/*
 * ERIT Cloud, design system "Petrol" (D-71). Ported from the founder's Figma Make export
 * (src/index.css + src/ds.tsx) to plain CSS custom properties; no build step (DP-8).
 *
 * Rules carried over from the mock:
 * - Petrol is the brand: links, navigation, primary actions, focus.
 * - Error red is reserved for the status "Fehler" (mock: "Zu korrigieren") and nothing else.
 * - Every status has its own shape, so colour is never the only signal.
 * - Serif (Source Serif 4) only for headlines, verdicts and large figures; mono (IBM Plex Mono)
 *   only for references, numbers of documents and keys; everything else IBM Plex Sans.
 * - Motion is calm and short; prefers-reduced-motion switches it off.
 */

/* ------------------------------------------------------------------ fonts (self-hosted, OFL) */
@font-face { font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 400; font-display: swap; src: url(../fonts/ibm-plex-sans-latin-400-normal.woff2) format('woff2'); }
@font-face { font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 500; font-display: swap; src: url(../fonts/ibm-plex-sans-latin-500-normal.woff2) format('woff2'); }
@font-face { font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 600; font-display: swap; src: url(../fonts/ibm-plex-sans-latin-600-normal.woff2) format('woff2'); }
@font-face { font-family: 'IBM Plex Mono'; font-style: normal; font-weight: 400; font-display: swap; src: url(../fonts/ibm-plex-mono-latin-400-normal.woff2) format('woff2'); }
@font-face { font-family: 'IBM Plex Mono'; font-style: normal; font-weight: 500; font-display: swap; src: url(../fonts/ibm-plex-mono-latin-500-normal.woff2) format('woff2'); }
/* Source Serif 4 with its optical-size axis (opsz 8..60), as the Figma loads it: large headlines get the
   narrower display cut automatically. Google Fonts' latin file, unmodified (Reserved Font Name "Source"). */
@font-face { font-family: 'Source Serif 4'; font-style: normal; font-weight: 500 600; font-display: swap; src: url(../fonts/source-serif-4-latin-opsz.woff2) format('woff2'); }

/* ------------------------------------------------------------------ tokens */
:root,
[data-theme='light'] {
  --c-bg: #f5f4f0;
  --c-surface: #ffffff;
  --c-surface-2: #efede7;
  --c-ink: #141c1c;
  --c-muted: #4d5958;
  --c-line: #d8d5cc;
  --c-line-strong: #a9a59a;
  --c-brand: #1d4c52;
  --c-brand-hover: #163b40;
  --c-brand-ink: #ffffff;
  --c-brand-soft: #e3eeee;
  --c-ok: #1c6636;
  --c-ok-soft: #e5f1e8;
  --c-err: #a3202a;
  --c-err-soft: #fbe9e9;
  --c-warn: #7f4d00;
  --c-warn-soft: #faefd9;
  --c-pend: #3c4a57;
  --c-pend-soft: #e9edf1;
  --c-focus: #1d4c52;
  --c-paper: #ffffff;
  --c-scrim: rgba(20, 28, 28, 0.45);
  /* the ERIT mark: the brand kit's fixed colours (tools/site/brand_mark.py) */
  --mark-tile: #faf8f3; --mark-stroke: #2c2a27; --mark-line: #2c2a27;
  --mark-accent: #1d5870; --mark-shadow: #2c2a27;
  color-scheme: light;
}

[data-theme='dark'] {
  --c-bg: #0e1414;
  --c-surface: #151d1d;
  --c-surface-2: #1c2626;
  --c-ink: #e7ecea;
  --c-muted: #a2afad;
  --c-line: #2d3939;
  --c-line-strong: #4d5c5c;
  --c-brand: #86c8c8;
  --c-brand-hover: #a3d7d7;
  --c-brand-ink: #0e1414;
  --c-brand-soft: #1b3436;
  --c-ok: #74d093;
  --c-ok-soft: #14301e;
  --c-err: #ff9090;
  --c-err-soft: #3b1a1c;
  --c-warn: #f0b95c;
  --c-warn-soft: #33270f;
  --c-pend: #b7c3cf;
  --c-pend-soft: #222b34;
  --c-focus: #a3d7d7;
  --c-paper: #f4f2ec;
  --c-scrim: rgba(0, 0, 0, 0.6);
  --mark-tile: #1b2227; --mark-stroke: #3a474e; --mark-line: #e9e4da;
  --mark-accent: #5aacce; --mark-shadow: #000000;
  color-scheme: dark;
}

/* No explicit choice yet: follow the operating system. theme.js sets data-theme before paint
   when the user picked one; this block covers the no-JS case. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --c-bg: #0e1414; --c-surface: #151d1d; --c-surface-2: #1c2626; --c-ink: #e7ecea; --c-muted: #a2afad;
    --c-line: #2d3939; --c-line-strong: #4d5c5c; --c-brand: #86c8c8; --c-brand-hover: #a3d7d7; --c-brand-ink: #0e1414;
    --c-brand-soft: #1b3436; --c-ok: #74d093; --c-ok-soft: #14301e; --c-err: #ff9090; --c-err-soft: #3b1a1c;
    --c-warn: #f0b95c; --c-warn-soft: #33270f; --c-pend: #b7c3cf; --c-pend-soft: #222b34; --c-focus: #a3d7d7;
    --c-paper: #f4f2ec; --c-scrim: rgba(0, 0, 0, 0.6);
    --mark-tile: #1b2227; --mark-stroke: #3a474e; --mark-line: #e9e4da;
    --mark-accent: #5aacce; --mark-shadow: #000000;
    color-scheme: dark;
  }
}

:root {
  --font-sans: 'IBM Plex Sans', system-ui, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, monospace;
  --font-serif: 'Source Serif 4', Georgia, serif;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --r-sm: 4px;
  --r-md: 6px;
  --r-lg: 8px;
  --r-xl: 12px;
  --rail: 212px;
}

/* ------------------------------------------------------------------ base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.45;
  background: var(--c-bg);
  color: var(--c-ink);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, p, dl, dd, ol, ul, figure { margin: 0; }
h1, h2, h3, h4 { overflow-wrap: break-word; hyphens: auto; }
ol, ul { padding: 0; list-style: none; }
a { color: var(--c-brand); text-underline-offset: 2px; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; text-align: inherit; }
button:disabled { cursor: not-allowed; }
img, svg { display: block; }
svg.inline { display: inline-block; vertical-align: -2px; }
table { border-collapse: collapse; }
[hidden] { display: none !important; }

:where(button, a, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--c-focus);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}

.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-link { position: absolute; left: 12px; top: -48px; z-index: 50; background: var(--c-brand); color: var(--c-brand-ink); padding: 8px 12px; border-radius: var(--r-md); font-weight: 600; text-decoration: none; }
.skip-link:focus { top: 12px; }

.tnum { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--font-mono); }
.serif { font-family: var(--font-serif); }
.muted { color: var(--c-muted); }
.ink { color: var(--c-ink); }
.brand { color: var(--c-brand); }
.hyph { hyphens: auto; overflow-wrap: break-word; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.nowrap { white-space: nowrap; }
.break-all { word-break: break-all; }
.fw-500 { font-weight: 500; }
.fw-600 { font-weight: 600; }

/* spacing helpers (no style attributes: the CSP has no 'unsafe-inline') */
.mt-4 { margin-top: 4px; } .mt-6 { margin-top: 6px; } .mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; } .mt-32 { margin-top: 32px; } .mb-12 { margin-bottom: 12px; }

/* ------------------------------------------------------------------ status: shape + word + colour */
.s-ok { --s: var(--c-ok); --s-soft: var(--c-ok-soft); }
.s-err { --s: var(--c-err); --s-soft: var(--c-err-soft); }
.s-pdf { --s: var(--c-warn); --s-soft: var(--c-warn-soft); }
.s-pend { --s: var(--c-pend); --s-soft: var(--c-pend-soft); }
.s-quar { --s: var(--c-pend); --s-soft: var(--c-pend-soft); }
.s-dup { --s: var(--c-pend); --s-soft: var(--c-pend-soft); }
.s-done { --s: var(--c-brand); --s-soft: var(--c-brand-soft); }
.s-fg { color: var(--s); }

.shape { flex-shrink: 0; color: var(--s, currentColor); }
.icon { flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

.badge {
  display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; white-space: nowrap;
  font-weight: 500; color: var(--s); background: var(--s-soft); padding: 4px 10px; font-size: 13px; line-height: 1.2;
}
.badge--compact { padding: 2px 8px; font-size: 12px; gap: 5px; }

/* ------------------------------------------------------------------ buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px; font-size: 14px; font-weight: 500; line-height: 1;
  border-radius: var(--r-md); border: 1px solid transparent; text-decoration: none; white-space: nowrap;
  transition: background-color .15s, border-color .15s, color .15s;
}
.btn--sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn--lg { height: 48px; padding: 0 20px; font-size: 15px; }
.btn--primary { background: var(--c-brand); color: var(--c-brand-ink); }
.btn--primary:hover { background: var(--c-brand-hover); }
.btn--secondary { background: var(--c-surface); color: var(--c-ink); border-color: var(--c-line-strong); }
.btn--secondary:hover { background: var(--c-surface-2); }
.btn--ghost { color: var(--c-brand); }
.btn--ghost:hover { background: var(--c-brand-soft); }
.btn--block { width: 100%; }
.btn:disabled, .btn[aria-disabled='true'] { opacity: .45; cursor: not-allowed; }
.btn:disabled:hover { background: inherit; }
.btn--primary:disabled:hover { background: var(--c-brand); }

.kbd {
  font-family: var(--font-mono); font-size: 11px; line-height: 1; padding: 4px 6px; border-radius: var(--r-sm);
  border: 1px solid var(--c-line-strong); color: var(--c-muted); background: var(--c-surface-2); font-weight: 400;
}
.btn--primary .kbd { border-color: color-mix(in srgb, currentColor 40%, transparent); background: transparent; color: inherit; opacity: .9; }
html[data-kbd='aus'] .kbd--letter { display: none; }

.link { color: var(--c-brand); font-weight: 500; text-decoration: none; display: inline-flex; align-items: center; gap: 4px; }
.link:hover { text-decoration: underline; }

/* ------------------------------------------------------------------ form controls */
.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.field > span:first-child, .field__label { font-weight: 500; }
.field__hint { color: var(--c-muted); font-size: 12.5px; }
.input, .select, .textarea {
  height: 40px; border-radius: var(--r-md); border: 1px solid var(--c-line-strong); background: var(--c-surface);
  padding: 0 12px; font-size: 14px; width: 100%;
}
.input--sm, .select--sm { height: 36px; font-size: 13.5px; padding: 0 10px; }
.textarea { height: auto; padding: 12px; line-height: 1.6; resize: vertical; }
.input:focus-visible, .select:focus-visible, .textarea:focus-visible { border-color: var(--c-brand); }
.input--code { font-family: var(--font-mono); font-size: 22px; letter-spacing: .3em; text-align: center; height: 52px; }
.field--error .input { border-color: var(--c-err); }
.form-error { color: var(--c-err); font-weight: 500; display: flex; gap: 8px; align-items: flex-start; font-size: 13.5px; }

.search { position: relative; display: block; }
.search .icon { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--c-muted); }
.search input {
  height: 32px; width: 220px; border-radius: var(--r-md); border: 1px solid var(--c-line); background: var(--c-bg);
  padding: 0 36px 0 32px; font-size: 13px;
}
.search input::placeholder { color: var(--c-muted); }
.search .kbd { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); }

.switch { position: relative; flex-shrink: 0; width: 44px; height: 24px; border-radius: 999px; border: 1px solid var(--c-line-strong); background: var(--c-surface-2); transition: background-color .2s, border-color .2s; }
.switch::after { content: ''; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: var(--c-surface); box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: left .2s var(--ease); }
.switch[aria-checked='true'] { background: var(--c-brand); border-color: var(--c-brand); }
.switch[aria-checked='true']::after { left: 21px; }
/* the knob's mark (Figma Switch): a dash when off, a check when on */
.switch::before { content: ''; position: absolute; z-index: 1; left: 7px; top: 10px; width: 8px; height: 2px; border-radius: 1px; background: var(--c-line-strong); transition: left .2s var(--ease); }
.switch[aria-checked='true']::before { left: 28px; top: 5px; width: 5px; height: 9px; border-radius: 0; background: none; border: solid var(--c-brand); border-width: 0 2px 2px 0; transform: rotate(45deg); }

