/* ==========================================================================
   TABIFLOW V2 — Trip Map Pane
   --------------------------------------------------------------------------
   File: styles/components/map-pane.css
   Source: Mock-up/planner-v2-mockup.html §3 (Trip map slide-in pane)
   Load order: After pin-quest.css, before shell.css

   C2 Day 3 scope: Full-screen slide-in trip map, showing all pinned stops
   across all days. Opens from stop ⋮ action "View trip map".
   Two-instance strategy: tripMapController (#trip-map-canvas) is separate
   from mapController (#map-canvas) — V1 pick-mode map untouched.

   All rules scoped to html.tf-v2panel — V1 users never see this surface.

   z-index map:
     #tm-overlay: 280  (below pq-overlay 289; above stop-action-panel 190)
     #tm-pane:    281

   !important policy: every usage annotates which inline style it defeats.
   ========================================================================== */


/* ── 1. Overlay / backdrop ─────────────────────────────────────────────── */
/*
 * Fixed full-screen dimmer. Same pattern as #pq-overlay in pin-quest.css.
 * Darker than PQ overlay (0.72 vs 0.55) — full-screen pane warrants it.
 * style="display:none" set in planner.html; .is-open reveals via !important.
 */

html.tf-v2panel #tm-overlay {
  position: fixed;
  inset: 0;
  z-index: 280;
  background: rgba(0, 0, 0, 0.72);
  display: none;
}

html.tf-v2panel #tm-overlay.is-open {
  display: block !important; /* defeats inline style="display:none" */
  animation: tm-fade-in var(--tf-duration-fast) linear both;
}


/* ── 2. Pane shell ─────────────────────────────────────────────────────── */
/*
 * Full-screen fixed-position pane.
 * display:none → display:flex !important on .is-open.
 * flex-direction: column → topbar, map canvas (flex:1), dock.
 * padding-bottom: env(safe-area-inset-bottom) clears iOS home indicator.
 *
 * Slide-up uses @keyframes (not transition) because display is not animatable
 * via transition — the keyframe fires on class-add regardless of prior display.
 */

html.tf-v2panel #tm-pane {
  position: fixed;
  inset: 0;
  z-index: 281;
  background: var(--tf-bg-page);
  display: none;
  flex-direction: column;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

html.tf-v2panel #tm-pane.is-open {
  display: flex !important; /* defeats inline style="display:none" */
  animation: tm-slide-up var(--tf-duration-normal) var(--tf-ease) both;
}


/* ── 3. Slide-up + fade-in keyframes ───────────────────────────────────── */
/*
 * tm-slide-up: 24px translate — slightly larger than pq-slide-up (20px) to
 * reinforce the full-screen weight of this pane vs the bottom-sheet PQ pane.
 */

@keyframes tm-slide-up {
  from {
    transform: translateY(24px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes tm-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}


/* ── 4. Topbar ─────────────────────────────────────────────────────────── */
/*
 * "Trip Map" title left, × close button right.
 * height: 52px — matches V2 shell topbar visual weight.
 * border-bottom: subtle line separating topbar from map canvas.
 * Close: min-height/width 44px (--tf-tap-min) per IW10 tap-target spec.
 * No .focus() call on close — v2-bug-log #1 (iOS ghost-click after tap).
 */

html.tf-v2panel .tm-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 52px;
  padding: 0 var(--tf-space-md);
  border-bottom: 1px solid var(--tf-border-line);
  flex-shrink: 0;
  gap: var(--tf-space-sm);
}

html.tf-v2panel .tm-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--tf-text-primary);
  flex: 1;
}

html.tf-v2panel .tm-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  font-size: 20px;
  color: var(--tf-text-secondary);
  cursor: pointer;
  min-height: var(--tf-tap-min);
  min-width: var(--tf-tap-min);
  border-radius: var(--tf-radius-md);
  transition: background var(--tf-duration-fast);
  padding: 0;
  font-family: inherit;
  line-height: 1;
  flex-shrink: 0;
}

html.tf-v2panel .tm-close:hover,
html.tf-v2panel .tm-close:focus-visible {
  background: var(--tf-bg-surface);
  outline: none;
}

