:root {
  --bg: #f4f6f9;
  --surface: #ffffff;
  --surface-2: #eef2f7;
  --text: #17202b;
  --muted: #5f6b7a;
  --border: #dde3ea;
  --accent: #1f4e79;
  --accent-text: #ffffff;
  --accent-soft: #e3edf7;
  --success: #1e7a46;
  --success-soft: #e1f3e8;
  --warn: #a35a00;
  --warn-soft: #fdf0dc;
  --danger: #b42318;
  --danger-soft: #fde8e6;
  --rec: #d92d20;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
  --nav-h: 64px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f141a;
    --surface: #171e26;
    --surface-2: #1f2832;
    --text: #e8edf3;
    --muted: #94a1b2;
    --border: #2b3643;
    --accent: #6aa7e0;
    --accent-text: #0b1520;
    --accent-soft: #1b2b3c;
    --success: #5cc98a;
    --success-soft: #16301f;
    --warn: #f0b45c;
    --warn-soft: #33260f;
    --danger: #f2877d;
    --danger-soft: #3a1a17;
    --shadow: none;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom));
}
a { color: var(--accent); text-decoration: none; }
h1 { font-size: 1.5rem; margin: 0 0 4px; letter-spacing: -.01em; }
h2 { font-size: 1.05rem; margin: 0 0 10px; }
h3 { font-size: .95rem; margin: 0 0 8px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.boot { padding: 40vh 0; text-align: center; color: var(--muted); }

.page { max-width: 760px; margin: 0 auto; padding: 16px 16px 24px; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin: 8px 0 16px; }
.page-head .sub { color: var(--muted); font-size: .9rem; }
.back { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: .9rem; margin-bottom: 6px; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); margin-bottom: 14px; }
.card.tight { padding: 0; overflow: hidden; }

/* Buttons */
.btn {
  appearance: none; border: 1px solid var(--border); background: var(--surface); color: var(--text);
  border-radius: 12px; padding: 11px 16px; font: inherit; font-weight: 600; min-height: 46px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer;
  text-align: center; -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.btn.danger { color: var(--danger); border-color: var(--danger-soft); background: var(--danger-soft); }
.btn.success { background: var(--success); border-color: var(--success); color: #fff; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--accent); }
.btn.block { width: 100%; }
.btn.sm { min-height: 36px; padding: 6px 12px; font-size: .9rem; border-radius: 10px; }
.btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }
.btn-row > .btn { flex: 1 1 140px; }
.actions-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.actions-grid .btn { width: 100%; }
.actions-grid .full { grid-column: 1 / -1; }

/* Forms */
label.field { display: block; margin-bottom: 12px; }
label.field > span { display: block; font-size: .85rem; color: var(--muted); margin-bottom: 4px; font-weight: 500; }
input, select, textarea {
  width: 100%; font: inherit; color: var(--text); background: var(--surface);
  border: 1px solid var(--border); border-radius: 10px; padding: 11px 12px; min-height: 46px;
}
textarea { min-height: 70px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: var(--accent); }
.grid2 { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 0 12px; }
.grid2 > *, .grid3 > *, .item-grid > * { min-width: 0; }
input[type=date] { -webkit-appearance: none; appearance: none; display: block; min-width: 0; }
.grid3 { display: grid; grid-template-columns: minmax(0,2fr) minmax(0,1fr); gap: 0 12px; }
.check { display: flex; gap: 10px; align-items: flex-start; margin: 6px 0 14px; }
.check input { width: 22px; height: 22px; min-height: 0; margin: 1px 0 0; flex: none; }
.hint { font-size: .8rem; color: var(--muted); margin-top: -6px; margin-bottom: 12px; }
details > summary { cursor: pointer; font-weight: 600; padding: 4px 0; list-style: none; }
details > summary::before { content: "▸ "; color: var(--muted); }
details[open] > summary::before { content: "▾ "; }

/* KPIs */
.kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); }
.kpi .label { font-size: .8rem; color: var(--muted); }
.kpi .value { font-size: 1.35rem; font-weight: 700; margin-top: 2px; font-variant-numeric: tabular-nums; }
.kpi .meta { font-size: .8rem; color: var(--muted); }
.kpi.warn .value { color: var(--danger); }

