/* FreeDeen — Full-Viewport 3D Terrain Seerah Map (/seerah/map/ & /en/seerah/map/)
   Desktop: slim 52px bar + 100% viewport 3D map + collapsible left Chronology Drawer + floating right Story Card + bottom Timeline Dock.
   Mobile: scrollable single-row era pills + 52vh 3D map + sticky thumb stepper + clean story card below + native <dialog> chapter sheet. */

:root {
  --era-makkah: #F4B038;
  --era-madinah: #F4B038;
  --glass-bg: rgba(255, 251, 245, 0.78);
  --glass-bg-strong: rgba(255, 251, 245, 0.86);
  --glass-inset: rgba(255, 250, 242, 0.56);
  --glass-border: rgba(255, 255, 255, 0.72);
  --glass-ring: rgba(110, 78, 38, 0.14);
  --glass-shadow: 0 22px 54px rgba(24, 15, 6, 0.24), 0 4px 14px rgba(24, 15, 6, 0.08);
  --glass-blur: blur(22px) saturate(1.55);
}
:root[data-theme="day"] {
  --era-makkah: #E5981D;
  --era-madinah: #E5981D;
}
:root[data-theme="night"] {
  --glass-bg: rgba(22, 17, 13, 0.72);
  --glass-bg-strong: rgba(24, 19, 14, 0.82);
  --glass-inset: rgba(255, 242, 222, 0.07);
  --glass-border: rgba(255, 232, 195, 0.16);
  --glass-ring: rgba(255, 224, 175, 0.11);
  --glass-shadow: 0 24px 56px rgba(0, 0, 0, 0.54), 0 4px 16px rgba(0, 0, 0, 0.30);
  --glass-blur: blur(24px) saturate(1.38);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="day"]) {
    --glass-bg: rgba(22, 17, 13, 0.72);
    --glass-bg-strong: rgba(24, 19, 14, 0.82);
    --glass-inset: rgba(255, 242, 222, 0.07);
    --glass-border: rgba(255, 232, 195, 0.16);
    --glass-ring: rgba(255, 224, 175, 0.11);
    --glass-shadow: 0 24px 56px rgba(0, 0, 0, 0.54), 0 4px 16px rgba(0, 0, 0, 0.30);
    --glass-blur: blur(24px) saturate(1.38);
  }
}

