/* Shared dialog headers, buttons, fields and appearance rules stay in charge. */
.progress-photo-entry .fine-print {
  margin: 12px 0 0;
  line-height: 1.5;
}

#modal.modal-progress-photos {
  max-height: calc(100dvh - 24px);
}
#modal.modal-progress-photos.progress-photo-gallery {
  width: min(800px, calc(100% - 32px));
}
.modal-progress-photos .modal-body {
  min-width: 0;
}
.progress-photo-viewer {
  --photo-selection: var(--palette-075bff, #075bff);
  min-width: 0;
}
html[data-theme='night'] .progress-photo-viewer {
  --photo-selection: var(--palette-90b8df, #90b8df);
}
.progress-photo-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 18px;
}
.progress-photo-client {
  font-size: 13px;
  font-weight: 700;
  margin: 0;
}
.progress-photo-toolbar .fine-print {
  margin: 4px 0 0;
}
.progress-photo-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}
.progress-photo-modes {
  flex-shrink: 0;
  gap: 2px;
}
.progress-photo-modes button {
  display: grid;
  place-items: center;
  width: 38px;
  height: 34px;
  padding: 7px;
}
.progress-photo-modes svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
}
.progress-photo-modes button:disabled {
  opacity: 0.35;
  cursor: default;
}
.progress-photo-filter {
  margin: 0 !important;
  max-width: 135px;
}
.progress-photo-filter > .visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.progress-photo-filter select {
  margin: 0;
  min-height: 36px;
  height: 36px;
  padding: 6px 30px 6px 10px;
  font-size: 12px;
}
.progress-photo-stage {
  display: grid;
  gap: 3px;
  border: 1px solid var(--line);
  border-radius: var(--ui-radius);
  overflow: hidden;
  background: var(--line);
}
.progress-photo-stage.is-compare {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.progress-photo-stage.is-single {
  max-width: 430px;
  margin: 0 auto;
}
.progress-photo-pane {
  position: relative;
  min-width: 0;
  background: var(--white);
  border-bottom: 3px solid transparent;
}
.progress-photo-pane.is-active {
  border-bottom-color: var(--photo-selection);
}
.progress-photo-image {
  display: block;
  width: 100%;
  border: 0;
  padding: 0;
  background: transparent;
  position: relative;
  cursor: pointer;
  aspect-ratio: 3/4;
  max-height: 48dvh;
}
.progress-photo-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.progress-photo-side {
  position: absolute;
  top: 9px;
  left: 9px;
  z-index: 1;
  padding: 4px 7px;
  border-radius: var(--ui-radius);
  background: #142237e6;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}
.progress-photo-pane.is-active .progress-photo-side {
  background: var(--navy);
  color: var(--white);
}
.progress-photo-image.is-empty {
  background: var(--paper);
  color: var(--muted);
}
.progress-photo-placeholder {
  display: flex;
  height: 100%;
  min-height: 120px;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 10px;
  padding: 32px 12px;
  font-size: 12px;
  line-height: 1.5;
}
.progress-photo-placeholder .icon {
  width: 28px;
  height: 28px;
}
.progress-photo-image:focus-visible,
.progress-photo-thumb:focus-visible {
  outline: 2px solid var(--photo-selection);
  outline-offset: -3px;
}
.progress-photo-stamp {
  position: absolute;
  inset: auto 0 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 25px 6px 12px;
  color: #fff;
  background: linear-gradient(transparent, #000b);
  font-size: 12px;
  pointer-events: none;
}
.progress-photo-stamp > span {
  font-size: 10px;
  opacity: 0.85;
}
#modal.modal-progress-photos .progress-photo-options {
  position: absolute;
  right: 9px;
  top: 9px;
  width: 32px;
  height: 32px;
  min-width: 32px;
  min-height: 32px;
  border: 1px solid #ffffff66;
  background: #142237b3;
  color: #fff;
  border-radius: var(--ui-radius);
}
#modal.modal-progress-photos .progress-photo-options:hover:where(html:not([data-touch-input]) *) {
  background: #142237e6;
  color: #fff;
}
.progress-photo-options .icon {
  width: 18px;
  height: 18px;
}
.progress-photo-hint {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.6;
  margin: 12px 0;
}
.progress-photo-timeline {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 5px 2px 14px;
  scrollbar-width: thin;
}
.progress-photo-thumb {
  border: 0;
  padding: 0;
  background: transparent;
  flex: 0 0 80px;
  cursor: pointer;
  color: var(--ink);
}
.progress-photo-thumb > span {
  display: block;
  position: relative;
  border: 2px solid transparent;
  padding: 3px;
  border-radius: var(--ui-radius);
}
.progress-photo-thumb.is-selected > span {
  border-color: var(--photo-selection);
}
.progress-photo-thumb img {
  display: block;
  width: 70px;
  height: 85px;
  object-fit: contain;
  background: var(--white);
  border-radius: var(--ui-radius);
}
.progress-photo-thumb b.tag {
  position: absolute;
  right: 6px;
  bottom: 6px;
  border-radius: var(--ui-radius);
  padding: 2px 4px;
  font-size: 9px;
}
.progress-photo-thumb time {
  display: block;
  font-size: 11px;
  margin-top: 5px;
  white-space: nowrap;
}
.progress-photo-privacy {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  font-size: 11px;
  line-height: 1.6;
  color: var(--muted);
  margin: 18px 0 8px;
}
.progress-photo-privacy .icon {
  width: 15px;
  height: 15px;
  margin-top: 1px;
  flex-shrink: 0;
}
.progress-photo-policy {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.6;
}
.progress-photo-policy summary {
  cursor: pointer;
}
.progress-photo-policy p {
  margin: 8px 0 0;
}
.progress-photo-empty {
  text-align: center;
  padding: 32px 16px;
}
.progress-photo-empty > .icon {
  width: 32px;
  height: 32px;
  color: var(--muted);
}
.progress-photo-empty h3 {
  margin: 14px 0 8px;
  font-size: 18px;
}
.progress-photo-empty p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}
.progress-photo-picker {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 8px;
  padding: 24px 12px;
  border: 1px dashed var(--line);
  border-radius: var(--ui-radius);
  background: var(--white);
  position: relative;
  cursor: pointer;
  margin-bottom: 16px;
}
.progress-photo-picker > span {
  font-size: 11px;
  color: var(--muted);
}
.progress-photo-picker input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}
.progress-photo-picker:focus-within {
  outline: 3px solid var(--palette-90b8df, #90b8df);
  outline-offset: 3px;
}
.progress-photo-preview {
  display: block;
  max-width: 100%;
  max-height: 34dvh;
  object-fit: contain;
  margin: 0 auto 16px;
  border: 1px solid var(--line);
  border-radius: var(--ui-radius);
}
.progress-photo-preview[hidden] {
  display: none;
}
.progress-photo-form-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}
.progress-photo-form-fields label {
  min-width: 0;
}
.progress-photo-form-fields input,
.progress-photo-form-fields select {
  min-width: 0;
  max-width: 100%;
}
.progress-photo-details > strong {
  display: block;
  font-size: 13px;
  text-align: center;
}
.progress-photo-detail-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 20px 0;
}
.progress-photo-detail-actions .btn {
  min-width: 0;
  white-space: normal;
}
.progress-photo-detail-actions .danger {
  grid-column: 1 / -1;
  justify-self: start;
  min-height: 36px;
}
.progress-photo-details > .btn {
  margin-top: 4px;
}

