/* =====================================================================
   E-Invoice Studio: Stylesheet aller Seiten (außer Fehlerseiten).
   Designkonzept „Zwei Schichten“: vorne das lesbare Blatt, dahinter die XML.
   Markenfarbe ist das Petrol (--accent); es wird sparsam eingesetzt:
   Hauptknöpfe, aktive Navigation, Links, Marke, Erfolgsstempel.
   Regel-Codes (BR-DE-15 …) sind wie mit dem Textmarker markiert (--mark).
   ===================================================================== */
:root {
  --ink:#14213D; --ink-soft:#4F5B75; --ink-faint:#6B7590;
  --canvas:#EEF1F6; --surface:#FFFFFF; --surface-2:#F6F8FB; --line:#D6DCE6; --line-soft:#E6EAF1;
  --accent:#0E7C7B; --accent-deep:#0B5F5E; --accent-tint:#E3F2F1; --on-accent:#FFFFFF;
  --mark:#FFE066; --mark-ink:#3A2F00;
  --code-bg:#1C2A4A; --code-ink:#C9D6F2; --code-tag:#8FB3E8; --code-val:#FFE066; --code-num:#8FE3BA;
  --ok:#1A7F4E; --warn:#94650E; --danger:#C2362B;
  --ok-bg:#E6F4EC; --warn-bg:#FBF1DC; --danger-bg:#FBEAE8;
  --shadow-sm:0 1px 2px rgba(20,33,61,.06);
  --shadow-md:0 10px 30px -14px rgba(20,33,61,.28);
  --shadow-lg:0 30px 60px -25px rgba(20,33,61,.45);
  --r-sm:6px; --r-md:8px; --r-lg:12px;
  --sans:'Schibsted Grotesk',system-ui,-apple-system,'Segoe UI',Roboto,sans-serif;
  --mono:'IBM Plex Mono',ui-monospace,'SFMono-Regular',Menlo,monospace;
  --page:1180px; --head-h:68px;
  color-scheme:light;
}
html[data-theme="dark"] {
  --ink:#E6EBF4; --ink-soft:#A3AEC4; --ink-faint:#8792AA;
  --canvas:#0D1422; --surface:#141D2E; --surface-2:#192439; --line:#2A3750; --line-soft:#212D43;
  --accent:#2BBFAE; --accent-deep:#5FD3C5; --accent-tint:#13302F; --on-accent:#05201D;
  --mark:#E8C547; --mark-ink:#2A2100;
  --code-bg:#0A1020; --code-ink:#BFCBE6;
  --ok:#4CC98A; --warn:#E3B55A; --danger:#F07167;
  --ok-bg:#12291E; --warn-bg:#2B2312; --danger-bg:#2E1716;
  --shadow-sm:0 1px 2px rgba(0,0,0,.4); --shadow-md:0 12px 30px -12px rgba(0,0,0,.6); --shadow-lg:0 30px 60px -25px rgba(0,0,0,.75);
  color-scheme:dark;
}

* { box-sizing:border-box; }
html, body { margin:0; padding:0; }
html { -webkit-text-size-adjust:100%; }
body { font-family:var(--sans); background:var(--canvas); color:var(--ink); font-size:16px; line-height:1.55; -webkit-font-smoothing:antialiased; }
a { color:inherit; }
::selection { background:color-mix(in srgb, var(--accent) 26%, transparent); }
:focus-visible { outline:2px solid var(--accent); outline-offset:2px; border-radius:3px; }
.sr-only { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }
.skip { position:absolute; left:-9999px; top:8px; z-index:100; background:var(--surface); color:var(--ink); padding:8px 12px; border-radius:var(--r-sm); box-shadow:var(--shadow-md); }
.skip:focus { left:8px; }
.muted { color:var(--ink-soft); font-size:14px; }
.todo { background:var(--mark); color:var(--mark-ink); padding:1px 6px; border-radius:3px; font-size:.92em; }
.ic { width:18px; height:18px; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }

/* ---------- Seitengerüst ---------- */
.app { min-height:100vh; min-height:100dvh; overflow-x:clip; }
.main { display:flex; flex-direction:column; min-height:calc(100vh - var(--head-h)); }
.content { width:100%; max-width:var(--page); margin:0 auto; padding:32px 32px 64px; flex:1; }
@keyframes rise { from { opacity:0; transform:translateY(10px); } }

/* ---------- Kopfbereich ---------- */
.site-head { position:sticky; top:0; z-index:30; background:color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter:blur(10px); -webkit-backdrop-filter:blur(10px); border-bottom:1px solid var(--line); }
.head-in { max-width:var(--page); margin:0 auto; height:var(--head-h); padding:0 32px; display:flex; align-items:center; gap:32px; }
.brand { display:inline-flex; align-items:center; gap:11px; text-decoration:none; color:var(--ink); flex:none; }
/* Marke: das Blatt (Tinte) mit der XML-Schicht dahinter (Petrol) */
.brand-mark { width:22px; height:27px; border:2px solid var(--ink); border-radius:3px; background:var(--surface); box-shadow:5px 5px 0 -2px var(--surface), 5px 5px 0 0 var(--accent); flex:none; }
.brand-name { font-weight:800; font-size:18px; letter-spacing:-.02em; white-space:nowrap; }

