/**
 * Druckwerk — Modul-spezifische Styles (Welle D1).
 * Nutzt module-layout.css (Header/Toolbar/Body/Footer) als Basis.
 */

/* ── Tabs ──────────────────────────────────────────────────────────────── */

.dw-root .dw-tabs {
  display: flex;
  gap: 0;
}

.dw-root .dw-tab {
  padding: 6px 16px;
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-medium);
  letter-spacing: var(--letter-spacing-wide);
  border: none;
  background: transparent;
  color: var(--color-text-secondary);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}

.dw-root .dw-tab:hover:not([disabled]) {
  color: var(--color-text-primary);
}

.dw-root .dw-tab[aria-selected="true"] {
  color: var(--color-accent);
  border-bottom-color: var(--color-accent);
}

.dw-root .dw-tab[disabled] {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ── Toolbar Info ──────────────────────────────────────────────────────── */

.dw-root .dw-toolbar__info {
  font-size: var(--font-size-base);
  color: var(--color-text-tertiary);
}

/* ── Body ──────────────────────────────────────────────────────────────── */

.dw-root .dw-body {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.dw-root .dw-tab-content {
  padding: 20px 24px;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.dw-root .dw-tab-content[hidden] {
  display: none;
}

/* ── Vorlagen Master-Detail ───────────────────────────────────────────── */

.dw-vorlagen-master {
  display: flex;
  gap: 20px;
  height: 100%;
  min-height: 0;
}

.dw-vorlagen-master__list {
  flex: 0 0 280px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.dw-vorlagen-master__preview {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

/* ── Accordion Groups ────────────────────────────────────────────────── */

.dw-group__header {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 10px;
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-semibold);
  font-family: inherit;
  color: var(--color-text-primary);
  background: var(--color-bg-secondary);
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s;
}

.dw-group__header:hover { background: var(--color-bg-tertiary); }
.dw-group__chevron { font-size: var(--font-size-lg); color: var(--color-text-tertiary); width: 12px; text-align: center; }
.dw-group__icon { font-size: var(--font-size-lg); }
.dw-group__count {
  margin-left: auto;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-normal);
  color: var(--color-text-tertiary);
  background: var(--color-bg-primary);
  padding: 0 6px;
  border-radius: 8px;
}

.dw-group__body { padding: 2px 0 6px 0; }
.dw-group__body[hidden] { display: none; }

/* ── Template Row (inside accordion) ─────────────────────────────────── */

.dw-tpl-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px 5px 30px;
  border-radius: 4px;
  cursor: pointer;
  font-size: var(--font-size-base);
  color: var(--color-text-secondary);
  transition: background 0.1s, color 0.1s;
}

.dw-tpl-row:hover { background: var(--color-bg-primary); color: var(--color-text-primary); }
.dw-tpl-row--active {
  background: color-mix(in srgb, var(--color-accent) 10%, transparent);
  color: var(--color-accent);
  font-weight: var(--font-weight-medium);
}

.dw-tpl-row__icon { font-size: var(--font-size-lg); flex-shrink: 0; }
.dw-tpl-row__name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dw-tpl-row__badge {
  font-size: var(--font-size-xs);
  color: var(--color-accent);
  background: color-mix(in srgb, var(--color-accent) 10%, transparent);
  padding: 0 5px;
  border-radius: 4px;
}

/* ── Preview Panel ───────────────────────────────────────────────────── */

.dw-preview-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  gap: 8px;
  color: var(--color-text-dim);
}
.dw-preview-empty__icon { font-size: var(--font-size-md); opacity: 0.4; }
.dw-preview-empty__text { font-size: var(--font-size-md); }

.dw-preview {
  display: flex;
  flex-direction: column;
  height: 100%;
  gap: 8px;
}

.dw-preview__header {
  display: flex;
  align-items: center;
  gap: 8px;
}
.dw-preview__icon { font-size: var(--font-size-base); }
.dw-preview__title { font-size: var(--font-size-lg); font-weight: var(--font-weight-semibold); color: var(--color-text-primary); }
.dw-preview__desc { font-size: var(--font-size-base); color: var(--color-text-muted); }

.dw-preview__frame {
  flex: 1;
  min-height: 0;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  overflow: hidden;
  background: #fff;
}

.dw-preview__iframe {
  width: 100%;
  height: 100%;
  border: none;
}

.dw-preview__actions {
  display: flex;
  gap: 8px;
  padding-top: 4px;
}

.dw-preview__btn {
  padding: 6px 14px;
  font-size: var(--font-size-base);
  font-family: inherit;
  font-weight: var(--font-weight-medium);
  color: var(--color-accent);
  background: color-mix(in srgb, var(--color-accent) 8%, transparent);
  border: 1px solid var(--color-accent);
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s;
}
.dw-preview__btn:hover { background: color-mix(in srgb, var(--color-accent) 16%, transparent); }
.dw-preview__btn--primary {
  color: var(--color-text-on-primary);
  background: var(--color-primary);
  border-color: var(--color-primary);
}
.dw-preview__btn--primary:hover { background: color-mix(in srgb, var(--color-primary) 85%, black); }

/* ── Badges ────────────────────────────────────────────────────────────── */

.dw-badge {
  display: inline-block;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  padding: 1px 7px;
  border-radius: 4px;
  letter-spacing: var(--letter-spacing-wide);
}

.dw-badge--system {
  background: var(--color-bg-tertiary);
  color: var(--color-text-secondary);
}

.dw-badge--db {
  background: color-mix(in srgb, var(--color-accent) 12%, transparent);
  color: var(--color-accent);
}

.dw-badge--skeleton {
  background: color-mix(in srgb, var(--color-success) 12%, transparent);
  color: var(--color-success);
}

.dw-badge--edit {
  background: color-mix(in srgb, var(--color-accent) 10%, transparent);
  color: var(--color-accent);
  font-size: var(--font-size-sm);
}

/* ── Einstellungen-Tab ─────────────────────────────────────────────────── */

.dw-settings-layout {
  display: flex;
  gap: 32px;
  align-items: flex-start;
}

.dw-settings {
  flex: 1;
  min-width: 0;
  max-width: 480px;
}

.dw-settings-preview {
  position: sticky;
  top: 0;
  flex-shrink: 0;
}

.dw-settings__section {
  margin-bottom: 32px;
}

.dw-settings__title {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-primary);
  margin: 0 0 4px 0;
}

