.profile-photo-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin: 12px 0;
}
.profile-selfie-preview { position:relative; background:#000; aspect-ratio:1; max-height:50dvh; overflow:hidden; border-radius:14px; }
.profile-selfie-preview video { display:block; width:100%; height:100%; object-fit:cover; opacity:0; transform:scaleX(-1); }
.profile-selfie-preview video.profile-selfie-ready { opacity:1; }
.profile-selfie-cover { position:absolute; inset:0; z-index:1; background:#000; pointer-events:none; }
.profile-selfie-ready + .profile-selfie-cover { display:none; }
.profile-selfie-preview video::-webkit-media-controls,
.profile-selfie-preview video::-webkit-media-controls-start-playback-button { display:none !important; }
.profile-selfie-camera button:disabled { opacity:.45; cursor:default; }
.profile-photo-controls button {
  border: 1px solid #b9cfce;
  border-radius: 10px;
  padding: 10px 12px;
  background: #fff;
  color: #25414a;
  font:
    500 13px Montserrat,
    Arial,
    sans-serif;
  cursor: pointer;
}
.profile-photo-controls button:disabled {
  opacity: 0.45;
  cursor: default;
}
.profile-photo-editor {
  box-sizing: border-box;
  width: min(390px, calc(100vw - 28px));
  max-height: calc(100dvh - 28px);
  margin: auto;
  padding: 20px;
  border: 0;
  border-radius: 22px;
  background: #fff;
  color: #25414a;
  overflow-y: auto;
  box-shadow: 0 20px 70px #173f4a55;
  font:
    14px/1.4 Montserrat,
    Arial,
    sans-serif;
}
.profile-photo-editor::backdrop {
  background: #173f4a99;
  backdrop-filter: blur(4px);
}
.profile-photo-editor h2 {
  margin: 0 0 8px;
  font-size: 20px;
  line-height: 1.25;
}
.photo-editor-hint {
  margin: 0 0 14px;
  font-size: 13px;
  color: #61797d;
}
.profile-photo-editor canvas {
  display: block;
  width: min(100%, 225px);
  height: auto;
  margin: 0 auto 16px;
  aspect-ratio: 5/6;
  border-radius: 12px;
  background: #e8eef0;
  touch-action: none;
  cursor: grab;
}
.profile-photo-editor canvas:active {
  cursor: grabbing;
}
.photo-editor-previews {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 12px;
  margin-bottom: 16px;
}
.photo-editor-previews #photoEditorCanvas {
  width: min(225px, calc(100% - 76px));
  margin: 0;
}
.photo-editor-circle {
  flex: 0 0 64px;
  text-align: center;
  font-size: 12px;
  color: #61797d;
}
.photo-editor-circle #photoCirclePreview {
  width: 64px;
  height: 64px;
  aspect-ratio: 1;
  border-radius: 50%;
  margin: 0 0 6px;
  cursor: default;
}
.photo-editor-sliders {
  display: grid;
  gap: 6px;
}
.photo-editor-sliders label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  font-weight: 500;
}
.photo-editor-sliders input[type="range"] {
  box-sizing: border-box;
  width: 100%;
  min-height: 28px;
  margin: 0 0 5px;
  padding: 0;
  accent-color: #2db7ad;
}
.photo-editor-sliders input:disabled {
  opacity: 0.4;
}
.photo-editor-actions {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}
.photo-editor-actions button {
  flex: 1;
  border: 1px solid #b9cfce;
  border-radius: 10px;
  min-height: 44px;
  padding: 9px 8px;
  font:
    500 13px Montserrat,
    Arial,
    sans-serif;
  background: #fff;
  color: #25414a;
  cursor: pointer;
}
.photo-editor-actions .photo-apply {
  flex: 1.4;
  background: #2db7ad;
  color: #fff;
  border-color: #2db7ad;
}
.profile-photo-editor button:focus-visible,
.profile-photo-editor input:focus-visible {
  outline: 3px solid #173f4a;
  outline-offset: 3px;
}
#photoEditorError:empty,
#profilePhotoError:empty {
  display: none;
}
#photoEditorError {
  color: #a52b37;
  font-size: 13px;
  margin: 10px 0;
}
@media (max-height: 680px) {
  .profile-photo-editor canvas {
    width: 165px;
  }
  .profile-photo-editor {
    padding: 16px;
  }
  .photo-editor-hint {
    margin-bottom: 10px;
  }
}
