/* Digitale Mietermappe — Klick-Demo · Gewobag-Stil (übernommen aus Prototyp v1) */

@font-face { font-family: "Museo Sans"; src: url("./assets/fonts/museo-sans-300-BpedHyas.woff2") format("woff2"); font-weight: 300; font-style: normal; font-display: swap; }
@font-face { font-family: "Museo Sans"; src: url("./assets/fonts/museo-sans-700-FtKqmE4X.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Museo"; src: url("./assets/fonts/museo-700-BPtMR2Ny.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }

:root {
  --ink: #202124;
  --muted: #667078;
  --line: #dfe3e5;
  --soft-line: #eaedef;
  --surface: #ffffff;
  --canvas: #f4f5f5;
  --brand: #e40046;
  --brand-dark: #bc0039;
  --cyan: #00a6c8;
  --process: #087f96;
  --process-soft: #e8f6f8;
  --process-line: #b9dfe6;
  --green: #13895c;
  --green-soft: #e8f5ef;
  --yellow: #ffd300;
  --warn-bg: #fffaf0;
  --warn-line: #eedba5;
  --warn-ink: #9d6b00;
  --shadow: 0 8px 28px rgba(32, 33, 36, 0.09);
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body { margin: 0; color: var(--ink); background: var(--canvas); font-family: "Museo Sans", Arial, sans-serif; font-weight: 300; -webkit-font-smoothing: antialiased; font-size: 14px; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, textarea:focus-visible { outline: 3px solid rgba(0,166,200,.3); outline-offset: 2px; }
mark { background: #fff3b8; padding: 0 2px; border-radius: 3px; }

/* ---------- Shell ---------- */
.app-shell { height: 100vh; display: flex; flex-direction: column; overflow: hidden; }

.topbar { height: 54px; flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 18px; background: var(--surface); border-bottom: 1px solid var(--line); z-index: 30; }
.brand-block { display: flex; align-items: center; gap: 12px; }
.brand-block img { height: 26px; object-fit: contain; }
.brand-divider { width: 1px; height: 26px; background: var(--line); }
.brand-text { display: flex; flex-direction: column; gap: 1px; }
.brand-text strong { font-family: "Museo", sans-serif; font-size: 15px; letter-spacing: -.1px; }
.brand-text span { color: var(--muted); font-size: 11px; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.demo-chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--warn-line); background: var(--warn-bg); color: var(--warn-ink); font-size: 11px; font-weight: 700; border-radius: 20px; padding: 5px 12px; white-space: nowrap; }
.profile { display: flex; align-items: center; gap: 9px; }
.profile .avatar { width: 30px; height: 30px; border-radius: 50%; color: #fff; background: var(--cyan); display: grid; place-items: center; font-size: 10px; font-weight: 700; }
.profile div { display: flex; flex-direction: column; }
.profile strong { font-size: 12px; }
.profile small { color: var(--muted); font-size: 10px; }

/* ---------- Stepper ---------- */
.stepper { flex: 0 0 auto; display: flex; align-items: stretch; background: var(--surface); border-bottom: 1px solid var(--line); padding: 0 18px; gap: 4px; overflow-x: auto; }
.step { display: flex; align-items: center; gap: 9px; padding: 11px 14px 9px; border: 0; background: transparent; border-bottom: 3px solid transparent; color: var(--muted); font-size: 12px; white-space: nowrap; }
.step .step-num { width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid #c3cacd; display: grid; place-items: center; font-size: 10px; font-weight: 700; }
.step.current { color: var(--ink); font-weight: 700; border-bottom-color: var(--brand); }
.step.current .step-num { border-color: var(--brand); background: var(--brand); color: #fff; }
.step.done { color: var(--green); }
.step.done .step-num { border-color: var(--green); background: var(--green-soft); color: var(--green); }
.step:disabled { cursor: default; }
.step:not(:disabled):hover { background: #f7f8f8; }
.step-arrow { align-self: center; color: #c3cacd; font-size: 12px; }

/* ---------- Screen layout ---------- */
.screens { flex: 1; min-height: 0; display: flex; }
.screen { display: none; flex: 1; min-width: 0; }
.screen.active { display: flex; }
.screen-inner { flex: 1; min-width: 0; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); }
.screen-inner.with-viewer { grid-template-columns: minmax(0, 1fr) 460px; }
.screen-main { min-width: 0; overflow-y: auto; padding: 18px 22px 60px; container-type: inline-size; }

/* Bricht die 2-Spalten-Raster um, sobald der Inhaltsbereich schmal wird
   (z. B. weil die Dokumentvorschau daneben geöffnet ist) */
@container (max-width: 940px) {
  .intake-grid, .overview-grid, .klage-grid, .final-grid { grid-template-columns: 1fr !important; }
  .field-row { grid-template-columns: 1fr auto; row-gap: 3px; }
  .field-row .field-label { grid-column: 1; grid-row: 1; }
  .field-row .chip-sap, .field-row .chip-manual { grid-column: 2; grid-row: 1; justify-self: end; }
  .field-row .field-value { grid-column: 1 / -1; grid-row: 2; }
  .summary-strip { grid-template-columns: repeat(2, 1fr); }
  .summary-strip > div { border-bottom: 1px solid var(--soft-line); }
}
.screen-main.narrow { max-width: 1180px; margin: 0 auto; width: 100%; }

/* ---------- Generic panels ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; }
.panel + .panel { margin-top: 12px; }
.panel-pad { padding: 16px 18px; }
.eyebrow { color: #6d767b; font-size: 10px; text-transform: uppercase; letter-spacing: 1.2px; font-weight: 700; }
h1.screen-title { font-family: "Museo", sans-serif; font-size: 24px; margin: 4px 0 4px; letter-spacing: -.4px; }
.screen-sub { color: var(--muted); font-size: 13px; margin: 0 0 16px; max-width: 860px; line-height: 1.5; }
.primary-button, .secondary-button, .ghost-button { height: 38px; border-radius: 7px; padding: 0 16px; font-size: 12.5px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; }
.primary-button { border: 1px solid var(--brand); background: var(--brand); color: #fff; }
.primary-button:hover { background: var(--brand-dark); }
.primary-button:disabled { background: #e9b7c5; border-color: #e9b7c5; cursor: not-allowed; }
.secondary-button { border: 1px solid #cfd5d8; background: #fff; }
.secondary-button:hover { background: #f7f8f8; }
.ghost-button { border: 0; background: transparent; color: var(--process); padding: 0 6px; height: auto; }
.ghost-button:hover { text-decoration: underline; }

/* ---------- Screen 1: Arbeitsvorrat ---------- */
.import-card { display: flex; align-items: center; gap: 16px; padding: 16px 18px; }
.import-card .xl-icon { width: 44px; height: 44px; border-radius: 9px; background: #e7f3ec; color: #1d6f42; display: grid; place-items: center; font-size: 20px; flex: 0 0 auto; }
.import-card .import-meta { flex: 1; min-width: 0; }
.import-card .import-meta strong { display: block; font-size: 14px; }
.import-card .import-meta span { color: var(--muted); font-size: 12px; }
.import-status { display: none; align-items: center; gap: 8px; color: var(--green); font-size: 12px; font-weight: 700; }
.import-status.visible { display: inline-flex; }

.worklist-wrap { margin-top: 12px; display: none; }
.worklist-wrap.visible { display: block; animation: fadeUp .35s ease; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.worklist-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px 10px; }
.worklist-head h2 { font-family: "Museo", sans-serif; font-size: 16px; margin: 0; }
.worklist-head span { color: var(--muted); font-size: 12px; }
table.worklist { width: 100%; border-collapse: collapse; font-size: 12.5px; }
table.worklist th { text-align: left; color: #768086; font-size: 10px; text-transform: uppercase; letter-spacing: .6px; font-weight: 700; padding: 8px 12px; border-top: 1px solid var(--soft-line); border-bottom: 1px solid var(--soft-line); background: #fafbfb; white-space: nowrap; }
table.worklist td { padding: 11px 12px; border-bottom: 1px solid var(--soft-line); vertical-align: middle; white-space: nowrap; }
table.worklist tr.selectable { cursor: pointer; }
table.worklist tr.selectable:hover { background: #f7fbfc; }
table.worklist tr.target { background: #fff5f8; box-shadow: inset 3px 0 0 var(--brand); }
table.worklist tr.done-row { color: #9aa2a7; }
table.worklist tr.done-row td { text-decoration: none; }
.prio-badge { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 6px; font-size: 11px; font-weight: 700; }
.prio-1 { background: #fdecef; color: var(--brand); }
.prio-2 { background: #fff4c9; color: #6e5b18; }
.prio-3 { background: #eef1f2; color: #5a646a; }
.pill { display: inline-flex; align-items: center; gap: 5px; border-radius: 12px; font-size: 10px; font-weight: 700; padding: 4px 9px; }
.pill.ready { background: var(--green-soft); color: #167d58; }
.pill.loading { background: #fff4c9; color: #6e5b18; }
.pill.done { background: #eef1f2; color: #767f85; }
.pill.target { background: var(--brand); color: #fff; }
.row-note { color: #8a9298; font-size: 10.5px; white-space: normal; }
.worklist-foot { display: flex; align-items: center; justify-content: space-between; padding: 12px 18px; color: var(--muted); font-size: 11.5px; }

/* ---------- Case header (screens 2–5) ---------- */
.case-header { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 14px 18px 14px; margin-bottom: 12px; }
.case-header-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.case-title h2 { font-family: "Museo", sans-serif; font-size: 22px; margin: 3px 0 3px; letter-spacing: -.3px; }
.case-title p { margin: 0; color: var(--muted); font-size: 12px; }
.title-status { display: inline-flex; align-items: center; gap: 6px; font-size: 10px; color: #187651; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; }
.status-dot { width: 7px; height: 7px; background: #20a26f; border-radius: 50%; box-shadow: 0 0 0 3px #dcf3e9; }
.case-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.summary-strip { display: grid; grid-template-columns: repeat(5, 1fr); border: 1px solid var(--line); border-radius: 9px; margin-top: 13px; overflow: hidden; background: #fff; }
.summary-strip > div { padding: 10px 14px; display: flex; flex-direction: column; border-right: 1px solid var(--soft-line); min-width: 0; }
.summary-strip > div:last-child { border-right: 0; }
.summary-strip span { color: #768086; font-size: 9px; text-transform: uppercase; letter-spacing: .6px; }
.summary-strip strong { font-size: 16px; margin: 3px 0 1px; white-space: nowrap; }
.summary-strip small { color: #81898e; font-size: 10px; }
.summary-strip .accent strong { color: var(--brand); }
.summary-strip .accent { background: #fff5f8; }
.deadline-banner { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border: 1px solid var(--warn-line); background: var(--warn-bg); border-radius: 9px; margin-bottom: 12px; }
.deadline-icon { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 7px; color: var(--warn-ink); background: #fff0c4; flex: 0 0 auto; }
.deadline-banner strong { font-size: 13px; display: block; }
.deadline-banner span { color: #7d6a2e; font-size: 11.5px; }

/* ---------- Screen 2: Fallübersicht ---------- */
.overview-grid { display: grid; grid-template-columns: 1.15fr 1fr; gap: 12px; align-items: start; }
.pipeline-list { display: flex; flex-direction: column; gap: 0; }
.pipeline-item { display: flex; gap: 12px; padding: 11px 4px; border-bottom: 1px solid var(--soft-line); font-size: 12.5px; line-height: 1.45; }
.pipeline-item:last-child { border-bottom: 0; }
.pipeline-item .pi-icon { flex: 0 0 auto; }
.finding { border: 1px solid var(--warn-line); background: var(--warn-bg); border-radius: 8px; padding: 11px 13px; margin-top: 9px; }
.finding strong { font-size: 12.5px; display: flex; align-items: center; gap: 7px; color: var(--warn-ink); }
.finding p { margin: 5px 0 7px; font-size: 12px; color: #5d554c; line-height: 1.45; }
.doclist { display: flex; flex-direction: column; }
.doc-row { display: flex; align-items: center; gap: 11px; padding: 10px 4px; border-bottom: 1px solid var(--soft-line); border-left: 0; background: transparent; border-top: 0; border-right: 0; text-align: left; width: 100%; }
.doc-row:last-child { border-bottom: 0; }
.doc-row:hover { background: #f7fbfc; }
.doc-row.active-doc { background: var(--process-soft); }
.doc-ico { width: 34px; height: 34px; border-radius: 7px; background: #fdecef; color: var(--brand); display: grid; place-items: center; font-size: 13px; font-weight: 700; flex: 0 0 auto; }
.doc-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.doc-meta strong { font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.doc-meta span { color: var(--muted); font-size: 10.5px; }
.doc-state { font-size: 9.5px; color: #167d58; background: var(--green-soft); border-radius: 10px; padding: 3px 8px; font-weight: 700; white-space: nowrap; }

/* ---------- Screen 3: Checkliste ---------- */
.check-progress { display: flex; align-items: center; gap: 14px; padding: 13px 18px; }
.check-progress .bar { flex: 1; height: 7px; background: #e8ebec; border-radius: 4px; overflow: hidden; }
.check-progress .bar i { display: block; height: 100%; width: 0; background: var(--green); border-radius: 4px; transition: width .3s ease; }
.check-progress span { font-size: 12px; color: var(--muted); white-space: nowrap; }
.check-card { border: 1px solid var(--line); border-radius: 10px; background: #fff; margin-top: 10px; overflow: hidden; }
.check-card.confirmed { border-color: #bfe3d2; }
.check-card.open-card { border-color: var(--process-line); box-shadow: 0 0 0 3px var(--process-ring, rgba(0,166,200,.14)); }
.check-head { width: 100%; border: 0; background: transparent; display: flex; align-items: center; gap: 12px; padding: 13px 16px; text-align: left; }
.check-num { width: 26px; height: 26px; border-radius: 50%; border: 1.5px solid #c3cacd; display: grid; place-items: center; font-size: 11px; font-weight: 700; color: var(--muted); flex: 0 0 auto; }
.check-card.confirmed .check-num { border-color: var(--green); background: var(--green); color: #fff; }
.check-head strong { flex: 1; font-size: 13.5px; }
.check-state-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: #9aa2a7; }
.check-card.confirmed .check-state-label { color: var(--green); }
.check-body { display: none; border-top: 1px solid var(--soft-line); padding: 13px 16px 15px; }
.check-card.open-card .check-body { display: block; }
.fact { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-bottom: 1px dashed var(--soft-line); font-size: 12.5px; line-height: 1.5; }
.fact:last-of-type { border-bottom: 0; }
.fact .fact-check { color: var(--green); flex: 0 0 auto; margin-top: 1px; }
.fact-text { flex: 1; }
.fact-edit-btn { flex: 0 0 auto; border: 1px solid transparent; background: transparent; color: #b3bcc1; border-radius: 6px; width: 26px; height: 26px; font-size: 12px; }
.fact:hover .fact-edit-btn { color: var(--process); border-color: var(--process-line); background: var(--process-soft); }
.fact-edited .fact-check { color: var(--warn-ink); }
.fact-orig { color: #9aa2a7; font-size: 11px; }
.edited-badge { display: block; margin-top: 4px; font-size: 10px; font-weight: 700; color: var(--warn-ink); background: var(--warn-bg); border: 1px solid var(--warn-line); border-radius: 10px; padding: 3px 9px; width: fit-content; }
.fact-editbox { margin: 6px 0 10px 26px; border: 1px solid var(--process-line); background: #f5fafb; border-radius: 8px; padding: 10px 12px; }
.fact-editbox textarea { width: 100%; min-height: 58px; border: 1px solid var(--line); border-radius: 7px; padding: 8px 10px; font-size: 12px; resize: vertical; background: #fff; }
.fact-editbox-foot { display: flex; align-items: center; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.fact-editbox-foot span { flex: 1; min-width: 200px; font-size: 10.5px; color: #3f545b; }
.src-chip { display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--process-line); background: var(--process-soft); color: var(--process); font-size: 10px; font-weight: 700; border-radius: 12px; padding: 3px 9px; margin-left: 7px; vertical-align: 2px; }
.src-chip:hover { background: #d8eef3; }
.check-hint { margin-top: 10px; border-left: 3px solid var(--cyan); background: #f5fafb; padding: 8px 12px; font-size: 11.5px; color: #3f545b; border-radius: 0 6px 6px 0; line-height: 1.45; }
.check-foot { display: flex; align-items: center; gap: 10px; margin-top: 13px; flex-wrap: wrap; }
.confirm-button { height: 34px; border-radius: 7px; border: 1px solid var(--green); background: var(--green); color: #fff; font-size: 12px; font-weight: 700; padding: 0 14px; display: inline-flex; align-items: center; gap: 7px; }
.confirm-button:hover { background: #0f7750; }
.confirm-button.is-confirmed { background: var(--green-soft); color: #167d58; border-color: #bfe3d2; cursor: default; }
.comment-toggle { height: 34px; border-radius: 7px; border: 1px dashed #cfd5d8; background: #fff; color: var(--muted); font-size: 11.5px; padding: 0 12px; display: inline-flex; align-items: center; gap: 6px; }
.comment-toggle:hover { border-color: var(--process); color: var(--process); }
.comment-toggle.has-comment { border-style: solid; border-color: var(--warn-line); background: var(--warn-bg); color: var(--warn-ink); }
.comment-box { display: none; margin-top: 10px; }
.comment-box.visible { display: block; }
.comment-box textarea { width: 100%; min-height: 64px; border: 1px solid var(--line); border-radius: 7px; padding: 9px 11px; font-size: 12px; resize: vertical; background: #fffdf5; }
.comment-box small { color: var(--muted); font-size: 10.5px; }

/* Merkmal-Picker */
.merkmal-row { display: flex; align-items: flex-start; gap: 11px; padding: 10px 0; border-bottom: 1px dashed var(--soft-line); }
.merkmal-row:last-child { border-bottom: 0; }
.merkmal-row input[type="checkbox"] { width: 17px; height: 17px; margin-top: 2px; accent-color: var(--brand); flex: 0 0 auto; }
.merkmal-main { flex: 1; min-width: 0; }
.merkmal-main strong { font-size: 12.5px; display: inline; }
.merkmal-gruppe { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .5px; display: block; margin-bottom: 2px; }
.wirkung { display: inline-block; font-size: 9.5px; font-weight: 700; border-radius: 10px; padding: 2px 8px; margin-left: 7px; vertical-align: 1px; }
.wirkung.positiv { background: var(--green-soft); color: #167d58; }
.wirkung.negativ { background: #fdecef; color: var(--brand); }
.erfahrung { margin: 5px 0 0; font-size: 11.5px; color: #5d6a70; line-height: 1.45; }
.erfahrung.warn { color: #8a6410; background: var(--warn-bg); border: 1px solid var(--warn-line); border-radius: 6px; padding: 6px 9px; }
.anlage-note { display: none; margin-top: 5px; font-size: 11px; color: var(--process); font-weight: 700; }
.anlage-note.visible { display: block; }

/* Review-Aktion (Schwärzung) */
.review-action { display: flex; align-items: center; gap: 12px; margin-top: 12px; padding: 11px 13px; border: 1px solid var(--line); border-radius: 8px; background: #fafbfb; flex-wrap: wrap; }
.review-status { font-size: 12px; font-weight: 700; color: var(--warn-ink); display: inline-flex; align-items: center; gap: 7px; }
.review-status.approved { color: var(--green); }

/* ---------- Screen 4: Klage & Anlagen ---------- */
.klage-grid { display: grid; grid-template-columns: 1.25fr 1fr; gap: 12px; align-items: start; }
.paper { background: #fff; border: 1px solid var(--line); border-radius: 4px; box-shadow: var(--shadow); padding: 34px 40px 30px; font-size: 12.5px; line-height: 1.6; }
.paper .paper-head { display: flex; justify-content: space-between; color: var(--muted); font-size: 10.5px; margin-bottom: 22px; }
.paper h3 { font-family: "Museo", sans-serif; font-size: 16px; margin: 0 0 4px; }
.paper .gericht { font-weight: 700; margin-bottom: 18px; white-space: pre-line; }
.paper .parteien { white-space: pre-line; margin-bottom: 16px; }
.paper .antrag-list { margin: 8px 0 16px; padding-left: 20px; }
.paper .antrag-list li { margin-bottom: 7px; }
.paper h4 { font-size: 12.5px; margin: 15px 0 4px; }
.paper .baustein { background: #f2f9fb; border-bottom: 1.5px dotted var(--cyan); }
.paper .signatur { margin-top: 26px; border-top: 1px solid var(--soft-line); padding-top: 12px; color: var(--muted); font-size: 11.5px; }
.anlage-block h4 { font-family: "Museo", sans-serif; font-size: 13.5px; margin: 0 0 8px; display: flex; align-items: center; gap: 8px; }
.anlage-item { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-bottom: 1px dashed var(--soft-line); font-size: 12px; line-height: 1.45; }
.anlage-item:last-child { border-bottom: 0; }
.anlage-k { flex: 0 0 34px; font-weight: 700; color: var(--brand); font-size: 11px; padding-top: 1px; }
.anlage-check { color: var(--green); flex: 0 0 auto; }

/* ---------- Screen 5: Abschluss ---------- */
.final-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 12px; align-items: start; }
.timeline { display: flex; flex-direction: column; }
.tl-item { display: flex; gap: 13px; padding: 9px 0; border-bottom: 1px dashed var(--soft-line); font-size: 12.5px; align-items: baseline; }
.tl-item:last-child { border-bottom: 0; }
.tl-time { flex: 0 0 52px; color: var(--muted); font-size: 11px; font-weight: 700; }
.done-banner { display: flex; align-items: center; gap: 13px; border: 1px solid #bfe3d2; background: var(--green-soft); border-radius: 10px; padding: 14px 16px; margin-bottom: 12px; }
.done-banner .done-ico { width: 38px; height: 38px; border-radius: 50%; background: var(--green); color: #fff; display: grid; place-items: center; font-size: 17px; flex: 0 0 auto; }
.done-banner strong { display: block; font-size: 14px; }
.done-banner span { color: #35695a; font-size: 12px; }
.note-item { border-left: 3px solid var(--warn-line); background: var(--warn-bg); border-radius: 0 7px 7px 0; padding: 8px 12px; margin-bottom: 8px; font-size: 12px; }
.note-item strong { display: block; font-size: 11px; color: var(--warn-ink); margin-bottom: 2px; }
.empty-notes { color: var(--muted); font-size: 12px; padding: 6px 0; }
.final-textarea { width: 100%; min-height: 74px; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; font-size: 12.5px; resize: vertical; margin-top: 8px; }

/* ---------- Doc viewer ---------- */
.doc-viewer { border-left: 1px solid var(--line); background: #eceff0; display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.viewer-head { background: var(--surface); border-bottom: 1px solid var(--line); padding: 10px 14px; display: flex; align-items: center; gap: 10px; }
.viewer-head .doc-ico { width: 30px; height: 30px; font-size: 11px; }
.viewer-title { flex: 1; min-width: 0; }
.viewer-title strong { display: block; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.viewer-title span { color: var(--muted); font-size: 10px; }
.viewer-tabs { display: flex; gap: 6px; padding: 8px 12px; background: var(--surface); border-bottom: 1px solid var(--line); overflow-x: auto; }
.vtab { border: 1px solid var(--line); background: #fff; border-radius: 6px; padding: 5px 10px; font-size: 10px; white-space: nowrap; color: var(--muted); }
.vtab.active { border-color: var(--brand); color: var(--brand); font-weight: 700; background: #fff5f8; }
.viewer-body { flex: 1; min-height: 0; overflow-y: auto; padding: 16px 16px 40px; }
.doc-paper { background: #fff; border-radius: 3px; box-shadow: 0 2px 14px rgba(0,0,0,.1); padding: 26px 28px; font-size: 12px; line-height: 1.6; }
.doc-paper + .doc-paper { margin-top: 14px; }
.doc-section { padding: 9px 0; border-bottom: 1px dashed #eef1f2; scroll-margin-top: 20px; border-radius: 6px; }
.doc-section:last-child { border-bottom: 0; }
.doc-section .sec-label { display: block; color: var(--muted); font-size: 9.5px; text-transform: uppercase; letter-spacing: .7px; font-weight: 700; margin-bottom: 3px; }
.doc-section.flash { animation: flashHl 2.2s ease; }
@keyframes flashHl { 0% { background: #fff3b8; box-shadow: 0 0 0 6px #fff3b8; } 100% { background: transparent; box-shadow: none; } }
.letterhead { font-size: 11px; color: var(--muted); border-bottom: 1px solid var(--soft-line); padding-bottom: 10px; margin-bottom: 4px; }
.letterhead .lh-betreff { color: var(--ink); font-weight: 700; font-size: 12.5px; margin-top: 7px; }
.redacted-block { background: repeating-linear-gradient(45deg, #2a2d2f, #2a2d2f 8px, #3a3e40 8px, #3a3e40 16px); color: #fff; border-radius: 4px; padding: 14px; font-size: 11px; }
.redacted-block mark { background: var(--yellow); color: #202124; }
.doc-table { width: 100%; border-collapse: collapse; font-size: 11.5px; margin-top: 4px; }
.doc-table th, .doc-table td { border: 1px solid var(--soft-line); padding: 6px 9px; text-align: left; }
.doc-table th { background: #fafbfb; font-size: 9.5px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); }
.mg-pos { color: #167d58; font-weight: 700; }
.mg-neg { color: var(--brand); font-weight: 700; }
.viewer-empty { flex: 1; display: grid; place-items: center; color: #9aa2a7; font-size: 12px; text-align: center; padding: 30px; }
.viewer-close { display: inline-flex; }
.viewer-seg { display: inline-flex; background: #eceff0; padding: 3px; border-radius: 7px; gap: 2px; flex: 0 0 auto; }
.viewer-seg button { border: 0; background: transparent; padding: 5px 11px; border-radius: 5px; font-size: 11px; cursor: pointer; color: var(--muted); }
.viewer-seg button.active { background: #fff; font-weight: 700; color: var(--ink); box-shadow: 0 1px 4px rgba(0,0,0,.08); }
.viewer-body.original-mode { padding: 0; display: flex; }
.pdf-frame { flex: 1; width: 100%; border: 0; background: #525659; min-height: 0; }
.orig-note { border: 1px solid var(--process-line); background: var(--process-soft); color: #3f545b; border-radius: 7px; padding: 9px 12px; font-size: 11.5px; line-height: 1.45; margin-bottom: 10px; }

/* ---------- Assistant ---------- */
.chat-fab { position: fixed; right: 22px; bottom: 22px; z-index: 60; height: 46px; border-radius: 24px; border: 1px solid var(--process); background: var(--process); color: #fff; font-weight: 700; font-size: 13px; padding: 0 18px; display: inline-flex; align-items: center; gap: 9px; box-shadow: var(--shadow); }
.chat-fab:hover { background: #076e82; }
.chat-drawer { position: fixed; right: 0; top: 0; bottom: 0; width: 400px; max-width: 92vw; background: #fff; border-left: 1px solid var(--line); box-shadow: -12px 0 32px rgba(0,0,0,.12); z-index: 70; transform: translateX(105%); transition: transform .25s ease; display: flex; flex-direction: column; }
.chat-drawer.open { transform: none; }
.chat-head { padding: 13px 16px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }
.chat-head .avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--process); color: #fff; display: grid; place-items: center; font-size: 13px; }
.chat-head strong { flex: 1; font-size: 13.5px; }
.chat-body { flex: 1; overflow-y: auto; padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.chat-msg { max-width: 88%; border-radius: 12px; padding: 10px 13px; font-size: 12.5px; line-height: 1.5; }
.chat-msg.user { align-self: flex-end; background: var(--process); color: #fff; border-bottom-right-radius: 4px; }
.chat-msg.bot { align-self: flex-start; background: #f2f4f5; border-bottom-left-radius: 4px; }
.chat-msg .src-chip { margin: 7px 0 0; }
.chat-suggest { padding: 10px 16px 16px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 7px; }
.chat-suggest span { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .6px; font-weight: 700; }
.chat-q { text-align: left; border: 1px solid var(--process-line); background: var(--process-soft); color: var(--process); border-radius: 8px; padding: 8px 12px; font-size: 12px; }
.chat-q:hover { background: #d8eef3; }
.chat-q:disabled { opacity: .45; cursor: default; }
.typing { display: inline-flex; gap: 4px; padding: 4px 2px; }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: #9aa2a7; animation: blink 1s infinite; }
.typing i:nth-child(2) { animation-delay: .18s; }
.typing i:nth-child(3) { animation-delay: .36s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }

/* ---------- Toast ---------- */
.toast { position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 20px); background: #202124; color: #fff; border-radius: 9px; padding: 11px 18px; font-size: 12.5px; opacity: 0; pointer-events: none; transition: all .25s ease; z-index: 90; max-width: 90vw; text-align: center; }
.toast.visible { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Next-step bar (statisch am Ende des Inhalts, kein Schweben) ---------- */
.next-bar { margin-top: 20px; padding: 14px 0 4px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 10px; }

/* ---------- Arbeitsmodi: Laptop · Homeoffice · 34″ Widescreen ---------- */
.mode-switch { display: inline-flex; background: #eceff0; padding: 3px; border-radius: 8px; gap: 2px; }
.mode-switch button { border: 0; background: transparent; padding: 7px 12px; border-radius: 6px; font-size: 11.5px; cursor: pointer; color: var(--muted); white-space: nowrap; }
.mode-switch button.active { background: #fff; font-weight: 700; color: var(--ink); box-shadow: 0 1px 4px rgba(0,0,0,.08); }

/* Homeoffice: Viewer klappt automatisch aus, sobald ein Dokument geöffnet ist (460px, ziehbar) */
body.mode-home .screen-inner.with-viewer { grid-template-columns: minmax(0, 1fr); }
body.mode-home .screen-inner.with-viewer .doc-viewer { display: none; }
body.mode-home .screen-inner.with-viewer.viewer-active { grid-template-columns: minmax(0, 1fr) var(--viewer-w, 460px); }
body.mode-home .screen-inner.with-viewer.viewer-active .doc-viewer { display: flex; }

/* 34″ Widescreen: Inhalte auf lesbare Breite zentriert — Dokumentbereich klappt
   automatisch breit aus (~38 %), sobald ein Dokument angezeigt wird */
body.mode-wide .screen-inner.with-viewer { grid-template-columns: minmax(0, 1fr); }
body.mode-wide .screen-inner.with-viewer .doc-viewer { display: none; }
body.mode-wide .screen-inner.with-viewer.viewer-active { grid-template-columns: minmax(0, 1fr) var(--viewer-w, minmax(640px, 38%)); }
body.mode-wide .screen-inner.with-viewer.viewer-active .doc-viewer { display: flex; }
body.mode-wide .screen-main { padding: 18px 30px 60px; }
body.mode-wide .screen-main > * { max-width: 1400px; margin-left: auto; margin-right: auto; }
body.mode-wide .doc-paper { padding: 36px 42px; font-size: 13px; max-width: 1080px; margin: 0 auto; }
body.mode-wide .viewer-body { padding: 20px 24px 48px; }
body.mode-wide .chat-drawer { width: 460px; }
body.mode-wide .check-head strong { font-size: 14.5px; }
body.mode-wide .fact { font-size: 13px; }

/* Laptop: Viewer als Overlay, kompaktere Flächen */
body.mode-laptop .screen-inner.with-viewer { grid-template-columns: minmax(0, 1fr); }
body.mode-laptop .doc-viewer { position: fixed; top: 54px; right: 0; bottom: 0; width: var(--viewer-w, min(480px, 94vw)); max-width: 96vw; z-index: 50; transform: translateX(105%); transition: transform .25s ease; box-shadow: -12px 0 32px rgba(0,0,0,.14); border-left: 1px solid var(--line); }
body.mode-laptop .doc-viewer.open { transform: none; }
body.mode-laptop .viewer-close { display: inline-flex; }
body.mode-laptop .overview-grid, body.mode-laptop .klage-grid, body.mode-laptop .final-grid { grid-template-columns: 1fr; }
body.mode-laptop .screen-main { padding: 14px 16px 60px; }
body.mode-laptop .case-title h2 { font-size: 20px; }
body.mode-laptop .summary-strip strong { font-size: 14px; }

@media (max-width: 900px) {
  .summary-strip { grid-template-columns: repeat(2, 1fr); }
  .summary-strip > div { border-bottom: 1px solid var(--soft-line); }
  .brand-text span { display: none; }
  .mode-switch { display: none; }
}

/* ---------- Startbildschirm (Moduswahl) ---------- */
body.on-start .stepper { display: none; }
.start-layout { display: grid; gap: 26px; align-content: center; min-height: 100%; padding: 20px 0 40px; }
.start-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; max-width: 980px; margin: 0 auto; width: 100%; }
.start-card { text-align: left; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 26px 26px 22px; display: grid; gap: 9px; align-content: start; cursor: pointer; transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease; }
.start-card:hover { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand), var(--shadow); transform: translateY(-2px); }
.start-ico { font-size: 30px; }
.start-card strong { font-family: "Museo", sans-serif; font-size: 21px; letter-spacing: -.2px; }
.start-role { color: var(--process); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .7px; }
.start-desc { color: var(--muted); font-size: 13px; line-height: 1.5; }
.start-cta { margin-top: 8px; color: var(--brand); font-weight: 700; font-size: 13px; }
body.mode-laptop .start-grid { grid-template-columns: 1fr; max-width: 640px; }

/* ---------- Schritt 0: Fallaufnahme ---------- */
.intake-search { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 10px; }
.intake-search input { flex: 1; min-width: 260px; height: 40px; border: 1px solid var(--line); border-radius: 7px; padding: 0 13px; font-size: 13.5px; background: #fff; }
.intake-search input:disabled { background: #f6f7f7; color: var(--muted); }
.intake-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 12px; align-items: start; margin-top: 12px; }
body.mode-laptop .intake-grid { grid-template-columns: 1fr; }
.field-list { display: grid; }
.field-row { display: grid; grid-template-columns: 190px 1fr auto; gap: 12px; align-items: center; padding: 8px 0; border-bottom: 1px dashed var(--soft-line); }
.field-row:last-child { border-bottom: 0; }
.field-label { color: var(--muted); font-size: 11.5px; }
.field-value { font-size: 13px; font-weight: 700; min-width: 0; }
.field-value select, .field-value input { width: 100%; height: 34px; border: 1px solid var(--line); border-radius: 6px; padding: 0 9px; font-size: 12.5px; font-weight: 300; background: #fffdf5; }
.chip-sap { display: inline-flex; align-items: center; border: 1px solid #bfe3d2; background: var(--green-soft); color: #167d58; font-size: 9.5px; font-weight: 700; border-radius: 10px; padding: 3px 8px; white-space: nowrap; }
.chip-manual { display: inline-flex; align-items: center; border: 1px solid var(--warn-line); background: var(--warn-bg); color: var(--warn-ink); font-size: 9.5px; font-weight: 700; border-radius: 10px; padding: 3px 8px; white-space: nowrap; }
.missing-row { display: flex; gap: 11px; align-items: center; padding: 9px 0; border-bottom: 1px dashed var(--soft-line); }
.missing-row:last-child { border-bottom: 0; }
.missing-ico { width: 26px; height: 26px; border-radius: 50%; background: var(--warn-bg); border: 1px solid var(--warn-line); color: var(--warn-ink); display: grid; place-items: center; font-size: 13px; font-weight: 700; flex: 0 0 auto; }
.missing-text { flex: 1; min-width: 0; font-size: 12.5px; line-height: 1.4; }
.missing-text > span > span { color: var(--muted); font-size: 11.5px; }
.scan-assign { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 8px; padding: 9px 11px; border: 1px dashed var(--warn-line); background: var(--warn-bg); border-radius: 7px; }
.scan-assign select { flex: 1; min-width: 220px; height: 32px; border: 1px solid var(--line); border-radius: 6px; padding: 0 8px; font-size: 12px; background: #fff; }
.note-block { margin-top: 12px; border-top: 1px solid var(--soft-line); padding-top: 12px; }
.note-block-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.note-block textarea { width: 100%; min-height: 96px; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; font-size: 13px; line-height: 1.5; resize: vertical; background: #fffdf5; }
.voice-row { display: flex; align-items: center; gap: 12px; margin-top: 9px; flex-wrap: wrap; }
.voice-btn { height: 36px; border-radius: 18px; border: 1px solid var(--process); background: #fff; color: var(--process); font-size: 12.5px; font-weight: 700; padding: 0 16px; display: inline-flex; align-items: center; gap: 7px; }
.voice-btn:hover { background: var(--process-soft); }
.voice-btn.recording { border-color: var(--brand); background: #fff5f8; color: var(--brand); animation: voicePulse 1.1s ease-in-out infinite; }
@keyframes voicePulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(228, 0, 70, .25); } 50% { box-shadow: 0 0 0 7px rgba(228, 0, 70, 0); } }
.voice-hint { color: var(--muted); font-size: 11px; }

/* ---------- Kompletter Mappen-Browser ---------- */
.mappe-folder { border: 1px solid var(--soft-line); border-radius: 8px; margin-top: 7px; background: #fff; overflow: hidden; }
.mappe-folder summary { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 13px; cursor: pointer; font-size: 12.5px; font-weight: 700; }
.mappe-folder summary::-webkit-details-marker { display: none; }
.mappe-folder summary:hover { background: #f7fbfc; }
.mappe-folder[open] summary { border-bottom: 1px solid var(--soft-line); background: #fafbfb; }
.mappe-count { color: var(--muted); font-size: 10.5px; font-weight: 300; white-space: nowrap; }
.mappe-files { max-height: 300px; overflow-y: auto; scrollbar-width: thin; }
.file-row { width: 100%; display: flex; align-items: center; gap: 10px; padding: 7px 12px; border: 0; border-bottom: 1px solid #f2f4f5; background: transparent; text-align: left; }
.file-row:last-child { border-bottom: 0; }
.file-row:hover { background: var(--process-soft); }
.file-ico { flex: 0 0 auto; width: 30px; height: 22px; border-radius: 4px; display: grid; place-items: center; font-size: 8.5px; font-weight: 700; background: #fdecef; color: var(--brand); }
.file-ico.img { background: #e8f5ef; color: #167d58; }
.file-ico.msg { background: #eef1f2; color: #5a646a; }
.file-ico.csv, .file-ico.other { background: #eef1f2; color: #8a9298; }
.file-name { flex: 1; min-width: 0; font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-sub { display: block; color: #9aa2a7; font-size: 9.5px; }
.file-open { color: var(--process); font-size: 10px; font-weight: 700; white-space: nowrap; }

/* Bild-Vorschau im Viewer */
.img-wrap { flex: 1; overflow: auto; display: grid; place-items: start center; background: #3c4043; padding: 18px; }
.img-frame { max-width: 100%; height: auto; box-shadow: 0 2px 14px rgba(0,0,0,.35); border-radius: 3px; }

/* ---------- Viewer: Resize-Griff & Split-Screen ---------- */
.doc-viewer { position: relative; }

/* Vollbildmodus der Dokumentansicht */
.doc-viewer.fullscreen { position: fixed !important; inset: 0 !important; z-index: 85; width: auto !important; max-width: none !important; transform: none !important; display: flex !important; border-left: 0; box-shadow: none; }
.doc-viewer.fullscreen .viewer-resize { display: none; }
.doc-viewer.fullscreen .doc-paper { max-width: 1080px; margin: 0 auto; }
.viewer-resize { position: absolute; left: -4px; top: 0; bottom: 0; width: 9px; cursor: col-resize; z-index: 8; }
.viewer-resize:hover { background: rgba(0, 166, 200, .30); }
body.resizing { cursor: col-resize; user-select: none; }
body.resizing iframe { pointer-events: none; }
.viewer-body.split { display: grid; grid-template-columns: 1fr 1fr; padding: 0; overflow: hidden; }
.pane { display: flex; flex-direction: column; min-width: 0; min-height: 0; border-left: 1px solid var(--line); }
.pane:first-child { border-left: 0; }
.pane-head { display: flex; align-items: center; gap: 8px; padding: 8px 10px; background: var(--surface); border-bottom: 1px solid var(--line); flex: 0 0 auto; }
.pane-select { flex: 1; min-width: 0; height: 32px; border: 1px solid var(--line); border-radius: 6px; padding: 0 8px; font-size: 12px; background: #fff; }
.viewer-seg-sm button { padding: 4px 9px; font-size: 10px; }
.pane .pdf-frame { flex: 1; }
.pane-scroll { flex: 1; overflow-y: auto; padding: 14px; background: #eceff0; }
.pane .viewer-empty { background: #eceff0; }

/* ---------- Volltextsuche im Viewer ---------- */
.viewer-search { position: relative; display: flex; gap: 8px; align-items: center; padding: 8px 12px; background: var(--surface); border-bottom: 1px solid var(--line); flex: 0 0 auto; }
.viewer-search input { flex: 1; min-width: 0; height: 32px; border: 1px solid var(--line); border-radius: 7px; padding: 0 11px; font-size: 12px; background: #f8f9f9; }
.viewer-search input:focus { background: #fff; }
.search-results { position: absolute; left: 12px; right: 12px; top: 44px; z-index: 20; background: #fff; border: 1px solid var(--line); border-radius: 9px; box-shadow: var(--shadow); max-height: 340px; overflow-y: auto; padding: 6px; }
.search-group { color: var(--muted); font-size: 9.5px; text-transform: uppercase; letter-spacing: .7px; font-weight: 700; padding: 7px 8px 4px; }
.search-hit { width: 100%; text-align: left; border: 0; background: transparent; border-radius: 6px; padding: 7px 9px; display: grid; gap: 2px; }
.search-hit:hover { background: var(--process-soft); }
.search-hit strong { font-size: 11.5px; }
.search-hit span { font-size: 11px; color: var(--muted); line-height: 1.35; }
.search-empty { padding: 12px; font-size: 11.5px; color: var(--muted); }

/* ---------- Assistent: Kontext & Freitext ---------- */
.chat-context { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding-bottom: 4px; }
.ctx-label { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .6px; font-weight: 700; }
.ctx-chip { border: 1px solid var(--line); background: #fff; color: var(--muted); border-radius: 14px; padding: 5px 11px; font-size: 11px; }
.ctx-chip.active { border-color: var(--process); background: var(--process-soft); color: var(--process); font-weight: 700; }
.ctx-chip:disabled { opacity: .5; cursor: default; }
.chat-inputrow { display: flex; gap: 8px; padding: 10px 16px 14px; border-top: 1px solid var(--line); }
.chat-inputrow input { flex: 1; min-width: 0; height: 38px; border: 1px solid var(--line); border-radius: 19px; padding: 0 14px; font-size: 12.5px; background: #f8f9f9; }
.chat-inputrow input:focus { background: #fff; }
.chat-inputrow button { width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--process); background: var(--process); color: #fff; font-size: 14px; }
.chat-inputrow button:hover { background: #076e82; }

/* ---------- Druck: Übergabeblatt Fallaufnahme ---------- */
#print-sheet { display: none; }
@media print {
  .app-shell, .chat-drawer, .chat-fab, .toast, .controls { display: none !important; }
  body { background: #fff; }
  #print-sheet { display: block; color: #111; font-size: 11pt; line-height: 1.45; }
  #print-sheet .ps-head { display: flex; align-items: center; gap: 14px; border-bottom: 2px solid #111; padding-bottom: 10px; margin-bottom: 14px; }
  #print-sheet .ps-head img { height: 34px; }
  #print-sheet .ps-head strong { display: block; font-size: 14pt; }
  #print-sheet .ps-head span { font-size: 9pt; color: #444; }
  #print-sheet h2 { font-size: 11pt; margin: 14px 0 6px; border-bottom: 1px solid #999; padding-bottom: 3px; }
  #print-sheet .ps-table { width: 100%; border-collapse: collapse; }
  #print-sheet .ps-table td { border-bottom: 1px solid #ddd; padding: 4px 8px 4px 0; vertical-align: top; font-size: 10pt; }
  #print-sheet .ps-table td:first-child { width: 32%; color: #444; }
  #print-sheet .ps-src { color: #666; font-size: 8.5pt; white-space: nowrap; }
  #print-sheet .ps-note { border-left: 3px solid #999; padding-left: 10px; font-size: 10pt; }
  #print-sheet .ps-sign { display: flex; gap: 40px; margin-top: 34px; }
  #print-sheet .ps-sign > div { flex: 1; font-size: 9pt; color: #444; }
  #print-sheet .ps-sign span { display: block; margin-bottom: 26px; }
  #print-sheet .ps-sign i { display: block; border-top: 1px solid #111; margin-bottom: 4px; }
  #print-sheet .ps-foot { margin-top: 22px; padding-top: 8px; border-top: 1px solid #999; font-size: 8pt; color: #666; }
}

/* ---------- Zahlungscheck, Historien, „gezahlt"-Zeile ---------- */
.pill.paid { background: #13895c; color: #fff; }
tr.paid-row { background: #f0faf4; box-shadow: inset 3px 0 0 var(--green); }
.row-note-paid { color: #167d58; font-weight: 700; }
.zahlung-banner { display: flex; align-items: flex-start; gap: 12px; padding: 11px 14px; border-radius: 9px; margin-bottom: 12px; border: 1px solid; }
.zahlung-banner.nein { border-color: #f1b9c8; background: #fff4f7; }
.zahlung-banner.ja { border-color: #bfe3d2; background: var(--green-soft); }
.zahlung-ico { width: 34px; height: 34px; border-radius: 7px; display: grid; place-items: center; font-weight: 700; font-size: 15px; flex: 0 0 auto; }
.zahlung-banner.nein .zahlung-ico { background: #fde0e8; color: var(--brand); }
.zahlung-banner.ja .zahlung-ico { background: #cfeedd; color: #167d58; }
.zahlung-body { flex: 1; min-width: 0; }
.zahlung-body strong { display: block; font-size: 13px; }
.zahlung-banner.nein .zahlung-body strong { color: #9a1b3f; }
.zahlung-banner.ja .zahlung-body strong { color: #167d58; }
.zahlung-body span { font-size: 11.5px; color: #5d5058; line-height: 1.45; }
.check-body .zahlung-banner { margin: 10px 0 4px; }

.history-grid { display: grid; grid-template-columns: 1.15fr 1fr 1fr; gap: 12px; align-items: start; margin-bottom: 12px; }
@container (max-width: 1240px) { .history-grid { grid-template-columns: 1fr 1fr; } }
@container (max-width: 940px) { .history-grid { grid-template-columns: 1fr; } }
.hist-table { width: 100%; border-collapse: collapse; font-size: 12px; margin-top: 8px; }
.hist-table th { text-align: left; color: #768086; font-size: 9.5px; text-transform: uppercase; letter-spacing: .6px; padding: 6px 6px; border-bottom: 1px solid var(--soft-line); }
.hist-table td { padding: 8px 6px; border-bottom: 1px dashed var(--soft-line); vertical-align: top; line-height: 1.4; }
.hist-table tr:last-child td { border-bottom: 0; }
.hist-table tr.hist-offen td { background: #fff5f8; }
.hist-tag { display: inline-block; border-radius: 10px; font-size: 9.5px; font-weight: 700; padding: 2px 7px; margin-left: 4px; }
.hist-tag.offen { background: #fdecef; color: var(--brand); }
.hist-tag.ok { background: var(--green-soft); color: #167d58; }
.chain { display: flex; flex-direction: column; margin-top: 8px; }
.chain-item { display: flex; gap: 11px; padding: 6px 0 12px; position: relative; }
.chain-item::before { content: ""; position: absolute; left: 5px; top: 18px; bottom: -4px; width: 1.5px; background: var(--line); }
.chain-item:last-child::before { display: none; }
.chain-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--process); border: 2px solid #fff; box-shadow: 0 0 0 1.5px var(--process); flex: 0 0 auto; margin-top: 5px; z-index: 1; }
.chain-item > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.chain-date { color: var(--muted); font-size: 10.5px; text-transform: uppercase; letter-spacing: .4px; }
.chain-item strong { font-size: 12.5px; line-height: 1.35; }
.chain-src { color: var(--muted); font-size: 11px; }
.chain-verdict { margin-top: 4px; border-radius: 7px; padding: 8px 11px; font-size: 12px; font-weight: 700; }
.chain-verdict.ok { background: var(--green-soft); color: #167d58; }
.chain-verdict.warn { background: var(--warn-bg); color: var(--warn-ink); border: 1px solid var(--warn-line); }
.claims-list { display: flex; flex-direction: column; margin-top: 8px; }
.claims-item { display: flex; gap: 12px; padding: 8px 0; border-bottom: 1px dashed var(--soft-line); }
.claims-item:last-child { border-bottom: 0; }
.claims-year { flex: 0 0 52px; font-weight: 700; font-size: 12px; color: var(--process); padding-top: 1px; }
.claims-item > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.claims-item strong { font-size: 12.5px; line-height: 1.35; }
.claims-item > div > span { font-size: 11.5px; color: #5d6a70; line-height: 1.4; }
.hist-details { margin-top: 10px; border: 1px solid var(--soft-line); border-radius: 8px; padding: 0 12px 10px; background: #fafbfb; }
.hist-details summary { cursor: pointer; font-size: 12px; font-weight: 700; color: var(--process); padding: 9px 0; list-style: none; }
.hist-details summary::-webkit-details-marker { display: none; }
.hist-details summary::before { content: "▸ "; }
.hist-details[open] summary::before { content: "▾ "; }

.hist-table .src-chip, .chain-src .src-chip, .claims-item .src-chip { white-space: nowrap; }

/* ---------- Claiming im Arbeitsvorrat ---------- */
.worklist-head { align-items: flex-start; gap: 14px; flex-wrap: wrap; }
.worklist-tools { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.team-legend { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.claim-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; color: var(--ink); white-space: nowrap; }
.claim-chip small { color: var(--muted); font-size: 9.5px; margin-left: 2px; }
.claim-chip.mine { font-weight: 700; }
.claim-avatar { width: 22px; height: 22px; border-radius: 50%; color: #fff; display: inline-grid; place-items: center; font-size: 8.5px; font-weight: 700; font-style: normal; flex: 0 0 auto; }
.claim-btn { height: 28px; border-radius: 14px; border: 1px dashed var(--process); background: #fff; color: var(--process); font-size: 11px; font-weight: 700; padding: 0 11px; white-space: nowrap; }
.claim-btn:hover { background: var(--process-soft); }
.seg-filter button { font-size: 11px; padding: 5px 10px; }

/* ---------- Prüfklassen & Sammelbestätigung ---------- */
.klasse-badge { display: inline-flex; align-items: center; border-radius: 10px; font-size: 9.5px; font-weight: 700; padding: 3px 8px; white-space: nowrap; }
.klasse-badge.pflicht { background: #fdecef; color: var(--brand); }
.klasse-badge.stichprobe { background: var(--process-soft); color: var(--process); }
.check-head .klasse-badge { margin-right: 10px; }
.sammel-panel { padding: 14px 18px; margin-top: 10px; border-color: var(--process-line); }
.sammel-panel.done { border-color: #bfe3d2; background: #f6fbf8; }
.sammel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.sammel-head > div { flex: 1; min-width: 280px; display: flex; flex-direction: column; gap: 4px; }
.sammel-head strong { font-size: 13.5px; }
.sammel-sub { color: var(--muted); font-size: 11.5px; line-height: 1.45; }
.sammel-ok { display: flex; flex-direction: column; gap: 2px; color: #167d58; font-weight: 700; font-size: 12.5px; text-align: right; }
.sammel-ok small { color: var(--muted); font-weight: 300; font-size: 10.5px; }
.sammel-steps { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--soft-line); }
.sammel-note { color: var(--muted); font-size: 11px; margin-left: 4px; }
.fact.fact-warn { background: var(--warn-bg); border: 1px solid var(--warn-line); border-radius: 7px; padding: 8px 10px; margin: 6px 0; }
.fact.fact-warn .fact-check { color: var(--warn-ink); }

/* ---------- Entscheidung Vertragsparteien ---------- */
.decision-block { margin-top: 12px; border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; background: #fff; display: flex; flex-direction: column; gap: 8px; }
.decision-title { font-size: 10px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); font-weight: 700; }
.decision-opt { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border: 1px solid var(--soft-line); border-radius: 7px; cursor: pointer; font-size: 12px; line-height: 1.45; }
.decision-opt.active { border-color: var(--green); background: var(--green-soft); }
.decision-opt input { margin-top: 3px; accent-color: var(--green); }

/* Arbeitsvorrat: mehr Breite für 11 Spalten, sonst horizontal scrollbar statt Abschneiden */
#screen-1 .screen-main.narrow { max-width: 1440px; }
.worklist-wrap { overflow-x: auto; }
table.worklist { min-width: 1160px; }
table.worklist td:nth-child(3) { min-width: 230px; white-space: normal; }
table.worklist .claim-chip { flex-wrap: wrap; max-width: 150px; }
table.worklist .claim-chip small { display: block; width: 100%; padding-left: 28px; margin: -2px 0 0; }
