/* TechStone Field — modules/travel.css — P3 Travel: the Map tab (Will: "The Map tab = Travel" — one
 * module, mounted under both the #/map tab root and modules/map.js's alias).
 * Brand Light tokens from app.css only; every rule here keeps the app.css rulings (no sideways scroll,
 * targets 44 px+, inputs 16 px, nowrap only on pills/times — checked by test/field-app-css.test.js, which
 * is why times below reuse the already-allowed `.srow-time` class rather than a new nowrap selector).
 * A separate file so P3 adds no lines to app.css (the P1 Sync precedent).
 *
 * The artboard (project/Travel.dc.html) draws a decorative city backdrop behind hand-placed pins. This
 * app has no stop coordinates on the client (geo_point stays server-side — "location only on request"; no
 * tile map is in scope, D6) and no free map SDK to draw one honestly, so the strip below is an ORDER
 * schematic instead: stops in sequence, not in true geography. Documented as a deviation in the deploy
 * plan, not silently reinterpreted as the real thing.
 */

/* ------------------------------------------------------------------ header row + mode chip */
.trv-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; flex: 0 0 auto; }
.trv-sub { display: block; font: 400 13px/1.3 var(--f-body); color: var(--ink-soft); margin-top: 2px; }
.trv-greet { display: block; font: 600 12px/1.3 var(--f-body); color: var(--ink-soft); margin-bottom: 1px; }
.trv-mode {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 14px;
  border: 1.5px solid var(--btn-rule);
  border-radius: 10px;
  background: var(--card);
  color: var(--ink, var(--basalt));
  font: 600 13px/1.2 var(--f-body);
  cursor: pointer;
}
.trv-mode .ic { width: 16px; height: 16px; }

/* ------------------------------------------------------------------ the order-schematic strip */
.trv-map {
  flex: 0 0 auto;
  position: relative;
  min-height: 92px;
  padding: 16px 14px 10px;
  border: 1px solid var(--rule);
  border-radius: 14px;
  background: var(--card);
  overflow: hidden;
}
.trv-map-row { display: flex; align-items: center; gap: 0; }
.trv-map-stop { flex: 1 1 auto; display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; }
.trv-map-line { flex: 1 1 24px; height: 2px; margin: 0 -2px 22px; background: var(--rule); min-width: 8px; }
.trv-map-line.walk { background: repeating-linear-gradient(90deg, var(--copper-ink) 0 4px, transparent 4px 8px); }
.trv-pin {
  width: 26px;
  height: 26px;
  flex: 0 0 auto;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--basalt);
  color: var(--offwhite);
  font: 800 11px/1 var(--f-head);
  border: 2px solid var(--card);
  box-shadow: 0 0 0 1px var(--rule);
}
.trv-pin.fl { background: var(--card); color: var(--ink, var(--basalt)); border: 2px dashed var(--copper-ink); box-shadow: none; }
.trv-pin.hq { border-radius: 7px; background: var(--copper); font-size: 9.5px; }
.trv-map-lab {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
  line-clamp: 1;
  overflow: hidden;
  font: 600 11px/1.2 var(--f-body);
  color: var(--ink-soft);
  max-width: 64px;
  text-align: center;
}
.trv-finish {
  position: absolute;
  right: 10px;
  top: 10px;
  height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid var(--rule);
  display: inline-flex;
  align-items: center;
  font: 600 11.5px/1.2 var(--f-body);
  color: var(--ink, var(--basalt));
}

/* ------------------------------------------------------------------ stops timeline (a Deck) */
.trv-deck { flex: 1 1 auto; min-height: 0; }
.trv-st {
  display: grid;
  grid-template-columns: 26px 46px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  width: 100%;
  height: 100%;
  padding: 0 4px;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--card);
  text-align: left;
}
.trv-st-no { justify-self: center; }
.trv-st-t1, .trv-st-t2 { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 1; line-clamp: 1; overflow: hidden; }
.trv-st-t1 { font: 600 14px/1.3 var(--f-body); }
.trv-st-t2 { font: 400 12.5px/1.3 var(--f-body); color: var(--ink-soft); }

/* ------------------------------------------------------------------ saved routes (a Deck) */
.trv-sv {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  width: 100%;
  height: 100%;
  padding: 0 12px;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--card);
  text-align: left;
}
.trv-sv-t1, .trv-sv-t2 { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 1; line-clamp: 1; overflow: hidden; }
.trv-sv-t1 { font: 600 14.5px/1.3 var(--f-body); }
.trv-sv-t2 { font: 400 12.5px/1.3 var(--f-body); color: var(--ink-soft); }

