/* §AVATAR-CROP-2026-09-23 — Crop-Dialog (avatar-cropper.js). Hängt direkt an
 * <body>, außerhalb von #ec-mobile-shell — die ID-Kaskade der Mobile-Shell
 * greift hier also nicht. Über Sheets (2147482700) und dem Profil-Editor
 * (2147482600), unter Sperrbildschirmen.
 * §CROPPER-V2-2026-10-26: zentrierte Glas-Karte (max. 540 px) statt Vollbild;
 * Bedienleiste direkt am Bild, Aktionen unten rechts in der Karte. Immer dunkel
 * (Bildbearbeitung), unabhängig vom App-Thema. */
.ec-crop {
  position: fixed; inset: 0; z-index: 2147482800;
  display: flex; align-items: center; justify-content: center;
  box-sizing: border-box;
  padding: max(16px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px))
           max(16px, env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
  background: rgba(2, 2, 6, .62);
  color: #f1f5f9;
  font: 15px/1.35 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent;
  touch-action: none; overscroll-behavior: contain;
  animation: ec-crop-in .18s ease-out;
}
@keyframes ec-crop-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes ec-crop-card-in { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }

.ec-crop-card {
  position: relative; box-sizing: border-box;
  display: flex; flex-direction: column;
  width: min(540px, 100%); max-height: 100%;
  padding: 18px 18px 14px;
  background: rgba(10, 10, 14, .85);
  -webkit-backdrop-filter: blur(25px) saturate(140%); backdrop-filter: blur(25px) saturate(140%);
  border: 1px solid rgba(255, 255, 255, .12); border-radius: 20px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, .55), inset 0 1px 0 rgba(255, 255, 255, .06);
  animation: ec-crop-card-in .2s ease-out;
}
/* Ohne backdrop-filter: deckend statt durchscheinend (Lesbarkeit). */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .ec-crop-card { background: rgba(10, 10, 14, .97); }
}
@media (prefers-reduced-motion: reduce) { .ec-crop, .ec-crop-card { animation: none; } }

.ec-crop-top { flex: none; padding: 0 2px 12px; }
.ec-crop-title { display: block; font-size: 17px; font-weight: 600; letter-spacing: .01em; }
.ec-crop-top small { display: block; margin-top: 3px; font-size: 12.5px; color: rgba(241, 245, 249, .58); }

/* Bildfläche deckend schwarz: die Unschärfe der Karte muss beim Ziehen/Pinch nicht
 * neu berechnet werden (Ruckeln auf schwachen WebViews). Höhe folgt dem Viewport,
 * damit die Leiste auch im Querformat (≈ 360 px) nie abgeschnitten wird. */
.ec-crop-stage {
  position: relative; flex: 0 1 auto; overflow: hidden;
  width: 100%; aspect-ratio: 1 / 1;
  height: auto; min-height: 160px;
  max-height: min(444px, calc(100vh - 250px)); max-height: min(444px, calc(100dvh - 250px));
  border-radius: 14px; background: #050507;
  touch-action: none; cursor: grab;
}
.ec-crop-stage:active { cursor: grabbing; }
.ec-crop-img {
  position: absolute; left: 0; top: 0; transform-origin: 0 0;
  max-width: none; max-height: none; will-change: transform; pointer-events: none;
}
/* Kreis: der riesige Schatten dunkelt alles außerhalb dezent ab (an der Fläche gekappt). */
.ec-crop-hole {
  position: absolute; border-radius: 50%; pointer-events: none;
  box-shadow: 0 0 0 200vmax rgba(0, 0, 0, .62);
  outline: 1.5px solid rgba(255, 255, 255, .85); outline-offset: -1px;
}

.ec-crop-tools {
  flex: none; display: flex; align-items: center; gap: 10px;
  margin-top: 12px;
}
.ec-crop-zoom { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: 6px; }
.ec-crop-zoom input { flex: 1; min-width: 0; margin: 0; accent-color: #f5f5f7; touch-action: none; }
.ec-crop-icon, .ec-crop-tool {
  flex: none; min-width: 40px; min-height: 40px; box-sizing: border-box;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid rgba(255, 255, 255, .12); border-radius: 12px;
  background: rgba(255, 255, 255, .05); color: #f1f5f9;
  font: inherit; font-size: 14px; cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease;
}
.ec-crop-icon { padding: 0; font-size: 20px; line-height: 1; }
.ec-crop-tool { padding: 0 12px; white-space: nowrap; }
.ec-crop-tool span { font-size: 17px; }
.ec-crop-icon:hover:not(:disabled), .ec-crop-tool:hover:not(:disabled) { background: rgba(255, 255, 255, .11); border-color: rgba(255, 255, 255, .22); }
.ec-crop-icon:disabled, .ec-crop-tool:disabled { opacity: .4; cursor: default; }

.ec-crop-err { flex: none; margin: 10px 2px 0; color: #fca5a5; font-size: 13.5px; }
.ec-crop-err[hidden] { display: none; }

/* Aktionen gebündelt unten rechts in der Karte. */
.ec-crop-bar {
  flex: none; display: flex; align-items: center; justify-content: flex-end; gap: 10px;
  margin-top: 14px;
}
.ec-crop-btn {
  min-width: 44px; min-height: 44px; padding: 0 18px; box-sizing: border-box;
  border: 1px solid transparent; border-radius: 12px;
  background: transparent; color: rgba(241, 245, 249, .82);
  font: inherit; font-size: 15px; font-weight: 500; cursor: pointer;
  transition: background-color .15s ease, color .15s ease, box-shadow .15s ease;
}
.ec-crop-btn:hover:not(:disabled) { background: rgba(255, 255, 255, .08); color: #fff; }
/* Monochromer Glow-Knopf: heller Grund, dunkle Schrift (Kontrast ≈ 18:1). */
.ec-crop-save {
  background: #f5f5f7; color: #0a0a0e; font-weight: 600;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .45), 0 0 22px rgba(255, 255, 255, .22);
}
.ec-crop-save:hover:not(:disabled) { background: #fff; color: #0a0a0e; box-shadow: 0 0 0 1px rgba(255, 255, 255, .6), 0 0 30px rgba(255, 255, 255, .34); }
.ec-crop-btn:focus-visible, .ec-crop-icon:focus-visible, .ec-crop-tool:focus-visible, .ec-crop-zoom input:focus-visible {
  outline: 2px solid #f5f5f7; outline-offset: 2px;
}
.ec-crop-btn:disabled { opacity: .55; cursor: default; }
.ec-crop.is-busy .ec-crop-stage { pointer-events: none; opacity: .8; }

/* Schmale Handys: engere Innenabstände, damit der Regler Platz behält. */
@media (max-width: 360px) {
  .ec-crop-card { padding: 14px 12px 12px; }
  .ec-crop-tool { padding: 0 10px; }
}
/* Niedrige Fenster (Querformat): kompakter Kopf. */
@media (max-height: 520px) {
  .ec-crop-card { padding-top: 12px; padding-bottom: 10px; }
  .ec-crop-top { padding-bottom: 8px; }
  .ec-crop-top small { display: none; }
  .ec-crop-tools { margin-top: 8px; }
  .ec-crop-bar { margin-top: 8px; }
}

/* §MBF-2026-11-09 (6): Titelbild-Zuschnitt — rechteckige Maske (8:3 Profil, 16:9 Gruppe) auf breiterer Fläche. */
.ec-crop.is-rect .ec-crop-stage { aspect-ratio: 4 / 3; }
.ec-crop.is-rect .ec-crop-hole { border-radius: 10px; }