.dw-settings__hint {
  font-size: var(--font-size-base);
  color: var(--color-text-tertiary);
  margin: 0 0 14px 0;
  line-height: var(--line-height-ui);
}

.dw-settings__row {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ── Farbfamilien-Grid ─────────────────────────────────────────────────── */

.dw-family-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 10px;
}

.dw-family {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--color-bg-primary);
  border: 2px solid var(--color-border);
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
  text-align: left;
  font: inherit;
  color: inherit;
}

.dw-family:hover {
  border-color: var(--color-text-tertiary);
}

.dw-family--active {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px var(--color-primary-alpha);
}

.dw-family__swatch {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  flex-shrink: 0;
}

.dw-family__color-input {
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 6px;
  padding: 0;
  cursor: pointer;
  flex-shrink: 0;
  background: none;
}

.dw-family__color-input::-webkit-color-swatch-wrapper { padding: 0; }
.dw-family__color-input::-webkit-color-swatch { border: none; border-radius: 6px; }

.dw-family__info {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.dw-family__label {
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-primary);
}

.dw-family__desc {
  font-size: var(--font-size-base);
  color: var(--color-text-tertiary);
}

/* ── Radio-Buttons ─────────────────────────────────────────────────────── */

.dw-radio {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 14px;
  background: var(--color-bg-primary);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 0.15s;
}

.dw-radio:hover {
  border-color: var(--color-text-tertiary);
}

