/* ===========================================================================
   doc-photos.css — the Photos dialog (doc-photos.js): photos kept as a record
   of a binder, a page, a card, a shelf or an item. What they are of along the
   top, Take / Add photos under it, then the photos as a grid of thumbnails;
   one photo opens large in place of the grid, with its caption, a download and
   a delete.
   =========================================================================== */

.modal.modal-docphotos {
  width: min(760px, 100%); max-height: 90vh;
  display: flex; flex-direction: column; overflow: hidden;
}
.dp { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.dp > .modal-head p { white-space: normal; }
.dp-body {
  flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
  display: flex; flex-direction: column; gap: 14px;
}
.dp-body.is-drop-over { outline: 2px dashed var(--accent); outline-offset: -6px; border-radius: var(--radius-md, 12px); }

/* What a photo is of: wraps on a phone rather than scrolling sideways. */
.dp-choices { flex-wrap: wrap; height: auto; align-self: flex-start; max-width: 100%; }
.dp-choices .seg-opt { gap: 6px; }
.dp-n {
  display: inline-block; min-width: 18px; padding: 0 5px; border-radius: var(--radius-pill);
  font-size: 11px; font-weight: 650; line-height: 17px; text-align: center; font-variant-numeric: tabular-nums;
  color: var(--ink-3); background: color-mix(in srgb, var(--ink) 8%, transparent);
}
.dp-inputs .ph-btn { flex: 0 1 auto; height: 38px; }

.dp-grid {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px;
}
.dp-tile {
  position: relative; display: flex; flex-direction: column; width: 100%; padding: 0; overflow: hidden;
  border: 1px solid var(--line); border-radius: 12px; background: var(--bg-3); color: var(--ink);
  text-align: left; cursor: pointer;
  transition: border-color var(--t-1) var(--ease-out), transform var(--t-1) var(--ease-out);
}
.dp-tile:hover { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); }
:root[data-motion="full"] .dp-tile:hover { transform: translateY(-2px); }
.dp-tile img, .dp-wait { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: var(--bg-2); }
.dp-tile-meta { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px 9px; min-width: 0; }
.dp-tile-meta b { font-size: 12px; font-weight: 650; color: var(--accent-text); }
.dp-cap {
  font-size: 12.5px; line-height: 1.35; color: var(--ink-2);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.dp-worth { font-size: 12px; font-weight: 600; color: var(--gold-text); font-variant-numeric: tabular-nums; }
.dp-tile time { font-size: 11.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.dp-tile.is-uploading { cursor: default; }
.dp-tile.is-uploading img { opacity: .55; }
.dp-bar { position: absolute; left: 10px; right: 10px; bottom: 10px; height: 4px; border-radius: 2px; background: color-mix(in srgb, var(--ink) 14%, transparent); overflow: hidden; }
.dp-bar i { display: block; height: 100%; width: 0; background: var(--accent); transition: width var(--t-2) var(--ease-out); }

.dp-groups { display: flex; flex-direction: column; gap: 18px; }
.dp-group h3 {
  display: flex; align-items: center; gap: 8px; margin: 0 0 8px;
  font-size: var(--fs-micro, 11px); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2);
}

.dp-empty { padding: 28px 12px; text-align: center; color: var(--ink-2); }
.dp-empty p { margin: 0 0 6px; }
.dp-empty-ico {
  display: grid; place-items: center; width: 58px; height: 58px; margin: 0 auto 14px; border-radius: 18px;
  color: #60a5fa; background: color-mix(in srgb, #60a5fa 15%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, #60a5fa 32%, transparent), 0 12px 30px -12px color-mix(in srgb, #60a5fa 70%, transparent);
}
.dp-empty-ico svg { width: 28px; height: 28px; display: block; }
.dp-hint { font-size: 13px; color: var(--ink-3); max-width: 42ch; margin-inline: auto !important; }

/* One photo, large. */
.dp-viewer { display: flex; flex-direction: column; gap: 10px; }
.dp-stage { position: relative; display: flex; align-items: center; justify-content: center; gap: 8px; }
.dp-full { display: block; min-width: 0; flex: 1; }
.dp-full img {
  display: block; width: 100%; height: auto; max-height: 52vh; object-fit: contain;
  border-radius: 10px; background: var(--bg-2);
}
.dp-step { flex: none; }
.dp-meta { margin: 0; font-size: 12.5px; color: var(--ink-3); }
.dp-caption { width: 100%; resize: vertical; min-height: 56px; }
.dp-acts { display: flex; flex-wrap: wrap; gap: 8px; }
.dp-acts .btn { display: inline-flex; align-items: center; gap: 6px; }
.dp-acts .btn:last-child { margin-left: auto; }
.dp-acts .ico, .dp-acts .ico svg { display: block; width: 15px; height: 15px; }

@media (max-width: 560px) {
  .dp-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .dp-step { position: absolute; top: 50%; translate: 0 -50%; z-index: 1; background: var(--glass); }
  .dp-step.is-prev { left: 6px; }
  .dp-step.is-next { right: 6px; }
  .dp-acts .btn:last-child { margin-left: 0; }
}

/* ------------------------------------------------- the Insurance Report (records.js) */
.modal.modal-ir { width: min(560px, 100%); }
.ir .modal-body { display: flex; flex-direction: column; gap: 14px; }
.ir-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
.ir-stats > div {
  display: flex; flex-direction: column; gap: 2px; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--bg-3);
}
.ir-stats span { font-size: 11px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.ir-stats b { font-size: 17px; font-variant-numeric: tabular-nums; }
.ir-stats > div:first-child b { color: var(--gold-text); }
.ir-opts { display: flex; flex-direction: column; gap: 4px; }
.ir .modal-foot { flex-wrap: wrap; }
.dp-report { align-self: flex-start; }
/* Opened straight on a photo, before the list is read (doc-photos.js openFirst) */
.dp-opening { margin: 48px 0; text-align: center; font-size: 13px; color: var(--ink-3); }
