/* =============================================================================
   FIELD-WORK WORKSPACE + FOCUSED INSPECTION FORM  (architecture.md §238)
   ==========================================================================
   Scoped to .fw-theme / .fw-capture — nothing here touches :root or any other
   screen, so supervisor/admin views are unaffected. Tokens mirror tasks.css's
   --task-* palette (navy chrome, cyan accent, blue primary, white panels) with
   text colors chosen to stay readable outdoors: state colors used as TEXT are
   the darker variants (orange #b4540a, green #1f7a48), the brighter ones are
   reserved for fills/icons.
   ========================================================================== */

.fw-theme {
  --fw-bg: #f4f6fb;
  --fw-surface: #ffffff;
  --fw-border: #d3d9e6;
  --fw-text: #16213a;
  --fw-dim: #56617b;
  --fw-accent: #2f6fed;
  --fw-accent-dim: #eaf1ff;
  --fw-cyan: var(--chrome-cyan, #2fc7e3);
  --fw-navy: var(--chrome-bg, #01162e);
  --fw-green: #1f7a48;
  --fw-green-bg: #e7f6ee;
  --fw-orange: #b4540a;
  --fw-orange-bg: #fef1de;
  --fw-red: #b42318;
  --fw-red-bg: #fdecea;
  --fw-info: #1d4ed8;
  --fw-info-bg: #e8f0fe;
  --fw-shadow: 0 1px 2px rgba(20, 30, 60, 0.06), 0 6px 20px rgba(20, 30, 60, 0.10);
  color: var(--fw-text);
  font-family: var(--font-body, system-ui, sans-serif);
}
:root[data-theme="dark"] .fw-theme {
  --fw-bg: #10151f;
  --fw-surface: #181f2e;
  --fw-border: #2b3448;
  --fw-text: #e7ebf5;
  --fw-dim: #a3adc6;
  --fw-accent: #5b9bff;
  --fw-accent-dim: #1c2c47;
  --fw-green: #6fd09c;
  --fw-green-bg: #143224;
  --fw-orange: #f5a25a;
  --fw-orange-bg: #3a2717;
  --fw-red: #f08a7e;
  --fw-red-bg: #3a1f1c;
  --fw-info: #8ab4ff;
  --fw-info-bg: #182640;
  --fw-shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 6px 20px rgba(0, 0, 0, 0.35);
}
.fw-theme *, .fw-theme *::before, .fw-theme *::after { box-sizing: border-box; }
.fw-theme [hidden] { display: none !important; }
.fw-theme button { font-family: inherit; }

/* app.css gives every h1/h2/h3 the condensed uppercase display look and h2 a dim
   colour; the workspace uses sentence-case body type at the sizes below. */
.fw-theme h1, .fw-theme h2, .fw-theme h3 {
  font-family: var(--font-body, system-ui, sans-serif);
  text-transform: none;
  letter-spacing: -0.01em;
  color: var(--fw-text);
}

/* ---- Focused mode: the global chrome steps aside -------------------------- */
#app.fw-focus > .topbar,
#app.fw-focus > .tabbar { display: none; }
#app.fw-focus #view-root { overflow: hidden; }

/* ---- Frame ------------------------------------------------------------------ */
.fw-root {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  background: var(--fw-bg);
  overflow: hidden;
}
.fw-empty { padding: 24px; }

.fw-header {
  flex: none;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
  min-height: 58px;
  padding: 6px 8px;
  background: var(--fw-navy);
  color: #fff;
}
.fw-hback { justify-self: start; }
.fw-haction { justify-self: end; }
.fw-logo { height: 32px; width: auto; max-width: 34vw; object-fit: contain; pointer-events: none; }
.fw-hbtn {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 44px; min-width: 44px; padding: 0 8px;
  background: transparent; border: 0; border-radius: 10px;
  color: #fff; font-size: 16px; font-weight: 500; cursor: pointer; white-space: nowrap;
}
.fw-hbtn:hover { background: rgba(255, 255, 255, 0.10); }
.fw-hbtn:focus-visible { outline: 2px solid var(--fw-cyan); outline-offset: 1px; }
.fw-hbtn svg { flex: none; }
.fw-hbtn { gap: 6px; }

.fw-banners { flex: none; }
.fw-banner {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 14px; font-size: 13.5px; line-height: 1.35;
  border-bottom: 1px solid var(--fw-border);
}
.fw-banner-text { flex: 1; min-width: 0; }
.fw-banner-btn {
  flex: none; min-height: 36px; padding: 0 12px; border-radius: 9px;
  background: var(--fw-surface); border: 1px solid currentColor; color: inherit; font-weight: 600; cursor: pointer;
}
.fw-banner.is-info { background: var(--fw-info-bg); color: var(--fw-info); }
.fw-banner.is-warn { background: var(--fw-orange-bg); color: var(--fw-orange); }
.fw-banner.is-bad { background: var(--fw-red-bg); color: var(--fw-red); }

/* ---- Layout: phone (default) ------------------------------------------------ */
.fw-main {
  flex: 1; min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  grid-template-areas: "summary" "toggle" "stage" "sheet";
}
.fw-summary { grid-area: summary; }
.fw-viewtoggle { grid-area: toggle; }
.fw-stage { grid-area: stage; }
.fw-list-wrap { grid-area: stage; }
.fw-sheet { grid-area: sheet; }

.fw-summary { background: var(--fw-surface); padding: 12px 16px 12px; border-bottom: 1px solid var(--fw-border); }
.fw-title { margin: 0; font-size: 21px; line-height: 1.2; font-weight: 700; letter-spacing: -0.01em; color: var(--fw-text); }
.fw-subtitle { margin-top: 2px; color: var(--fw-dim); font-size: 14.5px; }
.fw-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 14px; margin-top: 6px; }
.fw-chip-status {
  display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 500;
  color: var(--fw-dim); background: none; border: 0; padding: 0; min-height: 28px;
}
.fw-chip-status.is-button { min-height: 44px; padding: 0 4px; margin: -6px 0; cursor: pointer; border-radius: 8px; }
.fw-chip-status.is-button:hover { background: var(--fw-accent-dim); }
.fw-chip-status.is-ok { color: var(--fw-green); }
.fw-chip-status.is-warn { color: var(--fw-orange); }
.fw-chip-status.is-bad { color: var(--fw-red); }
.fw-chip-status.is-info { color: var(--fw-info); }

.fw-progress-row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-top: 8px; font-size: 14.5px; }
.fw-progress-side { color: var(--fw-dim); font-size: 13.5px; white-space: nowrap; }
.fw-issue { color: var(--fw-orange); font-weight: 600; }
.fw-waiting { color: var(--fw-info); font-weight: 500; }
.fw-pct { color: var(--fw-accent); font-weight: 700; }
.fw-bar { display: flex; height: 8px; margin-top: 6px; border-radius: 99px; overflow: hidden; background: color-mix(in srgb, var(--fw-border) 70%, transparent); }
.fw-bar-done { background: var(--fw-accent); transition: width 0.2s; }
/* Waiting-to-send is hatched, not just lighter — distinguishable without colour. */
.fw-bar-wait { background: repeating-linear-gradient(45deg, var(--fw-accent) 0 4px, transparent 4px 8px); }

