/* Field capture: photo time/GPS chips, arrival check-in, draw-on-photo editor (Task C2). */

.capture-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ---------------------------------------------------------------- photo tile chips */

.photo-meta {
  position: absolute; left: 4px; right: 4px; bottom: 4px; display: flex; flex-direction: column; align-items: flex-start;
  gap: 3px; pointer-events: none;
}
.pm-row { display: flex; flex-wrap: wrap; gap: 3px; }
.pm-chip {
  display: inline-flex; align-items: center; gap: 3px; padding: 2px 6px; border-radius: 999px;
  background: rgba(0, 0, 0, 0.62); color: #fff; font-size: 0.66rem; font-weight: 700; line-height: 1.3; white-space: nowrap;
}
.pm-chip svg { width: 11px; height: 11px; flex: none; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.pm-far { display: block; max-width: 100%; padding: 2px 5px; background: #b35c00; font-size: 0.62rem; overflow: hidden; text-overflow: ellipsis; }

.tile-draw {
  position: absolute; top: 4px; left: 4px; width: 40px; height: 40px; border: 0; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; background: rgba(0, 0, 0, 0.6); color: #fff; cursor: pointer;
}
.tile-draw svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tile-draw:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

/* ---------------------------------------------------------------- check-in card */

.checkin-card { display: flex; align-items: center; gap: 12px; }
.checkin-card.is-checked-in { border-left: 4px solid var(--ok); }
.checkin-icon { width: 28px; height: 28px; flex: none; fill: none; stroke: var(--ok); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.checkin-form { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; margin: 0; }
.checkin-btn { flex: none; min-height: 48px; }
.checkin-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------------------------------------------------------------- draw editor */

html.draw-open, html.draw-open body { overflow: hidden; }

.draw-overlay {
  position: fixed; inset: 0; z-index: 1000; display: flex; flex-direction: column;
  background: #0d1117; color: #fff; touch-action: none; overscroll-behavior: contain;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
  padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right);
}
.draw-overlay button { font: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.draw-overlay button:disabled { opacity: 0.4; cursor: default; }
.draw-overlay button:focus-visible { outline: 2px solid #ffd400; outline-offset: 2px; }

.draw-top {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: max(8px, env(safe-area-inset-top)) 12px 8px;
}
.draw-topbtn {
  min-height: 44px; padding: 8px 16px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, 0.35);
  background: transparent; color: #fff; font-weight: 700; font-size: 1rem; white-space: nowrap;
}
.draw-revert { font-size: 0.875rem; padding: 8px 12px; }
.draw-save { background: #fff; border-color: #fff; color: #111; min-width: 80px; }

.draw-stage { position: relative; flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.draw-wrap { position: relative; box-shadow: 0 4px 24px rgba(0, 0, 0, 0.5); }
.draw-wrap canvas { position: absolute; inset: 0; display: block; width: 100%; height: 100%; touch-action: none; }
.draw-live { cursor: crosshair; }
.draw-loading { color: #cfd6de; padding: 24px; text-align: center; }

.draw-textform {
  position: absolute; top: 8px; left: 8px; right: 8px; z-index: 2; display: flex; gap: 8px; margin: 0; padding: 8px;
  border-radius: 12px; background: rgba(22, 27, 34, 0.96); box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
}
.draw-textform input {
  flex: 1; min-width: 0; min-height: 44px; padding: 0 12px; border: 0; border-radius: 8px;
  font-size: 16px; /* 16px stops iOS from zooming in on focus */
  -webkit-user-select: text; user-select: text;
}
.draw-textform .draw-topbtn { padding: 8px 12px; }

.draw-status { min-height: 26px; padding: 3px 12px; text-align: center; font-size: 0.875rem; color: #cfd6de; }
.draw-status.is-error { color: #ffb4a8; font-weight: 700; }

.draw-tools {
  display: grid; gap: 10px; padding: 10px 12px max(12px, env(safe-area-inset-bottom));
  background: #161b22; border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.draw-tools > .draw-row { width: 100%; max-width: 560px; margin: 0 auto; }
.draw-toolrow { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.draw-tool, .draw-undo {
  min-height: 60px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  padding: 4px; border: 2px solid transparent; border-radius: 12px; background: #232a33; color: #fff;
  font-size: 0.78rem; font-weight: 700;
}
.draw-tool svg, .draw-undo svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.draw-tool[aria-pressed="true"] { border-color: #ff6a00; background: #33291f; }
.draw-undo { background: transparent; border-color: rgba(255, 255, 255, 0.2); }

.draw-tools > .draw-row:not(.draw-toolrow) { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.draw-colors { display: flex; gap: 8px; }
.draw-color {
  width: 42px; height: 42px; padding: 0; border-radius: 50%; border: 3px solid #161b22;
  background: var(--swatch); box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.25);
}
.draw-color[aria-checked="true"] { box-shadow: 0 0 0 3px #fff; }
.draw-widths { display: flex; gap: 4px; }
.draw-width {
  width: 40px; height: 42px; padding: 0; display: flex; align-items: center; justify-content: center;
  border: 2px solid transparent; border-radius: 10px; background: transparent;
}
.draw-width i { display: block; width: var(--dot); height: var(--dot); border-radius: 50%; background: #fff; }
.draw-width[aria-checked="true"] { border-color: #fff; background: #232a33; }
