:root{--bsttv-r4r10a1-css-ready:1}
/* R4R10A1. Opt-in after JS initialization. No global theme, route or tracker changes. */
body.r4r10-enhanced{--r4r10-top:0px;--r4r10-bottom:0px;--r4r10-height:100dvh;--r4r10-worktop:158px}
body.r4r10-enhanced .r3r1-day-switch{top:calc(var(--r4r10-top) + 8px);width:min(670px,calc(100vw - 20px));box-sizing:border-box;max-width:none;z-index:1102;padding:4px;min-height:50px}
body.r4r10-enhanced .r3r1-day-button{min-height:44px;font-size:13px}
.r4r10-ribbon{position:fixed;left:50%;transform:translateX(-50%);width:min(670px,calc(100vw - 20px));box-sizing:border-box;z-index:1101;padding:7px 10px;background:rgba(17,35,56,.95);color:#f8fafc;border-radius:13px;box-shadow:0 5px 20px #0003;font:13px/1.35 -apple-system,BlinkMacSystemFont,"Segoe UI","Microsoft JhengHei",sans-serif}
.r4r10-mode{font-size:11px;color:#fde68a;margin:0 0 3px;overflow-wrap:anywhere}
.r4r10-sequence{margin:0 0 4px;font-weight:750;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.r4r10-actions{display:flex;gap:5px;flex-wrap:wrap}
.r4r10-ribbon .r4r10-actions{display:grid;grid-template-columns:repeat(4,minmax(0,1fr))}
.r4r10-actions button,.r4r10-panel button,.r4r10-info .r4r10-panel-head button{font:inherit;min-height:44px;min-width:44px;border:1px solid #94a3b8;border-radius:9px;background:#fff;color:#172033;padding:7px 9px;cursor:pointer;line-height:1.35;overflow-wrap:anywhere}
.r4r10-ribbon button{background:#f8fafc;border-color:#d5dce5;font-size:12px;font-weight:650}
.r4r10-ribbon [data-r4r10-action="guide"]{background:#fbbf24;border-color:#fbbf24;color:#172033}
.r4r10-live-status{font-size:11px;margin:4px 0 0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.r4r10-action-status{font-size:12px;color:#fde68a;margin:4px 0 0;max-height:3.6em;overflow:auto}
.r4r10-action-status:empty{display:none}
.r4r10-panel[hidden],.r4r10-info[hidden]{display:none!important}
.r4r10-panel,.r4r10-info{position:fixed;z-index:1150;top:var(--r4r10-worktop);bottom:calc(var(--r4r10-bottom) + 14px);left:10px;width:min(350px,calc(100vw - 135px));display:flex;flex-direction:column;background:#f8fafc;color:#172033;border:1px solid #b9c6d5;border-radius:15px;box-shadow:0 10px 32px #0004;overflow:hidden;box-sizing:border-box;font:14px/1.5 -apple-system,BlinkMacSystemFont,"Segoe UI","Microsoft JhengHei",sans-serif}
.r4r10-panel-head{display:flex;align-items:center;justify-content:space-between;gap:8px;background:#13233b;color:#fff;padding:8px 12px;flex:0 0 auto}
.r4r10-panel-head h2{margin:0;font-size:18px;line-height:1.25}
.r4r10-panel .r4r10-panel-head button,.r4r10-info .r4r10-panel-head button{font-size:12px;color:#fff;background:#233e59;border-color:#a0b2c8;padding:5px 10px}
.r4r10-tabs,.r4r10-phases{display:flex;gap:6px;padding:7px 10px 0;flex:0 0 auto}
.r4r10-phases:empty{display:none}
.r4r10-tabs button,.r4r10-phases button{flex:1;padding:5px;font-size:12px}
.r4r10-tabs button[aria-pressed="true"],.r4r10-phases button[aria-pressed="true"]{background:#13233b;color:#fff}
.r4r10-panel-content,.r4r10-info-content{overflow:auto;overscroll-behavior:contain;padding:8px 12px 16px;min-height:0;flex:1 1 auto;scrollbar-gutter:stable}
.r4r10-hint{font-size:12px;color:#4b5a70;margin:4px 0 10px}
.r4r10-warning{font-size:13px;background:#fff6da;border-left:3px solid #c5780a;padding:10px;margin:6px 0}
.r4r10-count{font-size:12px;color:#526075;margin:5px 0}
.r4r10-list{padding-left:24px;margin:7px 0 12px}
.r4r10-list li{padding:3px 0 5px}.r4r10-list li::marker{font-size:12px;color:#8b3615;font-weight:750}
.r4r10-list button{width:100%;display:flex;align-items:flex-start;flex-wrap:wrap;text-align:left;gap:4px;background:#fff;border-color:#ced8e4;padding:8px}
.r4r10-list button strong{font-size:14px}.r4r10-list button small{display:block;flex-basis:100%;font-size:11px;color:#536074}
.r4r10-list button[aria-pressed="true"]{border:2px solid #a14620;background:#fff6eb}
.r4r10-list button:disabled{cursor:default;background:#eef2f6;color:#5b6573;border-style:dashed}
.r4r10-tag{border-radius:6px;background:#e7eef5;font-size:10px;padding:1px 4px}
.r4r10-selected{padding:10px;border:1px solid #daae7c;border-radius:9px;background:#fff8ef}
.r4r10-selected p{margin:5px 0;font-size:12px}.r4r10-selected .r4r10-excerpt{color:#536074}
.r4r10-check{display:flex;gap:8px;align-items:center;min-height:44px;font-size:13px}.r4r10-check input{width:20px;height:20px}
.r4r10-panel button:focus-visible,.r4r10-info button:focus-visible,.r4r10-ribbon button:focus-visible,.r4r10-panel-content:focus-visible,.r4r10-info-content:focus-visible{outline:3px solid #c2410c;outline-offset:-3px}
body.r4r10-enhanced .rightTools{top:var(--r4r10-worktop);bottom:auto;right:8px;display:grid;grid-template-columns:repeat(2,46px);gap:5px;max-height:calc(100dvh - var(--r4r10-bottom) - var(--r4r10-worktop) - 12px);overflow:auto;padding:3px;z-index:1110}
body.r4r10-enhanced .tool-btn{width:46px;height:48px;min-height:44px;border-radius:13px;gap:2px;flex-shrink:0}
body.r4r10-enhanced .tool-btn-icon{font-size:19px}.r4r10-enhanced .tool-btn-label{font-size:9px;line-height:1.15}
body.r4r10-enhanced .leftNav{top:auto;bottom:calc(var(--r4r10-bottom) + 18px);left:auto;right:115px;gap:5px;z-index:1110}
body.r4r10-enhanced .nav-card{width:48px;height:52px;border-radius:13px}.r4r10-enhanced .nav-card-icon{font-size:20px}
body.r4r10-enhanced .nav-card-label{font-size:10px}
body.r4r10-enhanced .lockNotice{top:var(--r4r10-top);max-width:80vw;white-space:normal;z-index:1190}
/* Retain the original info elements and their handlers, but let users expand them. */
.r4r10-info-content .topbar,.r4r10-info-content .marquee-wrap,.r4r10-info-content .r3r1-route-note,.r4r10-info-content .bottomPanel{position:static!important;transform:none!important;width:100%!important;max-width:100%!important;box-sizing:border-box;pointer-events:auto}
.r4r10-info-content .topbar{padding:12px 10px;background:#23344e;border-radius:10px}
.r4r10-info-content .topline{font-size:14px}.r4r10-info-content .meta-line{font-size:12px;justify-content:flex-start;gap:6px;line-height:1.45}
.r4r10-info-content .phase-pill{font-size:12px}.r4r10-info-content .marquee-wrap{margin:10px 0}
.r4r10-info-content .marquee{font-size:12px;white-space:normal;border-radius:10px}.r4r10-info-content .marquee-track{animation:none;padding-left:0}
.r4r10-info-content .r3r1-route-note{font-size:12px;line-height:1.5;margin-bottom:10px}
.r4r10-info-content .bottomPanel{padding:7px;background:#17263e;border-radius:10px}
.r4r10-info-content .bottomGrid{grid-template-columns:repeat(2,minmax(0,1fr));gap:7px}
.r4r10-info-content .metricCard{padding:8px;min-height:64px}.r4r10-info-content .metricTitle{font-size:11px}.r4r10-info-content .metricValue{font-size:17px}.r4r10-info-content .metricSub{font-size:11px;line-height:1.4}
.r4r10-info-content .actionCard{display:flex;flex-direction:column;min-height:65px;padding:8px;font-size:14px;line-height:1.4}.r4r10-info-content .actionCard small{font-size:11px;line-height:1.4}
body.r4r10-enhanced .r4r9-overlay{top:var(--r4r10-top);bottom:var(--r4r10-bottom);padding:8px}
body.r4r10-enhanced .r4r9-dialog{max-height:100%;height:auto;min-height:0}
body.r4r10-enhanced .r4r9-header{padding:8px 14px}.r4r10-enhanced .r4r9-header h2{font-size:18px}
body.r4r10-enhanced .r4r9-close{width:44px;height:44px}.r4r10-enhanced .r4r9-dates{padding:8px 14px 5px}
body.r4r10-enhanced .r4r9-content{min-height:0}
body.r4r10-enhanced .leaflet-bottom{bottom:var(--r4r10-bottom)}
.r4r10-direction-icon{pointer-events:none!important;background:none;border:0}
.r4r10-arrow-glyph{width:22px;height:22px;display:block;line-height:22px;text-align:center;font-size:22px;color:#8d2e05;text-shadow:0 1px 2px #fff,0 -1px 2px #fff,1px 0 2px #fff,-1px 0 2px #fff;transform-origin:50% 50%}
body.r4r10-outside-view .r4r10-ribbon,body.r4r10-outside-view .r4r10-panel,body.r4r10-outside-view .r4r10-info,body.r4r10-outside-view .rightTools,body.r4r10-outside-view .leftNav,body.r4r10-outside-view .r3r1-day-switch{visibility:hidden}
@media(max-width:650px){
 .r4r10-panel,.r4r10-info{top:auto;left:8px;width:calc(100vw - 16px);bottom:calc(var(--r4r10-bottom) + 10px);max-height:calc(var(--r4r10-height) * .54);height:calc(var(--r4r10-height) * .54)}
 .r4r10-panel-head{padding:6px 10px}.r4r10-panel-head h2{font-size:16px}
 .r4r10-tabs,.r4r10-phases{padding:5px 8px 0;gap:5px}.r4r10-panel-content{padding:6px 10px 12px}
 .r4r10-ribbon{padding:6px 8px}.r4r10-mode{font-size:10px}.r4r10-actions button{font-size:11px;padding:5px 3px}
 .r4r10-sequence{font-size:12px}.r4r10-live-status{font-size:10px}.r4r10-action-status{font-size:11px}
 body.r4r10-enhanced .r3r1-day-button{font-size:11px;padding:5px 3px}
 body.r4r10-panel-open .rightTools,body.r4r10-info-open .rightTools{grid-template-columns:repeat(3,44px);right:8px;gap:3px}
 body.r4r10-panel-open .tool-btn,body.r4r10-info-open .tool-btn{width:44px;height:44px}
 body.r4r10-panel-open .leftNav,body.r4r10-info-open .leftNav{bottom:auto;top:var(--r4r10-worktop);left:8px;right:auto}
 body.r4r10-short .r4r10-panel,body.r4r10-short .r4r10-info{top:var(--r4r10-worktop);bottom:calc(var(--r4r10-bottom) + 10px);width:calc(100vw - 124px);height:auto;max-height:none}
 body.r4r10-short .rightTools{grid-template-columns:repeat(2,44px);right:8px}
 body.r4r10-short.r4r10-panel-open .leftNav,body.r4r10-short.r4r10-info-open .leftNav{left:auto;right:8px;top:auto;bottom:calc(var(--r4r10-bottom) + 12px)}
 body.r4r10-short .r4r10-phases{flex-wrap:wrap}.r4r10-short .r4r10-panel-head h2{font-size:14px}
}
@media(prefers-reduced-motion:reduce){.r4r10-ribbon *,.r4r10-panel *,.r4r10-info *{scroll-behavior:auto}}

body.r4r10-short .r4r10-panel-head{padding:2px 8px}
body.r4r10-short .r4r10-tabs{padding-top:3px}
body.r4r10-short .r4r10-panel-content>.r4r10-phases{padding:0 0 6px}

/* R4R10A1R1: mobile sheets share the viewport with the map and its existing tools. */
:root{--bsttv-r4r10a1r1-layout-ready:1}
.r4r10-panel [hidden],.r4r10-info [hidden]{display:none!important}
.r4r10-peek-note{margin:0;padding:3px 10px 7px;font-size:11px;line-height:1.35;color:#4b5a70}
@media(max-width:650px){
 body.r4r10-mobile-sheet .r4r10-ribbon .r4r10-sequence,
 body.r4r10-mobile-sheet .r4r10-ribbon>.r4r10-actions{display:none}
 body.r4r10-mobile-sheet .r4r10-ribbon{padding:5px 8px}
 body.r4r10-mobile-sheet .r4r10-mode{margin:0;font-size:10px}
 body.r4r10-mobile-sheet .r4r10-live-status{margin-top:2px}
 body.r4r10-mobile-sheet .r4r10-action-status{font-size:10px;max-height:2.8em;line-height:1.3;margin-top:2px}
 body.r4r10-mobile-sheet .r4r10-panel,body.r4r10-mobile-sheet .r4r10-info{
   top:auto;left:8px;width:calc(100vw - 16px);bottom:calc(var(--r4r10-bottom) + 22px);
   height:var(--r4r10-sheet-height,200px);max-height:var(--r4r10-sheet-height,200px)
 }
 body.r4r10-mobile-sheet .rightTools{top:var(--r4r10-worktop);bottom:auto;right:8px;grid-template-columns:repeat(2,44px);gap:4px;padding:3px;
   max-height:calc(100dvh - var(--r4r10-tools-bottom,0px) - var(--r4r10-worktop));overflow:auto}
 body.r4r10-mobile-sheet .leftNav{top:var(--r4r10-worktop);bottom:auto;left:8px;right:auto}
 body.r4r10-mobile-sheet .tool-btn{width:44px;height:44px;min-height:44px}
 body.r4r10-mobile-sheet .r4r10-panel-head{padding:4px 8px;gap:6px;min-height:52px;box-sizing:border-box}
 body.r4r10-mobile-sheet .r4r10-panel-head h2{min-width:0;flex:1;font-size:15px;overflow-wrap:anywhere}
 body.r4r10-mobile-sheet .r4r10-panel-head button{flex:0 0 auto;max-width:92px;min-height:44px}
 body.r4r10-mobile-sheet .r4r10-panel-content,body.r4r10-mobile-sheet .r4r10-info-content{-webkit-overflow-scrolling:touch;touch-action:pan-y}
 body.r4r10-sheet-peek #r4r10Panel>.r4r10-tabs,
 body.r4r10-sheet-peek #r4r10Panel>.r4r10-phases,
 body.r4r10-sheet-peek #r4r10Panel>.r4r10-panel-content{display:none}
 body.r4r10-sheet-peek #r4r10Panel{height:auto;max-height:112px}
 body.r4r10-sheet-peek #r4r10Panel .r4r10-panel-head h2{font-size:14px;max-height:3em;overflow:auto}
 /* Short visible frames use a side lane so the toolbar is never behind the sheet. */
 body.r4r10-sheet-side .r4r10-panel,body.r4r10-sheet-side .r4r10-info{
   top:var(--r4r10-worktop);bottom:calc(var(--r4r10-bottom) + 22px);left:8px;width:calc(100vw - 124px);height:auto;max-height:none
 }
 body.r4r10-sheet-side .leftNav{left:auto;right:8px;top:auto;bottom:calc(var(--r4r10-bottom) + 22px)}
}
