/* Rechnungen — im Look von Life OS „Abendlicht“:
   eine große Platte auf ruhigem Grund, oben der Himmel, cremige Karten,
   Pill-Navigation mit dunkler Aktiv-Pille, Orange als einzige Akzentfarbe.
   Kein Grün, auch nicht als „bezahlt“-Farbe: bezahlt ist ruhig, nicht grün. */
:root {
  --font: 'DM Sans', system-ui, -apple-system, sans-serif;
  --surface: #fffaf3; --surface-2: #f6ece3; --bg-tint: #efe1d6;
  --text: #392e35; --text-dim: #725f65; --text-faint: #806e73;
  --accent: #b8520a; --accent-2: #e07c3a;
  --accent-fill: #f59450; --accent-ink: #3a2412; --accent-soft: #f3a47826; --accent-line: #c6805b66;
  --peach: #f2a478; --solid: #473943; --solid-text: #fff7ed;
  --border: #70565b24; --border-soft: #70565b14;
  --page: #a59a9e; --shell-base: #f4e9df; --cloud-veil: #f6eade;
  --cool: #826777; --danger: #b13c50; --warn: #946123;
  --r: 29px; --r-lg: 32px; --r-sm: 17px;
  --shadow: 0 4px 18px #5a394509; --shadow-hover: 0 10px 28px #5a394513;
  color-scheme: light;
}
:root[data-theme='dark'] {
  --surface: #382e37; --surface-2: #443640; --bg-tint: #4d3e46;
  --text: #fff4eb; --text-dim: #dcc3c8; --text-faint: #c0a4ae;
  --accent: #fa9440; --accent-2: #fcb77e;
  --accent-fill: #f89a4e; --accent-ink: #2a1a0e; --accent-soft: #f3a47824; --accent-line: #f3a47866;
  --solid: #f4ae87; --solid-text: #392e35;
  --border: #f9d7c929; --border-soft: #f9d7c919;
  --page: #211b23; --shell-base: #302630; --cloud-veil: #302630;
  --cool: #d2accc; --danger: #ffa0ab; --warn: #ebc17d;
  --shadow: 0 5px 20px #160d1b20; --shadow-hover: 0 12px 28px #160d1b35;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--font); color: var(--text); background: var(--page); -webkit-font-smoothing: antialiased; font-size: 14px; padding: 22px; min-height: 100vh; }
h1, h2, h3 { margin: 0; font-weight: 500; letter-spacing: -.02em; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.num { font-variant-numeric: tabular-nums; }

/* ---------- Platte + Himmel ---------- */
.shell { position: relative; isolation: isolate; background: var(--shell-base); max-width: 1440px; margin: 0 auto; border-radius: 40px; padding: 24px 38px 46px; box-shadow: 0 24px 55px #3c293b30; min-height: calc(100vh - 44px); }
.himmel { position: absolute; inset: 0 0 auto; height: 420px; z-index: -2; border-radius: 40px 40px 0 0; background: url('/static/himmel.jpg') center / cover; pointer-events: none; -webkit-mask-image: linear-gradient(#000 55%, transparent 98%); mask-image: linear-gradient(#000 55%, transparent 98%); }
.shell::before { content: ''; position: absolute; inset: 0 0 auto; height: 420px; z-index: -1; border-radius: 40px 40px 0 0; pointer-events: none; background: linear-gradient(90deg, var(--cloud-veil) 0%, transparent 90%), linear-gradient(0deg, var(--shell-base), transparent 60%); }
:root[data-theme='dark'] .himmel { opacity: .38; }

/* ---------- Kopf ---------- */
.topbar { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; margin-right: auto; }
.brand-mark { width: 40px; height: 40px; border-radius: 14px; background: var(--accent-fill); display: grid; place-items: center; color: var(--accent-ink); overflow: hidden; flex: none; }
.brand-mark.has-logo { background: #fffaf3; padding: 6px 12px; width: auto; max-width: 170px; box-shadow: var(--shadow); }
.brand-mark.app-icon { background: none; width: 46px; height: 46px; }
.brand-mark.app-icon img { width: 46px; height: 46px; max-width: none; max-height: none; transform: scale(1.22); }
.brand-mark img { max-width: 100%; max-height: 100%; object-fit: contain; }
.brand-mark.has-logo img { height: 28px; }
.brand h1 { font-size: 22px; font-weight: 500; line-height: 1.1; }
.brand .sub { font-size: 11px; color: var(--text-dim); letter-spacing: .02em; }
.tabs { display: flex; gap: 4px; background: var(--surface); padding: 5px; border-radius: 999px; box-shadow: var(--shadow); }
.tab { text-decoration: none; padding: 0 17px; min-height: 40px; display: inline-flex; align-items: center; border-radius: 999px; color: var(--text-dim); font-size: 13.5px; white-space: nowrap; transition: background .16s, color .16s; }
.tab:hover { background: var(--bg-tint); color: var(--text); }
.tab.on { background: var(--solid); color: var(--solid-text); font-weight: 500; }
.top-actions { display: flex; gap: 8px; align-items: center; }
.icon-btn { width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--surface); color: var(--text-dim); display: grid; place-items: center; box-shadow: var(--shadow); }
.icon-btn:hover { color: var(--accent); }

/* ---------- Knöpfe ---------- */
.solid-btn, .btn, .ghost-btn, .danger-btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 42px; padding: 0 18px; border-radius: 999px; font-size: 13.5px; font-weight: 500; text-decoration: none; border: 1px solid transparent; transition: filter .15s, background .15s, color .15s, border-color .15s; white-space: nowrap; }
.solid-btn { background: var(--solid); color: var(--solid-text); }
.solid-btn:hover { filter: brightness(1.12); }
.btn { background: var(--accent-fill); color: var(--accent-ink); }
.btn:hover { filter: brightness(1.05); }
.ghost-btn { background: var(--surface); color: var(--text); border-color: var(--border); }
.ghost-btn:hover { border-color: var(--accent-line); color: var(--accent); background: var(--accent-soft); }
.danger-btn { background: transparent; color: var(--danger); border-color: var(--border); }
.danger-btn:hover { background: color-mix(in srgb, var(--danger) 10%, transparent); }
button:disabled { opacity: .45; cursor: default; filter: none; }
.link-btn { border: 0; background: none; color: var(--accent); padding: 4px 0; font-size: 13px; font-weight: 500; }
.link-btn:hover { text-decoration: underline; }
.sm { min-height: 34px; padding: 0 13px; font-size: 12.5px; }

/* ---------- Begrüßung ---------- */
.hello { display: flex; align-items: center; gap: 22px; padding: 30px 0 26px; }
.hello p { font-size: 11px; text-transform: uppercase; letter-spacing: .14em; color: var(--text-dim); margin: 0 0 10px; }
.hello h2 { font-size: clamp(30px, 3.6vw, 44px); font-weight: 400; letter-spacing: -.045em; line-height: 1.12; max-width: 22ch; }
.hello h2 em { font-style: normal; color: var(--accent); }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 30px 0 22px; }
.page-head p { font-size: 11px; text-transform: uppercase; letter-spacing: .14em; color: var(--text-dim); margin: 0 0 10px; }
.page-head h2 { font-size: clamp(28px, 3vw, 38px); font-weight: 400; letter-spacing: -.04em; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* Die Wolke aus Life OS — atmet ruhig, wird bei Überfälligem schneller */
.cloud-orb { position: relative; width: 84px; height: 84px; flex: none; --breath: 7s; }
.cloud-halo { position: absolute; inset: 2%; background: radial-gradient(ellipse, #f6a26788, transparent 68%); filter: blur(5px); animation: cloud-halo var(--breath) ease-in-out infinite; }
.cloud-body { position: absolute; inset: 16% 2% 15%; animation: cloud-breath var(--breath) ease-in-out infinite; filter: drop-shadow(0 6px 6px #9f6b853a); }
.cloud-body span { position: absolute; border-radius: 50%; background: radial-gradient(ellipse at 36% 20%, #fffdf1 8%, #ffe6c7 38%, #eabfae 65%, #a58b9c); box-shadow: inset -2px -4px 7px #97718428; }
.cloud-body span:nth-child(1) { width: 47%; height: 62%; left: 2%; top: 32%; }
.cloud-body span:nth-child(2) { width: 55%; height: 82%; left: 24%; top: 3%; }
.cloud-body span:nth-child(3) { width: 40%; height: 60%; right: 0; top: 33%; }
.cloud-body span:nth-child(4) { width: 65%; height: 54%; left: 17%; top: 46%; background: radial-gradient(ellipse at 40% 0%, #fff0d6, #e9bdac 65%, #ac8e9e); }
.cloud-orb.urgent { --breath: 3.8s; }
.cloud-orb.urgent .cloud-halo { background: radial-gradient(ellipse, #f2954dcc, transparent 70%); }
@keyframes cloud-breath { 0%, 100% { transform: translateY(2px) scale(.93); } 50% { transform: translateY(-2px) scale(1.05); } }
@keyframes cloud-halo { 0%, 100% { transform: scale(.85); opacity: .55; } 50% { transform: scale(1.12); opacity: 1; } }

/* ---------- Raster + Karten ---------- */
.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px; align-items: start; }
.span-3 { grid-column: span 3; } .span-4 { grid-column: span 4; } .span-5 { grid-column: span 5; }
.span-6 { grid-column: span 6; } .span-7 { grid-column: span 7; } .span-8 { grid-column: span 8; } .span-12 { grid-column: span 12; }
.card { background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); min-width: 0; }
.card-head { display: flex; align-items: center; gap: 10px; padding: 20px 23px 14px; flex-wrap: wrap; }
.card-head h3 { font-size: 17px; font-weight: 500; letter-spacing: -.025em; }
.card-head .spacer { flex: 1; }
.card-head .hint { font-size: 12px; color: var(--text-faint); }
.card-body { padding: 0 23px 23px; }
.card.warm { background: var(--accent-fill); color: var(--accent-ink); }
.card.warm .card-head h3, .card.warm p { color: var(--accent-ink); }
.card.dark { background: var(--solid); color: var(--solid-text); }

.kpi { padding: 20px 23px 22px; }
.kpi .label { font-size: 12.5px; color: var(--text-dim); display: flex; align-items: center; gap: 8px; }
.kpi .label::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--dot, var(--text-faint)); }
.kpi .value { font-size: 34px; font-weight: 400; letter-spacing: -.04em; margin-top: 12px; line-height: 1; }
.kpi .value .unit { font-size: 15px; color: var(--text-faint); margin-left: 3px; letter-spacing: 0; }
.kpi .foot { font-size: 12px; color: var(--text-faint); margin-top: 8px; }
.kpi.accent { --dot: var(--accent); }
.kpi.danger { --dot: var(--danger); }
.kpi.cool { --dot: var(--cool); }
.card.dark .kpi .label, .card.dark .kpi .foot, .card.dark .kpi .unit { color: color-mix(in srgb, var(--solid-text) 70%, transparent); }

/* Monatsbalken */
.bars { display: grid; grid-template-columns: repeat(12, 1fr); gap: 8px; align-items: end; height: 170px; padding-top: 10px; }
.bar { display: flex; flex-direction: column; align-items: center; gap: 7px; height: 100%; justify-content: flex-end; }
.bar i { display: block; width: 100%; max-width: 34px; border-radius: 10px; background: var(--bg-tint); min-height: 4px; position: relative; }
.bar.has i { background: var(--accent-fill); }
.bar.now i { background: var(--accent); }
.bar span { font-size: 10.5px; color: var(--text-faint); }
.bar i:hover::after { content: attr(data-v); position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); background: var(--solid); color: var(--solid-text); font-size: 11px; font-style: normal; padding: 4px 8px; border-radius: 8px; white-space: nowrap; }

/* ---------- Listen / Tabellen ---------- */
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 18px 23px 12px; }
.pills { display: flex; gap: 4px; flex-wrap: wrap; }
.pill-btn { border: 0; background: transparent; color: var(--text-dim); padding: 0 14px; min-height: 36px; border-radius: 999px; font-size: 13px; }
.pill-btn:hover { background: var(--bg-tint); }
.pill-btn.on { background: var(--solid); color: var(--solid-text); }
.pill-btn .count { opacity: .6; margin-left: 4px; }
.search { margin-left: auto; min-width: 220px; }
table.list { width: 100%; border-collapse: collapse; }
.list th { text-align: left; font-size: 11.5px; font-weight: 500; color: var(--text-faint); padding: 10px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.list td { padding: 13px 12px; border-bottom: 1px solid var(--border-soft); vertical-align: middle; }
.list th:first-child, .list td:first-child { padding-left: 23px; }
.list th:last-child, .list td:last-child { padding-right: 23px; }
.list tr.click { cursor: pointer; transition: background .12s; }
.list tr.click:hover td { background: var(--accent-soft); }
.list tr:last-child td { border-bottom: 0; }
.list .r { text-align: right; }
.list .dim { color: var(--text-dim); font-size: 13px; }
.list .strong { font-weight: 500; }
.table-wrap { overflow-x: auto; }

.status { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 500; padding: 4px 10px 4px 9px; border-radius: 999px; background: var(--bg-tint); color: var(--text-dim); white-space: nowrap; }
.status::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status.draft { background: transparent; box-shadow: inset 0 0 0 1px var(--border); color: var(--text-faint); }
.status.issued { background: var(--accent-soft); color: var(--accent); }
.status.overdue { background: color-mix(in srgb, var(--danger) 13%, transparent); color: var(--danger); }
.status.paid { background: color-mix(in srgb, var(--cool) 14%, transparent); color: var(--cool); }
.status.cancelled, .status.storno { color: var(--text-faint); }

.empty { text-align: center; padding: 42px 20px 46px; color: var(--text-dim); }
.empty h4 { font-size: 17px; font-weight: 500; color: var(--text); margin: 0 0 6px; }
.empty p { margin: 0 0 16px; }

/* ---------- Formulare ---------- */
.fields { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px 14px; }
.field { display: flex; flex-direction: column; gap: 6px; grid-column: span 6; min-width: 0; }
.field.half { grid-column: span 3; } .field.third { grid-column: span 2; } .field.two-third { grid-column: span 4; }
.field label { font-size: 12px; color: var(--text-dim); font-weight: 500; }
.field label .req { color: var(--accent); }
.field .help { font-size: 11.5px; color: var(--text-faint); line-height: 1.4; }
input, select, textarea { background: var(--surface-2); border: 1px solid transparent; border-radius: 14px; padding: 0 13px; min-height: 42px; font-size: 14px; width: 100%; transition: border-color .15s, background .15s; }
textarea { padding: 11px 13px; min-height: 76px; resize: vertical; line-height: 1.45; }
input:hover, select:hover, textarea:hover { border-color: var(--border); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); background: var(--surface); }
input.missing { border-color: var(--accent-line); background: var(--accent-soft); }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23806e73' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 13px center; padding-right: 34px; }
.section-title { font-size: 11px; text-transform: uppercase; letter-spacing: .12em; color: var(--text-faint); margin: 8px 0 -2px; grid-column: span 6; }

/* Positionen: oben Bezeichnung + Zahlen, darunter die Beschreibung über die volle Breite */
.lines { display: flex; flex-direction: column; gap: 10px; }
.line, .line-head { display: grid; grid-template-columns: 24px minmax(0, 1fr) 70px 108px 100px 76px 96px 34px; gap: 8px; }
.line { align-items: center; background: var(--surface-2); border-radius: 20px; padding: 10px; }
.line .pos { font-size: 12px; color: var(--text-faint); text-align: center; }
.line .desc { grid-column: 2 / -2; }
.line input, .line select, .line textarea { background: var(--surface); }
.line textarea { min-height: 38px; font-size: 13px; padding: 8px 12px; }
.line .sum { text-align: right; padding-right: 4px; font-weight: 500; white-space: nowrap; }
.line .x { width: 34px; height: 34px; border-radius: 50%; border: 0; background: transparent; color: var(--text-faint); display: grid; place-items: center; }
.line .x:hover { background: var(--bg-tint); color: var(--danger); }
.line-head { padding: 0 10px 2px; font-size: 11px; color: var(--text-faint); }
.line-head .r { text-align: right; padding-right: 4px; }
.line .r input { text-align: right; }
.line-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.no-rate .line, .no-rate .line-head { grid-template-columns: 24px minmax(0, 1fr) 70px 108px 100px 96px 34px; }
.no-rate .rate-col { display: none; }

/* Summenkarte */
.sticky { position: sticky; top: 16px; }
.totals { display: flex; flex-direction: column; gap: 9px; }
.totals .row { display: flex; justify-content: space-between; gap: 12px; font-size: 13.5px; color: var(--text-dim); }
.totals .row.big { color: var(--text); font-size: 15px; font-weight: 500; padding-top: 12px; margin-top: 4px; border-top: 1.5px solid var(--accent); }
.totals .row.big .num { font-size: 26px; letter-spacing: -.03em; font-weight: 500; }
.checks { list-style: none; margin: 16px 0 0; padding: 0; display: flex; flex-direction: column; gap: 7px; }
.checks li { font-size: 12.5px; line-height: 1.4; display: flex; gap: 8px; color: var(--text-dim); }
.checks li::before { content: ''; flex: none; width: 7px; height: 7px; border-radius: 50%; margin-top: 6px; background: var(--accent); }
.checks li.warn::before { background: var(--warn); }
.checks.ok li::before { background: var(--cool); }
.stack { display: flex; flex-direction: column; gap: 8px; margin-top: 18px; }
.stack .row2 { display: flex; gap: 8px; }
.stack .row2 > * { flex: 1; }
.note { font-size: 12px; color: var(--text-faint); line-height: 1.45; margin: 12px 0 0; }
.tax-note { font-size: 12.5px; background: var(--accent-soft); color: var(--text); border-radius: 14px; padding: 10px 13px; margin-top: 12px; line-height: 1.45; }

/* Detailansicht */
.pdf-frame { width: 100%; height: 78vh; min-height: 560px; border: 0; border-radius: 0 0 var(--r) var(--r); background: #fff; display: block; }
.meta-list { display: grid; grid-template-columns: auto 1fr; gap: 9px 16px; font-size: 13px; }
.meta-list dt { color: var(--text-faint); }
.meta-list dd { margin: 0; text-align: right; font-weight: 500; overflow-wrap: anywhere; }
.timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.timeline li { font-size: 12.5px; display: flex; gap: 10px; color: var(--text-dim); }
.timeline li b { color: var(--text); font-weight: 500; }
.timeline time { color: var(--text-faint); white-space: nowrap; }
.hash { font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: 10.5px; color: var(--text-faint); overflow-wrap: anywhere; }

/* Setup-Hinweis */
.setup { display: flex; gap: 18px; align-items: center; padding: 20px 23px; flex-wrap: wrap; }
.setup .txt { flex: 1; min-width: 240px; }
.setup h3 { font-size: 17px; }
.setup p { margin: 5px 0 0; font-size: 13px; opacity: .85; }

/* Logo / Erscheinungsbild */
.logo-drop { border: 1.5px dashed var(--border); border-radius: 20px; min-height: 120px; display: grid; place-items: center; padding: 16px; text-align: center; color: var(--text-dim); font-size: 13px; cursor: pointer; background: var(--surface-2); transition: border-color .15s, background .15s; }
.logo-drop:hover, .logo-drop.over { border-color: var(--accent); background: var(--accent-soft); }
.logo-drop img { max-height: 76px; max-width: 100%; object-fit: contain; display: block; margin: 0 auto; }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.swatch { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--surface); box-shadow: 0 0 0 1px var(--border); padding: 0; }
.swatch.on { box-shadow: 0 0 0 2px var(--text); }
.swatches input[type=color] { width: 44px; height: 34px; padding: 2px; border-radius: 12px; min-height: 0; }

/* Dialog + Toasts */
dialog { border: 0; padding: 0; border-radius: var(--r-lg); background: var(--surface); color: var(--text); width: min(640px, calc(100vw - 32px)); max-height: calc(100vh - 40px); box-shadow: 0 30px 80px #2a1b2860; }
dialog::backdrop { background: #2a1d2866; backdrop-filter: blur(3px); }
.dlg-head { padding: 24px 26px 6px; display: flex; align-items: center; gap: 10px; }
.dlg-head h3 { font-size: 20px; font-weight: 500; flex: 1; }
.dlg-body { padding: 12px 26px 8px; }
.dlg-body p { margin: 0 0 10px; line-height: 1.5; color: var(--text-dim); }
.dlg-foot { padding: 16px 26px 24px; display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.toasts { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 50; pointer-events: none; }
.toast { background: var(--solid); color: var(--solid-text); padding: 12px 20px; border-radius: 999px; font-size: 13.5px; box-shadow: var(--shadow-hover); animation: toast-in .25s ease-out; max-width: calc(100vw - 32px); }
.toast.err { background: var(--danger); color: #fff; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

.muted { color: var(--text-faint); }
.mt { margin-top: 16px; }
.row-gap { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.kbd { font-size: 11px; color: var(--text-faint); }

/* ---------- Kleinere Bildschirme ---------- */
@media (max-width: 1180px) {
  .span-3 { grid-column: span 6; } .span-4 { grid-column: span 6; } .span-5, .span-7, .span-8 { grid-column: span 12; }
  .sticky { position: static; }
  .line, .no-rate .line { grid-template-columns: 24px 1fr 1fr 1fr 34px; }
  .line-head { display: none; }
  .line .name { grid-column: 2 / 5; grid-row: 1; }
  .line .x { grid-column: 5; grid-row: 1; }
  .line .desc { grid-column: 2 / 5; grid-row: 2; }
  .line .qty { grid-column: 2; grid-row: 3; } .line .unit { grid-column: 3; grid-row: 3; } .line .price { grid-column: 4; grid-row: 3; }
  .line .rate-col { grid-column: 2; grid-row: 4; } .line .sum { grid-column: 3 / 5; grid-row: 4; }
  .no-rate .line .sum { grid-column: 2 / 5; }
}
@media (max-width: 720px) {
  body { padding: 0; }
  .shell { border-radius: 0; padding: calc(18px + env(safe-area-inset-top, 0px)) 16px 90px; min-height: 100dvh; }
  .himmel, .shell::before { border-radius: 0; }
  .tabs { order: 3; width: 100%; overflow-x: auto; scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }
  .tab { padding: 0 13px; flex: 1 0 auto; justify-content: center; }
  .top-actions .solid-btn { position: fixed; right: 16px; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); z-index: 20; box-shadow: var(--shadow-hover); min-height: 50px; }
  .span-3, .span-4, .span-6 { grid-column: span 12; }
  .hello .cloud-orb { width: 62px; height: 62px; }
  .field.half, .field.third, .field.two-third { grid-column: span 6; }
  .search { min-width: 0; width: 100%; margin-left: 0; }
  .hide-sm { display: none; }
  input, select, textarea { font-size: 16px; }
  .list td, .list th { padding-left: 8px; padding-right: 8px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ============================================================
   Schnell-Rechnung — eine Frage pro Bildschirm, große Ziele fürs Handy
   ============================================================ */
.wiz { max-width: 560px; margin: 0 auto; padding: 18px 0 120px; }
.wiz-top { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.wiz-progress { flex: 1; height: 8px; border-radius: 99px; background: var(--surface); overflow: hidden; box-shadow: var(--shadow); }
.wiz-progress i { display: block; height: 100%; border-radius: 99px; background: var(--accent-fill); transition: width .35s cubic-bezier(.2, .8, .2, 1); }
.wiz-card { padding: 28px 26px 26px; animation: wiz-in .32s cubic-bezier(.2, .8, .2, 1); }
@keyframes wiz-in { from { opacity: 0; transform: translateY(14px) scale(.985); } }
.wiz-kicker { font-size: 11px; text-transform: uppercase; letter-spacing: .14em; color: var(--text-dim); margin: 0 0 10px; }
.wiz-q { font-size: clamp(26px, 6.4vw, 34px); font-weight: 400; letter-spacing: -.04em; line-height: 1.12; margin: 0 0 18px; }
.wiz-hint { color: var(--text-dim); margin: -8px 0 18px; }
.wiz-body { display: flex; flex-direction: column; gap: 12px; }
.wiz-sub { font-size: 12px; color: var(--text-faint); margin: 8px 0 0; }
.center { text-align: center; justify-content: center; }
.wiz-input, .wiz-search { min-height: 56px; font-size: 18px; border-radius: 18px; padding: 0 18px; }
.wiz-desc { min-height: 48px; font-size: 16px; border-radius: 16px; }
.wiz-list { display: flex; flex-direction: column; gap: 8px; max-height: 52vh; overflow-y: auto; }
.wiz-option { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; text-align: left; padding: 15px 18px; border-radius: 18px; border: 1px solid var(--border); background: var(--surface-2); min-height: 60px; transition: transform .12s, border-color .15s, background .15s; }
.wiz-option b { font-size: 16px; font-weight: 500; color: var(--text); }
.wiz-option span { font-size: 13px; color: var(--text-dim); }
.wiz-option:hover { border-color: var(--accent-line); background: var(--accent-soft); }
.wiz-option:active, .wiz-chip:active, .wiz-round:active { transform: scale(.97); }
.wiz-plus { align-self: flex-start; padding: 8px 0; font-size: 14px; }
.wiz-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.wiz-chip { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: 99px; border: 1px solid var(--border); background: var(--surface-2); font-size: 14px; color: var(--text); }
.wiz-chip small { color: var(--text-faint); font-size: 12px; }
.wiz-chip.on { background: var(--solid); color: var(--solid-text); border-color: transparent; }
.wiz-stepper { display: grid; grid-template-columns: 64px 1fr 64px; gap: 12px; align-items: center; margin: 6px 0 4px; }
.wiz-round { width: 64px; height: 64px; border-radius: 50%; border: 0; background: var(--surface-2); font-size: 30px; line-height: 1; color: var(--text); }
.wiz-big { min-height: 76px; font-size: 40px; text-align: center; letter-spacing: -.03em; border-radius: 22px; font-variant-numeric: tabular-nums; }
.wiz-money { display: flex; align-items: center; gap: 10px; }
.wiz-money span { font-size: 34px; color: var(--text-dim); }
.wiz-total { font-size: 20px; color: var(--text-dim); margin: 2px 0 0; font-variant-numeric: tabular-nums; }
.wiz-seg { display: inline-flex; background: var(--surface-2); border-radius: 99px; padding: 3px; vertical-align: middle; }
.wiz-seg button { border: 0; background: none; min-height: 32px; padding: 0 12px; border-radius: 99px; font-size: 13px; color: var(--text-dim); }
.wiz-seg button.on { background: var(--solid); color: var(--solid-text); }
.wiz-lines { display: flex; flex-direction: column; gap: 8px; }
.wiz-line { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center; padding: 13px 16px; border-radius: 16px; background: var(--surface-2); }
.wiz-line b { display: block; font-weight: 500; }
.wiz-line span { font-size: 12.5px; color: var(--text-dim); }
.wiz-line .x { width: 32px; height: 32px; border-radius: 50%; border: 0; background: none; color: var(--text-faint); font-size: 20px; }
.wiz-two { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 4px; }
.wiz-alt { min-height: 50px; }
.wiz-dates { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; align-items: center; }
.wiz-dates span { color: var(--text-faint); font-size: 13px; }
.wiz-sum { display: flex; flex-direction: column; gap: 8px; padding-bottom: 6px; }
.wiz-row { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; }
.wiz-row span { color: var(--text-dim); }
.wiz-row b { font-weight: 500; text-align: right; }
.wiz-tot { display: flex; flex-direction: column; gap: 6px; padding: 6px 4px 0; }
.wiz-tot div { display: flex; justify-content: space-between; color: var(--text-dim); font-size: 14px; }
.wiz-tot .big { color: var(--text); font-size: 17px; font-weight: 500; border-top: 1.5px solid var(--accent); padding-top: 10px; margin-top: 4px; }
.wiz-tot .big .num { font-size: 28px; letter-spacing: -.03em; }
.wiz-bar { position: sticky; bottom: 0; padding: 14px 0 calc(14px + env(safe-area-inset-bottom, 0px)); background: linear-gradient(transparent, var(--shell-base) 30%); margin-top: 14px; }
.wiz-next { width: 100%; min-height: 58px; font-size: 17px; border-radius: 20px; }
.wiz-stack { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.wiz-stack .link-btn { align-self: center; padding: 10px; }

/* Fertig: Haken zeichnet sich, Konfetti in Akzentfarben */
.wiz-done .wiz-card { text-align: center; }
.done-check { width: 92px; height: 92px; margin: 4px auto 18px; }
.done-check svg { width: 100%; height: 100%; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.done-check circle { stroke: var(--accent-fill); stroke-width: 3; stroke-dasharray: 151; stroke-dashoffset: 151; animation: draw .6s .05s ease-out forwards; }
.done-check path { stroke: var(--accent); stroke-width: 4; stroke-dasharray: 40; stroke-dashoffset: 40; animation: draw .35s .55s ease-out forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.wiz-done { position: relative; }
.confetti { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 30; }
.confetti i { position: absolute; top: -12px; left: var(--x); width: 8px; height: 14px; border-radius: 2px; background: var(--accent-fill); transform: rotate(var(--r)); animation: fall 1.6s var(--d) cubic-bezier(.3, .6, .4, 1) forwards; opacity: 0; }
.confetti i:nth-child(3n) { background: var(--accent); width: 6px; height: 10px; }
.confetti i:nth-child(4n) { background: var(--solid); }
@keyframes fall { 0% { opacity: 1; transform: translateY(0) rotate(var(--r)); } 100% { opacity: 0; transform: translateY(85vh) rotate(calc(var(--r) + 540deg)); } }

@media (max-width: 720px) {
  .wiz { padding-top: 6px; }
  .wiz-card { padding: 24px 20px 22px; border-radius: 26px; }
  /* Im Assistenten keine schwebende „Neue Rechnung“-Taste — sie würde „Weiter“ verdecken */
  body:has(.wiz) .top-actions .solid-btn { display: none; }
}
.wiz-dates input { min-width: 0; width: 100%; font-size: 15px; padding: 0 10px; }
