/* Scan-App (mobil): baut auf style.css / app-shell.css auf und ergänzt
   die mobspezifischen Elemente (Modus-Switch, Capture-Button, Touch-Canvases). */

.scan-main {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 760px;
  margin: 0 auto;
  padding: 1rem 0.75rem 3rem;
}

.mode-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin-top: 0.2rem;
}

.mode-btn {
  padding: 0.9rem 0.5rem;
  border: 1px solid #27344a;
  border-radius: 10px;
  background: #0f172a;
  color: #93a1b8;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  min-height: 48px;
}

.mode-btn.active {
  background: rgba(179, 33, 34, 0.16);
  border-color: var(--brand, #b32122);
  color: #e6ebf3;
}

/* Stepper: range + −/+ Tasten in einer Reihe (Touch-Ziele >= 44px) */
.stepper {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.step-btn {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border: 1px solid #27344a;
  border-radius: 10px;
  background: #0f172a;
  color: #e6ebf3;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}

.step-btn:active {
  background: rgba(179, 33, 34, 0.25);
  border-color: var(--brand, #b32122);
}

.lb-field .stepper input[type="range"] {
  flex: 1 1 auto;
  min-width: 0;
}

/* Strategie-/Empfindlichkeits-Readout unter den Reglern */
#readoutAuto {
  margin-top: -0.2rem;
}

.scan-hint {
  color: #93a1b8;
  font-size: 0.88rem;
  line-height: 1.5;
  margin: 0 0 0.6rem;
}

.scan-hint.small {
  font-size: 0.8rem;
  margin: 0 0 0.8rem;
}

.capture-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
}

.capture-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  border: 1px dashed var(--brand, #b32122);
  border-radius: 10px;
  background: rgba(179, 33, 34, 0.10);
  color: #e6ebf3;
  font-size: 1.05rem;
  font-weight: 600;
  cursor: pointer;
  min-height: 56px;
  user-select: none;
  -webkit-user-select: none;
}

.capture-btn:active {
  background: rgba(179, 33, 34, 0.22);
}

.check-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #e6ebf3;
  font-size: 0.85rem;
  margin: 0.4rem 0 0.8rem;
}

/* Große Touch-Ziele für Buttons/Formulare auf dem Handy */
#panelCapture,
#panelBoard,
#panelContour,
#panelShape {
  padding: 1rem;
}

.lb-btn {
  min-height: 48px;
}

.lb-field input[type="number"],
.lb-field input[type="text"],
.lb-field select {
  min-height: 44px;
}

.lb-canvas-wrap {
  position: relative;
  background: #0b1220;
  border: 1px solid #27344a;
  border-radius: 8px;
  overflow: auto;
  max-height: 55vh;
  touch-action: pinch-zoom;
}

.lb-canvas-wrap canvas {
  display: block;
  max-width: 100%;
  height: auto;
}

.lb-canvas-wrap canvas:nth-child(2) {
  position: absolute;
  top: 0;
  left: 0;
  touch-action: none;
}

#finalCanvas {
  max-width: 100%;
  height: auto;
  touch-action: pinch-zoom;
}

/* Status ohne Sonderfall: lb-status ist in lightboard.html inline definiert –
   hier für die Scan-App 1:1 nachbauen, damit die Seite unabhängig ist. */
.lb-status {
  font-size: 0.85rem;
  padding: 0.5rem 0.7rem;
  border-radius: 6px;
  margin-top: 0.6rem;
  display: none;
}

.lb-status.ok {
  display: block;
  background: #14532d;
  color: #bbf7d0;
}

.lb-status.err {
  display: block;
  background: #7f1d1d;
  color: #fecaca;
}

.lb-btn {
  padding: 0.6rem 1.1rem;
  border: none;
  border-radius: 6px;
  background: #334155;
  color: #e6ebf3;
  font-size: 0.88rem;
  cursor: pointer;
}

.lb-btn:hover {
  background: #475569;
}

.lb-btn.primary {
  background: var(--brand, #b32122);
  width: 100%;
}

.lb-btn.primary:hover {
  background: var(--brand-hover, #c93435);
}

.lb-btn:disabled {
  background: #334155;
  opacity: 0.5;
  cursor: not-allowed;
}

.lb-row {
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
  margin-bottom: 0.8rem;
  align-items: flex-end;
}

.lb-row > div {
  flex: 1;
  min-width: 140px;
}

.lb-field label {
  display: block;
  font-size: 0.8rem;
  color: #93a1b8;
  margin-bottom: 0.3rem;
}

.lb-field input[type="text"],
.lb-field input[type="number"],
.lb-field select {
  width: 100%;
  padding: 0.5rem;
  background: var(--surface-2, #1c283d);
  border: 1px solid var(--border, #27344a);
  border-radius: 6px;
  color: var(--text, #e6ebf3);
  font-size: 0.95rem;
  min-height: 44px;
}

.lb-field input[type="range"] {
  width: 100%;
}

.lb-readout {
  display: flex;
  gap: 1.2rem;
  flex-wrap: wrap;
  font-size: 0.85rem;
  color: #93a1b8;
  margin: 0.7rem 0;
}

.lb-readout b {
  color: #e6ebf3;
}

.lb-export-grid {
  display: flex;
  gap: 0.7rem;
  flex-wrap: wrap;
}

#downloads a {
  display: block;
  color: #e6ebf3;
  text-decoration: none;
  font-size: 0.85rem;
  margin-top: 0.4rem;
}

#downloads a::before { content: "⬇ "; color: #93a1b8; }

#downloads a:hover {
  text-decoration: underline;
}

.section-label {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
  margin: 1.1rem 0 0.5rem;
}

.lb-next-scan {
  display: none;
  width: 100%;
  margin-top: 0.9rem;
  padding: 0.9rem;
  border: 1px solid #27344a;
  border-radius: 8px;
  background: #0f172a;
  color: #e6ebf3;
  font-size: 0.95rem;
  cursor: pointer;
}

.lb-next-scan.visible {
  display: block;
}

@media (max-width: 520px) {
  .lb-row {
    flex-direction: column;
    align-items: stretch;
  }

  .lb-row > div {
    min-width: 0;
  }

  .lb-export-grid .lb-btn {
    flex: 1;
  }
}