.dw-radio input[type="radio"] {
  margin-top: 3px;
  accent-color: var(--color-accent);
}

.dw-radio__label {
  font-size: var(--font-size-md);
  color: var(--color-text-primary);
  line-height: var(--line-height-ui);
}

.dw-radio__label strong {
  display: inline;
}

/* ── Firmenstempel-Tab (Read-Only aus Stammwerk) ──────────────────────── */

.dw-stamp-cards {
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
}

.dw-stamp-card {
  flex: 1;
  background: var(--color-bg-primary);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  overflow: hidden;
}

.dw-stamp-card__header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: var(--color-bg-secondary);
  border-bottom: 1px solid var(--color-border);
}

.dw-stamp-card__icon { font-size: var(--font-size-2xl); }

.dw-stamp-card__title {
  flex: 1;
  margin: 0;
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-primary);
}

.dw-stamp-header__link {
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-medium);
  color: var(--color-accent);
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  padding: 3px 8px;
  border-radius: 4px;
  white-space: nowrap;
  transition: background 0.15s;
}

.dw-stamp-header__link:hover {
  background: color-mix(in srgb, var(--color-accent) 10%, transparent);
}

.dw-stamp-card__body {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.dw-stamp-card__line {
  font-size: var(--font-size-md);
  color: var(--color-text-primary);
}

.dw-stamp-card__line--muted {
  color: var(--color-text-secondary);
  font-size: var(--font-size-base);
}

.dw-stamp-card__line--mono {
  font-family: var(--font-family-mono);
  font-size: var(--font-size-base);
  color: var(--color-text-secondary);
  letter-spacing: var(--letter-spacing-wide);
}

.dw-stamp-card__contacts {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: var(--font-size-base);
  color: var(--color-text-secondary);
}

.dw-stamp-section {
  margin-bottom: 16px;
}

.dw-stamp-local {
  display: flex;
  gap: 16px;
  margin-top: 8px;
}

.dw-stamp-local .dw-stamp-field {
  flex: 0 0 160px;
}

.dw-stamp-field__label {
  display: block;
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-medium);
  color: var(--color-text-secondary);
  margin-bottom: 4px;
}

.dw-stamp-field__select {
  width: 100%;
  padding: 7px 10px;
  font-size: var(--font-size-md);
  font-family: inherit;
  color: var(--color-text-primary);
  background: var(--color-bg-primary);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23888'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 28px;
}

.dw-stamp-field__select:focus {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 2px var(--color-primary-alpha);
}

.dw-stamp-status {
  font-size: var(--font-size-base);
  min-height: 1.4em;
  margin-top: 8px;
}

.dw-stamp-status--ok { color: var(--color-success); }
.dw-stamp-status--error { color: var(--color-error); }

/* ── Empty State ──────────────────────────────────────────────────────── */

.dw-stamp-empty {
  text-align: center;
  padding: 48px 24px;
}

.dw-stamp-empty__icon {
  font-size: var(--font-size-display-md);
  display: block;
  margin-bottom: 12px;
}

.dw-stamp-empty__title {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-primary);
  margin: 0 0 8px 0;
}

.dw-stamp-empty__text {
  font-size: var(--font-size-base);
  color: var(--color-text-secondary);
  max-width: 400px;
  margin: 0 auto 16px;
  line-height: var(--line-height-normal);
}

/* ── Brief-Vorschau ────────────────────────────────────────────────────── */

.dw-preview__page {
  max-width: 400px;
  padding: 24px 28px;
  background: var(--doc-color-bg);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  font-family: var(--doc-font-family);
  font-size: var(--font-size-xs);
  line-height: var(--line-height-normal);
  color: var(--doc-color-text);
  box-shadow: var(--shadow-md);
}

.dw-preview__rule {
  height: 2px;
  background: var(--doc-color-rule);
  margin-bottom: 14px;
  border-radius: 1px;
}

.dw-preview__sender {
  font-weight: var(--font-weight-bold);
  font-size: var(--font-size-base);
  color: var(--doc-color-accent);
}

