.avatar-edit-trigger {
  position: relative;
  z-index: 3;
  pointer-events: auto !important;
  margin-left: 8px;
  min-height: 36px;
  border: 1px solid rgba(211, 70, 117, 0.25);
  color: #b72d61;
  background: #fff;
}

.avatar-edit-trigger .material-icons {
  margin-right: 4px;
  font-size: 18px;
  vertical-align: middle;
}

.avatar-editor-dialog {
  width: min(520px, calc(100vw - 24px));
  max-height: min(760px, calc(100dvh - 24px));
  padding: 0;
  border: 0;
  border-radius: 18px;
  overflow: hidden;
  background: #fff;
  color: #172033;
  box-shadow: 0 28px 80px rgba(15, 23, 42, 0.34);
}

.avatar-editor-dialog::backdrop {
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(6px);
}

.avatar-editor-dialog[open] {
  display: flex;
  flex-direction: column;
}

.avatar-editor-head,
.avatar-editor-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
}

.avatar-editor-head {
  border-bottom: 1px solid #e2e8f0;
}

.avatar-editor-head h3 {
  margin: 0;
  font:
    700 18px/1.2 system-ui,
    sans-serif;
}

.avatar-editor-close,
.avatar-editor-reset {
  min-width: 40px;
  min-height: 40px;
  border: 1px solid #dbe3ee;
  border-radius: 10px;
  background: #f8fafc;
  color: #475569;
  cursor: pointer;
}

.avatar-editor-body {
  flex: 1;
  min-height: 0;
  max-height: calc(100dvh - 150px);
  padding: 16px;
  overflow-y: auto;
}

.avatar-editor-stage {
  width: min(100%, 390px);
  aspect-ratio: 1;
  margin: 0 auto 16px;
  border-radius: 50%;
  overflow: hidden;
  background: #0f172a;
  box-shadow:
    0 0 0 5px #f1f5f9,
    0 14px 32px rgba(15, 23, 42, 0.2);
  touch-action: none;
  cursor: grab;
}

.avatar-editor-stage.is-dragging {
  cursor: grabbing;
}

.avatar-editor-canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.avatar-editor-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 16px;
}

.avatar-editor-control label {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
  color: #475569;
  font:
    650 12px/1.2 system-ui,
    sans-serif;
}

.avatar-editor-control output {
  color: #0f172a;
  font-variant-numeric: tabular-nums;
}

.avatar-editor-control input {
  width: 100%;
}

.avatar-editor-actions {
  border-top: 1px solid #e2e8f0;
  background: #f8fafc;
}

.avatar-editor-apply {
  min-height: 42px;
  padding: 0 22px;
  border: 0;
  border-radius: 11px;
  background: linear-gradient(135deg, #ff6b35, #d34675);
  color: #fff;
  cursor: pointer;
  font-weight: 750;
}

@media (max-width: 560px) {
  .avatar-editor-dialog {
    width: 100vw;
    max-width: none;
    height: 100dvh;
    max-height: none;
    border-radius: 0;
  }

  .avatar-editor-body {
    max-height: calc(100dvh - 142px);
    padding: 12px 16px;
  }

  .avatar-editor-stage {
    width: min(82vw, 360px);
  }

  .avatar-editor-controls {
    gap: 10px 14px;
  }
}
