/* SPAD 360 / V6: official IRANSans FaNum loaded from SPAD's existing font endpoint.
   This package deliberately does not redistribute the licensed font binaries.
   Server route: https://panel.spad.estate/api/virtual-tours/fonts/{weight}
   CORS: *; MIME: font/woff; CSP: font-src https://panel.spad.estate. */
@font-face{font-family:"SPAD-IRANSans-FaNum";src:url("https://panel.spad.estate/api/virtual-tours/fonts/ultralight") format("woff");font-style:normal;font-weight:100;font-display:swap}
@font-face{font-family:"SPAD-IRANSans-FaNum";src:url("https://panel.spad.estate/api/virtual-tours/fonts/light") format("woff");font-style:normal;font-weight:300;font-display:swap}
@font-face{font-family:"SPAD-IRANSans-FaNum";src:url("https://panel.spad.estate/api/virtual-tours/fonts/regular") format("woff");font-style:normal;font-weight:400;font-display:swap}
@font-face{font-family:"SPAD-IRANSans-FaNum";src:url("https://panel.spad.estate/api/virtual-tours/fonts/medium") format("woff");font-style:normal;font-weight:500;font-display:swap}
@font-face{font-family:"SPAD-IRANSans-FaNum";src:url("https://panel.spad.estate/api/virtual-tours/fonts/bold") format("woff");font-style:normal;font-weight:700;font-display:swap}
@font-face{font-family:"SPAD-IRANSans-FaNum";src:url("https://panel.spad.estate/api/virtual-tours/fonts/black") format("woff");font-style:normal;font-weight:900;font-display:swap}
/* Persian and UI copy use the official font in every viewport. */
:root{--font:"SPAD-IRANSans-FaNum",IRANSans,Tahoma,Arial,sans-serif}
html,body,button,input,textarea,select,option{font-family:var(--font)}
body,body *{font-family:var(--font)!important}

