/* Scoped to JourneyGuide; the host supplies ui.css tokens and owns the button-bar layout. */
.journey-guide-key { min-width:44px; min-height:44px; padding:8px 12px; border:1px solid var(--color-seam); border-radius:var(--radius-key); background:var(--color-rubber); color:var(--color-lamp); font:600 14px/18px var(--font-sans); pointer-events:auto; }
.journey-guide-key[aria-pressed="true"] { color:var(--color-glazing); background:var(--color-led); }
.journey-guide-key:disabled { color:var(--color-mist); opacity:.55; cursor:default; }
.journey-guide { position:absolute; z-index:13; left:var(--edge-left); bottom:calc(var(--edge-bottom) + 140px); width:min(360px, calc(100% - var(--edge-left) - var(--edge-right))); max-height:min(440px, calc(100dvh - 260px)); display:flex; flex-direction:column; border:1px solid var(--color-seam); border-radius:var(--radius-panel); background:var(--panel); color:var(--color-lamp); font:500 14px/18px var(--font-sans); pointer-events:auto; overflow:hidden; }
.journey-guide-header { display:flex; align-items:center; justify-content:space-between; gap:8px; padding:4px 8px 4px 12px; border-bottom:1px solid var(--color-seam); flex:none; }
.journey-guide-header strong { font:700 20px/22px var(--font-display); }
.journey-guide-header .journey-location { display:none; min-width:44px; justify-content:center; text-decoration:none; font-size:22px; }
.journey-guide-body { min-height:0; padding:8px 12px 12px; overflow:auto; overscroll-behavior:contain; touch-action:pan-y; scrollbar-width:thin; }
.journey-guide p { margin:6px 0; }
.journey-guide-tools { display:flex; gap:6px; align-items:center; flex-wrap:wrap; }
.journey-guide-tools .journey-guide-key { padding:6px 10px; }
.journey-guide-muted { color:var(--color-mist); font-size:12px; line-height:16px; }
.journey-guide-map { width:100%; height:180px; margin-top:8px; background:var(--color-glazing); touch-action:none; cursor:grab; overflow:hidden; }
.journey-guide-map:active { cursor:grabbing; }
.journey-guide-map .jg-tiles image { pointer-events:none; }
.journey-guide-map[data-basemap="satellite"] .jg-route { stroke-width:3; }
.journey-guide-map .jg-photo-pin { cursor:pointer; }
.journey-guide-map .jg-photo { fill:var(--color-lamp); stroke:var(--color-glazing); stroke-width:2; }
.journey-guide-map .jg-photo-glyph { fill:var(--color-glazing); pointer-events:none; }
.journey-guide-map .jg-photo-pin.selected .jg-photo { fill:var(--color-led); }
.journey-guide-map .jg-context { fill:none; stroke:var(--color-seam); stroke-width:1; stroke-linejoin:round; }
.journey-guide-map .jg-water { fill:var(--color-mist); fill-opacity:.13; stroke:none; fill-rule:evenodd; }
.journey-guide-map .jg-route, .journey-guide-map .jg-next { fill:none; stroke:var(--color-lamp); stroke-width:2; stroke-linejoin:round; stroke-linecap:round; }
.journey-guide-map .jg-next { stroke:var(--color-led); stroke-width:3; }
.journey-guide-map .jg-stop { fill:var(--color-glazing); stroke:var(--color-lamp); stroke-width:1; }
.journey-guide-map text { font:600 11px var(--font-sans); fill:var(--color-lamp); stroke:var(--color-glazing); stroke-width:3px; paint-order:stroke; stroke-linejoin:round; }
.journey-guide-map text.jg-next-label { fill:var(--color-led); }
.journey-guide-map .jg-bus circle { fill:var(--color-lush); stroke:var(--color-glazing); stroke-width:2; }
.journey-guide-map .jg-bus path { fill:var(--color-lush); stroke:var(--color-glazing); stroke-width:1.5; }
.journey-guide-detail { font-size:13px; line-height:17px; }
.journey-guide a { display:inline-flex; align-items:center; min-height:44px; color:var(--color-led); text-decoration:underline; text-underline-offset:3px; overflow-wrap:anywhere; }
.journey-guide-attribution { font-size:10px; line-height:14px; }
.journey-onemap-logo { width:14px; height:14px; margin-right:3px; vertical-align:-3px; }
.journey-guide-photo img { display:block; width:100%; height:150px; object-fit:contain; background:var(--color-glazing); margin:6px 0; }
.journey-guide-photo strong { display:block; font:700 20px/22px var(--font-display); }
.journey-map-frame { position:relative; }
.journey-map-photo-pin { position:absolute; right:8px; bottom:8px; width:92px; }
.journey-map-photo { padding:8px 0; border-top:1px solid var(--color-seam); }
.journey-map-photo-preview { border:1px solid var(--color-seam); border-radius:var(--radius-key); padding:0; background:var(--color-glazing); overflow:hidden; cursor:zoom-in; align-self:start; }
.journey-map-photo-preview img { display:block; width:100%; height:68px; object-fit:cover; }
.journey-map-photo summary { min-height:44px; display:flex; align-items:center; cursor:pointer; }
.journey-map-photo strong { font:600 16px/18px var(--font-display); }
.journey-guide-sources { display:flex; flex-wrap:wrap; column-gap:14px; font-size:12px; }
.journey-guide-header .journey-expand { display:none; }
.journey-map-photo-title, .journey-photo-distance { display:none; }
.journey-photo-strip { display:flex; gap:6px; overflow-x:auto; overflow-y:hidden; padding:6px 0; flex:none; scrollbar-width:thin; overscroll-behavior:contain; touch-action:pan-x; }
.journey-strip-item { flex:none; width:76px; min-width:0; height:52px; min-height:0; padding:0; border:2px solid transparent; border-radius:8px; overflow:hidden; background:var(--color-glazing); cursor:pointer; }
.journey-strip-item img { display:block; width:100%; height:100%; object-fit:cover; }
.journey-strip-item[aria-current="true"] { border-color:var(--color-led); }
/* Phones keep their measured compact panels; the strip is a desktop addition. */
@media (max-width:760px), (max-height:500px) { .journey-photo-strip { display:none; } }
/* Desktop pointer layout: a tall panel below the next-stop card (which already names the stop and road), controls and
   the photo card over a large map, and the photo strip beneath. Expand widens it across the road view. */