html.tf-v2panel .tm-close:focus-visible {
  box-shadow: var(--tf-focus-ring);
}

/* Day ▾ selector — sits in .tm-topbar between title and View all.
 * Matches solid v2 surface tokens. min-height 44px = --tf-tap-min.
 * appearance: none omitted intentionally — native chevron communicates
 * interactivity on both iOS and Android without custom arrow markup.
 * margin-left: auto pushes View-all + close to the right. */
html.tf-v2panel .tm-day-select {
  background: var(--tf-bg-elevated);
  color: var(--tf-text-primary);
  border: 1px solid var(--tf-border-soft);
  border-radius: var(--tf-radius-md);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  padding: 0 var(--tf-space-md);
  min-height: var(--tf-tap-min);
  min-width: 80px;
  cursor: pointer;
  flex-shrink: 0;
  /* .tm-topbar uses justify-content: space-between — no margin-left: auto needed */
}

html.tf-v2panel .tm-day-select:focus-visible {
  outline: none;
  box-shadow: var(--tf-focus-ring);
}

/* Issue 1 — View all button. Sits between title and close in the topbar.
 * Fits all rendered pins (located + fanned) on tap; uses fitAllPins on the
 * controller with padding:50 / maxZoom:14. */
html.tf-v2panel .tm-view-all-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--tf-border-soft);
  color: var(--tf-text-primary);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: var(--tf-radius-md);
  cursor: pointer;
  min-height: 32px;
  margin-left: auto;
  margin-right: var(--tf-space-sm);
  transition: background var(--tf-duration-fast);
}

html.tf-v2panel .tm-view-all-btn:hover,
html.tf-v2panel .tm-view-all-btn:focus-visible {
  background: var(--tf-bg-surface);
  outline: none;
}

html.tf-v2panel .tm-view-all-btn:focus-visible {
  box-shadow: var(--tf-focus-ring);
}


/* ── 5. Map canvas ─────────────────────────────────────────────────────── */
/*
 * #trip-map-canvas: fills space between topbar and dock.
 * flex: 1 + min-height: 0 prevent Leaflet overflow on small viewports.
 * background: --tf-bg-surface shows while tiles are loading.
 * position: relative — needed for absolutely-positioned service-limit card.
 * isolation: isolate — contains Leaflet's own stacking context (panes at z-200..1000)
 *   so that siblings of #trip-map-canvas inside #tm-pane (picker, error card) can
 *   paint over it with modest z-indexes without racing Leaflet's internals.
 *
 * tripMapController initialises the Leaflet map inside this element via
 * createMapController({ mapElementId: "trip-map-canvas" }).
 * Leaflet is called after display:flex resolves (double-RAF in openTripMapPane).
 */

html.tf-v2panel #trip-map-canvas {
  flex: 1;
  min-height: 0;
  background: var(--tf-bg-surface);
  position: relative;
  isolation: isolate;   /* contains Leaflet z-indexes; picker + error-card win at z-index:10 */
}

/* Leaflet container inherits full dimensions from flex parent */
html.tf-v2panel #trip-map-canvas .leaflet-container {
  width: 100%;
  height: 100%;
  background: var(--tf-bg-surface);
}


/* ── 6. Dock ───────────────────────────────────────────────────────────── */
/*
 * Two-button dock row at the bottom of the pane.
 *   #tm-list-view-btn — "🗺 List view"          — closes pane, returns to plan
 *   #tm-pinquest-btn  — "🎯 Pin Quest · N left" — opens Pin Quest pane (C1)
 *
 * border-top: divider between map canvas and dock.
 * Dock height: 52px — symmetrical with topbar.
 * padding-bottom on #tm-pane (env safe area) applies to the dock's bottom edge.
 *
 * No class names contain "menu" or "more" substrings (V1 blanket rules
 * at styles.css L1484–1486; conflict-registry #3).
 */

html.tf-v2panel .tm-dock {
  display: flex;
  align-items: stretch;
  border-top: 1px solid var(--tf-border-line);
  flex-shrink: 0;
}

