/* TripCast "Modify Route" (route-edit.js): the crosshair drawer (.dc-cc-drawer,
   cast-create.css), taller for the legs, plus numbered waypoint markers. */

/* As tall as its content up to the cap; past that only the legs (or route choices) scroll,
   cut to whole rows by fitScroll() in route-edit.js. */
.dc-cc-drawer.dc-re-drawer { width: 400px; height: auto; max-height: min(560px, calc(100vh - 160px)); padding-bottom: 12px; }
.dc-re-body { flex: 0 1 auto; min-height: 0; overflow: hidden; margin: 6px -4px 0; padding: 0 4px; display: flex; flex-direction: column; gap: 8px; }
.dc-re-body > * { flex: none; }
.dc-re-body > .dc-re-scroll { flex: 0 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scroll-snap-type: y mandatory; }
.dc-re-scroll > * { scroll-snap-align: start; }
.dc-re-prompt { font-size: 13px; line-height: 1.4; color: rgba(255, 255, 255, .65); }
.dc-re-prompt .dc-cc-spin { margin-right: 8px; vertical-align: -2px; }
.dc-re-total { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; font-size: 13px; color: rgba(255, 255, 255, .65); }
.dc-re-total b { font-size: 17px; font-weight: 800; color: #fff; font-variant-numeric: tabular-nums; }
.dc-re-legs { display: flex; flex-direction: column; border-top: 1px solid rgba(255, 255, 255, .1); }
.dc-re-leg {
    display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 5px 0;
    border-bottom: 1px solid rgba(255, 255, 255, .07); font-size: 13px; line-height: 18px;    /* whole-pixel rows (fitScroll) */
}
.dc-re-leg-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: rgba(255, 255, 255, .8); }
.dc-re-leg-val { flex: none; font-variant-numeric: tabular-nums; color: #fff; font-weight: 600; }
.dc-re-selrow {
    display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px;
    border-radius: 10px; background: rgba(255, 133, 4, .1); border: 1px solid rgba(255, 133, 4, .4);
}
.dc-re-selrow .dc-cc-mono { overflow-wrap: anywhere; }
.dc-re-sel-title { font-size: 14px; font-weight: 700; }
/* The app's red "Delete Waypoint #n" button. */
.dc-re-del {
    flex: none; min-height: 32px; padding: 0 12px; border: 0; border-radius: 8px; cursor: pointer;
    background: rgba(255, 59, 48, .85); color: #fff; font: 700 13px/1.2 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
.dc-re-del:hover { background: #ff3b30; }
.dc-re-add { display: flex; gap: 8px; }
.dc-re-add .dc-cc-input { flex: 1 1 auto; min-width: 0; min-height: 36px; padding: 6px 10px; font-size: 14px; text-overflow: ellipsis; }
.dc-re-add .dc-cc-btn { min-height: 36px; font-size: 14px; }
.dc-re-tools { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 16px; }
.dc-re-notice { font-size: 13px; line-height: 1.4; color: #81d4fa; }
.dc-re-err { font-size: 13px; line-height: 1.4; color: #ef9a9a; }
.dc-re-choices { display: flex; flex-direction: column; gap: 8px; }
.dc-re-foot { flex: none; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.dc-re-foot .dc-cc-btn-primary:disabled { opacity: .45; cursor: default; }
/* While a waypoint is dragged, the drawer stays out of the way. */
.dc-cc-drawer.dc-re-drawer.dc-re-dragging { opacity: .55; pointer-events: none; }

/* Waypoint markers: numbered, the TripCast colour, a dark ring for contrast on any layer. */
.leaflet-marker-icon.dc-re-wp {
    display: flex; align-items: center; justify-content: center; box-sizing: border-box;
    border-radius: 50%; background: #b388ff; border: 2px solid #0a0a19; color: #0a0a19;
    font: 800 12px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .6); cursor: grab;
}
.leaflet-marker-icon.dc-re-wp.dc-re-sel { background: #FF8504; color: #fff; border-color: #fff; box-shadow: 0 0 0 3px rgba(255, 133, 4, .45); }
.leaflet-marker-icon.dc-re-wp.leaflet-drag-target { cursor: grabbing; }
/* "Remove Waypoint" (DCCards.confirm) above the drawer: the page's inline .dc-confirm-overlay
   z-index (4000) otherwise wins over cast-cards.css. */
body.dc-re-on .dc-confirm-overlay.dc-card-confirm { z-index: 10100; }
/* An end's label when the spot's own name already shows there. */
.leaflet-tooltip.dc-re-end-label.dc-re-dup { display: none; }
/* Clicks add waypoints: a crosshair cursor on the map while editing. */
body.dc-re-on .leaflet-container { cursor: crosshair; }

@media (max-width: 600px) {
    .dc-cc-drawer.dc-re-drawer { max-height: 56vh; bottom: 16px; }
    .dc-re-add .dc-cc-input { font-size: 16px; }     /* under 16px, iOS Safari zooms in on focus */
}
