.photo-editor {
  box-sizing: border-box;
  width: min(1120px, calc(100% - 2rem));
  max-width: none;
  max-height: calc(100% - 2rem);
  padding: 0;
  border: 2px solid #d59a18;
  background: #fbfaf5;
  color: #050505;
  font: 400 1rem/1.45 var(--body, sans-serif);
}
.photo-editor::backdrop { background: rgb(5 5 5 / 78%); }
.photo-editor__content { padding: 1.25rem; }
.photo-editor__header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-bottom: .75rem; border-bottom: 2px solid #d59a18; }
.photo-editor__header h2 { margin: 0; font: 700 clamp(1.8rem, 4vw, 2.8rem)/1 var(--display, sans-serif); text-transform: uppercase; }
.photo-editor button { box-sizing: border-box; min-height: 44px; padding: .55rem .8rem; border: 1px solid #050505; border-radius: 0; background: #fbfaf5; color: #050505; font: 700 1.05rem/1.1 var(--display, sans-serif); cursor: pointer; }
.photo-editor button:hover:not(:disabled) { border-color: #d59a18; color: #785000; }
.photo-editor button:focus-visible, .photo-editor input:focus-visible { outline: 3px solid #d59a18; outline-offset: 3px; }
.photo-editor button:disabled { opacity: .55; cursor: wait; }
.photo-editor__header button { width: 44px; padding: 0; font: 400 2rem/1 var(--body, sans-serif); }
.photo-editor__comparison { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; margin-top: 1rem; }
.photo-editor__comparison figure { min-width: 0; margin: 0; }
.photo-editor__comparison figcaption { padding: .4rem .7rem; background: #050505; color: #fbfaf5; font: 700 1.2rem/1.2 var(--display, sans-serif); text-transform: uppercase; }
.photo-editor__comparison img, .photo-editor__preview { display: block; width: 100%; height: clamp(180px, 36vh, 380px); margin-top: .5rem; object-fit: contain; background: #e9e7df; }
.photo-editor__preview { display: flex; align-items: center; justify-content: center; }
.photo-editor__preview canvas { display: block; max-width: 100%; max-height: 100%; }
.photo-editor__status { min-height: 1.5em; margin: .9rem 0; text-align: center; }
.photo-editor__tools { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .65rem; }
.photo-editor__tools button { display: flex; align-items: center; justify-content: center; gap: .55rem; }
.photo-editor__tools button:first-child { border-color: #d59a18; }
.photo-editor__tools span { font-size: 1.65rem; }
.photo-editor__crop { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem 1rem; margin: 1rem 0 0; border: 1px solid #d59a18; }
.photo-editor__crop[hidden] { display: none; }
.photo-editor__crop label { display: grid; grid-template-columns: 4rem 1fr 3rem; align-items: center; gap: .4rem; }
.photo-editor__crop input { width: 100%; accent-color: #d59a18; }
.photo-editor__footer { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: 1rem; padding-top: 1rem; border-top: 1px solid #d59a18; }
.photo-editor__footer p { margin: 0; }
.photo-editor__footer div { display: flex; gap: .6rem; }
.photo-editor .photo-editor__save { border-color: #d59a18; background: #d59a18; }
.photo-edit-trigger { display: none; position: absolute; z-index: 4; align-items: center; gap: .35rem; min-height: 38px; padding: .4rem .65rem; border: 1px solid #d59a18; border-radius: 0; background: #050505; color: #fbfaf5; font: 700 1rem/1.05 var(--display, sans-serif); cursor: pointer; }
.has-admin-session [data-history-slide-current] .photo-edit-trigger:not([hidden]),
.has-admin-session .memory-lightbox__shell .photo-edit-trigger:not([hidden]) { display: inline-flex; }
.photo-edit-trigger:hover { background: #d59a18; color: #050505; }
.photo-edit-trigger:focus-visible { outline: 3px solid #f0b62a; outline-offset: 2px; }
.photo-edit-trigger span { font-size: 1.2em; }
@media (max-width: 700px) {
  .photo-editor { width: calc(100% - 1rem); max-height: calc(100% - 1rem); }
  .photo-editor__content { padding: .75rem; }
  .photo-editor__comparison { grid-template-columns: 1fr; gap: .7rem; }
  .photo-editor__comparison img, .photo-editor__preview { height: 210px; }
  .photo-editor__tools, .photo-editor__crop { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .photo-editor__footer { align-items: stretch; flex-direction: column; }
  .photo-editor__footer div > button { flex: 1; }
}
@media (max-width: 390px) {
  .photo-editor__crop { grid-template-columns: 1fr; }
  .photo-editor__tools button { gap: .25rem; padding: .45rem .3rem; font-size: .9rem; }
  .photo-editor__tools span { font-size: 1.3em; }
}