.nav { display:flex; align-items:center; gap:4px; flex:1; }
.nav-link { display:inline-flex; align-items:center; gap:6px; padding:8px 12px; font-size:15px; font-weight:500; color:var(--ink-soft); text-decoration:none; border-radius:var(--r-sm); cursor:pointer; list-style:none; position:relative; }
.nav-link::-webkit-details-marker { display:none; }
.nav-link:hover { color:var(--ink); background:var(--surface-2); }
.nav-link.active { color:var(--ink); }
.nav-link.active::after { content:""; position:absolute; left:12px; right:12px; bottom:-15px; height:2px; background:var(--accent); }
.chev { width:15px; height:15px; transition:transform .15s; }
.nav-tools { position:relative; }
.nav-tools[open] .chev { transform:rotate(180deg); }
.mega { position:absolute; left:-12px; top:calc(100% + 14px); width:min(720px, calc(100vw - 48px)); background:var(--surface); border:1px solid var(--line); border-radius:var(--r-lg); box-shadow:var(--shadow-lg); padding:20px; display:grid; grid-template-columns:1fr 1fr; gap:8px 24px; z-index:40; }
.nav-label { font-size:13px; font-weight:600; color:var(--ink-faint); padding:4px 10px 6px; }
.nav-label small { font-weight:500; color:var(--accent); margin-left:6px; font-size:12.5px; }
.nav-item { display:block; padding:9px 10px; border-radius:var(--r-sm); text-decoration:none; color:var(--ink); }
.nav-item b { display:block; font-weight:600; font-size:15px; }
.nav-item span { display:block; font-size:13.5px; color:var(--ink-soft); line-height:1.4; margin-top:1px; }
.nav-item:hover { background:var(--surface-2); }
.nav-item.active { background:var(--accent-tint); }
.nav-item.active b { color:var(--accent-deep); }

.head-actions { display:flex; align-items:center; gap:10px; flex:none; }
.status-dot { display:inline-flex; align-items:center; gap:7px; font-size:13px; color:var(--ink-faint); white-space:nowrap; text-decoration:none; padding:6px 4px; }
.status-dot:hover { color:var(--ink); }
.status-dot i { width:8px; height:8px; border-radius:50%; background:var(--ink-faint); }
.status-dot.ok i { background:var(--ok); }
.status-dot.warn i { background:var(--warn); }
.status-dot.bad i { background:var(--danger); }
.icon-btn { width:40px; height:40px; border-radius:var(--r-sm); border:1px solid var(--line); background:var(--surface); color:var(--ink-soft); cursor:pointer; display:grid; place-items:center; flex:none; }
.icon-btn:hover { color:var(--ink); border-color:var(--ink-faint); }
.menu-btn { display:none; }
.scrim { display:none; }

