/* Information Center v3.5 – Apple-Stil: iOS-Grau, weisse Listen, Arvengrün als Akzent */
:root {
  --bg: #F2F2F7;         /* iOS gruppierter Hintergrund */
  --card: #FFFFFF;
  --ink: #000000;
  --muted: #6C6C70;
  --tertiary: #8A8A8E;
  --surface: rgba(118,118,128,.12);
  --line: #C6C6C8;
  --line-strong: #C6C6C8;
  --accent: #1E6B47;     /* Arve */
  --accent-soft: #E3EEE7;
  --accent-ink: #D5E4DB;
  --danger: #FF3B30;
  --danger-ink: #D70015;
  --danger-soft: #FFE5E3;
  --warn: #FF9500;
  --warn-ink: #C25E00;
  --warn-soft: #FFF2DF;
  --ok: #34C759;
  --radius: 12px;
  --gutter: 16px;
  --font: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'SF Pro', 'Helvetica Neue', 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 16px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
main, .topbar { max-width: 560px; margin: 0 auto; }
main { padding: 0 var(--gutter) 40px; min-height: calc(100dvh - 64px); display: flex; flex-direction: column; }
a { color: var(--accent); }
svg { width: 24px; height: 24px; flex-shrink: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }

/* Kopfzeile */
.topbar { display: flex; justify-content: space-between; align-items: center; padding: 16px var(--gutter) 0; }
.brand { font-weight: 700; font-size: 15px; letter-spacing: .02em; color: var(--ink); text-decoration: none; }
.topbar nav { display: flex; gap: 18px; align-items: center; }
.topbar nav a { color: var(--muted); font-weight: 500; font-size: 15px; text-decoration: none; }
.avatar { width: 32px; height: 32px; border-radius: 16px; background: var(--surface); display: grid; place-items: center; color: var(--accent) !important; }
.avatar svg { width: 16px; height: 16px; }

/* Titel */
.page-head { padding: 36px 0 24px; display: flex; flex-direction: column; gap: 8px; }
h1 { font-size: 40px; line-height: 42px; font-weight: 800; letter-spacing: -.03em; margin: 0; }
.lead { margin: 0; color: var(--muted); }
h2 { font-size: 19px; font-weight: 800; margin: 0 0 12px; }

.flash { background: var(--surface); color: var(--ink); border-radius: 14px; padding: 12px 16px; margin-top: 16px; font-weight: 500; }

/* Buttons */
.btn {
  flex-direction: row;
  display: flex; align-items: center; justify-content: center; gap: 12px;
  min-height: 64px; border-radius: 32px; padding: 0 24px; width: 100%;
  font: 700 17px var(--font); cursor: pointer; border: 1.5px solid var(--ink);
  -webkit-tap-highlight-color: transparent; transition: transform .1s ease;
  text-decoration: none; white-space: nowrap;
}
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--ink); color: #fff; }
.btn-ghost { background: transparent; color: var(--ink); }
.btn-accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-small { min-height: 44px; font-size: 15px; width: auto; align-self: flex-start; }
.btn:disabled { opacity: .6; }
.link { background: none; border: 0; padding: 0; font: 600 15px var(--font); color: var(--accent); cursor: pointer; }
.link.danger { color: var(--danger); }
.stack { display: flex; flex-direction: column; gap: 12px; }

