/* QR-Rechnung (by NKE) — Modern Swiss Fintech UI (Dark + Light, Zero Notebook). */
:root {
  --bg: #eef2ee;
  --surface: #ffffff;
  --surface-2: #f4f7f4;
  --stage: #e2e8e3;
  --ink: #14201b;
  --ink-2: #4b5a53;
  --ink-3: #6b7a72;
  --border: rgba(20, 32, 27, 0.11);
  --border-strong: rgba(20, 32, 27, 0.22);
  --accent: #c2362e;
  --accent-text: #c2362e;
  --accent-hover: #9e2a23;
  --accent-soft: rgba(194, 54, 46, 0.10);
  --ok: #1f7a4a;
  --ok-soft: rgba(31, 122, 74, 0.11);
  --err: #b42318;
  --err-soft: rgba(180, 35, 24, 0.10);
  --warn: #b42318;
  --warn-soft: rgba(180, 35, 24, 0.10);
  --shadow-card: 0 1px 2px rgba(20, 32, 27, 0.05), 0 16px 36px -20px rgba(20, 32, 27, 0.25);
  --shadow-paper: 0 2px 6px rgba(20, 32, 27, 0.08), 0 34px 64px -26px rgba(20, 32, 27, 0.40);
  --radius: 14px;
  --radius-sm: 9px;
  --measure: 66ch;
  --glow: none;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --input-bg: #0c120f;
  --bg: #0b0f0d;
  --surface: #131a17;
  --surface-2: #19221e;
  --stage: #0f1412;
  --ink: #eef3f0;
  --ink-2: #a3b0a9;
  --ink-3: #75837c;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.17);
  --accent: #ef3340;
  --accent-text: #ff6b74;
  --accent-hover: #dc2330;
  --accent-soft: rgba(239, 51, 64, 0.18);
  --ok: #4ade80;
  --ok-soft: rgba(74, 222, 128, 0.13);
  --err: #fb7185;
  --err-soft: rgba(251, 113, 133, 0.14);
  --warn: #fb7185;
  --warn-soft: rgba(251, 113, 133, 0.14);
  --shadow-card: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 16px 38px -16px rgba(0, 0, 0, 0.65);
  --shadow-paper: 0 26px 64px -12px rgba(0, 0, 0, 0.72), 0 0 0 1px rgba(255, 255, 255, 0.08);
  color-scheme: dark;
}

/* Gemeinsame NKE-Typografie (wie NKE Webdesign) */
h1, h2 { font-weight: 800; letter-spacing: -0.032em; }

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  background-image: var(--glow);
  background-repeat: no-repeat;
  color: var(--ink);
  font-family: "Schibsted Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 0.95rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.num, .inv-table td:last-child, .inv-table td:nth-child(2), .inv-table td:nth-child(3) {
  
}
a { color: inherit; text-underline-offset: 3px; text-decoration-color: var(--border-strong); }
a:hover { color: var(--ink); text-decoration-color: var(--ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

h1, h2, h3 { margin: 0; font-weight: 700; letter-spacing: -0.025em; line-height: 1.15; }
p { margin: 0 0 0.85rem; }

.wrap { width: min(100% - 32px, 1280px); margin-inline: auto; }
.skip { position: absolute; left: -9999px; top: 8px; background: var(--ink); color: var(--bg); padding: 8px 14px; border-radius: 8px; font-weight: 600; text-decoration: none; z-index: 60; }
.skip:focus { left: 16px; }

.ico { width: 16px; height: 16px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }

/* Glassmorphic Topbar */
.site-head {
  position: sticky; top: 0; z-index: 30;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.site-head .wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; height: 60px;
}
.logo {
  display: inline-flex; align-items: center; gap: 10px;
  font-weight: 700; font-size: 1.02rem; text-decoration: none; letter-spacing: -0.02em;
}
.logo img { width: 26px; height: 26px; border-radius: 7px; }
.logo .sub {
  font-size: 0.76rem; font-weight: 500; color: var(--ink-3);
  border-left: 1px solid var(--border-strong); padding-left: 10px;
}
@media (max-width: 680px) { .logo .sub { display: none; } }

.nav { display: flex; align-items: center; gap: 16px; font-size: 0.86rem; }
.nav a { text-decoration: none; color: var(--ink-2); font-weight: 500; transition: color 120ms ease; }
.nav a:hover { color: var(--ink); }
@media (max-width: 820px) { .nav .hide-sm { display: none !important; } }

.status-dot {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 0.76rem; font-weight: 600; padding: 5px 10px;
  border-radius: 999px; background: var(--ok-soft); color: var(--ok);
  border: 1px solid color-mix(in srgb, var(--ok) 25%, transparent);
}
.status-dot::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor;
}
.status-dot.err {
  background: var(--err-soft); color: var(--err);
  border-color: color-mix(in srgb, var(--err) 28%, transparent);
}

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; padding: 0;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--ink-2); cursor: pointer;
  transition: border-color 120ms ease, color 120ms ease, background 120ms ease;
}
.icon-btn:hover { border-color: var(--border-strong); color: var(--ink); background: var(--surface-2); }
.icon-btn .ico-sun { display: none; }