@media (max-width: 760px) {
  .progress-photo-entry .btn {
    min-height: 36px;
    padding: 6px 10px;
    font-size: 11px;
    line-height: 1.2;
    gap: 5px;
  }
  .progress-photo-entry .btn > .icon {
    width: 14px;
    height: 14px;
  }
  #modal.modal-progress-photos.progress-photo-gallery {
    width: calc(100% - 24px);
  }
  .progress-photo-toolbar {
    margin-bottom: 16px;
  }
  .progress-photo-toolbar .btn {
    min-height: 36px;
    padding: 6px 10px;
    font-size: 11px;
    line-height: 1.2;
    gap: 5px;
  }
  .progress-photo-toolbar .btn > .icon {
    width: 14px;
    height: 14px;
  }
  .progress-photo-modes button {
    width: 36px;
    height: 32px;
  }
  .progress-photo-image {
    max-height: 44dvh;
  }
  .progress-photo-stamp {
    font-size: 11px;
    padding-bottom: 10px;
  }
  #modal.modal-progress-photos .progress-photo-options {
    width: 30px;
    height: 30px;
    min-width: 30px;
    min-height: 30px;
    top: 7px;
    right: 7px;
  }
  .progress-photo-timeline {
    gap: 8px;
  }
  .progress-photo-thumb {
    flex-basis: 78px;
  }
  .progress-photo-thumb img {
    width: 68px;
    height: 80px;
  }
  .progress-photo-thumb time {
    font-size: 10px;
  }
  .progress-photo-form-fields {
    gap: 10px;
  }
}
@media (max-width: 360px) {
  .progress-photo-detail-actions {
    grid-template-columns: minmax(0, 1fr);
  }
}