.fw-viewtoggle { display: flex; gap: 4px; padding: 8px 12px; background: var(--fw-bg); }
.fw-viewtoggle button {
  flex: 1; min-height: 44px; border-radius: 10px; border: 1px solid var(--fw-border);
  background: var(--fw-surface); color: var(--fw-dim); font-size: 15px; font-weight: 600; cursor: pointer;
}
.fw-viewtoggle button.is-on { background: var(--fw-accent); border-color: var(--fw-accent); color: #fff; }

.fw-stage { position: relative; z-index: 0; isolation: isolate; min-height: 0; background: #e7ebf3; } /* isolate: Leaflet's panes/controls use z-index up to 1000 and must not climb above the Finish screen or a modal */
.fw-map { position: absolute; inset: 0; }
.fw-root[data-view="list"] .fw-stage { visibility: hidden; }
.fw-list-wrap { display: none; overflow: auto; min-height: 0; background: var(--fw-bg); padding: 10px 12px 14px; -webkit-overflow-scrolling: touch; }
.fw-root[data-view="list"] .fw-list-wrap { display: block; }

/* ---- Bottom sheet ------------------------------------------------------------ */
.fw-sheet {
  position: relative; z-index: 5;
  background: var(--fw-surface);
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -6px 24px rgba(20, 30, 60, 0.18);
  max-height: 58vh; overflow-y: auto; overscroll-behavior: contain;
  padding-bottom: env(safe-area-inset-bottom);
}
.fw-sheet-handle {
  display: flex; justify-content: center; align-items: center;
  width: 100%; min-height: 44px; margin-bottom: -10px;
  background: none; border: 0; cursor: pointer; position: sticky; top: 0; z-index: 2;
  background: linear-gradient(var(--fw-surface) 70%, transparent);
}
.fw-sheet-handle span { width: 44px; height: 5px; border-radius: 99px; background: var(--fw-border); }
.fw-sheet-body { padding: 0 16px 14px; }

.fw-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 11px; border-radius: 999px;
  font-size: 12.5px; font-weight: 700; letter-spacing: 0.04em;
  background: var(--fw-accent-dim); color: var(--fw-accent);
}
.fw-chip.is-ok { background: var(--fw-green-bg); color: var(--fw-green); }
.fw-chip.is-warn { background: var(--fw-orange-bg); color: var(--fw-orange); }
.fw-chip.is-muted { background: color-mix(in srgb, var(--fw-border) 55%, transparent); color: var(--fw-dim); }
.fw-chip.is-info { background: var(--fw-info-bg); color: var(--fw-info); }
.fw-asset-name { margin: 8px 0 0; font-size: 25px; line-height: 1.15; font-weight: 700; letter-spacing: -0.01em; overflow-wrap: anywhere; }
.fw-asset-meta { margin-top: 3px; color: var(--fw-dim); font-size: 16px; }
.fw-asset-instr {
  margin: 8px 0 0; font-size: 16px; line-height: 1.4; color: var(--fw-text);
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.fw-asset-reason { margin: 8px 0 0; font-size: 15px; color: var(--fw-orange); }
.fw-muted { color: var(--fw-dim); font-size: 14px; line-height: 1.4; }
.fw-secondary { display: flex; flex-wrap: wrap; justify-content: space-around; gap: 0 8px; margin-top: 4px; }
.fw-footer-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 0 8px; margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--fw-border); }

/* ---- Buttons ------------------------------------------------------------------ */
.fw-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 0 18px; border-radius: 13px;
  font-size: 17px; font-weight: 600; cursor: pointer;
  border: 1.5px solid transparent; text-decoration: none;
}
.fw-btn-lg { width: 100%; min-height: 54px; margin-top: 12px; }
.fw-btn-primary { background: var(--fw-accent); color: #fff; }
.fw-btn-primary:hover { filter: brightness(1.06); }
.fw-btn-ghost { background: var(--fw-surface); color: var(--fw-accent); border-color: var(--fw-accent); }
.fw-btn:disabled { opacity: 0.55; cursor: not-allowed; filter: none; }
.fw-btn:focus-visible, .fw-link:focus-visible, .fw-row:focus-visible, .fw-filter:focus-visible { outline: 3px solid var(--fw-cyan); outline-offset: 2px; }
.fw-link {
  display: inline-flex; align-items: center; gap: 7px; min-height: 44px; padding: 0 10px;
  background: none; border: 0; border-radius: 10px; color: var(--fw-accent); font-size: 15px; font-weight: 600; cursor: pointer; text-decoration: none; white-space: nowrap;
}
.fw-link-lg { font-size: 16.5px; }
.fw-link:hover { background: var(--fw-accent-dim); }
.fw-link:disabled { opacity: 0.65; cursor: default; }
.fw-link:disabled:hover { background: none; }
/* Driving directions (architecture.md §243): "Hide route" is a lower-emphasis
   twin of the Directions link next to it — same size/hit-target, muted color
   so the pair doesn't read as two equally-weighted primary actions. */
.fw-link-clear { color: var(--fw-dim); }
.fw-link-clear:hover { background: color-mix(in srgb, var(--fw-dim) 14%, transparent); }
.fw-spin { animation: fw-spin 0.9s linear infinite; }
@keyframes fw-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .fw-spin { animation-duration: 2.4s; } }

/* Drive/Walk toggle (architecture.md §245, hidden-by-default behind a plain
   "Directions" link since §246 — see directionsControlHtml). Two
   equal-weight segments so neither mode reads as the default; whichever is
   currently shown/loading gets the filled .is-active look, same accent
   color .fw-btn-primary already uses. Deliberately smaller than the other
   .fw-link-lg controls around it (direct request) — it's a secondary
   refinement of a choice already made by tapping Directions, not a
   same-weight primary action. */