.dw-preview__sender-sub {
  font-size: var(--font-size-xs);
  color: var(--doc-color-text-secondary);
  margin-bottom: 6px;
}

.dw-preview__spacer { height: 12px; }

.dw-preview__recipient {
  font-size: var(--font-size-xs);
  color: var(--doc-color-text);
}

.dw-preview__subject {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--doc-color-text);
  margin-bottom: 8px;
}

.dw-preview__body {
  font-size: var(--font-size-xs);
  color: var(--doc-color-text);
}

.dw-preview__closing {
  margin-top: 14px;
  font-size: var(--font-size-xs);
}

.dw-preview__signature {
  margin-top: 6px;
  font-weight: var(--font-weight-semibold);
  font-size: var(--font-size-xs);
}

/* ── Template-Editor (D6) ──────────────────────────────────────────────── */

.dw-editor {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 200px);
  min-height: 400px;
}

.dw-editor__toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 0 12px 0;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 12px;
  flex-shrink: 0;
}

.dw-editor__btn {
  padding: 5px 12px;
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-medium);
  font-family: inherit;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  background: var(--color-bg-primary);
  color: var(--color-text-primary);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.dw-editor__btn:hover {
  border-color: var(--color-text-tertiary);
  background: var(--color-bg-secondary);
}

.dw-editor__btn--save {
  background: var(--color-primary);
  color: var(--color-text-on-primary);
  border-color: var(--color-primary);
}

.dw-editor__btn--save:hover {
  filter: brightness(1.1);
  background: var(--color-primary);
  border-color: var(--color-primary);
}

.dw-editor__btn--reset {
  color: var(--color-text-secondary);
}

.dw-editor__title {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-primary);
}

.dw-editor__tools {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.dw-editor__engine {
  font-size: var(--font-size-base);
  color: var(--color-text-tertiary);
  white-space: nowrap;
}

.dw-editor__content {
  display: flex;
  gap: 12px;
  flex: 1;
  min-height: 0;
}

.dw-editor__code-panel,
.dw-editor__preview-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  overflow: hidden;
}

.dw-editor__code-header,
.dw-editor__preview-header {
  padding: 6px 12px;
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-secondary);
  background: var(--color-bg-secondary);
  border-bottom: 1px solid var(--color-border);
  text-transform: uppercase;
  letter-spacing: var(--letter-spacing-wide);
  flex-shrink: 0;
}

.dw-editor__textarea {
  flex: 1;
  width: 100%;
  resize: none;
  border: none;
  outline: none;
  padding: 12px;
  font-family: var(--font-family-mono);
  font-size: var(--font-size-base);
  line-height: var(--line-height-normal);
  color: var(--color-text-primary);
  background: var(--color-bg-primary);
  tab-size: 2;
  white-space: pre;
  overflow: auto;
}

.dw-editor__preview-frame {
  flex: 1;
  overflow: auto;
  background: #fff;
}

.dw-editor__iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

.dw-editor__status {
  font-size: var(--font-size-base);
  min-height: 1.4em;
  margin-top: 8px;
  flex-shrink: 0;
}

.dw-editor__status--ok { color: var(--color-success); }
.dw-editor__status--error { color: var(--color-error); }