.seg { display: inline-flex; border: 1px solid var(--c-line-strong); border-radius: var(--r-md); padding: 2px; }
.seg__opt { height: 28px; padding: 0 12px; border-radius: var(--r-sm); font-size: 12.5px; color: var(--c-muted); display: inline-flex; align-items: center; text-decoration: none; }
.seg__opt:hover { color: var(--c-ink); }
.seg__opt[aria-checked='true'], .seg__opt[aria-current='true'] { background: var(--c-brand-soft); color: var(--c-brand); font-weight: 600; }

/* ------------------------------------------------------------------ shell */
.app { display: flex; min-height: 100vh; }
.rail {
  width: var(--rail); flex-shrink: 0; background: var(--c-surface-2); border-right: 1px solid var(--c-line);
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.rail__brand { height: 56px; padding: 0 20px; display: flex; align-items: center; gap: 9px; color: var(--c-ink); text-decoration: none; }
.logo-word { font-family: var(--font-mono); font-weight: 500; letter-spacing: .14em; font-size: 15px; line-height: 1; }
.rail__nav { padding: 8px 10px 0; display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  position: relative; width: 100%; height: 36px; padding: 0 8px 0 10px; border-radius: var(--r-md); display: flex; align-items: center; gap: 10px;
  font-size: 13.5px; color: var(--c-muted); text-decoration: none; transition: background-color .15s, color .15s;
}
.nav-item:hover { color: var(--c-ink); background: color-mix(in srgb, var(--c-surface) 60%, transparent); }
.nav-item[aria-current='page'] { background: var(--c-surface); color: var(--c-ink); font-weight: 600; box-shadow: 0 1px 0 var(--c-line), 0 0 0 1px var(--c-line); }
.nav-item[aria-current='page'] .icon { color: var(--c-brand); }
.nav-item__count { margin-left: auto; font-size: 12px; font-weight: 500; color: var(--c-ink); font-variant-numeric: tabular-nums; }
.nav-item__key { position: absolute; right: 8px; font-family: var(--font-mono); font-size: 10.5px; color: var(--c-muted); background: inherit; opacity: 0; transition: opacity .15s; }
.nav-item:hover .nav-item__key, .nav-item:focus-visible .nav-item__key { opacity: 1; }
.nav-item__count + .nav-item__key { display: none; }
.nav-item__tag { margin-left: auto; font-size: 11px; color: var(--c-muted); border: 1px solid var(--c-line-strong); border-radius: 999px; padding: 1px 6px; font-weight: 500; }
.nav-item__tag + .nav-item__key { display: none; }

/* Unternehmen / Mandanten switcher at the top of the rail (DP-6) */
.switcher { margin: 4px 10px 6px; position: relative; }
.switcher > summary {
  list-style: none; cursor: pointer; display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; align-items: center;
  padding: 8px 10px; border-radius: var(--r-md); border: 1px solid var(--c-line); background: var(--c-surface);
}
.switcher > summary::-webkit-details-marker { display: none; }
.switcher > summary:hover { border-color: var(--c-line-strong); }
.switcher__label { font-size: 11px; color: var(--c-muted); grid-column: 1; }
.switcher__name { font-size: 13px; font-weight: 600; grid-column: 1; }
.switcher__chev { grid-column: 2; grid-row: 1 / span 2; color: var(--c-muted); transform: rotate(90deg); transition: transform .2s var(--ease); }
.switcher[open] .switcher__chev { transform: rotate(-90deg); }
.switcher__static { padding: 8px 10px; }
.switcher__menu {
  position: absolute; z-index: 30; left: 0; right: -120px; top: calc(100% + 4px); background: var(--c-surface); border: 1px solid var(--c-line-strong);
  border-radius: var(--r-lg); box-shadow: 0 16px 40px -18px rgba(0,0,0,.45); padding: 6px; animation: rise .2s var(--ease) both;
}
.switcher__menu h2 { font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--c-muted); padding: 6px 8px 4px; }
.switcher__opt { width: 100%; display: grid; grid-template-columns: 16px 1fr auto; gap: 8px; align-items: center; padding: 8px; border-radius: var(--r-md); font-size: 13px; text-align: left; }
.switcher__opt:hover { background: var(--c-surface-2); }
.switcher__opt[aria-current='true'] { background: var(--c-brand-soft); }
.switcher__opt .role { font-size: 11.5px; color: var(--c-muted); }
.switcher__all { display: block; padding: 8px; font-size: 12.5px; border-top: 1px solid var(--c-line); margin-top: 4px; }

.rail__foot { margin: auto 12px 12px; display: flex; flex-direction: column; gap: 10px; }
.status-card { border-radius: var(--r-lg); border: 1px solid var(--c-line); background: var(--c-surface); padding: 12px; font-size: 12px; line-height: 1.35; }
.status-card__head { display: flex; align-items: center; gap: 8px; font-weight: 500; color: var(--c-ink); }
.status-card p { color: var(--c-muted); padding-left: 16px; margin-top: 4px; }
.status-card .sep { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--c-line); }
.dot { position: relative; display: inline-flex; width: 8px; height: 8px; flex-shrink: 0; }
.dot::before, .dot::after { content: ''; position: absolute; inset: 0; border-radius: 50%; background: var(--s, var(--c-ok)); }
.dot--live::before { animation: ping 2s cubic-bezier(0, 0, .2, 1) infinite; opacity: .4; }
.rail__user { display: flex; align-items: center; gap: 8px; font-size: 12.5px; padding: 0 2px; }
.rail__user .who { min-width: 0; flex: 1; }
.rail__user .who b { display: block; font-weight: 500; }
.rail__user .who span { color: var(--c-muted); font-size: 11.5px; }
.icon-btn { width: 32px; height: 32px; border-radius: var(--r-md); display: inline-grid; place-items: center; color: var(--c-muted); }
.icon-btn:hover { background: var(--c-surface); color: var(--c-ink); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; min-height: 100vh; }
.toolbar {
  min-height: 56px; flex-shrink: 0; padding: 8px 20px; display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
  border-bottom: 1px solid var(--c-line); background: var(--c-surface);
}
.toolbar h1 { font-size: 16px; font-weight: 600; white-space: nowrap; }
.toolbar__meta { font-size: 13px; color: var(--c-muted); white-space: nowrap; }
.toolbar__end { margin-left: auto; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

/* banners: Testphase, Lesemodus, Prüfer, Vorschau */
.banner { display: flex; gap: 12px; align-items: flex-start; padding: 10px 20px; font-size: 13px; line-height: 1.5; border-bottom: 1px solid var(--c-line); }
.banner .shape, .banner .icon { margin-top: 2px; }
.banner b { font-weight: 600; }
.banner__end { margin-left: auto; display: flex; gap: 12px; align-items: center; flex-shrink: 0; }
.banner--trial { background: var(--c-warn-soft); color: var(--c-ink); }
.banner--trial > .icon { color: var(--c-warn); }
.banner--readonly { background: var(--c-pend-soft); }
.banner--pruefer { background: var(--c-brand-soft); }
.banner--pruefer > .icon { color: var(--c-brand); }
.preview-ribbon {
  position: fixed; z-index: 60; right: 12px; bottom: 12px; font-family: var(--font-mono); font-size: 11px; letter-spacing: .08em;
  text-transform: uppercase; background: var(--c-ink); color: var(--c-bg); padding: 6px 10px; border-radius: 999px; text-decoration: none;
}

/* ------------------------------------------------------------------ shared blocks */
.eyebrow { font-family: var(--font-mono); font-size: 12px; text-transform: uppercase; letter-spacing: .14em; color: var(--c-muted); }
.card { border-radius: var(--r-xl); border: 1px solid var(--c-line); background: var(--c-surface); overflow: hidden; }
.card--lg { border-radius: var(--r-lg); }
.rows > * + * { border-top: 1px solid var(--c-line); }
.section-title { font-size: 15px; font-weight: 600; }
.section-title .muted { font-weight: 400; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.leader { flex: 1; border-bottom: 1px dotted var(--c-line-strong); transform: translateY(-4px); min-width: 1rem; }
.leader-row { display: flex; align-items: baseline; gap: 8px; padding: 4px 0; }
.chev { transform: none; }
.back { transform: rotate(180deg); }

.timeline { position: relative; padding-left: 24px; }
.timeline::before { content: ''; position: absolute; left: 5px; top: 8px; bottom: 8px; width: 1px; background: var(--c-line); }
.timeline li { position: relative; display: grid; grid-template-columns: minmax(52px, max-content) 1fr; gap: 12px; padding: 8px 0; font-size: 13.5px; }
.timeline li::before { content: ''; position: absolute; left: -22px; top: 13px; width: 9px; height: 9px; border-radius: 50%; border: 2px solid var(--c-brand); background: var(--c-bg); }
.timeline time { font-family: var(--font-mono); font-size: 12.5px; color: var(--c-muted); font-variant-numeric: tabular-nums; padding-top: 1px; }
.timeline--tight { padding-left: 20px; }
.timeline--tight::before { left: 4px; top: 6px; bottom: 6px; }
.timeline--tight li { grid-template-columns: auto 1fr; gap: 8px; padding: 6px 0; font-size: 13px; }
.timeline--tight li::before { left: -19px; top: 11px; background: var(--c-surface); }

.seal { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; border: 1px solid color-mix(in srgb, var(--c-brand) 40%, transparent); background: var(--c-brand-soft); color: var(--c-brand); padding: 4px 10px; font-size: 12.5px; font-weight: 500; }
.hash { font-family: var(--font-mono); font-size: 11.5px; word-break: break-all; border-radius: var(--r-md); background: var(--c-surface-2); padding: 8px 12px; color: var(--c-muted); line-height: 1.6; }

.note { display: flex; gap: 12px; border-radius: var(--r-lg); border: 1px solid var(--c-line); background: var(--c-surface); padding: 16px; font-size: 14px; line-height: 1.55; }
.note > .icon { color: var(--c-brand); margin-top: 2px; }

/* Befund: plain language first, technical reference second and small */
.finding { border-radius: var(--r-lg); border: 1px solid var(--c-line); background: var(--c-surface); padding: 16px; }
.finding__head { display: flex; gap: 10px; align-items: flex-start; }
.finding__title { font-weight: 600; font-size: 14px; line-height: 1.35; }
.finding__body { margin-top: 8px; font-size: 13.5px; line-height: 1.6; }
.finding__next { margin-top: 12px; font-size: 13.5px; line-height: 1.6; }
.finding__ref { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--c-line); font-family: var(--font-mono); font-size: 11.5px; color: var(--c-muted); }

/* toast with undo */
.toast-host { position: fixed; z-index: 40; left: 50%; bottom: 24px; transform: translateX(-50%); display: flex; justify-content: center; width: max-content; max-width: calc(100vw - 32px); }
.toast { display: inline-flex; align-items: center; gap: 16px; border-radius: var(--r-lg); background: var(--c-ink); color: var(--c-bg); padding: 8px 8px 8px 16px; box-shadow: 0 12px 30px -12px rgba(0,0,0,.5); font-size: 14px; animation: rise .3s var(--ease) both; }
.toast__text { font-weight: 500; }
.toast form { display: contents; }
.toast__btn { display: inline-flex; align-items: center; gap: 6px; border-radius: var(--r-sm); padding: 4px 8px; font-weight: 600; color: inherit; }
.toast__btn--undo { text-decoration: underline; text-underline-offset: 2px; }
.toast__btn:hover { background: color-mix(in srgb, var(--c-bg) 12%, transparent); }
.toast :focus-visible { outline-color: var(--c-bg); }

.empty { display: grid; place-items: center; padding: 48px 24px; text-align: center; }
.empty__inner { max-width: 420px; }
.empty__mark { display: inline-grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: var(--s-soft, var(--c-brand-soft)); color: var(--s, var(--c-brand)); }
.empty h2 { margin-top: 20px; font-family: var(--font-serif); font-size: 24px; font-weight: 600; line-height: 1.2; }
.empty p { margin-top: 6px; font-size: 14px; color: var(--c-muted); line-height: 1.55; }
.empty .btn { margin-top: 24px; }

.copy-field { display: flex; align-items: center; gap: 8px; border: 1px solid var(--c-line-strong); border-radius: var(--r-md); background: var(--c-surface); padding: 4px 4px 4px 12px; }
.copy-field code { font-family: var(--font-mono); font-size: 13px; flex: 1; min-width: 0; overflow-wrap: anywhere; }

/* ------------------------------------------------------------------ Übersicht */
.page { flex: 1; overflow: auto; }
.page__inner { max-width: 1120px; margin: 0 auto; padding: 32px; }
.lead { display: flex; align-items: flex-end; justify-content: space-between; gap: 32px; }
.lead__date { font-size: 13px; color: var(--c-muted); }
.lead h1 { margin-top: 8px; font-family: var(--font-serif); font-size: 34px; line-height: 1.1; font-weight: 600; letter-spacing: -.025em; max-width: 620px; }
.lead h1 em { font-style: normal; color: var(--c-brand); }
.stats { margin-top: 32px; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); }
.stats > div { padding: 16px 20px; }
.stats > div + div { border-left: 1px solid var(--c-line); }
.stats dt { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--c-muted); white-space: nowrap; }
.stats dd { margin-top: 8px; font-family: var(--font-serif); font-size: 32px; font-weight: 600; line-height: 1; font-variant-numeric: tabular-nums; }
.overview-grid { margin-top: 32px; display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 32px; }
.overview-grid > div, .overview-grid > aside { display: flex; flex-direction: column; gap: 32px; min-width: 0; }
.decide-row { display: grid; grid-template-columns: 16px minmax(0, 1fr) auto auto 16px; gap: 16px; align-items: center; padding: 14px 20px; text-decoration: none; color: inherit; transition: background-color .15s; }
.decide-row:hover { background: var(--c-surface-2); }
.decide-row:hover .chev { transform: translateX(2px); }
.decide-row .chev { color: var(--c-muted); transition: transform .15s; }
.decide-row__name { display: block; font-weight: 500; font-size: 14px; }
.decide-row__why { display: block; font-size: 12.5px; color: var(--c-muted); }
.decide-row__why b { color: var(--s); font-weight: 500; }
.decide-row__no { font-family: var(--font-mono); font-size: 12px; color: var(--c-muted); }
.decide-row__amt { font-size: 14px; font-weight: 500; width: 104px; text-align: right; font-variant-numeric: tabular-nums; }
.quick a, .quick button { width: 100%; display: flex; align-items: center; gap: 12px; padding: 0 16px; height: 44px; font-size: 13.5px; color: var(--c-ink); text-decoration: none; transition: background-color .15s; }
.quick a:hover, .quick button:hover { background: var(--c-surface-2); }
.quick .icon { color: var(--c-brand); }
.quick .chev { margin-left: auto; color: var(--c-muted); }
.syscheck { padding: 6px 16px; font-size: 13px; }
.syscheck > div { display: flex; align-items: flex-start; gap: 10px; padding: 8px 0; }
.syscheck > div + div { border-top: 1px solid var(--c-line); }
.syscheck .shape { margin-top: 3px; }
.syscheck dt { font-weight: 500; }
.syscheck dd { margin-left: auto; color: var(--c-muted); text-align: right; min-width: 0; overflow-wrap: anywhere; }