.fw-mode-toggle {
  display: inline-flex; border: 1.5px solid var(--fw-accent); border-radius: 9px; overflow: hidden;
}
.fw-mode-btn {
  display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 0 11px;
  background: none; border: 0; color: var(--fw-accent); font-size: 13.5px; font-weight: 600; cursor: pointer;
}
.fw-mode-btn svg { width: 16px; height: 16px; }
.fw-mode-btn + .fw-mode-btn { border-left: 1.5px solid var(--fw-accent); }
.fw-mode-btn:hover { background: var(--fw-accent-dim); }
.fw-mode-btn.is-active { background: var(--fw-accent); color: #fff; }
.fw-mode-btn:disabled { opacity: 0.7; cursor: default; }
.fw-mode-btn:disabled:hover { background: none; }
.fw-mode-btn.is-active:disabled:hover { background: var(--fw-accent); }

/* Turn-by-turn (architecture.md §245) — a static step list for whichever
   route is currently shown, not live step-advancing navigation. */
.fw-steps { margin-top: 14px; border: 1px solid var(--fw-border); border-radius: 12px; overflow: hidden; }
.fw-steps-toggle {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%;
  min-height: 46px; padding: 0 14px; background: var(--fw-accent-dim); border: 0; cursor: pointer;
  color: var(--fw-text); font-size: 14.5px; font-weight: 700; text-align: left;
}
.fw-steps-toggle-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fw-steps-chevron { flex: none; display: flex; color: var(--fw-dim); transition: transform 0.15s ease; }
.fw-steps.is-collapsed .fw-steps-chevron { transform: rotate(-90deg); }
.fw-steps.is-collapsed .fw-steps-list { display: none; }
.fw-steps-list {
  list-style: none; margin: 0; padding: 6px 0; max-height: 46vh; overflow-y: auto;
}
.fw-step { display: flex; align-items: flex-start; gap: 12px; padding: 9px 14px; }
.fw-step + .fw-step { border-top: 1px solid var(--fw-border); }
.fw-step-icon {
  flex: none; display: flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 50%; margin-top: 1px;
  background: var(--fw-accent-dim); color: var(--fw-accent);
}
.fw-step-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.fw-step-instruction { font-size: 15px; color: var(--fw-text); line-height: 1.3; }
.fw-step-dist { font-size: 13px; color: var(--fw-dim); }

/* "Optimize route" (architecture.md §247) — task-level, so its own accent
   distinguishes it from the per-asset Directions/mode controls above it. */
.fw-link-optimize { color: var(--fw-accent); }
.fw-multiroute {
  margin-bottom: 12px; padding: 12px 14px; border-radius: 12px;
  background: var(--fw-accent-dim); border: 1px solid var(--fw-accent);
}
.fw-multiroute-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.fw-multiroute-title { display: inline-flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 700; color: var(--fw-text); }
.fw-multiroute-title svg { width: 18px; height: 18px; flex: none; color: var(--fw-accent); }
.fw-multiroute-stats { margin-top: 4px; font-size: 14px; color: var(--fw-dim); }
.fw-multiroute-note { margin-top: 4px; font-size: 13px; color: var(--fw-orange); }

/* Optimized-route directions (architecture.md §249) — the same .fw-steps card
   as a single route, but one block per leg, each headed by the number of the
   stop it ends at (matching that stop's map pin). Scrolls as ONE region
   (.fw-legs) so the per-leg lists don't each become their own nested scroller
   the way a lone .fw-steps-list is; the leg header sticks so a long leg still
   says which stop it's heading to. */
.fw-steps.is-collapsed .fw-legs { display: none; }
.fw-legs { max-height: 46vh; overflow-y: auto; }
.fw-legs .fw-steps-list { max-height: none; overflow: visible; padding: 0 0 6px; }
.fw-leg + .fw-leg { border-top: 1px solid var(--fw-border); }
.fw-leg-head {
  position: sticky; top: 0; z-index: 1; display: flex; align-items: center; gap: 10px;
  padding: 9px 14px; background: var(--fw-surface); border-bottom: 1px solid var(--fw-border);
}
.fw-leg-num {
  flex: none; display: flex; align-items: center; justify-content: center;
  min-width: 26px; height: 26px; padding: 0 6px; border-radius: 13px; box-sizing: border-box;
  background: var(--fw-accent); color: #fff; font-size: 13px; font-weight: 700;
}
.fw-leg-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14.5px; font-weight: 700; color: var(--fw-text); }
.fw-leg-dist { flex: none; font-size: 13px; color: var(--fw-dim); }

.fw-saved { margin: 4px 0 8px; padding: 12px 14px; border-radius: 14px; background: var(--fw-green-bg); border: 1px solid color-mix(in srgb, var(--fw-green) 35%, transparent); }
.fw-saved-head { display: flex; align-items: center; gap: 8px; color: var(--fw-green); font-size: 17px; }
.fw-saved-sub { margin-top: 2px; color: var(--fw-text); font-size: 15px; }
.fw-saved-next { margin-top: 6px; font-size: 15px; color: var(--fw-text); }