html.tf-v2panel .tm-dock-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--tf-space-xs);
  background: var(--tf-bg-elevated);
  border: none;
  color: var(--tf-text-secondary);
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  min-height: 52px;
  padding: var(--tf-space-sm) var(--tf-space-md);
  transition: background var(--tf-duration-fast), color var(--tf-duration-fast);
}

html.tf-v2panel .tm-dock-btn:first-child {
  border-right: 1px solid var(--tf-border-line);
}

html.tf-v2panel .tm-dock-btn:hover,
html.tf-v2panel .tm-dock-btn:focus-visible {
  background: var(--tf-bg-elevated-2);
  color: var(--tf-text-primary);
  outline: none;
}

html.tf-v2panel .tm-dock-btn:focus-visible {
  box-shadow: var(--tf-focus-ring);
}

html.tf-v2panel .tm-dock-icon {
  font-size: 16px;
  line-height: 1;
  flex-shrink: 0;
}

/*
 * Badge showing count of unpinned stops next to "Pin Quest".
 * hidden attr toggled by renderTripMapPins() — badge absent when count is 0.
 * Primary-soft background with --tf-primary text — consistent with pq-soon-label.
 */

html.tf-v2panel .tm-dock-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--tf-primary-soft);
  color: var(--tf-primary);
  font-size: 11px;
  font-weight: 600;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: var(--tf-radius-full);
  line-height: 1;
  flex-shrink: 0;
}

html.tf-v2panel .tm-dock-badge[hidden] {
  display: none;
}


/* ── 7. Map service offline card ───────────────────────────────────────── */
/*
 * #tm-service-limit-card is inside #trip-map-canvas, absolutely positioned
 * to overlay the map canvas when tiles fail (tileerror event).
 * Shows mockup §3 offline state copy:
 *   Title: "Map needs a connection"
 *   Body:  "Your trip is safe here. Tiles load when network returns."
 *
 * pointer-events: none — lets the map layer still receive gestures so the
 * user can pan/zoom while waiting for tiles to return.
 *
 * Shares .map-error-card / .map-error-card-* class names with V1 map panel
 * card — CSS specificity via #trip-map-canvas parent selector keeps them
 * visually distinct without duplicate class names.
 */

html.tf-v2panel #trip-map-canvas .map-error-card {
  position: absolute;
  left: var(--tf-space-lg);
  right: var(--tf-space-lg);
  bottom: var(--tf-space-xl);
  z-index: 10;
  background: var(--tf-bg-elevated);
  border: 1px solid var(--tf-border-soft);
  border-radius: var(--tf-radius-lg);
  padding: var(--tf-space-xl);
  text-align: center;
  pointer-events: none;
}

html.tf-v2panel #trip-map-canvas .map-error-card-icon {
  font-size: 28px;
  margin-bottom: var(--tf-space-sm);
}

html.tf-v2panel #trip-map-canvas .map-error-card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--tf-text-primary);
  margin-bottom: var(--tf-space-xs);
}

html.tf-v2panel #trip-map-canvas .map-error-card-body {
  font-size: 13px;
  color: var(--tf-text-secondary);
  line-height: 1.55;
}


/* ── 8. Path B — #tm-drop-pin-picker (foggy-stop picker, >1 unlocated stops) ── */
/*
 * Sits between #trip-map-canvas and .tm-dock inside #tm-pane.
 * Hidden by default (hidden attr); shown by JS when >1 foggy stops exist.
 * Overlay the canvas so the picker appears centred over the map area.
 *
 * CSS discipline: every selector prefixed html.tf-v2panel (per pin-quest.css
 * convention). !important only used where noted to defeat inline styles.
 */

html.tf-v2panel #tm-drop-pin-picker {
  position: absolute;               /* !important not needed — #tm-pane is position:fixed */
  left: 0;
  right: 0;
  bottom: 64px;                     /* above .tm-dock (approx 64px tall) */
  max-height: 60%;
  overflow-y: auto;
  background: var(--tf-bg-surface);
  border-top: 1px solid var(--tf-border-soft);
  z-index: 10;
  padding: var(--tf-space-md) var(--tf-space-lg);
  display: flex;
  flex-direction: column;
  gap: var(--tf-space-sm);
}