/* ------------------------------------------------------------------ profile / save-as-route / recall sheets */
.trv-form { display: flex; flex-direction: column; gap: 12px; }
.trv-hint { font: 400 13px/1.4 var(--f-body); color: var(--ink-soft); }
.trv-dates { display: flex; flex-wrap: wrap; gap: 8px; }
.trv-date-chip {
  min-height: 44px;
  padding: 0 14px;
  border: 1.5px solid var(--btn-rule);
  border-radius: 999px;
  background: var(--card);
  color: var(--ink, var(--basalt));
  font: 600 14px/1.2 var(--f-body);
  cursor: pointer;
}
.trv-date-chip.on { border-color: var(--copper-solid, var(--basalt)); background: var(--copper-solid, var(--basalt)); color: var(--offwhite); }
.trv-pending { font: 500 13px/1.4 var(--f-body); color: var(--ink-soft); }

/* ------------------------------------------------------------------ Update #3: Locations (the pin map) */
/* Only the Locations segment fills the stage (search + full-height deck); scoped to #trv-body.trv-body-fill
 * so the trip/routes segments keep their existing block layout. All rules keep the app.css rulings: no
 * sideways scroll, no fixed width > 360 / min-width > 320 outside the 768 breakpoint, targets 44 px+, the
 * search input 16 px (no iOS zoom), and nowrap only via the shared .chip. */
.trv-body-fill { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; gap: 10px; }
.trv-loc-tools { flex: 0 0 auto; display: flex; flex-direction: column; gap: 8px; }
/* 9 Oct 2026: the browser Field Map button, its one-line note, and the in-app map beneath it */
.trv-maplinks { display: flex; flex-direction: column; gap: 8px; margin-bottom: 4px; }
.trv-maplinks .trv-hint { margin: 0; }
.trv-loc-q {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1.5px solid var(--btn-rule);
  border-radius: 10px;
  background: var(--card);
  color: var(--ink, var(--basalt));
  font: 400 16px/1.2 var(--f-body);
}
.trv-loc-q:focus { border-color: var(--copper); outline: none; box-shadow: 0 0 0 3px rgba(180, 122, 60, .25); }
.trv-loc-types { display: flex; flex-wrap: wrap; gap: 8px; }
.trv-loc-chip {
  min-height: 44px;
  padding: 0 14px;
  border: 1.5px solid var(--btn-rule);
  border-radius: 999px;
  background: var(--card);
  color: var(--ink, var(--basalt));
  font: 600 13.5px/1.2 var(--f-body);
  cursor: pointer;
}
.trv-loc-chip.on { border-color: var(--copper-solid, var(--basalt)); background: var(--copper-solid, var(--basalt)); color: var(--offwhite); }
.trv-loc-count { flex: 0 0 auto; font: 400 12.5px/1.3 var(--f-body); color: var(--ink-soft); }
.trv-loc-deck { flex: 1 1 auto; min-height: 0; }

/* The tile map (#1, 29 Sep 2026). modules/tilemap.js draws it; the .tm-* rules live here because travel is
 * its only caller, and a separate tilemap.css would be one more precached file.
 * 30 Sep 2026 refit: the map is no longer embedded in the tab, so there is no `.trv-map { min-height: 260px }`
 * override here any more - which also stops it fighting the order-schematic strip above, which is .trv-map
 * too and wants flex: 0 0 auto at 92 px. The map's own screen sizes it: .fm-map below. */
