.hp-photo-dialog {
  width: min(1100px, calc(100vw - 32px));
  max-width: calc(100vw - 32px);
  max-height: calc(100dvh - 28px);
  padding: 18px;
  border: 1px solid #cbd9cd;
  border-radius: 18px;
  background: #f9fbf8;
  color: #203d30;
  box-shadow: 0 24px 90px #10241c55;
  overflow: auto;
}
.hp-photo-dialog::backdrop { background: #10221cbb; }
.hp-photo-dialog-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.hp-photo-dialog-header h2 { margin: 0; font-size: 20px; }
.hp-photo-button {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  min-height: 36px;
  padding: 6px 11px;
  border: 1px solid #ccddd2;
  border-radius: 9px;
  background: #f8fbf8;
  color: #315747;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  cursor: pointer;
  white-space: nowrap;
}
.hp-photo-button:hover:not(:disabled) { background: #e6f1e8; border-color: #8eb5a1; }
.hp-photo-button:focus-visible, .hp-photo-surface:focus-visible { outline: 3px solid #4c9574; outline-offset: 2px; }
.hp-photo-button:disabled { opacity: .4; cursor: default; }
.hp-photo-button.hp-photo-primary { background: #25694e; border-color: #25694e; color: white; }
.hp-photo-button.hp-photo-primary:hover:not(:disabled) { background: #1b523c; }
.hp-photo-button[aria-pressed="true"] { background: #d5eadd; border-color: #5f9a7b; }
.hp-photo-close { font-size: 25px; line-height: 1; padding: 3px 9px; }
.hp-photo-toolbar { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 9px 0; }
.hp-photo-percentage { min-width: 48px; text-align: center; font-size: 13px; font-variant-numeric: tabular-nums; color: #4b685b; }
.hp-photo-edit-actions { padding-bottom: 7px; border-bottom: 1px solid #dbe5dc; }
.hp-photo-surface {
  position: relative;
  width: 100%;
  height: min(62dvh, 640px);
  min-height: 180px;
  overflow: hidden;
  isolation: isolate;
  background: #e7ede7;
  background-image: linear-gradient(45deg, #dfe6df 25%, transparent 25%), linear-gradient(-45deg, #dfe6df 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #dfe6df 75%), linear-gradient(-45deg, transparent 75%, #dfe6df 75%);
  background-size: 20px 20px;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0;
  border: 1px solid #d0ddd3;
  border-radius: 10px;
  touch-action: none;
  cursor: grab;
  user-select: none;
}
.hp-photo-surface.hp-photo-dragging { cursor: grabbing; }
.hp-photo-surface.hp-photo-cropping { cursor: crosshair; }
.hp-photo-stage { position: absolute; left: 50%; top: 50%; transform-origin: center; line-height: 0; }
.hp-photo-stage > .hp-photo-content {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  min-width: 0 !important;
  max-width: none !important;
  max-height: none !important;
  margin: 0 !important;
  padding: 0 !important;
  border-radius: 0 !important;
  object-fit: fill;
  pointer-events: none;
}
.hp-photo-crop-box { position: absolute; border: 2px solid white; outline: 1px solid #245e43; box-sizing: border-box; background: #4c95741a; box-shadow: 0 0 0 10000px #0b241c66; pointer-events: none; }
.hp-photo-crop-box::before, .hp-photo-crop-box::after { content: ''; position: absolute; inset: 33.333% 0; border-top: 1px solid #ffffff88; border-bottom: 1px solid #ffffff88; }
.hp-photo-crop-box::after { inset: 0 33.333%; border: 0; border-left: 1px solid #ffffff88; border-right: 1px solid #ffffff88; }
.hp-photo-hint { margin: 8px 0; color: #60776a; font-size: 12px; line-height: 1.5; }
.hp-photo-status { min-height: 20px; margin: 8px 0 0; color: #526d5c; font-size: 12px; }
.hp-photo-footer { display: flex; justify-content: flex-end; gap: 8px; margin-top: 10px; }
.hp-photo-viewer { width: 100%; min-width: 0; }
.hp-photo-viewer .hp-photo-surface { height: min(72dvh, 760px); }
.hp-photo-viewer.hp-photo-original-ready .hp-photo-content { pointer-events: auto; }
.hp-photo-download { text-decoration: none; }
.hp-photo-download[aria-disabled="true"] { opacity: .4; cursor: wait; }
.hp-photo-dialog [hidden], .hp-photo-viewer [hidden] { display: none !important; }
@media (max-width: 600px) {
  .hp-photo-dialog { padding: 12px; width: calc(100vw - 16px); max-width: calc(100vw - 16px); max-height: calc(100dvh - 16px); border-radius: 12px; }
  .hp-photo-surface { height: 46dvh; }
  .hp-photo-toolbar { gap: 4px; }
  .hp-photo-button { min-height: 38px; padding: 6px 9px; }
}