@media (min-width:761px) and (min-height:501px) {
  .hud:not(.touchmode) .journey-guide { top:calc(var(--edge-top) + 168px); bottom:calc(var(--edge-bottom) + 92px); width:clamp(340px, calc(50vw - 216px), 540px); max-height:none; }
  .hud:not(.touchmode) .journey-guide.expanded { top:var(--edge-top); right:var(--edge-right); width:auto; z-index:16; background:var(--color-glazing); }
  .hud:not(.touchmode) .journey-guide-header .journey-expand { display:inline-flex; align-items:center; margin-left:auto; }
  .hud:not(.touchmode)[data-guide-open="map"] .journey-guide-header .journey-location { display:flex; }
  .hud:not(.touchmode)[data-guide-open="map"] .journey-guide-body { position:relative; display:flex; flex-direction:column; flex:1; overflow:hidden; }
  .hud:not(.touchmode)[data-guide-open="map"] .journey-guide-tools { position:absolute; z-index:2; top:16px; left:20px; right:20px; gap:4px; pointer-events:none; }
  .hud:not(.touchmode)[data-guide-open="map"] .journey-guide-tools > * { pointer-events:auto; }
  .hud:not(.touchmode)[data-guide-open="map"] .journey-guide-tools .journey-guide-key { min-width:36px; min-height:36px; padding:4px 10px; background:rgba(12, 14, 13, .86); }
  .hud:not(.touchmode)[data-guide-open="map"] .journey-guide-tools .journey-guide-muted { padding:3px 6px; border-radius:6px; background:rgba(12, 14, 13, .72); color:var(--color-lamp); }
  .hud:not(.touchmode)[data-guide-open="map"] .journey-map-frame { flex:1; min-height:150px; }
  .hud:not(.touchmode)[data-guide-open="map"] .journey-guide-map { position:absolute; inset:0; height:100%; margin:0; border-radius:10px; }
  .hud:not(.touchmode)[data-guide-open="map"] .journey-map-photo-pin { width:min(40%, 220px); right:10px; bottom:10px; }
  .hud:not(.touchmode)[data-guide-open="map"] .journey-map-photo-preview { display:block; width:100%; border-width:2px; text-align:left; }
  .hud:not(.touchmode)[data-guide-open="map"] .journey-map-photo-preview img { height:auto; aspect-ratio:3 / 2; }
  .hud:not(.touchmode)[data-guide-open="map"] .journey-map-photo-title { display:block; padding:4px 8px 0; font:600 13px/16px var(--font-sans); color:var(--color-lamp); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
  .hud:not(.touchmode)[data-guide-open="map"] .journey-photo-distance { display:block; margin:0; padding:0 8px 6px; border:2px solid var(--color-seam); border-top:0; border-radius:0 0 var(--radius-key) var(--radius-key); background:var(--color-glazing); }
  .hud:not(.touchmode)[data-guide-open="map"] .journey-map-photo-preview { border-bottom:0; border-radius:var(--radius-key) var(--radius-key) 0 0; }
  .hud:not(.touchmode) .journey-legend { display:none; }
  .hud:not(.touchmode)[data-guide-open="map"] .journey-guide-attribution { flex:none; margin:2px 0 0; font-size:10px; line-height:13px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
  .hud:not(.touchmode)[data-guide-open="map"] .journey-guide-attribution a { display:inline; min-height:0; }
  .hud:not(.touchmode) .journey-strip-item { width:72px; height:48px; }
  .hud:not(.touchmode)[data-guide-open="map"] .journey-guide-body > p { margin:2px 0; flex:none; }
  .hud:not(.touchmode)[data-guide-open="map"] .journey-guide-detail:not(.selected),
  .hud:not(.touchmode)[data-guide-open="map"] .journey-guide-detail + .journey-guide-muted,
  .hud:not(.touchmode)[data-guide-open="map"] .journey-guide-body > a { display:none; }
  .hud:not(.touchmode)[data-guide-open="map"] .journey-map-photo { flex:none; padding:0; border-top:0; }
  .hud:not(.touchmode)[data-guide-open="map"] .journey-map-photo strong { display:none; }
  .hud:not(.touchmode)[data-guide-open="map"] .journey-map-photo p { display:inline; margin:0 8px 0 0; }
  .hud:not(.touchmode)[data-guide-open="map"] .journey-map-photo details { display:inline-block; }
  .hud:not(.touchmode)[data-guide-open="map"] .journey-map-photo summary { min-height:30px; }
  .hud:not(.touchmode) .journey-guide.expanded .journey-map-photo-pin { width:min(30%, 360px); }
  .hud:not(.touchmode) .journey-guide.expanded .journey-strip-item { width:96px; height:64px; }
  .hud:not(.touchmode)[data-guide-open="photos"] .journey-guide-photo img { height:clamp(150px, calc(100dvh - 545px), 440px); }
  .hud:not(.touchmode) .journey-guide.expanded .journey-guide-photo img { height:calc(100dvh - 380px); }
}
@media (max-width:760px) and (orientation:portrait) {
  .hud[data-guide-open] .upcoming-stops, .hud[data-guide-open] .road { display:none; }
  .journey-guide { left:var(--edge-left); top:calc(var(--edge-top) + 196px); width:calc(100% - var(--edge-left) - var(--edge-right)); bottom:auto; max-height:min(300px, calc(100dvh - var(--edge-top) - var(--edge-bottom) - 496px)); border-radius:12px; }
  .journey-guide-map { height:140px; }
  .journey-guide-photo img { height:120px; }
}
@media (max-height:500px) and (orientation:landscape) {
  .hud[data-guide-open] .upcoming-stops, .hud[data-guide-open] .road { display:none; }
  .journey-guide { left:calc(var(--edge-left) + 250px); right:auto; top:calc(var(--edge-top) + 58px); bottom:auto; width:min(300px, calc(100% - var(--edge-left) - var(--edge-right) - 390px)); max-height:calc(100dvh - var(--edge-top) - var(--edge-bottom) - 180px); }
  .journey-guide-map { height:120px; }
  .journey-guide-photo img { height:110px; }
}
/* Short screens keep the entire diagram or photo visible; sources remain in the scroll area. */
@media (max-width:760px) and (max-height:740px), (max-height:500px) and (orientation:landscape) {
  .journey-guide-header strong { font-size:16px; line-height:18px; flex:1; min-width:0; }
  .journey-guide-body { position:relative; }
  [data-guide-open="map"] .journey-guide-body { overflow:auto; flex:1; }
  [data-guide-open="map"] .journey-guide-header .journey-location { display:flex; }
  [data-guide-open="map"] .journey-guide-tools { position:absolute; right:8px; bottom:8px; gap:4px; }
  [data-guide-open="map"] .journey-guide-tools > :nth-child(n+3) { display:none; }
  [data-guide-open="map"] .journey-guide-map { width:calc(100% - 98px); height:65px; margin:0; }
  [data-guide-open="map"] .journey-map-photo-pin { right:102px; bottom:4px; width:52px; }
  [data-guide-open="map"] .journey-map-photo-preview img { height:44px; }
  [data-guide-open="map"] .journey-guide-detail, [data-guide-open="map"] .journey-guide-muted, [data-guide-open="map"] .journey-guide-body > a { display:none; }
  [data-guide-open="map"] .journey-map-photo .journey-guide-muted { display:block; }
  [data-guide-open="map"] .journey-map-photo { display:none; }
  .journey-photo-strip { display:none; }
  [data-guide-open="photos"] .journey-guide-header strong { max-width:calc(100% - 218px); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
  .journey-photo-tools { position:fixed; top:calc(var(--edge-top) + 200px); left:calc(100% - var(--edge-right) - 224px); gap:4px; }
  .journey-photo-tools button { width:44px; padding:0; font-size:0; }
  .journey-photo-tools button::before { font:600 22px var(--font-sans); }
  .journey-photo-tools button:nth-child(1)::before { content:'‹'; }
  .journey-photo-tools button:nth-child(2)::before { content:'›'; }
  .journey-photo-tools button:nth-child(3)::before { content:'↻'; }
  .journey-photo-status { display:none; }
  .journey-guide-photo { display:flex; flex-direction:column; }
  .journey-guide-photo img { order:-1; height:78px; margin:0 0 6px; }
}
@media (max-height:500px) and (orientation:landscape) {
  [data-guide-open="map"] .journey-guide-map { height:100px; }
  .journey-photo-tools { top:calc(var(--edge-top) + 62px); left:calc(var(--edge-left) + 250px + min(300px, 100vw - var(--edge-left) - var(--edge-right) - 390px) - 212px); }
}
/* Follow the compact header's real height, including wrapped names and the stopping bell. */
@media (max-width:760px), (max-width:1050px) and (max-height:500px) {
  .hud:not(.touchmode)[data-guide-open] .upcoming-stops, .hud:not(.touchmode)[data-guide-open] .road { display:none; }
  .hud:not(.touchmode) .journey-guide { position:relative; grid-column:1 / -1; grid-row:3; align-self:start; left:auto; right:auto; top:auto; bottom:auto; width:100%; max-height:min(300px, calc(100dvh - var(--edge-top) - var(--edge-bottom) - 360px)); border-radius:12px; }
  .hud:not(.touchmode) .journey-photo-tools { position:static; }
  .hud:not(.touchmode)[data-guide-open="photos"] .journey-guide-header strong { max-width:none; }
}
@media (min-width:600px) and (max-width:1050px) and (max-height:500px) and (orientation:landscape) {
  .hud:not(.touchmode) .journey-guide { grid-column:2; grid-row:2; max-height:calc(100dvh - var(--edge-top) - var(--edge-bottom) - 180px); }
}
@media (max-width:760px) and (orientation:portrait) {
  .touchmode .journey-guide { position:relative; grid-column:1 / -1; grid-row:3; align-self:start; left:auto; right:auto; top:auto; bottom:auto; width:100%; }
  .touchmode .journey-photo-tools { position:static; }
  .touchmode[data-guide-open="photos"] .journey-guide-header strong { max-width:none; }
}
/* Short photo panels use the header for navigation so the complete image fits above the driving controls. */
@media (max-width:760px) and (max-height:740px) and (orientation:portrait), (max-width:1050px) and (max-height:500px) and (orientation:landscape) {
  .hud[data-guide-open="photos"] .journey-guide-body { position:static; }
  .hud[data-guide-open="photos"] .journey-photo-tools { position:absolute; top:4px; right:76px; left:auto; }
  .hud[data-guide-open="photos"] .journey-guide-header strong { max-width:calc(100% - 218px); }
}
