/* map - styles owned by mod/map.js. Ported from the demo's mod-map.css.
   The shared map styles (#mapWrap, .aTag, .tTag, .rTag, .pendTag, chips,
   #findWrap) are in app-ui.css; this file carries what the map feature
   added on top: department-level flags, Find rows for unpinned machines,
   and the live-position layer. */

/* A contractor's assigned machines: the pink pulsing target ring, tappable
   (owner: "when they open the map they see their work blinking"). */
.tTag.work{cursor:pointer;}
.tTag.work circle.core, .tTag.work text{pointer-events:all;}

/* ---- reporter-marked spot (owner, 2026-09-02; D73/D74) ----
   A flagged machine with no pin, drawn where the reporter tapped — exactly
   as a pin: the same dot, the same size, the same colours (app-ui.css
   .aTag.job / .safety / .blink). No ring, no badge, nothing around it.
   (The department badge of D28 and the dashed "mark" ring were removed on
   2026-09-04 at the owner's word.) */

/* the crosshair under the "marked spot" chip when a card sends you here —
   the accent crosshair of placement, but dashed: it is a mark, not a pin */
.pendTag.spot circle{stroke-dasharray:4 3;}
.chip.spot{border:1px dashed var(--accent);}
.chip.spot b{color:var(--accent);}

/* Find: an Asset Book machine that is not on the map */
.pill.none{color:var(--muted); border-color:var(--line);}
.srow.dim{cursor:default;}
.srow.dim:hover{background:transparent;}

/* the hint bar fades after a few seconds (map.js setHint); once gone it takes
   no taps, so the floor plan underneath is fully usable */
.maphint{transition:opacity .6s ease;}
.maphint.gone{opacity:0; pointer-events:none;}

/* the drawing has not arrived yet: keep the frame visible so the pins have
   a floor to sit on rather than floating in the dark */
#mapImg:not([src]){background:var(--panel); opacity:.35;}

/* ---- building outline on the roof drawing (map/outline.js) ----
   Under the air-unit markers, never tappable. Stroke width is set by the
   map on every redraw so it stays about 2 px on screen. Dark on both
   themes: it sits on the white roof drawing, not on the app's surfaces. */
#outlineSvg{position:absolute; left:0; top:0; overflow:visible; pointer-events:none;}
#outlineSvg path.bldg{fill:none; stroke:#0d1015; stroke-linejoin:round; stroke-linecap:round;}
html[data-theme="light"] #outlineSvg path.bldg{stroke:#1a2230;}

/* ---- the legend over the printed one (map/legend.js) ----
   White on both themes — it covers a white box printed into the drawing.
   Only the row cells take taps; the selected row is tinted the same pink
   as the department mask. */
/* The layer itself must be transparent to taps — it spans the whole map, and
   without this it swallowed every pin tap and the map answered with the
   department under the finger instead of the machine (owner, 2026-09-02). */
#legendSvg{position:absolute; left:0; top:0; overflow:visible; pointer-events:none;}
/* ...but the white box and the row cells DO take taps: a tap on the box
   clears the department instead of sampling the printed swatch under it */
#legendSvg rect.box{pointer-events:all;}
#legendSvg .legRow{cursor:pointer;}
#legendSvg .legRow.rest{cursor:default;}
#legendSvg .legRow rect.cell{fill:#000; fill-opacity:0; pointer-events:all;}
@media (hover:hover){ #legendSvg .legRow:not(.rest):hover rect.cell{fill-opacity:.06;} }
/* Selected row: a heavy dark frame, not a colour tint — visible in greyscale. */
#legendSvg .legRow.on rect.cell{fill:#000; fill-opacity:.08; stroke:#111; stroke-width:6px;}
#legendSvg text{fill:#111; font-weight:600; dominant-baseline:central; -webkit-user-select:none; user-select:none;}

/* ---- live position ----
   Its own SVG layer above the markers, so it rides both drawings (the plant
   and RTU images share one pixel frame) and a marker redraw never touches it. */
#gpsSvg{position:absolute; left:0; top:0; overflow:visible; pointer-events:none;}
.gpsAcc{fill:rgba(53,194,255,.16); stroke:rgba(53,194,255,.6); stroke-width:1.5;
  vector-effect:non-scaling-stroke;}
/* the old program's navLine: from the fix to the Find target - dashed, so it
   reads in greyscale too, and one width on screen at any zoom */
.navLine{stroke:var(--target); stroke-width:2.5; stroke-dasharray:8 7; fill:none;
  vector-effect:non-scaling-stroke; stroke-linecap:round;}
.gpsDot circle.core{fill:#2b8cff; stroke:#fff; stroke-width:2.5;}
.gpsDot circle.halo{fill:none; stroke:#2b8cff; stroke-width:3;
  animation:tpulse 2s ease-out infinite;}
/* simulated — same dot, dashed halo, so it never passes for a real fix */
.gpsDot.sim circle.core{fill:var(--warn);}
.gpsDot.sim circle.halo{stroke:var(--warn); stroke-dasharray:5 4;}
.chip.gps{border:1px solid #2b8cff;}
.chip.gps .cn{font-family:var(--sans); font-size:12.5px;}
.chip.gps.offmap, .chip.gps.err{border-color:var(--warn);}
.chip.gps.sim{border-color:var(--warn); border-style:dashed;}
@media (prefers-reduced-motion:reduce){
  .gpsDot circle.halo{animation:none; opacity:.7;}
}