/* Lock Seerah Map page cleanly to viewport on desktop so the timeline dock NEVER clips below the fold */
body[data-page="seerah-map"] .site-footer { display: none; }
.atlas-workspace { display: flex; flex-direction: column; height: calc(100svh - var(--header-h, 64px)); min-height: 540px; overflow: hidden; background: #140F0B; }

/* Slim 56px single-row workspace bar (Back left · Title centered · Milestones toggle right) */
.atlas-bar { flex: none; min-height: 56px; padding: 6px clamp(14px, 2vw, 24px); background: var(--surface); border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; z-index: 12; }
.atlas-bar__crumb { justify-self: start; display: inline-flex; align-items: center; gap: 5px; min-height: 44px; padding: 0 4px; font-size: var(--fs-sm); font-weight: 600; color: var(--accent); text-decoration: none; white-space: nowrap; }
.atlas-bar__crumb svg { width: 15px; height: 15px; flex: none; }
.atlas-bar__crumb:hover { text-decoration: underline; text-underline-offset: 3px; }
.atlas-bar__title { justify-self: center; font-family: var(--font-display); font-size: clamp(17px, 1.6vw, 21px); font-weight: 800; color: var(--text); white-space: nowrap; text-align: center; }
.atlas-bar__right { justify-self: end; display: flex; align-items: center; }

.atlas-list-toggle { flex: none; display: inline-flex; align-items: center; gap: 7px; min-height: 44px; padding: 0 15px; border-radius: var(--r-pill); border: 1px solid var(--line-strong); background: var(--bg); color: var(--text); font-size: 13.5px; font-weight: 700; cursor: pointer; white-space: nowrap; transition: border-color var(--t-state), background-color var(--t-state), color var(--t-state); }
.atlas-list-toggle svg { width: 16px; height: 16px; flex: none; }
.atlas-list-toggle:hover, .atlas-list-toggle[aria-expanded="true"] { border-color: var(--accent); color: var(--accent); background: var(--surface-2); }

/* Full-bleed 3D Map Stage */
.atlas-stage { position: relative; flex: 1 1 auto; min-height: 0; overflow: hidden; background: #140F0B; }
.atlas-canvas { position: absolute; inset: 0; }
.atlas-map { position: absolute; inset: 0; z-index: 2; }
.atlas-poster { position: absolute; inset: 0; z-index: 1; display: grid; place-items: center; background: var(--bg); transition: opacity .35s ease; }
.atlas-stage.is-gl-ready .atlas-poster { opacity: 0; pointer-events: none; }
.atlas-poster svg { width: 100%; height: 100%; max-height: 540px; }

/* Subtle editorial vignette around the 3D terrain edges */
.atlas-stage::after { content: ""; position: absolute; inset: 0; z-index: 3; pointer-events: none; background: radial-gradient(ellipse at 50% 48%, transparent 56%, rgba(14, 10, 7, 0.42) 100%); }

/* Collapsible Full-Height Left Chronology Drawer (Desktop — frosted glass over 3D terrain) */
.atlas-drawer { position: absolute; top: 14px; left: 14px; bottom: 88px; width: 356px; z-index: 9; display: flex; flex-direction: column; border-radius: 20px; background: var(--glass-bg); backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur); box-shadow: var(--glass-shadow), inset 0 1px 0 var(--glass-border), inset 0 0 0 1px var(--glass-ring); transform: translateX(calc(-100% - 24px)); opacity: 0; pointer-events: none; transition: transform .28s cubic-bezier(.2,.7,.2,1), opacity .22s ease; overflow: hidden; }
.atlas-drawer.is-open { transform: translateX(0); opacity: 1; pointer-events: auto; }
.atlas-drawer__head { flex: none; display: flex; align-items: center; justify-content: space-between; padding: 13px 14px 12px 18px; border-bottom: 1px solid var(--glass-ring); background: var(--glass-inset); }
.atlas-drawer__title { font-family: var(--font-display); font-size: 16px; font-weight: 800; color: var(--text); letter-spacing: -.01em; }
.atlas-drawer__close { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--glass-ring); background: var(--glass-bg-strong); color: var(--muted); font-size: 14px; cursor: pointer; display: grid; place-items: center; transition: background-color var(--t-state), color var(--t-state), border-color var(--t-state); }
.atlas-drawer__close:hover { background: var(--saffron); color: var(--on-saffron); border-color: transparent; }
.atlas-drawer__scroll { position: relative; flex: 1 1 auto; overflow-y: auto; padding: 10px 10px 14px; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--muted) 34%, transparent) transparent; }
.atlas-drawer__scroll::-webkit-scrollbar { width: 6px; }
.atlas-drawer__scroll::-webkit-scrollbar-track { background: transparent; }
.atlas-drawer__scroll::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--muted) 30%, transparent); border-radius: 99px; }

.atlas-list { list-style: none; display: grid; gap: 4px; position: relative; }
.atlas-list__li { position: relative; }
.atlas-list__li:not(:last-child)::before { content: ""; position: absolute; left: 22px; top: 34px; bottom: -10px; width: 1.5px; background: color-mix(in srgb, var(--line-strong) 72%, transparent); pointer-events: none; z-index: 0; }

