/* v26: in-app camera, "Filing to" picker, photo feed (grouped by day), share links + public share page, job assignment. */

/* ---------- camera (full screen, always dark: it is a viewfinder) ---------- */
body.camera-mode { overflow: hidden; }
body.camera-mode > header.topbar { display: none !important; }
body.camera-mode main { padding: 0 !important; margin: 0 !important; }
.cam { position: fixed; inset: 0; z-index: 60; background: #05070b; color: #fff; display: flex; flex-direction: column; overflow: hidden;
  font-size: 16px; -webkit-user-select: none; user-select: none; animation: none !important; }
.cam-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #05070b; }
.cam.no-live .cam-video { display: none; }
.cam-flashfx { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; }
.cam-flashfx.go { animation: camflash .28s ease-out; }
@keyframes camflash { from { opacity: .85; } to { opacity: 0; } }
.cam-top { position: relative; z-index: 2; display: flex; align-items: center; gap: .6rem;
  padding: calc(.6rem + env(safe-area-inset-top, 0px)) calc(.8rem + env(safe-area-inset-right, 0px)) .6rem calc(.8rem + env(safe-area-inset-left, 0px));
  background: linear-gradient(180deg, rgba(0,0,0,.6), rgba(0,0,0,0)); }
.cam-top-right { display: flex; gap: .5rem; margin-left: auto; }
.cam-round { display: grid; place-items: center; width: 46px; height: 46px; flex: none; border-radius: 50%; border: 0; color: #fff; background: rgba(20,24,32,.62);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); cursor: pointer; }
.cam-round.big { width: 54px; height: 54px; }
.cam-round.on { background: #f2c14e; color: #1a1205; }
.cam-round[hidden] { display: none; }
.cam-filing { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: .5rem; min-height: 46px; padding: .3rem .9rem; border-radius: 99px; border: 0;
  background: rgba(20,24,32,.62); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); color: #fff; font: inherit; text-align: left; cursor: pointer; }
.cam-filing-txt { display: flex; flex-direction: column; min-width: 0; line-height: 1.15; }
.cam-filing-txt small { font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: rgba(255,255,255,.7); }
.cam-filing-txt b { font-size: .98rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cam-change { margin-left: auto; flex: none; font-size: .85rem; font-weight: 700; color: #f2c14e; }
.cam-locnote { position: relative; z-index: 2; align-self: center; margin: .2rem 1rem 0; max-width: 34rem; padding: .35rem .8rem; border-radius: 99px; font-size: .8rem;
  line-height: 1.3; text-align: center; color: rgba(255,255,255,.9); background: rgba(20,24,32,.55); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.cam-locnote[hidden] { display: none; }
.cam-fallback { position: relative; z-index: 2; flex: 1; display: grid; place-items: center; padding: 1rem; }
.cam-fallback[hidden] { display: none; }
.cam-fb-card { max-width: 30rem; padding: 1.4rem 1.2rem; border-radius: 22px; background: #141a26; border: 1px solid #263048; text-align: center; color: #eef1f6; }
.cam-fb-card h2 { color: #fff; font-size: 1.2rem; margin: .5rem 0 .4rem; }
.cam-fb-card p { color: #b9c2d3; font-size: .95rem; margin: 0 0 1rem; }
.cam-fb-ic { display: inline-grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: #222c42; color: #f2c14e; }
.cam-fb-actions { display: grid; gap: .55rem; }
.cam-fb-actions .btn { justify-content: center; min-height: 52px; }
.cam-bottom { position: relative; z-index: 2; margin-top: auto; display: flex; flex-direction: column; gap: .55rem;
  padding: .7rem calc(.9rem + env(safe-area-inset-right, 0px)) calc(1rem + env(safe-area-inset-bottom, 0px)) calc(.9rem + env(safe-area-inset-left, 0px));
  background: linear-gradient(0deg, rgba(0,0,0,.72), rgba(0,0,0,.35) 70%, rgba(0,0,0,0)); }
.cam-strip { display: flex; gap: .45rem; overflow-x: auto; scrollbar-width: none; padding: .1rem; min-height: 0; }
.cam-strip[hidden] { display: none; }
.cam-strip::-webkit-scrollbar { display: none; }
.cam-thumb button { display: block; width: 56px; height: 56px; padding: 0; border: 2px solid rgba(255,255,255,.9); border-radius: 12px; overflow: hidden; background: #222; cursor: pointer; }
.cam-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cam-thumb.saving button { opacity: .6; }
.cam-stages { display: flex; justify-content: center; gap: .35rem; }
.cam-stage { min-height: 36px; padding: .25rem .9rem; border-radius: 99px; border: 0; font: inherit; font-size: .85rem; font-weight: 700; letter-spacing: .02em;
  color: rgba(255,255,255,.85); background: rgba(20,24,32,.55); cursor: pointer; }
.cam-stage[aria-checked="true"] { background: #fff; color: #10141c; }
.cam-controls { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; }
.cam-controls > :first-child { justify-self: start; } .cam-controls > :last-child { justify-self: end; }
.cam-shutter { width: 84px; height: 84px; border-radius: 50%; border: 5px solid #fff; background: transparent; padding: 5px; cursor: pointer; }
.cam-shutter span { display: block; width: 100%; height: 100%; border-radius: 50%; background: #fff; transition: transform .12s; }
.cam-shutter:active span { transform: scale(.88); }
.cam-shutter:disabled span { opacity: .6; }
.cam-done { min-width: 92px; min-height: 50px; padding: .4rem 1.1rem; border-radius: 99px; border: 0; font: inherit; font-weight: 800; color: #1a1205; background: #f2c14e; cursor: pointer; }
@media (min-width: 720px) {
  .cam-bottom { align-items: center; } .cam-bottom > * { width: min(100%, 560px); }
  .cam-strip { justify-content: center; }
}

/* ---------- "Filing to" picker + camera settings (normal themed modals on top of the camera) ---------- */
.modal-backdrop:has(.filing-picker), .modal-backdrop:has(.cam-settings) { z-index: 80; }
.fp-why { margin: 0 0 .6rem; font-weight: 650; }
.fp-search { width: 100%; box-sizing: border-box; margin-bottom: .5rem; }
.fp-list { display: grid; gap: .35rem; max-height: min(52vh, 460px); overflow-y: auto; margin: 0 -.2rem; padding: 0 .2rem; }
.fp-h { margin: .6rem 0 .1rem; font-size: .78rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.fp-row { display: flex; align-items: center; gap: .7rem; width: 100%; min-height: 58px; padding: .5rem .75rem; border-radius: var(--radius-md); border: 1.5px solid var(--line);
  background: var(--surface); color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
.fp-row.current { border-color: var(--accent); background: var(--accent-soft); }
.fp-ic { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--surface-3); color: var(--accent); flex: none; }
.fp-main { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.fp-main b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fp-main small { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fp-dist { color: var(--muted); font-size: .85rem; flex: none; }
.fp-note { color: var(--muted); font-size: .85rem; margin: .8rem 0 .4rem; }
.fp-empty { margin: .6rem 0; }
#fp-set-here { margin-top: .6rem; }
.cs-row { display: flex; align-items: flex-start; gap: .75rem; padding: .65rem 0; border-bottom: 1px solid var(--line); }
.cs-row input[type=checkbox] { width: 24px; height: 24px; margin-top: .15rem; flex: none; accent-color: var(--accent); }
.cs-row span { display: flex; flex-direction: column; flex: 1; } .cs-row small { color: var(--muted); }
.cs-row select { flex: none; min-height: 44px; }

/* ---------- photo feed ---------- */
.loc-row { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .6rem; margin: -.2rem 0 1rem; padding: .55rem .8rem; border-radius: var(--radius-md);
  background: var(--surface); border: 1px solid var(--line); font-size: .9rem; color: var(--ink-2); }
.loc-row .icon { color: var(--accent); }
.loc-text { flex: 1 1 14rem; }
.loc-msg { flex-basis: 100%; color: var(--muted); font-size: .85rem; } .loc-msg:empty { display: none; }
.feed-filters { display: flex; flex-direction: column; gap: .5rem; margin: 0 0 .6rem; }
.feed-filters .chips { margin: 0; }
.feed-tags { display: flex; gap: .5rem; flex-wrap: wrap; }
.feed-tags select { min-height: 44px; max-width: 100%; }
.chip-av { display: inline-grid; place-items: center; min-width: 1.8em; font-weight: 800; font-size: .85rem; letter-spacing: .02em; }
.day-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin: 0 0 .35rem; }
.day-head h3 { margin: 0 !important; font-size: 1.02rem !important; color: var(--ink) !important; }
.day-head h3 small { color: var(--muted); font-weight: 600; font-size: .85rem; }
.feed-grid { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)) !important; gap: .4rem !important; margin: .2rem 0 .4rem !important; }
.feed-tile img { aspect-ratio: 1 / 1 !important; border-radius: 12px !important; }
.feed-tile figcaption { font-size: .78rem; line-height: 1.25; display: flex; gap: .2rem; align-items: flex-start; overflow-wrap: anywhere; }
.feed-tile .stage-tag { top: .3rem; left: .3rem; font-size: .6rem; padding: .1rem .45rem; }
.stage-tag.st-log { background: rgba(42,93,159,.9); }
.taker { position: absolute; left: .3rem; top: calc(100% - 2.1rem); display: grid; place-items: center; min-width: 1.75rem; height: 1.75rem; padding: 0 .3rem; border-radius: 99px;
  font-size: .68rem; font-weight: 800; letter-spacing: .03em; color: #fff; background: rgba(23,35,58,.86); box-shadow: 0 0 0 2px rgba(255,255,255,.85); }
.feed-tile:has(figcaption) .taker { top: auto; bottom: calc(1.5rem + .35rem); }
.feed-tile .photo-btn { position: relative; }
.feed-tile { position: relative; }
.sel-mark { position: absolute; top: .3rem; right: .3rem; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%;
  border: 2px solid #fff; background: rgba(0,0,0,.35); color: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.3); }
.feed-tile.selected .sel-mark { background: var(--accent); border-color: #fff; }
.feed-tile.selected img { outline: 3px solid var(--accent); outline-offset: -3px; }
.photos-tab.selecting .feed-tile .photo-btn { cursor: pointer; }
.photos-tab.selecting { padding-bottom: 5rem; }
.sel-bar { position: fixed; z-index: 45; left: calc(var(--side) + .75rem); right: .75rem; bottom: calc(var(--tabbar) + .6rem); display: flex; align-items: center; gap: .5rem;
  padding: .55rem .6rem .55rem 1rem; border-radius: 18px; background: var(--surface); border: 1px solid var(--line-2); box-shadow: var(--shadow-3); }
.sel-bar b { margin-right: auto; }
.share-links { margin-top: 1rem; }
.share-links[hidden] { display: none; }
.share-list { list-style: none; margin: .4rem 0 0; padding: 0; display: grid; gap: .5rem; }
.share-item { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem; padding: .55rem 0; border-top: 1px solid var(--line); }
.share-item > div:first-child { display: flex; flex-direction: column; }
.share-item[data-status="revoked"] b, .share-item[data-status="expired"] b { color: var(--muted); text-decoration: line-through; }
.photo-viewer .pv-meta { color: var(--muted); margin: .5rem 0; font-size: .92rem; }

/* ---------- share dialog ---------- */
.share-thumbs { display: flex; gap: .35rem; overflow-x: auto; margin-bottom: .8rem; }
.share-thumbs img { width: 64px; height: 64px; object-fit: cover; border-radius: 10px; flex: none; background: var(--surface-3); }
.share-more { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 10px; background: var(--surface-3); font-weight: 800; flex: none; }
.share-dialog .field { display: flex; flex-direction: column; gap: .3rem; font-weight: 650; margin-bottom: .5rem; }
.share-dialog .field input { min-height: 48px; }
.share-status { min-height: 1.3em; color: var(--muted); margin: .4rem 0; } .share-status.err { color: var(--bad); font-weight: 650; }
.share-ok { display: flex; align-items: center; gap: .3rem; font-weight: 700; color: var(--ok); margin: 0 0 .5rem; }
.share-dialog .linkbox { width: 100%; box-sizing: border-box; min-height: 48px; font-size: .9rem; margin-bottom: .6rem; }
.share-dialog .btn-row { flex-wrap: wrap; }

/* ---------- public share page (#/share/<token>) ---------- */
body.share-mode > main { max-width: 980px; }
.sp-page { padding: calc(1rem + env(safe-area-inset-top, 0px)) 1rem calc(2rem + env(safe-area-inset-bottom, 0px)); color: var(--ink); }
.sp-brand { display: flex; align-items: center; gap: .55rem; font-weight: 800; font-size: 1.05rem; margin: 0 0 1rem; color: var(--ink); }
.sp-head { margin-bottom: 1rem; }
.sp-head h1 { font-size: 1.75rem; line-height: 1.15; margin: 0 0 .3rem; }
.sp-sub { font-size: 1.05rem; margin: 0 0 .2rem; color: var(--ink-2); }
.sp-count { color: var(--muted); margin: 0; }
.sp-day { margin: 1.2rem 0; }
.sp-day h2 { font-size: 1.1rem; margin: 0 0 .5rem; }
.sp-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: .6rem; }
@media (min-width: 640px) { .sp-grid { grid-template-columns: repeat(3, 1fr); } }
.sp-photo { margin: 0; }
.sp-img { display: block; width: 100%; padding: 0; border: 0; background: var(--surface-3); border-radius: 14px; overflow: hidden; cursor: zoom-in; aspect-ratio: 4 / 3; }
.sp-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sp-photo.missing .sp-img { background: repeating-linear-gradient(45deg, var(--surface-3), var(--surface-3) 8px, var(--surface-2) 8px, var(--surface-2) 16px); }
.sp-photo figcaption { display: flex; justify-content: space-between; gap: .4rem; font-size: .9rem; margin-top: .3rem; color: var(--ink-2); }
.sp-photo figcaption time { color: var(--muted); flex: none; }
.sp-foot { margin-top: 2rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.sp-contact { display: flex; flex-wrap: wrap; gap: .5rem 1.2rem; }
.sp-contact a { display: inline-flex; align-items: center; gap: .3rem; min-height: 44px; font-weight: 650; }
.sp-viewer { position: fixed; inset: 0; z-index: 100; background: rgba(0,0,0,.92); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 1rem; color: #fff; }
.sp-viewer[hidden] { display: none; }
.sp-viewer img { max-width: 100%; max-height: 82vh; object-fit: contain; border-radius: 8px; }
.sp-viewer p { margin: .6rem 0 0; text-align: center; }
.sp-close { position: absolute; top: calc(.6rem + env(safe-area-inset-top, 0px)); right: .6rem; width: 48px; height: 48px; border-radius: 50%; border: 0; background: rgba(255,255,255,.15); color: #fff; display: grid; place-items: center; }
.sp-msg .ap-card { margin-top: .5rem; }

/* ---------- job assignment ---------- */
.assignees { display: inline-flex; align-items: center; }
.assignees .as-badge { display: inline-grid; place-items: center; min-width: 30px; height: 30px; padding: 0 .3rem; border-radius: 99px; font-size: .72rem; font-weight: 800;
  letter-spacing: .02em; color: #fff; background: var(--brand-2); border: 2px solid var(--surface); margin-left: -6px; }
.assignees .as-badge:first-child { margin-left: 0; }
.assignees .as-badge.me { background: var(--accent); color: var(--accent-ink); }
.hero .assignees .as-badge { border-color: transparent; }
.job-filter { display: flex; gap: .4rem; overflow-x: auto; scrollbar-width: none; margin: 0 0 .9rem; padding: .1rem; }
.job-filter::-webkit-scrollbar { display: none; }
.job-filter .chip { flex: none; min-height: 40px; padding: .3rem .9rem; }
.assign-field { display: flex; flex-wrap: wrap; gap: .4rem; }
.assign-field label { display: inline-flex; align-items: center; gap: .4rem; min-height: 44px; padding: .2rem .8rem .2rem .5rem; border-radius: 99px; border: 1.5px solid var(--line-2); background: var(--surface); cursor: pointer; }
.assign-field label:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.assign-field input { width: 20px; height: 20px; accent-color: var(--accent); }
.pc-assign { margin-left: auto; }
button.person-chip { font: inherit; text-align: left; cursor: pointer; }
.field .field-label { display: block; font-weight: 650; margin-bottom: .35rem; }
/* Photos tab actions: a tidy grid on phones (Take photos full width, then two equal buttons). */
@media (max-width: 640px) {
  .photos-tab .page-head { flex-direction: column; align-items: stretch; }
  .photos-tab .photo-actions { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; width: 100%; }
  .photos-tab .photo-actions > * { justify-content: center; white-space: nowrap; min-width: 0; }
  .photos-tab .photo-actions #take-photos { grid-column: 1 / -1; }
  .photos-tab .photo-actions > :only-child, .photos-tab .photo-actions > #add-progress-photo:last-child { grid-column: 1 / -1; }
}