/* Formulare */
label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: 14px; color: var(--muted); }
input:not([type=radio]):not([type=checkbox]):not([type=file]), textarea, select {
  font: 400 16px/1.4 var(--font); color: var(--ink); background: var(--bg);
  border: 1.5px solid var(--line-strong); border-radius: 14px; padding: 12px 14px; width: 100%;
}
input:focus, textarea:focus, select:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.mono { font-family: ui-monospace, 'SF Mono', Menlo, monospace !important; font-size: 15px !important; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.card-narrow, .narrow { max-width: 400px; width: 100%; margin: 40px auto 0; display: flex; flex-direction: column; gap: 16px; }
.narrow form { display: flex; flex-direction: column; gap: 16px; }
.error { color: var(--danger); font-weight: 600; margin: 0; }

/* Upload */
.upload { display: flex; flex-direction: column; gap: 20px; flex: 1; }
.apps { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 12px; }
.app-option {
  display: flex; flex-direction: row; align-items: center; gap: 16px; padding: 20px;
  border-radius: var(--radius); background: var(--surface); cursor: pointer; color: var(--ink);
  transition: background .15s ease;
}
.app-option input { position: absolute; opacity: 0; pointer-events: none; }
.app-icon { color: var(--accent); display: flex; }
.app-icon svg { width: 28px; height: 28px; }
.app-text { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.app-text strong { font-size: 19px; font-weight: 800; }
.app-text small { font-size: 14px; line-height: 20px; color: var(--muted); font-weight: 400; }
.radio { width: 24px; height: 24px; border-radius: 12px; border: 2px solid var(--accent-soft); flex-shrink: 0; display: grid; place-items: center; }
.app-option:has(input:checked) { background: var(--accent); }
.app-option:has(input:checked) .app-icon, .app-option:has(input:checked) .app-text strong { color: #fff; }
.app-option:has(input:checked) .app-text small { color: var(--accent-ink); }
.app-option:has(input:checked) .radio { background: #fff; border-color: #fff; }
.app-option:has(input:checked) .radio::after { content: ''; width: 10px; height: 10px; border-radius: 5px; background: var(--accent); }
.app-option:has(input:focus-visible) { outline: 2px solid var(--ink); outline-offset: 2px; }

.pages, .text-panel { display: flex; flex-direction: column; gap: 10px; }
.pages-head { display: flex; justify-content: space-between; align-items: baseline; }
.pages ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.pages li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.pages img, .file-badge { width: 44px; height: 44px; border-radius: 10px; object-fit: cover; background: var(--surface); flex-shrink: 0; }
.file-badge { display: grid; place-items: center; font-size: 12px; font-weight: 800; color: var(--accent); }
.file-name { flex: 1; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.remove { border: 0; background: none; font-size: 24px; color: var(--muted); width: 44px; height: 44px; cursor: pointer; }
.text-panel textarea { min-height: 200px; }

.note-field summary { color: var(--accent); font-weight: 600; font-size: 15px; cursor: pointer; list-style: none; }
.note-field summary::-webkit-details-marker { display: none; }
.note-field textarea { margin-top: 10px; }

.actions-bottom { margin-top: auto; display: flex; flex-direction: column; gap: 12px; padding-top: 12px; }
.hint { text-align: center; color: var(--muted); font-size: 14px; margin: 4px 0 0; }

/* Archiv */
.search { display: flex; align-items: center; gap: 10px; height: 52px; padding: 0 18px; border-radius: 26px; background: var(--surface); margin-top: 12px; color: var(--muted); }
.search svg { width: 20px; height: 20px; }
.search input { border: 0 !important; background: transparent !important; padding: 0 !important; outline: none !important; flex: 1; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding-top: 12px; scrollbar-width: none; }
.chip { padding: 8px 16px; border-radius: 18px; border: 1.5px solid var(--line-strong); font-size: 14px; font-weight: 600; color: var(--ink); text-decoration: none; white-space: nowrap; }
.chip.active { background: var(--ink); border-color: var(--ink); color: #fff; font-weight: 700; }

.doc-list { list-style: none; margin: 0; padding: 0; }
.doc-list .group { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 20px 0 4px; }
.row { display: flex; align-items: center; gap: 14px; padding: 16px 0; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--ink); }
.row-icon { width: 44px; height: 44px; border-radius: 12px; background: var(--surface); display: grid; place-items: center; color: var(--accent); flex-shrink: 0; }
.row-icon svg { width: 22px; height: 22px; }
.row-main { display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 0; }
.row-main strong { font-size: 16px; line-height: 22px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-main small { font-size: 14px; color: var(--muted); }
.row-end { width: 84px; display: flex; justify-content: flex-end; flex-shrink: 0; }
.amount { font-size: 15px; font-weight: 800; font-variant-numeric: tabular-nums; }
.status-pending { font-size: 13px; font-weight: 600; color: var(--muted); }
.status-error { font-size: 13px; font-weight: 700; color: var(--danger); }
.empty { color: var(--muted); text-align: center; padding: 48px 0; }

.summary-strip { display: flex; justify-content: space-between; align-items: center; padding: 18px 20px; border-radius: var(--radius); background: var(--surface); margin-bottom: 8px; }
.summary-strip > div { display: flex; flex-direction: column; }
.summary-strip .big { font-size: 26px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.badge { padding: 4px 10px; border-radius: 12px; font-size: 13px; font-weight: 700; }
.badge-fehler { background: var(--danger-soft); color: var(--danger); }

/* Detail */
.doc { display: flex; flex-direction: column; gap: 10px; padding-top: 16px; }
.back { font-weight: 600; font-size: 15px; text-decoration: none; margin-bottom: 14px; }
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 0; }
.doc h1 { font-size: 32px; line-height: 36px; letter-spacing: -.025em; overflow-wrap: anywhere; }
.summary { margin: 0; font-size: 16px; line-height: 24px; }
.note { margin: 0; color: var(--muted); font-style: italic; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; padding-top: 4px; }
.tag { padding: 5px 12px; border-radius: 14px; background: var(--surface); font-size: 13px; font-weight: 600; color: var(--accent); text-decoration: none; }

.analysing { display: flex; gap: 14px; align-items: center; padding: 16px 18px; border-radius: var(--radius); background: var(--surface); }
.analysing div { display: flex; flex-direction: column; }
.analysing small { color: var(--muted); font-size: 14px; }
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 3px solid var(--accent-soft); border-top-color: var(--accent); animation: spin 0.9s linear infinite; flex-shrink: 0; }
@keyframes spin { to { transform: rotate(360deg); } }
.alert { display: flex; flex-direction: column; gap: 2px; padding: 14px 18px; border-radius: 14px; background: var(--danger-soft); color: var(--danger); margin: 0; }
.alert-soft { background: var(--surface); color: var(--ink); display: block; }

#doc-form { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.block { padding-top: 20px; display: flex; flex-direction: column; gap: 12px; }
.block h2 { margin: 0; }
.block-head { display: flex; justify-content: space-between; align-items: baseline; }
.points { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.tasks { list-style: none; margin: 0; padding: 0; }
.tasks li { display: flex; flex-direction: column; padding: 10px 0 10px 28px; border-bottom: 1px solid var(--line); position: relative; }
.tasks li::before { content: ''; position: absolute; left: 0; top: 13px; width: 16px; height: 16px; border: 2px solid var(--accent-soft); border-radius: 5px; }
.tasks small { color: var(--muted); }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 0; }
.facts dt { color: var(--muted); font-weight: 600; font-size: 14px; }
.facts dd { margin: 0; }

.chart-card { display: flex; flex-direction: column; gap: 14px; padding: 18px; border-radius: var(--radius); border: 1.5px solid var(--line); }
.chart-card p { margin: 0; font-size: 15px; line-height: 22px; }
.chart-card p.muted { font-size: 14px; }
.chart-title { font-weight: 700; font-size: 15px; }
.chart-title .muted { font-weight: 500; }
.bars { display: flex; align-items: flex-end; gap: 8px; height: 150px; }
.bar { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; height: 100%; min-width: 0; }
.bar-fill { width: 100%; border-radius: 6px; background: var(--accent-soft); display: block; max-height: calc(100% - 44px); }
.bar-value { font-size: 12px; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.bar-label { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.bar.peak .bar-fill { background: var(--accent); }
.bar.peak .bar-value { color: var(--accent); font-weight: 800; }

.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { border-collapse: collapse; width: 100%; font-size: 14px; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
thead th { font-weight: 700; color: var(--muted); font-size: 13px; }

.rows { gap: 0; }
.row-details { border-bottom: 1px solid var(--line); }
.row-details summary { display: flex; justify-content: space-between; align-items: center; padding: 16px 0; font-weight: 700; cursor: pointer; list-style: none; }
.row-details summary::-webkit-details-marker { display: none; }
.row-details summary .muted { font-weight: 400; font-size: 15px; }
.row-details[open] summary .muted { visibility: hidden; }
.fulltext { padding-bottom: 20px; font-size: 15px; line-height: 24px; overflow-wrap: anywhere; }
.fulltext h3, .fulltext h4, .fulltext h5 { font-size: 17px; margin: 18px 0 6px; }
.fulltext blockquote { margin: 12px 0; padding: 4px 0 4px 14px; border-left: 3px solid var(--accent); background: transparent; }
.fulltext p { margin: 0 0 12px; }
.originals { display: flex; flex-direction: column; gap: 12px; padding-bottom: 20px; }
.originals img { width: 100%; border-radius: 12px; border: 1px solid var(--line); }
.file-link { font-weight: 600; }
.edit { display: flex; flex-direction: column; gap: 14px; padding-bottom: 20px; }
.toggle { flex-direction: row; align-items: center; gap: 10px; font-size: 16px; color: var(--ink); }
.toggle input { width: 22px; height: 22px; accent-color: var(--accent); }

.doc-actions { display: flex; flex-direction: column; gap: 16px; padding-top: 20px; }
.doc-actions-secondary { display: flex; justify-content: center; gap: 28px; }

@media (min-width: 700px) {
  main { padding-bottom: 64px; }
  .page-head { padding-top: 56px; }
}

/* Zusatzoptionen beim Upload, Segment-Schalter */
.app-opts { display: flex; flex-direction: column; gap: 10px; }
.hint-left { margin: 0; color: var(--muted); font-size: 14px; }
.segmented { display: flex; background: var(--surface); border-radius: 26px; padding: 4px; gap: 4px; }
.segmented label { flex: 1; flex-direction: row; justify-content: center; cursor: pointer; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented span { display: block; width: 100%; text-align: center; padding: 10px 0; border-radius: 22px; font-size: 15px; font-weight: 700; color: var(--muted); }
.segmented input:checked + span { background: var(--bg); color: var(--ink); box-shadow: 0 1px 3px rgba(30,35,33,.12); }
.segmented input:focus-visible + span { outline: 2px solid var(--accent); }

/* Rechnungen: Übersicht und Listen */
.summary-grid { display: flex; flex-direction: column; gap: 8px; }
.link-strip { text-decoration: none; color: var(--ink); }
.chev { font-size: 24px; color: var(--muted); }
.list-links { display: flex; gap: 8px; padding: 12px 0 4px; }
.list-links .btn { flex: 1; min-height: 48px; }
.filters-row { display: flex; gap: 8px; padding-top: 12px; }
.filters-row select { flex: 1; }
.positions { list-style: none; margin: 0; padding: 0; }
.positions li { display: flex; gap: 12px; align-items: flex-start; padding: 14px 0; border-bottom: 1px solid var(--line); }
.pos-check { width: 22px; height: 22px; margin-top: 2px; accent-color: var(--accent); flex-shrink: 0; }
.pos-check-spacer { width: 22px; flex-shrink: 0; }
.pos-main { flex: 1; display: flex; flex-direction: column; gap: 2px; text-decoration: none; color: var(--ink); min-width: 0; }
.pos-top { display: flex; justify-content: space-between; gap: 12px; }
.pos-top strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pos-purpose { font-size: 15px; }
.total-row { display: flex; justify-content: space-between; align-items: baseline; padding: 18px 0; font-size: 15px; color: var(--muted); }
.total-row strong { font-size: 22px; color: var(--ink); font-variant-numeric: tabular-nums; }
.positions-form { display: flex; flex-direction: column; }
.footer-links { text-align: center; padding-top: 32px; font-size: 14px; }
.footer-links a { color: var(--muted); }
.badge-ok { background: var(--surface); color: var(--accent); vertical-align: middle; }

/* Verwandte Dokumente */
.related-list { list-style: none; margin: 0; padding: 0; }
.related-list li a { display: flex; flex-direction: column; gap: 2px; padding: 12px 0; border-bottom: 1px solid var(--line); color: inherit; text-decoration: none; }
.related-list li:last-child a { border-bottom: 0; }
.related-list li a span { font-weight: 600; }

/* Zwei-Faktor */
.qr-box { display: flex; justify-content: center; padding: 16px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); margin: 8px 0 12px; }
.qr-box svg { width: 200px; height: 200px; }
.steps { padding-left: 20px; margin: 0 0 8px; line-height: 1.5; }

/* Kostenbalken */
.meter { display: block; height: 8px; border-radius: 4px; background: var(--line); margin-top: 10px; overflow: hidden; width: 100%; min-width: 200px; }
.meter > span { display: block; height: 100%; background: var(--accent, #1F5A43); border-radius: 4px; }
.meter > span.warn { background: #B5473A; }

/* Auswertung (Farben geprüft: Blau/Orange, CVD ΔE 24.7) */
:root { --series-privat: #2a78d6; --series-geschaeft: #eb6834; }
.stat-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 8px; }
.stat { background: var(--surface); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.stat-label { font-size: 14px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.stat-value { white-space: nowrap; font-size: 22px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat-sub { font-size: 13px; color: var(--muted); }
.key { display: inline-block; width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }
.key-privat { background: var(--series-privat); }
.key-geschaeft { background: var(--series-geschaeft); }
.legend { display: flex; gap: 14px; font-size: 14px; color: var(--muted); }
.legend > span { display: inline-flex; align-items: center; gap: 6px; }
.month-chart { width: 100%; height: auto; display: block; overflow: visible; }
.month-chart .grid { stroke: var(--line); stroke-width: 1; }
.month-chart .baseline { stroke: var(--line-strong); stroke-width: 1; }
.month-chart .axis { fill: var(--muted); font: 500 12px var(--font); font-variant-numeric: tabular-nums; }
.month-chart .seg-privat { fill: var(--series-privat); }
.month-chart .seg-geschaeft { fill: var(--series-geschaeft); }
.month-chart .hit { fill: transparent; }
.month-chart .bar:hover .hit, .month-chart .bar:focus .hit { fill: var(--surface); }
.month-chart .bar:focus { outline: none; }
.cat-bars { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.cat-bars li { display: flex; flex-direction: column; gap: 6px; cursor: default; }
.cat-top { display: flex; justify-content: space-between; font-size: 15px; }
.cat-top strong { font-variant-numeric: tabular-nums; }
.cat-track { display: flex; gap: 2px; height: 10px; }
.cat-track .seg { display: block; height: 100%; }
.cat-track .seg:last-child { border-radius: 0 4px 4px 0; }
.seg-privat { background: var(--series-privat); }
.seg-geschaeft { background: var(--series-geschaeft); }
.data-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; font-size: 15px; }
.data-table th, .data-table td { text-align: right; padding: 8px 4px; border-bottom: 1px solid var(--line); }
.data-table th:first-child, .data-table td:first-child { text-align: left; }
.data-table tfoot td { font-weight: 700; border-bottom: 0; }
.chart-tip { position: fixed; z-index: 50; pointer-events: none; background: var(--ink); color: #fff; font-size: 13px; font-weight: 500; padding: 6px 10px; border-radius: 8px; white-space: nowrap; transform: translate(-50%, calc(-100% - 10px)); }
.stat-value small { font-size: 13px; font-weight: 600; color: var(--muted); letter-spacing: 0; }
.update-log { list-style: none; padding: 16px; margin: 0 0 16px; background: var(--surface); border-radius: var(--radius); display: flex; flex-direction: column; gap: 6px; font-size: 15px; }

/* Teilen und Kalender */
.row-toggle { padding: 14px 0; border-bottom: 1px solid var(--line, rgba(0,0,0,.08)); }
.share-box { display: flex; flex-direction: column; gap: 12px; padding: 4px 0 14px; }
.share-row { display: flex; gap: 10px; align-items: center; }
.share-row select { flex: 0 0 auto; width: auto; }
.share-row .btn { flex: 1; }
.share-result { display: flex; flex-direction: column; gap: 8px; }
.share-result[hidden] { display: none; }
.share-status { margin: 0; }
.share-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.share-list li { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 14px; color: var(--muted, #666); }
.shared-page { max-width: 720px; margin: 0 auto; padding: 24px 16px 48px; }
.shared-page img { width: 100%; height: auto; border-radius: 10px; margin: 8px 0; }

.originals audio, .shared-page audio { width: 100%; margin: 6px 0; }
.rec-box { display: flex; flex-direction: column; gap: 10px; }
.rec-btn.recording { background: #b3261e; border-color: #b3261e; color: #fff; }
.rec-time { font-variant-numeric: tabular-nums; }

.cat-edit { list-style: none; margin: 0 0 16px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.cat-edit li { display: flex; align-items: center; gap: 10px; }
.cat-edit li input[name^="label"] { flex: 1; }
.cat-edit small { min-width: 2ch; text-align: right; }
.small-link { font-size: 13px; color: var(--muted); align-self: flex-end; }

.cat-edit .budget-input { width: 84px; flex: 0 0 84px; text-align: right; }
.budget-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.budget-list .cat-track { position: relative; }
.budget-list .seg-over { background: #b3261e; }
.budget-list .over strong { color: #b3261e; }
.cat-edit li input[name^="label"] { min-width: 0; }
.cat-edit small { flex: 0 0 auto; }

/* =========================================================================
   v3.5 Apple-Stil. Überschreibt die älteren Regeln oben.
   ========================================================================= */
body { font: 400 17px/1.35 var(--font); letter-spacing: -.01em; }
main, .topbar { max-width: 600px; }
main { padding: 0 var(--gutter) 32px; min-height: 100dvh; gap: 0; }
body.has-tabs main { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
.topbar { padding: 18px var(--gutter) 0; }
.brand { font-size: 17px; font-weight: 600; letter-spacing: -.01em; }

/* Grosse Titel */
.page-head { padding: 14px 0 18px; gap: 6px; }
.large-title { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 0 16px; }
.large-title > div { display: flex; flex-direction: column; gap: 0; min-width: 0; }
h1 { font-size: 34px; line-height: 41px; font-weight: 700; letter-spacing: .01em; }
.lead { font-size: 17px; color: var(--muted); }
h2 { font-size: 20px; line-height: 25px; font-weight: 700; letter-spacing: .01em; margin: 0 0 8px; }
.eyebrow { font-size: 13px; font-weight: 600; letter-spacing: .02em; text-transform: uppercase; color: var(--tertiary); }
.avatar { width: 36px; height: 36px; border-radius: 18px; background: var(--accent); color: #fff !important; display: grid; place-items: center;
  font-size: 14px; font-weight: 600; letter-spacing: 0; text-decoration: none; flex-shrink: 0; }
.muted { color: var(--muted); }
.tint { color: var(--accent); }
.danger { color: var(--danger-ink) !important; }
.warn { color: var(--warn-ink) !important; }
em.danger, em.warn { font-style: normal; font-size: 13px; font-weight: 600; margin-left: 4px; }

.flash { background: var(--card); border-radius: var(--radius); padding: 12px 16px; margin: 12px 0 0; font-size: 15px; }

/* Karten und gruppierte Listen */
.card { display: flex; flex-direction: column; gap: 12px; background: var(--card); border-radius: 16px; padding: 18px; color: var(--ink); text-decoration: none; }
.card-head, .card-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.card-head { font-size: 15px; font-weight: 500; color: var(--muted); }
.card-head .tint { font-weight: 400; }
.card-foot { font-size: 13px; color: var(--muted); }
.card-foot .up { color: var(--warn-ink); }
.card-foot .down { color: var(--accent); }
.big-number { font-size: 40px; line-height: 44px; font-weight: 700; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.big-number small { font-size: 17px; font-weight: 500; color: var(--tertiary); letter-spacing: 0; }
.big-number.neg { color: var(--danger-ink); }
.progress { display: block; height: 8px; border-radius: 4px; background: #E5E5EA; overflow: hidden; }
.progress > span { display: block; height: 100%; border-radius: 4px; background: var(--accent); }
.progress > span.warn { background: var(--warn); }
.progress > span.over { background: var(--danger); }
.progress.thin { height: 6px; }
.empty-card { gap: 6px; }
.empty-card .muted { font-size: 15px; }

.section { display: flex; flex-direction: column; gap: 7px; padding-top: 24px; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; padding: 0 4px; }
.section-head h2 { margin: 0; }
.section-head a { font-size: 15px; color: var(--accent); text-decoration: none; }
.section-head.small { padding: 0 16px; }
.section-head.small > span { font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .02em; }

.list { list-style: none; margin: 0; padding: 0; background: var(--card); border-radius: var(--radius); overflow: hidden; }
.list > li { position: relative; }
.list > li + li::before { content: ''; position: absolute; top: 0; left: 60px; right: 0; height: .5px; background: var(--line); }
.list > li.budget-cell + li::before, .list > li + li.budget-cell::before { left: 16px; }
.cell { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 10px 16px; color: var(--ink); text-decoration: none; }
.cell-main { display: flex; flex-direction: column; gap: 1px; flex: 1; min-width: 0; }
.cell-main strong { font-weight: 400; font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cell-main small { font-size: 13px; color: var(--muted); }
.cell-end { flex-shrink: 0; }
.amount { font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; }
.sq { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; color: #fff; flex-shrink: 0; }
.sq svg { width: 18px; height: 18px; }
svg.chev { width: 8px; height: 14px; color: #C4C4C7; flex-shrink: 0; }

.budget-cell { display: flex; flex-direction: column; align-items: stretch; gap: 8px; padding: 12px 16px; }
.budget-top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.budget-top .muted { font-size: 15px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.budget-top strong { color: var(--ink); font-weight: 600; }

.ring-card { flex-direction: row; align-items: center; gap: 18px; }
.ring { width: 96px; height: 96px; flex-shrink: 0; }
.ring circle { fill: none; stroke-width: 12; }
.ring-track { stroke: #E5E5EA; }
.ring-fill { stroke: var(--accent); stroke-linecap: round; }
.ring.warn .ring-fill { stroke: var(--warn); }
.ring.over .ring-fill { stroke: var(--danger); }
.ring-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ring-text .muted { font-size: 15px; }
.ring-text small { font-size: 13px; }
.ring-text .big-number { font-size: 34px; line-height: 40px; }
.forecast { flex-direction: row; gap: 12px; margin-top: 24px; padding: 14px 16px; }
.forecast > svg { width: 22px; height: 22px; color: var(--accent); }
.forecast div { display: flex; flex-direction: column; gap: 3px; }
.forecast strong { font-size: 15px; font-weight: 600; }
.forecast p { margin: 0; font-size: 15px; line-height: 20px; color: #3C3C43; }
.forecast small { font-size: 13px; }

/* Kacheln „Zuletzt hinzugefügt“ */
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tile { display: flex; flex-direction: column; gap: 2px; background: var(--card); border-radius: var(--radius); padding: 12px; color: var(--ink); text-decoration: none; min-width: 0; }
.tile img, .tile-art { width: 100%; height: 72px; border-radius: 8px; object-fit: cover; margin-bottom: 8px; background: var(--surface); }
.tile-art { display: grid; place-items: center; background: color-mix(in srgb, var(--c) 14%, white); color: var(--c); }
.tile-art svg { width: 30px; height: 30px; }
.tile strong { font-size: 15px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile small { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Tab-Leiste */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; display: flex; justify-content: space-around; align-items: flex-start;
  padding: 7px max(8px, env(safe-area-inset-right)) calc(env(safe-area-inset-bottom) + 6px) max(8px, env(safe-area-inset-left));
  background: rgba(249,249,249,.94); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  border-top: .5px solid rgba(0,0,0,.2); }
.tabbar a { flex: 1; max-width: 96px; display: flex; flex-direction: column; align-items: center; gap: 2px; min-height: 44px;
  color: var(--tertiary); text-decoration: none; font-size: 10px; font-weight: 500; letter-spacing: .01em; -webkit-tap-highlight-color: transparent; }
.tabbar a svg { width: 26px; height: 24px; }
.tabbar a svg .fill { fill: currentColor; }
.tabbar a:not(.on) svg .fill { fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; }
.tabbar a.on { color: var(--accent); }
.tabbar .plus-btn { width: 48px; height: 36px; border-radius: 18px; background: var(--accent); color: #fff; display: grid; place-items: center; margin-top: 2px; }
.tabbar .plus-btn svg { width: 18px; height: 18px; }
.tabbar a.plus:active .plus-btn { transform: scale(.94); }
@media (min-width: 700px) {
  .tabbar { justify-content: center; gap: 24px; }
  main { padding-left: 24px; padding-right: 24px; }
}

/* Knöpfe */
.btn { min-height: 50px; border-radius: 12px; border: 0; padding: 0 20px; font: 600 17px var(--font); letter-spacing: -.01em; gap: 8px; }
.btn svg { width: 20px; height: 20px; }
.btn:active { transform: none; opacity: .7; }
.btn-primary, .btn-accent { background: var(--accent); color: #fff; }
.btn-ghost { background: var(--card); color: var(--accent); }
.btn-small { min-height: 36px; border-radius: 18px; font-size: 15px; padding: 0 14px; background: var(--accent-soft); color: var(--accent); }
.btn-small.btn-primary, .btn-small.btn-accent { background: var(--accent); color: #fff; }
.link { font: 400 17px var(--font); }
.link.danger { color: var(--danger); }

/* Formulare */
label { gap: 6px; font-weight: 400; font-size: 15px; color: var(--muted); }
input:not([type=radio]):not([type=checkbox]):not([type=file]), textarea, select {
  font: 400 17px/1.3 var(--font); background: var(--card); border: 0; border-radius: 10px; padding: 12px 14px; color: var(--ink); }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--accent); outline-offset: 0; }
select { -webkit-appearance: none; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%238A8A8E' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M1 1.5l5 5 5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px !important; }
.toggle { font-size: 17px; color: var(--ink); background: var(--card); border-radius: 10px; padding: 12px 14px; }
.toggle input[type=checkbox] { -webkit-appearance: none; appearance: none; width: 51px; height: 31px; border-radius: 16px; background: #E9E9EA; position: relative; flex-shrink: 0; cursor: pointer; transition: background .2s; margin: 0; order: 2; margin-left: auto; }
.toggle input[type=checkbox]::after { content: ''; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 3px 8px rgba(0,0,0,.15), 0 1px 1px rgba(0,0,0,.06); transition: transform .2s; }
.toggle input[type=checkbox]:checked { background: var(--ok); }
.toggle input[type=checkbox]:checked::after { transform: translateX(20px); }
.hint-left, .hint { font-size: 13px; color: var(--muted); }
.stack { gap: 10px; }
.block { padding-top: 28px; gap: 8px; }
.block > h2 { font-size: 13px; font-weight: 400; color: var(--muted); text-transform: uppercase; letter-spacing: .02em; padding: 0 16px; margin: 0; }

/* Suche und Umschalter */
.search { height: 36px; padding: 0 8px; border-radius: 10px; background: var(--surface); margin-top: 4px; gap: 6px; color: var(--tertiary); }
.search svg { width: 16px; height: 16px; }
.search input { font-size: 17px !important; }
.chips { gap: 8px; padding-top: 12px; }
.chip { padding: 6px 14px; border-radius: 16px; border: 0; background: var(--surface); font-size: 15px; font-weight: 400; color: var(--ink); }
.chip.active { background: var(--accent); color: #fff; font-weight: 600; }
.segmented { background: var(--surface); border-radius: 9px; padding: 2px; gap: 0; }
.segmented span { padding: 6px 0; border-radius: 7px; font-size: 13px; font-weight: 400; color: var(--ink); }
.segmented input:checked + span { background: var(--card); font-weight: 600; box-shadow: 0 3px 8px rgba(0,0,0,.12), 0 3px 1px rgba(0,0,0,.04); }

/* Archiv als gruppierte Liste */
.doc-list .group { font-size: 13px; font-weight: 400; letter-spacing: .02em; color: var(--muted); padding: 22px 16px 7px; }
.doc-list > li:not(.group) { background: var(--card); position: relative; }
.doc-list > li.group + li { border-radius: var(--radius) var(--radius) 0 0; }
.doc-list > li:not(.group):has(+ li.group), .doc-list > li:not(.group):last-child { border-radius: 0 0 var(--radius) var(--radius); }
.doc-list > li.group + li:has(+ li.group), .doc-list > li.group + li:last-child { border-radius: var(--radius); }
.doc-list > li:not(.group) + li:not(.group)::before { content: ''; position: absolute; top: 0; left: 60px; right: 0; height: .5px; background: var(--line); }
.row { gap: 12px; padding: 10px 16px; border-bottom: 0; min-height: 56px; }
.row-icon { width: 32px; height: 32px; border-radius: 8px; color: #fff; background: var(--tertiary); }
.row-icon svg { width: 18px; height: 18px; stroke-width: 2.2; }
.row-main { gap: 1px; }
.row-main strong { font-size: 17px; font-weight: 400; line-height: 22px; }
.row-main small { font-size: 13px; }
.row-end { width: auto; min-width: 48px; }
.row-end .amount { font-size: 17px; }
.status-pending { font-size: 15px; font-weight: 400; color: var(--tertiary); }
.status-error { font-size: 15px; font-weight: 600; }
.empty { padding: 56px 0; font-size: 17px; }
.summary-strip { background: var(--card); border-radius: 16px; padding: 16px 18px; margin-bottom: 0; }
.summary-strip .big { font-size: 28px; font-weight: 700; letter-spacing: -.01em; }
.summary-grid { gap: 10px; padding-top: 4px; }
.list-links { padding: 10px 0 0; }
.list-links .btn { min-height: 44px; }

/* Hochladen: Anwendungen als iOS-Liste mit Häkchen */
.apps { gap: 0; background: var(--card); border-radius: var(--radius); overflow: hidden; }
.apps legend { display: none; }
.app-option { padding: 10px 16px; gap: 12px; border-radius: 0; background: var(--card); position: relative; min-height: 52px; }
.app-option + .app-option::before { content: ''; position: absolute; top: 0; left: 60px; right: 0; height: .5px; background: var(--line); }
.app-icon { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; color: #fff; flex-shrink: 0; }
.app-icon svg { width: 18px; height: 18px; stroke-width: 2.2; }
.app-text strong { font-size: 17px; font-weight: 400; }
.app-text small { font-size: 13px; line-height: 17px; }
.radio { border: 0; width: 20px; height: 20px; border-radius: 0; }
.app-option:has(input:checked) { background: var(--card); }
.app-option:has(input:checked) .app-icon { color: #fff; }
.app-option:has(input:checked) .app-text strong { color: var(--ink); font-weight: 600; }
.app-option:has(input:checked) .app-text small { color: var(--muted); }
.app-option:has(input:checked) .radio { background: none; border: 0; }
.app-option:has(input:checked) .radio::after { content: ''; width: 18px; height: 14px; border-radius: 0; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='14' fill='none' stroke='%231E6B47' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 7.5 6.5 12 16 2'/%3E%3C/svg%3E") no-repeat center; }
.upload { gap: 16px; }
.pages, .text-panel { background: var(--card); border-radius: var(--radius); padding: 12px 16px; }
.pages li { border-bottom: .5px solid var(--line); }
.pages li:last-child { border-bottom: 0; }
.text-panel textarea { background: var(--bg); }
.note-field summary { font-weight: 400; font-size: 17px; padding: 0 4px; }
.actions-bottom { gap: 10px; }
#pick-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
#pick-actions .btn { flex-direction: column; min-height: 76px; gap: 6px; padding: 12px 6px; background: var(--card); color: var(--ink);
  font-size: 13px; font-weight: 500; white-space: normal; text-align: center; line-height: 16px; }
#pick-actions .btn svg { width: 26px; height: 26px; color: var(--accent); }
#pick-actions .rec-btn.recording { background: var(--danger); color: #fff; }
#pick-actions .rec-btn.recording svg { color: #fff; }

/* Dokument */
.doc { gap: 12px; padding-top: 8px; }
.back { display: inline-flex; align-items: center; gap: 4px; font-size: 17px; font-weight: 400; margin: 0 0 6px -4px; min-height: 44px; }
.doc h1 { font-size: 28px; line-height: 34px; font-weight: 700; letter-spacing: .01em; }
.summary { background: var(--card); border-radius: var(--radius); padding: 14px 16px; font-size: 17px; line-height: 23px; }
.tag { background: var(--card); color: var(--accent); font-size: 13px; font-weight: 500; }
.analysing, .alert-soft { background: var(--card); border-radius: var(--radius); }
.alert { border-radius: var(--radius); background: var(--danger-soft); color: var(--danger-ink); }
#doc-form { gap: 12px; }
.facts { background: var(--card); border-radius: var(--radius); padding: 4px 16px; grid-template-columns: auto 1fr; gap: 0 16px; }
.facts dt, .facts dd { padding: 11px 0; border-bottom: .5px solid var(--line); font-size: 17px; }
.facts dt { font-weight: 400; color: var(--ink); }
.facts dd { color: var(--muted); text-align: right; }
.facts dt:last-of-type, .facts dd:last-of-type { border-bottom: 0; }
.points, .tasks { background: var(--card); border-radius: var(--radius); padding: 12px 16px 12px 34px; }
.tasks { padding: 4px 16px; }
.tasks li { border-bottom: .5px solid var(--line); }
.tasks li:last-child { border-bottom: 0; }
.chart-card { background: var(--card); border: 0; }
.rows { background: var(--card); border-radius: var(--radius); padding: 0 16px; }
.row-details { border-bottom: .5px solid var(--line); }
.row-details:last-child { border-bottom: 0; }
.row-details summary { font-weight: 400; font-size: 17px; min-height: 44px; padding: 11px 0; }
.row-details summary .muted { margin-left: auto; font-size: 17px; }
.row-toggle { border-bottom: .5px solid var(--line); }
.doc-actions { padding-top: 24px; gap: 10px; }
.doc-actions-secondary { gap: 24px; }
.related-list { background: var(--card); border-radius: var(--radius); padding: 0 16px; }
.related-list li a { border-bottom: .5px solid var(--line); }
.originals img { border: 0; }
.share-box { padding: 4px 0 14px; }

/* Rechnungslisten, Auswertung, Kategorien */
.positions { background: var(--card); border-radius: var(--radius); padding: 0 16px; }
.positions li { border-bottom: .5px solid var(--line); }
.positions li:last-child { border-bottom: 0; }
.stat { background: var(--card); }
.stat-value { font-weight: 700; }
.cat-bars { background: var(--card); border-radius: var(--radius); padding: 14px 16px; }
.update-log { background: var(--card); }
.qr-box { border: 0; }
.meter { background: #E5E5EA; }
.meter > span.warn { background: var(--danger); }
.data-table th, .data-table td { border-bottom: .5px solid var(--line); }
.footer-links { padding-top: 28px; font-size: 15px; }
.badge-fehler { background: var(--danger-soft); color: var(--danger-ink); }
.badge-ok { background: var(--accent-soft); }

/* Anmeldung */
.narrow { margin-top: 56px; }
.narrow h1 { font-size: 34px; }

@media (prefers-reduced-motion: reduce) {
  .toggle input[type=checkbox], .toggle input[type=checkbox]::after { transition: none; }
}
.row-main small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.budget-top > span:first-child { min-width: 0; }
.grid2 > * { min-width: 0; }
.grid2 input { min-width: 0; }
input[type=date] { -webkit-appearance: none; appearance: none; min-height: 46px; }
.rows .toggle, .row-toggle .toggle { background: none; padding: 0; border-radius: 0; }
.row-toggle { padding: 11px 0; }

/* Kategorien bearbeiten (v3.5.3): zweizeilig, passt auf schmale iPhones */
.cat-edit { gap: 0; background: var(--card); border-radius: var(--radius); overflow: hidden; }
.cat-edit li { display: flex; flex-direction: column; align-items: stretch; gap: 2px; padding: 8px 16px 10px; background: var(--card); border-radius: 0; position: relative; }
.cat-edit li + li::before { content: ''; position: absolute; top: 0; left: 16px; right: 0; height: .5px; background: var(--line); }
.cat-line { display: flex; align-items: center; gap: 12px; }
.cat-edit input.cat-name { flex: 1; min-width: 0; padding: 6px 0 !important; border-radius: 0; font-size: 17px; background: transparent !important; }
.cat-sub { justify-content: space-between; font-size: 13px; }
.cat-budget { flex-direction: row; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.cat-edit .budget-input { width: 92px; flex: 0 0 92px; text-align: right; padding: 6px 10px !important; background: var(--bg) !important; border-radius: 8px; font-size: 15px; }
/* iOS-Schalter */
.switch { display: inline-flex; flex-direction: row; flex-shrink: 0; }
.switch input[type=checkbox], .toggle input[type=checkbox] { -webkit-appearance: none; appearance: none; width: 51px; height: 31px; border-radius: 16px;
  background: #E9E9EA !important; position: relative; flex-shrink: 0; cursor: pointer; transition: background .2s; margin: 0; padding: 0; border: 0; }
.switch input[type=checkbox]::after, .toggle input[type=checkbox]::after { content: ''; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%;
  background: #fff; box-shadow: 0 3px 8px rgba(0,0,0,.15), 0 1px 1px rgba(0,0,0,.06); transition: transform .2s; }
.switch input[type=checkbox]:checked, .toggle input[type=checkbox]:checked { background: var(--ok) !important; }
.switch input[type=checkbox]:checked::after, .toggle input[type=checkbox]:checked::after { transform: translateX(20px); }
.switch input:disabled { opacity: .5; cursor: default; }
.switch input:focus-visible, .toggle input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Rückmeldung beim Speichern */
.btn { transition: transform .12s ease, background-color .25s ease, opacity .2s; }
.btn:active { transform: scale(.96); opacity: 1; }
.btn.is-busy { opacity: .7; pointer-events: none; }
.btn.is-done { background: var(--ok) !important; color: #fff !important; animation: btn-pop .35s ease; }
.btn.is-done svg { width: 20px; height: 20px; }
@keyframes btn-pop { 0% { transform: scale(.94); } 60% { transform: scale(1.03); } 100% { transform: scale(1); } }
.toast { display: flex; align-items: flex-start; gap: 10px; margin: 12px 0 0; padding: 12px 14px; border-radius: var(--radius); background: var(--card); font-size: 15px; line-height: 20px;
  box-shadow: 0 1px 2px rgba(0,0,0,.04); transition: opacity .4s ease, max-height .4s ease, margin .4s ease, padding .4s ease; max-height: 300px; overflow: hidden; }
.toast-icon { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; color: #fff; flex-shrink: 0; background: var(--ok); }
.toast-icon svg { width: 14px; height: 14px; }
.toast-error { background: var(--danger-soft); color: var(--danger-ink); }
.toast-error .toast-icon { background: var(--danger); }
.toast-hide { opacity: 0; max-height: 0; margin: 0; padding-top: 0; padding-bottom: 0; }
@media (prefers-reduced-motion: reduce) { .btn, .toast { transition: none; } .btn.is-done { animation: none; } }

.cat-sub.cat-budget { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 13px; color: var(--muted); }
.cat-fixed { font-size: 13px; color: var(--tertiary); flex-shrink: 0; }

/* v3.5.5: nichts darf breiter als der Bildschirm werden (sonst verkleinert Safari die ganze Seite) */
html, body { overflow-x: hidden; }
main { min-width: 0; width: 100%; }
main > * { min-width: 0; max-width: 100%; }
.chips { margin: 0 calc(-1 * var(--gutter)); padding: 12px var(--gutter) 2px; -webkit-overflow-scrolling: touch; scroll-padding: 0 var(--gutter); }
.chips::after { content: ''; flex: 0 0 1px; }
.list-nav { margin-top: 12px; }
.list-nav .cell-main span { font-size: 17px; }
.summary-strip > div { min-width: 0; }
.summary-strip .muted { overflow-wrap: anywhere; }
.share-row { flex-wrap: wrap; }
.share-row > .btn { flex: 1 1 140px; min-width: 0; white-space: normal; }
/* v3.5.5: Schalter immer rechtsbündig */
.toggle { display: flex; flex-direction: row; align-items: center; gap: 12px; }
.toggle input[type=checkbox] { order: 2; margin-left: auto !important; }
/* Auswahlfelder nicht abschneiden */
.grid2:has(select) { grid-template-columns: 1fr; }
.filters-row { flex-wrap: wrap; }
.filters-row select { flex: 1 1 140px; min-width: 0; }
select { max-width: 100%; text-overflow: ellipsis; }
/* Titel zweizeilig statt abgeschnitten */
.row-main strong, .tile strong { white-space: normal; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; overflow-wrap: anywhere; }
.row-main small { white-space: normal; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
/* Konten */
.block-head { gap: 8px; flex-wrap: wrap; }
.block-head > * { min-width: 0; }
details summary { flex-wrap: wrap; gap: 4px 12px; }
details summary .muted { margin-left: auto; text-align: right; }
/* Datei-Auswahl */
input[type=file] { font: inherit; font-size: 15px; color: var(--muted); width: 100%; padding: 10px; background: var(--card); border-radius: 10px; border: 1px dashed var(--line-strong); }
input[type=file]::file-selector-button { font: inherit; font-weight: 600; color: var(--accent); background: var(--surface); border: 0; border-radius: 8px; padding: 8px 14px; margin-right: 12px; cursor: pointer; }
/* Budget: Hinweis neben dem Namen */
.budget-top > span:first-child { min-width: 0; }
.budget-top em { white-space: nowrap; }
/* lange Wörter und Links */
main a, main p, .doc-body { overflow-wrap: anywhere; }
/* Garantie bei der Rechnung (ab v3.6) */
.warranty-add summary { color: var(--accent); font-weight: 600; font-size: 17px; cursor: pointer; list-style: none; padding: 0 16px; }
.warranty-add summary::-webkit-details-marker { display: none; }
.warranty-add summary::before { content: '+ '; }
.warranty-add[open] summary::before { content: '− '; }
.warranty-add > .block { padding-top: 12px; }
/* Garantiefall (ab v3.7) */
.claim-state { margin: 0; padding: 12px 16px; border-radius: var(--radius); background: var(--accent-soft); color: var(--accent); font-size: 15px; font-weight: 600; }
.claim-form textarea { min-height: 360px; font-size: 16px; line-height: 1.45; }

/* v3.8: Verträge und Briefe */
.letter-opts { display: flex; flex-direction: column; gap: 8px; }
.letter-opts .reply-intent { display: none; }
.letter-opts:has(input[type=checkbox]:checked) .reply-intent { display: flex; }
.letter-text { min-height: 320px; font-size: 16px; line-height: 1.45; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; }
.btn-row .btn-small { align-self: auto; }
.letter-explain { margin: 0; padding: 14px 16px; background: var(--card); border-radius: var(--radius); font-size: 17px; line-height: 1.45; }
.letter-action { margin: 0; padding: 0 16px; font-size: 16px; }
.letter-deadline { margin: 0; padding: 12px 16px; border-radius: var(--radius); background: var(--card); font-weight: 600; font-size: 16px; display: flex; flex-direction: column; gap: 2px; }
.letter-deadline small { font-weight: 400; font-size: 13px; color: var(--muted); }
.letter-deadline.danger { background: var(--danger-soft); }
.letter-deadline.warn { background: var(--warn-soft); }
.letter-deadline.ok { color: var(--accent) !important; background: var(--accent-soft); }
.chips.chips-wrap { flex-wrap: wrap; overflow: visible; margin: 0; padding: 0; }
.chips.chips-wrap::after { display: none; }
button.chip { font: inherit; font-size: 15px; cursor: pointer; }
.contracts-nav { margin-top: 8px; }
.contracts-hint { padding: 8px 16px 0; }
.contract-danger { padding: 20px 0 8px; justify-content: space-between; }
.facts dd.ok { color: var(--accent); }
.hint-left.warn { font-weight: 600; }
.section + .block, .summary-grid + .section { margin-top: 4px; }
.history { list-style: none; margin: 0; padding: 0 16px; background: var(--card); border-radius: var(--radius); }
.history li { display: flex; flex-direction: column; padding: 11px 0; border-bottom: .5px solid var(--line); }
.history li:last-child { border-bottom: 0; }
.history small { color: var(--muted); font-size: 13px; }

/* Dokumentenscanner (v3.9) */
html.scanner-open, html.scanner-open body { overflow: hidden; }
.scanner { position: fixed; inset: 0; z-index: 1000; background: #0B0F0D; color: #fff; display: flex; flex-direction: column;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); font-family: var(--font); }
.scan-head { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; min-height: 52px; padding: 0 8px; }
.scan-title { font-weight: 600; font-size: 17px; text-align: center; white-space: nowrap; }
.scan-link { background: none; border: 0; color: #fff; font: 400 17px var(--font); min-height: 44px; padding: 0 8px; justify-self: start; cursor: pointer; }
.scan-skip { justify-self: end; color: #7FD3A6; }
.scan-stage { position: relative; flex: 1; min-height: 0; overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none; }
.scan-img, .scan-svg { position: absolute; }
.scan-svg { overflow: visible; pointer-events: none; }
.scan-svg polygon { fill: rgba(61,220,132,.16); stroke: #3DDC84; stroke-width: 2.5; stroke-linejoin: round; }
.scan-svg polygon.bad { fill: rgba(255,59,48,.18); stroke: #FF453A; }
.scan-handle { position: absolute; width: 44px; height: 44px; margin: -22px 0 0 -22px; border-radius: 50%; touch-action: none; cursor: grab; }
.scan-handle::after { content: ''; position: absolute; inset: 10px; border-radius: 50%; background: rgba(255,255,255,.95); border: 3px solid #1E6B47; box-shadow: 0 1px 6px rgba(0,0,0,.5); transition: transform .12s; }
.scan-handle.active::after { transform: scale(1.3); }
.scan-loupe { position: absolute; top: 12px; left: 12px; width: 110px; height: 110px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 4px 16px rgba(0,0,0,.6); pointer-events: none; }
.scan-loupe.right { left: auto; right: 12px; }
.scan-result { position: absolute; inset: 16px; width: calc(100% - 32px); height: calc(100% - 32px); object-fit: contain; }
.scan-busy { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); background: rgba(0,0,0,.7); padding: 10px 16px; border-radius: 12px; font-size: 15px; white-space: nowrap; }
.scan-tools { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px; padding: 10px 12px 4px; }
.scan-tool { display: inline-flex; align-items: center; gap: 6px; background: rgba(255,255,255,.12); color: #fff; border: 0; border-radius: 18px; min-height: 36px; padding: 0 14px; font: 500 15px var(--font); cursor: pointer; }
.scan-tool svg { width: 18px; height: 18px; }
.scan-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 5px; max-width: 100%; }
.scan-rot { justify-self: end; display: inline-flex; align-items: center; color: #fff; }
.scan-rot svg { width: 24px; height: 24px; }
.scan-chip { background: rgba(255,255,255,.12); color: #fff; border: 0; border-radius: 18px; min-height: 36px; padding: 0 10px; font: 500 14px var(--font); white-space: nowrap; cursor: pointer; }
.scan-chip.on { background: #fff; color: #1E6B47; font-weight: 600; }
.scan-note { flex-basis: 100%; text-align: center; margin: 2px 0 0; font-size: 14px; color: #FFD08A; }
.scan-foot { display: flex; gap: 8px; padding: 10px 16px 14px; }
.scan-foot button { flex: 1 1 0; min-width: 0; min-height: 50px; border-radius: 12px; border: 0; padding: 0 6px; font: 600 16px var(--font); white-space: nowrap; cursor: pointer; }
.scan-foot .scan-second:first-child { flex: 0 0 auto; padding: 0 16px; }
.scan-main { background: #1E6B47; color: #fff; }
.scan-main:disabled { opacity: .45; }
.scan-second { background: rgba(255,255,255,.14); color: #fff; }
.scan-foot button:active, .scan-tool:active, .scan-chip:active { opacity: .7; }
.scan-fix { display: block; font-size: 14px; padding: 2px 0 0; min-height: 0; }
.pages li > .file-name { display: flex; flex-direction: column; align-items: flex-start; }
.pages li > .file-name > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }

/* Zahldatum (v3.9.1) */
.paid-date { display: flex; flex-direction: column; gap: 8px; background: var(--card); border-radius: 10px; padding: 10px 14px 12px; }
.paid-date label { margin: 0; }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-btn { border: 0; border-radius: 16px; min-height: 32px; padding: 0 12px; background: var(--accent-soft); color: var(--accent); font: 500 15px var(--font); cursor: pointer; }
.chip-btn:active { opacity: .7; }
.paid-hint { text-align: left; margin: -4px 4px 0; font-size: 14px; color: var(--muted); }