.tm { position: relative; overflow: hidden; border-radius: 12px; background: #e8e4dd; touch-action: none; user-select: none; -webkit-user-select: none; }
.tm-tiles, .tm-pins, .tm-route { position: absolute; inset: 0; }
.tm-route { pointer-events: none; }
.tm-pins { pointer-events: none; }
.tm-t { position: absolute; width: 256px; height: 256px; pointer-events: none; }
.tm-p {
  position: absolute; width: 18px; height: 18px; margin: -9px 0 0 -9px; padding: 0;
  border: 2px solid #fff; border-radius: 50%; box-shadow: 0 1px 3px rgba(0,0,0,.4);
  background: var(--ink-soft, #6b6f76); cursor: pointer; pointer-events: auto;
}
.tm-p::after { content: ""; position: absolute; inset: -13px; border-radius: 50%; }   /* a 44 px touch target */
.tm-client { background: #2f7d4f; }
.tm-project { background: #b47a3c; }
.tm-prospect { background: #3b6ea8; }
.tm-zoom { position: absolute; right: 8px; bottom: 26px; display: flex; flex-direction: column; gap: 6px; }
.tm-zb {
  width: 44px; height: 44px; border: 1px solid var(--rule, #cfcac2); border-radius: 10px;
  background: var(--card, #fff); font-size: 20px; line-height: 1; cursor: pointer;
}
.tm-attr { position: absolute; left: 0; right: 0; bottom: 0; padding: 2px 6px; font-size: 10px; background: rgba(255,255,255,.75); color: #444; }
.tm-attr a { color: inherit; }
.trv-loc {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  width: 100%;
  height: 100%;
  min-height: 44px;   /* the whole row is the tap target (Deck onOpen) — never under 44 px */
  padding: 6px 10px;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--card);
  text-align: left;
  cursor: pointer;
}
.trv-loc-ic { justify-self: center; display: grid; place-items: center; color: var(--copper-ink); }
.trv-loc-ic .ic { width: 22px; height: 22px; }
.trv-loc-t1, .trv-loc-t2 { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 1; line-clamp: 1; overflow: hidden; }
.trv-loc-t1 { font: 600 14px/1.3 var(--f-body); }
.trv-loc-t2 { font: 400 12.5px/1.3 var(--f-body); color: var(--ink-soft); }
.trv-loc-kv { display: flex; flex-direction: column; gap: 10px; margin: 4px 0 16px; }

@media (max-width: 359px) {
  .trv-map-lab { max-width: 44px; }
  .trv-mode span.trv-mode-w { display: none; }
}

/* ------------------------------------------------------------------ #1 refit: the map on its own screen
 * Will, 30 Sep 2026: the embedded map was "difficult to navigate because I had to manually use the zoom
 * in/out controls to view locations properly. The limited map viewing area within the app also makes it
 * less convenient to use." So #/map/full gives the tiles the whole phone (app.css hides the header and the
 * tab bar while it is open) and every control floats over them instead of taking room from them. */
.fm { position: absolute; inset: 0; }
.fm-map { position: absolute; inset: 0; z-index: 0; }
.fm .tm { border-radius: 0; }                                        /* edge to edge, no card corners */
.fm .tm-zoom { bottom: calc(var(--safe-b) + 30px); }                 /* clear of the attribution strip */
.fm .tm-attr { padding-bottom: calc(2px + var(--safe-b)); }
.fm-back, .fm-find, .fm-save {
  position: absolute;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;                                                  /* never under 44 px - it is a phone */
  padding: 0 14px;
  border: 1px solid var(--btn-rule);
  border-radius: 22px;
  background: var(--card);
  color: var(--ink, var(--basalt));
  font: 600 13.5px/1.2 var(--f-head);
  text-decoration: none;
  box-shadow: 0 2px 10px rgba(16, 24, 40, .20);
  cursor: pointer;
}
.fm-back { top: calc(var(--safe-t) + 8px); left: 8px; }
.fm-find { top: calc(var(--safe-t) + 8px); right: 8px; width: 44px; padding: 0; justify-content: center; }
.fm-find.on { background: var(--copper-solid, var(--basalt)); border-color: var(--copper-solid, var(--basalt)); color: var(--offwhite); }
/* Bottom left, because tilemap.js puts its own zoom buttons bottom right. */
.fm-save { bottom: calc(var(--safe-b) + 30px); left: 8px; max-width: calc(100% - 76px); }
.fm-back .ic, .fm-find .ic, .fm-save .ic { width: 18px; height: 18px; flex: 0 0 auto; }
.fm-tools {
  position: absolute;
  z-index: 2;
  top: calc(var(--safe-t) + 60px);
  left: 8px;
  right: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--rule);
  border-radius: 12px;
  background: var(--card);
  box-shadow: 0 8px 24px rgba(16, 24, 40, .24);
}
.fm-tools[hidden] { display: none; }                                 /* it is display:flex otherwise */
.fm-note {
  position: absolute;
  z-index: 1;
  top: 50%;
  left: 16px;
  right: 16px;
  transform: translateY(-50%);
  margin: 0;
  text-align: center;
  font: 400 14.5px/1.45 var(--f-body);
  color: var(--ink-soft);
}
/* The same note when the map is drawn behind it: it needs a ground of its own to stay readable, and
   it sits below the controls rather than across the middle, so the map is still usable underneath. */
.fm-note-card {
  top: calc(var(--safe-t) + 60px);
  transform: none;
  z-index: 2;
  padding: 10px 14px;
  border: 1px solid var(--rule);
  border-radius: 12px;
  background: var(--card);
  color: var(--ink, var(--basalt));
}

/* dark overrides (generated 12 Oct 2026) */
html[data-theme='dark'] .tm{background:var(--card2,#e8e4dd)}
html[data-theme='dark'] .tm-p{border-color:var(--border,#fff)}
html[data-theme='dark'] .tm-attr{background:var(--card,rgba(255,255,255,.75));color:var(--text,#444)}