/* ══════════════════════════════════════════════════════════════════════════
   QR-Bill — Swiss QR-Rechnung (SIX Standard, ISO 20022)
   Exakte Masse: 210×105mm, Empfangsschein 62mm, Zahlteil 148mm
   Schrift: Liberation Sans / Helvetica / Arial, 6–11pt

   KEINE THEME-TOKENS IN DIESEM BLOCK — mit Absicht (2026-08-01).
   Der Zahlteil ist ein genormtes Artefakt, kein Stück Portal-Oberfläche. Was
   die Norm festlegt, darf ein Themenwechsel nicht verschieben; deshalb stehen
   Masse, Schriftfamilie, Grössen, Gewichte, Zeilenhöhen und Laufweiten hier
   als feste Werte. Dieselbe Grenze wie bei der Zeichenfläche der Flipchart-
   Schmiede (docs/TYPOGRAFIE-KONZEPT.md §2.4).

   Es war vorher anders, und das war ein Fehler mit sichtbarer Folge: 15
   Deklarationen zeigten auf Bildschirm-Tokens (--font-weight-bold,
   --line-height-normal, --letter-spacing-caps …). Der Zahlteil wird aber in
   ein EIGENES Dokument gerendert (window.open / iframe.srcdoc), und dorthin
   überträgt services/DocTokenCss.js ausschliesslich --doc-*. Die Bezüge
   liefen also ins Leere: die von der Norm verlangten fetten Titel von
   Empfangsschein und Zahlteil (.qrb-receipt__title, .qrb-payment__title)
   wurden gedruckt normal gesetzt. Wer hier wieder Tokens einsetzt, bricht
   entweder die Norm oder den Druck.
   ══════════════════════════════════════════════════════════════════════════ */

/* Kein Zahlteil moeglich: der gewaehlte Absender-Kontext traegt keine
   Bankverbindung. Sichtbarer Hinweis statt eines QR-Codes mit fremdem
   Empfaenger (Entscheid 2026-07-21). */
.qrb-page--fehlt {
  display: flex; flex-direction: column; justify-content: center; align-items: center;
  text-align: center; padding: 20mm 15mm; gap: 4mm;
  border: 1px dashed var(--doc-color-text-muted);
}
.qrb-fehlt-titel { font-weight: 700; font-size: 12pt; }
.qrb-fehlt-text  { font-size: 9pt; line-height: 1.5; max-width: 120mm; }

.qrb-page {
  width: 210mm;
  min-height: 105mm;
  padding: 0;
  page-break-before: always;
  font-family: 'Liberation Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  color: #000;
  background: #fff;
}

.qrb-perforation {
  border-top: 1px dashed #000;
  position: relative;
  height: 0;
}

.qrb-scissors {
  position: absolute;
  top: -8px;
  left: -2mm;
  font-size: var(--font-size-lg);
  line-height: 1;
  color: #000;
}

.qrb-layout {
  display: flex;
  min-height: 105mm;
  padding: 5mm 0 0 0;
}

/* ── Empfangsschein (links, 62mm) ──────────────────────────────────────── */

.qrb-receipt {
  width: 62mm;
  min-height: 100mm;
  border-right: 1px dashed #000;
  padding: 0 5mm 0 5mm;
  font-size: 8pt;
  line-height: 1.5;
  display: flex;
  flex-direction: column;
}

.qrb-receipt__title {
  font-size: 11pt;
  font-weight: 700;
  margin-bottom: 3mm;
}

.qrb-receipt__bottom {
  margin-top: auto;
}

/* ── Zahlteil (rechts, 148mm) ──────────────────────────────────────────── */

.qrb-payment {
  flex: 1;
  min-height: 100mm;
  padding: 0 5mm 0 5mm;
  font-size: 9pt;
  line-height: 1.5;
}

.qrb-payment__title {
  font-size: 11pt;
  font-weight: 700;
  margin-bottom: 3mm;
}

.qrb-payment__top {
  display: flex;
  gap: 5mm;
  margin-bottom: 5mm;
}

.qrb-payment__details {
  padding-left: 0;
}

.qrb-payment__amounts {
  display: flex;
  align-items: flex-end;
}

/* ── QR-Code (46×46mm mit Swiss Cross) ─────────────────────────────────── */

.qrb-qrcode {
  width: 46mm;
  height: 46mm;
  position: relative;
  flex-shrink: 0;
}

.qrb-qrcode__img {
  width: 46mm;
  height: 46mm;
  display: block;
  image-rendering: pixelated;
}

.qrb-swiss-cross {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 7mm;
  height: 7mm;
}