.quick { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 18px; }
.quick .btn { min-height: 64px; flex-direction: column; gap: 4px; font-size: .95rem; }

.banner { background: var(--warn-soft); color: var(--warn); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 14px; font-size: .95rem; }
.banner a { color: inherit; font-weight: 700; text-decoration: underline; }

/* Lists */
.list { list-style: none; margin: 0; padding: 0; }
.list li + li { border-top: 1px solid var(--border); }
.row { display: flex; align-items: center; gap: 12px; padding: 14px 16px; color: var(--text); }
.row .main { flex: 1; min-width: 0; }
.row .title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .meta { font-size: .85rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .amount { font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.empty { padding: 28px 16px; text-align: center; color: var(--muted); }

.chip { display: inline-block; font-size: .75rem; font-weight: 700; padding: 2px 8px; border-radius: 99px; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.chip.draft { background: var(--surface-2); color: var(--muted); }
.chip.open { background: var(--accent-soft); color: var(--accent); }
.chip.paid, .chip.accepted { background: var(--success-soft); color: var(--success); }
.chip.overdue, .chip.rejected, .chip.cancelled { background: var(--danger-soft); color: var(--danger); }
.chip.cancellation { background: var(--warn-soft); color: var(--warn); }

.tabs { display: flex; gap: 8px; overflow-x: auto; margin: 0 -16px 12px; padding: 0 16px; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { border: 1px solid var(--border); background: var(--surface); color: var(--muted); padding: 7px 14px; border-radius: 99px; font: inherit; font-size: .9rem; font-weight: 600; white-space: nowrap; cursor: pointer; }
.tab.active { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.search { margin-bottom: 12px; }

/* Items editor */
.item { border: 1px solid var(--border); border-radius: 12px; padding: 12px; margin-bottom: 10px; background: var(--surface); }
.item.needs-price { border-color: var(--warn); background: var(--warn-soft); }
.item-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.item-head .pos { font-size: .8rem; font-weight: 700; color: var(--muted); }
.item textarea { min-height: 52px; margin-bottom: 8px; }
.item-grid { display: grid; grid-template-columns: minmax(0,.8fr) minmax(0,1.25fr) minmax(0,1.3fr); gap: 8px; }
.item-grid select { padding-left: 8px; padding-right: 4px; }
.item-grid label span { font-size: .75rem; color: var(--muted); display: block; margin-bottom: 2px; }
.item-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; gap: 8px; }
.item-foot select { width: auto; min-height: 36px; padding: 4px 8px; font-size: .9rem; }
.item-foot .line-total { font-weight: 700; font-variant-numeric: tabular-nums; }
.icon-btn { background: none; border: 0; color: var(--muted); padding: 6px; cursor: pointer; border-radius: 8px; display: inline-flex; }
.icon-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.icon-btn:hover { color: var(--danger); background: var(--danger-soft); }

.mic-cta {
  width: 100%; border: 2px dashed var(--accent); background: var(--accent-soft); color: var(--accent);
  border-radius: var(--radius); padding: 18px; font: inherit; font-weight: 700; font-size: 1.05rem;
  display: flex; align-items: center; justify-content: center; gap: 10px; cursor: pointer; margin-bottom: 14px;
}
.mic-cta svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }

/* Sticky totals bar */
.sticky-bar {
  position: sticky; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 8px); z-index: 5;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(16, 24, 40, .14); padding: 12px; display: flex; align-items: center; gap: 10px;
}
.sticky-bar .sum { flex: 1; min-width: 0; }
.sticky-bar .sum .label { font-size: .75rem; color: var(--muted); }
.sticky-bar .sum .value { font-size: 1.2rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.sticky-bar .btn { min-height: 44px; padding: 8px 14px; }
.save-state { font-size: .75rem; color: var(--muted); }

.totals { margin-top: 6px; }
.totals .line { display: flex; justify-content: space-between; padding: 3px 0; font-variant-numeric: tabular-nums; }
.totals .line.grand { font-weight: 800; font-size: 1.1rem; border-top: 1px solid var(--border); margin-top: 6px; padding-top: 8px; }

.doc-summary .amount-big { font-size: 2rem; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; font-size: .92rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; text-align: right; }
.ro-item { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; }
.ro-item + .ro-item { border-top: 1px solid var(--border); }
.ro-item .d { white-space: pre-wrap; }
.ro-item .q { font-size: .85rem; color: var(--muted); }
.ro-item .t { font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }

/* Bottom navigation */
.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; height: calc(var(--nav-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom); background: var(--surface); border-top: 1px solid var(--border);
  display: flex; justify-content: space-around;
}
.bottom-nav a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--muted); font-size: .7rem; font-weight: 600; }
.bottom-nav a.active { color: var(--accent); }
.bottom-nav svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* Auth */
.auth { max-width: 400px; margin: 0 auto; padding: 12vh 20px 40px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.8rem; color: var(--accent); margin-bottom: 6px; letter-spacing: -.02em; }
.logo img { width: 42px; height: 42px; }

/* Toast & Modal */
.toast {
  position: fixed; left: 50%; transform: translateX(-50%); top: calc(env(safe-area-inset-top) + 12px);
  background: #17202b; color: #fff; padding: 12px 18px; border-radius: 12px; z-index: 50; max-width: calc(100% - 32px);
  box-shadow: 0 8px 24px rgba(0,0,0,.25); font-size: .95rem;
}
.toast.error { background: var(--danger); }
.modal-backdrop { position: fixed; inset: 0; background: rgba(10, 15, 20, .55); z-index: 40; display: flex; align-items: flex-end; justify-content: center; }
.modal { background: var(--surface); width: 100%; max-width: 520px; border-radius: 20px 20px 0 0; padding: 20px 18px calc(18px + env(safe-area-inset-bottom)); max-height: 92vh; overflow: auto; }
@media (min-width: 640px) { .modal-backdrop { align-items: center; } .modal { border-radius: 20px; } }
.modal h2 { font-size: 1.2rem; }
.modal p { color: var(--muted); }
.modal .btn-row { margin-top: 16px; }

.rec { text-align: center; padding: 10px 0; }
.rec-btn {
  width: 96px; height: 96px; border-radius: 50%; border: 0; background: var(--rec); color: #fff; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; box-shadow: 0 0 0 0 rgba(217, 45, 32, .5);
}
.rec-btn.on { animation: pulse 1.4s infinite; }
.rec-btn svg { width: 40px; height: 40px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.rec-time { font-size: 1.6rem; font-weight: 700; font-variant-numeric: tabular-nums; margin: 12px 0 4px; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(217,45,32,.55); } 70% { box-shadow: 0 0 0 22px rgba(217,45,32,0); } 100% { box-shadow: 0 0 0 0 rgba(217,45,32,0); } }
.spinner { width: 34px; height: 34px; border: 4px solid var(--accent-soft); border-top-color: var(--accent); border-radius: 50%; animation: spin 1s linear infinite; margin: 10px auto; }
@keyframes spin { to { transform: rotate(360deg); } }
.transcript { background: var(--surface-2); border-radius: 10px; padding: 10px 12px; font-size: .9rem; color: var(--muted); font-style: italic; margin: 10px 0; white-space: pre-wrap; }

@media (min-width: 760px) {
  .kpis { grid-template-columns: repeat(4, 1fr); }
  .item-grid { grid-template-columns: minmax(0,1fr) minmax(0,1fr) minmax(0,1.3fr); }
}
@media (max-width: 380px) {
  .grid2 { grid-template-columns: 1fr; }
  .item-grid { grid-template-columns: 1fr 1fr; }
  .item-grid label:last-child { grid-column: 1 / -1; }
}

/* EU AI Act: KI-Kennzeichnung */
.ai-badge { display: inline-block; font-size: .7rem; font-weight: 800; letter-spacing: .02em; padding: 1px 7px; border-radius: 99px; background: #efe7fb; color: #5b2bab; vertical-align: middle; white-space: nowrap; font-style: normal; }
@media (prefers-color-scheme: dark) { .ai-badge { background: #2c2140; color: #c9a8ff; } }
.ai-note { background: var(--surface-2); border-left: 3px solid #7c4dcc; border-radius: 8px; padding: 8px 10px; color: var(--muted); margin: 8px 0; }
.thumbs { display: flex; align-items: center; gap: 4px; margin-top: 10px; }
.thumbs .icon-btn:hover { color: var(--accent); background: var(--accent-soft); }
.thumbs .icon-btn.active { color: var(--accent); background: var(--accent-soft); }
.fb-item { padding: 12px 0; }
.fb-item + .fb-item { border-top: 1px solid var(--border); }
.legal-links a { color: var(--muted); text-decoration: underline; }
code { font-size: .85em; background: var(--surface-2); padding: 1px 5px; border-radius: 5px; }

/* ---------- v1.2: Onboarding ---------- */
.onb { max-width: 520px; margin: 0 auto; padding: 20px 16px 40px; min-height: 100vh; }
body:has(.onb) { padding-bottom: 0; }
.onb h1 { font-size: 1.6rem; margin: 8px 0 6px; }
.onb-hero { text-align: center; padding: 6vh 0 18px; }
.onb-logo { width: 72px; height: 72px; margin-bottom: 8px; }
.onb-top { display: flex; justify-content: space-between; align-items: center; margin-top: 4px; }
.onb-progress { height: 6px; background: var(--surface-2); border-radius: 99px; overflow: hidden; margin: 8px 0 18px; }
.onb-progress > div { height: 100%; background: var(--accent); border-radius: 99px; transition: width .3s ease; }
.onb-actions { display: grid; grid-template-columns: auto 1fr 1.4fr; gap: 10px; position: sticky; bottom: 0; padding: 12px 0 calc(12px + env(safe-area-inset-bottom)); background: linear-gradient(to top, var(--bg) 75%, transparent); }
.onb-list { list-style: none; margin: 0; padding: 0; }
.onb-list li { display: flex; align-items: center; gap: 12px; padding: 10px 0; }
.onb-list li + li { border-top: 1px solid var(--border); }
.onb-list li .chip { margin-left: auto; }
.onb-steps { padding-left: 20px; margin: 0 0 12px; }
.onb-steps li { margin-bottom: 8px; }
.onb-check { width: 72px; height: 72px; border-radius: 50%; background: var(--success-soft); color: var(--success); display: inline-flex; align-items: center; justify-content: center; margin-bottom: 8px; }
.onb-check svg { width: 38px; height: 38px; fill: none; stroke: currentColor; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.choice-group { display: grid; gap: 10px; margin-bottom: 14px; }
.choice { display: flex; gap: 12px; align-items: flex-start; border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; cursor: pointer; }
.choice input { width: 20px; height: 20px; min-height: 0; margin: 2px 0 0; flex: none; accent-color: var(--accent); }
.choice > span { display: flex; flex-direction: column; gap: 2px; }
.choice:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.setup-banner { display: flex; align-items: center; gap: 12px; justify-content: space-between; }
.setup-banner .btn { flex: none; color: var(--accent-text); text-decoration: none; }

/* ---------- v1.2: Einstellungen ---------- */
.sicon { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.set-group { margin-bottom: 16px; }
.set-group h3 { margin: 0 0 6px 4px; }
.set-group .card { margin-bottom: 0; }
.set-row { padding: 12px 14px; }
.set-row .set-ico { width: 34px; height: 34px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); display: inline-flex; align-items: center; justify-content: center; flex: none; }
.set-row > .sicon { color: var(--muted); width: 18px; height: 18px; }
.set-row.active { background: var(--accent-soft); }
.set-profile { display: flex; align-items: center; gap: 14px; }
.set-profile .main { min-width: 0; }
.set-profile .title { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.set-profile .meta { color: var(--muted); font-size: .85rem; }
.avatar { width: 48px; height: 48px; border-radius: 50%; background: var(--accent); color: var(--accent-text); display: inline-flex; align-items: center; justify-content: center; font-weight: 800; flex: none; }
.page.wide { max-width: 1040px; }
.settings-layout { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 28px; align-items: start; }
.settings-layout aside { min-width: 0; }
.settings-layout .set-row .meta { display: none; }
.settings-layout .set-row { padding: 9px 12px; }
.settings-layout .set-row .set-ico { width: 30px; height: 30px; }
.set-title { font-size: 1.3rem; margin: 4px 0 8px; }
.bottom-nav a span { font-size: .66rem; white-space: nowrap; letter-spacing: -.01em; }

/* ---------- v1.3: Anhänge & Senden ---------- */
.att-head { display: flex; align-items: center; justify-content: space-between; }
.att-head h2 { display: flex; align-items: center; gap: 8px; }
.att-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; margin-bottom: 12px; }
.att { position: relative; min-width: 0; }
.att-thumb { display: block; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: var(--surface-2); border: 1px solid var(--border); }
.att-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.att-icon { width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: var(--accent); }
.att-icon svg { width: 34px; height: 34px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linejoin: round; }
.att-icon small { font-weight: 800; font-size: .7rem; }
.att-name { font-size: .75rem; margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.att-meta { font-size: .7rem; color: var(--muted); }
.att-del { position: absolute; top: 4px; right: 4px; width: 26px; height: 26px; border-radius: 50%; border: 0; background: rgba(0,0,0,.6); color: #fff; font-size: 18px; line-height: 1; cursor: pointer; }
.btn.sm svg { width: 18px; height: 18px; }
label.btn { cursor: pointer; }
.send-list { border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px 2px; margin-bottom: 10px; }
.send-list .check { margin: 4px 0 10px; }
.send-list .check span { min-width: 0; overflow-wrap: anywhere; }
.send-att-add { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.choice-group.compact .choice { padding: 10px 12px; }
.send-status { min-height: 1.2em; margin: 4px 0 0; }
.send-footer { position: sticky; bottom: calc(-18px - env(safe-area-inset-bottom)); background: var(--surface); padding: 10px 0 calc(6px + env(safe-area-inset-bottom)); margin-top: 6px; border-top: 1px solid var(--border); }

/* ---------- v1.4: E-Rechnung ---------- */
.einv-badge { display: inline-block; font-size: .7rem; font-weight: 800; padding: 2px 8px; border-radius: 99px; background: var(--success-soft); color: var(--success); white-space: nowrap; vertical-align: middle; }
.einv-badge::before { content: "✓ "; }
.einv-note { background: var(--success-soft); color: var(--text); border-radius: 10px; padding: 9px 12px; margin: 0 0 12px; }
.head-chips { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }

/* ---------- v1.4.1: QR-Code Handy-Adresse ---------- */
.qr-card { display: flex; gap: 16px; align-items: center; border: 2px solid var(--accent); }
.qr-svg { width: 132px; height: 132px; flex: none; background: #fff; border-radius: 10px; padding: 6px; display: flex; align-items: center; justify-content: center; }
.qr-svg svg { width: 100%; height: 100%; display: block; }
.qr-wait { background: var(--surface-2); }
.qr-text { min-width: 0; }
.qr-text h2 { margin-bottom: 4px; }
.qr-text p { margin: 0 0 6px; }
.qr-url { display: block; font-size: .78rem; word-break: break-all; padding: 6px 8px; }
@media (max-width: 420px) { .qr-card { flex-direction: column; text-align: center; } .qr-svg { width: 180px; height: 180px; } }

/* ---------- v1.5: Leistungskatalog ---------- */
.item-head .save-cat:hover { color: var(--accent); background: var(--accent-soft); }
.cat-pick { max-height: 52vh; overflow: auto; border: 1px solid var(--border); border-radius: 12px; margin-bottom: 8px; }
.cat-row { display: flex; width: 100%; align-items: center; gap: 10px; padding: 12px; background: none; border: 0; border-bottom: 1px solid var(--border); text-align: left; font: inherit; color: var(--text); cursor: pointer; }
.cat-row:last-child { border-bottom: 0; }
.cat-row .main { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.cat-row .d { font-weight: 600; }
.cat-row .q { font-size: .85rem; color: var(--muted); }
.cat-add { width: 32px; height: 32px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: inline-flex; align-items: center; justify-content: center; flex: none; }
.cat-add svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }
.cat-row.picked { background: var(--success-soft); }
.cat-row.picked .cat-add { background: var(--success); color: #fff; }

/* ---------- v1.5: Wiederkehrende Rechnungen ---------- */
.tab-link { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; border-style: dashed; }
.tab-link svg, .rec-plan h2 svg, .banner svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -3px; }
.rec-plan { border: 2px solid var(--accent); }
.rec-plan h2 { display: flex; align-items: center; gap: 8px; }
.rec-mark { color: var(--accent); font-weight: 800; }
.rec-ico svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.rec-ico.off { background: var(--surface-2); color: var(--muted); }
.rec-banner { display: flex; gap: 10px; align-items: center; text-decoration: none; background: var(--accent-soft); color: var(--text); }

/* ---------- v1.6: Bestellung einlesen, Abnahmeprotokoll, Unterschrift, Logo, Nummernkreise ---------- */
.quick .btn.wide { grid-column: 1 / -1; min-height: 52px; flex-direction: row; gap: 10px; }
.order-drop { text-align: center; border-style: dashed; border-width: 2px; padding: 22px 16px; }
.order-drop.over { border-color: var(--accent); background: var(--accent-soft); }
.order-ico svg { width: 44px; height: 44px; stroke: var(--accent); fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.import-banner { display: flex; gap: 10px; align-items: flex-start; background: var(--accent-soft); color: var(--text); }
.import-banner svg, .proto-status svg { width: 20px; height: 20px; flex: 0 0 auto; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.proto-status { list-style: none; margin: 0 0 12px; padding: 0; }
.proto-status li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.proto-status li:last-child { border-bottom: 0; }
.proto-status .ps-ico { color: var(--muted); display: flex; }
.proto-status li.ok .ps-ico { color: var(--success); }
.proto-status .ps-text { flex: 1; min-width: 0; line-height: 1.3; }
.link-btn { background: none; border: 0; padding: 6px 4px; color: var(--accent); font: inherit; font-size: .9rem; font-weight: 600; cursor: pointer; }
.proto-row { border-top: 1px solid var(--border); padding-top: 8px; margin-top: 8px; }
.proto-row .d { font-weight: 600; margin-bottom: 6px; white-space: pre-line; }
fieldset.plain { border: 0; margin: 0; padding: 0; min-width: 0; }
.sig-pad { position: relative; border: 1.5px dashed var(--border); border-radius: 12px; background: #fff; margin: 4px 0 12px; touch-action: none; overflow: hidden; }
.sig-pad canvas { display: block; width: 100%; touch-action: none; cursor: crosshair; }
.sig-line { position: absolute; left: 18px; right: 18px; bottom: 34px; border-top: 1px solid #c4ccd6; padding-top: 4px; font-size: .75rem; color: #8a96a5; pointer-events: none; }
.sig-saved { background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 10px; margin: 10px 0; min-height: 60px; display: flex; align-items: center; justify-content: center; }
.sig-saved img { max-width: 100%; max-height: 90px; }
.logo-prev { background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 12px; margin-bottom: 10px; min-height: 64px; display: flex; align-items: center; justify-content: center; text-align: center; }
.logo-prev img { max-width: 100%; max-height: 90px; }
.num-block + .num-block { border-top: 1px solid var(--border); padding-top: 12px; }
.num-block h2 { margin-top: 0; }
code { background: var(--surface-2); padding: 1px 5px; border-radius: 5px; font-size: .85em; }
@media (prefers-color-scheme: dark) { .sig-line { border-top-color: #c4ccd6; } }