.atlas-item { position: relative; z-index: 1; width: 100%; display: grid; grid-template-columns: 28px minmax(0, 1fr); column-gap: 11px; align-items: start; text-align: left; padding: 10px 12px 10px 9px; border-radius: 14px; border: 1px solid transparent; background: transparent; color: var(--text); cursor: pointer; text-decoration: none; transition: background-color var(--t-state), border-color var(--t-state), box-shadow var(--t-state); }
.atlas-item:hover { background: var(--glass-inset); border-color: var(--glass-ring); }
.atlas-item.is-active { background: color-mix(in srgb, #F6B94D 16%, var(--glass-bg-strong)); border-color: color-mix(in srgb, #E89B1E 48%, var(--glass-border)); box-shadow: 0 6px 18px rgba(180, 110, 10, .10), inset 0 1px 0 var(--glass-border); }

.atlas-item__rail { display: grid; place-items: center; padding-top: 1px; }
.atlas-item__n { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 11.5px; font-weight: 800; color: var(--muted); background: var(--glass-bg-strong); border: 1.5px solid color-mix(in srgb, var(--era-makkah) 48%, var(--line)); transition: background var(--t-state), color var(--t-state), border-color var(--t-state), transform var(--t-state), box-shadow var(--t-state); }
.atlas-item:hover .atlas-item__n { color: var(--text); }
.atlas-item.is-active .atlas-item__n { background: linear-gradient(135deg, #FFD36A, #F2A928); border-color: #E59616; color: #1C1306; transform: scale(1.06); box-shadow: 0 3px 10px rgba(232, 155, 30, .42); }

.atlas-item__body { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.atlas-item__t { font-size: 14px; font-weight: 700; line-height: 1.32; color: var(--text); }
.atlas-item__d { font-size: 12.5px; line-height: 1.36; color: color-mix(in srgb, var(--text) 72%, var(--muted)); }
.atlas-item__km { align-self: flex-start; display: inline-flex; align-items: center; gap: 4px; margin-top: 3px; padding: 2px 9px; border-radius: var(--r-pill); font-size: 11.5px; font-weight: 700; line-height: 1.3; color: var(--accent); background: color-mix(in srgb, #F6B94D 18%, var(--glass-bg-strong)); border: 1px solid color-mix(in srgb, #E89B1E 30%, transparent); white-space: nowrap; }
.atlas-item__km svg { width: 11px; height: 11px; flex: none; opacity: .88; }

/* First-Visit Floating Welcome Overlay Card (Frosted glass, ONE unmistakable CTA + inline color key) */
.atlas-welcome { position: absolute; top: 20px; right: 20px; width: min(392px, calc(100% - 40px)); z-index: 10; padding: 24px 22px; border-radius: 20px; background: var(--glass-bg); backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur); box-shadow: var(--glass-shadow), inset 0 1px 0 var(--glass-border), inset 0 0 0 1px color-mix(in srgb, var(--saffron) 34%, var(--glass-ring)); display: grid; gap: 12px; }
.atlas-welcome[hidden] { display: none; }
.atlas-welcome__kicker { font-size: 13px; font-weight: 800; color: var(--accent); }
.atlas-welcome__title { font-family: var(--font-display); font-size: clamp(22px, 2.2vw, 27px); line-height: 1.26; color: var(--text); }
.atlas-welcome__body { font-size: 15px; line-height: 1.68; color: color-mix(in srgb, var(--text) 84%, var(--muted)); }
.atlas-welcome__actions { display: flex; flex-wrap: wrap; gap: 10px; padding-top: 2px; }
.atlas-welcome__start { position: relative; overflow: hidden; flex: 1 1 auto; justify-content: center; animation: atlas-start-glow 2.8s ease-in-out infinite; }
.atlas-welcome__start::after { content: ""; position: absolute; inset: 0; width: 46%; background: linear-gradient(108deg, transparent 0%, rgba(255, 250, 236, .48) 50%, transparent 100%); transform: translateX(-160%) skewX(-18deg); animation: atlas-start-sheen 3.2s cubic-bezier(.35, 0, .2, 1) infinite; pointer-events: none; }
.atlas-start-arrow { display: inline-flex; align-items: center; animation: atlas-arrow-nudge 2.8s ease-in-out infinite; }
.atlas-start-arrow svg { width: 17px; height: 17px; }
@keyframes atlas-start-glow {
  0%, 100% { box-shadow: 0 4px 14px rgba(224, 154, 42, .28), 0 0 0 0 rgba(246, 185, 77, .48); }
  50% { box-shadow: 0 6px 22px rgba(224, 154, 42, .42), 0 0 0 7px rgba(246, 185, 77, 0); }
}
@keyframes atlas-start-sheen {
  0%, 42% { transform: translateX(-160%) skewX(-18deg); }
  78%, 100% { transform: translateX(340%) skewX(-18deg); }
}
@keyframes atlas-arrow-nudge {
  0%, 60%, 100% { transform: translateX(0); }
  75% { transform: translateX(4px); }
  88% { transform: translateX(0); }
}
@media (prefers-reduced-motion: reduce) {
  .atlas-welcome__start, .atlas-welcome__start::after, .atlas-start-arrow { animation: none; }
}

/* Floating Editorial Story Card (Frosted glassmorphism over 3D terrain) */
.atlas-card { position: absolute; top: 18px; right: 18px; width: min(396px, calc(100% - 36px)); max-height: calc(100% - 148px); z-index: 9; display: flex; flex-direction: column; border-radius: 20px; background: var(--glass-bg); backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur); box-shadow: var(--glass-shadow), inset 0 1px 0 var(--glass-border), inset 0 0 0 1px var(--glass-ring); overflow: hidden; }
.atlas-card[hidden] { display: none; }
.atlas-card__top { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 13px 14px 12px 18px; border-bottom: 1px solid var(--glass-ring); background: var(--glass-inset); }
.atlas-card__date { flex: 1 1 auto; min-width: 0; font-size: 12.5px; font-weight: 800; color: var(--accent); line-height: 1.35; }
.atlas-card__top-r { flex: none; display: flex; align-items: center; gap: 7px; }
.atlas-card__step { flex: none; white-space: nowrap; font-size: 12px; font-weight: 800; color: var(--muted); padding: 4px 11px; border-radius: var(--r-pill); background: var(--glass-bg-strong); border: 1px solid var(--glass-ring); }
.atlas-card__min { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--glass-ring); background: var(--glass-bg-strong); color: var(--text); font-size: 16px; line-height: 1; cursor: pointer; display: grid; place-items: center; transition: background-color var(--t-state), color var(--t-state), border-color var(--t-state); }
.atlas-card__min:hover { background: var(--saffron); color: var(--on-saffron); border-color: transparent; }

.atlas-card__body { flex: 1 1 auto; overflow-y: auto; padding: 16px 18px 18px; display: grid; gap: 13px; overscroll-behavior: contain; }
.atlas-card.is-collapsed .atlas-card__body { display: none; }
.atlas-card.is-collapsed .atlas-card__top { border-bottom: 0; padding-bottom: 13px; }
.atlas-card__title { font-family: var(--font-display); font-size: clamp(21px, 2vw, 25px); font-weight: 800; line-height: 1.28; letter-spacing: -.01em; color: var(--text); }
.atlas-card__summary { font-size: 15.5px; line-height: 1.72; color: color-mix(in srgb, var(--text) 92%, var(--muted)); }
.atlas-card__route-note { position: relative; padding: 10px 14px 10px 16px; border-radius: 0 8px 8px 0; background: var(--glass-inset); border: 1px solid var(--glass-ring); border-left: 0; font-size: 13.5px; line-height: 1.58; color: color-mix(in srgb, var(--text) 86%, var(--muted)); overflow: hidden; }
.atlas-card__route-note::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3.5px; background: var(--era-makkah); }

/* Compact inline reference pills inside Atlas card so they never bloat card height */
.atlas-card__refs { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; }
.atlas-card__refs .pill-ref { min-height: 30px; padding: 0; }
.atlas-card__refs .pill-ref__in { min-height: 28px; padding: 2px 10px; font-size: 12px; background: var(--glass-bg-strong); }

/* Clear Navigation Hierarchy: Primary = Prev/Next inside Atlas, Secondary = Read Episode */
.atlas-card__footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 12px; border-top: 1px solid var(--glass-ring); }
.atlas-card__step-nav { display: flex; align-items: center; gap: 7px; }
.atlas-step-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 42px; padding: 0 14px; border-radius: var(--r-pill); border: 1px solid var(--glass-ring); background: var(--glass-bg-strong); color: var(--text); font-size: 13.5px; font-weight: 700; cursor: pointer; transition: background-color var(--t-state), border-color var(--t-state), color var(--t-state), box-shadow var(--t-state); }
.atlas-step-btn svg { width: 15px; height: 15px; flex: none; }
.atlas-step-btn:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.atlas-step-btn:disabled { opacity: .38; cursor: not-allowed; }
.atlas-step-btn--next { background: linear-gradient(135deg, #FFCF63, #F1A928); border-color: #E2971A; color: #1C1306; box-shadow: 0 4px 12px rgba(232, 155, 30, .28); }
.atlas-step-btn--next:hover:not(:disabled) { background: linear-gradient(135deg, #FFD87C, #F4B336); border-color: #D88A10; color: #1C1306; box-shadow: 0 6px 16px rgba(232, 155, 30, .38); }

.atlas-read-link { display: inline-flex; align-items: center; gap: 5px; min-height: 42px; padding: 0 13px; border-radius: var(--r-pill); border: 1px solid var(--glass-ring); background: var(--glass-bg-strong); color: var(--accent); font-size: 13.5px; font-weight: 700; text-decoration: none; white-space: nowrap; transition: background-color var(--t-state), border-color var(--t-state); }
.atlas-read-link svg { width: 12px; height: 12px; flex: none; }
.atlas-read-link:hover { border-color: var(--accent); background: var(--glass-inset); }

/* Floating Single-Line Keyboard Hint above Timeline Dock (Wide desktop pointer devices only — clears attribution cleanly) */
.atlas-kbd-hint { position: absolute; left: 50%; bottom: 84px; transform: translateX(-50%); z-index: 9; margin: 0; padding: 4px 12px; border-radius: var(--r-pill); background: rgba(20, 15, 11, .70); backdrop-filter: blur(14px) saturate(1.3); -webkit-backdrop-filter: blur(14px) saturate(1.3); color: rgba(251, 244, 231, .90); box-shadow: inset 0 1px 0 rgba(255, 240, 210, .18), inset 0 0 0 1px rgba(246, 185, 77, .22); font-size: 12px; font-weight: 500; line-height: 1.4; white-space: nowrap; display: inline-flex; align-items: center; gap: 5px; pointer-events: none; transition: opacity .18s ease; }
.atlas-kbd-hint kbd { display: inline-flex; align-items: center; justify-content: center; min-width: 21px; height: 20px; padding: 0 5px; border-radius: 4px; background: rgba(255, 250, 240, .14); border: 1px solid rgba(255, 244, 224, .34); box-shadow: 0 1.5px 0 rgba(0, 0, 0, .48); color: #FFF8EC; font-family: var(--font-latin); font-size: 11px; font-weight: 700; line-height: 1; }
@media (hover: none), (max-width: 1180px) { .atlas-kbd-hint { display: none; } }

/* Floating Bottom Timeline Scrubber Dock (Frosted glassmorphism — ALWAYS visible inside viewport!) */
.atlas-dock { position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%); width: min(780px, calc(100% - 28px)); z-index: 10; padding: 6px 10px; border-radius: var(--r-pill); background: var(--glass-bg); backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur); box-shadow: var(--glass-shadow), inset 0 1px 0 var(--glass-border), inset 0 0 0 1px var(--glass-ring); display: flex; align-items: center; gap: 8px; }
.atlas-play { flex: none; width: 44px; height: 44px; border-radius: 50%; border: 0; background: linear-gradient(135deg, #FFCF63, #F1A928); color: #1C1306; box-shadow: 0 4px 12px rgba(232, 155, 30, .32); display: grid; place-items: center; cursor: pointer; transition: transform var(--t-state), box-shadow var(--t-state); }
.atlas-play:hover { transform: scale(1.05); box-shadow: 0 6px 16px rgba(232, 155, 30, .44); }
.atlas-play svg { width: 23px; height: 23px; }
.atlas-dock__arrow { flex: none; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--glass-ring); background: var(--glass-bg-strong); color: var(--text); display: grid; place-items: center; cursor: pointer; transition: border-color var(--t-state), color var(--t-state), background-color var(--t-state); }
.atlas-dock__arrow svg { width: 15px; height: 15px; }
.atlas-dock__arrow:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.atlas-dock__arrow:disabled { opacity: .35; cursor: not-allowed; }

.atlas-scrub-wrap { flex: 1 1 auto; display: flex; align-items: center; gap: 8px; min-width: 0; }
.atlas-scrub__year { font-size: 11.5px; font-weight: 700; color: var(--muted); white-space: nowrap; }
.atlas-scrub-track { position: relative; flex: 1 1 auto; height: 44px; display: flex; align-items: center; }
.atlas-scrub-ticks { position: absolute; left: 8px; right: 8px; top: 50%; transform: translateY(-50%); display: flex; justify-content: space-between; pointer-events: none; z-index: 0; }
.atlas-scrub-ticks i { width: 2px; height: 9px; border-radius: 1px; background: var(--era-makkah); opacity: .55; }
.atlas-scrub-ticks i.is-past { opacity: .95; }
.atlas-scrub__range { position: relative; z-index: 1; width: 100%; height: 44px; margin: 0; accent-color: var(--accent); cursor: pointer; background: transparent; outline: none; }
.atlas-scrub__range:focus-visible { outline: 2px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 4px; border-radius: var(--r-pill); }
.atlas-dock__now { flex: none; padding: 0 10px 0 4px; text-align: right; font-size: 12.5px; font-weight: 800; color: var(--accent); white-space: nowrap; }
.atlas-dock__mob-list { display: none; }

/* ================= Industry-Standard Cartographic Map Markers (EXACT anchor at [lon, lat], ZERO offset!) ================= */
/* CRITICAL: Keep position: absolute; top: 0; left: 0 so MapLibre's .maplibregl-marker transform is NEVER displaced!
   44×44 transparent hit area centered on [lon, lat] meets the 44px tap-target bar while keeping the visual dot crisp. */
.atlas-star-pin { position: absolute; top: 0; left: 0; margin: 0; width: 44px; height: 44px; padding: 0; border: 0; background: none; appearance: none; display: grid; place-items: center; cursor: pointer; font-family: var(--font-ui); color: var(--era-makkah); overflow: visible; z-index: 4; }

/* Industry-standard circular map node (origin, route waypoints, overview landmarks) */
.atlas-pin-dot { position: relative; z-index: 2; width: 14px; height: 14px; border-radius: 50%; background: currentColor; border: 2.5px solid #FFFBF2; box-shadow: 0 2px 6px rgba(0, 0, 0, .58), 0 0 0 1px rgba(20, 15, 11, .45); transition: transform .32s cubic-bezier(.2,.7,.2,1), opacity .28s ease; }

/* Classic teardrop Map Pin (active milestone ONLY — bottom tip sits dead-on [lon, lat] at container center 50%!) */
.atlas-pin-drop { position: absolute; left: 50%; bottom: 50%; transform: translateX(-50%) scale(.6); transform-origin: 50% 100%; width: 30px; height: 39px; z-index: 3; opacity: 0; pointer-events: none; transition: transform .38s cubic-bezier(.22, 1.15, .36, 1), opacity .25s ease; filter: drop-shadow(0 5px 10px rgba(0, 0, 0, .55)); }
.atlas-pin-drop__body { fill: currentColor; stroke: #FFFBF2; stroke-width: 2; stroke-linejoin: round; }
.atlas-pin-drop__hole { fill: #FFFBF2; stroke: rgba(20, 15, 11, .28); stroke-width: 1; }

/* Future state: delicate outlined node */
.atlas-star-pin.is-future .atlas-pin-dot { opacity: .65; transform: scale(.85); background: rgba(20, 15, 11, .7); border-color: currentColor; }

/* Calm orientation anchor (Makkah / Madinah when distant reference) */
.atlas-star-pin.is-anchor { z-index: 3; }
.atlas-star-pin.is-anchor .atlas-pin-dot { opacity: .72; transform: scale(.78); }
.atlas-star-pin.is-anchor .atlas-star-pin__lbl { opacity: .82; font-size: 11px; }

/* Intermediate route waypoint: crisp smaller dot right on the curve */
.atlas-star-pin.is-waypoint { z-index: 5; }
.atlas-star-pin.is-waypoint .atlas-pin-dot { width: 11px; height: 11px; border-width: 2px; opacity: .96; }

/* Past / origin stop: crisp solid waypoint node */
.atlas-star-pin.is-past .atlas-pin-dot { opacity: .98; }

/* Active state: swap dot for crisp classic teardrop Map Pin + subtle ground anchor & dual pulsing rings */
.atlas-star-pin.is-active { z-index: 8; }
.atlas-star-pin.is-active .atlas-pin-dot { width: 8px; height: 8px; border-width: 1.5px; opacity: .85; }
.atlas-star-pin.is-active .atlas-pin-drop { opacity: 1; transform: translateX(-50%) scale(1); }

.atlas-star-pin__ring { position: absolute; inset: 12px; border-radius: 50%; border: 2px solid currentColor; opacity: 0; pointer-events: none; z-index: 1; }
.atlas-star-pin.is-active .atlas-star-pin__ring { animation: atlas-star-ripple 2.5s ease-out infinite; }
.atlas-star-pin.is-active .atlas-star-pin__ring--2 { animation-delay: 1.25s; }
@keyframes atlas-star-ripple {
  0% { transform: scale(.55); opacity: .85; }
  100% { transform: scale(2.6); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .atlas-star-pin.is-active .atlas-star-pin__ring { animation: none; opacity: .45; transform: scale(1.45); }
}

/* Label pill positioned cleanly beside the map marker (flips left automatically when needed; never displaces anchor!) */
.atlas-star-pin__lbl { position: absolute; left: calc(50% + 14px); top: 50%; transform: translateY(-50%); display: inline-flex; align-items: baseline; gap: 6px; padding: 4px 10px; border-radius: var(--r-pill); background: rgba(20, 15, 11, .88); color: #FBF4E7; box-shadow: 0 3px 12px rgba(0, 0, 0, .42), inset 0 0 0 1px rgba(246, 185, 77, .42); white-space: nowrap; font-size: 13px; font-weight: 700; line-height: 1.3; pointer-events: none; transition: opacity .22s ease; }
.atlas-star-pin__ar { font-family: var(--font-arabic); font-size: 13px; font-weight: 400; opacity: .9; }
.atlas-star-pin.is-active .atlas-star-pin__lbl { left: calc(50% + 18px); top: calc(50% - 16px); background: rgba(20, 15, 11, .95); font-size: 13.5px; box-shadow: 0 6px 18px rgba(0, 0, 0, .55), inset 0 0 0 1.4px currentColor; }
.atlas-star-pin.is-lbl-left .atlas-star-pin__lbl { left: auto; right: calc(50% + 14px); }
.atlas-star-pin.is-active.is-lbl-left .atlas-star-pin__lbl { left: auto; right: calc(50% + 18px); top: calc(50% - 16px); }
.atlas-star-pin.is-dot-only .atlas-star-pin__lbl { opacity: 0; }
.atlas-star-pin.is-dot-only:hover .atlas-star-pin__lbl,
.atlas-star-pin.is-dot-only:focus-visible .atlas-star-pin__lbl { opacity: 1; }

/* Distance badge floating cleanly in empty stretch along route */
.atlas-km-badge { position: absolute; top: 0; left: 0; margin: 0; padding: 3px 10px; border-radius: var(--r-pill); background: rgba(20, 15, 11, .88); color: #F6B94D; font-size: 11.5px; font-weight: 800; box-shadow: 0 4px 14px rgba(0, 0, 0, .45), inset 0 0 0 1px rgba(246, 185, 77, .55); white-space: nowrap; pointer-events: none; z-index: 6; }

/* Keep MapLibre controls unobtrusive while keeping full map & terrain attribution always visible without colliding with kbd hint */
.atlas-map .maplibregl-ctrl-bottom-right { bottom: 76px; right: 14px; max-width: min(320px, calc(100% - 28px)); }
.atlas-map .maplibregl-ctrl-bottom-left { bottom: 76px; left: 14px; }
.atlas-map .maplibregl-ctrl-group { border-radius: 14px; overflow: hidden; background: var(--glass-bg); backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur); box-shadow: var(--glass-shadow), inset 0 1px 0 var(--glass-border), inset 0 0 0 1px var(--glass-ring); }
.atlas-map .maplibregl-ctrl-group button { width: 44px; height: 44px; background: transparent; border-top-color: var(--glass-ring); }
.atlas-map .maplibregl-ctrl-group button:hover { background: var(--glass-inset); }
[data-theme="night"] .atlas-map .maplibregl-ctrl-group button .maplibregl-ctrl-icon { filter: invert(.92) sepia(.18) saturate(.6) hue-rotate(355deg); }
.atlas-map .maplibregl-ctrl-attrib { font-size: 10.5px; line-height: 1.42; padding: 4px 10px; border-radius: 10px; background: var(--glass-bg); color: var(--text); backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur); box-shadow: inset 0 1px 0 var(--glass-border), inset 0 0 0 1px var(--glass-ring); }
.atlas-map .maplibregl-ctrl-attrib a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
[data-theme="night"] .atlas-map .maplibregl-ctrl-attrib-button { background-color: rgba(244, 237, 227, .88); }
.atlas-mob-credit { display: none; }

/* ================= Bangla Typography Floor (>= 15px, zero letter-spacing on all Bangla controls & labels) ================= */
:lang(bn) .atlas-era,
:lang(bn) .atlas-list-toggle,
:lang(bn) .atlas-drawer__title,
:lang(bn) .atlas-item__t,
:lang(bn) .atlas-item__d,
:lang(bn) .atlas-item__n,
:lang(bn) .atlas-item__km,
:lang(bn) .atlas-welcome__kicker,
:lang(bn) .atlas-card__date,
:lang(bn) .atlas-card__step,
:lang(bn) .atlas-card__route-note,
:lang(bn) .atlas-step-btn,
:lang(bn) .atlas-read-link,
:lang(bn) .atlas-scrub__year,
:lang(bn) .atlas-dock__now,
:lang(bn) .atlas-dock__mob-list,
:lang(bn) .atlas-star-pin__lbl,
:lang(bn) .atlas-star-pin.is-active .atlas-star-pin__lbl,
:lang(bn) .atlas-star-pin.is-anchor .atlas-star-pin__lbl,
:lang(bn) .atlas-km-badge {
  font-size: 15px;
  letter-spacing: 0;
}
:lang(bn) .atlas-item__t { font-size: 15.5px; }
:lang(bn) .atlas-item__d { font-size: 14px; }
:lang(bn) .atlas-item__n { font-size: 12.5px; }
:lang(bn) .atlas-item__km { font-size: 13px; }
:lang(bn) .atlas-drawer__title { font-size: 17px; }
:lang(bn) .atlas-kbd-hint { font-size: 15px; letter-spacing: 0; }

/* Mobile bottom sheet list styling */
.atlas-sheet__body { max-height: 62vh; overflow-y: auto; padding-top: 6px; }

/* ================= Mobile & Tablet Adaptation (< 960px) ================= */
@media (max-width: 960px) {
  .atlas-workspace { height: auto; min-height: calc(100svh - var(--header-h, 58px)); overflow: visible; background: var(--bg); }
  .atlas-bar { padding: 4px 10px; gap: 6px; grid-template-columns: 1fr auto 1fr; }
  .atlas-bar__crumb { font-size: 13px; gap: 3px; padding: 0; }
  .atlas-bar__title { font-size: 16px; grid-column: 2; }
  .atlas-bar__right { visibility: hidden; pointer-events: none; }
  .atlas-list-toggle { display: none; }

  .atlas-stage { display: flex; flex-direction: column; overflow: visible; background: var(--bg); }
  .atlas-stage::after { display: none; }
  .atlas-canvas { order: 1; position: relative; height: 38svh; min-height: 245px; max-height: 330px; flex: none; background: #140F0B; }
  .atlas-drawer { display: none; }

  /* Place Timeline Dock immediately below the map — clean, spacious 44px thumb controls */
  .atlas-dock { order: 2; position: sticky; top: var(--header-h, 58px); left: auto; bottom: auto; transform: none; width: 100%; border-radius: 0; box-shadow: 0 4px 12px rgba(0, 0, 0, .08); border-bottom: 1px solid var(--line); background: var(--surface); padding: 6px 8px; gap: 6px; z-index: 15; justify-content: space-between; }
  .atlas-play { width: 44px; height: 44px; }
  .atlas-dock__arrow { width: 44px; height: 44px; }
  .atlas-scrub-wrap { display: none; }
  .atlas-dock__now { min-width: 54px; }
  .atlas-dock__mob-list { flex: 1 1 auto; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 0 12px; border-radius: var(--r-pill); border: 1px solid var(--line-strong); background: var(--bg); color: var(--text); font-size: 13.5px; font-weight: 700; cursor: pointer; white-space: nowrap; }
  .atlas-dock__mob-list svg { width: 15px; height: 15px; color: var(--accent); }

  .atlas-welcome,
  .atlas-card { order: 3; position: relative; top: auto; right: auto; width: 100%; max-height: none; border-radius: 0; box-shadow: none; background: var(--bg); backdrop-filter: none; -webkit-backdrop-filter: none; }
  .atlas-card__min, .atlas-card__step { display: none; }
  .atlas-card__top { padding: 12px 16px 6px; border-bottom: 0; background: transparent; }
  .atlas-card__body { overflow: visible; padding: 2px 16px 28px; gap: 11px; }
  .atlas-card__route-note { background: var(--surface-2); border-color: var(--line); border-left: 0; border-radius: 0 8px 8px 0; }
  /* Hide desktop +/- buttons on touchscreens (pinch-zoom is native); keep corner attribution compact while full credit sits cleanly below card */
  .atlas-map .maplibregl-ctrl-bottom-left { display: none; }
  .atlas-map .maplibregl-ctrl-bottom-right { bottom: 6px; right: 6px; max-width: calc(100% - 12px); }
  .atlas-map .maplibregl-ctrl-attrib { font-size: 9.5px; padding: 2px 6px; }
  .atlas-card__footer { flex-wrap: wrap; gap: 8px; }
  .atlas-mob-credit { order: 4; display: block; margin: 0; padding: 10px 16px 22px; border-top: 1px solid var(--line); background: var(--bg); font-size: 11px; line-height: 1.5; color: var(--muted); }
  .atlas-mob-credit a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
}
@media (max-width: 380px) {
  .atlas-dock { padding: 6px 6px; gap: 4px; }
  .atlas-dock__now { display: none; }
  .atlas-dock__mob-list { padding: 0 8px; }
}