html.tf-v2panel #tm-drop-pin-picker[hidden] {
  display: none !important;         /* defeats display:flex above when hidden attr present */
}

html.tf-v2panel .tm-drop-pin-picker-head {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--tf-text-muted);
  padding-bottom: var(--tf-space-xs);
  border-bottom: 1px solid var(--tf-border-line);
}

html.tf-v2panel .tm-drop-pin-picker-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

html.tf-v2panel .tm-drop-pin-picker-row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: var(--tf-space-sm);
  padding: 10px var(--tf-space-sm);
  border-radius: var(--tf-radius-sm);
  border: none;
  background: transparent;
  color: var(--tf-text-primary);
  font-family: inherit;
  font-size: 14px;
  text-align: left;
  cursor: pointer;
  min-height: var(--tf-tap-min);
  transition: background 100ms;
}

html.tf-v2panel .tm-drop-pin-picker-row:hover,
html.tf-v2panel .tm-drop-pin-picker-row:active {
  background: var(--tf-bg-elevated);
}

html.tf-v2panel .tm-drop-pin-picker-row:focus-visible {
  outline: none;
  box-shadow: var(--tf-focus-ring);
}

html.tf-v2panel .tm-drop-pin-picker-icon {
  color: var(--tf-text-muted);
  font-size: 8px;
  flex: 0 0 auto;
}

html.tf-v2panel .tm-drop-pin-picker-label {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

html.tf-v2panel .tm-drop-pin-all-pinned {
  font-size: 14px;
  color: var(--tf-text-secondary);
  text-align: center;
  padding: var(--tf-space-md) 0;
}


/* ── 9. Path B redesign — #tm-simplified-popup (in-drawer confirm + advanced) ── */
/*
 * Sits between #trip-map-canvas and .tm-dock inside #tm-pane (sibling of
 * #tm-drop-pin-picker; mutually exclusive via hidden attribute). Same
 * stacking context governed by §5 #trip-map-canvas isolation:isolate (203f13e).
 *
 * Two modes — "simple" (default: Save / Move pin / ⋮) and "advanced" (5-row
 * menu reached via ⋮, ← Back returns). Same root element, content swapped.
 *
 * Pan-to-move flow uses inline visibility:hidden during active map pan
 * (set by JS movestart listener gated by drawerPanMoveActive). CSS keeps
 * the layout slot reserved so re-show on moveend is instant.
 *
 * CSS discipline: every selector prefixed html.tf-v2panel; !important only
 * where it defeats an inline style with a comment naming the target.
 */

html.tf-v2panel #tm-simplified-popup {
  position: absolute;               /* parent #tm-pane is position:fixed */
  left: 0;
  right: 0;
  bottom: 64px;                     /* above .tm-dock (matches picker §8) */
  max-height: 70%;
  overflow-y: auto;
  background: var(--tf-bg-surface);
  border-top: 1px solid var(--tf-border-soft);
  z-index: 10;
  padding: var(--tf-space-md) var(--tf-space-lg);
  display: flex;
  flex-direction: column;
  gap: var(--tf-space-sm);
  transition: visibility 80ms;      /* visibility is JS-controlled; transition is for the instant snap-back */
}

html.tf-v2panel #tm-simplified-popup[hidden] {
  display: none !important;         /* defeats display:flex above when hidden attr present */
}

/* Simple mode — kicker / label / prompt / disclaimer / actions */

html.tf-v2panel .tm-simplified-popup-kebab {
  position: absolute;
  top: var(--tf-space-sm);
  right: var(--tf-space-sm);
  background: transparent;
  border: none;
  color: var(--tf-text-muted);
  font-size: 20px;
  line-height: 1;
  padding: 4px 8px;
  cursor: pointer;
  font-family: inherit;
}

html.tf-v2panel .tm-simplified-popup-kebab:focus-visible {
  outline: none;
  box-shadow: var(--tf-focus-ring);
  border-radius: var(--tf-radius-sm);
}

