/* Beleg-Kreislauf (produkte/swx-studio/#kreislauf): Motiongrafik + Stationsleiste.
   Gemeinsam genutzt von der Website und der HyperFrames-Komposition (tools/motion/beleg-kreislauf),
   daher jede Variable mit Fallback. Bewegte Elemente haben hier bewusst keine transform-Werte:
   Startzustände setzt die Zeitleiste in szene.js. */

.bk { margin-top: 28px; }
.bk-anzeige { display: none; }
.bk-bereit .bk-anzeige { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 40px; align-items: center; margin-bottom: 24px; }
/* Standbild-Wechsel bei reduzierter Bewegung (steuerung.js): nur Deckkraft, keine Bewegung */
.bk-anzeige { transition: opacity .3s ease; }
.bk-anzeige.bk-blende { opacity: 0; }

/* Bühne mit Beleg */
.bk-buehne { position: relative; display: grid; place-items: center; min-height: 400px; padding: 40px 0 96px; box-sizing: border-box; }
.bk-papier { display: grid; width: min(100%, 340px); }
.bk-papier > * { grid-area: 1 / 1; }
.bk-geist { background: #f8fafc; border: 1px solid var(--border, #e2e8f0); border-radius: 10px; box-shadow: 0 10px 30px rgba(27, 58, 107, .12); opacity: 0; }
.bk-beleg { position: relative; background: #fff; border: 1px solid var(--border, #e2e8f0); border-radius: 10px; box-shadow: 0 10px 30px rgba(27, 58, 107, .12); padding: 18px 18px 16px; font-size: 13px; line-height: 1.4; color: var(--dark, #1e293b); }

.bk-kopf { position: relative; margin-bottom: 12px; }
.bk-kennung { display: block; height: 16px; overflow: hidden; font-size: 11px; line-height: 16px; font-weight: 700; letter-spacing: .06em; font-variant-numeric: tabular-nums; color: #a35a10; }
.bk-roll { display: block; }
.bk-roll b { display: block; height: 16px; }
.bk-art { position: relative; display: block; height: 28px; font-size: 20px; line-height: 28px; font-weight: 700; color: var(--primary, #1B3A6B); }
.bk-art span { position: absolute; left: 0; top: 0; opacity: 0; }
.bk-art .bk-a0 { opacity: 1; }
.bk-stempel { position: absolute; right: 0; top: 6px; display: block; padding: 3px 8px; border: 2px solid #15803d; border-radius: 4px; color: #15803d; font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; opacity: 0; }
.bk-siegel { position: absolute; right: -34px; top: -40px; display: grid; place-items: center; width: 66px; height: 66px; padding: 6px; box-sizing: border-box; border-radius: 50%; background: var(--primary, #1B3A6B); border: 3px solid var(--accent, #E8851A); color: #fff; font-size: 10px; font-weight: 800; line-height: 1.15; text-align: center; box-shadow: 0 6px 16px rgba(27, 58, 107, .3); opacity: 0; }

.bk-zeile { position: relative; display: flex; justify-content: space-between; gap: 12px; padding: 6px 8px; margin: 0 -8px; border-radius: 6px; }
.bk-zeile > span { color: var(--muted, #64748b); }
.bk-zeile strong { text-align: right; }
.bk-pos { position: relative; margin: 6px -8px; padding: 4px 8px; border-radius: 6px; border-top: 1px solid var(--border, #e2e8f0); border-bottom: 1px solid var(--border, #e2e8f0); }
.bk-p { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 64px 64px 14px; gap: 8px; align-items: center; padding: 5px 0; border-radius: 4px; }
.bk-p[data-p="0"] { padding-bottom: 18px; }
.bk-p-text { position: relative; }
.bk-rest { position: absolute; left: 0; top: 100%; display: block; white-space: nowrap; font-size: 10px; font-style: normal; font-weight: 700; color: #a35a10; opacity: 0; }
.bk-p-menge { position: relative; height: 18px; }
.bk-p-menge span { position: absolute; right: 0; top: 0; white-space: nowrap; opacity: 0; }
.bk-p-menge .bk-m0 { opacity: 1; }
.bk-p-menge .bk-m2 { color: #b91c1c; font-weight: 700; }
.bk-p-preis { text-align: right; font-variant-numeric: tabular-nums; }
.bk-p-haken { display: block; color: #15803d; font-weight: 800; opacity: 0; }
.bk-mark { position: absolute; right: -12px; top: -9px; display: block; padding: 1px 7px; border-radius: 999px; background: var(--accent, #E8851A); color: var(--dark, #1e293b); font-size: 9px; font-style: normal; font-weight: 700; opacity: 0; }
.bk-hinweis { position: absolute; left: 8px; right: 8px; top: 100%; z-index: 2; margin-top: 4px; padding: 6px 8px; border-radius: 6px; background: #fef2f2; border: 1px solid #fecaca; color: #b91c1c; font-size: 11px; font-weight: 600; box-shadow: 0 6px 16px rgba(185, 28, 28, .12); opacity: 0; }
.bk-fuss { display: flex; justify-content: space-between; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border, #e2e8f0); font-weight: 700; color: var(--primary, #1B3A6B); }
.bk-summe { position: relative; display: block; min-width: 100px; height: 20px; }
.bk-summe span { position: absolute; right: 0; top: 0; white-space: nowrap; font-variant-numeric: tabular-nums; opacity: 0; }
.bk-summe .bk-s0 { opacity: 1; }

/* Zahlstand unter dem Beleg */
.bk-offen { position: absolute; left: 0; right: 0; bottom: 8px; width: min(100%, 320px); margin: 0 auto; padding: 8px 12px; box-sizing: border-box; border-radius: 8px; background: #f8fafc; border: 1px solid var(--border, #e2e8f0); font-size: 12px; opacity: 0; }
.bk-offen-kopf { display: flex; justify-content: space-between; font-weight: 600; color: var(--primary, #1B3A6B); }
.bk-offen-betrag { position: relative; display: block; min-width: 100px; height: 18px; }
.bk-offen-betrag span { position: absolute; right: 0; top: 0; white-space: nowrap; font-variant-numeric: tabular-nums; opacity: 0; }
.bk-offen-betrag .bk-b0 { opacity: 1; }
.bk-offen-betrag .bk-b2 { color: #15803d; }
.bk-balken { display: block; height: 6px; margin: 6px 0 4px; border-radius: 3px; background: var(--border, #e2e8f0); overflow: hidden; }
.bk-balken i { display: block; width: 100%; height: 100%; background: #15803d; transform-origin: 0 50%; }
.bk-offen-info { position: relative; display: block; height: 16px; font-size: 11px; color: var(--muted, #64748b); }
.bk-offen-info span { position: absolute; left: 0; top: 0; white-space: nowrap; opacity: 0; }
.bk-offen-info .bk-i0 { opacity: 1; }

/* Ablage */
.bk-ordner { position: absolute; left: 0; right: 0; bottom: 12px; display: block; width: 120px; height: 78px; margin: 0 auto; border-radius: 6px 6px 10px 10px; background: var(--primary, #1B3A6B); box-shadow: 0 10px 24px rgba(27, 58, 107, .25); opacity: 0; }
.bk-ordner::before { content: ""; position: absolute; left: 10px; top: -10px; width: 46px; height: 14px; border-radius: 6px 6px 0 0; background: var(--primary, #1B3A6B); }
.bk-schloss { position: absolute; left: 50%; top: 32px; display: block; width: 22px; height: 18px; margin-left: -11px; border-radius: 4px; background: var(--accent, #E8851A); opacity: 0; }
.bk-schloss::before { content: ""; position: absolute; left: 4px; top: -10px; width: 14px; height: 13px; box-sizing: border-box; border: 3px solid var(--accent, #E8851A); border-bottom: 0; border-radius: 8px 8px 0 0; }

/* Erklärtext */
.bk-text { display: grid; }
.bk-t { grid-area: 1 / 1; padding: 6px 0 6px 18px; border-left: 3px solid var(--accent, #E8851A); opacity: 0; }
.bk-t:first-child { opacity: 1; }
.bk-t-nr { display: block; margin-bottom: 8px; font-size: 12px; font-weight: 700; letter-spacing: .06em; font-variant-numeric: tabular-nums; color: #a35a10; }
.bk-t-titel { display: block; margin-bottom: 8px; font-size: 26px; line-height: 1.2; color: var(--primary, #1B3A6B); }
.bk-t-satz { margin: 0; font-size: 17px; line-height: 1.5; color: var(--muted, #64748b); }

/* Stationsleiste (ohne JavaScript: die Kacheln wie bisher) */
.swx-flow { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); counter-reset: s; }
.swx-flow li { background: var(--white, #fff); border: 1px solid var(--border, #e2e8f0); border-radius: var(--radius, 10px); padding: 14px 16px; counter-increment: s; position: relative; font-weight: 600; color: var(--dark, #1e293b); transition: border-color .3s, background .3s; }
.swx-flow li::before { content: counter(s); display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--accent, #E8851A); color: var(--white, #fff); font-size: .8rem; font-weight: 700; margin-right: 8px; }
.swx-flow small { display: block; color: var(--muted, #64748b); font-weight: 400; margin-top: 4px; }
.swx-flow li.is-aktiv { border-color: var(--accent, #E8851A); background: #fff7ed; }
.bk-knopf { appearance: none; background: none; border: 0; padding: 0; margin: 0; font: inherit; color: inherit; text-align: left; }
.bk-bereit .bk-knopf { cursor: pointer; }
.bk-knopf::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius, 10px); }
.bk-knopf:focus-visible { outline: none; }
.bk-knopf:focus-visible::after { outline: 2px solid var(--primary, #1B3A6B); outline-offset: 2px; }

@media (min-width: 900px) {
  .swx-flow { grid-template-columns: repeat(6, 1fr); }
}
@media (max-width: 899px) {
  .bk-bereit .bk-anzeige { grid-template-columns: 1fr; gap: 20px; }
  .bk-bereit .swx-flow { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .bk-papier { width: min(calc(100% - 40px), 340px); } /* Platz für das überstehende Siegel */
}
@media (max-width: 479px) {
  .bk-bereit .swx-flow { grid-template-columns: repeat(2, minmax(0, 1fr)); } /* drei Spalten sind auf dem Handy zu eng ("Lieferschein" läuft über) */
  .bk-bereit .swx-flow li { overflow-wrap: anywhere; } /* Notbremse für sehr schmale Geräte (320 px) */
}
@media (prefers-reduced-motion: reduce) {
  .swx-flow li { transition: none; }
}
