/* A photo with an optional marker drawn over it. Positions are percentages,
   so the marker stays on the right spot at any display size. */
.marked-photo { position: relative; display: inline-block; line-height: 0; max-width: 100%; }
.marked-photo img { max-width: 100%; height: auto; }
.photo-marker {
  position: absolute;
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border: 3px solid #ff2d55;
  border-radius: 50%;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, .85), inset 0 0 0 2px rgba(255, 255, 255, .85);
  pointer-events: none;
}
.photo-marker.is-box { border-radius: 4px; aspect-ratio: auto; transform: none; }
.photo-rect {
  position: absolute;
  border: 3px solid #ff2d55;
  border-radius: 4px;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, .85), inset 0 0 0 2px rgba(255, 255, 255, .85);
  pointer-events: none;
}
.marker-canvas { cursor: crosshair; touch-action: none; user-select: none; }
.marker-canvas img { -webkit-user-drag: none; }
.marker-canvas img { max-height: 75vh; width: auto; }
/* The marker is only interactive inside the editor: drag to move, handle to resize. */
.marker-canvas .photo-marker { pointer-events: auto; cursor: move; }
.marker-canvas .photo-marker:focus-visible { outline: 2px solid var(--bs-primary); outline-offset: 2px; }
.marker-handle {
  position: absolute; right: -8px; bottom: -8px; width: 14px; height: 14px;
  background: #ff2d55; border: 2px solid #fff; border-radius: 50%; cursor: nwse-resize;
}
.photo-marker:not(.is-box) .marker-handle { display: none; }

/* Small thumbnail in the location list: keep the marker visible but subtle. */
.marked-photo.thumb img { height: 56px; width: auto; }
.marked-photo.thumb .photo-marker,
.marked-photo.thumb .photo-rect { border-width: 2px; box-shadow: 0 0 0 1px rgba(255, 255, 255, .85); }

/* Gallery picker: the whole thumbnail is the radio button. */
.gallery-picker label { cursor: pointer; transition: box-shadow .15s; }
.gallery-picker .btn-check:checked + label { border-color: var(--bs-primary) !important; box-shadow: 0 0 0 3px rgba(var(--bs-primary-rgb), .35); }
.gallery-picker .btn-check:focus-visible + label { outline: 2px solid var(--bs-primary); outline-offset: 2px; }
.gallery-picker img { aspect-ratio: 4 / 3; object-fit: cover; width: 100%; }

/* Circle / box toggle on the marker page. */
.marker-shape .btn-check:checked + label { background: var(--bs-primary); color: #fff; border-color: var(--bs-primary); }

/* AI proposal review: boxes can be dragged and resized. */
.detect-rect { pointer-events: auto; cursor: move; touch-action: none; }
.detect-rect.active, .detect-rect:focus { border-color: #0d6efd; outline: none; }
.detect-rect[hidden] { display: none; }
.detect-handle { position: absolute; right: -8px; bottom: -8px; width: 14px; height: 14px; background: #ff2d55; border: 2px solid #fff; border-radius: 50%; cursor: nwse-resize; }