html.tf-v2panel .tm-simplified-popup-kicker {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--tf-text-muted);
  padding-right: 32px;              /* kebab clearance */
}

html.tf-v2panel .tm-simplified-popup-label {
  font-size: 16px;
  font-weight: 600;
  color: var(--tf-text-primary);
  padding-right: 32px;              /* kebab clearance */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

html.tf-v2panel .tm-simplified-popup-prompt {
  font-size: 13px;
  color: var(--tf-text-secondary);
  margin: 0;
}

html.tf-v2panel .tm-simplified-popup-disclaimer {
  font-size: 11px;
  color: var(--tf-text-muted);
  line-height: 1.45;
  margin: 0;
}

html.tf-v2panel .tm-simplified-popup-actions {
  display: flex;
  gap: var(--tf-space-sm);
  margin-top: var(--tf-space-xs);
}

html.tf-v2panel .tm-simplified-popup-save {
  flex: 1;
  /* background + border-color set inline by JS to the day-color palette */
  color: #ffffff;
  border: 1px solid transparent;
  border-radius: var(--tf-radius-md);
  padding: 10px 14px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  min-height: var(--tf-tap-min);
  transition: opacity 120ms;
}

html.tf-v2panel .tm-simplified-popup-save:hover,
html.tf-v2panel .tm-simplified-popup-save:active {
  opacity: 0.88;
}

html.tf-v2panel .tm-simplified-popup-save:focus-visible {
  outline: none;
  box-shadow: var(--tf-focus-ring);
}

html.tf-v2panel .tm-simplified-popup-move {
  flex: 0 0 auto;
  background: transparent;
  color: var(--tf-text-primary);
  border: 1px solid var(--tf-border-soft);
  border-radius: var(--tf-radius-md);
  padding: 10px 14px;
  font-family: inherit;
  font-size: 14px;
  cursor: pointer;
  min-height: var(--tf-tap-min);
  transition: background 100ms;
}

html.tf-v2panel .tm-simplified-popup-move:hover,
html.tf-v2panel .tm-simplified-popup-move:active {
  background: var(--tf-bg-elevated);
}

html.tf-v2panel .tm-simplified-popup-move:focus-visible {
  outline: none;
  box-shadow: var(--tf-focus-ring);
}

/* Location Editor — locked state badge */
html.tf-v2panel .tm-simplified-popup-lock-badge {
  font-size: 13px;
  font-weight: 600;
  color: var(--tf-text-primary);
  margin-bottom: var(--tf-space-xs);
}

/* Location Editor — disclaimer slot (display:none inline until copy approved) */
html.tf-v2panel .tm-loc-ed-disclaimer[data-disclaimer-slot] {
  font-size: 11px;
  color: var(--tf-text-muted);
  line-height: 1.45;
  margin: 0;
}

/* Advanced mode — back arrow + 5-row menu + status */

html.tf-v2panel .tm-simplified-popup-back {
  align-self: flex-start;
  background: transparent;
  border: none;
  color: var(--tf-text-secondary);
  font-size: 18px;
  line-height: 1;
  padding: 4px 8px;
  cursor: pointer;
  font-family: inherit;
}

html.tf-v2panel .tm-simplified-popup-back:focus-visible {
  outline: none;
  box-shadow: var(--tf-focus-ring);
  border-radius: var(--tf-radius-sm);
}

html.tf-v2panel .tm-simplified-popup-advanced-head {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--tf-text-muted);
  padding-bottom: var(--tf-space-xs);
  border-bottom: 1px solid var(--tf-border-line);
}

/* Location Editor — smart locator field (advanced mode) */
html.tf-v2panel .tm-loc-ed-locator-field {
  display: flex;
  gap: var(--tf-space-xs);
  margin: var(--tf-space-sm) 0;
}

html.tf-v2panel .tm-loc-ed-locator-input {
  flex: 1;
  min-width: 0;
  padding: 8px 10px;
  font-size: 14px;
  font-family: inherit;
  border: 1px solid var(--tf-border-soft);
  border-radius: var(--tf-radius-md);
  background: var(--tf-bg-surface);
  color: var(--tf-text-primary);
  box-sizing: border-box;
}