.qrb-swiss-cross__svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* ── Gemeinsame Elemente ───────────────────────────────────────────────── */

.qrb-section {
  margin-bottom: 2.5mm;
}

.qrb-label {
  font-size: 6pt;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5mm;
  line-height: 1.35;
}

.qrb-value {
  font-size: inherit;
  line-height: 1.5;
}

.qrb-value--bold {
  font-size: 10pt;
  font-weight: 700;
}

.qrb-value--ref {
  font-size: 7pt;
  font-family: 'Liberation Sans', 'Courier New', monospace;
  letter-spacing: 0.03em;
}

.qrb-amount-row {
  display: flex;
  gap: 5mm;
}

.qrb-amount-col {
  min-width: 12mm;
}

.qrb-acceptance {
  font-size: 6pt;
  font-weight: 700;
  text-align: right;
  margin-top: 3mm;
}

/* Eck-Rahmen fuer leere Felder (SIX-Vorgabe: Empfaenger/Betrag leer) */
.qrb-corner-box {
  width: 60mm;
  height: 20mm;
  border: 1px solid #000;
  border-radius: 0;
  position: relative;
}

.qrb-corner-box--sm {
  width: 40mm;
  height: 15mm;
}

.qrb-corner-box--xs {
  width: 25mm;
  height: 10mm;
  display: inline-block;
}

@media print {
  .qrb-page {
    page-break-before: always;
    margin: 0;
  }
  .qrb-perforation {
    border-top-style: dashed;
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   DRUCKWERK WIZARD (Standalone-Druck)
   ═══════════════════════════════════════════════════════════════════════════ */

.dw-wizard-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
}

.dw-wizard {
  background: var(--color-bg-primary);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border-primary);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
  width: min(560px, 90vw);
  max-height: 85vh;
  display: flex;
  flex-direction: column;
}

.dw-wizard__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--color-border-primary);
}

.dw-wizard__title {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-primary);
  margin: 0;
}

.dw-wizard__close {
  background: none;
  border: none;
  font-size: var(--font-size-display-xs);
  color: var(--color-text-muted);
  cursor: pointer;
  padding: 0 4px;
  line-height: var(--line-height-tight);
}
.dw-wizard__close:hover { color: var(--color-text-primary); }

.dw-wizard__body {
  padding: 16px 20px;
  overflow-y: auto;
  flex: 1;
}

.dw-wizard__section {
  margin-bottom: 16px;
}

.dw-wizard__section-title {
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-semibold);
  text-transform: uppercase;
  letter-spacing: var(--letter-spacing-caps);
  color: var(--color-text-secondary);
  margin: 0 0 8px;
}

.dw-wizard__row {
  display: flex;
  gap: 12px;
  margin-bottom: 8px;
}

.dw-wizard__label {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: var(--font-size-md);
  color: var(--color-text-secondary);
}

.dw-wizard__label--full { flex-basis: 100%; }

.dw-wizard__select,
.dw-wizard__input,
.dw-wizard__textarea {
  padding: 6px 10px;
  border: 1px solid var(--color-border-primary);
  border-radius: var(--radius-sm);
  background: var(--color-bg-secondary);
  color: var(--color-text-primary);
  font-size: var(--font-size-md);
  font-family: inherit;
}
.dw-wizard__select:focus,
.dw-wizard__input:focus,
.dw-wizard__textarea:focus {
  outline: none;
  border-color: var(--color-primary);
}

.dw-wizard__textarea { resize: vertical; }

.dw-wizard__checkboxes {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
}

.dw-wizard__check {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--font-size-md);
  color: var(--color-text-secondary);
  cursor: pointer;
}

.dw-wizard__preview-info {
  padding: 10px 14px;
  background: var(--color-bg-tertiary);
  border-radius: var(--radius-sm);
  font-size: var(--font-size-md);
  color: var(--color-text-secondary);
  margin-top: 8px;
}

.dw-wizard__footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 20px;
  border-top: 1px solid var(--color-border-primary);
}