/* ---- Asset list ------------------------------------------------------------------ */
.fw-list-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.fw-filters { display: flex; flex-wrap: wrap; gap: 6px; }
.fw-filter {
  min-height: 44px; padding: 0 14px; border-radius: 999px; cursor: pointer;
  background: var(--fw-surface); border: 1px solid var(--fw-border); color: var(--fw-dim); font-size: 14px; font-weight: 600;
}
.fw-filter.is-on { background: var(--fw-accent-dim); border-color: var(--fw-accent); color: var(--fw-accent); }
.fw-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.fw-list-empty { padding: 20px 4px; }
.fw-row {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 64px; padding: 10px 12px;
  background: var(--fw-surface); border: 1px solid var(--fw-border); border-radius: 14px; text-align: left; color: var(--fw-text); cursor: pointer;
}
.fw-row.is-selected { border-color: var(--fw-accent); box-shadow: 0 0 0 2px var(--fw-accent-dim); }
.fw-row-num {
  position: relative; flex: none; width: 40px; height: 40px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; color: #fff; background: #64748b; font-weight: 700; font-size: 15px;
}
.fw-row-num i { font-style: normal; }
.fw-row-num svg {
  position: absolute; right: -5px; bottom: -5px; width: 19px; height: 19px; padding: 2px;
  background: var(--fw-surface); color: #64748b; border-radius: 50%; border: 1.5px solid currentColor;
}
.fw-row-num.is-active { background: #2f6fed; } .fw-row-num.is-active svg { color: #2f6fed; }
.fw-row-num.is-inspected { background: #2e8f5b; } .fw-row-num.is-inspected svg { color: #2e8f5b; }
.fw-row-num.is-exception { background: #d9531e; } .fw-row-num.is-exception svg { color: #d9531e; }
.fw-row-num.is-queued { background: #0f9d8f; } .fw-row-num.is-queued svg { color: #0f9d8f; }
.fw-row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.fw-row-name { font-size: 16.5px; font-weight: 600; overflow-wrap: anywhere; }
.fw-next-tag { display: inline-block; white-space: nowrap; font-style: normal; margin-left: 6px; padding: 2px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 700; letter-spacing: 0.04em; background: var(--fw-accent-dim); color: var(--fw-accent); text-transform: uppercase; }
.fw-row-meta { font-size: 13.5px; color: var(--fw-dim); }
.fw-row-meta.is-ok { color: var(--fw-green); } .fw-row-meta.is-warn { color: var(--fw-orange); } .fw-row-meta.is-info { color: var(--fw-info); }
.fw-row-go { color: var(--fw-dim); flex: none; }

/* ---- Map: pins, controls ------------------------------------------------------------ */
.fw-pin { background: none; border: 0; }
.fw-pin-svg { display: block; overflow: visible; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.35)); transform-origin: 50% 96%; transition: transform 0.12s; }
.fw-pin-body { fill: #64748b; stroke: #fff; stroke-width: 2; }
.fw-pin.is-active .fw-pin-body { fill: #2f6fed; }
.fw-pin.is-inspected .fw-pin-body { fill: #2e8f5b; }
.fw-pin.is-exception .fw-pin-body { fill: #e8622c; }
.fw-pin.is-queued .fw-pin-body { fill: #0f9d8f; }
.fw-pin.is-selected .fw-pin-svg { transform: scale(1.32); }
.fw-pin.is-next::after {
  content: ''; position: absolute; left: 50%; bottom: -3px; width: 26px; height: 26px; margin-left: -13px;
  border-radius: 50%; border: 3px solid rgba(47, 111, 237, 0.65); pointer-events: none; animation: fw-pulse 1.7s ease-out infinite;
}
@keyframes fw-pulse { 0% { transform: scale(0.5); opacity: 0.9; } 100% { transform: scale(1.5); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .fw-pin.is-next::after { animation: none; } .fw-pin-svg { transition: none; } }

/* Feature popups (direct request — tapping a pin/shape shows its name and
   status). Deliberately NOT themed to the app's dark palette, same
   convention app.css's .feature-popup already documents: Leaflet's own
   default light popup chrome is left as-is everywhere in this app, so these
   colors are light-background-appropriate, not var(--fw-*) dark-mode tokens. */
.fw-feature-popup { font-size: 13.5px; min-width: 120px; color: #16213a; }
.fw-feature-popup-title { display: flex; align-items: center; gap: 7px; font-size: 15px; font-weight: 700; line-height: 1.25; }
.fw-feature-popup-num {
  flex: none; display: inline-flex; align-items: center; justify-content: center;
  min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; box-sizing: border-box;
  background: #64748b; color: #fff; font-size: 12px; font-weight: 700;
}
.fw-feature-popup-state { margin-top: 3px; font-size: 12.5px; color: #56617b; }
.fw-feature-popup-state.is-active { color: #2f6fed; }
.fw-feature-popup-state.is-inspected { color: #2e8f5b; }
.fw-feature-popup-state.is-exception { color: #d9531e; }
.fw-feature-popup-state.is-queued { color: #0f9d8f; }

.leaflet-bar.fw-map-controls a { width: 44px; height: 44px; line-height: 44px; display: flex; align-items: center; justify-content: center; color: #16213a; }
.fw-map .leaflet-control-zoom a { width: 40px; height: 40px; line-height: 40px; }
@media (pointer: coarse) { .fw-map .leaflet-control-zoom { display: none; } }
.fw-map-popover {
  position: absolute; z-index: 1000; top: 10px; right: 64px; min-width: 230px; padding: 8px 12px 10px;
  background: var(--fw-surface); color: var(--fw-text); border: 1px solid var(--fw-border); border-radius: 12px; box-shadow: var(--fw-shadow); font-family: inherit;
}
.fw-pop-title { margin: 6px 0 2px; font-size: 12px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--fw-dim); }
.fw-pop-row { display: flex; align-items: center; gap: 10px; min-height: 44px; font-size: 15px; cursor: pointer; }
.fw-pop-row input { width: 20px; height: 20px; }

/* ---- Modals (Cannot inspect, Sync details) -------------------------------------------- */
.fw-overlay {
  position: fixed; left: 0; right: 0; top: 0; height: 100dvh; z-index: 300;
  display: flex; align-items: flex-end; justify-content: center; background: rgba(6, 14, 28, 0.58);
}
.fw-modal { width: 100%; max-width: 500px; max-height: 100%; overflow-y: auto; background: var(--fw-surface); color: var(--fw-text); border-radius: 22px 22px 0 0; padding-bottom: env(safe-area-inset-bottom); }
.fw-modal-head { padding: 18px 18px 6px; }
.fw-modal-head h2 { margin: 0 0 2px; font-size: 21px; }
.fw-modal-body { padding: 8px 18px 4px; }
.fw-modal-actions { padding: 6px 18px 18px; }
.fw-modal-actions .fw-btn-lg:first-child { margin-top: 8px; }
.fw-modal-note { margin: 12px 0 0; color: var(--fw-dim); font-size: 13.5px; }
.fw-modal-error { margin-top: 10px; padding: 10px 12px; border-radius: 10px; background: var(--fw-red-bg); color: var(--fw-red); font-size: 14px; }
.fw-outcomes { display: grid; gap: 8px; }
.fw-outcome {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-height: 60px; padding: 10px 14px; text-align: left; cursor: pointer;
  background: var(--fw-surface); color: var(--fw-text); border: 1.5px solid var(--fw-border); border-radius: 14px;
}
.fw-outcome strong { font-size: 16.5px; }
.fw-outcome span { color: var(--fw-dim); font-size: 13.5px; }
.fw-outcome.is-on { border-color: var(--fw-accent); background: var(--fw-accent-dim); box-shadow: 0 0 0 2px var(--fw-accent-dim); }
.fw-reason { margin-top: 12px; }
.fw-reason label { display: block; font-weight: 600; margin-bottom: 6px; }
.fw-reason-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.fw-reason textarea {
  width: 100%; min-height: 84px; padding: 10px 12px; border-radius: 12px; font: inherit; font-size: 16px; resize: vertical;
  background: var(--fw-surface); color: var(--fw-text); border: 1.5px solid var(--fw-border);
}
.fw-wait-list { margin: 8px 0; padding-left: 20px; font-size: 15px; line-height: 1.5; }

/* ---- Finish for today ------------------------------------------------------------------ */
.fw-screen { position: absolute; inset: 0; z-index: 50; display: flex; background: var(--fw-bg); }
.fw-screen-inner { display: flex; flex-direction: column; width: 100%; min-height: 0; }
.fw-screen-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 16px 16px calc(24px + env(safe-area-inset-bottom)); -webkit-overflow-scrolling: touch; }
.fw-screen-col { max-width: 560px; margin: 0 auto; }
.fw-finish-title { margin: 4px 0 2px; font-size: 30px; line-height: 1.15; font-weight: 700; letter-spacing: -0.01em; }
.fw-card { margin: 12px 0; padding: 14px 16px; background: var(--fw-surface); border: 1px solid var(--fw-border); border-radius: 16px; box-shadow: var(--fw-shadow); }
.fw-card.is-ok { background: var(--fw-green-bg); border-color: color-mix(in srgb, var(--fw-green) 30%, transparent); }
.fw-card.is-warn { background: var(--fw-orange-bg); border-color: color-mix(in srgb, var(--fw-orange) 30%, transparent); }
.fw-card.is-bad { background: var(--fw-red-bg); border-color: color-mix(in srgb, var(--fw-red) 30%, transparent); color: var(--fw-red); }
.fw-card.is-muted { color: var(--fw-dim); }
.fw-card-label { margin-bottom: 8px; font-size: 12.5px; font-weight: 700; letter-spacing: 0.08em; color: var(--fw-dim); }
.fw-stat-row { display: flex; align-items: center; gap: 12px; min-height: 44px; font-size: 17px; }
.fw-stat-row strong { margin-left: auto; font-size: 19px; }
.fw-stat-ic { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 50%; color: #fff; }
.fw-stat-ic.is-ok { background: #2e8f5b; } .fw-stat-ic.is-warn { background: #d98a12; }
.fw-stat-split { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 8px; padding-top: 12px; border-top: 1px solid var(--fw-border); }
.fw-stat-split strong { font-size: 22px; }
.fw-syncbox { display: flex; gap: 12px; align-items: flex-start; }
.fw-syncbox > svg { flex: none; margin-top: 3px; width: 22px; height: 22px; }
.fw-attn { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 48px; padding: 6px 4px; background: none; border: 0; color: var(--fw-text); text-align: left; font-size: 15.5px; cursor: pointer; }
.fw-attn > span { flex: 1; }
.fw-info { display: flex; gap: 10px; align-items: flex-start; margin: 14px 2px 4px; color: var(--fw-dim); font-size: 14.5px; line-height: 1.4; }
.fw-info svg { flex: none; margin-top: 2px; }
.fw-finish-actions .fw-btn-lg { margin-top: 10px; }

/* ---- Tablet / desktop: side panel beside a full-height map ------------------------------ */
@media (min-width: 720px) {
  .fw-main {
    grid-template-columns: clamp(320px, 32vw, 380px) minmax(0, 1fr);
    grid-template-rows: auto auto minmax(0, 1fr);
    grid-template-areas: "summary stage" "sheet stage" "list stage";
  }
  .fw-viewtoggle { display: none; }
  .fw-list-wrap { display: block; grid-area: list; border-right: 1px solid var(--fw-border); }
  .fw-root[data-view="list"] .fw-stage { visibility: visible; }
  .fw-summary { border-right: 1px solid var(--fw-border); }
  .fw-sheet { max-height: none; overflow: visible; border-radius: 0; box-shadow: none; border-right: 1px solid var(--fw-border); border-bottom: 1px solid var(--fw-border); }
  .fw-sheet-handle { display: none; }
  .fw-sheet-body { padding-top: 12px; }
  .fw-logo { height: 38px; }
  .fw-overlay { align-items: center; }
  .fw-modal { border-radius: 20px; max-height: 92%; }
}

@media (max-width: 380px) {
  .fw-hbtn span { font-size: 15px; }
  .fw-title { font-size: 19px; }
  .fw-asset-name { font-size: 22px; }
}
/* Landscape phones are short: give the map more of the height. */
@media (max-height: 480px) and (max-width: 719.98px) {
  .fw-sheet { max-height: 70vh; }
  .fw-summary { padding: 6px 14px; }
  .fw-chips { display: none; }
}

/* =============================================================================
   WORKER-SCREEN DESIGN MATCH  (architecture.md §238)
   ==========================================================================
   Brings the workspace in line with the approved worker-screen mock: cyan
   stacked wordmark, floating white summary card with inline progress, Map|List
   pill floating on the map, a single Locate button + compass + scale bar, a
   large-radius bottom sheet with a plain "UP NEXT" chip, and a footer strip.
   These rules come AFTER the base workspace rules above and override them.
   ========================================================================== */

.fw-main { background: var(--fw-bg); }

/* Header: cyan stacked wordmark, larger actions */
.fw-header { min-height: 48px; padding: 3px 10px; }
.fw-hbtn { min-height: 40px; font-size: 16px; }
.fw-hbtn span { font-size: 16px; }
.fw-header .fw-hbtn svg { width: 20px; height: 20px; }
.fw-header .fw-logo { height: 36px; max-width: 46vw; }
/* Summary: a floating white card on the light page background */
.fw-summary {
  margin: 8px 12px 6px; padding: 12px 16px 14px;
  background: var(--fw-surface); border: 1px solid var(--fw-border); border-radius: 18px;
  box-shadow: var(--fw-shadow);
}
.fw-title { font-size: 22px; font-weight: 800; letter-spacing: -0.015em; }
.fw-subtitle { margin-top: 0; font-size: 15px; line-height: 1.25; }

.fw-chips { flex-wrap: wrap; gap: 0; margin-top: 2px; }
.fw-chip-status svg { width: 18px; height: 18px; }
.fw-chip-status svg[viewBox="0 0 24 24"][width="14"] { width: 14px; height: 14px; }
.fw-chip-status {
  position: relative; gap: 6px; min-height: 24px; padding: 0 10px; font-size: 14px; font-weight: 500;
  color: var(--fw-dim); border-left: 1px solid var(--fw-border);
}
.fw-chip-status:first-child { padding-left: 0; border-left: 0; }
.fw-chip-status > span { color: var(--fw-dim); }
.fw-chip-status svg { flex: none; }
.fw-chip-status.is-ok svg { color: #26a35a; }
.fw-chip-status.is-warn svg { color: #d98a12; }
.fw-chip-status.is-bad svg { color: var(--fw-red); }
.fw-chip-status.is-bad > span { color: var(--fw-red); }
.fw-chip-status.is-info svg { color: var(--fw-info); }
.fw-chip-status.is-gps.is-ok svg { color: #1c2434; }
:root[data-theme="dark"] .fw-chip-status.is-gps.is-ok svg { color: var(--fw-text); }
/* keep the 44 px tap target without making the row tall */
.fw-chip-status.is-button { min-height: 24px; margin: 0; padding-right: 0; cursor: pointer; border-radius: 0; }
.fw-chip-status.is-button:hover { background: none; }
.fw-chip-status.is-button::after { content: ""; position: absolute; inset: -8px -6px; }

.fw-progress-row { display: flex; align-items: center; gap: 10px; margin-top: 3px; font-size: 14px; }
.fw-progress-text { flex: none; font-weight: 700; color: var(--fw-text); }
.fw-progress-side { flex: none; margin: 0; color: var(--fw-dim); font-size: 14px; white-space: nowrap; }
.fw-bar { flex: 1 1 auto; min-width: 36px; height: 10px; margin: 0; }
.fw-issue { color: #c2510f; font-weight: 600; }
:root[data-theme="dark"] .fw-issue { color: var(--fw-orange); }
.fw-waiting { margin-top: 8px; color: var(--fw-info); font-size: 13.5px; font-weight: 600; }

/* Finish screen keeps its own (older) card rows */
.fw-screen .fw-progress-row { margin-top: 6px; justify-content: space-between; }
.fw-screen .fw-bar { flex: none; width: 100%; margin-top: 6px; }

/* Map|List pill floats over the map (phone) */
.fw-viewtoggle {
  grid-area: stage; z-index: 20; align-self: start; justify-self: start; margin: 12px;
  display: inline-flex; gap: 0; padding: 3px; background: #fff; border-radius: 999px;
  box-shadow: 0 2px 8px rgba(20, 30, 60, 0.22);
}
.fw-viewtoggle button {
  flex: none; min-height: 34px; padding: 0 16px; border: 0; border-radius: 999px; background: transparent;
  color: #16213a; font-size: 14.5px; font-weight: 700; cursor: pointer;
}
.fw-viewtoggle button.is-on { background: #1266ea; color: #fff; }
.fw-root[data-view="list"] .fw-list-wrap { padding-top: 62px; }

/* Map chrome: one Locate button, compass, scale bar */
.fw-map .leaflet-top .leaflet-control { margin-top: 12px; }
.fw-map .leaflet-right .leaflet-control { margin-right: 12px; }
.fw-map .leaflet-left .leaflet-control { margin-left: 12px; }
.fw-map .leaflet-bottom .leaflet-control { margin-bottom: 12px; }
.leaflet-bar.fw-map-controls { border: 0; border-radius: 12px; overflow: hidden; box-shadow: 0 2px 10px rgba(20, 30, 60, 0.25); }
.leaflet-bar.fw-map-controls a { width: 42px; height: 42px; line-height: 42px; background: #fff; color: #1266ea; border-bottom: 1px solid #e4e8f0; }
.leaflet-bar.fw-map-controls a:last-child { border-bottom: 0; }
.fw-compass {
  width: 40px; height: 40px; border-radius: 50%; background: #fff; box-shadow: 0 2px 8px rgba(20, 30, 60, 0.25);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0;
  color: #1c2434; font: 700 13px/1 var(--font-body, system-ui, sans-serif); pointer-events: none;
}
.fw-compass svg { display: block; width: 14px; height: 17px; margin-bottom: 1px; }
.fw-map .leaflet-control-scale-line {
  position: relative; background: transparent; box-shadow: none; border: 0; border-bottom: 2px solid #1c2434; color: #1c2434;
  font-size: 14px; font-weight: 700; line-height: 1.3; padding: 0 8px 1px; text-align: center; min-width: 70px;
  text-shadow: 0 0 3px #fff, 0 0 3px #fff, 0 0 3px #fff;
}
.fw-map .leaflet-control-scale-line::before, .fw-map .leaflet-control-scale-line::after {
  content: ""; position: absolute; bottom: -2px; width: 2px; height: 10px; background: #1c2434; /* end ticks: half the old side-border height */
}
.fw-map .leaflet-control-scale-line::before { left: 0; }
.fw-map .leaflet-control-scale-line::after { right: 0; }
.fw-map .leaflet-control-attribution { font-size: 10px; background: rgba(255, 255, 255, 0.7); }

/* Pins: the asset being pointed at (up next / selected) is the large blue pin */
.fw-pin-body { fill: #7b8696; }
.fw-pin.is-next.is-pending .fw-pin-body { fill: #1266ea; }
.fw-pin.is-next::after { content: none; animation: none; }
.fw-pin-svg { filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.28)); }
.fw-pin.is-selected .fw-pin-svg { transform: scale(1.36); }

/* Bottom sheet (phone): fieldWork.js sets an explicit height (full / peek / hidden)
   and slides the card content under the handle; these transitions only run for the
   snap after a release or tap — .is-dragging switches them off so the panel tracks
   the finger 1:1 and so content re-renders apply instantly. */
.fw-sheet { transition: height 0.3s cubic-bezier(0.22, 0.8, 0.25, 1); }
.fw-sheet-body { transition: transform 0.3s cubic-bezier(0.22, 0.8, 0.25, 1); will-change: transform; }
/* Content that fades as the sheet shrinks (fieldWork.js sets opacity/visibility inline). */
.fw-sheet-body [data-sfade] { transition: opacity 0.3s cubic-bezier(0.22, 0.8, 0.25, 1), visibility 0.3s; }
.fw-sheet.is-dragging, .fw-sheet.is-dragging .fw-sheet-body, .fw-sheet.is-dragging .fw-sheet-body [data-sfade] { transition: none; }
@media (prefers-reduced-motion: reduce) { .fw-sheet, .fw-sheet-body, .fw-sheet-body [data-sfade] { transition: none; } }

/* Bottom sheet */
.fw-sheet { border-radius: 28px 28px 0 0; box-shadow: 0 -4px 22px rgba(20, 30, 60, 0.16); padding-bottom: env(safe-area-inset-bottom); }
.fw-sheet-handle { min-height: 28px; margin-bottom: 0; background: var(--fw-surface); touch-action: none; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; cursor: grab; }
.fw-sheet-handle:active { cursor: grabbing; }
.fw-sheet-handle span { width: 48px; height: 5px; background: #c7ccd7; }
.fw-sheet-body { padding: 0 20px 0; }
.fw-chip { padding: 2px 10px; font-size: 12px; font-weight: 700; letter-spacing: 0.01em; background: #e6efff; color: #1a5edb; }
.fw-chip.is-ok { background: var(--fw-green-bg); color: var(--fw-green); }
.fw-chip.is-warn { background: var(--fw-orange-bg); color: var(--fw-orange); }
.fw-asset-name { margin-top: 6px; font-size: 28px; font-weight: 800; letter-spacing: -0.02em; }
.fw-asset-meta { margin-top: 1px; font-size: 17px; color: var(--fw-dim); }
.fw-asset-instr { margin-top: 8px; font-size: 16px; line-height: 1.35; -webkit-line-clamp: 2; }
.fw-btn.fw-primary { min-height: 44px; margin-top: 10px; gap: 12px; border-radius: 16px; font-size: 20px; font-weight: 700; background-clip: padding-box; }
.fw-btn.fw-primary.fw-btn-primary { background: #1266ea; }
.fw-btn.fw-primary svg { width: 28px; height: 28px; }
.fw-secondary { margin-top: 6px; }
.fw-link-lg { font-size: 17px; font-weight: 700; min-height: 48px; }
.fw-link-lg svg { width: 24px; height: 24px; }
.fw-footer-row {
  margin: 4px -20px 0; padding: 0 22px calc(0px + env(safe-area-inset-bottom)); border-top: 1px solid #e4e8f0;
  background: color-mix(in srgb, var(--fw-bg) 55%, var(--fw-surface)); justify-content: space-between; flex-wrap: nowrap;
  margin-bottom: calc(-1 * env(safe-area-inset-bottom));
}
.fw-footer-row .fw-link { font-size: 16.5px; font-weight: 700; min-height: 52px; padding: 0; }
.fw-footer-row .fw-link svg { width: 24px; height: 24px; }
.fw-link-finish { gap: 10px; }
.fw-link-finish svg:last-child { width: 20px; height: 20px; }

@media (max-width: 719.98px) {
  .fw-main { grid-template-rows: auto minmax(0, 1fr) auto; grid-template-areas: "summary" "stage" "sheet"; }
  /* Inspect / Review & submit / Inspect next / Return to work in the bottom sheet: shorter, same width. */
  .fw-sheet-body .fw-btn-lg { min-height: 44px; }
}
@media (min-width: 720px) {
  .fw-viewtoggle { display: none; } /* side panel shows the list beside the map, so no Map|List switch */
  .fw-main { grid-template-columns: clamp(340px, 34vw, 400px) minmax(0, 1fr); }
  .fw-summary { margin: 12px; }
  .fw-progress-row { flex-wrap: wrap; justify-content: space-between; gap: 6px 10px; }
  .fw-bar { order: 3; flex: 1 0 100%; }
  .fw-sheet { border-radius: 0; box-shadow: none; height: auto !important; transition: none; }
  .fw-sheet-body { transform: none !important; transition: none; }
  .fw-link-finish svg:last-child { display: none; }
  .fw-secondary { flex-wrap: nowrap; }
  .fw-secondary .fw-link-lg { padding: 0 6px; }
  .fw-sheet-body { padding: 8px 18px 0; }
  .fw-footer-row { margin: 8px -18px 0; padding: 2px 18px; margin-bottom: 0; }
  .fw-asset-name { font-size: 26px; }
  .fw-asset-meta { font-size: 16px; }
  .fw-asset-instr { font-size: 16px; }
  .fw-btn.fw-primary { min-height: 56px; font-size: 19px; }
  .fw-link-lg { font-size: 16px; min-height: 48px; }
  .fw-footer-row .fw-link { font-size: 15.5px; min-height: 50px; }
}

/* =============================================================================
   FOCUSED INSPECTION FORM  (.fw-capture — capture.js in task-item mode)
   ==========================================================================
   Only the chrome and the control SIZING change; the fields themselves are the
   form's own, rendered by the same code as every other form. Selectors are
   scoped to .fw-capture so standalone Capture, the Designer preview and every
   other screen are untouched. Choice lists become large tap tiles, yes/no a
   large segmented control, photos a large "add" tile — driven by the existing
   markup (.choice-list / .yesno-toggle / .photo-capture-btn), not by field
   names, so it works for whatever the task's form contains.
   ========================================================================== */

.fw-cap-root { position: absolute; left: 0; right: 0; top: 0; bottom: 0; display: flex; flex-direction: column; background: var(--asphalt); z-index: 1; }
.fw-cap-root > .sheet.fw-capture { height: auto !important; max-height: none !important; flex: 1 1 auto; min-height: 0; border-top: 0; padding-bottom: 0; }
.fw-capture .sheet-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 14px 16px 24px; }

.fw-cap-menu-wrap { position: relative; }
.fw-cap-menu { position: absolute; right: 0; top: 48px; z-index: 30; min-width: 210px; padding: 6px; background: var(--fw-surface); border: 1px solid var(--fw-border); border-radius: 12px; box-shadow: var(--fw-shadow); }
.fw-cap-menu button { display: block; width: 100%; min-height: 46px; padding: 0 12px; background: none; border: 0; border-radius: 8px; text-align: left; font-size: 16px; color: var(--fw-text); cursor: pointer; }
.fw-cap-menu button:hover { background: var(--fw-accent-dim); }
.fw-cap-menu button.is-danger { color: var(--fw-red); }

.fw-capture .fw-cap-head { padding: 12px 16px 10px; }
.fw-cap-titlerow { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.fw-cap-titles { min-width: 0; }
.fw-cap-asset { margin: 0; font-family: var(--font-body); font-size: 26px; line-height: 1.15; font-weight: 700; letter-spacing: -0.01em; color: var(--paper); overflow-wrap: anywhere; text-transform: none; }
.fw-cap-sub { margin-top: 2px; color: var(--paper-dim); font-size: 15px; }
.fw-cap-status { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 3px; font-size: 13.5px; color: var(--paper-dim); text-align: right; }
.fw-cap-gps { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: var(--paper); }
.fw-cap-dot { width: 10px; height: 10px; border-radius: 50%; background: #97a0b8; }
.fw-cap-dot.gps-good { background: #2e8f5b; } .fw-cap-dot.gps-fair { background: #d98a12; } .fw-cap-dot.gps-poor { background: #d8483a; }
.fw-cap-track[data-tone="ok"] { color: var(--fw-green); }

.fw-cap-instr { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 16px; padding: 12px 14px; border-radius: 12px; background: var(--fw-accent-dim); color: var(--fw-accent); font-size: 16px; line-height: 1.4; }
.fw-cap-instr svg { flex: none; margin-top: 1px; }

/* Bigger labels and inputs (16px+ so iOS doesn't zoom the page on focus). */
.fw-capture .field-label { font-size: 18px; font-weight: 700; color: var(--paper); }
.fw-capture input[type="text"], .fw-capture input[type="email"], .fw-capture input[type="tel"], .fw-capture input[type="url"],
.fw-capture input[type="number"], .fw-capture input[type="date"], .fw-capture select, .fw-capture textarea { font-size: 16px; min-height: 52px; }

/* Choice lists -> large tiles. The radio/checkbox stays in the DOM (visually
   hidden, still focusable and announced) and the tile shows the selection. */
.fw-capture .choice-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(104px, 1fr)); gap: 10px; }
.fw-capture .choice-row {
  position: relative; display: flex; align-items: center; justify-content: center; text-align: center;
  min-height: 78px; padding: 12px 10px; border-radius: 14px; font-size: 17px; font-weight: 600;
  background: var(--panel); border: 1.5px solid var(--steel); color: var(--paper); cursor: pointer;
}
.fw-capture .choice-row input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.fw-capture .choice-row:has(input:checked) { border-color: var(--yellow); background: var(--fw-accent-dim); color: var(--fw-accent); box-shadow: 0 0 0 2px var(--fw-accent-dim); }
.fw-capture .choice-row:has(input:checked)::after { content: "\2713"; position: absolute; top: 6px; right: 9px; font-size: 15px; font-weight: 800; }
.fw-capture .choice-row:has(input:focus-visible) { outline: 3px solid var(--fw-cyan); outline-offset: 2px; }

/* Yes / No */
.fw-capture .yesno-toggle button { min-height: 56px; font-size: 17px; font-weight: 700; }

/* Photo: a large add tile, previews at a comfortable size. */
.fw-capture .photo-capture-btn { min-height: 92px; font-size: 17px; font-weight: 600; border-radius: 14px; }
.fw-capture .photo-capture-btn svg { width: 30px; height: 30px; }
.fw-capture .photo-thumb-remove { min-width: 40px; min-height: 40px; }

/* Location captured */
.fw-cap-loc { margin-top: 8px; }
.fw-cap-loc-card { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; background: var(--fw-info-bg); border: 1px solid var(--fw-border); }
.fw-cap-loc-card.is-ok { background: var(--fw-info-bg); }
.fw-cap-loc-card.is-warn { background: var(--fw-orange-bg); }
.fw-cap-loc-card.is-bad { background: var(--fw-red-bg); }
.fw-cap-loc-card.is-muted { background: color-mix(in srgb, var(--fw-border) 40%, transparent); }
.fw-cap-loc-ic { flex: none; color: var(--fw-dim); }
.fw-cap-loc-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; color: var(--paper); }
.fw-cap-loc-text strong { font-size: 16px; }
.fw-cap-loc-text span { font-size: 14px; color: var(--paper-dim); }
.fw-cap-loc-card.is-bad .fw-cap-loc-text span, .fw-cap-loc-card.is-warn .fw-cap-loc-text span { color: inherit; }
.fw-cap-loc-view { flex: none; min-height: 44px; padding: 0 6px; background: none; border: 0; color: var(--fw-accent); font-size: 15.5px; font-weight: 700; cursor: pointer; }
.fw-cap-loc-detail { margin: 6px 4px 0; font-size: 13.5px; color: var(--paper-dim); font-variant-numeric: tabular-nums; }

/* Persistent footer: draft status + ONE primary action, always on screen. */
.fw-cap-footer { flex: none; flex-direction: column; align-items: stretch; gap: 8px; padding: 8px 16px calc(10px + env(safe-area-inset-bottom)); background: var(--panel); border-top: 1px solid var(--steel); box-shadow: 0 -4px 14px rgba(20, 30, 60, 0.10); position: static; }
.fw-cap-saved { display: flex; align-items: center; gap: 8px; justify-content: center; min-height: 22px; font-size: 13.5px; color: var(--paper-dim); }
.fw-cap-saved[data-tone="ok"]::before { content: "\2713"; display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; border-radius: 50%; background: #2e8f5b; color: #fff; font-size: 11px; font-weight: 800; }
.fw-cap-saved[data-tone="bad"] { color: var(--fw-red); font-weight: 600; }
.fw-cap-primary { min-height: 56px; width: 100%; font-size: 18px; font-weight: 700; border-radius: 14px; }
.fw-cap-footer-row { display: flex; gap: 8px; justify-content: center; }
.fw-cap-footer-row .btn { flex: 1; min-height: 46px; background: none; border: 0; color: var(--fw-accent); font-size: 16px; font-weight: 700; }

/* A text box is active (capture.js adds .is-typing): the keyboard covers most of
   the screen, so the footer collapses to ONE short row — draft on the left, the
   primary action on the right. The draft-status line is hidden meanwhile (autosave
   keeps running) and the safe-area padding is dropped, since the keyboard sits
   over the home indicator. Everything returns to full size when focus leaves. */
.fw-cap-root.is-typing .fw-cap-footer { flex-direction: row; align-items: center; gap: 8px; padding: 6px 12px; box-shadow: 0 -2px 8px rgba(20, 30, 60, 0.10); }
.fw-cap-root.is-typing .fw-cap-saved { display: none; }
.fw-cap-root.is-typing .fw-cap-footer-row { display: contents; }
.fw-cap-root.is-typing .fw-cap-footer-row #back-btn { order: 1; }
.fw-cap-root.is-typing .fw-cap-footer-row #save-draft-btn { order: 2; }
.fw-cap-root.is-typing .fw-cap-primary { order: 3; flex: 1.5 1 0; width: auto; min-height: 40px; padding: 0 10px; font-size: 15px; border-radius: 11px; }
.fw-cap-root.is-typing .fw-cap-footer-row .btn { flex: 1 1 0; min-height: 40px; padding: 0 6px; font-size: 14px; border: 1.5px solid var(--fw-border); border-radius: 11px; }

/* Desktop: keep the form a comfortable width inside the full-height page. */
@media (min-width: 720px) {
  .fw-cap-root > .sheet.fw-capture .sheet-header, .fw-cap-root > .sheet.fw-capture .sheet-body, .fw-cap-root > .sheet.fw-capture .sheet-footer { max-width: 680px; margin-left: auto; margin-right: auto; width: 100%; }
}

/* app.css styles .btn / .field-label / .photo-capture-btn as uppercase, tracked
   labels; the focused form uses sentence-case labels at reading size. */
.fw-capture .field-label, .fw-capture .photo-capture-btn, .fw-capture .btn {
  text-transform: none; letter-spacing: 0; font-family: var(--font-body);
}
.fw-capture .btn-primary { color: #fff; }
.fw-capture .photo-capture-btn { width: auto; min-width: 200px; }
