/* Inherit the same drawer, header, body and cards as the other sidebar panes. */
.story-intro-title { font-weight:800; font-size:1.25rem; color:var(--primary); }
.story-intro-copy { font-size:.85rem; color:var(--text-muted); }
#pane-story .story-eyebrow { font-size:.75rem; color:var(--text-muted); margin-bottom:6px; }
#pane-story #storyTitle { font-size:1.15rem; font-weight:800; color:var(--text-main); line-height:1.5; margin:0; }
#pane-story .story-english { font-size:.8rem; color:var(--text-muted); margin:6px 0 0; text-align:right; }
#pane-story .story-actions { display:flex; gap:6px; }
#pane-story .story-actions .gis-btn { font-size:.72rem; font-family:inherit; padding:9px 8px; }

:is(#pane-story, .story-toolbar) .story-stations { display:flex; gap:6px; overflow:auto; padding:4px 0 8px; scrollbar-width:thin; }
:is(#pane-story, .story-toolbar) .story-stations button { flex-shrink:0; font:700 .75rem Almarai,sans-serif; padding:8px 10px; border:1px solid #e2e8f0; border-radius:8px; background:#fff; color:var(--text-muted); cursor:pointer; }
:is(#pane-story, .story-toolbar) .story-stations button[aria-current=true] { background:#eff6ff; border-color:#93c5fd; color:var(--primary); }
#pane-story .story-status { font-size:.75rem; color:var(--text-muted); margin-bottom:8px; }
#pane-story .story-progress { height:4px; background:#e2e8f0; border-radius:6px; overflow:hidden; }
#pane-story .story-progress div { height:100%; background:var(--primary-light); transition:width .3s; }
#pane-story .story-nav { display:flex; justify-content:space-between; gap:8px; margin-top:12px; }
#pane-story .story-nav button { font-family:inherit; }
#pane-story :focus-visible, #storyTourRailBtn:focus-visible { outline:3px solid var(--primary-light); outline-offset:2px; }
.gis-pin-landmark.story-active-landmark>div:before { content:''; position:absolute; width:58px; height:58px; left:-10px; top:-10px; border:2px solid #fb7185; border-radius:50%; background:#e11d4822; box-shadow:0 0 0 7px #e11d481c; pointer-events:none; }
.gis-pin-landmark.story-active-landmark svg { filter:drop-shadow(0 0 8px #fff) drop-shadow(0 0 14px #e11d48)!important; }
@media(prefers-reduced-motion:reduce) { #pane-story .story-progress div { transition:none; } }
/* Leave room for the original landmark popup above the mobile tour drawer. */
@media (max-width: 768px) {
    body.story-touring .gis-drawer-panel { max-height: 45vh; max-height: 45dvh; }
}
@media (max-width: 768px) {
    body.story-touring .gis-drawer-panel { max-height: min(45dvh, max(120px, calc(100dvh - 320px))); }
}

#pane-story .story-media-figure { margin:0 0 16px; }
#pane-story .story-media-image { display:block; width:100%; aspect-ratio:16/9; object-fit:cover; border-radius:8px; background:#f1f5f9; }
#pane-story .story-media-figure figcaption { font-size:.7rem; color:var(--text-muted); line-height:1.7; margin-top:6px; }
#pane-story .story-information { font-size:.85rem; color:#334155; line-height:1.9; white-space:pre-line; overflow-wrap:anywhere; }
#pane-story .story-video-play { display:flex; align-items:center; justify-content:center; gap:12px; width:100%; aspect-ratio:16/9; border:1px solid #e2e8f0; border-radius:8px; background:#eff6ff; color:var(--primary); font:700 .85rem Almarai,sans-serif; cursor:pointer; }
#pane-story .story-video-play i { font-size:2rem; }
#pane-story .story-video-play:hover { background:#dbeafe; }
#pane-story .story-video-frame { display:block; width:100%; aspect-ratio:16/9; border:0; border-radius:8px; }
/* Fixed drawer footer; only the content above it scrolls. */
.story-toolbar[hidden] { display:none!important; }
.story-toolbar { flex:0 0 auto; padding:10px 14px max(12px,env(safe-area-inset-bottom)); background:#f8fafc; border-top:1px solid var(--border-subtle); box-shadow:0 -4px 12px rgba(15,23,42,.04); }
.story-toolbar-status .story-status { font:400 .7rem Almarai,sans-serif; color:var(--text-muted); margin-bottom:6px; }
.story-toolbar .story-progress { height:3px; border-radius:6px; background:#e2e8f0; overflow:hidden; margin-bottom:10px; }
.story-toolbar .story-progress div { height:100%; background:var(--primary-light); transition:width .3s; }
.story-controls { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:6px; }
.story-controls button,.story-controls a { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:5px; min-width:0; min-height:48px; padding:7px 3px; border-radius:8px; font:700 .68rem Almarai,sans-serif; line-height:1.4; text-align:center; text-decoration:none; overflow-wrap:anywhere; }
.story-controls i { font-size:.85rem; }
.story-controls button:disabled { opacity:.4; cursor:default; }
.story-controls :focus-visible { outline:3px solid var(--primary-light); outline-offset:2px; }
body.story-touring .gis-drawer-body { min-height:0; }
@media(max-width:768px) { body.story-touring .gis-drawer-panel { max-height:min(55dvh,max(260px,calc(100dvh - 300px))); } }
@media(prefers-reduced-motion:reduce) { .story-toolbar .story-progress div { transition:none; } }

.story-station-dock { min-width:0; margin-bottom:8px; padding-bottom:6px; border-bottom:1px solid var(--border-subtle); }
.story-station-heading { display:flex; align-items:center; justify-content:space-between; gap:8px; margin-bottom:4px; }
.story-station-heading h6 { margin:0; font:700 .8rem Almarai,sans-serif; color:var(--text-main); }
.story-station-heading small { font-size:.65rem; color:var(--text-muted); }
.story-toolbar .story-stations { margin:0; scroll-snap-type:x proximity; scrollbar-width:thin; scrollbar-color:#cbd5e1 transparent; }
.story-toolbar .story-stations button { min-height:40px; scroll-snap-align:center; }
.story-toolbar .story-stations :focus-visible { outline:2px solid var(--primary-light); outline-offset:-2px; }
@media(max-width:768px) {
    body.story-touring .gis-drawer-panel { max-height:min(70dvh,calc(100dvh - 100px)); }
    .story-toolbar { padding-top:8px; }
    .story-station-heading small { font-size:.62rem; }
}
@media(max-height:500px) {
    .story-toolbar { padding-top:6px; padding-bottom:6px; }
    .story-station-dock { margin-bottom:5px; padding-bottom:3px; }
    .story-controls button,.story-controls a { min-height:44px; gap:3px; }
}
/* A single responsive row for the station number and both landmark names. */
#pane-story .story-landmark-line { display:flex; align-items:center; flex-wrap:nowrap; gap:10px; min-width:0; }
#pane-story .story-landmark-line .story-eyebrow { flex:0 0 auto; display:flex; align-items:center; gap:3px; margin:0; font-size:.65rem; white-space:nowrap; }
#pane-story .story-landmark-line #storyTitle { flex:1 1 0; min-width:0; font-size:clamp(.82rem,1.5vw,1rem); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
#pane-story .story-landmark-line .story-english { flex:0 1 30%; min-width:0; margin:0; font-size:.7rem; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; text-align:left; }
@media(max-width:400px) { #pane-story .story-landmark-line { gap:6px; padding:12px!important; } #pane-story .story-landmark-line .story-eyebrow { font-size:.6rem; } }
/* Persistent autoplay status when the tour controls are out of sight. */
.story-autoplay-notice[hidden] { display:none!important; }
.story-autoplay-notice {
    position:fixed; z-index:1750; left:50%; bottom:calc(20px + var(--map-credit-height,64px));
    transform:translateX(-50%); box-sizing:border-box; width:340px; max-width:calc(100% - 24px);
    padding:12px 14px; border:1px solid #bfdbfe; border-top:3px solid var(--primary,#1e40af);
    border-radius:12px; background:rgba(255,255,255,.98); box-shadow:0 6px 24px rgba(15,23,42,.18);
    color:#334155; font-family:Almarai,sans-serif; text-align:right;
}
.story-autoplay-copy strong { display:flex; align-items:center; gap:8px; color:var(--primary,#1e40af); font-size:12px; line-height:1.8; }
.story-autoplay-copy strong i { color:#15803d; }
.story-autoplay-station { display:block; margin-top:4px; font-size:11px; line-height:1.8; overflow-wrap:anywhere; }
.story-autoplay-actions { display:flex; gap:8px; margin-top:8px; }
.story-autoplay-actions button { flex:1; min-width:0; min-height:44px; padding:6px 8px; border:1px solid #cbd5e1; border-radius:8px; background:#fff; color:#334155; font:700 11px/1.6 Almarai,sans-serif; cursor:pointer; touch-action:manipulation; }
.story-autoplay-actions .story-autoplay-open { background:#eff6ff; color:var(--primary,#1e40af); border-color:#bfdbfe; }
.story-autoplay-actions button:hover { background:#e2e8f0; }
.story-autoplay-actions button:focus-visible { outline:3px solid #2563eb; outline-offset:2px; }
@media(max-width:768px) {
    .story-autoplay-notice { bottom:calc(var(--mobile-rail-space,146px) + 8px); }
    body.gis-sidebar-hidden .story-autoplay-notice { bottom:calc(76px + var(--map-credit-height,64px)); }
}
@media(max-width:768px) and (max-height:500px) {
    .story-autoplay-notice { width:440px; padding:8px 12px; display:flex; align-items:center; gap:10px; }
    .story-autoplay-copy { flex:1; min-width:0; }
    .story-autoplay-actions { margin:0; flex:0 0 180px; }
}
/* Dedicated drag handle keeps the tour actions independent of dragging. */
.story-autoplay-copy strong { padding-left:40px; min-height:32px; }
.story-autoplay-move {
    position:absolute; left:6px; top:4px; display:flex; align-items:center; justify-content:center;
    width:44px; height:44px; padding:0; border:0; border-radius:8px;
    background:transparent; color:#64748b; font-size:16px; cursor:grab;
    touch-action:none; user-select:none; -webkit-user-select:none;
}
.story-autoplay-move:hover { background:#eff6ff; color:#1e40af; }
.story-autoplay-move:focus-visible { outline:3px solid #2563eb; outline-offset:-3px; }
.story-autoplay-notice.is-dragging, .story-autoplay-notice.is-dragging .story-autoplay-move { cursor:grabbing; user-select:none; }
.story-autoplay-notice.is-dragging { box-shadow:0 12px 32px rgba(15,23,42,.24); }
@media(max-width:768px) and (max-height:500px) {
    .story-autoplay-notice { padding-left:50px; }
    .story-autoplay-copy strong { padding-left:0; }
}
