/* Photos: the strip, the viewer and the Undo bar (photos.js, H19).
   Shared by the desktop portal (/pm/) and the phone page (/field/), so it
   uses only the colour tokens both define: --accent, --line, --bg,
   --surface, --ink, --ink-faint. Moved out of styles.css 2026-10-13 (H117). */
.photo-btn{font-size:12.5px;}
.photo-btn.open{border-color:var(--accent); color:var(--accent);}
.photo-strip{margin-top:8px; padding:8px; border:1px dashed var(--line); border-radius:10px; background:var(--bg);}
.photo-strip.photo-drop{border-color:var(--accent); background:#eaf2ef;}
.photo-row{display:flex; flex-wrap:wrap; gap:8px; align-items:center;}
.photo-tile{
  position:relative; width:72px; height:72px; border-radius:8px; overflow:hidden; padding:0; margin:0;
  border:1px solid var(--line); background:#dde2dd; flex:0 0 auto;
}
.photo-tile img{width:100%; height:100%; object-fit:cover; display:block;}
button.photo-saved{cursor:pointer;}
button.photo-saved:hover, button.photo-saved:focus-visible{outline:2px solid var(--accent); outline-offset:1px;}
.photo-pm{position:absolute; left:3px; top:3px; font-size:9.5px; font-weight:700; padding:1px 4px; border-radius:4px; background:#5c4410; color:#fff;}
.photo-pending img{opacity:.55;}
.photo-ring{
  position:absolute; left:50%; top:50%; width:30px; height:30px; margin:-15px 0 0 -15px; border-radius:50%;
  background:conic-gradient(var(--accent) calc(var(--p, 0) * 1%), rgba(255,255,255,.75) 0);
  -webkit-mask:radial-gradient(circle, transparent 9px, #000 10px); mask:radial-gradient(circle, transparent 9px, #000 10px);
}
.photo-preparing .photo-ring{animation:photo-spin 1s linear infinite; background:conic-gradient(var(--accent) 25%, rgba(255,255,255,.75) 0);}
@keyframes photo-spin{to{transform:rotate(360deg);}}
.photo-failed{border-color:#b3261e;}
.photo-fail{position:absolute; inset:auto 0 0 0; display:flex; justify-content:space-between; gap:2px; padding:2px; background:rgba(255,255,255,.9);}
.photo-retry, .photo-discard{font-size:11px; padding:2px 6px; min-height:0; border-radius:5px;}
.photo-retry{color:#b3261e; font-weight:700;}
.photo-discard-staged{position:absolute; right:2px; top:2px; background:rgba(255,255,255,.9);}
.photo-add{
  width:72px; height:72px; border:1px dashed var(--accent); border-radius:8px; display:flex; flex-direction:column;
  align-items:center; justify-content:center; color:var(--accent); cursor:pointer; font-size:12px; font-weight:600;
  margin:0; text-transform:none; letter-spacing:0; background:var(--surface);
}
.photo-add:focus-within{outline:2px solid var(--accent); outline-offset:1px;}
.photo-add-plus{font-size:22px; line-height:1;}
.photo-input{position:absolute; width:1px; height:1px; opacity:0; overflow:hidden;}
.photo-msg{font-size:12px; color:var(--ink-faint); margin-top:6px;}
.photo-msg-error{color:#b3261e;}
.photo-stage{margin:4px 0 8px;}

.modal-overlay.photo-viewer{z-index:60; background:rgba(10,14,12,.82); padding:12px;}
.pv-card{
  background:var(--surface); border-radius:12px; width:100%; max-width:1000px; max-height:100%;
  display:flex; flex-direction:column; overflow:hidden; box-shadow:0 12px 32px rgba(0,0,0,.35);
}
.photo-viewer .modal-head.pv-head{position:static; margin:0; padding:10px 14px; border-radius:0; cursor:default; touch-action:auto; user-select:text;}
.pv-title{font-size:15px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;}
.pv-stage{
  position:relative; flex:0 0 auto; height:min(70vh, calc(100vh - 240px)); min-height:200px; background:#111;
  display:flex; align-items:center; justify-content:center; touch-action:pan-y;
}
.pv-img{
  width:100%; height:100%; object-fit:contain; display:block;
  background-size:contain; background-position:center; background-repeat:no-repeat;
}
.pv-nav{
  position:absolute; top:50%; transform:translateY(-50%); width:44px; height:64px; border:0; border-radius:8px;
  background:rgba(255,255,255,.18); color:#fff; font-size:32px; line-height:1; cursor:pointer;
}
.pv-nav:hover, .pv-nav:focus-visible{background:rgba(255,255,255,.35);}
.pv-prev{left:8px;} .pv-next{right:8px;}
.pv-info{padding:10px 14px 12px; display:flex; flex-direction:column; gap:6px;}
.pv-caption{width:100%; padding:7px 10px; border:1px solid var(--line); border-radius:6px; font:inherit; font-size:14px;}
.pv-meta{font-size:12.5px; color:var(--ink-faint);}
.pv-msg{font-size:12.5px; min-height:1em;}
.pv-actions{display:flex; gap:8px; justify-content:flex-end;}
.pv-download{
  text-decoration:none; display:inline-flex; align-items:center; color:var(--ink); border:1px solid var(--line);
  background:var(--surface); font-weight:600;
}
.pv-download:hover{border-color:var(--accent); color:var(--accent);}
.photo-undo{
  position:fixed; left:50%; bottom:18px; transform:translateX(-50%); z-index:70; display:flex; align-items:center; gap:12px;
  background:#1c231f; color:#fff; border-radius:10px; padding:10px 14px; font-size:14px; box-shadow:0 6px 18px rgba(0,0,0,.3);
  max-width:calc(100vw - 32px);
}
.photo-undo[hidden]{display:none;}
.photo-undo-btn{background:transparent; border:1px solid rgba(255,255,255,.6); color:#fff; font-weight:700; padding:4px 10px; border-radius:6px;}
@media (max-width:767px){
  .pv-stage{height:calc(100vh - 270px);}
  .pv-nav{width:36px; height:52px; font-size:26px;}
}
.pv-attach{display:flex; align-items:center; gap:8px; flex-wrap:wrap; background:var(--bg); border:1px solid var(--line); border-radius:8px; padding:8px;}
.pv-attach[hidden]{display:none;}
.pv-attach-lbl{font-size:13px; font-weight:600;}
.pv-attach-select{flex:1 1 220px; min-width:0; min-height:36px; border:1px solid var(--line); border-radius:6px; padding:4px 8px; font:inherit; font-size:14px; background:var(--surface);}
.photo-later{margin:6px 0 10px; padding:8px 10px; border:1px solid var(--line); border-radius:10px; background:var(--surface);}
.photo-later-head{display:flex; align-items:center; gap:8px; flex-wrap:wrap; font-size:13px;}
/* A site item's Overview / Detail photo: its role (and the way the camera faced) along the bottom (H162). */
.photo-role{position:absolute; left:0; right:0; bottom:0; font-size:9.5px; font-weight:700; line-height:1.2; padding:2px 3px; background:rgba(255,255,255,.92); color:var(--ink); text-align:center; white-space:normal;}
