/* ---------- Klick-Demos (abgespielte Produkt-Animationen) ---------- */
.dm__box { display: grid; grid-template-columns: 1.45fr 1fr; gap: 64px; align-items: center; padding: 56px; border-radius: var(--radius); background: #f1efea; }
.dm__stage { position: relative; padding: 0 0 44px; }
.dm__sheet { position: relative; width: 100%; background: #fff; border-radius: 14px; box-shadow: var(--shadow-s); padding: 10px; overflow: hidden; }
.dm__sheet svg { display: block; width: 100%; height: auto; }
.dm__scan { position: absolute; top: 0; bottom: 0; left: -30%; width: 22%; background: linear-gradient(90deg, rgba(245,197,24,0), rgba(245,197,24,.28), rgba(245,197,24,0)); opacity: 0; pointer-events: none; }
.dm--scan .dm__scan { opacity: 1; animation: dmScan 1.8s linear infinite; }
@keyframes dmScan { to { left: 110%; } }

.dm-ball { transform-box: fill-box; transform-origin: center; animation: dmPop .45s var(--ease) both; }
.dm-ball circle { fill: var(--accent); stroke: #1a1400; stroke-width: 1.2; }
.dm-ball text { font: 700 11px var(--sans); fill: #1a1400; text-anchor: middle; dominant-baseline: central; }
@keyframes dmPop { from { transform: scale(0); } 70% { transform: scale(1.18); } to { transform: scale(1); } }

.dm__panel { position: absolute; right: -6%; top: 3%; width: 44%; background: #fff; border-radius: 16px; border: 2px solid var(--accent); box-shadow: var(--shadow); padding: 14px 14px 12px; font-size: 12px; }
.dm__ph { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.dm__ph small { display: block; font-size: 9px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); }
.dm__ph b { font-size: 15px; }
.dm__count { min-width: 30px; height: 26px; padding: 0 8px; border-radius: 8px; display: grid; place-items: center; background: #fdf3cc; color: #8a6a00; font-weight: 800; font-size: 13px; transition: background .3s; }
.dm__row, .dm__thead { display: grid; grid-template-columns: 22px 1fr 1fr .7fr; gap: 6px; align-items: center; }
.dm__thead { padding: 0 4px 6px; border-bottom: 1px solid var(--line); font-size: 9px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); }
.dm__rows { height: 124px; overflow: hidden; scroll-behavior: smooth; }
.dm__row { padding: 5px 4px; border-bottom: 1px solid var(--line); animation: dmRow .5s var(--ease) both; }
.dm__row i { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: #1a1400; font-style: normal; font-weight: 800; font-size: 10px; }
.dm__row b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dm__row span { font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 11px; white-space: nowrap; }
.dm__row span + span { color: var(--soft); }
@keyframes dmRow { from { opacity: 0; transform: translateY(8px); background: #fff7d6; } 60% { background: #fff7d6; } to { opacity: 1; transform: none; background: transparent; } }
.dm__empty { height: 100%; display: grid; place-items: center; color: var(--faint); font-size: 12px; text-align: center; }

.dm__go { position: relative; overflow: hidden; width: 100%; height: 38px; margin-top: 12px; border: 0; border-radius: 10px; background: var(--ink); color: #fff; font-size: 12px; font-weight: 600; transition: background .3s, transform .15s; cursor: default; }
.dm__go span { position: relative; z-index: 1; }
.dm__bar { position: absolute; left: 0; bottom: 0; height: 4px; width: 0; background: var(--accent); }
.dm__go.is-down { transform: scale(.96); }
.dm__go.is-ok { background: var(--ok); }
.dm__go.is-cta { background: linear-gradient(135deg, var(--accent-2), var(--accent)); color: var(--accent-ink); }

.dm__pdf { position: absolute; left: 4%; bottom: 0; display: flex; align-items: center; gap: 12px; padding: 12px 18px 12px 12px; background: #fff; border-radius: 14px; box-shadow: var(--shadow); opacity: 0; transform: translateY(14px) scale(.96); transition: opacity .4s, transform .5s var(--ease); }
.dm__pdf.is-on { opacity: 1; transform: none; }
.dm__pdf em { width: 38px; height: 44px; border-radius: 6px; display: grid; place-items: center; background: #e5484d; color: #fff; font-style: normal; font-weight: 800; font-size: 10px; }
.dm__pdf b { display: block; font-size: 13px; }
.dm__pdf small { color: var(--ok); font-weight: 600; font-size: 12px; }

.dm__cursor { position: absolute; left: 0; top: 0; width: 22px; height: 22px; z-index: 5; pointer-events: none; transform: translate(var(--x, 105%), var(--y, 105%)); transition: transform .9s var(--ease), opacity .3s; opacity: 0; }
.dm__cursor.is-on { opacity: 1; }
.dm__cursor svg { width: 22px; height: 22px; filter: drop-shadow(0 2px 3px rgba(0,0,0,.3)); transition: transform .15s; }
.dm__cursor.is-down svg { transform: scale(.85); }
.dm--fade .dm__stage > * { transition: opacity .45s; opacity: 0 !important; }

.dm__eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--soft); }
.dm__text h2 { font-family: var(--display); font-weight: 760; font-size: clamp(28px, 1.2rem + 1.6vw, 40px); line-height: 1.1; letter-spacing: -.02em; margin-top: 14px; }
.dm__text p { margin-top: 18px; color: var(--soft); }
.dm__cta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 28px; }
.dm__note { display: block; margin-top: 16px; font-size: 12px; color: var(--faint); }

@media (max-width: 980px) {
  .dm__box { grid-template-columns: 1fr; gap: 36px; padding: 28px 18px; }
}
@media (max-width: 640px) {
  .dm__stage { padding-bottom: 0; }
  .dm__panel { right: 0; }
  .dm__panel { position: relative; width: 100%; top: auto; margin-top: 14px; }
  .dm__rows { height: 155px; }
  .dm__pdf { left: 8px; right: 8px; bottom: auto; top: 8px; padding: 8px 12px 8px 8px; transform: translateY(-10px); }
  .dm__pdf.is-on { transform: none; }
  .dm__pdf em { width: 30px; height: 36px; }
  .dm__pdf b { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .dm__pdf div { min-width: 0; }
  .dm__pdf small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  [data-demo="kalk"] .dm__panel { width: 100%; }
}

/* ---------- Kalkulation: Dateien hineinziehen, 3D-Teil, Werte, Staffelpreise ---------- */
.dm__drop { position: absolute; inset: 14px 40% 14px 14px; border: 2px dashed #cfd3d8; border-radius: 12px; display: grid; place-content: center; justify-items: center; gap: 8px; text-align: center; color: var(--faint); font-size: 13px; font-weight: 600; transition: opacity .4s, border-color .3s, background .3s; }
.dm__drop svg { width: 34px; height: 34px; }
.dm--over .dm__drop { border-color: var(--accent); background: #fffbea; color: #8a6a00; }
.dm--part .dm__drop { opacity: 0; }
.dm-part { opacity: 0; transform: translateY(12px) scale(.96); transform-box: fill-box; transform-origin: center; transition: opacity .6s, transform .8s var(--ease); }
.dm--part .dm-part { opacity: 1; transform: none; }
.dm-kdim { opacity: 0; transition: opacity .6s .1s; }
.dm--dims .dm-kdim { opacity: 1; }
.dm-mini { opacity: 0; transition: opacity .5s .3s; }
.dm--part .dm-mini { opacity: 1; }

.dm__file { position: absolute; left: 4%; bottom: 0; z-index: 4; display: grid; gap: 6px; transition: transform .95s var(--ease), opacity .35s; }
.dm__file div { display: flex; align-items: center; gap: 10px; padding: 8px 14px 8px 8px; background: #fff; border-radius: 12px; box-shadow: var(--shadow-s); font-size: 12px; font-weight: 600; white-space: nowrap; }
.dm__file em { width: 28px; height: 32px; border-radius: 5px; display: grid; place-items: center; font-style: normal; font-weight: 800; font-size: 8px; color: #fff; background: #3a6fd8; }
.dm__file div + div em { background: #e5484d; }
.dm__file.is-drag div { box-shadow: var(--shadow); }
.dm__file.is-gone { opacity: 0; }

.dm__kv { display: grid; grid-template-columns: 1fr auto; align-items: baseline; column-gap: 8px; padding: 5px 4px; border-bottom: 1px solid var(--line); animation: dmRow .5s var(--ease) both; }
.dm__kv b { font-weight: 600; white-space: nowrap; }
.dm__kv span { font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 11px; text-align: right; white-space: nowrap; }
.dm__kv small { margin-left: 6px; font-size: 8.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); }
.dm__rows--kv { height: auto; min-height: 120px; }
[data-demo="kalk"] .dm__panel { width: 47%; }
.dm__prices { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 10px; }
.dm__prices div { padding: 7px 8px; border-radius: 10px; background: #f6f5f1; opacity: .35; transition: opacity .4s, background .4s; }
.dm__prices small { display: block; font-size: 10px; color: var(--soft); }
.dm__prices b { font-size: 13px; white-space: nowrap; visibility: hidden; }
.dm--prices .dm__prices div { opacity: 1; background: #fff7d6; }
.dm--prices .dm__prices b { visibility: visible; }
.dm--prices .dm__prices div:nth-child(2) { transition-delay: .15s; }
.dm--prices .dm__prices div:nth-child(3) { transition-delay: .3s; }
@media (max-width: 640px) {
  .dm__drop { inset: 10px; }
  .dm__file { left: 8px; bottom: auto; top: 8px; }
}

/* ---------- Produktionsplanung: Plantafel mit Maschinenstatus ---------- */
[data-demo="plan"] .dm__sheet { padding: 0; }
[data-demo="plan"] .dm__panel { position: relative; top: auto; right: auto; width: 58%; margin: -34px -5% 0 auto; }
[data-demo="plan"] .dm__pdf { bottom: 30px; }
.dm-g { font-size: 11px; }
.dm-g__top { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.dm-g__top b { font-size: 13px; }
.dm-g__top small { color: var(--faint); font-weight: 600; }
.dm-g__head, .dm-g__row { display: grid; grid-template-columns: 128px 1fr; }
.dm-g__days { display: grid; grid-template-columns: repeat(5, 1fr); }
.dm-g__days span { padding: 7px 8px; font-size: 10px; font-weight: 700; color: var(--soft); border-left: 1px solid var(--line); }
.dm-g__days span.is-heute { color: #8a6a00; }
.dm-g__body { position: relative; }
.dm-g__row { height: 54px; border-top: 1px solid var(--line); transition: opacity .4s, background .4s; }
.dm-g__m { display: flex; flex-direction: column; justify-content: center; gap: 3px; padding: 0 12px; }
.dm-g__m b { font-size: 12px; white-space: nowrap; }
.dm-g__track { position: relative; background: repeating-linear-gradient(90deg, var(--line) 0 1px, transparent 1px 20%); transition: background .4s; }
.dm-g__row.is-no { opacity: .38; }
.dm-g__row.is-busy .dm-g__track { background-color: #fdeeee; }
.dm-g__row.is-ok { background: #ecf8f1; }
.dm-st { display: inline-flex; align-items: center; gap: 5px; font-size: 10px; font-weight: 700; }
.dm-st i { width: 7px; height: 7px; border-radius: 50%; }
.dm-st--run { color: #1f8a55; } .dm-st--run i { background: var(--ok); animation: dmPuls 1.6s infinite; }
.dm-st--set { color: #8a6a00; } .dm-st--set i { background: var(--accent); }
.dm-st--off { color: var(--faint); } .dm-st--off i { background: #c3c8cf; }
@keyframes dmPuls { 0% { box-shadow: 0 0 0 0 rgba(63,182,122,.6); } 70%, 100% { box-shadow: 0 0 0 6px rgba(63,182,122,0); } }
.dm-bar { position: absolute; top: 13px; bottom: 13px; display: flex; align-items: center; padding: 0 7px; border-radius: 7px; background: #e3e6ea; color: var(--ink); font-size: 10px; font-weight: 700; white-space: nowrap; overflow: hidden; }
.dm-bar--run { background: linear-gradient(90deg, #cdebd9 var(--p, 50%), #e3e6ea var(--p, 50%)); }
.dm-bar--new { background: linear-gradient(135deg, var(--accent-2), var(--accent)); color: var(--accent-ink); box-shadow: 0 6px 16px -6px rgba(245,197,24,.9); transform: scaleX(0); transform-origin: left; opacity: 0; transition: transform .8s var(--ease), opacity .3s; }
.dm--placed .dm-bar--new { transform: none; opacity: 1; }
.dm-g__now { position: absolute; top: 0; bottom: 0; left: calc(128px + (100% - 128px) * .08); width: 2px; background: #e5484d; }
.dm-g__now::before { content: ""; position: absolute; top: -4px; left: -3px; width: 8px; height: 8px; border-radius: 50%; background: #e5484d; }
.dm-g__due { position: absolute; top: 0; bottom: 0; left: calc(128px + (100% - 128px) * .74); border-left: 2px dashed #b8860b; opacity: 0; transition: opacity .5s; }
.dm-g__due span { position: absolute; top: 4px; right: 6px; padding: 3px 7px; border-radius: 6px; background: #fff7d6; color: #8a6a00; font-size: 10px; font-weight: 800; white-space: nowrap; box-shadow: var(--shadow-s); }
.dm--due .dm-g__due { opacity: 1; }
.dm-g__leg { display: flex; gap: 14px; padding: 10px 14px 44px; border-top: 1px solid var(--line); }
.dm__kv--ok span { color: #1f8a55; font-weight: 700; }
@media (max-width: 640px) {
  .dm-g__head, .dm-g__row { grid-template-columns: 92px 1fr; }
  .dm-g__now { left: calc(92px + (100% - 92px) * .08); }
  .dm-g__due { left: calc(92px + (100% - 92px) * .74); }
  .dm-g__m b { font-size: 10.5px; }
  .dm-bar { font-size: 9px; padding: 0 4px; }
  [data-demo="plan"] .dm__panel { width: 100%; margin: 14px 0 0; }
  [data-demo="plan"] .dm__pdf { bottom: auto; }
}

/* ---------- Prüfpläne: Prüfmittel, Ist-Werte, Abweichung ---------- */
.dm__thead--pp, .dm__row--pp { grid-template-columns: 22px .9fr 1.3fr .6fr; }
.dm__row--pp span small { display: block; font-family: var(--sans); font-size: 9px; color: var(--faint); }
.dm__row--pp em { font-style: normal; font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 11px; font-weight: 700; text-align: right; }
.dm__row--pp em.ok { color: #1f8a55; }
.dm__row--pp em.ok::after { content: " ✓"; }
.dm__row--pp em.nok { color: #c4282e; }
.dm__row--pp em.nok::after { content: " ✕"; }
.dm__row.is-nok { background: #fdeeee; animation: none; }
.dm__alarm { position: absolute; left: 4%; top: 6%; display: flex; align-items: center; gap: 10px; padding: 10px 14px 10px 10px; background: #fff; border-radius: 12px; box-shadow: var(--shadow); border-left: 4px solid #e5484d; opacity: 0; transform: translateY(-10px); transition: opacity .4s, transform .5s var(--ease); z-index: 3; }
.dm__alarm.is-on { opacity: 1; transform: none; }
.dm__alarm i { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: #e5484d; color: #fff; font-style: normal; font-weight: 800; }
.dm__alarm b { display: block; font-size: 12px; }
.dm__alarm small { font-size: 11px; color: var(--soft); }

/* ---------- Demo im Bildschirm oben auf der App-Seite ---------- */
.screen--demo main.dm--screen { display: block; padding: 18px 18px 58px; background: #f4f3ef; }
.dm--screen .dm__stage { padding-bottom: 36px; }
.dm--screen .dm__sheet { box-shadow: 0 1px 0 rgba(0,0,0,.04), 0 0 0 1px var(--line); }
.dm--screen .dm__panel { right: 0; width: 53%; }
.dm--screen [data-demo="plan"] .dm__panel { width: 56%; margin-right: 0; }
.dm--screen .dm__pdf { left: 0; max-width: 46%; }
.dm--screen .dm__pdf div { min-width: 0; }
.dm--screen .dm__pdf b, .dm--screen .dm__pdf small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.step { transition: box-shadow .4s, transform .4s var(--ease); }
.step.is-on { box-shadow: 0 0 0 2px var(--accent), var(--shadow-s); }
.step.is-on .n { background: var(--accent); color: var(--accent-ink); }
@media (max-width: 900px) {
  .screen--demo main.dm--screen { padding: 10px 10px 14px; }
  .dm--screen .dm__stage { padding-bottom: 0; }
}
@media (max-width: 640px) {
  .dm--screen .dm__panel, .dm--screen [data-demo="plan"] .dm__panel { width: 100%; margin: 12px 0 0; right: 0; }
  .dm--screen .dm__pdf { left: 8px; max-width: none; }
}

@media (prefers-reduced-motion: reduce) {
  .dm-ball, .dm__row, .dm__kv { animation: none; }
  .dm__cursor { display: none; }
}

/* ---------- App-Seite mit Klick-Demo: Text mittig, Demo direkt darunter (ohne Kärtchen) ---------- */
.p-hero--demo { padding: 120px 0 70px; }
.p-hero--demo .p-stage { margin-top: 40px; max-width: 960px; }
.p-hero--demo .p-stage .device { max-width: none; }
@media (max-width: 900px) { .p-hero--demo { padding-top: 110px; } .p-hero--demo .p-stage { margin-top: 32px; } }
.p-hero--demo .dm--screen [data-demo="kalk"], .p-hero--demo .dm--screen [data-demo="empb"], .p-hero--demo .dm--screen [data-demo="pruef"] { min-height: 470px; }
.p-hero--demo .dm--screen .dm__panel { width: 50%; font-size: 11px; padding: 12px 12px 10px; }
.p-hero--demo .dm--screen .dm__kv span, .p-hero--demo .dm--screen .dm__row span { font-size: 10px; }
.p-hero--demo .dm--screen .dm__kv small { margin-left: 4px; font-size: 7.5px; }
.p-hero--demo .dm--screen [data-demo="plan"] .dm__panel { width: 52%; margin-top: -64px; }
.p-hero--demo .dm--screen .dm-g__row { height: 44px; }
.p-hero--demo .dm--screen .dm-bar { top: 9px; bottom: 9px; }
@media (max-width: 1080px) {
  .p-hero--demo .dm--screen [data-demo="kalk"], .p-hero--demo .dm--screen [data-demo="empb"], .p-hero--demo .dm--screen [data-demo="pruef"] { min-height: 0; }
}
@media (max-width: 640px) {
  .p-hero--demo .dm--screen .dm__panel, .p-hero--demo .dm--screen [data-demo="plan"] .dm__panel { width: 100%; margin-top: 12px; }
}

[data-demo="pruef"] .dm__rows { height: 172px; }
