.guide-icon-definitions {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}
.guide-icon {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}
.selected-stop,
.route-strip,
.mobile-player,
.story-back,
.player-extra {
  display: none;
}
.audio-toggle .guide-icon {
  width: 20px;
  height: 20px;
}
.mobile-tabs .guide-icon {
  width: 23px;
  height: 23px;
}
.map-stage {
  z-index: 0;
}
@media (min-width: 0) {
  .guide-shell {
    --strip-height: 136px;
    --player-height: 48px;
    height: calc(100dvh - 60px - env(safe-area-inset-bottom));
  }
  .guide-shell {
    --player-height: 48px;
  }
  .mobile-tabs {
    height: calc(60px + env(safe-area-inset-bottom));
    padding: 0 8px env(safe-area-inset-bottom);
    box-shadow: none;
  }
  .mobile-tabs > button,
  .mobile-tabs > a,
  .mobile-tabs summary {
    height: 60px;
    gap: 3px;
    font-size: 11px;
    border-radius: 0;
  }
  .mobile-tabs button[aria-pressed='true'] {
    background: transparent;
    color: #0864bd;
  }
  .mobile-tabs button[aria-pressed='true'] .guide-icon {
    fill: #e6f0ff;
  }
  .map-tools {
    top: 12px;
    inset-inline: 12px;
  }
  .guide-search {
    height: 48px;
    border-radius: 24px;
    padding-inline: 16px;
    max-width: none;
  }
  .guide-search input {
    height: 44px;
  }
  .map-status {
    top: 72px;
  }
  .guide-panel {
    display: none;
  }
  .route-strip {
    display: block;
    position: absolute;
    bottom: var(--player-height);
    inset-inline: 0;
    z-index: 850;
    height: var(--strip-height);
    border-top: 1px solid #dfe3e8;
    background: white;
    padding: 12px 12px 8px;
    border-radius: 8px 8px 0 0;
    box-shadow: 0 -2px 8px #172a2010;
  }
  .route-strip:before {
    content: '';
    position: absolute;
    top: 5px;
    left: 50%;
    transform: translateX(-50%);
    width: 28px;
    height: 3px;
    background: #a8acaf;
    border-radius: 3px;
  }
  .route-strip-heading {
    display: flex;
    gap: 6px;
    align-items: center;
    min-height: 24px;
    margin-bottom: 8px;
  }
  .route-strip-heading > .guide-icon {
    width: 18px;
    height: 18px;
    color: #0864bd;
  }
  .route-strip-heading > strong {
    font-size: 13px;
    line-height: 1.2;
    min-width: 0;
    flex: 1;
    min-height: 24px;
    text-align: start;
    font-weight: 700;
    background: none;
    border: 0;
    padding: 0;
  }
  .route-strip-heading > span {
    font-size: 10px;
    color: #626d65;
    white-space: nowrap;
  }
  .route-stops {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    height: 82px;
    min-width: 0;
  }
  .route-stops > button {
    width: 48px;
    flex-shrink: 0;
    border: 0;
    background: none;
    min-height: 72px;
    padding: 2px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    color: #0864bd;
  }
  .route-stops > button > .guide-icon {
    width: 34px;
    height: 34px;
    padding: 6px;
    border-radius: 50%;
    background: #0864bd;
    color: white;
  }
  .route-stops > button small {
    font-size: 9px;
    color: #343a40;
  }
  #stop-strip {
    display: flex;
    gap: 6px;
    list-style: none;
    margin: 0;
    padding: 0 0 3px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
    min-width: 0;
    flex: 1;
    height: 84px;
    scroll-snap-type: x proximity;
  }
  #stop-strip li {
    flex: 0 0 76px;
    scroll-snap-align: center;
  }
  #stop-strip button {
    border: 0;
    background: none;
    width: 76px;
    padding: 0;
    text-align: start;
    color: #18211c;
  }
  .strip-photo {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 56px;
    border: 2px solid transparent;
    border-radius: 5px;
    overflow: hidden;
    background: #eaf2e7;
    font-size: 23px;
    font-weight: 600;
  }
  .strip-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
  .strip-caption {
    display: flex;
    gap: 3px;
    align-items: center;
    font-size: 10px;
    margin-top: 4px;
  }
  .strip-caption > span:last-child {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
  }
  .strip-number {
    min-width: 15px;
    padding: 1px 3px;
    background: #eee;
    border-radius: 2px;
    text-align: center;
    font-weight: 600;
  }
  #stop-strip button[aria-current='true'] .strip-photo {
    border-color: #df0757;
  }
  #stop-strip button[aria-current='true'] .strip-number {
    background: #df0757;
    color: white;
  }
  .selected-stop {
    display: flex;
    position: absolute;
    inset-inline: 8px;
    bottom: calc(var(--strip-height) + var(--player-height) + 8px);
    z-index: 850;
    height: 64px;
    background: white;
    border: 1px solid #dfe3e8;
    border-radius: 6px;
    box-shadow: 0 2px 8px #172a2020;
    padding: 5px;
    align-items: center;
  }
  .selected-stop > button {
    border: 0;
    background: none;
    min-height: 48px;
  }
  .selected-stop #open-stop {
    display: flex;
    gap: 10px;
    align-items: center;
    text-align: start;
    flex: 1;
    min-width: 0;
    padding: 0;
  }
  .stop-photo {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    flex-shrink: 0;
    border-radius: 4px;
    overflow: hidden;
    background: #eaf2e7;
    color: #17621b;
    font-size: 24px;
  }
  .stop-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
  .stop-copy {
    min-width: 0;
    flex: 1;
  }
  .stop-copy strong {
    font-size: 13px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .stop-copy small {
    display: block;
    font-size: 11px;
    color: #626d65;
    margin-top: 3px;
  }
  #stop-play {
    width: 48px;
    border-inline-start: 1px solid #e5eae5;
    color: #343a40;
  }
  #stop-play .guide-icon {
    width: 18px;
    height: 18px;
    fill: currentColor;
    stroke: none;
  }
  .mobile-player {
    position: absolute;
    inset-inline: 0;
    bottom: 0;
    z-index: 900;
    height: 48px;
    background: white;
    border-top: 1px solid #e5eae5;
  }
  .guide-shell .mobile-player {
    display: block;
  }
  .mobile-player .audio-player {
    height: 48px;
    gap: 4px;
    padding: 0 8px;
    margin: 0;
    border: 0;
    border-radius: 0;
  }
  .mobile-player .audio-toggle {
    background: none;
    color: #343a40;
    width: 36px;
    height: 44px;
    font-size: 16px !important;
  }
  .mobile-player .audio-track {
    display: flex;
    align-items: center;
    gap: 8px;
  }
  .mobile-player .audio-track input {
    height: 36px;
    flex: 1;
    accent-color: #343a40;
  }
  .mobile-player .audio-time {
    font-size: 10px;
    min-width: 33px;
    white-space: nowrap;
  }
  .mobile-player #audio-current {
    display: none;
  }
  .mobile-player .mute-button {
    display: none;
  }
  .mobile-player .player-extra {
    display: flex;
    align-items: center;
    justify-content: center;
    border: 0;
    background: none;
    height: 44px;
    width: 36px;
    padding: 4px;
    color: #343a40;
  }
  .player-extra .guide-icon {
    width: 19px;
    height: 19px;
  }
  .guide-shell[data-story='true'] .guide-panel,
  .guide-shell[data-mode='places'] .guide-panel {
    display: flex;
    top: 0;
    bottom: calc(var(--strip-height) + var(--player-height));
    height: auto !important;
    max-height: none;
    min-height: 0;
    width: 100%;
    inset-inline: 0;
    border-radius: 0;
    box-shadow: none;
  }
  .guide-shell[data-mode='places'] .guide-panel {
    top: 72px;
    border-radius: 12px 12px 0 0;
  }
  .guide-shell[data-story='true'] .selected-stop,
  .guide-shell[data-mode='places'] .selected-stop {
    display: none;
  }
  .guide-shell[data-story='true'] .map-tools {
    display: none;
  }
  .guide-shell[data-story='true'] .panel-heading,
  .guide-shell[data-story='true'] .panel-handle,
  .guide-shell[data-story='true'] .panel-footer {
    display: none;
  }
  .guide-shell[data-mode='places'] .panel-footer {
    display: none;
  }
  .guide-shell[data-mode='places'] .panel-handle {
    display: none;
  }
  .guide-shell[data-mode='places'] .panel-heading {
    padding: 16px;
  }
  .guide-shell[data-mode='places'] .panel-heading h1 {
    font-size: 18px;
  }
  .guide-shell[data-story='true'] .panel-content {
    padding: 0 0 16px;
  }
  .guide-shell[data-story='true'] .landmark-heading {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }
  .guide-shell[data-story='true'] .landmark-photo {
    width: 100%;
    height: 240px;
    border-radius: 0;
    background: #eaf2e7;
  }
  .guide-shell[data-story='true'] .landmark-photo img {
    object-position: center;
  }
  .guide-shell[data-story='true'] .landmark-heading > div:last-child {
    padding: 16px 16px 0;
  }
  .guide-shell[data-story='true'] .landmark-heading h2 {
    font-size: 21px;
    margin: 0;
    line-height: 1.3;
  }
  .guide-shell[data-story='true'] .place-index {
    font-size: 11px;
  }
  .guide-shell[data-story='true'] #full-story,
  .guide-shell[data-story='true'] .guide-note {
    padding-inline: 16px;
  }
  .guide-shell[data-story='true'] #story-text {
    margin: 16px 0;
    font-size: 15px;
    line-height: 1.65;
  }
  .guide-shell[data-story='true'] .story-back {
    display: flex;
    position: absolute;
    z-index: 950;
    top: 12px;
    inset-inline-start: 12px;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 50%;
    background: #fffffff0;
    color: #343a40;
    box-shadow: var(--shadow);
  }
  .guide-shell[data-story='true'] .map-actions {
    display: none;
  }
  .guide-pin {
    width: 40px;
    height: 40px;
    font-size: 15px;
  }
  .guide-pin.selected {
    border-color: #df0757;
  }
  .guide-pin > span {
    top: 33px;
    background: #0864bd;
    font-size: 10px;
    border: 0;
    padding: 2px 5px;
  }
  .leaflet-container .guide-pin.selected > span {
    background: #df0757;
  }
}
@media (max-width: 359px) {
  .guide-shell {
    --strip-height: 128px;
  }
  .route-strip {
    padding-inline: 8px;
  }
  .route-strip-heading strong {
    font-size: 12px;
  }
  .route-strip-heading > span {
    font-size: 9px;
  }
  .guide-shell[data-story='true'] .landmark-photo {
    height: 200px;
  }
}
@media (max-width: 1023px) and (max-height: 550px) {
  .guide-shell {
    --strip-height: 108px;
  }
  .route-strip {
    padding-top: 10px;
  }
  .route-strip-heading {
    margin-bottom: 4px;
  }
  .strip-photo {
    height: 38px;
  }
  .route-stops,
  #stop-strip {
    height: 60px;
  }
  .route-stops > button {
    min-height: 56px;
  }
  .guide-shell[data-story='true'] .landmark-photo {
    height: 160px;
  }
  .selected-stop {
    height: 56px;
  }
  .stop-photo {
    width: 44px;
    height: 44px;
  }
  .guide-shell {
    --player-height: 44px;
  }
  .mobile-player,
  .mobile-player .audio-player {
    height: 44px;
  }
}


/* Persistent controller: preserve its existing height and controls. */
.guide-shell .mobile-player { display: block; }
.mobile-player .audio-player .audio-track { display: grid; grid-template-columns: minmax(0,1fr) auto; grid-template-rows: 14px 24px; gap: 0 8px; min-width: 0; }
.mobile-player .audio-caption { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; min-width: 0; text-align: start; }
.mobile-player #audio-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; line-height: 14px; font-weight: 600; }
.mobile-player .audio-caption #audio-status { margin: 0; min-height: 0; font-size: 10px; line-height: 14px; color: #6c757d; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mobile-player .audio-caption #audio-status:empty { display: none; }
.mobile-player .audio-player .audio-track input { min-width: 0; height: 24px; width: 100%; }
.mobile-player .audio-toggle:disabled, .mobile-player .player-extra:disabled { opacity: .4; }
