/* Demo Automatisierung: ergänzt nur, was kit.css nicht hat. */

[hidden] { display: none !important; }
.au-section { padding-top: 8px; }

/* ---------- Konsole ---------- */
.au-console { background: var(--white); border: 1px solid var(--line-soft); border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: 20px; }
@media (min-width: 960px) { .au-console { padding: 26px 32px 30px; } }

.au-top { display: flex; justify-content: space-between; align-items: center; gap: 14px 20px; flex-wrap: wrap; padding-bottom: 18px; border-bottom: 1px solid var(--line-soft); }
.au-shop { display: flex; align-items: center; gap: 12px; min-width: 0; }
.au-shop-mark { width: 40px; height: 40px; flex-shrink: 0; }
.au-shop-name { margin: 0; font-weight: 500; letter-spacing: -0.015em; line-height: 1.3; }
.au-shop-sub { margin: 0; font-size: 13px; color: var(--ink-3); }

/* Schalter */
.au-switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14px; color: var(--ink-2); user-select: none; }
.au-switch input { position: absolute; left: 0; top: 50%; width: 40px; height: 24px; margin: -12px 0 0; opacity: 0; cursor: pointer; }
.au-switch-track { position: relative; flex-shrink: 0; width: 40px; height: 24px; border-radius: 99px; background: var(--paper-2); border: 1px solid rgba(18, 18, 17, .2); transition: background-color .25s, border-color .25s; }
.au-switch-track span { position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 99px; background: var(--white); box-shadow: 0 1px 3px rgba(18, 18, 17, .3); transition: transform .3s var(--ease); }
.au-switch input:checked + .au-switch-track { background: var(--signal-ink); border-color: var(--signal-ink); }
.au-switch input:checked + .au-switch-track span { transform: translateX(16px); }
.au-switch input:focus-visible + .au-switch-track { outline: 2px solid var(--ink); outline-offset: 3px; }
.au-switch:hover .au-switch-track { border-color: rgba(18, 18, 17, .45); }
.au-switch input:disabled, .au-switch input:disabled ~ * { cursor: not-allowed; }
.au-switch input:disabled ~ * { opacity: .5; }
.au-switch-text { color: var(--ink); }

.au-manual-note { margin: 14px 0 0; padding: 10px 14px; border-radius: 12px; background: var(--signal-soft); color: var(--signal-ink); font-size: 14px; }