:root[data-theme="dark"] .icon-btn .ico-sun { display: block; }
:root[data-theme="dark"] .icon-btn .ico-moon { display: none; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  font: inherit; font-size: 0.84rem; font-weight: 600;
  background: var(--accent); color: #ffffff;
  border: 1px solid transparent; border-radius: var(--radius-sm);
  padding: 0 14px; height: 38px;
  text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background 120ms ease, border-color 120ms ease, transform 90ms ease;
}
.btn:hover { background: var(--accent-hover); color: #ffffff; }
.btn:active { transform: translateY(1px); }
.btn.secondary {
  background: var(--surface); color: var(--ink); border-color: var(--border-strong);
}
.btn.secondary:hover { background: var(--surface-2); color: var(--ink); }
.btn.ghost {
  background: transparent; color: var(--ink-2); border-color: var(--border);
}
.btn.ghost:hover { background: var(--surface-2); color: var(--ink); border-color: var(--border-strong); }
.btn.sm { height: 32px; padding: 0 11px; font-size: 0.78rem; }

/* Intro Strip (kompakt & edel) */
.intro-strip { padding: 26px 0 20px; }
.intro-strip .wrap {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 14px 28px;
}
.intro-strip h1 { font-size: clamp(1.5rem, 2.2vw, 2.05rem); letter-spacing: -0.03em; }
.intro-strip p { margin: 5px 0 0; color: var(--ink-2); font-size: 0.92rem; max-width: 58ch; }
.total-readout {
  display: flex; align-items: baseline; gap: 12px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 10px 16px; box-shadow: var(--shadow-card);
}
.total-readout span { font-size: 0.76rem; font-weight: 600; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.05em; }
.total-readout strong { font-size: 1.35rem; font-weight: 800; letter-spacing: -0.02em;  }

/* Main Split App Workspace */
.workspace { padding: 6px 0 56px; }
.ws-grid { display: grid; grid-template-columns: minmax(0, 470px) minmax(0, 1fr); gap: 24px; align-items: start; }
@media (max-width: 1060px) { .ws-grid { grid-template-columns: minmax(0, 1fr); } }

/* Left Studio Form Card with Segmented Tabs */
.editor-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}
.step-tabs {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  background: var(--surface-2);
  padding: 5px; gap: 4px;
  border-bottom: 1px solid var(--border);
}
.step-tab {
  font: inherit; font-size: 0.78rem; font-weight: 600;
  color: var(--ink-2); background: transparent; border: 0; border-radius: 7px;
  padding: 8px 6px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  transition: background 120ms ease, color 120ms ease;
}
.step-tab:hover { color: var(--ink); }
.step-tab[aria-selected="true"] {
  background: var(--surface); color: var(--ink);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 0 0 1px var(--border);
}
.step-num {
  display: inline-grid; place-items: center; width: 18px; height: 18px;
  border-radius: 999px; font-size: 0.7rem; font-weight: 700;
  background: var(--border); color: var(--ink-2);
}
.step-tab[aria-selected="true"] .step-num { background: var(--accent); color: #fff; }
@media (max-width: 480px) { .step-tab { font-size: 0.72rem; padding: 8px 2px; } .step-num { display: none; } }

.step-panel { display: none; padding: 20px 22px 22px; }
.step-panel.is-active { display: block; }
.panel-head {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  margin-bottom: 16px;
}
.panel-head h2 { font-size: 0.96rem; }
.panel-head small { font-size: 0.76rem; color: var(--ink-3); }

.fg { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.fg.cols-3 { grid-template-columns: 1fr 5.2rem 1fr; }
.fg.cols-eq3 { grid-template-columns: 1fr 1.15fr 1fr; }
.fg .full { grid-column: 1 / -1; }
label.f { display: grid; gap: 5px; font-size: 0.78rem; font-weight: 600; color: var(--ink-2); }
input[type="text"], input[type="number"], input[type="date"], select {
  font: inherit; font-size: 0.9rem; font-weight: 500;
  color: var(--ink); background: var(--input-bg, #ffffff);
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  padding: 0 11px; height: 40px; width: 100%;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}
input:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
input[type="number"], input[type="date"] {  }
.hint { font-size: 0.76rem; color: var(--ink-3); font-weight: 500; }
.hint.ok { color: var(--ok); font-weight: 600; }
.hint.err { color: var(--err); font-weight: 600; }
@media (max-width: 520px) { .fg, .fg.cols-3, .fg.cols-eq3 { grid-template-columns: 1fr; } }

/* Positions */
.toggle-line {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 0.82rem; font-weight: 600; color: var(--ink); cursor: pointer; margin-bottom: 14px;
}
.toggle-line input { width: 16px; height: 16px; accent-color: var(--accent); }
.pos-head {
  display: grid; grid-template-columns: 1fr 4.4rem 5.8rem 34px; gap: 7px;
  font-size: 0.7rem; font-weight: 600; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 6px;
}
.pos-row { display: grid; grid-template-columns: 1fr 4.4rem 5.8rem 34px; gap: 7px; align-items: center; margin-bottom: 7px; }
.pos-row input { height: 36px; padding: 0 9px; font-size: 0.85rem; }
.pos-row button {
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); background: transparent; color: var(--ink-3);
  border-radius: var(--radius-sm); height: 36px; cursor: pointer;
}
.pos-row button:hover { color: var(--err); border-color: color-mix(in srgb, var(--err) 40%, transparent); background: var(--err-soft); }

.editor-foot {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 13px 22px; background: var(--surface-2); border-top: 1px solid var(--border);
  font-size: 0.78rem; color: var(--ink-3);
}
.step-nav { display: flex; gap: 6px; }

/* Right Stage: Preview Toolbar + Elevated Physical White A4 Paper */
.preview-stage {
  background: var(--stage);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px 20px;
  position: sticky; top: 76px;
}
.stage-bar {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center;
  gap: 10px; margin-bottom: 16px;
}
.seg {
  display: inline-flex; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 3px; gap: 2px;
}
.seg button {
  font: inherit; font-size: 0.78rem; font-weight: 600;
  color: var(--ink-2); background: transparent; border: 0; border-radius: 6px;
  padding: 5px 11px; cursor: pointer;
}
.seg button[aria-pressed="true"] { background: var(--surface-2); color: var(--ink); box-shadow: 0 0 0 1px var(--border); }
.action-group { display: flex; flex-wrap: wrap; gap: 7px; }

/* PHYSISCHES WEISSES DIN A4 BLATT (immer #fff/#000 für E-Banking-Scanner!) */
.a4-frame {
  background: #ffffff;
  color: #000000;
  border-radius: 4px;
  padding: 24px 26px 0;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.82rem;
  box-shadow: var(--shadow-paper);
}
.a4-frame.slip-preview .a4-top { display: none; }
.a4-frame.slip-preview { padding-top: 0; overflow: hidden; }
.a4-frame.slip-preview .qr-slip { margin: 0; border-top: 0; }
.a4-frame.slip-preview .qr-slip::before { display: none; }

.a4-top { padding-bottom: 22px; color: #000; }
.inv-head { display: flex; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.inv-sender { font-size: 0.78rem; line-height: 1.45; }
.inv-sender b { font-size: 0.96rem; display: block; margin-bottom: 2px; }
.inv-meta { text-align: right; font-size: 0.78rem; line-height: 1.45; }
.inv-meta b { font-size: 1.04rem; display: block; margin-bottom: 3px; }
.inv-recipient { margin: 0 0 16px; font-size: 0.82rem; line-height: 1.4; }
.inv-table { width: 100%; border-collapse: collapse; margin-bottom: 12px; font-size: 0.8rem; }
.inv-table th, .inv-table td { padding: 6px 5px; border-bottom: 1px solid #e0e0e0; text-align: left; }
.inv-table th:nth-child(n+2), .inv-table td:nth-child(n+2) { text-align: right; }
.inv-table thead th { border-bottom: 1.5px solid #000; font-size: 0.72rem; text-transform: uppercase; }
.inv-total { text-align: right; font-weight: 800; font-size: 0.95rem; margin: 6px 0 3px; }
.inv-note { font-size: 0.76rem; color: #444; margin: 0; }

/* OFFIZIELLER SIX QR-ZAHLTEIL (62 mm : 148 mm) */
.qr-slip {
  margin: 0 -26px; border-top: 1px dashed #000; position: relative;
  display: grid; grid-template-columns: 62fr 148fr;
  font-family: Arial, Helvetica, sans-serif; color: #000; background: #fff;
}
.qr-slip::before {
  content: "✂"; position: absolute; top: -0.62em; left: 50%; transform: translateX(-50%);
  background: #fff; padding: 0 4px; font-size: 10px; color: #000;
}
.qr-receipt {
  padding: 12px 11px 10px 14px; border-right: 1px dashed #000;
  display: flex; flex-direction: column; justify-content: space-between; min-height: 290px;
}
.qr-payment {
  padding: 12px 14px 10px 14px;
  display: grid; grid-template-columns: 148px 1fr; gap: 14px; min-height: 290px;
}
.qr-h { font-size: 11px; font-weight: 700; margin: 0 0 8px; }
.qr-lbl { font-size: 6.5px; font-weight: 700; margin: 6px 0 1px; line-height: 1.2; }
.qr-val { font-size: 8px; line-height: 1.3; margin: 0; white-space: pre-line; word-break: break-word; }
.qr-payment .qr-lbl { font-size: 7.5px; }
.qr-payment .qr-val { font-size: 9px; line-height: 1.32; }
.qr-code-box { width: 136px; height: 136px; margin: 4px 0 10px; background: #fff; }
.qr-code-box svg { width: 100%; height: 100%; display: block; }
.qr-amt-row { display: flex; gap: 12px; margin-top: 8px; }
.qr-blank { border: 1px solid #000; width: 78px; height: 24px; margin-top: 3px; }
.qr-accept { text-align: right; font-size: 6.5px; font-weight: 700; margin-top: 10px; }
@media (max-width: 680px) {
  .qr-slip { grid-template-columns: 1fr; }
  .qr-receipt { border-right: 0; border-bottom: 1px dashed #000; min-height: 0; }
  .qr-payment { grid-template-columns: 1fr; min-height: 0; }
}

.spec-note {
  margin-top: 14px; font-size: 0.78rem; color: var(--ink-3);
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px;
}

/* Info, FAQ & NKE Studio Showcase */
.info-sec { border-top: 1px solid var(--border); padding: 52px 0; }
.feature-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 44px; }
@media (max-width: 820px) { .feature-row { grid-template-columns: 1fr; } }
.feat {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px; box-shadow: var(--shadow-card);
}
.feat-ico {
  width: 34px; height: 34px; border-radius: 9px;
  display: inline-grid; place-items: center; margin-bottom: 12px;
  background: var(--accent-soft); color: var(--accent);
}
.feat h3 { font-size: 0.96rem; margin-bottom: 6px; }
.feat p { font-size: 0.86rem; color: var(--ink-2); margin: 0; }

.faq-wrap { display: grid; grid-template-columns: 1fr 1.35fr; gap: 36px; align-items: start; }
@media (max-width: 820px) { .faq-wrap { grid-template-columns: 1fr; } }
.faq-wrap h2 { font-size: 1.35rem; margin-bottom: 8px; }
.faq-wrap > div > p { color: var(--ink-2); font-size: 0.9rem; }
.faq details { border-top: 1px solid var(--border); padding: 14px 0; }
.faq details:last-of-type { border-bottom: 1px solid var(--border); }
.faq summary {
  font-weight: 600; font-size: 0.92rem; cursor: pointer; list-style: none;
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary .chev { width: 16px; height: 16px; color: var(--ink-3); transition: transform 150ms ease; flex: none; }
.faq details[open] summary .chev { transform: rotate(180deg); color: var(--ink); }
.faq details p { margin: 8px 0 0; color: var(--ink-2); font-size: 0.88rem; }

.nke-banner {
  margin-top: 44px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px 24px; box-shadow: var(--shadow-card);
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px;
}
.nke-banner strong { display: block; font-size: 0.96rem; margin-bottom: 2px; }
.nke-banner span { font-size: 0.86rem; color: var(--ink-2); }

/* Textseiten & Footer */
.prose { padding: 48px 0 68px; }
.prose .wrap { max-width: 720px; }
.prose h1 { font-size: 1.9rem; margin-bottom: 16px; }
.prose h2 { font-size: 1.15rem; margin: 26px 0 8px; }
.prose p { color: var(--ink-2); }

.site-foot {
  border-top: 1px solid var(--border); padding: 36px 0 48px;
  font-size: 0.84rem; color: var(--ink-3);
}
.site-foot .wrap { display: grid; gap: 20px; }
@media (min-width: 760px) { .site-foot .wrap { grid-template-columns: 2fr 1fr 1fr; } }
.site-foot ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 7px; }
.site-foot strong { color: var(--ink); font-weight: 600; }
.site-foot a { text-decoration: none; color: var(--ink-2); }
.site-foot a:hover { color: var(--ink); }

.toast {
  position: fixed; right: 20px; bottom: 20px;
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--border-strong); box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
  padding: 10px 15px; border-radius: 10px; font-weight: 600; font-size: 0.84rem;
  z-index: 80; opacity: 0; pointer-events: none; transition: opacity 160ms ease;
}
.toast.show { opacity: 1; }

/* MILLIMETER-GENAUER SIX A4-DRUCK (210 x 297 mm, Zahlteil exakt 210 x 105 mm unten!) */
@media print {
  @page { size: A4 portrait; margin: 0; }
  html, body { width: 210mm; height: 297mm; margin: 0; padding: 0; background: #fff !important; color: #000 !important; background-image: none !important; }
  .site-head, .intro-strip, .editor-card, .stage-bar, .spec-note, .info-sec, .site-foot, .toast { display: none !important; }
  .workspace, .wrap, .ws-grid, .preview-stage { display: block !important; position: static !important; margin: 0 !important; padding: 0 !important; max-width: none !important; width: 210mm !important; border: 0 !important; background: #fff !important; }
  .a4-frame { border: 0 !important; box-shadow: none !important; margin: 0 !important; padding: 0 !important; width: 210mm !important; height: 297mm !important; position: relative !important; }
  .a4-frame.slip-preview .a4-top { display: block !important; }
  .a4-top { padding: 18mm 18mm 0 18mm !important; }
  body.print-slip-only .a4-top { display: none !important; }
  .qr-slip {
    position: absolute !important; left: 0 !important; right: 0 !important; bottom: 0 !important;
    width: 210mm !important; height: 105mm !important; margin: 0 !important;
    grid-template-columns: 62mm 148mm !important; border-top: 0.75pt dashed #000 !important;
  }
  .qr-slip::before { display: block !important; }
  .qr-receipt { width: 62mm !important; height: 105mm !important; padding: 5mm !important; border-right: 0.75pt dashed #000 !important; }
  .qr-payment { width: 148mm !important; height: 105mm !important; padding: 5mm !important; grid-template-columns: 46mm 1fr !important; gap: 5mm !important; }
  .qr-h { font-size: 11pt !important; margin-bottom: 3mm !important; }
  .qr-receipt .qr-lbl { font-size: 6pt !important; margin: 2.2mm 0 0.3mm !important; }
  .qr-receipt .qr-val { font-size: 8pt !important; line-height: 9pt !important; }
  .qr-payment .qr-lbl { font-size: 8pt !important; margin: 2.6mm 0 0.4mm !important; }
  .qr-payment .qr-val { font-size: 10pt !important; line-height: 11pt !important; }
  .qr-code-box { width: 46mm !important; height: 46mm !important; margin: 2mm 0 5mm !important; }
  .qr-accept { font-size: 6pt !important; }
}

/* ==================== QR-RECHNUNG V2: LOGO, KUNDEN, MWST & ARCHIV ==================== */
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.left-col { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; align-content: start; min-width: 0; }

.logo-field {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 14px; margin-bottom: 16px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px;
}
.logo-box {
  width: 60px; height: 60px; flex: none;
  border-radius: 9px; background: var(--surface); border: 1px solid var(--border);
  display: grid; place-items: center; overflow: hidden; padding: 6px;
}
.logo-box img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
.logo-ph { width: 22px; height: 22px; color: var(--ink-3); }
.logo-meta { display: grid; gap: 3px; min-width: 0; }
.logo-meta strong { font-size: 0.86rem; }
.logo-meta span { font-size: 0.76rem; color: var(--ink-3); }
.logo-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }

.saved-bar {
  display: flex; gap: 7px; align-items: center; margin-bottom: 14px; flex-wrap: wrap;
}
.saved-bar select { flex: 1 1 180px; height: 36px; font-size: 0.84rem; }

.sum-box {
  margin: 16px 0 0; padding: 12px 14px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px;
  display: grid; gap: 6px; 
}
.sum-box > div { display: flex; justify-content: space-between; font-size: 0.84rem; color: var(--ink-2); }
.sum-box dt { font-weight: 500; }
.sum-box dd { margin: 0; font-weight: 600; color: var(--ink); }
.sum-box .sum-total {
  padding-top: 7px; margin-top: 2px; border-top: 1px solid var(--border-strong);
  font-size: 0.96rem; color: var(--ink);
}
.sum-box .sum-total dt, .sum-box .sum-total dd { font-weight: 800; }

/* A4 Logo & MWST-Summen */
.inv-logo { max-height: 44px; max-width: 160px; object-fit: contain; display: block; margin-bottom: 8px; }
.inv-title { font-size: 1.08rem; font-weight: 800; margin: 0 0 10px; color: #000; letter-spacing: -0.015em; }
.inv-sums { width: 100%; max-width: 240px; margin: 4px 0 8px auto; border-collapse: collapse; font-size: 0.8rem;  }
.inv-sums td { padding: 3px 0; color: #333; }
.inv-sums td:last-child { text-align: right; font-weight: 600; color: #000; white-space: nowrap; }
.inv-sums tr.is-total td { padding-top: 6px; border-top: 1.5px solid #000; font-weight: 800; font-size: 0.92rem; color: #000; }

/* Rechnungsarchiv */
.archive-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px 20px; box-shadow: var(--shadow-card);
}
.archive-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 12px; }
.archive-head h2 { font-size: 0.96rem; margin-bottom: 2px; }
.archive-head p { margin: 0; font-size: 0.78rem; color: var(--ink-3); }
.archive-actions { display: flex; gap: 6px; }
.archive-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; }
.archive-item {
  display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 9px 11px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface-2);
}
.archive-item-info { min-width: 0; }
.archive-item-info strong { display: block; font-size: 0.84rem; color: var(--ink); }
.archive-item-info span { font-size: 0.76rem; color: var(--ink-3);  }
.archive-item-btns { display: flex; gap: 5px; }
.archive-empty { margin: 0; font-size: 0.82rem; color: var(--ink-3); }

@media print {
  .left-col, .archive-card { display: none !important; }
  .inv-logo { max-height: 15mm !important; max-width: 55mm !important; }
}

.modal-backdrop {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(10, 16, 13, 0.58);
  backdrop-filter: blur(4px);
  display: grid; place-items: center; padding: 16px;
}
.modal-card {
  width: min(100%, 480px); max-height: 90vh; overflow-y: auto;
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--border-strong); border-radius: 16px;
  padding: 22px 24px; box-shadow: 0 24px 64px rgba(0, 0, 0, 0.35);
}
.modal-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
.modal-head h2 { font-size: 1.18rem; margin: 0; }
.auth-hint { font-size: 0.84rem; color: var(--ink-2); margin-bottom: 14px; }

/* ==================== PWA INSTALLATIONS-TUTORIAL MODAL ==================== */
.pwa-card { max-width: 520px; }
.pwa-tabs {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px;
  background: var(--surface-2); padding: 4px; border-radius: 9px; margin-bottom: 14px;
}
.pwa-tab {
  font: inherit; font-size: 0.82rem; font-weight: 600; padding: 8px 8px;
  border: 0; border-radius: 7px; background: transparent; color: var(--ink-2); cursor: pointer;
}
.pwa-tab[aria-selected="true"] {
  background: var(--surface); color: var(--ink);
  box-shadow: 0 1px 2px rgba(0,0,0,0.08), 0 0 0 1px var(--border);
}
.pwa-steps ol {
  margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; counter-reset: pwa;
}
.pwa-steps li {
  position: relative; padding: 11px 13px 11px 44px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px;
  font-size: 0.86rem; color: var(--ink-2); counter-increment: pwa;
}
.pwa-steps li::before {
  content: counter(pwa); position: absolute; left: 12px; top: 11px;
  width: 22px; height: 22px; border-radius: 999px;
  background: var(--accent); color: #fff; font-size: 0.74rem; font-weight: 800;
  display: grid; place-items: center;
}
.pwa-steps li strong { color: var(--ink); }