/* ------------------------------------------------------------------ Rechnungseingang */
.inbox { flex: 1; min-height: 0; display: flex; position: relative; }
.tabs { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.tab { height: 32px; padding: 0 10px; border-radius: var(--r-md); font-size: 13px; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; color: var(--c-muted); text-decoration: none; transition: background-color .15s, color .15s; }
.tab:hover { color: var(--c-ink); background: var(--c-surface-2); }
.tab[aria-selected='true'], .tab[aria-current='true'] { background: var(--c-brand-soft); color: var(--c-brand); font-weight: 600; }
.tab[aria-current='true'] .shape { color: inherit; }
.tab__n { font-size: 12px; opacity: .8; font-variant-numeric: tabular-nums; }

.list-pane { width: 330px; flex-shrink: 0; border-right: 1px solid var(--c-line); background: var(--c-surface); display: flex; flex-direction: column; }
.list-head { padding: 12px 16px 10px; border-bottom: 1px solid var(--c-line); }
.list-head__row { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--c-muted); }
.list-head__row b { color: var(--c-ink); font-weight: 600; }
.density { display: flex; gap: 2px; }
.density a { height: 28px; padding: 0 6px; border-radius: var(--r-sm); display: inline-flex; align-items: center; gap: 4px; color: var(--c-muted); text-decoration: none; font-size: 12px; }
.density a:hover { color: var(--c-ink); }
.density a[aria-current='true'] { color: var(--c-brand); background: var(--c-brand-soft); }
.progress { margin-top: 10px; display: flex; gap: 1px; height: 6px; border-radius: 999px; overflow: hidden; background: var(--c-surface-2); }
.progress > span { background: var(--s, var(--c-brand)); transition: flex-grow .7s var(--ease); }

