















.sc, .schau {
  --sc-grund: #0a0a0c;
  --sc-text: #f5f5f7;
  --sc-text-dim: rgba(245, 245, 247, 0.6);
  --sc-flaeche: rgba(255, 255, 255, 0.1);
  --sc-flaeche-hover: rgba(255, 255, 255, 0.18);
  --sc-flaeche-aktiv: rgba(255, 255, 255, 0.26);
  --sc-kante: rgba(255, 255, 255, 0.1);
  --sc-blau: #0a84ff;
  --sc-blau-flaeche: #0a6fdb;
  --sc-gruen: #30d158;
  --sc-rot: #ff6961;
}




body.sc-offen { overflow: hidden; }
.sc button, .schau button, .fo button, .sc select {
  touch-action: manipulation; -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.sc, .schau {
  position: fixed; inset: 0; z-index: var(--z-vollbild);
  display: flex; flex-direction: column;
  background: var(--sc-grund); color: var(--sc-text);
  padding: env(safe-area-inset-top) env(safe-area-inset-right)
           env(safe-area-inset-bottom) env(safe-area-inset-left);
}
.schau { z-index: calc(var(--z-vollbild) + 20); }


.sc :focus-visible, .schau :focus-visible, .fo :focus-visible {
  outline: 2px solid var(--sc-blau); outline-offset: 2px;
}

.sc-kopf, .fo-kopf {
  flex: 0 0 auto; display: flex; align-items: center; gap: var(--s3);
  padding: var(--s3) var(--s4); border-bottom: 1px solid var(--sc-kante);
}
.sc-titel { flex: 1; min-width: 0; text-align: center; line-height: 1.25; }
.sc-titel strong { display: block; font-size: var(--fs-lg); font-weight: 600; }
.sc-titel span { font-size: var(--fs-sm); color: var(--sc-text-dim); }
.sc-platzhalter { width: var(--h-ziel); flex: 0 0 auto; }
.sc-rund {
  flex: 0 0 auto; width: var(--h-ziel); height: var(--h-ziel);
  display: grid; place-items: center;
  border: none; border-radius: var(--r-pill); cursor: pointer;
  background: var(--sc-flaeche); color: var(--sc-text);
}
.sc-rund:hover { background: var(--sc-flaeche-hover); }
.sc-rund:active { background: var(--sc-flaeche-aktiv); }





.sc-mitte { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.sc-buehne {
  position: relative; flex: 1 1 auto; min-width: 0; min-height: 0;
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.sc-buehne video { width: 100%; height: 100%; object-fit: contain; display: block; }
.sc-status {
  position: absolute; left: 50%; bottom: var(--s4); transform: translateX(-50%);
  margin: 0; padding: var(--s2) var(--s5); border-radius: var(--r-pill); white-space: nowrap;
  font-size: var(--fs-bd); font-weight: 500; background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(10px); border: 1px solid var(--sc-kante);
}
.sc-status.warnt { background: rgba(255, 159, 10, 0.92); color: #1a1a1a; border-color: transparent; }



.sc-leer {
  position: absolute; inset: 0; z-index: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--s3);
  margin: 0 auto; padding: var(--s6); max-width: 26.25rem; text-align: center;
  font-size: var(--fs-lg); line-height: 1.5; color: var(--sc-text-dim);
}
.sc-leer strong { color: var(--sc-text); font-size: var(--fs-xl); font-weight: 600; line-height: 1.3; }
.sc-leer-zeichen {
  display: grid; place-items: center; width: 64px; height: 64px; margin-bottom: var(--s1);
  border-radius: var(--r-pill); background: var(--sc-flaeche); color: var(--sc-text);
}
.sc-leer-text { font-size: var(--fs-bd); }

.fo-leiste .btn { white-space: nowrap; padding-inline: var(--s3); }
@media (max-width: 359px) { .fo-leiste .btn svg { display: none; } }

.sc-leer .sc-nativ { min-height: 52px; margin-top: var(--s2); padding-inline: var(--s6);
                     font-size: var(--fs-lg); background: var(--sc-blau-flaeche); border-color: var(--sc-blau-flaeche); color: #fff; }
.sc-leer .sc-nativ:hover { background: #0959b8; border-color: #0959b8; }




.sc-kamera {
  position: absolute; right: var(--s3); top: var(--s3);
  min-height: var(--h-ziel);
  background: rgba(0, 0, 0, 0.6); color: var(--sc-text); font-size: var(--fs-sm);
  border: 1px solid var(--sc-kante); border-radius: var(--r-sm); padding: var(--s1) var(--s2);
  max-width: min(62%, 15rem);
}


.sc-kamera option, .sc-kamera optgroup { background: #1a1a1c; color: #f5f5f7; }
.sc-blitz {
  position: absolute; inset: 0; background: #fff; pointer-events: none;
  animation: sc-blitz var(--tempo-lang) ease-out forwards;
}
@keyframes sc-blitz { from { opacity: 0.9; } to { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .sc-blitz { display: none; } }








.fo {
  position: fixed; inset: 0; z-index: 5; display: none;
  flex-direction: column; background: var(--sc-grund); color: var(--sc-text);
  --sc-text: #f5f5f7;
  --sc-text-dim: rgba(245, 245, 247, 0.6);
  --sc-flaeche: rgba(255, 255, 255, 0.1);
  --sc-flaeche-hover: rgba(255, 255, 255, 0.18);
  --sc-flaeche-aktiv: rgba(255, 255, 255, 0.26);
  --sc-kante: rgba(255, 255, 255, 0.1);
  --sc-blau: #0a84ff;
  --sc-blau-flaeche: #0a6fdb;
  --sc-rot: #ff6961;
  padding: env(safe-area-inset-top) env(safe-area-inset-right)
           env(safe-area-inset-bottom) env(safe-area-inset-left);
}
.fo.offen { display: flex; }
.fo-kopf strong { font-size: var(--fs-lg); font-weight: 600; }
.fo-raster {
  flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
  display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s3);
  padding: var(--s3) var(--s4); align-content: start;
}
.fo-leer {
  flex: 1 1 auto; display: grid; place-content: center; text-align: center;
  margin: 0; padding: var(--s6); font-size: var(--fs-bd); line-height: 1.6;
  color: var(--sc-text-dim);
}
.fo-leiste {
  flex: 0 0 auto; display: flex; gap: var(--s3); padding: var(--s3) var(--s4) var(--s4);
  border-top: 1px solid var(--sc-kante);
}



.fo-leiste .btn {
  flex: 1; justify-content: center; min-height: var(--h-ziel);
  background: var(--sc-flaeche); color: var(--sc-text); border-color: var(--sc-kante);
}
.fo-leiste .btn:hover { background: var(--sc-flaeche-hover); border-color: var(--sc-kante); }
.fo-leiste .btn:active { background: var(--sc-flaeche-aktiv); }
.fo-leiste .btn-primary { background: var(--sc-blau-flaeche); border-color: var(--sc-blau-flaeche); color: #fff; }
.fo-leiste .btn-primary:hover { background: #0959b8; border-color: #0959b8; }


.fo-kachel {
  display: flex; flex-direction: column; gap: var(--s2); border-radius: var(--r-lg);
  background: rgba(255, 255, 255, 0.06); padding: var(--s2);
}
.fo-kachel.zieht { opacity: 0.4; }
.fo-bild {
  position: relative; display: block; width: 100%; padding: 0; border: none;
  border-radius: var(--r-sm); overflow: hidden; background: #fff; cursor: pointer;
  aspect-ratio: 3 / 4; touch-action: manipulation;
}
.fo-bild img { width: 100%; height: 100%; object-fit: cover; display: block; }
.fo-bild .nr {
  position: absolute; left: var(--s2); top: var(--s2); min-width: 22px; padding: var(--s0) var(--s2);
  border-radius: var(--r-pill); background: rgba(0, 0, 0, 0.72); color: #fff;
  font-size: var(--fs-sm); font-weight: 600; font-variant-numeric: tabular-nums;
}
.fo-bild:active { opacity: 0.8; }



.fo-marke {
  position: absolute; right: var(--s2); top: var(--s2);
  display: grid; place-items: center; width: 22px; height: 22px; border-radius: var(--r-pill);
  background: rgba(0, 0, 0, 0.72); color: #fff; pointer-events: none;
}


.fo-bild::after {
  content: ""; position: absolute; right: var(--s2); bottom: var(--s2);
  width: 26px; height: 26px; border-radius: var(--r-pill); pointer-events: none;
  background: rgba(0, 0, 0, 0.6) center/14px 14px no-repeat;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.5' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E");
}



.fo-knoepfe { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s0); }
.fo-knopf {
  height: var(--h-ziel); display: grid; place-items: center; padding: 0; cursor: pointer;
  border: none; border-radius: var(--r-sm); background: none;
  color: rgba(245, 245, 247, 0.85); touch-action: manipulation;
}
.fo-knopf:hover { background: var(--sc-flaeche-hover); }
.fo-knopf:active { background: var(--sc-flaeche-aktiv); }
.fo-knopf:disabled { opacity: var(--deckkraft-aus); cursor: default; background: none; }
.fo-knopf.gefahr { color: var(--sc-rot); }


.sc-leiste, .schau-leiste {
  flex: 0 0 auto; display: grid; grid-template-columns: 1fr auto 1fr;
  align-items: center; gap: var(--s3); padding: var(--s4) var(--s5) var(--s5);
}
.schau-leiste { grid-template-columns: repeat(5, 1fr); }
.schnitt-leiste { grid-template-columns: repeat(4, 1fr); }




@media (max-width: 599px) {
  .schau-leiste { grid-template-columns: repeat(3, 1fr); gap: var(--s1);
                  padding-bottom: var(--s4); }
  .schnitt-leiste { grid-template-columns: repeat(2, 1fr); gap: var(--s1);
                    padding-bottom: var(--s4); }
}
.sc-neben {
  display: flex; flex-direction: column; align-items: center; gap: var(--s1);
  min-width: 68px; min-height: 58px; padding: var(--s2); cursor: pointer;
  border: none; border-radius: var(--r-lg); background: none;
  color: rgba(245, 245, 247, 0.85); font-size: var(--fs-sm);
}
.sc-neben:hover { background: var(--sc-flaeche); }


.sc-neben:active { background: var(--sc-flaeche-aktiv); }
.sc-neben:disabled { opacity: var(--deckkraft-aus); cursor: default; }
.sc-neben:disabled:hover { background: none; }
.sc-neben.gefahr { color: var(--sc-rot); }


.sc-neben.haupt { color: var(--sc-blau); }
.sc-neben:last-child { justify-self: end; }
.schau-leiste .sc-neben { justify-self: center; }
.sc-zaehler {
  min-width: 26px; height: 22px; line-height: 22px; padding: 0 var(--s2);
  border-radius: var(--r-pill);
  background: var(--sc-gruen); color: #08240f; font-weight: 600; font-size: var(--fs-sm);
  font-variant-numeric: tabular-nums;
}
.sc-neben:disabled .sc-zaehler { background: rgba(255, 255, 255, 0.2); color: #fff; }


.sc-ausloeser {
  justify-self: center; width: 72px; height: 72px; padding: 0; cursor: pointer;
  display: grid; place-items: center; border-radius: var(--r-pill);
  border: 4px solid rgba(255, 255, 255, 0.9); background: transparent;
}
.sc-ausloeser .kern {
  width: 56px; height: 56px; border-radius: var(--r-pill); background: #fff;
  transition: transform var(--tempo) ease;
}
.sc-ausloeser:active .kern { transform: scale(0.85); }
.sc-ausloeser:disabled { opacity: var(--deckkraft-aus); cursor: default; }


.schau-buehne {
  position: relative; flex: 1 1 auto; min-height: 0;
  display: flex; align-items: center; justify-content: center; padding: var(--s3);
}
.schau-buehne img {
  max-width: 100%; max-height: 100%; object-fit: contain;
  border-radius: var(--r-sm); background: #fff; box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
}
.schau-pfeil {
  position: absolute; top: 50%; left: var(--s2); transform: translateY(-50%);
  width: 48px; height: 64px; display: grid; place-items: center; cursor: pointer;
  border: none; border-radius: var(--r-lg); color: #fff;
  background: rgba(0, 0, 0, 0.45); backdrop-filter: blur(8px);
}
.schau-pfeil.rechts { left: auto; right: var(--s2); }
.schau-pfeil:disabled { opacity: var(--deckkraft-aus); cursor: default; }





.schnitt { z-index: calc(var(--z-vollbild) + 25); }
.schnitt-buehne {
  position: relative; flex: 1 1 auto; min-height: 0;
  display: flex; align-items: center; justify-content: center;
  padding: var(--s4); overflow: hidden;
}
.schnitt-buehne img {
  position: relative; z-index: 1;
  max-width: 100%; max-height: 100%; object-fit: contain; display: block;
  background: #fff; user-select: none; -webkit-user-drag: none;



  transform-origin: center center;
}


.schnitt-blatt { position: absolute; z-index: 0; background: #fff; }
.schnitt-rahmen {
  position: absolute; z-index: 2; left: 0; top: 0; width: 0; height: 0; box-sizing: border-box;
  border: 2px solid #fff; cursor: move; touch-action: none;


  box-shadow: 0 0 0 100vmax rgba(0, 0, 0, 0.55);





  background-image:
    linear-gradient(to right, rgba(255, 255, 255, 0.28) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.28) 1px, transparent 1px);
  background-size: calc(100% / 3) 100%, 100% calc(100% / 3);
  background-position: 0 0;
}
.schnitt-griff {
  position: absolute; width: 34px; height: 34px; touch-action: none;
}


.schnitt-griff::after {
  content: ""; position: absolute; left: 50%; top: 50%;
  transform: translate(-50%, -50%); border-radius: var(--r-pill);
}
.g-ol::after, .g-or::after, .g-ul::after, .g-ur::after {
  width: 16px; height: 16px; border: 3px solid #fff; border-radius: var(--r-xs);
}
.g-ol::after { border-right: none; border-bottom: none; }
.g-or::after { border-left: none; border-bottom: none; }
.g-ul::after { border-right: none; border-top: none; }
.g-ur::after { border-left: none; border-top: none; }
.g-o::after, .g-u::after { width: 26px; height: 4px; background: #fff; }
.g-l::after, .g-r::after { width: 4px; height: 26px; background: #fff; }
.g-ol { left: -17px; top: -17px; cursor: nwse-resize; }
.g-or { right: -17px; top: -17px; cursor: nesw-resize; }
.g-ul { left: -17px; bottom: -17px; cursor: nesw-resize; }
.g-ur { right: -17px; bottom: -17px; cursor: nwse-resize; }
.g-o { left: 50%; top: -17px; margin-left: -17px; cursor: ns-resize; }
.g-u { left: 50%; bottom: -17px; margin-left: -17px; cursor: ns-resize; }
.g-l { top: 50%; left: -17px; margin-top: -17px; cursor: ew-resize; }
.g-r { top: 50%; right: -17px; margin-top: -17px; cursor: ew-resize; }




.schnitt-regler {
  flex: 0 0 auto; display: flex; align-items: center; gap: var(--s3);
  padding: var(--s2) var(--s5) 0;
}
.schnitt-regler label { flex: 0 0 auto; font-size: var(--fs-sm); color: var(--sc-text-dim); }




.schnitt-regler input[type="range"] {
  flex: 1 1 auto; min-width: 0; height: var(--h-ziel);
  -webkit-appearance: none; appearance: none; background: none; cursor: pointer;
  --von: 50%; --bis: 50%;
}
.schnitt-regler input[type="range"]::-webkit-slider-runnable-track {
  height: 4px; border-radius: var(--r-pill);
  background: linear-gradient(to right, var(--sc-kante) var(--von),
              var(--sc-blau) var(--von) var(--bis), var(--sc-kante) var(--bis));
}
.schnitt-regler input[type="range"]::-moz-range-track {
  height: 4px; border-radius: var(--r-pill);
  background: linear-gradient(to right, var(--sc-kante) var(--von),
              var(--sc-blau) var(--von) var(--bis), var(--sc-kante) var(--bis));
}


.schnitt-regler input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 22px; height: 22px; margin-top: -9px;
  border: none; border-radius: var(--r-pill); background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
}
.schnitt-regler input[type="range"]::-moz-range-thumb {
  width: 22px; height: 22px; border: none; border-radius: var(--r-pill); background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
}
.schnitt-null {
  flex: 0 0 auto; min-width: 66px; min-height: var(--h-ziel-klein); padding: 0 var(--s2);
  border: 1px solid var(--sc-kante); border-radius: var(--r-pill);
  background: var(--sc-flaeche); color: var(--sc-text); cursor: pointer;
  font: inherit; font-size: var(--fs-sm); font-variant-numeric: tabular-nums;
}
.schnitt-null:hover { background: var(--sc-flaeche-hover); }
.schnitt-null:disabled {
  background: none; border-color: transparent; color: var(--sc-text-dim); cursor: default;
}


.schluss {
  position: fixed; inset: 0; z-index: calc(var(--z-vollbild) + 30); display: flex;
  align-items: flex-end; justify-content: center; background: rgba(0, 0, 0, 0.6);
}
.schluss-box {
  width: min(560px, 100%); display: flex; flex-direction: column; gap: var(--s1);
  background: var(--bg-panel); color: var(--text);
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  padding: var(--s6) var(--s5) calc(var(--s5) + env(safe-area-inset-bottom));
}
.schluss-box h2 { margin: 0; font-size: var(--fs-2xl); }
.schluss-knoepfe { display: flex; gap: var(--s2); flex-wrap: wrap; margin-top: var(--s4); }
.schluss-knoepfe .btn { flex: 1 1 auto; min-height: var(--h-ziel); justify-content: center; }


@media (min-width: 900px) {
  .sc-mitte { flex-direction: row; }



  .fo {
    position: static; display: flex; width: 272px; flex: 0 0 272px;
    border-left: 1px solid var(--sc-kante); padding: 0;
  }
  .fo-zurueck { display: none; }
  .fo-raster { grid-template-columns: 1fr; }
  .schluss { align-items: center; }
  .schluss-box { border-radius: var(--r-xl); }
  .schau-buehne { --ausloeser-breite: 72px; padding: var(--s6) var(--ausloeser-breite); }
}







.leer-zustand.fehler-zustand { display: flex; flex-direction: column; align-items: center;
                               gap: var(--s1); }
.leer-zustand.fehler-zustand strong { color: var(--danger); }





.fo-kachel.kaputt .fo-bild { background: var(--sc-flaeche); }
.fo-kachel.kaputt .fo-bild::before {
  content: "Bild defekt"; position: absolute; inset: 0;
  display: grid; place-content: center; text-align: center; padding: var(--s2);
  color: var(--sc-rot); font-size: var(--fs-sm); font-weight: 600;
}
.schau-buehne img.kaputt {
  width: min(280px, 80%); height: 120px; background: var(--sc-flaeche);
  border: 1px dashed var(--sc-rot);
}


.sc-nochmal { margin-top: var(--s4); background: var(--sc-flaeche); color: var(--sc-text);
              border-color: var(--sc-kante); box-shadow: none; }
.sc-nochmal:hover { background: var(--sc-flaeche-hover); border-color: var(--sc-kante); }