.crumbbar { max-width:var(--page); margin:0 auto; width:100%; padding:22px 32px 0; }
.crumb { font-size:14px; color:var(--ink-faint); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.crumb a { color:var(--ink-faint); text-decoration:none; }
.crumb a:hover { color:var(--ink); text-decoration:underline; }
.crumb b { color:var(--ink-soft); font-weight:500; }
.crumbbar + .content { padding-top:16px; }

/* ---------- Knöpfe ---------- */
.btn { display:inline-flex; align-items:center; justify-content:center; gap:8px; font-family:var(--sans); font-size:15px; font-weight:600; padding:10px 18px; min-height:44px; border-radius:var(--r-sm); border:1.5px solid var(--line); background:var(--surface); color:var(--ink); cursor:pointer; text-decoration:none; transition:background .15s, border-color .15s, color .15s; }
.btn:active { transform:translateY(1px); }
.btn .ic { width:17px; height:17px; }
.btn-primary { background:var(--accent-deep); border-color:var(--accent-deep); color:var(--on-accent); }
.btn-primary:hover { background:var(--accent); border-color:var(--accent); }
html[data-theme="dark"] .btn-primary { background:var(--accent); border-color:var(--accent); }
html[data-theme="dark"] .btn-primary:hover { background:var(--accent-deep); border-color:var(--accent-deep); }
.btn-ghost, .btn:not(.btn-primary) { border-color:var(--ink); }
html[data-theme="dark"] .btn:not(.btn-primary) { border-color:var(--line); }
.btn:not(.btn-primary):hover { background:var(--surface-2); }
.btn-lg { min-height:50px; padding:12px 22px; font-size:16px; }
.btn:disabled { opacity:.5; cursor:not-allowed; transform:none; }
.head-cta { min-height:40px; padding:8px 16px; font-size:14.5px; }
/* Einwilligung: beide Entscheidungen gleich gewichtet */
.btn-choice { min-width:130px; }
.link-btn { background:none; border:0; cursor:pointer; font:inherit; padding:0; text-align:left; }

/* ---------- Startseite ---------- */
.home { padding-top:0; }
.hero { display:grid; grid-template-columns:1.05fr 1fr; gap:56px; align-items:center; padding:64px 0 48px; }
.hero h1 { font-weight:800; font-size:clamp(2.2rem,4.6vw,3.6rem); line-height:1.04; letter-spacing:-.035em; margin:0 0 20px; text-wrap:balance; }
.hero-lead { font-size:19px; line-height:1.55; color:var(--ink-soft); max-width:34em; margin:0 0 30px; }
.hero-actions { display:flex; gap:12px; flex-wrap:wrap; }

.layers { position:relative; height:420px; }
.layer-xml { position:absolute; right:0; top:0; width:80%; height:370px; background:var(--code-bg); border-radius:var(--r-md); padding:22px 24px; overflow:hidden; transform:rotate(2.5deg); }
.layer-xml code { display:block; white-space:pre; font:13px/1.85 var(--mono); color:var(--code-ink); }
.layer-xml .t { color:var(--code-tag); }
.layer-xml .v { color:var(--code-val); }
.layer-xml .n { color:var(--code-num); }
.layer-pdf { position:absolute; left:0; bottom:0; width:74%; background:#fff; color:#14213D; border-radius:var(--r-sm); box-shadow:var(--shadow-lg); padding:26px 28px 30px; transform:rotate(-2deg); animation:layerIn .9s cubic-bezier(.2,.8,.2,1) both; }
@keyframes layerIn { from { opacity:0; transform:translateY(28px) rotate(-6deg); } }
.lp-head { display:flex; justify-content:space-between; font-size:13px; color:#55607A; }
.lp-title { font-weight:800; font-size:22px; letter-spacing:-.02em; margin:20px 0 12px; }
.lp-row { display:flex; justify-content:space-between; gap:12px; font-size:14px; padding:8px 0; border-bottom:1px solid #DDE3EC; }
.lp-sum { display:flex; justify-content:space-between; font-weight:700; font-size:16px; padding-top:14px; }
.lp-stamp { position:absolute; right:-16px; bottom:-14px; background:var(--accent-deep); color:#fff; font-weight:700; font-size:14px; padding:9px 15px; border-radius:999px; box-shadow:0 10px 22px -10px rgba(11,95,94,.8); }

.deadline { display:flex; gap:12px; align-items:flex-start; margin:0 0 56px; padding:14px 18px; background:var(--surface); border:1px solid var(--line); border-left:4px solid var(--accent); border-radius:var(--r-sm); font-size:15px; line-height:1.5; }
.deadline .ic { color:var(--accent); flex:none; margin-top:2px; }
.deadline a { font-weight:600; }

/* Volle Breite für Bänder auf der Startseite */
.band { background:var(--surface); border-top:1px solid var(--line); border-bottom:1px solid var(--line); margin:0 calc(50% - 50vw); padding:56px calc(50vw - 50%); }
.band-in { max-width:var(--page); margin:0 auto; }
.split { display:grid; grid-template-columns:280px 1fr; gap:48px; }
.split-intro h2, .sample h2, .codes h2 { font-size:30px; font-weight:800; letter-spacing:-.025em; margin:0 0 10px; }
.split-intro p { color:var(--ink-soft); margin:0 0 14px; line-height:1.55; }
.more { font-weight:600; color:var(--ink); text-decoration-color:var(--accent); text-decoration-thickness:2px; text-underline-offset:4px; }
.more:hover { color:var(--accent-deep); }

.tool-list { display:grid; grid-template-columns:1fr 1fr; gap:0 40px; align-content:start; }
.tool-row { display:grid; grid-template-columns:1fr auto; gap:3px 12px; padding:17px 0; border-bottom:1px solid var(--line); color:var(--ink); text-decoration:none; }
.tool-row b { font-size:17px; font-weight:600; }
.tool-row span { grid-column:1; color:var(--ink-soft); font-size:14.5px; line-height:1.45; }
.tool-row .tag { grid-column:2; grid-row:1; font-style:normal; font-size:13px; color:var(--accent-deep); font-weight:600; }
.tool-row:hover b { text-decoration:underline; text-decoration-color:var(--accent); text-decoration-thickness:2px; text-underline-offset:4px; }

.sample { padding:64px 0; }
.sample-lead { color:var(--ink-soft); margin:0 0 20px; }
.sample-card { background:var(--surface); border:1px solid var(--line); border-radius:var(--r-md); overflow:hidden; }
.sample-head { display:flex; flex-wrap:wrap; align-items:baseline; gap:6px 14px; padding:16px 20px; border-left:5px solid var(--danger); border-bottom:1px solid var(--line); }
.sample-head b { font-size:18px; }
.sample-head span { color:var(--ink-soft); font-size:14px; }
.sample-card .msg { border:0; border-bottom:1px solid var(--line); border-radius:0; }
.sample-card .msg:last-child { border-bottom:0; }

.codes { padding:56px 0 8px; }
.chip-list { list-style:none; padding:0; margin:12px 0 18px; display:flex; flex-wrap:wrap; gap:8px; }
.chip-list a { display:inline-flex; gap:9px; align-items:center; padding:7px 12px; border:1px solid var(--line); border-radius:var(--r-sm); background:var(--surface); text-decoration:none; font-size:14px; }
.chip-list a:hover { border-color:var(--ink-faint); }
.chip-list code { font:500 12.5px var(--mono); background:var(--mark); color:var(--mark-ink); padding:1px 6px; border-radius:3px; }
.fineprint { margin-top:40px; }
.empty { padding:30px 16px; text-align:center; color:var(--ink-faint); font-size:14px; }

/* Ratgeber-Übersicht */
.guide-grid { display:grid; grid-template-columns:repeat(auto-fill, minmax(280px, 1fr)); gap:0 40px; margin-bottom:8px; }
.guide-card { display:block; padding:18px 0; border-bottom:1px solid var(--line); text-decoration:none; color:var(--ink); }
.guide-card h2, .guide-card h3 { font-size:18px; margin:0 0 4px; letter-spacing:-.01em; color:var(--ink); }
.guide-card p { margin:0; font-size:14.5px; color:var(--ink-soft); }
.guide-card:hover h2, .guide-card:hover h3 { text-decoration:underline; text-decoration-color:var(--accent); text-decoration-thickness:2px; text-underline-offset:4px; }

/* ---------- Werkzeugseiten ---------- */
.tool { max-width:880px; }
.eyebrow { font-size:14px; font-weight:600; color:var(--accent-deep); }
.panel-head { margin-bottom:22px; }
.panel-head h1 { font-weight:800; font-size:clamp(1.9rem,4vw,2.7rem); letter-spacing:-.03em; margin:6px 0 10px; line-height:1.08; }
.panel-head p { color:var(--ink-soft); margin:0; max-width:40em; font-size:17px; }
.card { background:var(--surface); border:1px solid var(--line); border-radius:var(--r-md); padding:22px; margin-bottom:16px; }
.card-title { font-size:15px; font-weight:700; color:var(--ink); margin-bottom:14px; }
.two-up { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:16px; }
.two-up > * { min-width:0; }
.tool-info { margin-top:48px; padding-top:32px; border-top:1px solid var(--line); }

/* Ablagefläche */
.drop { border:1.5px dashed color-mix(in srgb, var(--ink) 28%, var(--line)); border-radius:var(--r-md); background:var(--surface-2); padding:30px 18px; text-align:center; cursor:pointer; transition:border-color .15s, background .15s; position:relative; }
.drop:hover, .drop:focus-visible { border-color:var(--accent); background:color-mix(in srgb, var(--accent) 4%, var(--surface-2)); }
.drop.drag { border-color:var(--accent); background:var(--accent-tint); }
.drop .dz-ic { width:32px; height:32px; color:var(--accent); margin:0 auto 10px; stroke-width:1.6; display:block; }
.drop .dz-main { font-weight:600; font-size:16px; }
.drop .dz-sub { font-size:14px; color:var(--ink-faint); margin-top:4px; }
.drop input { display:none; }
.drop.filled { border-style:solid; border-color:var(--ok); background:color-mix(in srgb, var(--ok) 6%, var(--surface-2)); }
.drop.filled:hover { border-color:var(--ok); }
.drop.filled .dz-ic, .drop.filled .dz-main, .drop.filled .dz-sub { display:none; }
.dz-done { display:none; max-width:100%; }
.drop.filled .dz-done { display:block; animation:rise .28s cubic-bezier(.2,.7,.3,1) both; }
.dz-ok { width:40px; height:40px; border-radius:50%; margin:0 auto 9px; display:grid; place-items:center; background:color-mix(in srgb, var(--ok) 15%, transparent); color:var(--ok); }
.dz-ok svg { width:21px; height:21px; stroke-width:2.3; fill:none; stroke:currentColor; stroke-linecap:round; stroke-linejoin:round; }
.dz-title-ok { font-weight:600; font-size:15px; color:var(--ok); overflow-wrap:anywhere; }
.dz-state { margin-top:4px; font-size:14px; color:var(--ink); overflow-wrap:anywhere; }
.dz-hint { margin-top:5px; font-size:13px; color:var(--ink-faint); }

.file-chip { display:flex; align-items:center; gap:10px; margin-top:12px; padding:9px 12px; background:var(--surface); border:1px solid var(--line); border-radius:var(--r-sm); }
.file-chip .ic { width:16px; height:16px; color:var(--ink-soft); flex:none; }
.file-chip .fn { flex:1; min-width:0; font-size:14px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.file-chip .fs { font-size:13px; color:var(--ink-faint); flex:none; }
.file-chip .x { background:none; border:none; color:var(--ink-faint); cursor:pointer; padding:6px; display:grid; place-items:center; }
.file-chip .x:hover { color:var(--danger); }
.file-chip .x .ic { width:14px; height:14px; color:inherit; }

.actions-row { display:flex; gap:10px; margin-top:16px; flex-wrap:wrap; align-items:center; }
.actions-row.tight { margin-top:0; gap:8px; }

/* Ergebnis */
.result { margin-top:20px; }
.result:empty { margin-top:0; }
.result-banner { display:flex; align-items:flex-start; gap:12px; padding:14px 16px; border-radius:var(--r-sm); font-size:15px; margin-bottom:14px; white-space:pre-line; border-left:4px solid currentColor; }
.result-banner .ic { width:19px; height:19px; flex:none; margin-top:2px; }
.rb-ok { background:var(--ok-bg); color:var(--ok); }
.rb-warn { background:var(--warn-bg); color:var(--warn); }
.rb-err { background:var(--danger-bg); color:var(--danger); }

.code-bar { display:flex; align-items:center; justify-content:space-between; gap:8px; flex-wrap:wrap; padding:9px 12px; background:var(--surface-2); border:1px solid var(--line); border-bottom:none; border-radius:var(--r-sm) var(--r-sm) 0 0; }
.code-bar .lbl { font-size:13px; font-weight:600; color:var(--ink-soft); }
.code-bar .tools { display:flex; gap:6px; flex-wrap:wrap; }
.mini-btn { font-family:var(--sans); font-size:13.5px; font-weight:500; padding:6px 11px; border-radius:var(--r-sm); border:1px solid var(--line); background:var(--surface); color:var(--ink-soft); cursor:pointer; text-decoration:none; display:inline-flex; align-items:center; }
.mini-btn:hover { color:var(--ink); border-color:var(--ink-faint); }
.mini-btn[aria-pressed="true"] { color:var(--accent-deep); border-color:var(--accent); background:var(--accent-tint); }
.file-btn { position:relative; }
pre.code { margin:0; padding:16px; max-height:380px; overflow:auto; background:var(--code-bg); border:1px solid var(--code-bg); border-radius:0 0 var(--r-sm) var(--r-sm); font:12.5px/1.7 var(--mono); color:var(--code-ink); white-space:pre-wrap; word-break:break-word; }
iframe.preview { width:100%; min-height:600px; border:1px solid var(--line); border-radius:var(--r-sm); background:#fff; margin-top:10px; }
iframe.pdf-preview { width:100%; height:80vh; min-height:520px; border:1px solid var(--line); border-radius:var(--r-sm); background:#fff; margin-top:16px; }

/* Prüfergebnis */
.val-filters { display:flex; gap:8px; flex-wrap:wrap; margin-bottom:10px; }
.val-filters .push { margin-left:auto; }
.val-caveat { font-size:13px; color:var(--ink-faint); line-height:1.4; margin-bottom:14px; }
.val-summary { display:grid; grid-template-columns:repeat(3,1fr); gap:12px; margin-bottom:16px; }
.val-stat { background:var(--surface); border:1px solid var(--line); border-radius:var(--r-sm); padding:14px 16px; }
.val-stat .n { font-weight:800; font-size:1.8rem; line-height:1; letter-spacing:-.02em; }
.val-stat .l { font-size:14px; color:var(--ink-soft); margin-top:6px; }
.val-stat.err .n { color:var(--danger); }
.val-stat.warn .n { color:var(--warn); }
.val-stat.ok .n { color:var(--ok); }
.checks { list-style:none; padding:0; margin:0 0 16px; display:grid; gap:6px; }
.checks li { display:flex; gap:10px; align-items:baseline; font-size:14.5px; flex-wrap:wrap; }
.checks .st { font-size:12.5px; font-weight:600; padding:1px 8px; border-radius:999px; flex:none; }
.checks .st.ok { background:var(--ok-bg); color:var(--ok); }
.checks .st.skipped { background:var(--surface-2); color:var(--ink-soft); border:1px solid var(--line); }
.checks .st.error { background:var(--danger-bg); color:var(--danger); }
.checks .note-t { color:var(--ink-faint); font-size:13.5px; }
.msg-list { display:flex; flex-direction:column; border:1px solid var(--line); border-radius:var(--r-sm); overflow:hidden; background:var(--surface); }
.msg-list .msg { border:0; border-bottom:1px solid var(--line); border-radius:0; }
.msg-list .msg:last-child { border-bottom:0; }
.msg { display:grid; grid-template-columns:92px 1fr; gap:16px; align-items:start; padding:15px 18px; border:1px solid var(--line); border-radius:var(--r-sm); background:var(--surface); }
.msg .sev { font-size:13px; font-weight:600; justify-self:start; }
.sev-error { color:var(--danger); }
.sev-warn { color:var(--warn); }
.msg .rule { display:inline-block; font:500 12.5px var(--mono); background:var(--mark); color:var(--mark-ink); padding:1px 6px; border-radius:3px; margin-bottom:6px; word-break:break-all; }
.msg .txt { font-size:15px; line-height:1.5; }
.msg .explain { display:inline-block; margin-top:6px; font-size:14px; font-weight:600; color:var(--ink); text-decoration-color:var(--accent); text-decoration-thickness:2px; text-underline-offset:3px; }
.msg .hidden-note { margin-top:4px; }
.hidden-note { margin-top:10px; font-size:13px; color:var(--ink-faint); font-family:var(--mono); word-break:break-all; }
details.raw { margin-top:14px; }
details.raw summary { display:inline-flex; }
details.raw pre { margin-top:10px; border-radius:var(--r-sm); }
.meta-line { font-size:14px; color:var(--ink-faint); margin:-4px 0 18px; word-break:break-word; }

/* ---------- Hinweise ---------- */
.note { display:flex; gap:10px; align-items:flex-start; padding:12px 14px; border:1px solid var(--line); background:var(--surface); border-radius:var(--r-sm); font-size:14.5px; line-height:1.5; color:var(--ink-soft); margin-bottom:18px; }
.note .ic { width:17px; height:17px; flex:none; margin-top:2px; color:var(--accent); }
.note.warn { background:var(--warn-bg); border-color:transparent; color:var(--warn); }
.note.warn .ic { color:var(--warn); }
.note.privacy-note { background:var(--accent-tint); border-color:transparent; color:var(--accent-deep); }
.note.privacy-note .ic { color:var(--accent-deep); }
.disclaimer { display:flex; gap:12px; align-items:flex-start; padding:14px 0 0; margin-top:8px; font-size:14px; line-height:1.55; color:var(--ink-soft); }
.disclaimer .ic { width:18px; height:18px; flex:none; margin-top:2px; color:var(--ink-faint); }
.disclaimer a { color:var(--ink); font-weight:600; }

/* ---------- Textseiten (FAQ, Ratgeber, Fehlercodes, Recht) ---------- */
.prose { max-width:740px; line-height:1.7; font-size:16.5px; }
.prose.wide { max-width:none; }
.prose h1 { font-weight:800; font-size:clamp(1.9rem,4vw,2.7rem); letter-spacing:-.03em; line-height:1.1; margin:6px 0 12px; text-wrap:balance; }
.prose h2 { font-weight:700; font-size:1.4rem; margin:40px 0 10px; letter-spacing:-.015em; line-height:1.25; }
.prose h3 { font-size:1.08rem; margin:26px 0 6px; }
.prose p { margin:0 0 14px; }
.prose ul, .prose ol { margin:0 0 16px; padding-left:22px; }
.prose li { margin-bottom:6px; }
.prose a { color:var(--ink); text-decoration-color:var(--accent); text-decoration-thickness:1.5px; text-underline-offset:3px; }
.prose a:hover { color:var(--accent-deep); }
.prose .lead { color:var(--ink-soft); font-size:19px; line-height:1.55; margin:0 0 26px; }
.prose table { width:100%; border-collapse:collapse; margin:12px 0 20px; font-size:15px; background:var(--surface); border:1px solid var(--line); }
.prose th, .prose td { text-align:left; padding:10px 14px; border-bottom:1px solid var(--line-soft); vertical-align:top; }
.prose thead th { background:var(--surface-2); font-weight:600; }
.prose code { font-family:var(--mono); font-size:.86em; background:var(--surface-2); border:1px solid var(--line-soft); padding:1px 5px; border-radius:3px; }
.prose .note { display:block; }
.steps li b { display:inline; margin-right:4px; }
.defs { display:grid; grid-template-columns:max-content 1fr; gap:8px 20px; margin:0 0 16px; }
.defs dt { font-weight:600; }
.defs dd { margin:0; color:var(--ink-soft); }
.link-list li { margin-bottom:4px; }
.checklist { list-style:none; padding-left:0; }
.checklist li { padding-left:30px; position:relative; }
.checklist li::before { content:""; position:absolute; left:2px; top:6px; width:15px; height:15px; border:1.6px solid var(--accent); border-radius:3px; }
.rule-table td:first-child { white-space:nowrap; }
.rule-table td:first-child a, .rule-table td:first-child code { font:500 13px var(--mono); background:var(--mark); color:var(--mark-ink); padding:1px 6px; border-radius:3px; text-decoration:none; border:0; }
.rule-quote { margin:0 0 8px; padding:14px 18px; border-left:4px solid var(--accent); background:var(--surface); font-size:15.5px; }
.cta-row { display:flex; gap:10px; flex-wrap:wrap; margin:24px 0; }
.tool-hint { padding:14px 16px; border-radius:var(--r-sm); background:var(--accent-tint); margin:30px 0 16px; font-size:15px; }
.inline-state { margin-left:8px; font-size:15px; }
@media (max-width:600px){ .defs { grid-template-columns:1fr; } .defs dd { margin-bottom:8px; } }

/* Statusseite */
.status-banner { border-radius:var(--r-sm); padding:14px 16px; font-weight:600; margin-bottom:22px; display:flex; align-items:center; gap:10px; border-left:4px solid currentColor; }
.status-banner.ok { background:var(--ok-bg); color:var(--ok); }
.status-banner.bad { background:var(--danger-bg); color:var(--danger); }
.status-banner.warn { background:var(--warn-bg); color:var(--warn); }
.status-banner.wait { background:var(--surface-2); color:var(--ink-soft); }
.status-banner .dot, .status-rows .dot { width:10px; height:10px; border-radius:50%; flex:none; background:currentColor; display:inline-block; }
.status-rows .row { display:flex; justify-content:space-between; align-items:center; gap:12px; padding:14px 0; border-bottom:1px solid var(--line); font-size:15px; }
.status-rows .row:last-child { border-bottom:none; }
.status-rows .k { color:var(--ink-soft); }
.pill { display:inline-flex; align-items:center; gap:7px; font-weight:500; font-size:14px; }
.pill.ok { color:var(--ok); } .pill.bad { color:var(--danger); }

/* Spinner */
.spinner { width:16px; height:16px; border:2px solid currentColor; border-top-color:transparent; border-radius:50%; animation:spin .7s linear infinite; display:inline-block; }
@keyframes spin { to { transform:rotate(360deg); } }

/* Meldungen */
.toasts { position:fixed; right:20px; bottom:20px; display:flex; flex-direction:column; gap:10px; z-index:70; max-width:min(380px, calc(100vw - 40px)); }
.toast { display:flex; align-items:flex-start; gap:11px; padding:13px 15px; border-radius:var(--r-md); background:var(--surface); border:1px solid var(--line); box-shadow:var(--shadow-lg); animation:toastIn .3s cubic-bezier(.2,.8,.3,1) both; }
@keyframes toastIn { from { opacity:0; transform:translateY(14px); } }
.toast .ic { width:18px; height:18px; flex:none; margin-top:1px; }
.toast.ok .ic { color:var(--ok); }
.toast.err .ic { color:var(--danger); }
.toast.warn .ic { color:var(--warn); }
.toast .body { font-size:14px; line-height:1.45; }
.toast .body b { display:block; font-weight:600; margin-bottom:1px; }

/* ---------- Fußzeile ---------- */
.foot { background:var(--surface); border-top:1px solid var(--line); color:var(--ink-soft); font-size:14.5px; }
.foot-in { max-width:var(--page); margin:0 auto; padding:48px 32px 32px; display:grid; grid-template-columns:1.3fr 1fr 1.3fr .8fr; gap:32px; }
.foot-about .privacy { margin:14px 0 0; max-width:30em; line-height:1.55; }
.foot-col { display:flex; flex-direction:column; align-items:flex-start; gap:7px; }
.foot-group-label { font-weight:700; color:var(--ink); margin-bottom:4px; }
.foot-link { color:var(--ink-soft); text-decoration:none; font-size:14.5px; line-height:1.4; }
.foot-link:hover { color:var(--ink); text-decoration:underline; text-decoration-color:var(--accent); text-underline-offset:3px; }
.foot-bottom { max-width:var(--page); margin:0 auto; padding:16px 32px 28px; border-top:1px solid var(--line-soft); }
.foot .copy { font-size:13.5px; color:var(--ink-faint); }

/* ---------- Sortierbare Dateiliste ---------- */
.list-head { display:flex; align-items:center; gap:10px; margin:16px 0 8px; }
.list-head span { flex:1; font-size:14px; color:var(--ink-faint); }
.file-list { display:flex; flex-direction:column; gap:8px; list-style:none; margin:0; padding:0; }
.fl-item { display:flex; align-items:center; gap:10px; padding:8px 10px; background:var(--surface); border:1px solid var(--line); border-radius:var(--r-sm); cursor:grab; transition:border-color .15s, box-shadow .15s, opacity .15s; }
.fl-item:active { cursor:grabbing; }
.fl-item.dragging { opacity:.4; }
.fl-item.over { border-color:var(--accent); box-shadow:0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent); }
.fl-grip { color:var(--ink-faint); display:grid; place-items:center; flex:none; }
.fl-grip svg { width:14px; height:14px; }
.fl-idx { font-size:12px; font-weight:700; color:var(--on-accent); background:var(--accent-deep); width:22px; height:22px; border-radius:4px; display:grid; place-items:center; flex:none; }
html[data-theme="dark"] .fl-idx { background:var(--accent); }
.fl-thumb { width:32px; height:40px; object-fit:cover; border-radius:3px; border:1px solid var(--line); background:var(--surface-2); flex:none; }
.fl-pdf { width:32px; height:40px; border-radius:3px; border:1px solid var(--line); background:var(--surface-2); display:grid; place-items:center; color:var(--ink-soft); flex:none; }
.fl-pdf svg { width:15px; height:15px; }
.fl-name { flex:1; min-width:0; font-size:14px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.fl-size { font-size:13px; color:var(--ink-faint); flex:none; }
.fl-btn { background:none; border:none; color:var(--ink-faint); cursor:pointer; padding:7px; border-radius:4px; display:grid; place-items:center; flex:none; }
.fl-btn:hover { color:var(--ink); background:var(--surface-2); }
.fl-btn:disabled { opacity:.35; cursor:default; }
.fl-btn.del:hover { color:var(--danger); }
.fl-btn svg { width:15px; height:15px; fill:none; stroke:currentColor; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; }
@media (max-width:480px){ .fl-size, .fl-grip { display:none; } }

.opt-row { display:flex; align-items:center; gap:12px; margin-top:16px; flex-wrap:wrap; }
.opt-lbl { font-size:14px; font-weight:600; color:var(--ink-soft); flex:none; }
.name-input { flex:1; min-width:0; width:100%; max-width:480px; height:42px; padding:0 12px; border:1px solid var(--line); border-radius:var(--r-sm); background:var(--surface); color:var(--ink); font:inherit; font-size:15px; }
.name-input:focus { border-color:var(--accent); }
.seg { display:inline-flex; border:1px solid var(--line); border-radius:var(--r-sm); overflow:hidden; }
.seg button { background:var(--surface); border:none; padding:9px 14px; font:inherit; font-size:14px; color:var(--ink-soft); cursor:pointer; }
.seg button + button { border-left:1px solid var(--line); }
.seg button[aria-pressed="true"] { background:var(--accent-tint); color:var(--accent-deep); font-weight:600; }

/* ---------- E-Rechnung-Formular ---------- */
.frm { display:grid; gap:16px; }
.frm .grp { display:grid; gap:12px; grid-template-columns:1fr 1fr; }
.frm .grp.three { grid-template-columns:1fr 1fr 1fr; }
.frm .grp.four { grid-template-columns:2fr 1fr 1fr 1fr; }
.frm label { display:block; font-size:14px; font-weight:500; color:var(--ink-soft); margin-bottom:5px; }
.frm .req::after { content:" *"; color:var(--danger); font-weight:700; }
.frm input, .frm select, .frm textarea { width:100%; padding:10px 11px; min-height:44px; border:1px solid var(--line); border-radius:var(--r-sm); background:var(--surface); color:var(--ink); font:inherit; font-size:16px; }
@media (min-width:761px){ .frm input, .frm select, .frm textarea { font-size:15px; } }
.frm input:focus, .frm select:focus, .frm textarea:focus { outline:2px solid var(--accent); outline-offset:1px; border-color:var(--accent); }
.frm [aria-invalid="true"] { border-color:var(--danger); box-shadow:0 0 0 1px var(--danger); }
.frm .hint { font-size:13px; color:var(--ink-faint); margin-top:4px; }
.frm .hint a { color:var(--ink-soft); text-decoration-color:var(--accent); }
.frm input[type="file"] { padding:8px; }
.frm input[readonly], .frm select:disabled { background:var(--surface-2); color:var(--ink-soft); }
.field-note { font-size:13px; margin-top:4px; }
.field-note.ok { color:var(--ok); }
.field-note.bad { color:var(--danger); }
.align-end { display:flex; gap:8px; align-items:flex-end; flex-wrap:wrap; }
label.check { display:flex; gap:10px; align-items:flex-start; font-size:15px; color:var(--ink); margin-top:12px; cursor:pointer; }
label.check input { width:18px; height:18px; min-height:0; margin:2px 0 0; flex:none; accent-color:var(--accent-deep); }
details.sub { border:1px dashed var(--line); border-radius:var(--r-sm); padding:10px 12px; }
details.sub > summary { cursor:pointer; font-size:14.5px; font-weight:600; color:var(--ink-soft); }
details.sub[open] > summary { margin-bottom:12px; }
.draft-bar .card-title { margin-bottom:10px; }
.sum-preview { font-size:14.5px; font-weight:500; color:var(--ink); text-align:right; font-variant-numeric:tabular-nums; }
.line-row { border:1px solid var(--line); border-radius:var(--r-md); padding:16px; background:var(--surface-2); margin-bottom:12px; }
.line-head { display:flex; justify-content:space-between; align-items:center; margin-bottom:10px; gap:10px; }
.line-head b { font-size:15px; }
.line-tools { display:flex; gap:6px; }
.btn-rm { border:1px solid var(--line); background:var(--surface); color:var(--ink-soft); cursor:pointer; border-radius:var(--r-sm); padding:6px 10px; font:inherit; font-size:13.5px; }
.btn-rm:hover { color:var(--danger); border-color:var(--danger); }
.btn-rm:disabled { opacity:.45; cursor:default; color:var(--ink-faint); border-color:var(--line); }
.form-msg { padding:11px 14px; border-radius:var(--r-sm); font-size:15px; margin-bottom:10px; white-space:pre-line; border-left:4px solid currentColor; }
.form-msg.err { background:var(--danger-bg); color:var(--danger); }
.form-msg.ok { background:var(--ok-bg); color:var(--ok); }
.form-msg.info { background:var(--surface-2); color:var(--ink-soft); }
.form-msg.warn { background:var(--warn-bg); color:var(--warn); }
.form-msg ul { margin:6px 0 0; padding-left:18px; }
.form-msg a { color:inherit; font-weight:600; }
.logo-preview { margin-top:8px; display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.logo-preview img { max-height:48px; max-width:160px; border:1px solid var(--line); border-radius:4px; padding:4px; background:#fff; }
.logo-preview span { font-size:13px; color:var(--ink-soft); }
.logo-preview .err { color:var(--danger); }
.img-out { margin-top:8px; max-height:80px; max-width:100%; border:1px solid var(--line); border-radius:4px; padding:4px; background:#fff; }
.ml-auto { margin-left:auto; }

/* ---------- Einwilligung ---------- */
.consent { position:fixed; left:0; right:0; bottom:0; z-index:60; background:var(--surface); border-top:1px solid var(--line); box-shadow:var(--shadow-lg); padding:18px max(24px, calc(50vw - 590px)); display:flex; flex-wrap:wrap; gap:14px; align-items:center; justify-content:space-between; }
.consent[hidden] { display:none; }
.consent p { flex:1; min-width:260px; font-size:14.5px; color:var(--ink); line-height:1.5; margin:0; }
.consent a { color:var(--ink); text-decoration-color:var(--accent); font-weight:600; }
.consent .actions { display:flex; gap:10px; flex:none; }

/* ---------- Kleinere Bildschirme ---------- */
@media (max-width:1060px) {
  .head-in { gap:20px; }
  .status-dot span { display:none; }
}
@media (max-width:960px) {
  .hero { grid-template-columns:1fr; gap:40px; padding:44px 0 36px; }
  .layers { height:380px; max-width:560px; }
  .split { grid-template-columns:1fr; gap:20px; }
  .foot-in { grid-template-columns:1fr 1fr; }
}
@media (max-width:860px) {
  .site-head { backdrop-filter:none; -webkit-backdrop-filter:none; background:var(--surface); }
  .head-in { padding:0 16px; height:60px; }
  :root { --head-h:60px; }
  .head-cta { display:none; }
  .menu-btn { display:grid; }
  /* Navigation als Panel von rechts */
  .nav { position:fixed; top:0; right:0; bottom:0; width:min(340px, 88vw); background:var(--surface); border-left:1px solid var(--line); box-shadow:var(--shadow-lg); flex-direction:column; align-items:stretch; gap:2px; padding:20px 16px; overflow-y:auto; transform:translateX(100%); visibility:hidden; transition:transform .25s, visibility .25s; z-index:50; }
  .nav.open { transform:none; visibility:visible; }
  .nav-link { padding:12px 10px; font-size:16px; }
  .nav-link.active::after { display:none; }
  .nav-link.active { background:var(--accent-tint); color:var(--accent-deep); }
  .mega { position:static; width:auto; box-shadow:none; border:0; padding:4px 0 10px; grid-template-columns:1fr; }
  .nav-item span { display:none; }
  .scrim.show { display:block; position:fixed; inset:0; background:rgba(10,16,30,.45); z-index:25; }
  .content { padding:24px 16px 48px; }
  .crumbbar { padding:14px 16px 0; }
  .band { padding-top:40px; padding-bottom:40px; }
  .tool-list { grid-template-columns:1fr; }
  .two-up { grid-template-columns:1fr; }
  .frm .grp, .frm .grp.three, .frm .grp.four { grid-template-columns:1fr; }
  .msg { grid-template-columns:1fr; gap:6px; }
  .toasts { left:12px; right:12px; bottom:12px; max-width:none; }
  .consent { padding:16px; }
  .consent .actions { width:100%; }
  .consent .actions .btn { flex:1; }
}
@media (max-width:560px) {
  .brand-name { font-size:16.5px; }
  .layers { height:330px; }
  .layer-xml { width:92%; height:300px; padding:18px; }
  .layer-xml code { font-size:11.5px; }
  .layer-pdf { width:86%; padding:20px; }
  .lp-title { font-size:18px; margin:14px 0 8px; }
  .lp-row { font-size:13px; }
  .lp-stamp { right:-6px; font-size:13px; }
  .val-summary { gap:8px; }
  .val-stat { padding:10px; }
  .foot-in { grid-template-columns:1fr; padding:36px 16px 24px; }
  .foot-bottom { padding:14px 16px 24px; }
}
@media (prefers-reduced-motion:reduce) {
  *, *::before, *::after { animation-duration:.001ms !important; animation-iteration-count:1 !important; transition-duration:.001ms !important; scroll-behavior:auto !important; }
}
