/* Field map (Visit page). Leaflet base styles load from cdnjs; this is our layer on top. */

.field-map { margin: 1.75rem 0 0; }
.field-map .map-head { margin: 0 0 .75rem; }
.field-map .map-head h3 { margin: 0 0 .25rem; font-size: 1.375rem; font-weight: 800; color: var(--marsh-950); }
.field-map .map-head p { margin: 0; color: var(--ink-mid); }

/* Toolbar */
.fm-bar { display: flex; flex-wrap: wrap; gap: .5rem .75rem; align-items: center; margin: 0 0 .6rem; }
.fm-seg { display: inline-flex; border: 1px solid var(--rule); border-radius: 999px; background: #fff; padding: 2px; }
.fm-seg button, .fm-locate {
  font: 600 .9375rem/1 var(--font-body); color: var(--marsh-900); background: transparent;
  border: 0; border-radius: 999px; padding: .55rem .85rem; cursor: pointer; min-height: 40px;
}
.fm-seg button[aria-pressed="true"] { background: var(--marsh-900); color: var(--sand-50); }
.fm-check { display: inline-flex; align-items: center; gap: .4rem; font-weight: 600; font-size: .9375rem; color: var(--marsh-900); min-height: 40px; cursor: pointer; }
.fm-check input { width: 1.1rem; height: 1.1rem; accent-color: var(--marsh-700); }
.fm-locate { display: inline-flex; align-items: center; gap: .35rem; border: 1px solid var(--rule); background: #fff; }
.fm-locate .material-symbols-outlined { font-size: 1.2rem; }
.fm-locate[aria-pressed="true"] { background: #2b6cb0; border-color: #2b6cb0; color: #fff; }
.fm-seg button:focus-visible, .fm-locate:focus-visible, .fm-route-btn:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* Map box */
.fm-map { position: relative; height: min(72svh, 560px); min-height: 340px; border-radius: var(--radius); border: 1px solid var(--rule); background: var(--marsh-100); overflow: hidden; }
@media (min-width: 900px) { .fm-map { height: 620px; } }
.fm-map .leaflet-control-attribution { font-size: .6875rem; }
.fm-map[data-style="sat"] { background: #245f68; }
.fm-map[data-style="field"] { background: #f1ead8; }
.fm-locked::after {
  content: "Tap the map to move around"; position: absolute; left: 50%; bottom: 2.25rem; transform: translateX(-50%);
  z-index: 800; pointer-events: none; padding: .4rem .8rem; border-radius: 999px;
  background: rgba(20,34,25,.85); color: var(--sand-50); font-weight: 600; font-size: .875rem; white-space: nowrap;
}

/* Pins */
.fm-pin { display: grid; place-items: center; border-radius: 50%; background: var(--marsh-900); border: 3px solid var(--sand-50); box-shadow: 0 1px 4px rgba(0,0,0,.45); color: var(--sand-50); }
.fm-pin .material-symbols-outlined { font-size: 18px; }
.fm-pin:hover, .fm-pin:focus-visible { background: var(--accent); }
.fm-inlet { display: inline-flex !important; align-items: center; gap: .25rem; width: auto !important; height: auto !important; white-space: nowrap;
  padding: .2rem .5rem .2rem .3rem; border-radius: 999px; background: var(--call-caution-bg); border: 1px solid #b8901a; color: #3d2f00;
  font: 700 .75rem/1.2 var(--font-label); letter-spacing: .04em; text-transform: uppercase; box-shadow: 0 1px 3px rgba(0,0,0,.3);
  transform: translate(-50%, -50%); }
.fm-inlet .material-symbols-outlined { font-size: 15px; }
.fm-route { cursor: pointer; }

/* Popups */
.fm-map .leaflet-popup-content-wrapper { border-radius: var(--radius); }
.fm-map .leaflet-popup-content { margin: .85rem 1rem; font: 400 .9375rem/1.45 var(--font-body); color: var(--ink-mid); }
.fm-pop h4 { margin: 0 0 .15rem; font-size: 1.0625rem; font-weight: 800; color: var(--marsh-950); }
.fm-pop p { margin: 0 0 .5rem; }
.fm-pop p:last-child { margin-bottom: 0; }
.fm-pop .fm-meta { font-size: .8125rem; color: var(--ink-soft); }
.fm-pop dl { display: grid; grid-template-columns: auto 1fr; gap: .2rem .6rem; margin: .5rem 0; font-size: .875rem; }
.fm-pop dt { font-family: var(--font-label); font-weight: 700; font-size: .75rem; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-soft); padding-top: .1rem; }
.fm-pop dd { margin: 0; color: var(--ink); }
.fm-pop .fm-call { padding-top: .5rem; border-top: 1px solid var(--rule); }
.fm-call-wait { color: var(--ink-soft); font-style: italic; }

.fm-status { min-height: 1.4em; margin: .4rem 0 0; font-size: .875rem; color: var(--ink-soft); }

/* Legend + route list */
.fm-legend { display: flex; flex-wrap: wrap; gap: .4rem 1rem; margin: .25rem 0 1rem; font-size: .875rem; color: var(--ink-mid); }
.fm-legend span { display: inline-flex; align-items: center; gap: .4rem; }
.fm-legend i { display: inline-block; width: 1.4rem; height: 5px; border-radius: 3px; }
.fm-legend i.dot { width: .8rem; height: .8rem; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--rule); }
.fm-list-title { margin: 0 0 .5rem; font-size: 1.0625rem; font-weight: 800; color: var(--marsh-950); }
.fm-routes { list-style: none; margin: 0; padding: 0; border: 1px solid var(--rule); border-radius: var(--radius); background: #fff; overflow: hidden; }
.fm-routes li + li { border-top: 1px solid var(--rule); }
.fm-route-btn { display: grid; grid-template-columns: auto 1fr; gap: .2rem .75rem; align-items: center; width: 100%; padding: .75rem 1rem; text-align: left;
  background: none; border: 0; font: inherit; color: inherit; cursor: pointer; }
.fm-route-btn:hover { background: var(--sand-50); }
.fm-swatch { width: .9rem; height: .9rem; border-radius: 50%; grid-row: span 2; align-self: start; margin-top: .25rem; }
.fm-route-name { display: flex; flex-direction: column; }
.fm-route-name strong { color: var(--marsh-950); }
.fm-route-name span { font-size: .875rem; color: var(--ink-soft); }
.fm-route-call { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; grid-column: 2; font-size: .875rem; color: var(--ink-mid); }
.fm-wait { color: var(--ink-soft); font-style: italic; }
/* Grouped by launch: head row with the day's call, then each route under it */
.fm-group-head { display: grid; grid-template-columns: auto 1fr; gap: .2rem .75rem; align-items: center; padding: .75rem 1rem .35rem; }
.fm-group-name { color: var(--marsh-950); }
.fm-group-routes { padding: 0 0 .4rem; }
.fm-group .fm-route-btn { grid-template-columns: auto 1fr auto; gap: .5rem; padding: .45rem 1rem .45rem 2.65rem; font-size: .9375rem; color: var(--ink-mid); }
.fm-group .fm-route-btn .material-symbols-outlined { font-size: 1.1rem; color: var(--ink-soft); }
.fm-route-to strong { color: var(--marsh-950); font-weight: 600; }
.fm-route-show { font-size: .8125rem; color: var(--accent); font-weight: 600; white-space: nowrap; }
@media (min-width: 768px) {
  .fm-group-head { grid-template-columns: auto minmax(14rem, 1fr) 1.4fr; }
  .fm-group-head .fm-swatch { grid-row: auto; align-self: center; margin-top: 0; }
  .fm-group-head .fm-route-call { grid-column: auto; }
}
.fm-fine { margin: .75rem 0 0; font-size: .875rem; color: var(--ink-soft); }

/* Crossings we don't map */
.fm-notes { display: grid; gap: .75rem; margin: 1.5rem 0 0; }
@media (min-width: 768px) { .fm-notes { grid-template-columns: 1fr 1fr; } }
.fm-note { border-radius: var(--radius); padding: 1rem 1.15rem; background: var(--call-caution-bg); border: 1px solid #e3cf7d; }
.fm-note h4 { margin: 0 0 .3rem; display: flex; align-items: center; gap: .4rem; font-size: 1.0625rem; font-weight: 800; color: #3d2f00; }
.fm-note h4 .material-symbols-outlined { color: #9a6b00; }
.fm-note p { margin: 0; color: #4a3d12; }

/* Landing areas */
.fm-zone { cursor: pointer; }
.fm-zone-tip { background: rgba(20,34,25,.85); color: var(--sand-50); border: 0; border-radius: 999px; padding: .2rem .6rem;
  font: 700 .75rem/1.2 var(--font-label); letter-spacing: .04em; box-shadow: none; }
.fm-zone-tip::before { display: none; }

/* Trace mode (?trace) */
.fm-trace { margin: .5rem 0 0; padding: .6rem .8rem; border-radius: var(--radius); background: #fde7f3; border: 1px solid #f2a7cf; color: #5c0b35; font-size: .875rem; display: flex; flex-wrap: wrap; gap: .4rem .75rem; align-items: center; }
.fm-trace-btns { display: inline-flex; flex-wrap: wrap; gap: .4rem; }
.fm-trace button, .fm-trace a { font: 600 .8125rem/1 var(--font-body); padding: .45rem .7rem; border-radius: 999px; border: 1px solid #e0218a; background: #fff; color: #8a1252; text-decoration: none; cursor: pointer; }
.fm-pop .fm-note-line { font-size: .875rem; color: var(--ink); background: var(--sand-50); border-left: 3px solid var(--marsh-500); padding: .4rem .6rem; }

/* Mark a campsite: the field map switched to taking taps */
.fm-mark[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.fm-marking { cursor: crosshair; box-shadow: 0 0 0 3px var(--accent); }
.fm-marking .leaflet-interactive { pointer-events: none; }
.fm-markpanel { margin: .6rem 0 0; padding: .9rem 1rem .4rem; border: 2px solid var(--accent); border-radius: var(--radius); background: #fff; }
.fm-markpanel .camp-bar { margin-top: 0; }

/* Wind and current layer */
.fm-windcanvas { position: absolute; inset: 0; z-index: 450; pointer-events: none; }
.fm-windbtn[aria-pressed="true"] { background: #0e3a5a; border-color: #0e3a5a; color: #fff; }
.fm-windbar { margin: .55rem 0 .2rem; padding: .7rem .9rem .3rem; border: 1px solid var(--rule); border-radius: var(--radius); background: #fff; }
.fm-windrow { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem 1rem; }
.fm-windrow input { flex: 1 1 12rem; accent-color: #0e3a5a; }
.fm-windlabel { font: 600 .875rem var(--font-body); color: var(--ink); }
.fm-windlegend { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .5rem; margin: .5rem 0 .2rem; font-size: .8125rem; color: var(--ink-mid); }
.fm-windlegend span { font: 700 .75rem var(--font-label); letter-spacing: .08em; text-transform: uppercase; margin-right: .3rem; }
.fm-windlegend i { width: .9rem; height: .35rem; border-radius: 2px; display: inline-block; margin-left: .25rem; }
.fm-cur-icon { pointer-events: none; }
.fm-cur { position: absolute; left: 0; top: 0; width: 0; height: 0; transform: rotate(var(--rot)); }
.fm-cur-arrow { position: absolute; left: -2px; bottom: 0; width: 4px; height: var(--len); background: #00e0ff; border-radius: 2px; box-shadow: 0 0 0 2px rgba(0,30,50,.55); }
.fm-cur-arrow::after { content: ""; position: absolute; left: -6px; top: -9px; border: 8px solid transparent; border-bottom: 11px solid #00e0ff; border-top: 0; }
.fm-cur-tag { position: absolute; left: 14px; top: -10px; white-space: nowrap; font: 600 .75rem var(--font-body); color: #fff; background: rgba(0,30,50,.82); padding: .2rem .45rem; border-radius: 4px; line-height: 1.25; }
.fm-cur-tag strong { display: block; color: #8ff0ff; font-size: .8125rem; }
/* Night mode under the wind: the map dims to deep navy so the streaks glow (Becker-style) */
.fm-night .leaflet-tile-pane, .fm-night .leaflet-pane canvas.maplibregl-canvas, .fm-night .leaflet-gl-layer { filter: brightness(.72) saturate(.45) contrast(1.15); }
.fm-night::after { content: ""; position: absolute; inset: 0; z-index: 440; pointer-events: none; background: radial-gradient(ellipse at 50% 40%, rgba(6,14,30,.05), rgba(4,8,20,.35)); }
.fm-cur-tag-left { left: auto; right: 14px; text-align: right; }
