.gallery-heading {margin-bottom: 7px}
.gallery-heading-actions {display: grid; gap: 8px; margin-inline-start: auto}
.gallery-mark-toolbar {
  position: sticky;
  top: 10px;
  z-index: 4;
  display: flex;
  align-items: start;
  justify-content: flex-end;
  gap: 8px;
  margin-bottom: 8px;
  pointer-events: none;
}
#contribute-photos, #mark-gallery-photo {min-width: 122px}
#contribute-photos {background: #775a3b; color: #fff; border-color: #775a3b; font-weight: 600}
#mark-gallery-photo {
  flex: none;
  background: #fffaf1;
  box-shadow: 0 2px 9px #53391636;
  pointer-events: auto;
}
#mark-gallery-photo[aria-pressed="true"] {background: #775a3b; color: #fff; border-color: #775a3b}
.photo-upload-fields {display: grid; gap: 12px}
.photo-upload-drop {
  display: grid;
  justify-items: start;
  gap: 9px;
  min-width: 0;
  padding: 18px;
  border: 2px dashed #be9e78;
  border-radius: 9px;
  background: #fffaf2;
}
.photo-upload-drop.dragging {background: #f7e5c9; border-color: #775a3b}
.photo-upload-drop input[type=file] {max-width: 100%; margin: 0; font: inherit}
.photo-upload-status, .photo-upload-error {overflow-wrap: anywhere}
.photo-upload-status:empty, .photo-upload-error:empty {display: none}
.photo-upload-error {color: #982c24}
.photo-upload-fields .photo-editor-preview {max-height: min(210px, 25dvh)}
.photo-upload-people {min-width:0;margin:0;padding:10px 12px 12px;border:1px solid var(--liquid-line);border-radius:9px}
.photo-upload-people legend {padding:0 4px;font-weight:600}
.liquid-dialog .photo-upload-people p {font-size:12px;color:var(--popup-muted)}
.photo-upload-people input[type="search"] {margin-top:4px}
.photo-upload-people ul {margin:7px 0 0;padding:0;list-style:none}
.photo-upload-people .photo-upload-selected {display:flex;flex-wrap:wrap;gap:5px;margin-bottom:10px}
.photo-upload-selected button {background:#f2e8d6;overflow-wrap:anywhere}
.photo-upload-matches {display:grid;gap:4px}
.photo-upload-matches button {width:100%;text-align:left;overflow-wrap:anywhere}
.photo-upload-search-status:not(:empty) {margin-top:6px}
.gallery-tools {
  display: grid;
  gap: 9px;
  margin-bottom: 20px;
}
.gallery-tools label {color: #665744; font-size: 13px; font-weight: 600}
.gallery-tools input {
  width: min(100%, 390px);
  padding: 10px 12px;
  border: 1px solid #d8c8b3;
  border-radius: 7px;
  background: #fff;
  color: #4f463b;
  font: inherit;
}
.gallery-albums {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 3px;
}
.gallery-albums button {
  padding: 7px 12px;
  border: 1px solid #dccbb3;
  border-radius: 14px;
  background: #fffaf2;
  color: #684d32;
  font-size: 12px;
}
.gallery-albums [data-gallery-album="offene-gesichter"] {font-weight: 600}
.gallery-albums button[aria-pressed="true"] {
  border-color: #775a3b;
  background: #775a3b;
  color: #fff;
}
#gallery-count, #gallery-review-help, #gallery-mark-status {font-size: 12px; color: #746451}
#gallery-mark-status:empty {display: none}
#gallery-mark-status {
  margin: 0;
  padding: 6px 9px;
  border-radius: 5px;
  background: #fffaf1;
  box-shadow: 0 2px 6px #53391626;
}
.photo-frame {
  --frame-width: 16px;
  position: relative;
}
.photo-pinboard:not(:empty) {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 175px), 1fr));
  align-items: start;
  gap: 30px 24px;
}
.photo-frame > .photo-pinboard:not(:empty) {
  padding: 26px;
  border: var(--frame-width) solid #dec598;
  border-radius: 2px;
  background:
    linear-gradient(#e1e8d97a, #e1e8d97a),
    #f8f2e6 url("buettenpapier.png") center top / 960px auto repeat;
  background-clip: padding-box;
  box-shadow: inset 0 2px 9px #6249274d, 0 2px 3px #513d2640, 0 7px 16px #4c33232e;
}
.photo-frame-rail {
  display: none;
  position: absolute;
  pointer-events: none;
  isolation: isolate;
  background-color: #dec598;
}
.photo-frame > .photo-pinboard:not(:empty) ~ .photo-frame-rail {display: block}
.photo-frame-rail::before {
  content: "";
  position: absolute;
  inset: 0;
  /* White Maple Veneer by Jenelle van Heerden, Poly Haven, CC0.
     https://polyhaven.com/a/white_maple_veneer */
  background: url("ahorn-maserung.jpg") 0 var(--grain-offset, 67%) / 530px 168px repeat;
}
.photo-frame-rail::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(var(--frame-light), #fff7e1b8, #fff7e100 25%, #83613610 72%, #6f4c3970);
  box-shadow: inset 0 0 0 1px #8a6d442e;
}
.photo-frame-top, .photo-frame-bottom {inset-inline: 0; height: var(--frame-width)}
.photo-frame-top {
  --frame-light: 180deg;
  top: 0;
  clip-path: polygon(0 0, 100% 0, calc(100% - var(--frame-width)) 100%, var(--frame-width) 100%);
}
.photo-frame-bottom {
  --frame-light: 0deg;
  --grain-offset: 29%;
  bottom: 0;
  clip-path: polygon(var(--frame-width) 0, calc(100% - var(--frame-width)) 0, 100% 100%, 0 100%);
}
.photo-frame-left, .photo-frame-right {
  inset-block: 0;
  width: var(--frame-width);
  container-type: size;
}
.photo-frame-left {
  --frame-light: 90deg;
  --grain-offset: 51%;
  left: 0;
  clip-path: polygon(0 0, 100% var(--frame-width), 100% calc(100% - var(--frame-width)), 0 100%);
}
.photo-frame-right {
  --frame-light: 270deg;
  --grain-offset: 12%;
  right: 0;
  clip-path: polygon(0 var(--frame-width), 100% 0, 100% 100%, 0 calc(100% - var(--frame-width)));
}
.photo-frame-left::before, .photo-frame-right::before {
  inset: 50% auto auto 50%;
  width: 100cqh;
  height: 100cqw;
  transform: translate(-50%, -50%) rotate(90deg);
}
.photo-pinboard .gallery-item {
  --polaroid-angle: -2.8deg;
  position: relative;
  overflow: visible;
  padding: 10px 10px 5px;
  border: 1px solid #e9e1d2;
  border-radius: 1px;
  background: #fffdf8;
  box-shadow: 2px 5px 6px #3f2b2066, 5px 11px 15px #50382230;
  transform: translateY(var(--polaroid-offset, 0px)) rotate(var(--polaroid-angle));
}
.photo-pinboard .gallery-item:nth-child(3n+2) {--polaroid-angle: 2deg; --polaroid-offset: 6px}
.photo-pinboard .gallery-item:nth-child(4n+3) {--polaroid-angle: -1deg; --polaroid-offset: -3px}
.photo-pinboard .gallery-item:nth-child(5n) {--polaroid-angle: 3.5deg; --polaroid-offset: 2px}
.photo-pinboard .gallery-item:nth-child(7n+4) {--polaroid-angle: 1.1deg; --polaroid-offset: 4px}
.photo-pinboard .gallery-item::before {
  content: "";
  position: absolute;
  z-index: 1;
  top: -4px;
  left: calc(50% - 4px);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: radial-gradient(circle at 33% 28%, #e2c290, #956536 62%, #593d25);
  box-shadow: 1px 2px 3px #422d20a0;
  pointer-events: none;
}
.photo-pinboard .gallery-item .photo-tile {
  display: block;
  height: auto;
  aspect-ratio: 1;
  border: 1px solid #e3d9c8;
}
.photo-pinboard .gallery-caption {
  display: grid;
  place-items: center;
  min-height: 47px;
  padding: 7px 3px 3px;
  color: #48352b;
  font: 400 15px/1.28 "Segoe Print", "Bradley Hand", "Comic Sans MS", cursive;
  overflow-wrap: anywhere;
  text-align: center;
}
@media (max-width: 700px) {
  .photo-frame {--frame-width: 10px}
  .photo-frame > .photo-pinboard:not(:empty) {padding: 13px}
  .photo-pinboard:not(:empty) {grid-template-columns: repeat(auto-fill, minmax(min(100%, 120px), 1fr)); gap: 20px 13px}
  .photo-pinboard .gallery-item {padding: 7px 7px 3px}
  .photo-pinboard .gallery-caption {min-height: 39px; font-size: 13px}
}
.document-gallery {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr));
  gap: 18px;
}
.document-gallery .gallery-document {
  background: #fff;
  border: 1px solid #dcd8d0;
  box-shadow: 0 1px 3px #372c1a0e;
}
.document-gallery .photo-tile {
  display: block;
  height: clamp(150px, 20vw, 240px);
  padding: 12px;
  border-bottom: 1px solid #e7e3dd;
  background: #f1efeb;
  cursor: zoom-in;
}
.document-gallery .photo-tile img {object-fit: contain; transform: none}
.document-gallery .photo-tile:hover {background: #e9e5de}
.document-gallery .gallery-caption {
  padding: 10px 12px;
  color: #342f29;
  font: 600 13px/1.45 system-ui, sans-serif;
  overflow-wrap: anywhere;
}
@media (max-width: 620px) {
  .document-gallery {grid-template-columns: repeat(auto-fill, minmax(min(100%, 145px), 1fr)); gap: 12px}
}
.photo-review-badge {
  position: absolute;
  top: 7px;
  right: 7px;
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  border: 1px solid #fffaf2;
  border-radius: 50%;
  background: #775a3b;
  color: #fff;
  font: 700 15px/1 system-ui, sans-serif;
  pointer-events: none;
}
.gallery-item .photo-tile:focus-visible {outline: 3px solid #9c6e40; outline-offset: -3px}

.liquid-dialog.photo-dialog > .liquid-header {
  display:grid;
  grid-template-columns:minmax(0, 1fr) auto minmax(0, 1fr);
  align-items:center;
  gap:8px 12px;
  padding:10px 20px;
}
.photo-dialog #photo-title {display:flex;align-items:center;gap:9px;min-width:0;padding-right:26px}
.photo-title-icon {
  flex:none;
  width:32px;
  height:32px;
  padding:5px;
  border:1px solid #ecd3a768;
  border-radius:9px;
  color:#f4d7a5;
  background:#ffffff13;
}
.photo-dialog > .liquid-header .dialog-close {top:9px}
#photo-navigation {display:flex;align-items:center;justify-content:center;gap:9px}
#photo-navigation .subtle {
  display:grid;
  place-items:center;
  min-height:32px;
  width:32px;
  padding:4px;
  border-color:#f8e1bb5c;
  color:#fff6e5;
}
#photo-navigation .subtle:not([aria-disabled="true"]):hover {background:#ffffff24}
#photo-navigation [aria-disabled="true"] {opacity:.42;cursor:default}
#photo-navigation svg,#photo-edit-open svg {width:17px;height:17px}
#photo-position {min-width:7ch;text-align:center;white-space:nowrap;font-size:12px;font-variant-numeric:tabular-nums}
.liquid-dialog.photo-dialog > .liquid-body {padding:12px;gap:12px}
.liquid-dialog.photo-dialog .photo-view-footer {
  display:grid;
  grid-template-columns:minmax(0, 1fr) minmax(0, 4fr) minmax(0, 1fr);
  align-items:end;
  gap:8px;
  padding:7px 12px;
}
.photo-view-actions {grid-column:2;display:grid;justify-items:center;gap:5px;min-width:0}
.photo-view-footer #photo-edit-open {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:7px;
  min-width:122px;
  min-height:34px;
  padding:5px 12px;
}
#close-photo-bottom {grid-column:3;justify-self:end}
@media (max-width:620px) {
  .liquid-dialog.photo-dialog > .liquid-header {grid-template-columns:minmax(0, 1fr)}
}
.liquid-dialog #large-photo {touch-action:pan-y pinch-zoom}
.liquid-dialog.photo-dialog:has(#photo-edit-open:not([hidden])), .liquid-dialog.photo-dialog:has(#photo-navigation:not([hidden])) {width:min(980px, calc(100vw - 24px))}
.liquid-dialog.photo-dialog:has(#photo-face-form:not([hidden])) {width:min(1210px, calc(100vw - 24px))}
.photo-dialog .liquid-photo {align-items:center}
.photo-image-stage {position:relative;max-width:100%;min-width:0}
.photo-image-frame {position:relative;max-width:100%;min-width:0;line-height:0}
.photo-dialog .photo-image-frame #large-photo {max-width:100%}
.photo-title-document, .document-view .photo-title-image {display:none}
.document-view .photo-title-document {display:initial}
.liquid-dialog.document-view .liquid-photo {
  flex-direction:column;
  justify-content:start;
  gap:8px;
  background:#f3f1ed;
  border-radius:10px;
}
.document-view .photo-image-stage {
  --document-lens-diameter:min(287.5px, 46vw, 34.5dvh);
  display:flex;
  align-items:center;
  justify-content:center;
  width:100%;
  min-height:max(104px, 38dvh, calc(var(--document-lens-diameter) * 1.19));
}
.document-view .photo-image-frame {box-shadow:0 1px 8px #221a1733}
.photo-dialog.document-view #large-photo {
  max-height:max(110px, calc(100dvh - 290px));
  border-radius:0;
  background:#fff;
}
.photo-dialog.document-view #large-photo, .document-lens-image {filter:var(--document-detail-filter, none)}
#document-tools {
  display:flex;
  align-items:center;
  justify-content:center;
  flex-wrap:wrap;
  gap:5px 12px;
  width:100%;
}
#document-magnifier-toggle {
  display:inline-flex;
  align-items:center;
  gap:6px;
  min-height:36px;
  background:#fff;
}
#document-magnifier-toggle svg {width:17px;height:17px}
#document-magnifier-toggle[aria-pressed="true"] {background:#594737;color:#fff}
#document-tools .document-lens-setting {display:flex;align-items:center;gap:6px;font-size:12px}
#document-tools .document-lens-setting input {
  width:clamp(68px, 16vw, 118px);
  min-height:36px;
  margin:0;
  padding:0;
  border:0;
  background:transparent;
  accent-color:#765737;
}
.document-lens-setting span {min-width:4ch;font-variant-numeric:tabular-nums}
#document-magnifier-help {flex-basis:100%;padding:0;font-size:11px;color:#635a50}
.magnifier-active {cursor:none;touch-action:none}
.document-view .magnifier-active #large-photo {touch-action:none;user-select:none}
.document-view #large-photo:focus-visible {outline:2px solid #775a3b;outline-offset:2px}
#document-lens {
  position:absolute;
  z-index:1;
  width:var(--document-lens-diameter);
  aspect-ratio:1;
  transform:translate(-50%,-50%);
  pointer-events:none;
}
#document-lens::after {
  content:"";
  position:absolute;
  z-index:-1;
  width:30%;
  height:11%;
  top:81%;
  left:84%;
  transform:rotate(45deg);
  transform-origin:0 50%;
  border:1px solid #3b2b1d;
  border-radius:4px 10px 10px 4px;
  background:linear-gradient(#9e7d56, #473428 38%, #271e18 78%, #5c4837);
  box-shadow:2px 3px 5px #21160e59;
}
.document-lens-glass {
  position:absolute;
  inset:0;
  overflow:hidden;
  border:5px solid #64513c;
  border-top-color:#b69d77;
  border-left-color:#8b7356;
  border-radius:50%;
  background:#fffdf7;
  box-shadow:0 0 0 1px #382a20, 0 5px 14px #20191055;
}
.document-image-filter, .document-lens-image {position:absolute}
.document-lens-image {inset:0;overflow:hidden}
.document-lens-image img {position:absolute;left:50%;top:50%;max-width:none;height:auto}
.document-lens-glass::after {
  content:"";
  position:absolute;
  inset:0;
  border-radius:50%;
  background:linear-gradient(140deg,#fff6,transparent 28%);
  box-shadow:inset 0 0 0 1px #fff9, inset 0 0 11px #48362440;
}
.photo-dialog #large-photo.marking-faces {cursor:crosshair}
.photo-dialog:has(#photo-face-form:not([hidden])) #large-photo {max-height:clamp(110px, 36dvh, 360px)}
@media (min-width:780px) {
  .photo-dialog > .liquid-body:has(#photo-face-form:not([hidden])) {
    grid-template-columns:minmax(0, 1fr) minmax(0, 430px);
    align-items:start;
  }
  .photo-dialog:has(#photo-face-form:not([hidden])) #large-photo {
    max-height:max(110px, calc(100dvh - 180px));
  }
}
#photo-face-markers {position: absolute; pointer-events: none; inset: 0; z-index: 1}
.photo-face-marker {
  position: absolute;
  transform: translate(-50%, -50%);
  min-width: 29px;
  height: 29px;
  padding: 0 4px;
  border-radius: 50%;
  border: 2px solid #fff;
  background: #403128dc;
  color: #fff;
  box-shadow: 0 1px 5px #0009;
  pointer-events: auto;
  font-size: 12px;
}
.photo-face-marker[aria-pressed="true"] {background: #93602a; outline: 2px solid #f9cd7d}
#photo-face-names {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px;
  padding: 5px 8px;
  border-radius: 7px;
  background: #eee3d1;
  color: #56412f;
  line-height: 1.4;
  font-size: 12px;
}
#photo-face-names span {padding: 1px 5px; overflow-wrap: anywhere}
#photo-face-form {display:grid;gap:8px;padding:12px}
#photo-face-form p {font-size:12px;line-height:1.4}
#photo-face-selection {display:grid;gap:5px}
#photo-face-fields {
  display:grid;
  gap:4px;
  max-height:min(30dvh, 220px);
  overflow:auto;
  padding:3px;
  margin:-3px;
}
.photo-face-field {
  display:grid;
  grid-template-columns:max-content minmax(0, 230px) auto;
  align-items:center;
  gap:7px;
  justify-content:start;
}
#photo-face-hints {display:grid;grid-template-columns:minmax(0, 145px) minmax(0, 185px);gap:8px}
#photo-face-form label {font-size:12px}
#photo-face-form :is(input:not([type="checkbox"]),select) {
  min-width:0;
  min-height:30px;
  margin-top:3px;
  padding:4px 7px;
  font-size:13px;
  border-radius:6px;
}
#photo-face-form .photo-face-field input {margin:0}
#photo-face-form .photo-face-switch,
#photo-face-form .photo-editor-albums label {display:flex;align-items:center;gap:6px}
#photo-face-form input[type="checkbox"] {width:15px;height:15px}
#photo-face-form .photo-face-albums {min-width:0;margin:0;padding:4px 7px 6px;border:1px solid var(--liquid-line);border-radius:6px}
.photo-face-albums legend {font-size:12px;color:var(--popup-muted)}
#photo-face-form .photo-face-edit-row {display:flex;flex-wrap:wrap;align-items:center;gap:5px 8px}
.photo-dialog :is(#photo-face-form,.photo-view-footer) .subtle {
  min-height:30px;
  padding:4px 8px;
  font-size:12px;
}
#photo-face-form .photo-face-remove {font-size:16px;line-height:1}
#photo-face-status:empty, #photo-face-known:empty {display:none}
#photo-face-connection {text-align:center}
.photo-editor-albums {display: flex; flex-wrap: wrap; gap: 8px 14px; font-size: 13px}
.liquid-dialog .photo-editor-albums label {display: flex; align-items: center; gap: 5px}
#photo-face-form textarea {
  display: block;
  width: 100%;
  min-height: 52px;
  margin-top: 3px;
  padding: 6px 7px;
  border: 1px solid #cdb99a;
  border-radius: 6px;
  background: #fffdf8;
  color: #4f4436;
  font: 13px "Segoe UI", sans-serif;
  resize: vertical;
}
