/* The route page's live map: MapLibre's controls in the app's look (one 44 px glass capsule, 36 px on a phone, blue
   icons, the credits ⓘ on glass), the spinner and the fade-in. The box and its shapes are in the page (src/page.js),
   so they hold before this file arrives and without scripts. Colours, radii and shadows are the design tokens. */

.live-map { position: absolute; inset: 0; visibility: hidden; opacity: 0; transition: opacity 0.3s; }
.live[data-map="ready"] .live-map { visibility: visible; opacity: 1; }
.live[data-map="failed"] .live-map { display: none; }

/* --control: the capsule's width and each button's height, size-touch; on a phone size-chip (below). */
.live { --control: 44px; }
.live[data-map="loading"]::before, .live[data-map="loading"]::after { content: ""; position: absolute; border-radius: 50%; }
.live[data-map="loading"]::before { top: 8px; right: 8px; width: var(--control); height: var(--control); background: var(--glass); box-shadow: var(--shadow-control); }
.live[data-map="loading"]::after { top: calc(8px + (var(--control) - 20px) / 2); right: calc(8px + (var(--control) - 20px) / 2); width: 15px; height: 15px; border: 2.5px solid var(--fill-grey);
  border-top-color: var(--ink-muted); animation: route-map-spin 0.8s linear infinite; }
@keyframes route-map-spin { to { transform: rotate(360deg); } }

.live .maplibregl-ctrl-top-right .maplibregl-ctrl { margin: 8px 8px 0 0; }
.live .route-controls { border-radius: var(--radius-pill); background: var(--glass); box-shadow: var(--shadow-control);
  -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); overflow: hidden; }
.live .route-controls button { width: var(--control); height: var(--control); display: block; padding: 0; border: 0; background: var(--blue); cursor: pointer;
  -webkit-mask: var(--icon) center / calc(var(--control) / 2) no-repeat; mask: var(--icon) center / calc(var(--control) / 2) no-repeat; }
.live .route-controls button + button { box-shadow: inset 0 0.5px 0 var(--line); }
.live .route-controls button:focus-visible { outline: 2px solid var(--blue); outline-offset: -2px; }
.live .route-zoom-in { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='M12 5v14M5 12h14'/%3E%3C/svg%3E"); }
.live .route-zoom-out { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='M5 12h14'/%3E%3C/svg%3E"); }
.live .route-fit { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 9V4h5M20 9V4h-5M4 15v5h5M20 15v5h-5'/%3E%3C/svg%3E"); }

.live .maplibregl-ctrl-bottom-left .maplibregl-ctrl-attrib.maplibregl-compact { margin: 0 0 8px 8px; background: var(--glass);
  -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); box-shadow: var(--shadow-control); color: var(--ink);
  font: var(--caption-size) / var(--caption-line) var(--font-sf); }
.live .maplibregl-ctrl-bottom-left .maplibregl-ctrl-attrib.maplibregl-compact-show { padding: 4px 10px 4px 32px; border-radius: var(--radius-sm);
  max-width: calc(100% - 24px); }
.live .maplibregl-ctrl-attrib a { color: var(--ink); }
.live .maplibregl-ctrl-attrib-button:focus { box-shadow: none; }
.live .maplibregl-ctrl-attrib-button:focus-visible { box-shadow: 0 0 0 2px var(--blue); }

.live .maplibregl-cooperative-gesture-screen { background: var(--scrim); color: var(--on-fill); padding: 0 24px; text-align: center;
  font: var(--headline-weight) var(--headline-size) / var(--headline-line) var(--font-sf); }

/* The profile's cursor (src/client/route-profile.js; docs/features/website.md, route page), as the app's ElevationProfileChart: a thin grey line over the
   64 px chart, at rest at the start with its grip (a round white knob with ‹ ›, 28 px, the shadow of a control). The
   drag area reaches the grip's half width (--grip, OVERHANG in the script) past the chart at both ends. While it moves,
   the readout in the caption is ink semibold. */
.profile-scrub { --grip: 14px; --at: 0; position: absolute; top: 0; left: calc(-1 * var(--grip)); right: calc(-1 * var(--grip)); height: 64px;
  touch-action: pan-y; cursor: ew-resize; -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; }
.profile-scrub:focus { outline: none; }
.profile-scrub:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: var(--radius-sm); }
.profile-cursor, .profile-grip { position: absolute; left: calc(var(--grip) + (100% - 2 * var(--grip)) * var(--at)); pointer-events: none; }
.profile-cursor { top: 0; bottom: 0; width: 1px; margin-left: -0.5px; background: var(--ink-muted); }
.profile-grip { top: calc(32px - var(--grip)); width: calc(2 * var(--grip)); height: calc(2 * var(--grip)); margin-left: calc(-1 * var(--grip));
  border-radius: 50%; background: var(--surface); box-shadow: var(--shadow-control); }
.profile-grip::before { --chevrons: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 6l-6 6 6 6M15 6l6 6-6 6'/%3E%3C/svg%3E");
  content: ""; position: absolute; inset: 0; background: var(--ink-muted);
  -webkit-mask: var(--chevrons) center / 14px 14px no-repeat; mask: var(--chevrons) center / 14px 14px no-repeat; }
.profile.scrubbing .profile-grip { display: none; }
.profile.scrubbing .profile-readout { color: var(--ink); font-weight: 600; }

/* The cursor's dot on the map, as the app's CursorDotView: blue with a white ring, 26 px. */
.route-cursor-dot { width: 26px; height: 26px; box-sizing: border-box; border-radius: 50%; background: var(--blue);
  border: 3px solid var(--on-fill); box-shadow: var(--shadow-control); pointer-events: none; }

/* On a phone the capsule is size-chip (36 px) with 18 px icons, so the three buttons keep the map in view. */
@media (max-width: 599px) { .live { --control: 36px; } }