/* Steuerung */
.au-controls { display: grid; gap: 16px 32px; padding: 20px 0 4px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 960px) { .au-controls { grid-template-columns: minmax(0, 1fr) auto; align-items: start; } }
.au-scen { border: 0; margin: 0; padding: 0; min-width: 0; }
.au-legend { padding: 0; margin-bottom: 10px; font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.au-scen-list { display: flex; flex-wrap: wrap; gap: 8px; }
.au-chip { position: relative; display: inline-flex; }
.au-chip input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.au-chip span { display: inline-flex; align-items: center; height: 36px; padding: 0 15px; border-radius: 99px; border: 1px solid rgba(18, 18, 17, .15); background: var(--white); font-size: 14px; white-space: nowrap; transition: background-color .2s, border-color .2s, color .2s; }
.au-chip:hover span { border-color: rgba(18, 18, 17, .45); }
.au-chip input:checked + span { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.au-chip input:focus-visible + span { outline: 2px solid var(--ink); outline-offset: 2px; }
.au-scen-desc { margin: 12px 0 0; font-size: 14.5px; color: var(--ink-2); max-width: 68ch; min-height: 3.1em; }
.au-run-box { display: flex; flex-direction: column; align-items: stretch; gap: 8px; }
@media (min-width: 960px) { .au-run-box { align-items: flex-end; padding-top: 21px; } }
.au-run { min-width: 236px; }
.au-run[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }
.au-run[aria-disabled="true"]:hover .arrow { transform: none; }
.au-run-hint { margin: 0; font-size: 13px; color: var(--warn); min-height: 1.45em; }
@media (min-width: 960px) { .au-run-hint { text-align: right; max-width: 260px; } }

/* ---------- Ablaufgrafik ---------- */
.au-flow { position: relative; margin-top: 10px; padding: 18px 0 6px 16px; display: grid; grid-template-columns: minmax(0, 1fr); row-gap: 14px; }
.au-lines { position: absolute; left: 0; top: 0; overflow: visible; pointer-events: none; z-index: 0; }
.au-base { fill: none; stroke: rgba(18, 18, 17, .2); stroke-width: 1.5; transition: stroke .3s; }
.au-base.spur { stroke-dasharray: 3 4; }
.au-trail { fill: none; stroke: var(--ink); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.au-ghost { fill: none; stroke: none; }
.au-pulse { fill: var(--signal); stroke: var(--white); stroke-width: 2; }
.au-console.is-manual .au-base { stroke-dasharray: 1.5 6; stroke-linecap: round; stroke-width: 2; stroke: rgba(18, 18, 17, .3); }
.au-console.is-manual .au-trail { stroke: var(--signal); }

.au-station { position: relative; z-index: 1; display: flex; align-items: center; gap: 18px; min-width: 0; }
.au-node { position: relative; flex-shrink: 0; width: 56px; height: 56px; border-radius: 99px; background: var(--white); border: 1px solid rgba(18, 18, 17, .18); display: grid; place-items: center; color: var(--ink-2); transition: background-color .35s, border-color .35s, color .35s, box-shadow .35s; }
.au-node svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.au-check { position: absolute; right: -3px; top: -3px; width: 19px; height: 19px; border-radius: 99px; background: var(--ok); border: 2px solid var(--white); transform: scale(0); transition: transform .35s var(--ease); }
.au-check::after { content: ""; position: absolute; left: 5px; top: 2.5px; width: 4px; height: 7.5px; border: solid #fff; border-width: 0 1.7px 1.7px 0; transform: rotate(45deg); }
.au-branch .au-node { width: 46px; height: 46px; border-style: dashed; }
.au-branch .au-node svg { width: 21px; height: 21px; }

.au-station.is-done .au-node { background: var(--ink); border-color: var(--ink); border-style: solid; color: var(--paper); }
.au-station.is-done .au-check { transform: scale(1); }
.au-station.is-warn .au-node { border-color: var(--warn); border-style: solid; background: #fdf6ea; color: var(--warn); box-shadow: 0 0 0 5px var(--warn-soft); }
.au-station.is-flash .au-node { animation: au-flash 1.1s var(--ease); }
@keyframes au-flash { 0% { box-shadow: 0 0 0 0 rgba(255, 90, 31, .5); } 100% { box-shadow: 0 0 0 18px rgba(255, 90, 31, 0); } }

.au-st-text { min-width: 0; }
.au-st-no { margin: 0; font-family: var(--mono); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.au-st-name { margin: 1px 0 0; font-size: 16px; font-weight: 500; letter-spacing: -0.015em; line-height: 1.3; color: var(--ink-2); transition: color .3s; }
.au-st-desc { margin: 1px 0 0; font-size: 13px; line-height: 1.4; color: var(--ink-3); }
.au-st-out { margin: 4px 0 0; min-height: 1.45em; font-family: var(--mono); font-size: 11.5px; color: var(--ink-2); }
.au-st-out:empty::before { content: "\00a0"; }
.au-st-out.warn { color: var(--warn); }
.au-st-out.ok { color: var(--ok); }
.au-station.is-active .au-st-name, .au-station.is-done .au-st-name, .au-station.is-warn .au-st-name { color: var(--ink); }
.au-console.is-manual .au-st-desc { color: var(--signal-ink); }
.au-console.is-manual .au-branch .au-st-desc { color: var(--ink-3); }

/* schmal: senkrechter Ablauf, Ausnahmen eingerückt */
@media (max-width: 959px) {
  .au-branch { margin-left: 72px; }
  .au-branch .au-st-text { padding-left: 16px; }
}
.au-station.has-ticket .au-check { opacity: 0; }
/* breit: waagerechter Ablauf, Ausnahmen in der zweiten Reihe zwischen ihren Stationen */
@media (min-width: 960px) {
  .au-flow { grid-template-columns: repeat(12, minmax(0, 1fr)); row-gap: 22px; padding: 30px 0 4px; }
  .au-station { flex-direction: column; gap: 12px; text-align: center; grid-row: 1; }
  .au-st-text { max-width: calc(100% - 26px); }
  .au-station[data-id="shop"] { grid-column: 1 / span 2; }
  .au-station[data-id="pruefung"] { grid-column: 3 / span 2; }
  .au-station[data-id="buchhaltung"] { grid-column: 5 / span 2; }
  .au-station[data-id="lager"] { grid-column: 7 / span 2; }
  .au-station[data-id="versand"] { grid-column: 9 / span 2; }
  .au-station[data-id="kunde"] { grid-column: 11 / span 2; }
  .au-station[data-id="klaerung"] { grid-column: 4 / span 2; grid-row: 2; }
  .au-station[data-id="einkauf"] { grid-column: 8 / span 2; grid-row: 2; }
}

/* Bestellkarte */
.au-ticket { position: absolute; left: 0; top: 0; z-index: 3; width: 108px; height: 52px; padding: 7px 11px; border-radius: 12px; background: var(--white); border: 1px solid rgba(18, 18, 17, .14); box-shadow: 0 12px 26px -12px rgba(18, 18, 17, .5); display: flex; flex-direction: column; justify-content: center; gap: 1px; opacity: 0; pointer-events: none; transition: opacity .3s, box-shadow .3s, border-color .3s; will-change: transform; }
.au-ticket.is-on { opacity: 1; }
.au-tk-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.au-tk-no { font-family: var(--mono); font-size: 11px; color: var(--ink-3); }
.au-tk-dot { width: 7px; height: 7px; border-radius: 99px; background: var(--signal); flex-shrink: 0; }
.au-tk-sum { font-size: 15px; font-weight: 500; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.au-ticket.is-working { border-color: var(--signal); box-shadow: 0 12px 26px -12px rgba(18, 18, 17, .5), 0 0 0 4px var(--signal-soft); }
.au-ticket.is-working .au-tk-dot { animation: au-blink .9s ease-in-out infinite; }
.au-ticket.is-waiting { border-color: var(--warn); box-shadow: 0 12px 26px -12px rgba(18, 18, 17, .5), 0 0 0 4px var(--warn-soft); }
.au-ticket.is-waiting .au-tk-dot { background: var(--warn); animation: au-blink 1.6s ease-in-out infinite; }
.au-ticket.is-done .au-tk-dot { background: var(--ok); }
.au-ticket.is-cancelled .au-tk-dot { background: var(--err); }
.au-ticket.is-cancelled .au-tk-sum { text-decoration: line-through; color: var(--ink-3); }
@keyframes au-blink { 50% { opacity: .25; } }
@media (max-width: 959px) {
  .au-ticket { width: 90px; height: 48px; padding: 6px 9px; }
  .au-tk-sum { font-size: 14px; }
}

/* Aktuelle Bestellung */
.au-order { margin-top: 18px; padding: 14px 16px; border-radius: var(--radius); background: var(--paper); border: 1px solid var(--line-soft); }
.au-order:focus { outline: none; }
.au-order:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.au-order-empty { margin: 0; font-size: 14px; color: var(--ink-3); }
.au-order-dl { margin: 0; display: grid; gap: 12px 20px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.au-order-dl dt { font-family: var(--mono); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.au-order-dl dd { margin: 2px 0 0; font-size: 14px; }
.au-order-dl .au-o-items { grid-column: 1 / -1; }
@media (min-width: 960px) {
  .au-order-dl { grid-template-columns: auto auto minmax(0, 1fr) auto auto auto; gap: 12px 28px; }
  .au-order-dl .au-o-items { grid-column: auto; }
}

/* Aufgabe */
.au-task { margin-top: 14px; padding: 18px; border-radius: var(--radius); border: 1px solid rgba(154, 91, 0, .35); background: #fdf6ea; animation: kit-in .5s var(--ease) both; scroll-margin: 90px 0 24px; }
.au-task.is-neutral { border-color: var(--line); background: var(--sheet); }
.au-task-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.au-task-no { font-family: var(--mono); font-size: 12px; color: var(--ink-3); }
.au-task h3 { margin: 10px 0 0; font-size: 19px; font-weight: 500; letter-spacing: -0.02em; }
.au-task h3:focus { outline: none; }
.au-task h3:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.au-task p { margin: 6px 0 0; color: var(--ink-2); font-size: 14.5px; max-width: 72ch; }
.au-task-grid { display: grid; gap: 12px; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 14px; max-width: 640px; }
.au-task-grid .f-street { grid-column: 1 / span 2; }
.au-task-grid .f-city { grid-column: 2 / span 2; }
.au-task-items { list-style: none; margin: 12px 0 0; padding: 0; max-width: 460px; font-size: 14px; }
.au-task-items li { display: flex; justify-content: space-between; gap: 16px; padding: 7px 0; border-bottom: 1px solid rgba(18, 18, 17, .1); }
.au-task-items li:last-child { border-bottom: 0; font-weight: 500; }
.au-task-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 16px; }
.au-task-actions .hint { margin: 0; }
.au-task .error { margin: 8px 0 0; }
@media (max-width: 639px) {
  .au-task { padding: 16px; }
  .au-task-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .au-task-grid .f-street, .au-task-grid .f-city { grid-column: 1 / -1; }
  .au-task-actions .btn { white-space: normal; height: auto; min-height: 44px; padding: 10px 20px; line-height: 1.3; text-align: left; }
}

/* ---------- Protokoll, Zähler, Regeln ---------- */
.au-grid { display: grid; gap: 20px; margin-top: 20px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1100px) { .au-grid { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); align-items: stretch; } }
.au-logcard, .au-card { background: var(--sheet); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 20px; min-width: 0; }
@media (min-width: 960px) { .au-logcard, .au-card { padding: 24px; } }
.au-logcard { display: flex; flex-direction: column; }
.au-side { display: grid; gap: 20px; align-content: start; min-width: 0; }
.au-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 16px; }
.au-card-sub { margin: 3px 0 0; font-size: 13px; color: var(--ink-3); }

.au-log { list-style: none; margin: 0; padding: 0; height: 380px; overflow-y: auto; background: var(--white); border: 1px solid var(--line-soft); border-radius: var(--radius); font-size: 13.5px; overscroll-behavior: contain; }
@media (min-width: 1100px) { .au-log { flex: 1 1 auto; height: 0; min-height: 420px; } }
.au-log li { display: grid; grid-template-columns: 66px 98px minmax(0, 1fr); gap: 2px 12px; padding: 8px 14px; border-bottom: 1px solid var(--line-soft); line-height: 1.45; animation: au-row .45s var(--ease) both; }
.au-log li:last-child { border-bottom: 0; }
.au-log time { font-family: var(--mono); font-size: 12px; color: var(--ink-3); padding-top: 1px; font-variant-numeric: tabular-nums; }
.au-sys { font-family: var(--mono); font-size: 12px; color: var(--ink-2); padding-top: 1px; overflow-wrap: anywhere; }
.au-msg { min-width: 0; overflow-wrap: anywhere; }
.au-msg::before { content: ""; display: inline-block; width: 6px; height: 6px; margin: 0 8px 1px 0; border-radius: 99px; background: rgba(18, 18, 17, .25); vertical-align: middle; }
.au-log .lv-ok .au-msg::before { background: var(--ok); }
.au-log .lv-warn .au-msg::before { background: #c27c00; }
.au-log .lv-err .au-msg::before { background: var(--err); }
.au-log .lv-hand .au-msg::before { display: none; }
.au-hand { display: inline-flex; align-items: center; height: 19px; padding: 0 7px; margin-right: 8px; border-radius: 99px; background: var(--signal-soft); color: var(--signal-ink); font-family: var(--mono); font-size: 10.5px; letter-spacing: .04em; text-transform: uppercase; vertical-align: 1px; }
.au-log li.au-sep { display: block; padding: 7px 14px; background: var(--paper); font-family: var(--mono); font-size: 11.5px; letter-spacing: .04em; color: var(--ink-2); }
.au-log li.au-sep::before { content: ""; display: inline-block; width: 14px; height: 1px; margin-right: 8px; background: var(--ink-3); vertical-align: middle; }
@keyframes au-row { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@media (max-width: 640px) {
  .au-log li { grid-template-columns: auto minmax(0, 1fr); padding: 8px 12px; }
  .au-msg { grid-column: 1 / -1; }
}

/* Zähler */
.au-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.au-stat { background: var(--white); padding: 14px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.au-stat-val { font-size: 30px; font-weight: 500; letter-spacing: -0.035em; line-height: 1.05; display: inline-block; transform-origin: left bottom; }
.au-stat-label { font-size: 12.5px; color: var(--ink-3); line-height: 1.3; }
.au-saved { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.au-saved-label { margin: 0; font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.au-saved-val { margin: 4px 0 10px; font-size: 30px; font-weight: 500; letter-spacing: -0.035em; line-height: 1.1; transform-origin: left bottom; }
.au-assume { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; font-size: 14px; color: var(--ink-2); }
.au-mini-input { width: 78px; height: 36px; padding: 0 10px; font-variant-numeric: tabular-nums; }
.bump { animation: au-bump .5s var(--ease); }
@keyframes au-bump { 0% { transform: scale(1); } 35% { transform: scale(1.14); } 100% { transform: scale(1); } }

/* Regeln */
.au-rule { margin-bottom: 14px; }
.au-unit { position: relative; display: flex; align-items: center; }
.au-unit .input { padding-right: 64px; font-variant-numeric: tabular-nums; }
.au-unit span { position: absolute; right: 14px; color: var(--ink-3); font-size: 14px; pointer-events: none; }
.au-rules .check { margin-top: 10px; }
.au-stock-title { margin: 22px 0 6px; font-size: 14px; font-weight: 500; }
.au-stock { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.au-stock th { text-align: left; font-weight: 500; font-size: 12px; color: var(--ink-3); padding: 6px 0; border-bottom: 1px solid var(--line); }
.au-stock td { padding: 8px 0; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.au-stock tr:last-child td { border-bottom: 0; }
.au-stock .r { text-align: right; white-space: nowrap; }
.au-stock .badge { height: 20px; padding: 0 8px; font-size: 11.5px; margin-right: 8px; }
.au-stock .n { display: inline-block; min-width: 2.2ch; font-variant-numeric: tabular-nums; font-weight: 500; }
.au-stock tr.is-changed td { animation: au-rowflash 1.4s ease-out; }
@keyframes au-rowflash { 0% { background: var(--signal-soft); } 100% { background: transparent; } }

/* ---------- Umsetzung ---------- */
.au-how { border-top: 1px solid var(--line); padding-top: 64px; }
.au-how-grid { display: grid; gap: 28px; margin-top: 32px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) { .au-how-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px; } }
.au-how-grid > div { border-top: 1px solid var(--ink); padding-top: 16px; }
.au-how-no { margin: 0 0 10px; font-family: var(--mono); font-size: 12px; color: var(--signal-ink); }
.au-how-grid p:not(.au-how-no) { margin: 8px 0 0; color: var(--ink-2); }
.au-how-cta { margin-top: 44px; display: flex; gap: 16px 24px; align-items: center; flex-wrap: wrap; }
.au-how-cta p { margin: 0; }

/* Kopfzeile: auf mittleren Breiten Platz für den Seitennamen lassen */
@media (max-width: 960px) { .demo-bar .demo-tag { display: none; } }
