/* ESS Field Capture (ESS-PHOTO-001): phone-first. Touch targets >= 48px; address always visible in the bar. */
:root {
  --navy: #0f3c8c; --bg: #f3f5f9; --card: #fff; --fg: #1b2433; --muted: #6a7486; --line: #e3e7ee;
  --blue: #2f6fe0; --green: #1e9e5a; --amber: #b7791f; --red: #d93a3a; --violet: #7c5cdb;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--fg); font: 16px/1.4 system-ui, -apple-system, "Segoe UI", sans-serif; }
body { padding-bottom: env(safe-area-inset-bottom); }
button, input, select, textarea { font: inherit; }
.bar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 10px; padding: calc(8px + env(safe-area-inset-top)) 12px 8px; background: var(--navy); color: #fff; min-height: 60px; }
.bar .back[hidden] { display: none; }
.bar .back { color: #fff; text-decoration: none; font-size: 34px; line-height: 1; width: 40px; height: 44px; display: flex; align-items: center; justify-content: center; }
.bar .where { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.bar .where b { font-size: 17px; line-height: 1.2; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.bar .where span { font-size: 13px; opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pill { border: 0; border-radius: 999px; padding: 8px 12px; font-size: 13px; font-weight: 600; background: rgba(255,255,255,.18); color: #fff; min-height: 36px; }
.pill.off { background: #fde6e6; color: var(--red); } .pill.wait { background: #fff3d6; color: #8a6100; } .pill.ok { background: #e3f6ec; color: var(--green); }
main { padding: 12px; max-width: 760px; margin: 0 auto; outline: none; }
h2 { font-size: 15px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 18px 4px 8px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px; margin-bottom: 10px; }
.addr { font-size: 22px; font-weight: 800; line-height: 1.2; margin: 2px 0 4px; }
.muted { color: var(--muted); } .small { font-size: 13px; }
.btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 52px; border-radius: 12px; border: 1px solid var(--line); background: #fff; color: var(--fg); font-weight: 600; text-decoration: none; padding: 10px 14px; cursor: pointer; }
.btn.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn.huge { min-height: 84px; font-size: 22px; border-radius: 18px; }
.btn.green { background: var(--green); border-color: var(--green); color: #fff; }
.btn.warn { color: var(--red); border-color: #f3c4c4; }
.btn:disabled { opacity: .5; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 10px 0; }
.kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.kpi .n { display: block; font-size: 26px; font-weight: 800; } .kpi .t { font-size: 13px; color: var(--muted); }
.kpi.red .n { color: var(--red); } .kpi.green .n { color: var(--green); } .kpi.amber .n { color: var(--amber); }
.headline { font-weight: 700; padding: 10px 12px; border-radius: 10px; margin: 10px 0; }
.headline.no { background: #fde6e6; color: var(--red); } .headline.half { background: #fff3d6; color: #8a6100; } .headline.yes { background: #e3f6ec; color: var(--green); }
.list { list-style: none; margin: 0; padding: 0; }
.list li { border-bottom: 1px solid var(--line); }
.list li:last-child { border-bottom: 0; }
.list .it { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 52px; padding: 8px 4px; background: none; border: 0; text-align: left; color: inherit; text-decoration: none; cursor: pointer; }
.list .it .lbl { flex: 1; min-width: 0; }
.list .it .lbl small { display: block; color: var(--muted); font-size: 12px; }
.dot { width: 14px; height: 14px; border-radius: 50%; flex: 0 0 14px; background: #c8d0dd; }
.st-Captured .dot { background: var(--green); } .st-MissingRequired .dot { background: var(--red); } .st-NeedsRetake .dot { background: var(--amber); }
.st-IntentionallyNotCaptured .dot { background: var(--violet); } .st-NotApplicable .dot { background: #e3e7ee; } .st-Unconfirmed .dot { background: #fff; border: 2px dashed var(--muted); }
.tag { font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 6px; background: #eef0f4; color: #556; white-space: nowrap; }
.tag.red { background: #fde6e6; color: var(--red); } .tag.green { background: #e3f6ec; color: var(--green); } .tag.amber { background: #fff3d6; color: #8a6100; } .tag.violet { background: #efe9ff; color: var(--violet); }
.current { border: 2px solid var(--blue); }
.current .sect { font-size: 13px; color: var(--muted); }
.current .label { font-size: 24px; font-weight: 800; margin: 2px 0 6px; }
.field { display: block; margin: 8px 0; } .field span { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.field input, .field textarea, .field select { width: 100%; min-height: 48px; padding: 10px 12px; border: 1px solid #cfd6e2; border-radius: 10px; background: #fff; }
.strip { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0; }
.strip img, .strip .ph { width: 92px; height: 92px; object-fit: cover; border-radius: 10px; background: #e7ebf2; flex: 0 0 92px; }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 560px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } .kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.tile { position: relative; background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.tile img, .tile .ph { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: #e7ebf2; pointer-events: none; }
.tile .cap { padding: 6px 8px; font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile .nums { position: absolute; top: 6px; left: 6px; display: flex; gap: 4px; }
.tile .nums span { background: rgba(15,23,42,.75); color: #fff; font-size: 12px; font-weight: 700; border-radius: 6px; padding: 2px 6px; }
.tile .flags { position: absolute; top: 6px; right: 6px; display: flex; gap: 4px; }
.tile.excluded img { opacity: .45; }
.tile.lifted { opacity: .3; }
.tile.target { outline: 3px solid var(--blue); }
.ghost { position: fixed; z-index: 20; width: 140px; pointer-events: none; transform: translate(-50%, -60%); box-shadow: 0 12px 30px rgba(0,0,0,.3); border-radius: 12px; overflow: hidden; background: #fff; }
.ghost img { width: 100%; display: block; }
.dragging { touch-action: none; }
.seg { display: flex; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff; margin: 8px 0; }
.seg button { flex: 1; min-height: 48px; border: 0; background: none; font-weight: 600; }
.seg button.on { background: var(--blue); color: #fff; }
.inv { display: flex; align-items: center; gap: 10px; min-height: 56px; border-bottom: 1px solid var(--line); }
.inv:last-child { border-bottom: 0; }
.inv .lbl { flex: 1; } .inv .lbl small { display: block; color: var(--muted); font-size: 12px; }
.step { display: flex; align-items: center; gap: 6px; }
.step button, .yn button { min-width: 48px; min-height: 44px; border-radius: 10px; border: 1px solid #cfd6e2; background: #fff; font-weight: 700; }
.step b { min-width: 28px; text-align: center; font-size: 18px; }
.yn { display: flex; gap: 6px; } .yn button.on.y { background: var(--green); color: #fff; border-color: var(--green); } .yn button.on.n { background: #556; color: #fff; border-color: #556; }
.unconf { color: var(--amber); font-weight: 600; }
.viewer img { width: 100%; max-height: 70vh; object-fit: contain; background: #111; border-radius: 12px; display: block; }
.viewer.zoom .imgwrap { overflow: auto; max-height: 75vh; border-radius: 12px; background: #111; }
.viewer.zoom img { width: auto; max-width: none; max-height: none; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: 14px; } .kv dt { color: var(--muted); } .kv dd { margin: 0; }
.toggle { display: flex; align-items: center; justify-content: space-between; min-height: 52px; border-bottom: 1px solid var(--line); }
.toggle input { width: 26px; height: 26px; }
#toast { position: fixed; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: #1b2433; color: #fff; padding: 12px 18px; border-radius: 12px; font-weight: 600; z-index: 30; max-width: calc(100% - 32px); box-shadow: 0 8px 24px rgba(0,0,0,.25); }
#toast.bad { background: var(--red); }
.sticky-actions { position: sticky; bottom: 0; padding: 10px 0 calc(10px + env(safe-area-inset-bottom)); background: linear-gradient(transparent, var(--bg) 30%); }
details summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; font-weight: 600; }