html.tf-v2panel .tm-loc-ed-locator-input::placeholder {
  color: var(--tf-text-muted);
}

html.tf-v2panel .tm-loc-ed-locator-input:focus {
  outline: none;
  box-shadow: var(--tf-focus-ring);
}

html.tf-v2panel .tm-loc-ed-locator-btn {
  flex: 0 0 auto;
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  background: #10b981;
  color: #ffffff;
  border: none;
  border-radius: var(--tf-radius-md);
  cursor: pointer;
  min-height: var(--tf-tap-min);
}

html.tf-v2panel .tm-loc-ed-locator-btn:active {
  opacity: 0.88;
}

html.tf-v2panel .tm-loc-ed-locator-btn:focus-visible {
  outline: none;
  box-shadow: var(--tf-focus-ring);
}


/* ── 11. All-days legend ───────────────────────────────────────────────── */
/*
 * #tm-day-legend: positioned over the map canvas (bottom-left), matches
 * build reference Screen D Mode 2. Populated by renderTripMapPins() when
 * tripMapSelectedDay === -1 (All days mode). hidden attr when not in use.
 * pointer-events: none — map gestures pass through the legend tile.
 */

html.tf-v2panel .tm-day-legend {
  position: absolute;
  bottom: 10px;
  left: 10px;
  z-index: 10;
  background: rgba(8,12,22,.85);
  border: 1px solid #1c2740;
  border-radius: 8px;
  padding: 7px 9px;
  font-size: 10.5px;
  pointer-events: none;
}

html.tf-v2panel .tm-day-legend[hidden] {
  display: none;
}

html.tf-v2panel .tm-legend-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 2px 0;
  color: var(--tf-text-muted);
}

html.tf-v2panel .tm-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  display: inline-block;
  flex-shrink: 0;
}

/* Location Editor — destructive zone (Remove pin), visually separated */
html.tf-v2panel .tm-loc-ed-destructive-zone {
  list-style: none;
  margin: var(--tf-space-xs) 0 0;
  padding: var(--tf-space-xs) 0 0;
  border-top: 1px solid var(--tf-border-line);
}

html.tf-v2panel .tm-simplified-popup-advanced-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

html.tf-v2panel .tm-simplified-popup-row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: var(--tf-space-sm);
  padding: 10px var(--tf-space-sm);
  border-radius: var(--tf-radius-sm);
  border: none;
  background: transparent;
  color: var(--tf-text-primary);
  font-family: inherit;
  font-size: 14px;
  text-align: left;
  cursor: pointer;
  min-height: var(--tf-tap-min);
  transition: background 100ms;
}

html.tf-v2panel .tm-simplified-popup-row:hover,
html.tf-v2panel .tm-simplified-popup-row:active {
  background: var(--tf-bg-elevated);
}

html.tf-v2panel .tm-simplified-popup-row:focus-visible {
  outline: none;
  box-shadow: var(--tf-focus-ring);
}

html.tf-v2panel .tm-simplified-popup-row-icon {
  flex: 0 0 auto;
  font-size: 16px;
}

html.tf-v2panel .tm-simplified-popup-row-label {
  flex: 1;
  min-width: 0;
}

/* Mochi · Soon row — disabled div, not button, with soft pink pill (Day-1 color) */
html.tf-v2panel .tm-simplified-popup-row-soon {
  opacity: 0.5;
  cursor: default;
  pointer-events: none;
}

html.tf-v2panel .tm-simplified-popup-soon-pill {
  flex: 0 0 auto;
  background: rgba(236, 94, 138, 0.15);
  color: #ec5e8a;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 999px;
}

/* "Not right — cancel" row uses Day-1 pink text */
html.tf-v2panel .tm-simplified-popup-row-cancel {
  color: #ec5e8a;
}