.new-strip { display: flex; align-items: center; gap: 8px; padding: 0 16px; height: 40px; border-bottom: 1px solid var(--c-line); background: var(--c-brand-soft); color: var(--c-brand); font-size: 13px; text-decoration: none; }
.new-strip b { font-weight: 500; }
.new-strip span:last-child { margin-left: auto; font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.inv-list { flex: 1; overflow: auto; }
.group-head {
  position: sticky; top: 0; z-index: 1; padding: 0 16px; height: 28px; display: flex; align-items: center; gap: 8px;
  font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--s);
  background: color-mix(in srgb, var(--c-surface) 95%, transparent); border-bottom: 1px solid var(--c-line);
}
.group-head .tnum { color: var(--c-muted); font-weight: 400; }
.inv {
  position: relative; display: grid; grid-template-columns: 16px minmax(0, 1fr) auto; column-gap: 12px; align-items: start;
  padding: 14px 16px; border-bottom: 1px solid var(--c-line); text-decoration: none; color: inherit; transition: background-color .15s;
}
.inv:hover { background: var(--c-surface-2); }
.inv[aria-current='true'] { background: var(--c-brand-soft); }
.inv[aria-current='true']::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--c-brand); }
.inv .shape { margin-top: 3px; }
.inv__name { display: block; font-size: 14px; font-weight: 500; }
.inv[aria-current='true'] .inv__name { font-weight: 600; }
.inv__no { display: block; margin-top: 4px; font-size: 12px; color: var(--c-muted); font-family: var(--font-mono); }
.inv__status { display: block; margin-top: 4px; font-size: 12.5px; color: var(--s); font-weight: 500; }
.inv__amt { display: block; text-align: right; font-size: 14px; font-weight: 500; white-space: nowrap; font-variant-numeric: tabular-nums; }
.inv__date { display: block; margin-top: 4px; text-align: right; font-size: 12px; color: var(--c-muted); font-variant-numeric: tabular-nums; }
.inv-list--dense .inv { padding: 8px 16px; }
.inv-list--dense .inv__no, .inv-list--dense .inv__date { display: none; }
.inv-list--dense .inv__status { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
.list-foot { height: 40px; padding: 0 16px; display: flex; align-items: center; gap: 16px; border-top: 1px solid var(--c-line); font-size: 12px; color: var(--c-muted); }
.list-foot span { display: inline-flex; align-items: center; gap: 4px; }
html[data-kbd='aus'] .list-foot { display: none; }
.list-empty { padding: 24px; font-size: 13px; color: var(--c-muted); }

.doc-pane { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.doc-bar { height: 40px; flex-shrink: 0; padding: 0 16px; display: flex; align-items: center; gap: 12px; border-bottom: 1px solid var(--c-line); font-size: 12.5px; color: var(--c-muted); }
.doc-bar .mono { color: var(--c-ink); }
.doc-bar__end { margin-left: auto; display: flex; gap: 12px; align-items: center; }
.doc-stage {
  flex: 1; overflow: auto; padding: 24px;
  background-image: radial-gradient(var(--c-line) 1px, transparent 1px); background-size: 16px 16px;
}
.back-to-list { display: none; }

/* The invoice as a document: always on paper, always light, whatever the theme. */
.paper {
  margin: 0 auto; max-width: 600px; background: #fff; color: #141c1c; border-radius: 2px; padding: 40px;
  font-size: 12px; line-height: 1.6;
  box-shadow: 0 1px 2px rgba(0,0,0,.12), 0 24px 48px -28px rgba(0,0,0,.35);
}
.paper .p-muted { color: #4d5958; }
.paper__top { display: flex; justify-content: space-between; gap: 24px; }
.paper__seller { font-family: var(--font-serif); font-size: 19px; font-weight: 600; line-height: 1.2; }
.paper__title { font-family: var(--font-serif); font-size: 20px; font-weight: 600; letter-spacing: .03em; color: #141c1c; }
.paper__meta { text-align: right; color: #4d5958; flex-shrink: 0; font-variant-numeric: tabular-nums; }
.paper__meta .mono { color: #141c1c; }
.paper__addr { margin-top: 32px; }
.paper__addr small { display: block; font-size: 10px; color: #4d5958; text-decoration: underline; }
.paper__notice { margin-top: 24px; border-radius: 2px; background: #faefd9; color: #7f4d00; padding: 8px 12px; font-family: var(--font-sans); }
.paper table { width: 100%; margin-top: 32px; font-variant-numeric: tabular-nums; }
.paper thead tr { border-bottom: 1px solid #141c1c; text-align: left; font-size: 10.5px; text-transform: uppercase; letter-spacing: .05em; color: #4d5958; }
.paper th { padding: 8px 0; font-weight: 500; }
.paper td { padding: 10px 0; vertical-align: top; }
.paper tbody tr { border-bottom: 1px solid #e3e0d8; }
.paper .r { text-align: right; white-space: nowrap; padding-left: 12px; }
.paper__sums { margin: 20px 0 0 auto; width: 270px; font-variant-numeric: tabular-nums; }
.paper__sums > div { display: flex; justify-content: space-between; padding: 4px 0; }
.paper__sums > div.total { padding: 8px 0; margin-top: 4px; border-top: 2px solid #141c1c; font-weight: 600; font-size: 13.5px; }
.paper__foot { margin-top: 40px; padding-top: 16px; border-top: 1px solid #e3e0d8; color: #4d5958; font-size: 11px; }
.paper__missing { font-style: italic; }

/* finding pins on the document */
.pin { position: relative; display: inline-block; border-radius: 2px; padding: 0 4px; margin: 0 -4px; background: #fbe9e9; outline: 1px dashed #a3202a; outline-offset: 2px; transition: background-color .3s, outline-color .3s; }
.pin__n {
  position: absolute; top: -12px; right: -16px; width: 18px; height: 18px; display: grid; place-items: center; border-radius: 50%;
  background: #a3202a; color: #fff; font-family: var(--font-sans); font-size: 10.5px; font-weight: 600; font-variant-numeric: tabular-nums;
  box-shadow: 0 0 0 2px #fff; transition: transform .3s var(--ease); font-style: normal;
}
.pin.is-active { background: #f6d3d3; outline: 2px solid #a3202a; }
.pin.is-active .pin__n { transform: scale(1.25); }

.check-pane { width: 360px; flex-shrink: 0; border-left: 1px solid var(--c-line); background: var(--c-surface); display: flex; flex-direction: column; }
.check-scroll { flex: 1; overflow: auto; }
.verdict { padding: 20px; border-bottom: 1px solid var(--c-line); }
.verdict__top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.verdict__who { margin-top: 20px; font-size: 13px; color: var(--c-muted); }
.verdict__amt { margin-top: 6px; font-family: var(--font-serif); font-size: 34px; font-weight: 600; line-height: 1; letter-spacing: -.025em; font-variant-numeric: tabular-nums; }
.verdict__text { margin-top: 16px; font-size: 15px; line-height: 1.4; font-weight: 500; }
.verdict__bar { margin-top: 16px; height: 4px; border-radius: 999px; background: var(--c-pend-soft); overflow: hidden; }
.verdict__bar span { display: block; height: 100%; width: 33%; background: var(--c-pend); border-radius: 999px; animation: pulse 2s ease-in-out infinite; }
.findings { padding: 20px; }
.findings h3 { font-size: 13px; font-weight: 600; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.findings h3 .muted { font-weight: 400; }
.findings ol { display: flex; flex-direction: column; gap: 10px; }
.fcard { display: block; width: 100%; text-align: left; border-radius: var(--r-lg); border: 1px solid var(--c-line); background: var(--c-bg); padding: 16px; transition: border-color .2s, background-color .2s; }
.fcard:hover { border-color: var(--c-line-strong); }
.fcard.is-active { border-color: var(--c-err); background: color-mix(in srgb, var(--c-err-soft) 40%, transparent); }
.fcard__grid { display: flex; gap: 12px; align-items: flex-start; }
.fcard__n { margin-top: 1px; width: 20px; height: 20px; flex-shrink: 0; display: grid; place-items: center; border-radius: 50%; background: var(--c-err); color: var(--c-surface); font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums; }
.fcard__n--warn { background: var(--c-surface-2); color: var(--c-ink); border: 1px solid var(--c-line-strong); }
.fcard h4 { font-size: 14px; font-weight: 600; line-height: 1.35; }
.fcard__body { margin-top: 6px; font-size: 13px; line-height: 1.6; }
.fcard__next { margin-top: 10px; font-size: 13px; line-height: 1.4; display: flex; gap: 6px; }
.fcard__next .icon { color: var(--c-brand); margin-top: 2px; }
.fcard__ref { margin-top: 10px; font-family: var(--font-mono); font-size: 11px; color: var(--c-muted); }
.fcard__nopin { margin-top: 6px; font-size: 12px; color: var(--c-muted); }
.calc { margin-top: 10px; border-radius: var(--r-md); border: 1px solid var(--c-line); background: var(--c-surface); padding: 6px 12px; font-size: 12.5px; }
.calc > div { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; }
.calc dd { font-variant-numeric: tabular-nums; white-space: nowrap; }
.calc .sum { border-top: 1px solid var(--c-line); font-weight: 600; }
.calc .bad { color: var(--c-err); font-weight: 600; }
.passes { padding: 20px; font-size: 13.5px; display: flex; flex-direction: column; gap: 10px; }
.passes li { display: flex; gap: 10px; align-items: flex-start; }
.passes .shape { margin-top: 2px; }
.check-meta { padding: 0 20px 20px; font-size: 12px; color: var(--c-muted); display: flex; flex-direction: column; gap: 4px; }
.check-meta a { font-size: 12.5px; }
.actions { flex-shrink: 0; padding: 16px; border-top: 1px solid var(--c-line); background: var(--c-surface-2); display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.actions form { display: contents; }
.actions .btn { padding: 0 12px; }
.actions__note { grid-column: 1 / -1; font-size: 12.5px; color: var(--c-muted); line-height: 1.45; }
.subnote { padding: 12px 20px; font-size: 12.5px; color: var(--c-muted); border-top: 1px solid var(--c-line); }

/* Korrekturanforderung composer */
.composer { flex: 1; min-height: 0; display: flex; flex-direction: column; animation: rise .3s var(--ease) both; }
.composer__head { padding: 20px 20px 16px; border-bottom: 1px solid var(--c-line); }
.composer__head h2 { margin-top: 12px; font-family: var(--font-serif); font-size: 22px; font-weight: 600; line-height: 1.2; }
.composer__head p { margin-top: 4px; font-size: 13px; color: var(--c-muted); }
.composer__body { flex: 1; overflow: auto; padding: 20px; display: flex; flex-direction: column; gap: 12px; font-size: 13px; }
.composer__body .field > span:first-child { color: var(--c-muted); font-weight: 400; }
.composer__body .input { height: 36px; background: var(--c-bg); font-size: 13px; }
.composer__body .textarea { min-height: 240px; flex: 1; background: var(--c-bg); font-size: 13px; resize: none; }
.composer__hint { display: flex; gap: 8px; color: var(--c-muted); line-height: 1.45; }
.composer__foot { flex-shrink: 0; padding: 16px; border-top: 1px solid var(--c-line); background: var(--c-surface-2); display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.composer__foot .btn { width: 100%; padding: 0 10px; }
.composer__foot form { display: block; }

/* drop zone for the first upload */
.dropzone { margin-top: 24px; border: 1.5px dashed var(--c-line-strong); border-radius: var(--r-xl); background: var(--c-surface); padding: 32px; display: grid; gap: 12px; justify-items: center; text-align: center; transition: border-color .2s, background-color .2s; }
.dropzone.is-over { border-color: var(--c-brand); background: var(--c-brand-soft); }
.dropzone > .icon { color: var(--c-brand); }
.dropzone input[type='file'] { font-size: 13px; max-width: 100%; }

/* ------------------------------------------------------------------ Archiv */
.months { padding: 16px 20px; border-bottom: 1px solid var(--c-line); background: var(--c-surface); display: flex; align-items: flex-end; gap: 24px; flex-wrap: wrap; }
.months__bars { display: flex; align-items: flex-end; gap: 8px; height: 64px; }
.month { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; width: 44px; text-decoration: none; }
.month__track { display: block; width: 44px; height: 40px; }
.month__bar { fill: color-mix(in srgb, var(--c-brand) 35%, transparent); transition: fill .3s; }
.month:hover .month__bar { fill: color-mix(in srgb, var(--c-brand) 60%, transparent); }
.months--picked .month__bar { fill: var(--c-line); }
.month[aria-current='true'] .month__bar { fill: var(--c-brand); }
.month__label { font-size: 11.5px; color: var(--c-muted); }
.month[aria-current='true'] .month__label { color: var(--c-ink); font-weight: 600; }
.months__info { font-size: 12.5px; color: var(--c-muted); padding-bottom: 20px; }
.months__end { margin-left: auto; margin-bottom: 16px; display: flex; gap: 12px; align-items: center; }
.split { flex: 1; min-height: 0; display: flex; }
.split__main { flex: 1; min-width: 0; overflow: auto; }
.table { width: 100%; font-size: 13.5px; font-variant-numeric: tabular-nums; }
.table thead { position: sticky; top: 0; background: color-mix(in srgb, var(--c-bg) 95%, transparent); }
.table th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--c-muted); font-weight: 500; padding: 10px 0; border-bottom: 1px solid var(--c-line); }
.table td { padding: 12px 0; border-bottom: 1px solid var(--c-line); }
.table th:first-child, .table td:first-child { padding-left: 20px; }
.table th:not(:last-child), .table td:not(:last-child) { padding-right: 16px; }
.table th:last-child, .table td:last-child { padding-right: 20px; text-align: right; }
.table tbody tr { transition: background-color .15s; }
.table tbody tr:hover { background: var(--c-surface); }
.table tr[aria-current='true'] { background: var(--c-brand-soft); }
.table tr[aria-current='true'] td:first-child { box-shadow: inset 3px 0 0 var(--c-brand); }
.table .row-link { color: inherit; text-decoration: none; font-weight: 500; display: inline-flex; gap: 8px; align-items: center; }
.table .row-link::after { content: ''; position: absolute; inset: 0; }
.table tbody tr { position: relative; }
.table td.mono { font-size: 12.5px; }
.table-note { padding: 16px 20px; font-size: 12.5px; color: var(--c-muted); }
.side-pane { width: 360px; flex-shrink: 0; border-left: 1px solid var(--c-line); background: var(--c-surface); overflow: auto; animation: rise .3s var(--ease) both; }
.side-pane > section { padding: 20px; border-bottom: 1px solid var(--c-line); }
.side-pane > section:last-child { border-bottom: 0; }
.side-pane h3 { font-size: 13px; font-weight: 600; }
.side-pane .big { margin-top: 6px; font-family: var(--font-serif); font-size: 30px; font-weight: 600; line-height: 1; font-variant-numeric: tabular-nums; }
.btn-pair { margin-top: 16px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.kv { font-size: 13px; }
.kv > div { display: flex; gap: 12px; padding: 6px 0; }
.kv dt { color: var(--c-muted); flex-shrink: 0; }
.kv dd { margin-left: auto; text-align: right; min-width: 0; overflow-wrap: anywhere; }

.verify-result { margin: 16px 20px 0; }

/* ------------------------------------------------------------------ Lieferanten */
.sup-list { width: 330px; flex-shrink: 0; border-right: 1px solid var(--c-line); background: var(--c-surface); overflow: auto; }
.sup { position: relative; display: block; padding: 14px 16px; border-bottom: 1px solid var(--c-line); text-decoration: none; color: inherit; transition: background-color .15s; }
.sup:hover { background: var(--c-surface-2); }
.sup[aria-current='true'] { background: var(--c-brand-soft); }
.sup[aria-current='true']::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--c-brand); }
.sup__top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.sup__name { font-size: 14px; font-weight: 500; }
.sup[aria-current='true'] .sup__name { font-weight: 600; }
.sup__count { font-size: 12.5px; color: var(--c-muted); white-space: nowrap; }
.sup__q { margin-top: 8px; display: flex; align-items: center; gap: 10px; }
.ticks { display: flex; gap: 3px; align-items: center; }
.tick { width: 3px; height: 8px; border-radius: 1px; background: color-mix(in srgb, var(--c-ok) 60%, transparent); }
.sup__flag { margin-left: auto; font-size: 12px; white-space: nowrap; color: var(--c-muted); }
.sup__flag--err { color: var(--c-err); font-weight: 500; }
.detail { flex: 1; min-width: 0; overflow: auto; animation: rise .3s var(--ease) both; }
.detail__inner { max-width: 880px; margin: 0 auto; padding: 32px; }
.detail h2.title { font-family: var(--font-serif); font-size: 32px; font-weight: 600; line-height: 1.15; letter-spacing: -.025em; }
.two-col { margin-top: 32px; display: grid; grid-template-columns: 1.2fr 1fr; gap: 32px; }
.sub-title { font-size: 13px; font-weight: 600; margin-bottom: 8px; }
.data { border-radius: var(--r-lg); border: 1px solid var(--c-line); background: var(--c-surface); padding: 0 16px; }
.data > div { display: grid; grid-template-columns: minmax(0, 190px) 1fr; gap: 16px; padding: 12px 0; font-size: 13.5px; }
.data > div + div { border-top: 1px solid var(--c-line); }
.data dt { color: var(--c-muted); }
.data dd.warn { color: var(--c-err); font-weight: 500; display: flex; gap: 8px; align-items: center; }
.glance { display: grid; grid-template-columns: 1fr 1fr; border-radius: var(--r-lg); border: 1px solid var(--c-line); background: var(--c-surface); }
.glance > div { padding: 16px; }
.glance > div + div { border-left: 1px solid var(--c-line); }
.glance dt { font-size: 12.5px; color: var(--c-muted); }
.glance dd { margin-top: 4px; font-family: var(--font-serif); font-size: 28px; font-weight: 600; line-height: 1; font-variant-numeric: tabular-nums; }
.glance dd.err { color: var(--c-err); }
.history { width: 100%; border-radius: var(--r-lg); border: 1px solid var(--c-line); background: var(--c-surface); font-size: 13.5px; font-variant-numeric: tabular-nums; border-collapse: separate; border-spacing: 0; overflow: hidden; }
.history td { padding: 12px 0; border-bottom: 1px solid var(--c-line); }
.history tr:last-child td { border-bottom: 0; }
/* status column: as wide as its longest badge ("An Buchhaltung übergeben"), then 24px to the next column */
.history td:first-child { padding-left: 16px; padding-right: 24px; width: 1%; white-space: nowrap; }
.history td + td:not(:last-child) { padding-right: 16px; }
.history td:nth-child(3) { white-space: nowrap; }
.history td:last-child { padding-right: 16px; text-align: right; font-weight: 500; }
.history td.mono { font-size: 12.5px; }

/* ------------------------------------------------------------------ Einstellungen */
.settings-nav { width: 230px; flex-shrink: 0; border-right: 1px solid var(--c-line); background: var(--c-surface); padding: 12px; }
.settings-nav ul { display: flex; flex-direction: column; gap: 2px; position: sticky; top: 12px; }
.settings-nav a { display: flex; align-items: center; height: 36px; padding: 0 12px; border-radius: var(--r-md); font-size: 13.5px; color: var(--c-muted); text-decoration: none; transition: background-color .15s, color .15s; }
.settings-nav a:hover { color: var(--c-ink); background: var(--c-surface-2); }
.settings-nav a[aria-current='true'] { background: var(--c-brand-soft); color: var(--c-brand); font-weight: 600; }
.settings { flex: 1; min-width: 0; overflow: auto; }
.settings__inner { max-width: 760px; margin: 0 auto; padding: 32px; display: flex; flex-direction: column; gap: 40px; }
.group { scroll-margin-top: 24px; }
.group h2 { font-family: var(--font-serif); font-size: 24px; font-weight: 600; line-height: 1.2; }
.group__lead { margin-top: 6px; font-size: 14px; color: var(--c-muted); max-width: 560px; }
.group__box { margin-top: 16px; border-radius: var(--r-lg); border: 1px solid var(--c-line); background: var(--c-surface); padding: 0 20px; }
.setting { display: flex; align-items: flex-start; gap: 24px; padding: 16px 0; }
.setting + .setting { border-top: 1px solid var(--c-line); }
.setting__text { flex: 1; min-width: 0; }
.setting__title { font-size: 14px; font-weight: 500; }
.setting__desc { margin-top: 4px; font-size: 13px; color: var(--c-muted); line-height: 1.55; }
.setting__ctl { flex-shrink: 0; display: flex; align-items: center; gap: 8px; }
.setting--stack { flex-direction: column; gap: 12px; }
.setting--stack .setting__ctl { width: 100%; }
.setting__ctl--stack { flex-direction: column; align-items: stretch; gap: 12px; }
.setting__ctl--stack .setting__desc { margin-top: 0; }
.renew { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; }
.renew .setting__desc { flex: 1 1 240px; }
.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; padding: 20px 0; font-size: 13.5px; }
.facts dt { color: var(--c-muted); }
.facts dd { margin-top: 4px; font-weight: 500; }
.people { width: 100%; font-size: 13.5px; }
.people td { padding: 12px 0; border-top: 1px solid var(--c-line); vertical-align: top; }
.people tr:first-child td { border-top: 0; }
.people td.r { text-align: right; white-space: nowrap; }
.people .sub { display: block; color: var(--c-muted); font-size: 12.5px; }
.role-pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; border-radius: 999px; padding: 2px 8px; border: 1px solid var(--c-line-strong); color: var(--c-ink); white-space: nowrap; }
.inline-form { display: grid; grid-template-columns: minmax(0, 1fr) 160px auto; gap: 8px; align-items: end; padding: 16px 0; border-top: 1px solid var(--c-line); }
.inline-form--4 { grid-template-columns: minmax(0, 1fr) 140px 140px auto; }
.group__box > .inline-form:first-child { border-top: 0; }

/* section navigation without JS: the section named in the URL fragment is the current one
   (app.js marks [data-spy] and follows the scroll position instead) */
.split:has(.group:target) .settings-nav:not([data-spy]) a[aria-current='true'] { background: none; color: var(--c-muted); font-weight: 400; }
.split:has(#unternehmen:target) .settings-nav:not([data-spy]) a[href='#unternehmen'],
.split:has(#benutzer:target) .settings-nav:not([data-spy]) a[href='#benutzer'],
.split:has(#pruefer:target) .settings-nav:not([data-spy]) a[href='#pruefer'],
.split:has(#eingang:target) .settings-nav:not([data-spy]) a[href='#eingang'],
.split:has(#datev:target) .settings-nav:not([data-spy]) a[href='#datev'],
.split:has(#pruefung:target) .settings-nav:not([data-spy]) a[href='#pruefung'],
.split:has(#tarif:target) .settings-nav:not([data-spy]) a[href='#tarif'],
.split:has(#doku:target) .settings-nav:not([data-spy]) a[href='#doku'],
.split:has(#export:target) .settings-nav:not([data-spy]) a[href='#export'],
.split:has(#darstellung:target) .settings-nav:not([data-spy]) a[href='#darstellung'] { background: var(--c-brand-soft); color: var(--c-brand); font-weight: 600; }
@media (prefers-reduced-motion: no-preference) { .settings { scroll-behavior: smooth; } }

/* callout: a notice that belongs to a section (Figma: brand-soft box, icon, bold lead) */
.callout { margin-top: 16px; display: flex; gap: 12px; align-items: flex-start; border-radius: var(--r-lg); border: 1px solid color-mix(in srgb, var(--c-brand) 22%, transparent); background: var(--c-brand-soft); padding: 16px; font-size: 13.5px; line-height: 1.55; color: var(--c-ink); }
.callout > .icon, .callout > .shape { margin-top: 1px; color: var(--c-brand); }
.callout > .shape { color: var(--s); margin-top: 2px; }
.callout__body { flex: 1; min-width: 0; }
.callout__body b { font-weight: 600; }
.callout__body .link { display: inline; text-decoration: underline; text-underline-offset: 2px; }
.callout__form { margin-top: 14px; padding-top: 14px; border-top: 1px solid color-mix(in srgb, var(--c-brand) 18%, transparent); display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; }
.callout__form .check { flex: 1 1 280px; }
.callout--done { background: var(--c-surface); border-color: var(--c-line); padding: 12px 16px; font-size: 13px; }
.callout--done .callout__body { color: var(--c-muted); }
.callout--done .callout__body b { color: var(--c-ink); font-weight: 500; }

/* one settings card: head row with the action, then label/value rows (Figma DataRow) */
.setting--head { align-items: center; }
.kv-rows > div, .edit-rows__row { display: grid; grid-template-columns: minmax(0, 190px) minmax(0, 1fr); gap: 16px; padding: 12px 0; border-top: 1px solid var(--c-line); font-size: 13.5px; }
.kv-rows dt, .edit-rows__row > label, .edit-rows__label { color: var(--c-muted); }
.kv-rows dd { min-width: 0; overflow-wrap: anywhere; }
.edit-rows__row { align-items: start; }
.edit-rows__row > label, .edit-rows__label { padding-top: 8px; }
.edit-rows__row .setting__desc { margin-top: 7px; }
.edit-rows__row .textarea { padding: 8px 10px; font-size: 13.5px; line-height: 1.55; }
.edit-rows__foot { display: flex; gap: 8px; padding: 16px 0; border-top: 1px solid var(--c-line); }
.edit-rows__row--first { border-top: 0; padding-top: 16px; }
.edit-rows__row .input--plz { max-width: 140px; }
.edit-rows__note { margin: 0; padding: 12px 0; border-top: 1px solid var(--c-line); }
.setting--rule { border-top: 1px solid var(--c-line); }
.callout--top { margin-top: 0; }
.group__box > .phase3__actions { border-top: 1px solid var(--c-line); }
/* small disclosure (e.g. a checksum under a package): a brand link with a turning chevron */
.disclosure { margin-top: 6px; font-size: 12.5px; }
.disclosure > summary { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; list-style: none; color: var(--c-brand); font-weight: 500; }
.disclosure > summary::-webkit-details-marker { display: none; }
.disclosure > summary::before { content: ''; width: 6px; height: 6px; border: solid currentColor; border-width: 0 1.5px 1.5px 0; transform: rotate(-45deg); transition: transform .15s var(--ease); }
.disclosure[open] > summary::before { transform: rotate(45deg); }
.disclosure > summary:hover { text-decoration: underline; text-underline-offset: 2px; }

/* ------------------------------------------------------------------ Anmeldung (auth pages) */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 520px); }
.auth__side { background: var(--c-surface-2); border-right: 1px solid var(--c-line); padding: 40px; display: flex; flex-direction: column; justify-content: space-between; }
.auth__claim { font-family: var(--font-serif); font-size: 34px; line-height: 1.15; font-weight: 600; max-width: 460px; letter-spacing: -.025em; }
.auth__claim em { font-style: normal; color: var(--c-brand); }
.auth__steps { margin-top: 28px; display: flex; flex-direction: column; gap: 12px; font-size: 14px; max-width: 440px; }
.auth__steps li { display: flex; gap: 12px; align-items: flex-start; }
.auth__steps .shape { margin-top: 3px; }
.auth__fine { font-size: 12.5px; color: var(--c-muted); max-width: 460px; line-height: 1.55; }
.auth__main { padding: 40px; display: flex; flex-direction: column; justify-content: center; }
.auth__card { width: 100%; max-width: 380px; margin: 0 auto; }
.auth__card h1 { font-family: var(--font-serif); font-size: 28px; font-weight: 600; line-height: 1.2; }
.auth__card .lede { margin-top: 6px; font-size: 14px; color: var(--c-muted); line-height: 1.55; }
.auth__form { margin-top: 28px; display: flex; flex-direction: column; gap: 16px; }
.auth__links { margin-top: 20px; font-size: 13px; display: flex; flex-direction: column; gap: 8px; }
.stepper { display: flex; gap: 6px; margin-bottom: 24px; }
.stepper span { height: 4px; flex: 1; border-radius: 999px; background: var(--c-line); }
.stepper span.on { background: var(--c-brand); }
.qr { width: 184px; height: 184px; padding: 12px; background: #fff; border-radius: var(--r-md); border: 1px solid var(--c-line); }
.qr svg { width: 100%; height: 100%; }
.codes { margin-top: 20px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; font-family: var(--font-mono); font-size: 15px; letter-spacing: .05em; }
.codes li { border: 1px solid var(--c-line); border-radius: var(--r-md); background: var(--c-surface); padding: 8px 10px; text-align: center; font-variant-numeric: tabular-nums; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; line-height: 1.45; }
.check input { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--c-brand); flex-shrink: 0; }
/* checkbox drawn like the other controls: line-strong border, md radius, brand when checked */
.check input[type='checkbox'] {
  appearance: none; -webkit-appearance: none; display: inline-grid; place-items: center; cursor: pointer;
  border: 1px solid var(--c-line-strong); border-radius: var(--r-sm); background: var(--c-surface);
  transition: background-color .15s, border-color .15s;
}
.check input[type='checkbox']::after {
  content: ''; width: 5px; height: 9px; margin-top: -2px; border: solid var(--c-brand-ink); border-width: 0 2px 2px 0;
  transform: rotate(45deg) scale(0); transition: transform .15s var(--ease);
}
.check input[type='checkbox']:hover { border-color: var(--c-brand); }
.check input[type='checkbox']:checked { background: var(--c-brand); border-color: var(--c-brand); }
.check input[type='checkbox']:checked::after { transform: rotate(45deg) scale(1); }
.check input[type='checkbox']:disabled { opacity: .45; cursor: not-allowed; }
@media (forced-colors: active) {
  .check input[type='checkbox'] { appearance: auto; -webkit-appearance: auto; }
  .check input[type='checkbox']::after { content: none; }
}

.tenant-list { margin-top: 24px; }
.tenant { width: 100%; display: grid; grid-template-columns: 1fr auto 16px; gap: 12px; align-items: center; padding: 14px 16px; text-align: left; transition: background-color .15s; }
.tenant:hover { background: var(--c-surface-2); }
.tenant__name { font-weight: 500; font-size: 14px; display: block; }
.tenant__sub { font-size: 12.5px; color: var(--c-muted); display: block; }

/* Rechnungsausgang placeholder and other simple pages */
.placeholder { max-width: 640px; margin: 0 auto; padding: 64px 32px; }
.placeholder h1 { font-family: var(--font-serif); font-size: 30px; font-weight: 600; line-height: 1.2; letter-spacing: -.025em; margin-top: 12px; }
.placeholder p { margin-top: 12px; font-size: 15px; line-height: 1.6; }
.placeholder .btn { margin-top: 24px; }

.package { margin-top: 24px; }
.package li { display: flex; gap: 12px; align-items: flex-start; padding: 12px 16px; font-size: 13.5px; }
.package li + li { border-top: 1px solid var(--c-line); }
.package .icon { color: var(--c-brand); margin-top: 2px; }

/* ------------------------------------------------------------------ preview index (ui-preview only) */
.personas { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; margin-top: 24px; }
.persona { display: flex; flex-direction: column; gap: 6px; padding: 16px; text-align: left; border: 1px solid var(--c-line); border-radius: var(--r-lg); background: var(--c-surface); }
.persona:hover { border-color: var(--c-brand); }
.persona b { font-size: 14px; }
.persona span { font-size: 12.5px; color: var(--c-muted); line-height: 1.45; }

/* full-height work screens on wide viewports: panes scroll, the page does not (as the mock) */
.screen { flex: 1; min-height: 0; display: flex; flex-direction: column; }
@media (min-width: 761px) {
  .app { height: 100vh; }
  .main { height: 100vh; min-height: 0; }
  .page { flex: 1; min-height: 0; overflow: auto; }
}
.min-w-0 { min-width: 0; }

.progress-svg { display: block; margin-top: 10px; border-radius: 999px; overflow: hidden; }
.progress-track { fill: var(--c-surface-2); }
.progress-seg { fill: var(--s, var(--c-brand)); opacity: .7; }
.progress-seg.s-done { fill: var(--c-brand); opacity: 1; }

.paper--blank { min-height: 420px; }
.paper__notice--pend { background: #e9edf1; color: #3c4a57; }
.paper__notice--quar { background: #e9edf1; color: #3c4a57; }
.paper__skeleton { margin-top: 32px; display: grid; gap: 10px; }
.paper__skeleton span { height: 10px; border-radius: 2px; background: #efede7; }
.paper__skeleton span:nth-child(2) { width: 80%; } .paper__skeleton span:nth-child(3) { width: 92%; } .paper__skeleton span:nth-child(4) { width: 45%; }
.verdict__amt--none { font-size: 24px; color: var(--c-muted); }
.verdict__reason { margin-top: 8px; font-size: 13.5px; line-height: 1.5; }
.note-block { padding: 0 20px 20px; font-size: 13.5px; line-height: 1.55; display: flex; flex-direction: column; gap: 6px; }
.note-block h3 { font-size: 13px; font-weight: 600; display: flex; gap: 8px; align-items: center; }
.fcard { display: block; }
.fcard__show { margin-top: 8px; font-size: 12.5px; }
.fcard--warn .fcard__n { background: var(--c-surface-2); color: var(--c-ink); border: 1px solid var(--c-line-strong); }
.actions--single { grid-template-columns: 1fr 1fr; }
.remove-form { display: grid !important; grid-column: 1 / -1; gap: 8px; }
.composer__text { flex: 1; }
.remove-more { padding: 10px 16px 14px; border-top: 1px solid var(--c-line); background: var(--c-surface-2); font-size: 13px; }
.remove-more summary { cursor: pointer; }
.remove-more .remove-form { margin-top: 10px; }
.paper--blank .paper__seller { font-family: var(--font-mono); font-size: 15px; font-weight: 500; }

/* preview marker, in the flow so it never covers content */
.preview-bar { display: block; padding: 4px 20px; font-family: var(--font-mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; background: var(--c-ink); color: var(--c-bg); text-decoration: none; }
.preview-bar:hover { text-decoration: underline; }
.nav-item--geplant .icon { opacity: .7; }
.inv__no--plain { font-family: var(--font-sans); }
.paper th:first-child, .paper td:first-child { width: 32px; padding-right: 8px; }
@media (max-width: 760px) {
  .section-head { flex-wrap: wrap; row-gap: 4px; }
  .banner p { flex: 1 1 240px; }
}

input[type='file'] { font-size: 13px; color: var(--c-muted); }
input[type='file']::file-selector-button {
  height: 32px; padding: 0 12px; margin-right: 10px; border-radius: var(--r-md); border: 1px solid var(--c-line-strong);
  background: var(--c-surface); color: var(--c-ink); font: 500 13px var(--font-sans); cursor: pointer;
}
input[type='file']::file-selector-button:hover { background: var(--c-surface-2); }

/* sign-in */
.notice { display: flex; gap: 8px; align-items: center; font-size: 13.5px; }
.setup { margin-top: 24px; display: flex; flex-direction: column; gap: 24px; }
.setup > li { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 14px; }
.setup h2 { font-size: 15px; font-weight: 600; }
.setup p { font-size: 13.5px; margin-top: 4px; }
.setup__n { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--c-brand-soft); color: var(--c-brand); font-weight: 600; font-size: 13px; }
.setup summary { cursor: pointer; font-size: 13px; }
.auth__links .link { font-size: 13px; }

/* Archiv */
.verify-panel { display: flex; gap: 12px; align-items: flex-start; padding: 14px 20px; border-bottom: 1px solid var(--c-line); background: var(--s-soft); }
.verify-panel .shape { color: var(--s); margin-top: 2px; }
.verify-panel h2 { font-size: 14px; font-weight: 600; }
.verify-panel p { font-size: 13px; margin-top: 2px; }
.verify-list { margin-top: 6px; font-size: 13px; list-style: disc; padding-left: 18px; }
.tag { display: inline-block; margin-left: 8px; font-size: 11.5px; border-radius: 999px; padding: 1px 7px; border: 1px solid var(--c-line-strong); color: var(--c-muted); }
.seal--offen { border-color: var(--c-line-strong); background: var(--c-warn-soft); color: var(--c-warn); }
.side-pane__who { font-size: 13px; }
.small { font-size: 12.5px; }
.small-text { font-size: 12.5px; line-height: 1.55; }
.label { font-size: 12px; font-weight: 600; color: var(--c-ink); }
.table td a.row-link:hover span { text-decoration: underline; }
@media (max-width: 760px) {
  .split--detail .split__main { display: none; }
  .split:not(.split--detail) .side-pane { display: none; }
  .side-pane .back-to-list { display: flex; margin: -20px -20px 16px; }
}

/* exports */
.stats--two { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 24px; }
.period { display: grid; grid-template-columns: 1fr 1fr auto; gap: 12px; align-items: end; padding: 16px; }
.history .sub { display: block; font-size: 12px; }
@media (max-width: 760px) { .period { grid-template-columns: 1fr; } .history td:first-child { width: auto; } }

/* Einstellungen, Lieferanten, invitation */
.group__missing { padding: 16px 20px; font-size: 13.5px; color: var(--c-muted); }
.inline-form--pruefer { grid-template-columns: minmax(0, 1fr) 110px 110px auto; }
.inline-form--pruefer > label:first-of-type { grid-column: 1 / -1; }
.inline-form--datev { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.inline-form--datev > .btn { grid-column: 1 / -1; justify-self: start; }
.inline-form .btn { height: 36px; }
.pre-line { white-space: pre-line; }
.flex-1 { flex: 1; min-width: 0; }
.note--auff .shape { color: var(--c-pend); margin-top: 3px; }
.auth__steps--card { margin-top: 16px; font-size: 13.5px; }
.settings-nav { position: relative; }
.settings .facts { padding: 16px 0; }

/* reflow at 320 px (WCAG 1.4.10): buttons wrap instead of pushing the page sideways */
@media (max-width: 420px) {
  .actions, .composer__foot, .btn-pair { grid-template-columns: minmax(0, 1fr); }
  .actions .btn, .composer__foot .btn, .btn-pair .btn, .auth__form .btn { white-space: normal; height: auto; min-height: 40px; padding: 8px 12px; text-align: center; }
  .codes { grid-template-columns: minmax(0, 1fr); }
}

/* simple pages */
.page__inner--narrow { max-width: 720px; }
.page-title { font-family: var(--font-serif); font-size: 30px; font-weight: 600; line-height: 1.15; letter-spacing: -.025em; }
.lede { margin-top: 8px; font-size: 14.5px; color: var(--c-muted); line-height: 1.6; max-width: 620px; }
.auth__card--wide { max-width: 640px; }
.rail__brand--auth { padding: 0; height: auto; }

/* ------------------------------------------------------------------ motion */
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes pop { 0% { transform: scale(.6); opacity: 0; } 60% { transform: scale(1.08); } 100% { transform: none; opacity: 1; } }
@keyframes draw { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes ping { 75%, 100% { transform: scale(2); opacity: 0; } }
@keyframes pulse { 50% { opacity: .5; } }
.anim-rise { animation: rise .8s var(--ease) both; }
.anim-rise--fast { animation: rise .35s var(--ease) both; }
.anim-pop { animation: pop .35s var(--ease) both; }
.anim-draw { animation: draw .6s var(--ease) both; transform-origin: left; }
.d1 { animation-delay: 80ms; } .d2 { animation-delay: 130ms; } .d3 { animation-delay: 180ms; } .d4 { animation-delay: 230ms; } .d5 { animation-delay: 280ms; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ------------------------------------------------------------------ responsive: tablet and phone */
@media (max-width: 1180px) {
  .check-pane { width: 320px; }
  .list-pane, .sup-list { width: 290px; }
  .overview-grid { grid-template-columns: minmax(0, 1fr); }
  .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .stats > div:nth-child(4) { border-left: 0; }
  .stats > div:nth-child(n+4) { border-top: 1px solid var(--c-line); }
}

@media (max-width: 960px) {
  .doc-pane { display: none; }
  .inbox--detail .doc-pane { display: none; }
}

@media (max-width: 760px) {
  body { font-size: 15px; }
  .app { flex-direction: column; }
  .rail { position: static; width: 100%; height: auto; border-right: 0; border-bottom: 1px solid var(--c-line); flex-direction: row; flex-wrap: wrap; align-items: center; }
  .rail__brand { height: 52px; padding: 0 16px; }
  .switcher { flex: 1; margin: 6px 12px 6px 0; min-width: 0; }
  .switcher__menu { right: 0; }
  .rail__nav { order: 3; width: 100%; flex-direction: row; overflow-x: auto; padding: 0 8px 8px; gap: 4px; scrollbar-width: none; }
  .nav-item { width: auto; flex-shrink: 0; height: 36px; }
  .nav-item__key, .nav-item__tag { display: none !important; }
  .rail__foot { display: none; }
  .toolbar { padding: 10px 16px; gap: 12px; }
  .toolbar__end { width: 100%; margin-left: 0; }
  .search input { width: 100%; }
  .search { flex: 1; }
  .search .kbd { display: none; }
  .banner { padding: 10px 16px; flex-wrap: wrap; }
  .banner__end { margin-left: 28px; }
  .page__inner, .detail__inner, .settings__inner { padding: 20px 16px; }
  .lead { flex-direction: column; align-items: stretch; gap: 16px; }
  .lead h1 { font-size: 28px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats > div { border-left: 0 !important; border-top: 1px solid var(--c-line); }
  .stats > div:nth-child(-n+2) { border-top: 0; }
  .stats > div:nth-child(even) { border-left: 1px solid var(--c-line) !important; }
  .stats > div:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .decide-row { grid-template-columns: 16px minmax(0, 1fr) auto; padding: 12px 16px; }
  .decide-row__no, .decide-row .chev { display: none; }

  /* Rechnungseingang: list first; with an explicit selection, the selected invoice only */
  .inbox { flex-direction: column; }
  .list-pane { width: 100%; border-right: 0; }
  .list-foot { display: none; }
  .inbox--detail .list-pane { display: none; }
  .inbox:not(.inbox--detail) .check-pane { display: none; }
  .check-pane { width: 100%; border-left: 0; }
  .back-to-list { display: flex; padding: 12px 16px; border-bottom: 1px solid var(--c-line); background: var(--c-surface); font-size: 14px; }
  .actions { position: sticky; bottom: 0; }

  .split { flex-direction: column; }
  .side-pane { width: 100%; border-left: 0; border-top: 1px solid var(--c-line); }
  .table .hide-sm { display: none; }
  .months { padding: 12px 16px; gap: 12px; }
  .months__bars { overflow-x: auto; max-width: 100%; }
  .months__end { margin: 0; width: 100%; }

  .sup-list { width: 100%; border-right: 0; max-height: none; }
  .split--sup .sup-list { display: none; }
  .split--sup.split--list .sup-list { display: block; }
  .split--sup.split--list .detail { display: none; }
  .two-col { grid-template-columns: minmax(0, 1fr); }
  .data > div { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .detail__inner .back-to-list { padding: 0; margin-bottom: 16px; background: none; border: 0; }
  /* history tables stack: status and amount (or action) on top, reference and date below */
  .history, .history tbody { display: block; }
  .history tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--c-line); }
  .history tr:last-child { border-bottom: 0; }
  .history td, .history td:first-child, .history td:last-child { padding: 0; border: 0; width: auto; min-width: 0; }
  .history td:nth-child(1) { grid-area: 1 / 1; }
  .history td:nth-child(2) { grid-area: 2 / 1; }
  .history td:nth-child(3) { grid-area: 2 / 2; text-align: right; }
  .history td:nth-child(4) { grid-area: 1 / 2; }

  .settings-nav { display: none; }
  .setting { flex-direction: column; gap: 10px; }
  .facts { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .inline-form, .inline-form--4 { grid-template-columns: minmax(0, 1fr); }
  .kv-rows > div, .edit-rows__row { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .edit-rows__row > label, .edit-rows__label { padding-top: 0; }
  /* title and action share a row while the title fits; a long action wraps below it */
  .setting--head { flex-direction: row; align-items: center; flex-wrap: wrap; row-gap: 10px; }
  .setting--head .setting__text { flex: 1 1 12rem; }
  /* people and Prüfer tables stack: name, then role or years, then status with the action on the right */
  .people, .people tbody { display: block; }
  .people tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; align-items: center; padding: 12px 0; border-top: 1px solid var(--c-line); }
  .people tr:first-child { border-top: 0; }
  .people td, .people tr:first-child td { padding: 0; border: 0; }
  .people td:nth-child(1) { grid-column: 1 / -1; overflow-wrap: anywhere; }
  .people td:nth-child(2) { grid-column: 1 / -1; }
  .people td:nth-child(3) { grid-column: 1; }
  .people td:nth-child(4) { grid-column: 2; }

  .auth { grid-template-columns: minmax(0, 1fr); }
  .auth__side { display: none; }
  .auth__main { padding: 32px 20px; justify-content: flex-start; }
  .paper { padding: 24px; }
  .toast-host { bottom: 16px; }
}

/* Phase 3: calm settings/document flows within Petrol tokens. */
.phase3 { overflow: auto; }
/* same rhythm as .settings__inner: one column of groups, 40px apart */
.phase3__body { width: min(100%, 760px); padding: 32px; margin: 0 auto; display: flex; flex-direction: column; gap: 40px; }
.phase3__form { display: flex; flex-direction: column; gap: 16px; padding: 20px 0; }
.phase3__note { margin: 20px 0; line-height: 1.6; }
.phase3__actions { display: flex; flex-wrap: wrap; gap: 20px; align-items: center; padding: 20px 0; }
.phase3__hash { display: block; overflow-wrap: anywhere; padding: 10px 0; font-size: 12px; }
.phase3 .setting { flex-wrap: wrap; }
.phase3 .toolbar h1 { overflow-wrap: anywhere; }
@media (max-width: 600px) { .phase3__body { padding: 20px 16px; } .phase3 .toolbar { flex-wrap: wrap; } .phase3 h1 { font-size: 26px; } }

/* ==================== Rechnungsausgang (D-85/D-86): additive writer rules ==================== */
.ausgang-screen { min-width: 0; }
.ausgang-toolbar { gap: 20px; flex-wrap: wrap; min-height: 56px; height: auto; padding-top: 10px; padding-bottom: 10px; }
.ausgang-toolbar h1 { white-space: nowrap; }
.ausgang-toolbar .toolbar__meta { margin: 0; font-size: 13px; }
.ausgang-layout { display: grid; grid-template-columns: 300px minmax(0,1fr); flex: 1; min-height: 0; }
.ausgang-list { min-width: 0; background: var(--c-surface); border-right: 1px solid var(--c-line); overflow: auto; }
.ausgang-list ul { list-style: none; margin: 0; padding: 0; }
.ausgang-list .group-head { color: var(--c-muted); font-size: 11.5px; height: 32px; }
.ausgang-item { position: relative; display: grid; grid-template-columns: 16px minmax(0,1fr) auto; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--c-line); color: var(--c-ink); text-decoration: none; }
.ausgang-item:hover { background: var(--c-surface-2); }
.ausgang-item[aria-current='true'] { background: var(--c-brand-soft); }
.ausgang-item[aria-current='true']::before { content: ''; position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--c-brand); }
.ausgang-item__text { min-width: 0; }
.ausgang-item .inv__name { display: block; font-size: 14px; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ausgang-item .inv__no { display: block; font-size: 11px; line-height: 1.55; overflow-wrap: anywhere; margin-top: 4px; }
.ausgang-item .inv__status { display: block; font-size: 12.5px; margin-top: 4px; }
.ausgang-item__amt { font-size: 14px; font-weight: 500; white-space: nowrap; }
.ausgang-shape { margin-top: 3px; color: var(--c-muted); }
.out-sent .ausgang-shape, .out-sent .inv__status { color: var(--c-brand); }
.out-err .ausgang-shape, .out-err .inv__status { color: var(--c-err); }
.ausgang-schreiben { display: grid; grid-template-columns: minmax(0,1fr) 350px; min-width: 0; min-height: 0; margin: 0; }
.ausgang-schreiben > input[type=hidden] { display: none; }
.ausgang-document { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.ausgang-document__hint { min-height: 40px; border-bottom: 1px solid var(--c-line); display: flex; align-items: center; gap: 10px; padding: 8px 16px; color: var(--c-muted); font-size: 12.5px; }
.ausgang-document__hint .icon { flex-shrink: 0; }
.ausgang-save { margin-left: auto; flex: 0 0 90px; max-width: 90px; overflow: hidden; text-overflow: ellipsis; font-size: 11px; white-space: nowrap; text-align: right; }
.ausgang-canvas { padding: 24px; overflow: auto; flex: 1; background-image: radial-gradient(var(--c-line) 1px,transparent 1px); background-size: 16px 16px; }
.ausgang-paper { max-width: 600px; margin: 0 auto; background: #fff; color: #141c1c; color-scheme: light; padding: 40px; border-radius: 2px; box-shadow: 0 1px 2px rgba(0,0,0,.12),0 24px 48px -28px rgba(0,0,0,.35); font-size: 12px; line-height: 1.6; }
.ausgang-paper__fields { border: 0; padding: 0; margin: 0; min-width: 0; }
.ausgang-paper__head { display: grid; grid-template-columns: minmax(0,1fr) 170px; gap: 18px; }
.ausgang-seller { font: 600 19px/1.2 'Source Serif 4',Georgia,serif; margin: 0 0 6px; }
.ausgang-paper__muted, .ausgang-paper__meta { color: #4d5958; }
.ausgang-paper__meta { text-align: right; font-variant-numeric: tabular-nums; }
.ausgang-paper__title { font: 600 20px/1.2 'Source Serif 4',Georgia,serif; color: #141c1c; margin: 0 0 6px; }
.ausgang-field { width: 100%; min-width: 0; min-height: 24px; font: inherit; line-height: 1.5; color: #141c1c; background: transparent; padding: 2px 3px; border: 1px dashed transparent; border-radius: 3px; transition: background-color .15s,border-color .15s; }
.ausgang-field:hover:not(:disabled) { background: #f3f1ec; border-color: #c9c5bb; }
.ausgang-field:focus-visible { background: #eef5f5; border-color: #1d4c52; outline: 2px solid #1d4c52; outline-offset: 1px; }
.ausgang-field:disabled { opacity: 1; -webkit-text-fill-color: #141c1c; }
.ausgang-field::placeholder { color: #626c69; }
.ausgang-field--invalid { border-color: #a3202a; background: #fbe9e9; }
.ausgang-field--name { font-weight: 500; }
.ausgang-field--number { text-align: right; }
.ausgang-date { display: flex; align-items: center; justify-content: flex-end; gap: 3px; white-space: nowrap; }
.ausgang-date input { width: 110px; font-size: 11px; text-align: right; padding-right: 0; }
.ausgang-recipient { margin-top: 28px; display: grid; grid-template-columns: minmax(0,1fr) 165px; gap: 22px; align-items: start; }
.ausgang-return { font-size: 9px; color: #4d5958; text-decoration: underline; margin-bottom: 3px; }
.ausgang-address { display: grid; grid-template-columns: 54px minmax(0,1fr); }
.ausgang-country { display: flex; align-items: center; gap: 5px; font-size: 10px; color: #4d5958; }
.ausgang-country input { width: 35px; }
.ausgang-public { display: flex; align-items: start; gap: 5px; font-size: 10.5px; line-height: 1.4; color: #4d5958; }
.ausgang-public input { margin-top: 2px; accent-color: #1d4c52; }
.ausgang-reference__label { display: block; text-transform: uppercase; font-size: 10.5px; letter-spacing: .06em; color: #4d5958; margin-top: 12px; }
.ausgang-reference .ausgang-field { font-size: 11px; }
.ausgang-lines { width: 100%; margin-top: 28px; border-collapse: collapse; table-layout: fixed; }
.ausgang-lines th { font-size: 9.5px; text-transform: uppercase; letter-spacing: .04em; color: #4d5958; font-weight: 500; text-align: left; border-bottom: 1px solid #141c1c; padding: 7px 0; }
.ausgang-lines th:first-child { width: 32px; }
.ausgang-lines th:nth-child(3) { width: 44px; text-align: right; }
.ausgang-lines th:nth-child(4) { width: 65px; text-align: right; }
.ausgang-lines th:nth-child(5) { width: 82px; text-align: right; }
.ausgang-lines th:last-child { width: 20px; }
.ausgang-lines td { border-bottom: 1px solid #e3e0d8; padding: 7px 0; vertical-align: top; }
.ausgang-lines td:nth-child(2) { padding-right: 8px; }
.ausgang-lines td:nth-child(3), .ausgang-lines td:nth-child(4) { padding-left: 4px; }
.ausgang-line-amount { text-align: right; white-space: nowrap; padding-top: 10px !important; font-size: 11px; }
.ausgang-line-tax { display: flex; align-items: center; gap: 2px; margin-top: 2px; }
.ausgang-line-tax select { font-size: 9px; color: #4d5958; max-width: 115px; padding: 0; }
.ausgang-line-tax select:first-child { width: 47px; flex-shrink: 0; }
.ausgang-exemption { font-size: 10px; }
.ausgang-remove { color: #4d5958; display: inline-flex; padding: 3px; border: 0; background: transparent; cursor: pointer; }
.ausgang-add { display: inline-flex; align-items: center; gap: 6px; border: 0; padding: 3px; margin-top: 6px; color: #1d4c52; background: transparent; font-size: 12px; font-weight: 500; cursor: pointer; }
.ausgang-add:hover { background: #eef5f5; }
.ausgang-totals { width: 250px; max-width: 100%; margin: 18px 0 0 auto; }
.ausgang-totals > div { display: flex; justify-content: space-between; gap: 12px; padding: 3px 0; }
.ausgang-totals__grand { border-top: 2px solid #141c1c; margin-top: 4px; padding-top: 7px !important; font-size: 13.5px; font-weight: 600; }
.ausgang-payment { margin-top: 36px; padding-top: 12px; border-top: 1px solid #e3e0d8; color: #4d5958; font-size: 10.5px; }
.ausgang-payment .ausgang-date { justify-content: flex-start; }
.ausgang-payment .ausgang-date input { text-align: left; }
.ausgang-manual-save { display: block; margin: 14px auto 0; }
.ausgang-noscript { max-width: 600px; margin: 15px auto; font-size: 13px; }
.ausgang-panel { display: flex; flex-direction: column; min-width: 0; min-height: 0; border-left: 1px solid var(--c-line); background: var(--c-surface); }
.ausgang-panel__body { flex: 1; overflow: auto; }
.ausgang-format { border: 0; border-bottom: 1px solid var(--c-line); padding: 20px; margin: 0; min-width: 0; }
.ausgang-format legend { float: left; width: 100%; color: var(--c-muted); font-size: 13px; margin-bottom: 8px; }
.ausgang-format__toggle { clear: both; display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--c-line-strong); border-radius: 6px; padding: 2px; }
.ausgang-format__toggle label { position: relative; cursor: pointer; }
.ausgang-format__toggle input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.ausgang-format__toggle span { display: flex; align-items: center; justify-content: center; height: 32px; font-size: 13px; border-radius: 4px; }
.ausgang-format__toggle input:checked + span { background: var(--c-brand); color: var(--c-brand-ink); font-weight: 600; }
.ausgang-format__toggle input:focus-visible + span { outline: 2px solid var(--c-focus); outline-offset: 2px; }
.ausgang-format > p { margin-top: 8px; line-height: 1.3; }
.ausgang-mail { display: block; color: var(--c-muted); font-size: 13px; margin-top: 16px; }
.ausgang-mail input { display: block; width: 100%; min-width: 0; height: 36px; margin-top: 6px; font-size: 13.5px; background: var(--c-bg); }
.ausgang-checks { padding: 20px; }
.ausgang-checks__head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.ausgang-checks__head h2 { font: 600 13px/1.4 'IBM Plex Sans',sans-serif; }
.ausgang-progress { width: 100%; height: 4px; display: block; margin-top: 8px; appearance: none; border: 0; border-radius: 4px; overflow: hidden; color: var(--c-ok); background: var(--c-surface-2); }
.ausgang-progress::-webkit-progress-bar { background: var(--c-surface-2); }
.ausgang-progress::-webkit-progress-value { background: var(--c-ok); }
.ausgang-progress::-moz-progress-bar { background: var(--c-ok); }
.ausgang-checklist { list-style: none; padding: 0; margin: 16px 0 0; display: flex; flex-direction: column; gap: 4px; }
.ausgang-check { padding: 6px 4px; font-size: 13.5px; border-radius: 6px; }
.ausgang-check > div:first-child { display: flex; align-items: flex-start; gap: 10px; }
.ausgang-check .shape { margin-top: 2px; flex-shrink: 0; }
.ausgang-check.is-ok .shape { color: var(--c-ok); }
.ausgang-check.is-error { border: 1px solid color-mix(in srgb,var(--c-err) 50%,var(--c-surface)); background: color-mix(in srgb,var(--c-err-soft) 40%,var(--c-surface)); margin: 4px 0; padding: 12px; }
.ausgang-check.is-error > div:first-child { font-weight: 600; }
.ausgang-check.is-error .shape { color: var(--c-err); }
.ausgang-check__help { margin-left: 24px; font-size: 13px; line-height: 1.6; }
.ausgang-check__help p { margin-top: 6px; }
.ausgang-check__help .mono { margin-top: 8px; font-size: 11px; color: var(--c-muted); }
.ausgang-kosit-note { margin-top: 16px; line-height: 1.45; }
.ausgang-panel__footer { flex-shrink: 0; border-top: 1px solid var(--c-line); background: var(--c-surface-2); padding: 16px; }
.ausgang-panel__footer p { margin-bottom: 10px; line-height: 1.35; }
.ausgang-send { width: 100%; font-size: 13px; padding-left: 10px; padding-right: 10px; white-space: nowrap; }
.ausgang-send .kbd { font-size: 10px; }
.ausgang-findings { margin-top: 20px; border-top: 1px solid var(--c-line); padding-top: 16px; font-size: 13px; }
.ausgang-findings ul { list-style: none; padding: 0; }
.ausgang-findings li { margin-top: 10px; }
@media (min-width: 1200px) { .ausgang-layout { grid-template-columns: 300px minmax(0,1fr); } }
@media (max-width: 1199px) {
  .ausgang-layout { grid-template-columns: 235px minmax(0,1fr); }
  .ausgang-schreiben { grid-template-columns: minmax(0,1fr); }
  .ausgang-panel { border-top: 1px solid var(--c-line); border-left: 0; }
  .ausgang-panel__body { overflow: visible; }
  .ausgang-canvas { overflow: visible; }
  .ausgang-document { min-height: 650px; }
}
@media (max-width: 760px) {
  .ausgang-layout, .ausgang-schreiben { display: block; }
  .ausgang-list { border-right: 0; border-bottom: 1px solid var(--c-line); max-height: 320px; }
  .ausgang-toolbar { padding: 12px 16px; gap: 10px; }
  .ausgang-toolbar .toolbar__end { margin-left: 0; }
  .ausgang-toolbar .toolbar__meta { width: 100%; order: 3; font-size: 12px; }
  .ausgang-document__hint { flex-wrap: wrap; padding: 10px 14px; }
  .ausgang-document__hint > span:not(.ausgang-save) { flex: 1; }
  .ausgang-save { width: 100%; margin-left: 24px; }
  .ausgang-document { min-height: auto; }
  .ausgang-canvas { padding: 16px 12px 22px; }
  .ausgang-paper { padding: 24px 18px; }
  .ausgang-paper__head { display: block; }
  .ausgang-paper__meta { text-align: left; margin-top: 18px; }
  .ausgang-paper__meta .ausgang-date { justify-content: flex-start; }
  .ausgang-paper__meta .ausgang-date input { text-align: left; }
  .ausgang-recipient { grid-template-columns: minmax(0,1fr); gap: 16px; margin-top: 22px; }
  .ausgang-reference { max-width: 240px; }
  .ausgang-reference__label { margin-top: 8px; }
  .ausgang-lines, .ausgang-lines thead, .ausgang-lines tbody { display: block; width: 100%; }
  .ausgang-lines { font-size: 12px; margin-top: 22px; }
  .ausgang-lines tr { display: grid; grid-template-columns: 26px repeat(3,minmax(0,1fr)) 40px; column-gap: 6px; }
  .ausgang-lines th, .ausgang-lines td { width: auto !important; min-width: 0; padding: 5px 0; border-bottom: 0; }
  .ausgang-lines thead tr { border-bottom: 1px solid #141c1c; }
  .ausgang-lines tbody tr { border-bottom: 1px solid #e3e0d8; padding: 8px 0; }
  .ausgang-lines th:first-child, .ausgang-lines td:first-child { grid-column: 1; grid-row: 1; }
  .ausgang-lines th:nth-child(2), .ausgang-lines td:nth-child(2) { grid-column: 2 / 5; grid-row: 1; padding-right: 0; }
  .ausgang-lines th:nth-child(3), .ausgang-lines td:nth-child(3) { grid-column: 2; grid-row: 2; text-align: right; }
  .ausgang-lines th:nth-child(4), .ausgang-lines td:nth-child(4) { grid-column: 3; grid-row: 2; text-align: right; }
  .ausgang-lines th:nth-child(5), .ausgang-lines td:nth-child(5) { grid-column: 4 / 6; grid-row: 2; text-align: right; }
  .ausgang-lines th:last-child, .ausgang-lines td:last-child { grid-column: 5; grid-row: 1; }
  .ausgang-line-tax { gap: 6px; }
  .ausgang-line-tax select { max-width: none; width: auto; font-size: 11px; flex: 1; }
  .ausgang-line-tax select:first-child { max-width: 60px; }
  /* label on top like Menge and Preis; the value sits on the 40px line of the inputs beside it */
  .ausgang-line-amount { font-size: 12px; padding-top: 5px !important; line-height: 40px; }
  .ausgang-field, .ausgang-remove, .ausgang-add, .ausgang-format__toggle span, .ausgang-mail input, .ausgang-toolbar .btn, .ausgang-manual-save { min-height: 40px; }
  .ausgang-remove { min-width: 40px; justify-content: center; align-items: center; }
  .ausgang-description { min-height: 54px; }
  .ausgang-public { min-height: 40px; align-items: center; }
  .ausgang-country input { width: 40px; }
  .ausgang-payment p, .ausgang-return { overflow-wrap: anywhere; }
  .ausgang-lines td:nth-child(3)::before { content: 'Menge'; display: block; font-size: 10px; line-height: 1.4; color: #4d5958; }
  .ausgang-lines td:nth-child(4)::before { content: 'Preis'; display: block; font-size: 10px; line-height: 1.4; color: #4d5958; }
  .ausgang-lines td:nth-child(5)::before { content: 'Gesamt'; display: block; font-size: 10px; line-height: 1.4; color: #4d5958; }
  .ausgang-totals { width: 230px; }
  .ausgang-seller { font-size: 18px; }
  .ausgang-panel__footer { position: static; }
}
@media (prefers-reduced-motion: reduce) { .ausgang-field { transition: none; } }
.ausgang-description { resize: none; white-space: pre-wrap; overflow-wrap: anywhere; display: block; overflow: hidden; }
.ausgang-storno-reference { margin-top: 20px; padding: 10px 0; border-block: 1px solid #e3e0d8; }
.ausgang-action { width: 100%; min-height: 40px; margin: 8px 0; white-space: normal; }
.ausgang-duplicate { display: flex; gap: 8px; align-items: start; min-height: 40px; margin: 14px 0; font-size: 13px; line-height: 1.5; }
.ausgang-duplicate input { flex-shrink: 0; margin-top: 4px; }
.ausgang-reconcile h3 { font-size: 14px; margin: 14px 0 8px; }
/* ==================== End Rechnungsausgang ==================== */
/* ==================== Buchen (D-95): self-service order page ==================== */
.buchen-schritte { counter-reset: schritt; list-style: none; padding: 0; margin: 20px 0 0; display: grid; gap: 10px; font-size: 13.5px; line-height: 1.45; }
.buchen-schritte li { display: flex; gap: 10px; align-items: flex-start; }
.buchen-schritte li::before { counter-increment: schritt; content: counter(schritt); flex: 0 0 22px; height: 22px; margin-top: -1px; border-radius: 50%;
  background: var(--c-brand-soft); color: var(--c-brand); font-weight: 600; font-size: 12px; display: grid; place-items: center; }
.tarifwahl { display: grid; gap: 10px; border: 0; padding: 0; margin: 0; min-width: 0; }
.tarifwahl legend { font-weight: 500; font-size: 13px; margin-bottom: 6px; padding: 0; }
.tarif { display: grid; grid-template-columns: 18px 1fr auto; gap: 4px 12px; align-items: start; padding: 14px 16px;
  border: 1px solid var(--c-line-strong); border-radius: var(--r-md); background: var(--c-surface); cursor: pointer; }
.tarif:hover { border-color: var(--c-brand); }
.tarif:has(input:checked) { border-color: var(--c-brand); background: var(--c-brand-soft); }
.tarif:has(input:focus-visible) { outline: 2px solid var(--c-brand); outline-offset: 2px; }
.tarif:has(input:disabled) { opacity: .55; cursor: not-allowed; }
.tarif input { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--c-brand); }
.tarif__name { font-weight: 600; font-size: 14px; }
.tarif__preis { font-weight: 600; font-size: 14px; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.tarif__preis small { font-weight: 400; color: var(--c-muted); font-size: 12px; }
.tarif__text { grid-column: 2 / 4; font-size: 12.5px; color: var(--c-muted); line-height: 1.5; }
.tarif__plus { color: var(--c-brand); font-weight: 600; }
.buchen-zeile { display: grid; grid-template-columns: minmax(96px, 140px) 1fr; gap: 12px; }
@media (max-width: 480px) { .buchen-zeile { grid-template-columns: 1fr; } }
/* ==================== End Buchen ==================== */
