.pi-service-stage{position:fixed;inset:0;width:100%;height:100%;border:0;z-index:10020;background:#030913}.pi-service-stage[hidden]{display:none!important}#pi-session-bar,#pi-navigation-note{position:fixed;z-index:10035;top:10px;left:50%;transform:translateX(-50%);box-sizing:border-box;width:max-content;max-width:calc(100vw - 24px);background:#102f39;color:#fff;border:1px solid #74c6d4;border-radius:14px;box-shadow:0 4px 18px #0004;padding:8px 12px;font:14px/1.5 system-ui,sans-serif}#pi-session-bar{display:flex;align-items:center;gap:8px;flex-wrap:wrap}#pi-session-bar[hidden],#pi-navigation-note[hidden]{display:none!important}#pi-session-bar span{flex:1;min-width:110px;max-width:270px}#pi-session-bar button{font:inherit;min-height:44px;padding:6px 10px;border:1px solid #9ec5cc;border-radius:9px;background:#173e49;color:#fff;cursor:pointer}#pi-session-bar button:focus-visible{outline:3px solid #fff;outline-offset:2px}#pi-session-bar [data-session=stop]{border-color:#ffabb5}#pi-navigation-note{top:90px}body.pi-voice-stage-open{overflow:hidden}@media(max-width:520px){#pi-session-bar{top:auto;bottom:calc(92px + env(safe-area-inset-bottom));gap:6px;padding:6px 10px}#pi-session-bar span{max-width:175px}#pi-session-bar button{padding:6px 8px}}

#pi-history{position:fixed;inset:auto 190px calc(16px + env(safe-area-inset-bottom)) 100px;z-index:10030;display:flex;align-items:center;gap:10px;padding:7px 12px;max-width:1100px;margin:auto;background:#071b2bea;border:1px solid #6ea1ba66;border-radius:15px;color:#d9eaf1;font:12px/1.4 Arial;box-shadow:0 4px 20px #0005;backdrop-filter:blur(12px)}
#pi-history>span{flex:none;margin:0;color:#a4c9dc;font-size:11px;display:block}
#pi-history .pi-history-stops{display:flex;align-items:center;gap:6px;overflow-x:auto;min-width:0;scrollbar-width:thin;padding:2px}
#pi-history button{display:block;min-width:0;flex:none;max-width:240px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-height:34px;padding:7px 11px;color:#d9eaf1;background:#123044;border:1px solid #406579;border-radius:9px;font:12px/1.4 Arial;cursor:pointer}
#pi-history button[aria-current=page]{background:#2d5060;border-color:#a3dff1;color:#fff}
#pi-history button:focus-visible{outline:2px solid #fff;outline-offset:2px}
#pi-history{bottom:calc(66px + env(safe-area-inset-bottom))}
.pi-service-notice{position:fixed;left:100px;right:190px;bottom:calc(16px + env(safe-area-inset-bottom));z-index:10031;max-width:1100px;margin:auto;display:flex;align-items:center;gap:10px;min-height:40px;padding:5px 12px;box-sizing:border-box;border-radius:12px;background:#0a1c29ed;border:1px solid #7ba2ac55;color:#e6d9b6;font:14px/1.5 Georgia,serif;direction:rtl}
.pi-service-notice[hidden]{display:none!important}.pi-notice-line{min-width:0;flex:1;white-space:nowrap;overflow:hidden}.pi-service-notice button,.pi-service-notice summary{font:11px/1.4 Arial;color:#cbdfe6;cursor:pointer;white-space:nowrap}.pi-service-notice button{padding:6px 9px;background:#153043;border:1px solid #42667a;border-radius:7px}.pi-service-notice details{flex:none;margin:0;padding:0;border:0}.pi-service-notice form{position:absolute;bottom:48px;left:0;right:0;padding:14px;background:#102737;border:1px solid #5e889d;border-radius:12px}.pi-service-notice textarea{box-sizing:border-box;width:100%;font:16px/1.5 Arial;color:#fff;background:#061c2b;border:1px solid #5c8497;border-radius:8px;padding:10px;resize:vertical}.pi-service-notice [role=status]{display:block;font:12px/1.6 Arial;margin-top:6px}body:has(>.pi-service-notice[hidden])>#pi-history{bottom:calc(16px + env(safe-area-inset-bottom))}
@media(max-width:700px){#pi-history{inset:auto 12px calc(86px + env(safe-area-inset-bottom)) 12px}#pi-history>span{font-size:10px}#pi-session-bar{bottom:calc(146px + env(safe-area-inset-bottom))}}
@media(max-width:700px){#pi-history{bottom:calc(136px + env(safe-area-inset-bottom))}.pi-service-notice{left:12px;right:12px;bottom:calc(86px + env(safe-area-inset-bottom));font-size:13px}body:has(>.pi-service-notice[hidden])>#pi-history{bottom:calc(86px + env(safe-area-inset-bottom))}#pi-session-bar{bottom:calc(196px + env(safe-area-inset-bottom))}}

/* Route stations: thin connecting line, small orbs, diagonal readable labels. */
#pi-history{padding:0 12px;background:#071b2bdd}
#pi-history .pi-history-stops{align-items:stretch;gap:0;padding:0 5px;overflow-y:hidden}
#pi-history button{position:relative;display:block;flex:0 0 112px;width:112px;max-width:112px;height:108px;margin:0;padding:0;border:0;border-radius:0;overflow:visible;background:transparent;color:#d9eaf1}
#pi-history button:before{content:'';position:absolute;bottom:15px;left:0;right:0;height:1px;background:#6a9cba88}
#pi-history button:first-child:before{right:50%}#pi-history button:last-child:before{left:50%}
#pi-history button:after{content:'';position:absolute;bottom:10px;right:calc(50% - 5px);width:10px;height:10px;border-radius:50%;background:radial-gradient(circle at 30% 25%,#dcf5ff,#5993b6 55%,#234457);box-shadow:0 0 7px #75c5e455}
#pi-history .pi-history-title{position:absolute;bottom:32px;right:calc(50% - 2px);width:99px;transform:rotate(32deg);transform-origin:bottom right;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-align:right;padding-bottom:2px;border-bottom:1px solid #76a4bb66;font:12px/1.5 Arial}
#pi-history button[aria-current=page]{background:transparent;color:#f5ddb0}
#pi-history button[aria-current=page]:after{background:radial-gradient(circle at 30% 25%,#fff8e5,#dec080 60%,#8a632e);box-shadow:0 0 10px #e6c88988}
#pi-history button:hover .pi-history-title{color:#fff;border-color:#aee7ff}
#pi-history button:focus-visible{outline-offset:-3px;border-radius:8px}
@media(max-width:700px){#pi-history button{flex-basis:100px;width:100px;height:100px}#pi-history .pi-history-title{width:89px;font-size:11px}#pi-history>span{max-width:28px;white-space:normal}}

/* The trail and dedication sit directly on the existing space background. */
#pi-history,.pi-service-notice{background:transparent;border:0;box-shadow:none;backdrop-filter:none}
#pi-history .pi-history-title,#pi-history>span,.pi-notice-line,.pi-service-notice summary{text-shadow:0 1px 3px #000,0 0 8px #000}
.pi-service-notice>button{background:transparent;border-color:#7493a655}

/* A continuous viewport-wide route, with fluid station spacing and overflow. */
#pi-history{left:0;right:0;width:auto;max-width:none;margin:0;padding:0;border-radius:0}
#pi-history:before{content:'';position:absolute;left:0;right:0;bottom:15px;height:1px;background:#6a9cba88;pointer-events:none}
#pi-history>span{position:absolute;right:14px;bottom:112px;max-width:none;white-space:nowrap;pointer-events:none}
#pi-history .pi-history-stops{flex:1;width:100%;padding-inline:24px;scrollbar-width:thin}
#pi-history button{flex:1 0 112px;width:auto;max-width:none}
#pi-history button:before{display:none}
@media(max-width:700px){#pi-history button{flex-basis:100px}#pi-history>span{bottom:104px;max-width:none;white-space:nowrap}}
@media(max-height:500px){#pi-history,body:has(>.pi-service-notice[hidden])>#pi-history{bottom:38px}#pi-history button{height:70px;flex-basis:90px}#pi-history .pi-history-title{width:74px;font-size:10px}#pi-history>span{display:none}.pi-service-notice{bottom:4px;left:12px;right:12px;font-size:12px}}

/* Only edge arrows and direct touch/trackpad scrolling; no extra scroll rail. */
#pi-history{padding:0;gap:0}
#pi-history:before{bottom:15px}
#pi-history .pi-history-stops{box-sizing:border-box;padding-inline:44px;scrollbar-width:none}
#pi-history .pi-history-stops::-webkit-scrollbar{display:none}
#pi-history .pi-history-stops{touch-action:pan-x;cursor:grab;user-select:none}
#pi-history .pi-history-stops>button{cursor:grab}
#pi-history .pi-history-stops.is-dragging,#pi-history .pi-history-stops.is-dragging>button{cursor:grabbing}
#pi-history .pi-history-stops>button{height:80px}
#pi-history>span{display:none}
#pi-history .pi-history-title{bottom:22px;transform:rotate(24deg);font-size:11px;line-height:1.4;padding-bottom:0}
#pi-history .pi-history-arrow{position:absolute;bottom:-7px;width:44px;height:44px;min-height:44px;max-width:44px;padding:0;display:grid;place-items:center;background:transparent;border:0;border-radius:0;color:#d9eaf1;font:32px/1 Arial;z-index:1;direction:ltr}
#pi-history .pi-history-arrow:before,#pi-history .pi-history-arrow:after{display:none}
#pi-history .pi-history-right{right:0}#pi-history .pi-history-left{left:0}
#pi-history .pi-history-arrow:disabled{opacity:.22;cursor:default}
#pi-history .pi-history-arrow:hover:not(:disabled){color:#fff}
@media(max-width:700px){#pi-history .pi-history-stops>button{height:76px}#pi-history .pi-history-title{font-size:11px;width:89px}}
@media(max-height:500px){#pi-history .pi-history-stops>button{height:58px}#pi-history .pi-history-title{font-size:10px;width:68px;transform:rotate(18deg)}}

/* A quiet neural pulse on the existing line, independent of RTL and scrolling. */
#pi-history:after{content:'';position:absolute;left:0;right:0;bottom:11px;height:9px;pointer-events:none;background-image:radial-gradient(circle at 90% 50%,#f1fcff 0 1px,#a4e9ff 2px,#73cde944 4px,transparent 6px),linear-gradient(90deg,transparent 0%,#6eb7d222 30%,#83d9efaa 75%,#dcf8ff 90%,transparent 96%);background-size:96px 9px,96px 2px;background-repeat:no-repeat;background-position:-96px center;filter:drop-shadow(0 0 3px #83d9ef66);animation:pi-route-pulse var(--pi-route-pulse-duration,14s) linear infinite}
@keyframes pi-route-pulse{from{background-position:-96px center}to{background-position:calc(100% + 96px) center}}
.sky-paused #pi-history:after{animation-play-state:paused}
@media(prefers-reduced-motion:reduce){#pi-history:after{display:none;animation:none}}

/* Notice controls live in settings, leaving only the larger text on the graph. */
.pi-service-notice{font-size:21px;right:142px}
#service-text-settings{margin:28px 0;direction:rtl}#service-text-settings[hidden]{display:none}#service-text-settings details{padding:18px;border:1px solid #698496;border-radius:14px;background:#102736}#service-text-settings summary{font:18px Arial;cursor:pointer}#service-text-settings form{display:grid;gap:12px;margin-top:16px}#service-text-settings textarea{width:100%;box-sizing:border-box;font:16px/1.6 Arial;color:#fff;background:#071b29;border:1px solid #7298ac;border-radius:9px;padding:10px}#service-text-settings label{font:15px/1.6 Arial}#service-text-settings input{width:90px;margin-inline:10px;font:16px Arial}#service-text-settings [role=status]{font:14px Arial}
@media(max-width:700px){.pi-service-notice{font-size:19.5px;right:12px}}
@media(max-height:500px){.pi-service-notice{font-size:18px;left:90px;right:142px}}

.pi-route-motion-setting{display:block;margin:16px 0;font:14px/1.6 Arial;color:#c9dce7}.pi-route-motion-setting input[type=range]{display:block;width:100%;margin:10px 0;accent-color:#a6dcec}.pi-route-motion-setting output{display:block;font-size:12px;color:#a9c9d9}
body.pi-voice-stage-open>[data-pi-stage-suspended]{visibility:hidden!important;pointer-events:none!important}

/* Current station is identifiable by shape, text and color. */
#pi-history .pi-history-stops>button[aria-current=page]:before{display:block;left:calc(50% - 1.5px);right:auto;bottom:0;width:3px;height:34px;border-radius:2px;background:#ff625e;box-shadow:0 0 7px #ff625e88;z-index:2}
#pi-history .pi-history-stops>button[aria-current=page]:after{background:radial-gradient(circle at 30% 25%,#fff1ef,#ff7770 55%,#a82f2d);box-shadow:0 0 10px #ff625e88;z-index:3}
#pi-history .pi-history-current{position:absolute;bottom:0;left:calc(50% + 9px);font:10px/1 Arial;color:#ffaaa5;white-space:nowrap;text-shadow:0 1px 3px #000;pointer-events:none}
#pi-history .pi-history-stops>button[aria-current=page] .pi-history-title{color:#ffb1ac;border-color:#ff7770}

/* Chronology is physical left-to-right in every UI language. Keep short trails
   at the right edge; overflowing older visits remain reachable to the left. */
#pi-history .pi-history-stops{direction:ltr;overflow-anchor:none}
#pi-history .pi-history-stops>button{flex-grow:0}
#pi-history .pi-history-stops>button:first-child{margin-left:auto}

#pi-history button[hidden]{display:none!important}

#pi-history .pi-history-title[hidden]{display:none!important}

.pi-sponsors{display:flex;gap:14px;align-items:center;justify-content:center;overflow:auto;width:100%;padding:4px 0}
.pi-sponsors a{display:flex;align-items:center;flex:none;font:13px Arial;min-height:32px;text-decoration:none}
.pi-sponsors img{max-width:90px;height:26px;object-fit:contain}.pi-sponsors span[hidden]{display:none!important}
#service-text-settings fieldset{display:flex;flex-wrap:wrap;gap:8px;margin:10px 0;border:1px solid #42667a;border-radius:8px;padding:10px}
#service-text-settings input[type=url],#service-text-settings input[type=text]{max-width:100%;min-width:0;padding:8px;border:1px solid #5c8497;border-radius:8px;background:#061c2b;color:#fff}
.pi-notice-line[href]{cursor:pointer;text-decoration:underline;text-underline-offset:4px}

.pi-notice-line[hidden]{display:none!important}

.pi-guest-notice{position:fixed;top:76px;left:50%;transform:translateX(-50%);z-index:2100;box-sizing:border-box;max-width:calc(100vw - 24px);width:660px;display:flex;align-items:center;gap:12px;padding:12px 16px;border:1px solid #7196ac;border-radius:12px;background:#102b3a;color:#edf6fc;font:15px/1.6 Arial;box-shadow:0 4px 16px #0004}.pi-guest-notice[hidden]{display:none!important}.pi-guest-notice a{color:#c6edff;white-space:nowrap;text-decoration:underline}.pi-guest-notice button{flex:none;width:36px;min-height:36px;padding:0;background:transparent;border:0;color:inherit;font:24px Arial;cursor:pointer}@media(max-width:600px){.pi-guest-notice{top:66px;flex-wrap:wrap;font-size:14px}.pi-guest-notice span{flex:1;min-width:200px}.pi-guest-notice button{position:absolute;top:2px;inset-inline-end:2px}.pi-guest-notice span{padding-inline-end:20px}}

/* Or HaChaim uses the PI trail without its additional service notice row. */
body.or-history-enabled #pi-history{bottom:calc(16px + env(safe-area-inset-bottom));z-index:10030;left:0;right:0}
body.or-history-enabled{--or-trail-height:100px}
.or-history-enabled .cosmos-bottom{bottom:112px}
.or-history-enabled .cosmos-personal-actions,.or-history-enabled #cosmos-return{bottom:112px}
.or-history-enabled #study-space-canvas{bottom:100px;height:auto}
.or-history-enabled #space-reader{bottom:112px}
dialog:has(>#pi-history){padding-bottom:100px;box-sizing:border-box}
html.pi-embedded #pi-history{display:none!important}
@media(max-width:700px){body.or-history-enabled #pi-history{bottom:calc(14px + env(safe-area-inset-bottom))}}
@media(max-height:500px){body.or-history-enabled #pi-history{bottom:8px}.or-history-enabled .cosmos-bottom,.or-history-enabled .cosmos-personal-actions,.or-history-enabled #cosmos-return{bottom:78px}dialog:has(>#pi-history){padding-bottom:76px}}

/* The text or sponsor row sits below the route, as in PI. */
body.or-history-enabled #pi-history{bottom:calc(66px + env(safe-area-inset-bottom))}
.or-history-enabled .pi-service-notice{left:24px;right:24px;bottom:calc(12px + env(safe-area-inset-bottom));z-index:10031;max-width:1100px;text-align:center;color:#eee1c7;font-size:19px}
.or-history-enabled .pi-notice-line{text-align:center;color:inherit;text-decoration:none}
.or-history-enabled .cosmos-bottom,.or-history-enabled .cosmos-personal-actions,.or-history-enabled #cosmos-return{bottom:165px}
.or-history-enabled #study-space-canvas{bottom:150px}
.or-history-enabled #space-reader{bottom:165px}
dialog:has(>#pi-history){padding-bottom:150px}
#cosmos-settings:has(#service-text-settings:not([hidden])){width:min(430px,calc(100vw - 32px));bottom:165px}
#service-text-settings{margin:14px 0}#service-text-settings details{padding:12px}
#service-text-settings input:not([type=number]),#service-text-settings select{box-sizing:border-box;width:100%;margin:5px 0 9px;padding:7px;font:13px Heebo,sans-serif;color:#ecdfc3;background:#102736;border:1px solid #698496;border-radius:7px}
#service-text-settings fieldset{border:1px solid #698496!important;padding:10px!important;border-radius:8px}
@media(max-width:700px){body.or-history-enabled #pi-history{bottom:calc(64px + env(safe-area-inset-bottom))}.or-history-enabled .pi-service-notice{left:12px;right:12px;font-size:16px}}
@media(max-height:500px){body.or-history-enabled #pi-history{bottom:42px}.or-history-enabled .pi-service-notice{bottom:3px;font-size:14px}.or-history-enabled .cosmos-bottom,.or-history-enabled .cosmos-personal-actions,.or-history-enabled #cosmos-return{bottom:115px}dialog:has(>#pi-history){padding-bottom:112px}}

body.or-history-enabled:not(.cosmos-mode) #pi-history,dialog:not(#cosmos-settings)>#pi-history{background:linear-gradient(transparent,#071b2bf0 55%)}
body.or-history-enabled:not(.cosmos-mode) .pi-service-notice,dialog:not(#cosmos-settings)>.pi-service-notice{background:#071b2bf0;border-radius:8px}
