/* farbeleer.de: Druckbild-Doktor und Kartuschenwechsel (ergänzt assets/site.css) */
.app{margin-top:26px;border:2px solid var(--gray-mid);border-radius:10px;padding:22px;background:#fff;scroll-margin-top:12px}
.app[hidden],.app-only{display:none}
.js .app-only{display:block}
.app h2{margin-bottom:4px}
.app .sub{margin-bottom:16px}
.app-steps{display:flex;flex-wrap:wrap;gap:6px 14px;margin:0 0 16px;font-size:.88rem;color:var(--text-mid);list-style:none}
.app-steps li{display:flex;align-items:center;gap:6px}
.app-steps b{display:inline-flex;align-items:center;justify-content:center;width:22px;height:22px;border-radius:50%;background:var(--gray-mid);color:var(--text);font-size:.75rem}
.app-steps .on{color:var(--text);font-weight:700}.app-steps .on b{background:var(--red);color:#fff}
.app-steps .done b{background:var(--text);color:#fff}
.app-steps button{background:none;border:0;font:inherit;color:inherit;cursor:pointer;display:flex;align-items:center;gap:6px;padding:0}
.app-steps button:hover,.app-steps button:focus-visible{color:var(--red);outline:none;text-decoration:underline}

/* Abdruck-Kacheln */
.abdrucke{display:grid;grid-template-columns:repeat(4,1fr);gap:12px}
.atile{background:var(--gray-light);border:2px solid transparent;border-radius:8px;padding:10px;cursor:pointer;font-family:var(--font);color:var(--text);text-align:center;transition:border-color .15s,background .15s,transform .15s}
.atile:hover,.atile:focus-visible{border-color:var(--red);background:var(--red-soft);transform:translateY(-2px);outline:none}
.atile .abdruck{display:block;width:100%;height:auto;border-radius:4px;box-shadow:0 1px 3px rgba(0,0,0,.12);margin-bottom:8px}
.atile strong{display:block;font-size:1rem;line-height:1.2}
.atile small{display:block;color:var(--text-mid);font-size:.8rem}
.smoke{margin-top:14px;font-size:.95rem;color:var(--text-mid)}
.smoke button{background:none;border:0;color:var(--red);font:inherit;font-weight:700;cursor:pointer;text-decoration:underline;padding:0}

/* Antwort-Buttons */
.answers{display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:12px}
.answers .qtile{min-height:72px}
.mgrid{display:grid;grid-template-columns:repeat(4,1fr);gap:12px}
.mgrid .tile{width:100%}

/* Befund mit Ampel */
.befund{display:grid;grid-template-columns:auto 1fr;gap:22px;align-items:start}
.ampel{background:#2f2f31;border-radius:14px;padding:10px;display:flex;flex-direction:column;gap:8px}
.ampel i{width:34px;height:34px;border-radius:50%;background:#555;display:block;opacity:.35;transition:opacity .4s,box-shadow .4s}
.ampel .r.on{background:#e0242f;opacity:1;box-shadow:0 0 16px #e0242f}
.ampel .y.on{background:#f2b705;opacity:1;box-shadow:0 0 16px #f2b705}
.ampel .g.on{background:#2e9d4d;opacity:1;box-shadow:0 0 16px #2e9d4d}
.befund .tag{display:inline-block;font-size:.75rem;font-weight:700;letter-spacing:.04em;text-transform:uppercase;padding:3px 10px;border-radius:4px;margin-bottom:8px;color:#fff}
.tag.gruen{background:#2e7d43}.tag.gelb{background:#8a6a00}.tag.rot{background:var(--red)}
.befund h3{font-size:1.4rem;line-height:1.25;margin-bottom:6px}
.befund p{color:var(--text-mid);margin-bottom:10px}
.befund ol{margin:0 0 14px 20px;color:var(--text-mid)}
.befund ol li{margin-bottom:6px;padding-left:4px}
.fault{font-size:.85rem;color:var(--text-mid)}
.rec{background:var(--gray-light);border:1px solid var(--gray-mid);border-radius:6px;padding:14px 16px;margin:6px 0 14px}
.rec h4{font-size:1.05rem;margin-bottom:6px}
.rec .answers{margin-top:10px}
.rec .qtile{background:#fff}

/* Vorher-nachher-Regler */
.vn{margin-top:22px}
.vn-box{position:relative;max-width:520px;border-radius:8px;overflow:hidden;box-shadow:0 2px 8px rgba(0,0,0,.15);touch-action:pan-y}
.vn-box .abdruck{display:block;width:100%;height:auto}
.vn-after{position:absolute;inset:0;clip-path:inset(0 0 0 var(--cut,50%))}
.vn-line{position:absolute;top:0;bottom:0;left:var(--cut,50%);width:3px;margin-left:-1.5px;background:var(--red);pointer-events:none}
.vn-line::after{content:"";position:absolute;top:50%;left:50%;width:30px;height:30px;margin:-15px 0 0 -15px;border-radius:50%;background:var(--red);box-shadow:0 0 0 3px #fff}
.vn-lbl{display:flex;justify-content:space-between;max-width:520px;font-size:.85rem;color:var(--text-mid);margin-top:6px}
.vn input[type=range]{width:100%;max-width:520px;margin-top:8px;accent-color:var(--red)}

/* Kartuschenwechsel: Bühne */
.player{display:grid;grid-template-columns:1.1fr 1fr;gap:24px;align-items:center}
.stage{position:relative;background:#f7f7f8;border-radius:10px;overflow:hidden;aspect-ratio:4/3;touch-action:pan-y;user-select:none}
.progress{height:6px;background:var(--gray-mid);border-radius:3px;overflow:hidden;margin:0 0 8px}
.progress span{display:block;height:100%;background:var(--red);width:0;transition:width .35s}
.stepcount{font-size:.85rem;color:var(--text-mid);margin-bottom:4px}
.steptext{font-size:1.12rem;line-height:1.45;min-height:5.5em}
.steptip{background:var(--gray-light);border-radius:6px;padding:10px 12px;margin-top:10px;font-size:.92rem;color:var(--text-mid)}
.steptip:empty{display:none}
.ctrl{display:flex;flex-wrap:wrap;gap:10px;margin-top:16px;align-items:center}
.ctrl .btn[disabled]{opacity:.4;cursor:default}
.linkbtn{background:none;border:0;color:var(--text-mid);font:inherit;font-size:.95rem;cursor:pointer;text-decoration:underline;padding:6px 4px}
.linkbtn:hover,.linkbtn:focus-visible{color:var(--red);outline:none}
.stuck{display:inline-flex;align-items:center;gap:6px;margin-top:14px;color:var(--red);font-weight:700;text-decoration:none}
.stuck:hover{text-decoration:underline}
.swipehint{font-size:.8rem;color:var(--text-mid);text-align:center;margin-top:6px}
.done{text-align:center;padding:10px 0}
.done .tick{width:84px;height:84px;margin:0 auto 10px}
.done .tick circle{fill:#2e9d4d}
.done .tick path{fill:none;stroke:#fff;stroke-width:8;stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:80;stroke-dashoffset:80;animation:tick .6s .2s ease-out forwards}
@keyframes tick{to{stroke-dashoffset:0}}
.done .abdruck{max-width:320px;margin:14px auto;display:block;box-shadow:0 2px 8px rgba(0,0,0,.15);border-radius:6px}
.done h3{font-size:1.6rem}

/* Bilder je Schritt: weich überblenden, leicht heranzoomen */
.stage .pics img{position:absolute;inset:0;width:100%;height:100%;object-fit:contain;opacity:0;transition:opacity .6s ease}
.stage .pics img.on{opacity:1}
.stage .pics{position:absolute;inset:0;animation:zoom 7s ease-out forwards}
@keyframes zoom{from{transform:scale(1)}to{transform:scale(1.05)}}
.stage.a-align .pics,.stage.a-test .pics{animation:slidein .9s cubic-bezier(.3,.1,.2,1) both}
@keyframes slidein{from{transform:translateX(35%);opacity:0}to{transform:none;opacity:1}}
.stage .tap{position:absolute;width:46px;height:46px;margin:-23px 0 0 -23px;border-radius:50%;border:4px solid var(--red);animation:pulse 1.5s ease-out .4s infinite;opacity:0}
/* Tipp-Kreis nur auf dem ersten Bild (Maschinenfoto) */
.stage.later .tap{display:none}
@keyframes pulse{0%{transform:scale(.45);opacity:1}100%{transform:scale(1.5);opacity:0}}
.stage .busy{position:absolute;left:50%;bottom:12px;transform:translateX(-50%);display:flex;align-items:center;gap:8px;background:rgba(40,40,42,.86);color:#fff;font-size:.85rem;padding:6px 14px;border-radius:16px;white-space:nowrap;opacity:0;animation:fadein .4s 1.4s forwards}
.stage .busy i{width:14px;height:14px;border:2px solid #fff;border-top-color:transparent;border-radius:50%;animation:spin 1s linear infinite}
@keyframes fadein{to{opacity:1}}
@keyframes spin{to{transform:rotate(360deg)}}
.stage .dots{position:absolute;right:12px;bottom:12px;display:flex;gap:6px}
.stage .dots i{width:8px;height:8px;border-radius:50%;background:#c9c9cd;transition:background .3s}
.stage .dots i.on{background:var(--red)}
@media (prefers-reduced-motion:reduce){
  .stage *,.stage{transition:none!important;animation:none!important}
  .stage .tap,.stage .busy{opacity:1}
  .done .tick path{animation:none;stroke-dashoffset:0}
  .ampel i,.progress span{transition:none}
}

/* Textfassung (immer da, auch ohne JavaScript) */
.textfassung details{border:1px solid var(--gray-mid);border-radius:8px;padding:12px 16px;margin-top:10px}
.textfassung summary{font-weight:700;cursor:pointer}
.textfassung ol{margin:10px 0 4px 20px;color:var(--text-mid)}
.textfassung ol li{margin-bottom:6px}
.textfassung .src{font-size:.8rem;color:var(--text-mid);margin-top:8px}
.symlist{display:grid;grid-template-columns:repeat(2,1fr);gap:14px;margin-top:12px}
.sym{display:grid;grid-template-columns:120px 1fr;gap:12px;align-items:start;border:1px solid var(--gray-mid);border-radius:8px;padding:12px}
.sym .abdruck{width:100%;height:auto;border-radius:4px;box-shadow:0 1px 3px rgba(0,0,0,.12)}
.sym h3{font-size:1rem;margin-bottom:4px}
.sym p{font-size:.9rem;color:var(--text-mid)}
.order{counter-reset:o;list-style:none;display:flex;flex-wrap:wrap;gap:8px;margin-top:10px}
.order li{background:var(--gray-light);border-radius:20px;padding:6px 14px;font-size:.92rem}
.order li::before{counter-increment:o;content:counter(o) ". ";font-weight:700;color:var(--red)}

@media (max-width:860px){.abdrucke,.mgrid{grid-template-columns:repeat(3,1fr)}}
@media (max-width:720px){
  .app{padding:16px;margin-left:-6px;margin-right:-6px}
  .abdrucke,.mgrid{grid-template-columns:repeat(2,1fr)}
  .player{grid-template-columns:1fr;gap:14px}
  .steptext{min-height:0;font-size:1.02rem}
  .befund{grid-template-columns:1fr}
  .ampel{flex-direction:row;justify-self:start}
  .ampel i{width:26px;height:26px}
  .symlist{grid-template-columns:1fr}
  .sym{grid-template-columns:96px 1fr}
  .ctrl .btn{flex:1 1 auto;justify-content:center}
}

/* PostBase One als größte Maschine: füllt den Rest der letzten Reihe */
.mgrid .tile.wide{grid-column:span 2}
@media (max-width:860px){.mgrid .tile.wide{grid-column:1/-1}}
@media (max-width:720px){.mgrid .tile.wide{grid-column:span 2}}
@media (min-width:861px),(max-width:720px){.mgrid .tile.wide .pic{aspect-ratio:8/3}}
@media (min-width:721px) and (max-width:860px){.mgrid .tile.wide .pic{aspect-ratio:4/1}}
