/* Pulte Pics: photographer side */
:root {
  --bg: #eef2f6;
  --card: #ffffff;
  --ink: #102030;
  --muted: #5f6e7c;
  --line: #dde3ea;
  --brand: #0b3c5d;
  --brand-2: #14608f;
  --accent: #f5b800;
  --good: #1d8a4e;
  --bad: #c0392b;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(16, 32, 48, .06), 0 4px 14px rgba(16, 32, 48, .06);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.45 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  -webkit-text-size-adjust: 100%;
}
.hide { display: none !important; }
.visually-hidden { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

/* ---------- header ---------- */
header {
  position: sticky; top: 0; z-index: 20;
  background: linear-gradient(120deg, #072a43, var(--brand) 60%, var(--brand-2));
  color: #fff;
  padding: calc(env(safe-area-inset-top) + 12px) 18px 14px;
  box-shadow: 0 2px 12px rgba(7, 42, 67, .25);
}
.brand { display: flex; align-items: center; gap: 12px; max-width: 760px; margin: 0 auto; }
.logo { width: 36px; height: 36px; flex: none; }
header h1 { margin: 0; font-size: 19px; letter-spacing: -.01em; }
header .sub { font-size: 13px; opacity: .8; }

main { padding: 14px 16px 150px; max-width: 760px; margin: 0 auto; }

/* ---------- type ---------- */
h2, h3 { margin: 0; }
.title { font-size: 22px; letter-spacing: -.02em; }
.section { font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: 26px 4px 10px; }
.intro { margin: 6px 4px 14px; }
.intro .muted { margin-top: 4px; }
p { margin: 8px 0; }
.muted { color: var(--muted); font-size: 14px; }
.center { text-align: center; }
label { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin: 12px 0 6px; }

/* ---------- surfaces ---------- */
.card {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 16px; margin: 12px 0; border: 1px solid rgba(221, 227, 234, .7);
}

/* ---------- controls ---------- */
button, .btn {
  font: inherit; font-weight: 600; font-size: 16px;
  border: 1px solid var(--line); background: #fff; color: var(--ink);
  border-radius: 12px; padding: 12px 16px; min-height: 50px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  text-decoration: none; transition: transform .08s, box-shadow .15s, background .15s;
}
button:active, .btn:active { transform: scale(.98); }
button.primary, .btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 4px 12px rgba(11, 60, 93, .25); }
button.good { background: var(--good); border-color: var(--good); color: #fff; box-shadow: 0 4px 12px rgba(29, 138, 78, .25); }
button.ghost { background: transparent; border-color: transparent; color: var(--brand); }
button.danger { background: #fff; color: var(--bad); border-color: #f1c6c0; }
button.big { min-height: 58px; font-size: 17px; }
button.small, .btn.small { min-height: 38px; padding: 7px 12px; font-size: 14px; font-weight: 600; border-radius: 10px; }
button:disabled { opacity: .5; }
button.back { min-height: 36px; padding: 6px 12px; font-size: 14px; border-radius: 99px; background: #fff; }
.row { display: flex; gap: 10px; align-items: center; }
.row > .grow, .grow { flex: 1; min-width: 0; }
.row.between { justify-content: space-between; }
.row.two { align-items: flex-end; }
.stack > * { width: 100%; margin-top: 10px; }
input[type=text], input[type=email], input[type=number], input[type=date], input[type=password], select, textarea {
  font: inherit; width: 100%; padding: 11px 12px; min-height: 48px;
  border: 1px solid var(--line); border-radius: 12px; background: #fbfcfd; color: var(--ink);
  -webkit-appearance: none; appearance: none;
}
select { background: #fbfcfd url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%235f6e7c' stroke-width='2'/%3E%3C/svg%3E") no-repeat right 14px center; padding-right: 36px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand-2); box-shadow: 0 0 0 3px rgba(20, 96, 143, .15); background: #fff; }
textarea { resize: vertical; }

/* ---------- start ---------- */
.step { display: flex; gap: 14px; align-items: flex-start; padding: 4px 0 8px; }
.num-badge { flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--brand); color: #fff; font-size: 14px; font-weight: 700; display: flex; align-items: center; justify-content: center; margin-top: 34px; }
.drop { display: flex; align-items: center; gap: 12px; margin: 0; padding: 16px; border: 2px dashed #c6d2dd; border-radius: 14px; background: #f7fafc; color: var(--brand); font-size: 16px; font-weight: 600; cursor: pointer; }
.drop.has { border-style: solid; border-color: var(--good); color: var(--good); background: #f1faf4; }

/* ---------- review ---------- */
.review-card { display: grid; grid-template-columns: 92px 1fr; gap: 14px; align-items: start; }
.thumb { width: 92px; height: 92px; border-radius: 12px; object-fit: cover; box-shadow: inset 0 0 0 1px rgba(0,0,0,.08); background: #e8edf2; }
.review-card .fields { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.review-card .fields input, .review-card .fields select { min-height: 44px; font-weight: 600; }
.review-card .acts { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.review-card.warn { box-shadow: var(--shadow), inset 4px 0 0 #e7a400; }
.flag { color: #a4361f; font-size: 13px; font-weight: 600; margin-top: 6px; display: flex; gap: 6px; }
.flag::before { content: "!"; flex: none; width: 17px; height: 17px; border-radius: 50%; background: #fbe3dc; color: #a4361f; font-size: 12px; display: flex; align-items: center; justify-content: center; }
.notice { background: #fff8e6; border: 1px solid #f3dc9b; color: #6b4f00; border-radius: 14px; padding: 12px 14px; margin: 10px 0; font-size: 14px; font-weight: 600; }
.sticky-actions { position: sticky; bottom: calc(102px + env(safe-area-inset-bottom)); background: linear-gradient(transparent, var(--bg) 22%); padding-top: 18px; z-index: 5; }

/* ---------- route ---------- */
.summary .title { font-size: 20px; }
.progress { height: 10px; border-radius: 99px; background: #e5ebf0; overflow: hidden; margin: 12px 0; }
.progress i { display: block; height: 100%; width: 0; border-radius: 99px; background: linear-gradient(90deg, var(--good), #33b06c); transition: width .4s; }
.agent-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.achip { display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px 6px 8px; border-radius: 99px; background: #f1f4f7; font-size: 14px; font-weight: 600; }
.achip b { color: var(--muted); font-weight: 600; }
.dot { display: inline-block; width: 14px; height: 14px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0,0,0,.25); flex: none; }
.lot-row { display: flex; gap: 12px; align-items: center; padding: 12px 14px; margin: 8px 0; cursor: pointer; }
.lot-row .order { width: 30px; height: 30px; flex: none; border-radius: 50%; background: #eef2f6; color: var(--muted); font-size: 13px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.lot-row .num { font-size: 21px; font-weight: 800; letter-spacing: -.01em; min-width: 62px; }
.lot-row .who { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 14px; }
.pill { font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 99px; white-space: nowrap; }
.pill.done { background: #e4f5ea; color: var(--good); }
.pill.next { background: var(--brand); color: #fff; }
.pill.part { background: #fff3d6; color: #7a5a00; }
.lot-row.done { opacity: .62; }
.lot-row.done .order { background: #e4f5ea; color: var(--good); }
.lot-row.next { box-shadow: var(--shadow), 0 0 0 2px var(--brand); }
.lot-row.next .order { background: var(--brand); color: #fff; }

/* ---------- one lot ---------- */
.lot-hero { position: relative; overflow: hidden; display: flex; justify-content: space-between; align-items: flex-end; padding: 18px 18px 16px 24px; }
.lot-hero::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 8px; background: var(--c, #ccc); }
.agent-tag { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 15px; padding: 5px 12px 5px 8px; border-radius: 99px; background: #f1f4f7; }
.big-lot { font-size: 60px; font-weight: 800; line-height: 1; letter-spacing: -.03em; margin-top: 10px; }
.big-lot small { display: block; font-size: 13px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 700; margin-bottom: 2px; }
.lot-count { text-align: right; font-size: 14px; color: var(--muted); }
.lot-count b { display: block; font-size: 28px; color: var(--ink); line-height: 1.1; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips button { min-height: 42px; padding: 8px 14px; font-weight: 600; font-size: 14px; border-radius: 99px; }
.chips button.on { background: var(--brand); color: #fff; border-color: var(--brand); }
.preview { margin: 14px 0 4px; background: #f6f9fb; border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; }
.preview-label { font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
#lot-preview { font-size: 15px; }

/* find the lot */
.compass { display: flex; gap: 16px; align-items: center; }
.compass svg { flex: none; transition: transform .15s linear; filter: drop-shadow(0 2px 4px rgba(16,32,48,.12)); }
.compass .small { margin-top: 10px; }
.dist { font-size: 28px; font-weight: 800; letter-spacing: -.02em; line-height: 1.15; }
#mini { position: relative; height: 320px; border-radius: var(--radius); overflow: hidden; background: #cfe3c0 url(map.jpg) no-repeat; box-shadow: var(--shadow); margin: 12px 0; }
#mini-target { position: absolute; width: 36px; height: 36px; margin: -18px 0 0 -18px; border: 4px solid #e11d48; border-radius: 50%; box-shadow: 0 0 0 3px #fff, 0 2px 8px rgba(0,0,0,.3); }
#mini-me, .me { position: absolute; width: 18px; height: 18px; margin: -9px 0 0 -9px; background: #1a73e8; border: 3px solid #fff; border-radius: 50%; box-shadow: 0 0 0 6px rgba(26,115,232,.22); z-index: 3; }
#mini-acc { position: absolute; border-radius: 50%; transform: translate(-50%, -50%); background: rgba(26,115,232,.12); border: 1px solid rgba(26,115,232,.4); pointer-events: none; z-index: 2; }
#mini-here { position: absolute; width: 32px; height: 32px; margin: -16px 0 0 -16px; border-radius: 50%; background: rgba(255, 221, 0, .4); border: 3px solid var(--accent); }
#mini-me i { display: none; position: absolute; left: 50%; bottom: 100%; margin-left: -9px; border-left: 9px solid transparent; border-right: 9px solid transparent; border-bottom: 20px solid rgba(26,115,232,.75); }
#mini-me.facing i { display: block; }

/* photos taken on a lot */
#lot-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 8px; }
#lot-photos:empty { display: none; }
#lot-photos-sum { margin: 0 0 10px; font-weight: 600; }
#lot-photos-sum:only-child, #lot-photos:empty ~ * { margin: 0; }
#lot-photos-sum.ok { color: var(--good); }
.shot { position: relative; aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: #e7ebef; display: block; }
.shot img { width: 100%; height: 100%; object-fit: cover; display: block; opacity: .55; }
.shot.sent img { opacity: 1; }
.shot b { position: absolute; right: 4px; bottom: 4px; width: 22px; height: 22px; border-radius: 50%; background: #7b8794; color: #fff; font-size: 13px; display: flex; align-items: center; justify-content: center; box-shadow: 0 0 0 2px #fff; }
.shot.sent b { background: var(--good); }

/* ---------- map ---------- */
.map-tools { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; }
.seg { display: inline-flex; border-radius: 12px; overflow: hidden; box-shadow: var(--shadow); }
.seg button { min-height: 40px; width: 46px; padding: 0; border: 0; border-radius: 0; font-size: 22px; font-weight: 500; }
.seg button + button { border-left: 1px solid var(--line); }
#mapwrap { overflow: auto; touch-action: pan-x pan-y; height: calc(100vh - 300px); height: calc(100dvh - 300px); min-height: 320px; border-radius: var(--radius); background: #cfe3c0; box-shadow: var(--shadow); -webkit-overflow-scrolling: touch; }
#mapinner { position: relative; }
#mapinner img { display: block; width: 100%; }
.pin {
  position: absolute; transform: translate(-50%, -50%); box-sizing: border-box;
  min-width: var(--pin, 14px); height: var(--pin, 14px); padding: 0 1px; border-radius: 99px;
  border: 1px solid #102030; color: #102030; font-size: calc(var(--pin, 14px) * .58); line-height: 1; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
}
.pin.done { opacity: .45; }
.pin.next { box-shadow: 0 0 0 2px #fff, 0 0 0 4px #e11d48; z-index: 2; }
#mapinner.far .pin { font-size: 0; padding: 0; }
.routeline { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.routeline polyline { fill: none; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }

/* ---------- settings ---------- */
.agent-row { display: grid; grid-template-columns: 48px 1fr auto; gap: 10px; align-items: center; }
.agent-row input[type=color] { width: 48px; height: 48px; padding: 0; border: 0; border-radius: 12px; background: none; }
.agent-row input[type=color]::-webkit-color-swatch-wrapper { padding: 0; }
.agent-row input[type=color]::-webkit-color-swatch { border: 1px solid rgba(0,0,0,.15); border-radius: 12px; }
.team-link { display: flex; gap: 10px; align-items: center; background: linear-gradient(120deg, #072a43, var(--brand)); color: #fff; }
.team-link .muted { color: rgba(255,255,255,.75); }
.team-link button, .team-link .btn { background: rgba(255,255,255,.14); color: #fff; border-color: rgba(255,255,255,.3); }
.diag { font-size: 14px; color: var(--muted); line-height: 1.7; }
.diag b { color: var(--ink); }

/* ---------- bottom bar ---------- */
nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  background: rgba(255,255,255,.92); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
#status { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; padding: 7px 18px; color: var(--muted); border-bottom: 1px solid var(--line); max-width: 760px; margin: 0 auto; }
#status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--good); flex: none; }
#status.busy { color: #7a5a00; }
#status.busy::before { background: var(--accent); animation: pulse 1.2s infinite; }
#status.err { color: var(--bad); }
#status.err::before { background: var(--bad); }
@keyframes pulse { 50% { opacity: .3; } }
nav .tabs { display: flex; max-width: 760px; margin: 0 auto; }
nav .tabs button { flex: 1; flex-direction: column; gap: 2px; border: 0; border-radius: 0; min-height: 58px; font-size: 12px; color: var(--muted); background: none; }
nav .tabs svg { width: 24px; height: 24px; }
nav .tabs button.on { color: var(--brand); }

/* ---------- rapid camera ---------- */
#camera { position: fixed; inset: 0; z-index: 50; background: #000; }
#cam-video { width: 100%; height: 100%; object-fit: contain; }
#cam-top { position: absolute; top: calc(env(safe-area-inset-top) + 10px); left: 50%; transform: translateX(-50%); color: #fff; font-size: 13px; font-weight: 600; background: rgba(0,0,0,.45); padding: 6px 14px; border-radius: 99px; white-space: nowrap; }
#cam-bar { position: absolute; left: 0; right: 0; bottom: calc(env(safe-area-inset-bottom) + 22px); display: flex; align-items: center; justify-content: space-around; }
#cam-count { color: #fff; font-size: 17px; font-weight: 800; width: 84px; text-align: center; text-shadow: 0 1px 3px #000; }
#cam-shutter { width: 84px; height: 84px; min-height: 84px; border-radius: 50%; background: #fff; border: 6px solid rgba(255,255,255,.4); background-clip: padding-box; padding: 0; box-shadow: none; }
#cam-shutter:active { background: #d9d9d9; transform: scale(.94); }
#cam-close { width: 84px; background: rgba(255,255,255,.16); color: #fff; border-color: rgba(255,255,255,.45); border-radius: 99px; }
#cam-flash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; }
#cam-flash.go { animation: flash .18s ease-out; }
@keyframes flash { from { opacity: .7; } to { opacity: 0; } }
#cam-lenses { position: absolute; left: 0; right: 0; bottom: calc(env(safe-area-inset-bottom) + 128px); display: flex; justify-content: center; gap: 10px; }
#cam-lenses button { min-height: 42px; min-width: 50px; padding: 0 12px; border-radius: 99px; background: rgba(0,0,0,.5); color: #fff; border-color: rgba(255,255,255,.45); font-size: 15px; box-shadow: none; }
#cam-lenses button.on { background: #ffd60a; color: #000; border-color: #ffd60a; }

/* The control layer. Held sideways it lays out like the iPhone camera: shutter at the right middle, lenses beside it,
   saved count above and Done below. With rotation lock on, the screen stays tall, so the whole layer is turned to
   face the photographer (tilt-l: top of the phone to the left, tilt-r: to the right). */
#cam-ui { position: absolute; left: 0; top: 0; width: 100%; height: 100%; transform-origin: 0 0; }
#camera.tilt-l #cam-ui { width: 100vh; height: 100vw; transform: rotate(90deg) translateY(-100%); }
#camera.tilt-r #cam-ui { width: 100vh; height: 100vw; transform: rotate(-90deg) translateX(-100%); }
@supports (height: 100dvh) {
  #camera.tilt-l #cam-ui, #camera.tilt-r #cam-ui { width: 100dvh; height: 100dvw; }
  #camera.tilt-l #cam-ui { transform: rotate(90deg) translateY(-100%); }
  #camera.tilt-r #cam-ui { transform: rotate(-90deg) translateX(-100%); }
}
@media (orientation: landscape) {
  #cam-bar { left: auto; top: 0; bottom: 0; right: calc(env(safe-area-inset-right) + 14px); width: 96px; flex-direction: column; justify-content: space-around; padding: 14px 0; }
  #cam-lenses { left: auto; top: 0; bottom: 0; right: calc(env(safe-area-inset-right) + 124px); flex-direction: column; justify-content: center; }
  #cam-count { width: auto; }
}
#camera.tilt-l #cam-bar, #camera.tilt-r #cam-bar { left: auto; top: 0; bottom: 0; right: 18px; width: 96px; flex-direction: column; justify-content: space-around; padding: 14px 0; }
#camera.tilt-l #cam-lenses, #camera.tilt-r #cam-lenses { left: auto; top: 0; bottom: 0; right: 128px; flex-direction: column; justify-content: center; }
#camera.tilt-l #cam-count, #camera.tilt-r #cam-count { width: auto; }
#camera.tilt-l #cam-top, #camera.tilt-r #cam-top { top: 12px; }
#camera.tilt-l #cam-flip, #camera.tilt-r #cam-flip { top: 10px; right: 140px; }
#camera.tilt-l #cam-torch, #camera.tilt-r #cam-torch { top: 10px; left: 16px; }

/* older per-agent page (agent.html) */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin-top: 10px; }
.grid a { display: block; aspect-ratio: 4 / 3; background: #e7ebef; border-radius: 8px; overflow: hidden; }
.grid img { width: 100%; height: 100%; object-fit: cover; display: block; }
.wide main { max-width: 1100px; }

/* delete a photo */
.shot .del { position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; border-radius: 50%; background: rgba(16, 32, 48, .72); color: #fff; font-style: normal; font-size: 16px; line-height: 1; display: flex; align-items: center; justify-content: center; cursor: pointer; }

/* arrived at the lot */
.compass.arrived { box-shadow: var(--shadow), 0 0 0 2px var(--good); background: #f2fbf5; }
.compass.arrived .dist { color: var(--good); }
button.pulse { animation: ready 1.4s ease-in-out infinite; }
@keyframes ready { 50% { box-shadow: 0 0 0 8px rgba(29, 138, 78, .18); } }
@media (prefers-reduced-motion: reduce) { button.pulse { animation: none; } }

/* flip saved photos if they come out upside down */
#cam-flip { position: absolute; top: calc(env(safe-area-inset-top) + 8px); right: calc(env(safe-area-inset-right) + 12px); min-height: 36px; padding: 6px 14px; border-radius: 99px; background: rgba(0,0,0,.45); color: #fff; border-color: rgba(255,255,255,.45); font-size: 13px; box-shadow: none; }
#cam-flip.on { background: #ffd60a; color: #000; border-color: #ffd60a; }

/* quality options under the camera buttons */
.quality-row { margin-top: 8px; align-items: center; }
.quality-row .muted { font-size: 13px; line-height: 1.35; }
/* flashlight in the rapid camera */
#cam-torch { position: absolute; top: calc(env(safe-area-inset-top) + 8px); left: calc(env(safe-area-inset-left) + 12px); min-height: 36px; padding: 6px 14px; border-radius: 99px; background: rgba(0,0,0,.45); color: #fff; border-color: rgba(255,255,255,.45); font-size: 13px; box-shadow: none; }
#cam-torch.on { background: #ffd60a; color: #000; border-color: #ffd60a; }

/* fix photo orientation */
.fix-lot .row { gap: 8px; margin-bottom: 10px; }
.fix-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.fix-shot { position: relative; padding: 0; min-height: 0; aspect-ratio: 4 / 3; border-radius: 10px; overflow: hidden; background: #e7ebef; border: 2px solid transparent; }
.fix-shot img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .25s; }
.fix-shot.on { border-color: var(--accent); }
.fix-shot.fixed { border-color: var(--good); }
.fix-shot b { position: absolute; left: 4px; bottom: 4px; font-size: 12px; padding: 2px 7px; border-radius: 99px; background: var(--accent); color: #000; }
.fix-shot b:empty { display: none; }
.fix-shot.fixed b { background: var(--good); color: #fff; }

/* past runs */
.lot-row.past { flex-direction: column; align-items: stretch; }
.lot-row.past.done { opacity: 1; }
.past-photos { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.past-photos .fix-shot { display: block; }