:root{color-scheme:dark;--blue:#138dd6;--bright:#59c7ff;--navy:#061c31;--ink:#061727;--line:rgba(160,216,250,.25);--glass:rgba(5,27,47,.83);--white:#f1f9ff;--muted:#a8c8df;--font:"SPAD-IRANSans-FaNum",IRANSans,Tahoma,Arial,sans-serif}
*{box-sizing:border-box}html,body,#app{width:100%;height:100%;margin:0;overflow:hidden}html{font-family:var(--font)}body{background:var(--ink);color:var(--white)}button,input,select{font:inherit}button{cursor:pointer;touch-action:manipulation}button:disabled{opacity:.4;cursor:not-allowed}button:focus-visible,input:focus-visible,select:focus-visible{outline:2px solid var(--bright);outline-offset:2px}button,a{-webkit-tap-highlight-color:transparent}.hidden{display:none!important}
#stage{position:fixed;inset:0;overflow:hidden;background:radial-gradient(circle at 55% 46%,#184c72 0%,#061a2d 65%,#041322 100%)}#stage:after{content:"";position:absolute;z-index:1;inset:0;pointer-events:none;background:linear-gradient(180deg,rgba(2,12,25,.55),transparent 24%,transparent 69%,rgba(2,13,24,.67))}#pano{position:absolute;inset:0;width:100%;height:100%;display:block;touch-action:none;cursor:grab;outline:none}#pano.dragging{cursor:grabbing}#linkLayer{position:absolute;inset:0;z-index:3;pointer-events:none}#sceneFade{position:absolute;inset:0;z-index:10;pointer-events:none;opacity:0;background:#061c31;transition:opacity .19s ease}#sceneFade.active{opacity:.82}
.glass{background:var(--glass);border:1px solid var(--line);-webkit-backdrop-filter:blur(20px);backdrop-filter:blur(20px);box-shadow:0 12px 32px rgba(0,7,22,.18)}.iconBtn{flex:none;width:37px;height:37px;border:1px solid rgba(152,214,251,.22);border-radius:11px;background:rgba(13,73,118,.25);color:#edf9ff;display:grid;place-items:center;transition:background .18s,border .18s}.iconBtn:hover:not(:disabled),.toolWithText:hover:not(:disabled){background:rgba(30,137,203,.4);border-color:#80d7ff}.iconBtn.active,.toolWithText.active{background:rgba(11,136,215,.55);border-color:#88d9ff}.iconBtn svg,.toolWithText svg{height:18px;width:18px;stroke-width:1.75}
#topbar{position:fixed;top:max(12px,env(safe-area-inset-top));left:17px;right:17px;z-index:12;display:flex;justify-content:space-between;align-items:flex-start;gap:12px;pointer-events:none}#topbar>*{pointer-events:auto}.brand{display:flex;align-items:center;gap:11px;padding:8px 13px;border-radius:16px;max-width:min(570px,68vw)}.brandMark{width:57px;height:53px;flex:none;border-radius:12px;border:1px solid rgba(211,242,255,.35);background:linear-gradient(145deg,#117cbf,#074276);display:flex;align-items:center;justify-content:center;flex-direction:column;direction:ltr}.brandMark b{font:800 18px/1 Arial;letter-spacing:1.7px}.brandMark span{font:700 8px/1.3 Arial;color:#cceeff;margin-top:5px}.brandCopy{min-width:0}.brandTag{display:block;color:#77d3ff;font-size:10px;font-weight:500;margin-bottom:3px}#tourTitle{display:block;font-size:14px;font-weight:650;line-height:1.55;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}#sceneSubtitle{font-size:10px;color:#aac7da;display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.topActions{display:flex;align-items:center;gap:5px;padding:7px;border-radius:14px}
#watermark{position:fixed;z-index:2;top:98px;left:18px;display:flex;align-items:baseline;gap:6px;pointer-events:none;direction:ltr;opacity:.68;text-shadow:0 2px 12px #000}#watermark b{font:800 19px Arial;letter-spacing:1.7px}#watermark span{font:700 9px Arial;letter-spacing:.7px;color:#b8e4ff}
.sceneInfo{position:fixed;z-index:5;right:17px;top:99px;display:flex;align-items:center;gap:8px;padding:7px 10px;border-radius:12px;pointer-events:none}.sceneInfo .sceneCounter{border-radius:8px;background:rgba(19,142,218,.27);color:#8bdaff;display:grid;place-items:center;padding:7px 9px;font-size:10px;white-space:nowrap}.sceneInfo b,.sceneInfo small{display:block}.sceneInfo b{font-size:11px;font-weight:600}.sceneInfo small{font-size:9px;color:#a8c9dd;margin-top:2px}
.dpad{position:fixed;z-index:8;right:18px;top:49%;transform:translateY(-50%);width:122px;height:122px;border-radius:23px;display:grid;grid-template:repeat(3,1fr)/repeat(3,1fr);gap:3px;padding:7px;direction:ltr}.dpad .iconBtn{width:100%;height:100%;border-radius:11px;touch-action:none}.dpad .up{grid-area:1/2}.dpad .left{grid-area:2/1}.dpad .center{grid-area:2/2;display:grid;place-items:center;color:#5fb3e8}.dpad .center svg{width:20px;height:20px}.dpad .right{grid-area:2/3}.dpad .down{grid-area:3/2}
.bottomBar{position:fixed;z-index:9;bottom:max(10px,env(safe-area-inset-bottom));left:17px;right:17px;display:flex;flex-direction:column;gap:7px}.filmstrip{height:84px;display:flex;gap:7px;align-items:center;padding:7px;border-radius:15px;overflow-x:auto;overscroll-behavior-inline:contain;scrollbar-width:thin;scrollbar-color:#4484ac transparent;white-space:nowrap}.stripHint{font-size:11px;color:#b9d8eb;padding:0 10px}.sceneCard{width:94px;min-width:94px;height:69px;padding:3px;background:#0d3655;border:1px solid #245c84;border-radius:10px;color:#effaff;display:flex;flex-direction:column;gap:3px;text-align:center;overflow:hidden}.sceneCard.active{border-color:#83daff;background:#106caa}.sceneCard img{width:100%;height:45px;object-fit:cover;border-radius:6px;display:block}.sceneCard span{font-size:9px;line-height:1.2;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;display:block}.toolbar{min-height:51px;padding:5px 7px;border-radius:15px;display:flex;align-items:center;justify-content:space-between;gap:9px;overflow-x:auto;scrollbar-width:none}.toolbar::-webkit-scrollbar{display:none}.toolGroup{display:flex;align-items:center;gap:4px;flex:none}.toolDivider{height:22px;width:1px;margin:0 5px;background:#2e5a77}.toolWithText{height:37px;min-width:63px;padding:0 9px;display:flex;align-items:center;justify-content:center;gap:5px;border-radius:10px;border:1px solid rgba(152,214,251,.22);background:rgba(13,73,118,.25);color:#eef9ff}.toolWithText b{font-size:10px;font-weight:550}.editButton{min-width:90px;background:linear-gradient(110deg,#0c65a7,#0e8ad2)}
.linkSpot{position:absolute;pointer-events:auto;display:flex;flex-direction:column;align-items:center;gap:6px;transform:translate(-50%,-48%);border:0;color:#fff;background:none;filter:drop-shadow(0 4px 8px #00152f);max-width:145px}.linkSpot .linkOrb{width:42px;height:42px;border:2px solid rgba(233,249,255,.95);display:grid;place-items:center;border-radius:50%;background:linear-gradient(130deg,#16a7ed,#07558c);box-shadow:0 0 0 6px rgba(27,140,211,.2)}.linkSpot .linkOrb svg{width:18px;height:18px}.linkSpot .linkLabel{max-width:142px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;font-size:10px;background:rgba(3,27,47,.87);border:1px solid rgba(163,218,247,.34);padding:5px 9px;border-radius:8px}.linkSpot:hover .linkOrb{background:#1cb6ff}.linkSpot.editor .linkOrb{background:#b57b20}
.welcome{position:fixed;inset:0;z-index:40;display:grid;place-items:center;padding:16px;background:rgba(2,14,29,.7);-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);transition:opacity .3s,visibility .3s}.welcome.dismissed{opacity:0;visibility:hidden;pointer-events:none}.welcomeCard{width:min(420px,100%);border-radius:22px;padding:25px 26px 20px;text-align:center;background:linear-gradient(145deg,rgba(9,53,91,.98),rgba(5,25,46,.98));border:1px solid rgba(156,223,255,.45);box-shadow:0 32px 95px rgba(0,7,23,.5)}.welcomeLogo{display:flex;align-items:baseline;justify-content:center;gap:6px;direction:ltr}.welcomeLogo b{font:900 32px Arial;letter-spacing:3px}.welcomeLogo span{font:700 13px Arial;color:#63c6ff}.welcomeTag{display:block;color:#88d5fa;font-size:10px;margin:10px 0 0}.welcomeCard h1{font-size:18px;line-height:1.9;margin:10px 0 3px;font-weight:650}.welcomeCard p{font-size:11px;line-height:2;color:#b5d1e2;margin:4px auto 18px;max-width:320px}.primaryBtn{width:100%;display:flex;align-items:center;justify-content:center;gap:10px;padding:11px 14px;min-height:45px;border-radius:11px;color:white;border:1px solid rgba(192,241,255,.5);background:linear-gradient(110deg,#168fda,#0764a6);font-size:12px;font-weight:600}.primaryBtn svg,.secondaryBtn svg{height:18px;width:18px}.welcomeCard .primaryBtn{margin:0 auto;max-width:280px}.welcomeCard small{display:block;font-size:9px;color:#84aac4;margin-top:17px}
.scrim{position:fixed;inset:0;z-index:29;background:rgba(0,9,20,.52);opacity:0;visibility:hidden;transition:opacity .22s,visibility .22s}.scrim.open{opacity:1;visibility:visible}.manager{position:fixed;top:0;right:0;bottom:0;z-index:30;width:min(394px,100vw);padding:21px 19px 16px;overflow-y:auto;overscroll-behavior:contain;background:linear-gradient(154deg,#0c3554,#061c31 60%,#041629);border-left:1px solid rgba(172,218,251,.28);transform:translateX(105%);transition:transform .26s ease;box-shadow:-22px 0 60px rgba(0,7,19,.38)}.manager.open{transform:translateX(0)}.managerHead{display:flex;justify-content:space-between;align-items:flex-start;gap:10px}.managerHead span{color:#7bd5ff;font-size:9px;letter-spacing:1.1px;direction:ltr;display:block}.managerHead h2{font-size:17px;margin:5px 0 2px}.managerHead small{font-size:10px;color:#aecddd}.managerTabs{display:flex;gap:5px;padding:5px;background:rgba(5,15,25,.35);border:1px solid rgba(178,225,255,.15);border-radius:13px;margin:20px 0 13px}.tab{flex:1;min-height:36px;color:#b4d3e8;font-size:11px;border:0;border-radius:9px;background:transparent}.tab.active{background:#116caa;color:white}.panelTab{min-height:120px}.panelTip{font-size:10px;line-height:2;color:#9ebfd3;margin:9px 0 15px}.managerPrimary{margin:9px 0}.roomList,.connectionList{display:flex;flex-direction:column;gap:7px;margin:12px 0}.roomItem,.connectionItem{display:flex;align-items:center;gap:10px;padding:8px;border:1px solid rgba(174,226,255,.18);border-radius:12px;background:rgba(255,255,255,.035)}.roomItem.active{border-color:#65cbff;background:rgba(16,112,175,.25)}.roomItem img{width:68px;height:45px;object-fit:cover;border-radius:8px}.roomItem .itemName{flex:1;text-align:right;min-width:0}.roomItem b,.connectionItem b{display:block;font-size:10px;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.roomItem small,.connectionItem small{display:block;font-size:9px;color:#a7cada;margin-top:4px}.miniControls{display:flex;gap:3px;flex:none}.miniControls button{width:27px;height:28px;background:#0c4268;color:#fff;border:1px solid #28719d;border-radius:7px;font-size:10px}.connectionItem{justify-content:space-between}.connectionItem .itemName{flex:1;min-width:0}.secondaryBtn{border:1px solid rgba(147,205,247,.32);background:rgba(18,83,128,.26);color:#e1f3ff;font-size:10px;padding:9px 12px;min-height:38px;width:100%;border-radius:10px;display:flex;align-items:center;justify-content:center;gap:8px;margin:7px 0}.secondaryBtn.danger{border-color:#a25f6e;color:#ffd7e0}.fieldLabel{font-size:10px;color:#c1e0ef;display:block;margin:14px 0 7px}.field{width:100%;min-height:40px;border-radius:10px;background:#103b59;border:1px solid #478ab1;color:white;padding:9px 12px;outline:none}.managerFooter{border-top:1px solid rgba(145,210,250,.15);margin-top:20px;padding-top:13px}.managerFooter #projectStatus{font-size:10px;color:#95bed7;line-height:2;display:block;text-align:center;margin-top:10px}
.emptyStage{position:absolute;inset:0;display:grid;place-items:center;pointer-events:none}.halo{position:absolute;width:55vmin;height:55vmin;border-radius:50%;background:radial-gradient(circle,#156caa55,#12508d18,transparent 70%);filter:blur(32px)}.gridSphere{position:absolute;width:42vmin;height:42vmin;border:1px solid #377ba34c;border-radius:50%;box-shadow:inset 0 0 0 1px #3784a42f,0 0 100px #0687cb19}.gridSphere:before,.gridSphere:after{content:"";position:absolute;inset:0;border:1px solid #3f8ab34c;border-radius:50%;transform:scaleX(.38)}.gridSphere:after{transform:scaleY(.38)}.emptyLetter{color:#9adfff55;font:800 clamp(35px,7vw,98px) Arial;letter-spacing:7px;direction:ltr}.emptyLetter span{font-size:.38em;letter-spacing:0}.loadOverlay{position:fixed;z-index:15;inset:0;display:flex;flex-direction:column;gap:12px;align-items:center;justify-content:center;background:rgba(2,13,25,.75);font-size:12px}.loaderSpin{width:30px;height:30px;border:3px solid #2875a1;border-top-color:#a9e8ff;border-radius:50%;animation:spin 1s linear infinite}@keyframes spin{to{transform:rotate(360deg)}}.toast{position:fixed;z-index:55;left:50%;top:85px;transform:translate(-50%,-10px);opacity:0;pointer-events:none;transition:opacity .2s,transform .2s;max-width:90vw;border:1px solid #4b9dc5;border-radius:11px;background:rgba(5,43,69,.97);padding:10px 14px;font-size:11px;text-align:center;box-shadow:0 10px 27px #0005}.toast.show{opacity:1;transform:translate(-50%,0)}
@media(max-width:1024px){#topbar{left:12px;right:12px}.bottomBar{left:12px;right:12px}.dpad{right:12px;width:111px;height:111px}.toolbar{gap:7px}.toolWithText{min-width:57px}#watermark{left:12px}.sceneInfo{right:12px}}
@media(min-width:701px) and (max-width:1024px){.bottomBar{bottom:12px}.filmstrip{height:76px}.sceneCard{width:84px;min-width:84px;height:62px}.sceneCard img{height:39px}.dpad{top:47%;width:108px;height:108px}.brand{max-width:calc(100vw - 170px)}.toolGroup{gap:3px}}
@media(max-width:700px){#topbar{top:max(7px,env(safe-area-inset-top));left:7px;right:7px;gap:5px}.brand{max-width:calc(100vw - 100px);gap:6px;padding:5px 7px;border-radius:12px}.brandMark{width:40px;height:40px;border-radius:9px}.brandMark b{font-size:13px}.brandMark span{font-size:7px}.brandTag{font-size:8px;margin:0}#tourTitle{font-size:10px}.brandCopy small{font-size:8px}.topActions{padding:4px;gap:3px;border-radius:11px}.topActions .iconBtn{width:32px;height:32px;border-radius:8px}.topActions .iconBtn svg{width:15px;height:15px}#watermark{top:auto;bottom:126px;left:10px}#watermark b{font-size:14px}#watermark span{font-size:7px}.sceneInfo{right:8px;top:66px;padding:5px 7px;gap:6px}.sceneInfo .sceneCounter{font-size:8px;padding:5px}.sceneInfo b{font-size:9px}.sceneInfo small{font-size:8px}.dpad{right:7px;top:46%;height:100px;width:100px;padding:5px;border-radius:17px;gap:2px}.dpad .iconBtn{border-radius:9px}.dpad .iconBtn svg{width:15px;height:15px}.dpad .center svg{height:14px;width:14px}.bottomBar{left:7px;right:7px;bottom:max(7px,env(safe-area-inset-bottom));gap:5px}.filmstrip{height:64px;border-radius:11px;padding:5px;gap:5px}.sceneCard{min-width:74px;width:74px;height:51px;padding:2px;border-radius:7px;gap:2px}.sceneCard img{height:32px;border-radius:5px}.sceneCard span{font-size:8px}.stripHint{font-size:9px}.toolbar{padding:4px;border-radius:11px;min-height:43px;gap:8px;justify-content:flex-start}.toolGroup{gap:4px}.iconBtn{width:31px;height:31px;border-radius:8px}.iconBtn svg,.toolWithText svg{width:15px;height:15px}.toolWithText{height:31px;min-width:49px;padding:0 6px;border-radius:8px}.toolWithText b{font-size:9px}.editButton{min-width:76px}.toolDivider{height:17px;margin:0 2px}.welcomeCard{max-width:360px;padding:21px 18px 18px;border-radius:19px}.welcomeLogo b{font-size:27px}.welcomeLogo span{font-size:11px}.welcomeTag{font-size:9px;margin-top:7px}.welcomeCard h1{font-size:15px;margin:7px 0 2px}.welcomeCard p{font-size:10px;margin:3px auto 14px}.welcomeCard small{margin-top:12px;font-size:8px}.welcomeCard .primaryBtn{min-height:42px;font-size:11px}.manager{width:min(370px,100vw);padding:14px}.managerHead h2{font-size:15px}.linkSpot .linkOrb{width:33px;height:33px}.linkSpot .linkLabel{font-size:8px;padding:4px 6px;max-width:94px}}
@media(max-width:375px){.brandCopy small{display:none}#tourTitle{font-size:9px}.dpad{top:44%;width:89px;height:89px}.editButton{min-width:70px}.manager{width:100vw}.toolWithText{min-width:44px;padding:0 5px}.toolGroup{gap:3px}}
@media(max-height:600px) and (min-width:701px){.dpad{top:43%}.bottomBar{bottom:7px}.filmstrip{height:65px}.sceneCard{height:49px}.sceneCard img{height:29px}.welcomeCard{padding:16px}.welcomeLogo b{font-size:25px}}
@media(prefers-reduced-motion:reduce){*,*:before,*:after{animation-duration:.01ms!important;transition-duration:.01ms!important;scroll-behavior:auto!important}}

/* v3 performance and mobile usability improvements */
#pano{image-rendering:auto;touch-action:none;}
#cpuPano{position:absolute;inset:0;width:100%;height:100%;z-index:0;pointer-events:none;display:none;}
#cpuPano.visible{display:block;}
.linkSpot .linkOrb{overflow:hidden;position:relative;isolation:isolate}
.linkSpot .linkOrb img{position:absolute;inset:1px;width:calc(100% - 2px);height:calc(100% - 2px);object-fit:cover;border-radius:50%;filter:saturate(1.08)}
.linkSpot .linkOrb:after{content:'›';position:absolute;z-index:1;right:-1px;bottom:-4px;border-radius:12px;background:#0873b7;color:white;font:700 17px/19px Tahoma;min-width:19px;height:19px;box-shadow:0 2px 7px #00152c}
.sceneInfo .sceneHeadingThumb{height:30px;width:42px;object-fit:cover;border-radius:6px;border:1px solid rgba(255,255,255,.3)}
body:not(.editMode) #openEdit,body:not(.editMode) .managerTabs,body:not(.editMode) #addPanoramas,
body:not(.editMode) #autoLink,body:not(.editMode) #connectionsTab,
body:not(.editMode) #settingsTab,body:not(.editMode) .managerFooter,
body:not(.editMode) .miniControls{display:none!important}
body:not(.editMode) .roomItem .itemName{cursor:pointer}
body:not(.editMode) .managerHead span{display:none}
body:not(.editMode) .managerHead{margin-bottom:19px}
.sceneCard:focus-visible,.linkSpot:focus-visible{outline:2px solid #96dfff;outline-offset:2px}
#pano,#cpuPano{backface-visibility:hidden}
.dpad{grid-template-columns:repeat(3,minmax(0,1fr));grid-template-rows:repeat(3,minmax(0,1fr))}
.dpad .iconBtn{min-width:0;min-height:0;width:100%;height:100%;padding:0}
body:not(.editMode) #roomsTab .panelTip{display:none}
body:not(.editMode) .roomItem{cursor:pointer}

@media (max-width:700px){
 #topbar{z-index:14}
 .dpad{top:43%;width:83px;height:83px;opacity:.82}
 .sceneInfo{top:62px;max-width:calc(100vw - 14px)}
 .filmstrip{height:77px}.sceneCard{min-width:86px;width:86px;height:63px}.sceneCard img{height:42px}
 .bottomBar{bottom:max(6px,env(safe-area-inset-bottom));}
 .toolbar{touch-action:pan-x}
 .linkSpot .linkOrb{width:38px;height:38px}
 .linkSpot .linkLabel{font-size:9px;max-width:110px}
}
@media (max-width:480px) and (orientation:portrait){
 .brandMark{width:37px;height:37px}.brand{max-width:calc(100vw - 100px)}
 .sceneInfo{top:59px}.dpad{right:7px;top:42%}
 .filmstrip{height:72px}.sceneCard{min-width:82px;width:82px;height:59px}.sceneCard img{height:38px}
 #watermark{bottom:132px}
}
@media (orientation:landscape) and (max-height:540px){
 #topbar{top:5px}.brand{padding:3px 6px}.brandMark{width:32px;height:32px}.brandTag,#sceneSubtitle{display:none}
 .sceneInfo{top:52px}.dpad{display:none}.filmstrip{height:59px}.sceneCard{width:76px;min-width:76px;height:49px}.sceneCard img{height:31px}
 .bottomBar{gap:3px}.toolbar{min-height:35px;padding:3px}.toolbar .iconBtn,.toolbar .toolWithText{height:28px}
 .welcomeCard{max-height:calc(100dvh - 18px);overflow:auto;padding:12px 19px}.welcomeCard h1{font-size:14px;margin:3px}.welcomeCard p{margin:2px auto 9px}.welcomeCard small{margin-top:7px}
 #watermark{bottom:96px}
}
@media (max-width:330px){.toolWithText b{font-size:8px}.brandMark{display:none}.topActions{gap:2px}}
@media (orientation:landscape) and (max-height:540px){.filmstrip{height:68px}.sceneCard{height:57px;min-height:57px}.sceneCard img{height:35px;flex:none}.sceneCard span{line-height:12px;flex:none}}

/* V7: never leave a black screen if panorama cannot be decoded. */
#panoRecovery{position:absolute;inset:0;display:none;align-items:center;justify-content:center;z-index:3;isolation:isolate;overflow:hidden;text-align:center;background:#06172c;color:#eef9ff;padding:18px}
#panoRecovery.visible{display:flex}
#panoRecovery>img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;filter:blur(18px) brightness(.32);z-index:-1;transform:scale(1.06)}
#panoRecovery>div{background:#072b49ec;border:1px solid #70b6df80;border-radius:17px;padding:22px 24px;max-width:min(90vw,420px);box-shadow:0 15px 60px #0006}
#panoRecovery strong{font-size:15px;display:block;margin-bottom:11px}
#panoRecovery p{font-size:11px;line-height:1.8;margin-bottom:16px}
#panoRecovery button{background:#176bb8;border:1px solid #58b9ff;color:#fff;padding:9px 28px;border-radius:9px;cursor:pointer}

/* V8 layout refinement — improved button positioning and cleaner visual hierarchy */
#topbar{
  align-items:flex-start;
}
.brand{
  box-shadow:0 14px 36px rgba(0,10,28,.22);
}
.topActions{
  position:relative;
  z-index:2;
}
.sceneInfo{
  top:96px;
  right:18px;
  min-width:170px;
  max-width:min(320px,34vw);
  padding:8px 11px;
  box-shadow:0 12px 28px rgba(0,8,24,.2);
}

/* Move direction pad closer to main controls instead of floating mid-screen */
.dpad{
  top:auto;
  bottom:128px;
  right:18px;
  transform:none;
  width:108px;
  height:108px;
  padding:6px;
  border-radius:21px;
  background:rgba(6,35,61,.86);
  box-shadow:0 14px 34px rgba(0,9,28,.28);
}

.bottomBar{
  align-items:center;
  gap:8px;
}
.filmstrip,
.toolbar{
  width:min(1280px,100%);
  margin-inline:auto;
}
.filmstrip{
  justify-content:flex-start;
  padding-inline:10px;
}
.toolbar{
  justify-content:center;
  padding:7px 10px;
  gap:12px;
}
.toolGroup{
  gap:6px;
}
.toolWithText{
  min-width:72px;
}
.editButton{
  min-width:96px;
}

/* Keep the watermark above controls cleanly */
#watermark{
  bottom:138px;
}

@media (min-width:701px){
  .toolbar{
    overflow-x:visible;
    flex-wrap:wrap;
  }
}

@media (max-width:1024px){
  .sceneInfo{
    top:88px;
    right:12px;
    min-width:156px;
    max-width:220px;
  }
  .dpad{
    right:12px;
    bottom:118px;
    width:96px;
    height:96px;
  }
  .toolbar{
    gap:9px;
  }
}

@media (max-width:700px){
  #topbar{
    align-items:flex-start;
  }
  .sceneInfo{
    top:63px;
    right:8px;
    min-width:0;
    max-width:185px;
    padding:6px 8px;
  }
  .bottomBar{
    gap:6px;
  }
  .filmstrip,
  .toolbar{
    width:100%;
  }
  .filmstrip{
    height:72px;
    padding-inline:6px;
  }
  .toolbar{
    justify-content:flex-start;
    padding:5px 6px;
    gap:8px;
  }
  .toolGroup{
    gap:4px;
  }
  .dpad{
    right:8px;
    bottom:110px;
    top:auto;
    width:82px;
    height:82px;
    padding:4px;
    border-radius:16px;
    opacity:.95;
  }
  #watermark{
    bottom:118px;
  }
}

@media (max-width:480px) and (orientation:portrait){
  .brand{
    max-width:calc(100vw - 92px);
  }
  .sceneInfo{
    top:58px;
    max-width:170px;
  }
  .dpad{
    bottom:104px;
    width:76px;
    height:76px;
  }
  #watermark{
    bottom:110px;
  }
}

@media (orientation:landscape) and (max-height:540px){
  .sceneInfo{
    top:48px;
    right:8px;
    max-width:155px;
  }
  .dpad{
    display:grid;
    bottom:80px;
    right:8px;
    width:72px;
    height:72px;
    padding:3px;
    border-radius:14px;
  }
  .filmstrip{
    height:62px;
  }
  .toolbar{
    min-height:38px;
    padding:4px 5px;
    gap:6px;
  }
  #watermark{
    bottom:84px;
  }
}

/* Zagros 2: maintain safe space for controls around filmstrip */
@media(min-width:800px){.filmstrip{justify-content:center}.dpad{bottom:170px}}
@media(max-width:799px) and (orientation:portrait){.dpad{bottom:calc(max(6px,env(safe-area-inset-bottom)) + 143px)}}
@media(max-height:540px) and (orientation:landscape){.dpad{bottom:112px}}

/* SPAD_TOUR_FRAME_V5 */
html.spadFrame #watermark,html.spadFrame .brand{display:none!important}
html.spadFrame #topbar{position:fixed!important;top:max(10px,env(safe-area-inset-top))!important;left:10px!important;right:10px!important;bottom:auto!important;display:flex!important;flex-direction:row!important;justify-content:space-between!important;align-items:flex-start!important;gap:8px!important;z-index:14!important;pointer-events:none!important}
html.spadFrame #topbar>*{pointer-events:auto}
html.spadFrame #sceneInfo{position:static!important;inset:auto!important;transform:none!important;margin:0!important;min-width:0!important;max-width:min(300px,62vw)!important;display:flex!important;align-items:center!important;gap:9px!important;padding:5px 5px 5px 13px!important;border-radius:13px!important;background:rgba(5,24,44,.72)!important;border:1px solid rgba(255,255,255,.14)!important;box-shadow:none!important;pointer-events:none!important}
html.spadFrame #sceneInfo.hidden{display:none!important}
html.spadFrame #sceneInfo .sceneCounter,html.spadFrame #sceneInfo .sceneHeadingThumb{display:none!important}
html.spadFrame #sceneInfo>div{min-width:0}
html.spadFrame #sceneInfo b{display:block!important;font-size:12.5px!important;font-weight:500!important;line-height:1.6!important;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
html.spadFrame #sceneInfo small{display:block!important;margin:0!important;font-size:10.5px!important;color:#a9c6e2!important;white-space:nowrap}
html.spadFrame .spadChipImg{flex:none;width:34px;height:34px;border-radius:9px;object-fit:cover;border:1px solid rgba(255,255,255,.35)}
html.spadFrame .topActions{display:flex!important;gap:6px!important;padding:0!important;border:0!important;background:none!important;box-shadow:none!important;-webkit-backdrop-filter:none!important;backdrop-filter:none!important}
html.spadFrame .topActions .iconBtn{width:44px!important;min-width:44px!important;height:44px!important;padding:0!important;border-radius:13px!important;border:1px solid rgba(255,255,255,.14)!important;background:rgba(5,24,44,.72)!important;color:#fff!important;display:inline-flex!important;align-items:center!important;justify-content:center!important;gap:7px!important}
html.spadFrame .topActions .spadSpaces{width:auto!important;padding:0 13px!important}
html.spadFrame .topActions .spadSpaces b{font-size:12px!important;font-weight:400!important}
html.spadFrame .topActions svg{width:16px!important;height:16px!important}
html.spadFrame.spadEmbedded #topFullscreen{display:none!important}
html.spadFrame .bottomBar{position:fixed!important;top:auto!important;left:10px!important;right:10px!important;bottom:max(10px,env(safe-area-inset-bottom))!important;display:flex!important;flex-direction:column!important;align-items:stretch!important;gap:8px!important;z-index:9!important;pointer-events:none!important}
html.spadFrame .bottomBar>*,html.spadFrame .spadUpper>*{pointer-events:auto}
html.spadFrame .spadUpper{display:flex;align-items:flex-end;gap:8px;width:100%;min-width:0;pointer-events:none}
html.spadFrame #filmstrip{flex:1 1 auto!important;min-width:0!important;width:auto!important;height:auto!important;margin:0!important;padding:6px!important;gap:6px!important;border-radius:13px!important;background:rgba(5,24,44,.72)!important;border:1px solid rgba(255,255,255,.14)!important}
html.spadFrame .sceneCard{width:112px!important;min-width:112px!important;height:auto!important;padding:0!important;gap:0!important;border-radius:9px!important;background:#0b2a48!important;border:1px solid rgba(255,255,255,.12)!important;overflow:hidden!important}
html.spadFrame .sceneCard.active{border-color:#38a8ff!important;box-shadow:0 0 0 1px #38a8ff!important}
html.spadFrame .sceneCard img{height:58px!important;border-radius:0!important}
html.spadFrame .sceneCard span{font-size:10.5px!important;line-height:1.5!important;padding:3px 7px!important;text-align:right!important;color:#d6e6f5!important}
html.spadFrame .dpad{position:relative!important;inset:auto!important;transform:none!important;flex:none!important;margin:0 auto 0 0!important;width:92px!important;height:92px!important;padding:7px!important;gap:2px!important;border-radius:50%!important;opacity:1!important;display:grid!important;grid-template:repeat(3,minmax(0,1fr))/repeat(3,minmax(0,1fr))!important;background:rgba(5,24,44,.72)!important;border:1px solid rgba(255,255,255,.14)!important;box-shadow:none!important}
html.spadFrame .dpad .iconBtn{width:100%!important;height:100%!important;min-width:0!important;min-height:0!important;padding:0!important;border:0!important;border-radius:50%!important;background:rgba(255,255,255,.08)!important}
html.spadFrame .dpad .iconBtn svg{width:14px!important;height:14px!important}
html.spadFrame .dpad .center{display:grid!important;place-items:center!important}
html.spadFrame .dpad .center svg{display:none!important}
html.spadFrame .dpad .center:after{content:"";width:12px;height:12px;border-radius:50%;background:#0984e3}
html.spadFrame .toolbar{position:relative!important;width:100%!important;margin:0!important;min-height:0!important;padding:5px!important;border-radius:14px!important;display:flex!important;flex-wrap:nowrap!important;justify-content:space-between!important;align-items:center!important;gap:6px!important;overflow:visible!important;background:rgba(5,24,44,.72)!important;border:1px solid rgba(255,255,255,.14)!important}
html.spadFrame .toolbar .toolGroup{display:flex!important;align-items:center!important;gap:4px!important;flex:none!important}
html.spadFrame .toolbar .iconBtn,html.spadFrame .toolbar .toolWithText{width:auto!important;min-width:36px!important;height:36px!important;padding:0 9px!important;border-radius:10px!important;border:0!important;background:rgba(255,255,255,.07)!important;color:#e6f1fb!important;display:inline-flex!important;align-items:center!important;justify-content:center!important;gap:6px!important}
html.spadFrame .toolbar .iconBtn.active{background:rgba(56,168,255,.24)!important;color:#9fd6ff!important}
html.spadFrame .toolbar #nextScene{background:linear-gradient(135deg,#0984e3,#0569c7)!important;color:#fff!important}
html.spadFrame .toolbar svg{width:16px!important;height:16px!important;flex:none}
html.spadFrame .toolbar b,html.spadFrame .spadLabelWide,html.spadFrame .spadLabelMenu{font-size:12px!important;font-weight:400!important;white-space:nowrap}
html.spadFrame .spadLabelMenu{display:none}
html.spadFrame .spadCount{padding:0 4px;color:#a9c6e2;font-size:11.5px;white-space:nowrap}
html.spadFrame .spadExtra{display:contents}
html.spadFrame .toolbar .spadMoreBtn{display:none!important}
@media(max-width:700px){
html.spadFrame #topbar{left:8px!important;right:8px!important;top:max(8px,env(safe-area-inset-top))!important}
html.spadFrame .bottomBar{left:8px!important;right:8px!important;bottom:max(8px,env(safe-area-inset-bottom))!important;gap:6px!important}
html.spadFrame #sceneInfo{max-width:calc(100vw - 132px)!important}
html.spadFrame .topActions .iconBtn{height:42px!important;width:42px!important;min-width:42px!important}
html.spadFrame .topActions .spadSpaces{width:auto!important;padding:0 12px!important}
html.spadFrame .sceneCard{width:88px!important;min-width:88px!important}
html.spadFrame .sceneCard img{height:44px!important}
html.spadFrame .dpad{width:80px!important;height:80px!important;padding:6px!important}
html.spadFrame .toolbar{padding:4px!important;gap:4px!important}
html.spadFrame .toolbar .toolGroup{gap:3px!important}
html.spadFrame .toolbar .iconBtn,html.spadFrame .toolbar .toolWithText{width:34px!important;min-width:34px!important;height:34px!important;padding:0!important}
html.spadFrame .toolbar b,html.spadFrame .spadLabelWide{display:none!important}
html.spadFrame .toolbar .spadMoreBtn{display:inline-flex!important}
html.spadFrame .spadExtra{display:none;position:absolute;left:4px;bottom:calc(100% + 8px);z-index:20;min-width:176px;flex-direction:column;gap:3px;padding:6px;border-radius:13px;background:rgba(5,24,44,.94);border:1px solid rgba(255,255,255,.14)}
html.spadFrame .spadExtra.open{display:flex}
html.spadFrame .spadExtra .iconBtn{width:100%!important;min-width:0!important;height:38px!important;padding:0 10px!important;justify-content:flex-start!important;gap:9px!important}
html.spadFrame .spadExtra .spadLabelMenu{display:inline!important}
}
@media(max-width:360px){html.spadFrame .spadCount{display:none}}
@media(max-height:519px){html.spadFrame #filmstrip{display:none!important}}
@media(max-height:329px){html.spadFrame .dpad{display:none!important}}