html.tf-v2panel .tm-simplified-popup-advanced-status {
  font-size: 12px;
  color: var(--tf-text-secondary);
  padding: 8px 10px;
  border-left: 3px solid transparent;  /* left-border color set inline by JS to day-color */
  background: var(--tf-bg-elevated);
  border-radius: var(--tf-radius-sm);
  min-height: 0;
}

html.tf-v2panel .tm-simplified-popup-advanced-status:empty {
  display: none;
}


/* ── 10. Issue 1 — Trip-map numbered pins + hop keyframe ─────────────────── */
/*
 * Renders as numbered circles via L.divIcon. Per-day colour comes through the
 * --day-color custom property set inline by renderAllTripPins.
 *
 * Two states:
 *   .tm-trip-pin-located — solid fill, full opacity (Google geo / saved coord)
 *   .tm-trip-pin-fogged  — dashed border, reduced opacity (fanned/borrowed)
 *
 * Hop animation lives on the INNER .pin-wrap, never the marker root —
 * Leaflet owns the marker's transform via L.DivIcon iconAnchor positioning;
 * animating that corrupts placement. Class .is-hopping is toggled by
 * flyToPinAndHop and self-clears after the keyframe completes.
 *
 * Default Leaflet divIcon background/border removed so our circle reads
 * cleanly (no double box).
 */

html.tf-v2panel .leaflet-marker-icon.tm-trip-pin-icon {
  background: transparent !important;   /* defeats Leaflet's default icon bg */
  border: none !important;               /* defeats Leaflet's default icon border */
}

html.tf-v2panel .tm-trip-pin {
  width: 22px;
  height: 22px;
  position: relative;
  /* --day-color set inline per pin via style attribute */
}

html.tf-v2panel .tm-trip-pin .pin-wrap {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--day-color, #7F77DD);
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  font-family: var(--tf-font-body, inherit);
  font-variant-numeric: tabular-nums;
  border: 2px solid #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  transform-origin: 50% 50%;
}

html.tf-v2panel .tm-trip-pin-fogged .pin-wrap {
  background: var(--day-color, #7F77DD);
  opacity: 0.42;
  border-style: dashed;
  border-width: 2px;
  border-color: #ffffff;
}

html.tf-v2panel .tm-trip-pin .tm-trip-pin-num {
  line-height: 1;
  pointer-events: none;
  user-select: none;
}

/* Hop keyframe — ~1s, runs once on .is-hopping. transform on the inner wrap
 * only; marker root stays put so the pin doesn't drift off its anchor. */
@keyframes pin-hop {
  0%   { transform: translateY(0) scale(1); }
  20%  { transform: translateY(-12px) scale(1.08); }
  40%  { transform: translateY(0) scale(1); }
  55%  { transform: translateY(-6px) scale(1.04); }
  70%  { transform: translateY(0) scale(1); }
  85%  { transform: translateY(-2px) scale(1.02); }
  100% { transform: translateY(0) scale(1); }
}

html.tf-v2panel .tm-trip-pin .pin-wrap.is-hopping {
  animation: pin-hop 1s ease-out 1;
}


/* ── 11. Reduced-motion override ────────────────────────────────────────── */
/*
 * prefers-reduced-motion: both pane and overlay appear instantly.
 * Dock button transitions (background/color only) are safe to keep.
 * Picker row + simplified-popup transitions suppressed.
 * Trip-pin hop suppressed (tap-to-locate still flies the map; just no bounce).
 */

@media (prefers-reduced-motion: reduce) {
  html.tf-v2panel #tm-pane.is-open {
    animation: none;
  }

  html.tf-v2panel #tm-overlay.is-open {
    animation: none;
  }

  html.tf-v2panel .tm-drop-pin-picker-row {
    transition: none;
  }

  html.tf-v2panel #tm-simplified-popup,
  html.tf-v2panel .tm-simplified-popup-save,
  html.tf-v2panel .tm-simplified-popup-move,
  html.tf-v2panel .tm-simplified-popup-row,
  html.tf-v2panel .tm-loc-ed-locator-btn {
    transition: none;
  }

  html.tf-v2panel .tm-trip-pin .pin-wrap.is-hopping {
    animation: none;
  }
}
