:root{
  --accent:#3a63ff;
  --paper:#f4f6f9; --paper-2:#e5e9f1; --ink:#10182b; --ink-2:#4a5470; --line:#d0d7e3; --field:#ffffff;
  --glass:rgba(10,15,30,.58); --glass-line:rgba(255,255,255,.18);
  --font-display:'Bricolage Grotesque',system-ui,-apple-system,'Segoe UI',sans-serif;
  --font-body:'Figtree',system-ui,-apple-system,'Segoe UI',sans-serif;
  box-sizing:border-box;
  padding-top:env(safe-area-inset-top,0px);
  padding-bottom:env(safe-area-inset-bottom,0px);
}
@media (prefers-color-scheme: dark){
  :root:not([data-theme="light"]){ --paper:#161b29; --paper-2:#1f2536; --ink:#e9edf7; --ink-2:#9aa4be; --line:#2c3450; --field:#0f1420; }
}
:root[data-theme="dark"]{ --paper:#161b29; --paper-2:#1f2536; --ink:#e9edf7; --ink-2:#9aa4be; --line:#2c3450; --field:#0f1420; }
html{ scroll-padding-top:env(safe-area-inset-top,0px); }
html,body{ height:100%; margin:0; background:#0a0f1e; overflow:hidden; font-family:var(--font-body); color:#fff; -webkit-font-smoothing:antialiased; }
*,*::before,*::after{ box-sizing:inherit; }
[hidden]{ display:none !important; }
button,input,select,textarea{ font:inherit; color:inherit; }
button{ cursor:pointer; }
:focus-visible{ outline:2px solid var(--accent); outline-offset:2px; }

#stage{ position:fixed; inset:0; touch-action:none; cursor:grab; background:#0a0f1e; }
#stage canvas{ display:block; width:100%; height:100%; }
#stage canvas.t360-flares{ position:absolute; inset:0; pointer-events:none; }
.flare-dot{ box-shadow:0 0 8px 2px rgba(255,220,150,.7); }
.flare-item .field{ margin-bottom:8px; }
#stage.grabbing{ cursor:grabbing; }
#stage.pointing{ cursor:pointer; }
body.placing #stage{ cursor:crosshair; }
#fade{ position:fixed; inset:0; background:#0a0f1e; opacity:0; pointer-events:none; transition:opacity .34s ease; z-index:5; }
#fade.on{ opacity:1; }

.glass{ background:var(--glass); border:1px solid var(--glass-line); -webkit-backdrop-filter:blur(14px); backdrop-filter:blur(14px); border-radius:var(--r, 14px); color:var(--glass-ink, #fff); }

/* title card */
.title-card{ position:fixed; left:16px; top:calc(14px + env(safe-area-inset-top,0px)); max-width:min(430px, calc(100vw - 32px - 320px)); padding:14px 16px 15px; z-index:3; }
.brand{ display:flex; align-items:center; gap:8px; font-family:var(--font-display); font-weight:500; font-size:14px; opacity:.85; }
.brand svg{ width:18px; height:18px; stroke:currentColor; fill:none; stroke-width:1.6; }
.title-card h1{ margin:8px 0 0; font-family:var(--font-display); font-weight:700; font-size:clamp(22px,2.6vw,30px); line-height:1.08; letter-spacing:-.01em; }
.title-card .meta{ margin:6px 0 0; font-size:13px; opacity:.78; }
.title-card .desc{ margin:8px 0 0; font-size:14px; line-height:1.45; max-width:52ch; opacity:.92; }

/* toolbar */
.toolbar{ position:fixed; right:16px; top:calc(14px + env(safe-area-inset-top,0px)); display:flex; gap:8px; z-index:3; align-items:center; }
.tbtn{ height:42px; min-width:42px; padding:0 11px; display:inline-flex; align-items:center; justify-content:center; gap:8px; border-radius:var(--r-btn, 12px); background:var(--glass); border:1px solid var(--glass-line); -webkit-backdrop-filter:blur(14px); backdrop-filter:blur(14px); color:var(--glass-ink, #fff); }
.tbtn:hover{ box-shadow:inset 0 0 0 100px var(--glass-soft, rgba(255,255,255,.08)); }
.tbtn[aria-pressed="true"]{ border-color:var(--accent); box-shadow:inset 0 0 0 1px var(--accent); }
.tbtn svg{ width:20px; height:20px; stroke:currentColor; fill:none; stroke-width:1.7; stroke-linecap:round; stroke-linejoin:round; }
.tbtn.accent{ background:var(--accent); border-color:transparent; font-weight:600; font-size:14px; color:#fff; }
.tbtn.accent:hover{ filter:brightness(1.08); background:var(--accent); }

/* radar */
.side-stack{ position:fixed; right:16px; top:calc(68px + env(safe-area-inset-top,0px)); width:72px; display:flex; flex-direction:column; align-items:flex-end; gap:10px; z-index:2; pointer-events:none; }
.radar{ width:72px; height:72px; border-radius:var(--r-radar, 50%); pointer-events:none; }
.mapbtn{ pointer-events:auto; }
.radar canvas{ width:72px; height:72px; display:block; }

/* strip */
.strip{ position:fixed; left:50%; transform:translateX(-50%); bottom:calc(16px + env(safe-area-inset-bottom,0px)); display:flex; gap:8px; padding:8px; max-width:calc(100vw - 32px); overflow-x:auto; z-index:3; scrollbar-width:thin; }
.chip{ position:relative; flex:0 0 auto; width:116px; height:72px; border-radius:var(--r-sm, 9px); border:0; padding:0; background:#1a2036 center/cover no-repeat; overflow:hidden; outline-offset:2px; }
.chip::after{ content:""; position:absolute; inset:0; background:linear-gradient(to top, rgba(6,9,20,.85), rgba(6,9,20,0) 62%); }
.chip span{ position:absolute; left:8px; right:8px; bottom:6px; z-index:1; font-size:12px; font-weight:500; text-align:left; line-height:1.2; text-shadow:0 1px 2px rgba(0,0,0,.5); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.chip[aria-current="true"]{ box-shadow:0 0 0 2px var(--accent); }

.hint{ position:fixed; left:50%; transform:translateX(-50%); bottom:calc(108px + env(safe-area-inset-bottom,0px)); padding:8px 14px; font-size:13px; z-index:2; pointer-events:none; transition:opacity .6s ease; white-space:nowrap; }
.hint.gone{ opacity:0; }

.info-card{ position:fixed; left:50%; transform:translateX(-50%); bottom:calc(112px + env(safe-area-inset-bottom,0px)); width:min(440px, calc(100vw - 32px)); padding:16px 18px; z-index:4; animation:rise .22s ease-out; }
@keyframes rise{ from{ opacity:0; transform:translate(-50%,10px);} to{ opacity:1; transform:translate(-50%,0);} }
.info-card h3{ margin:0 0 6px; font-family:var(--font-display); font-size:18px; font-weight:700; padding-right:30px; }
.info-card p{ margin:0; font-size:14.5px; line-height:1.5; opacity:.94; white-space:pre-wrap; }
.info-card .x{ position:absolute; top:8px; right:8px; width:30px; height:30px; border-radius:8px; border:0; background:transparent; display:grid; place-items:center; }
.info-card .x:hover{ background:rgba(255,255,255,.12); }
.info-card .x svg{ width:16px; height:16px; stroke:currentColor; fill:none; stroke-width:2; stroke-linecap:round; }

.tip{ position:fixed; z-index:6; pointer-events:none; padding:6px 10px; font-size:13px; border-radius:8px; background:rgba(10,15,30,.85); border:1px solid var(--glass-line); transform:translate(-50%,-150%); white-space:nowrap; }
.banner{ position:fixed; left:50%; transform:translateX(-50%); top:calc(14px + env(safe-area-inset-top,0px)); z-index:8; background:var(--accent); color:#fff; padding:10px 12px 10px 16px; border-radius:12px; display:flex; align-items:center; gap:14px; font-size:14px; font-weight:500; box-shadow:0 10px 30px rgba(0,0,0,.35); max-width:calc(100vw - 24px); }
.banner button{ background:rgba(255,255,255,.2); border:0; border-radius:8px; padding:6px 12px; font-weight:600; }
.toast{ position:fixed; left:50%; top:calc(76px + env(safe-area-inset-top,0px)); transform:translate(-50%,-8px); background:rgba(10,15,30,.92); border:1px solid var(--glass-line); padding:9px 14px; border-radius:10px; font-size:13.5px; z-index:20; opacity:0; pointer-events:none; transition:opacity .2s, transform .2s; max-width:calc(100vw - 32px); text-align:center; }
.toast.on{ opacity:1; transform:translate(-50%,0); }

/* VR */
.reticle{ position:fixed; inset:0; z-index:6; pointer-events:none; display:none; --p:0; }
.reticle i{ position:absolute; top:50%; width:14px; height:14px; margin:-7px 0 0 -7px; border-radius:50%; border:2px solid #fff; box-shadow:0 0 0 1px rgba(0,0,0,.4); transform:scale(calc(1 + var(--p) * 1.4)); background:rgba(255,255,255,calc(var(--p) * .6)); }
.reticle i:nth-child(1){ left:25%; } .reticle i:nth-child(2){ left:75%; }
.vr-exit{ position:fixed; left:50%; transform:translateX(-50%); bottom:calc(16px + env(safe-area-inset-bottom,0px)); z-index:7; display:none; padding:9px 16px; border-radius:999px; border:1px solid var(--glass-line); background:var(--glass); color:#fff; }
.vr-note{ position:fixed; left:50%; top:20%; transform:translateX(-50%); z-index:7; display:none; padding:10px 16px; border-radius:12px; text-align:center; font-size:14px; }
body.vr .title-card, body.vr .toolbar, body.vr .side-stack, body.vr .map-panel, body.vr .map-backdrop, body.vr .strip, body.vr .hint, body.vr .info-card, body.vr .drawer, body.vr .tip{ display:none !important; }
body.vr .reticle, body.vr .vr-exit{ display:block; }
body.vr .vr-note.show{ display:block; }
body.vr #stage::after{ content:""; position:absolute; top:0; bottom:0; left:50%; width:2px; margin-left:-1px; background:#000; }

/* drawer */
.drawer{ position:fixed; top:0; bottom:0; right:0; width:380px; background:var(--paper); color:var(--ink); z-index:9; display:flex; flex-direction:column; padding-top:env(safe-area-inset-top,0px); transform:translateX(104%); transition:transform .28s cubic-bezier(.2,.8,.2,1); box-shadow:-14px 0 44px rgba(0,0,0,.4); }
.drawer.open{ transform:none; }
.drawer-head{ display:flex; align-items:center; justify-content:space-between; padding:16px 16px 6px 18px; }
.drawer-head h2{ margin:0; font-family:var(--font-display); font-size:20px; font-weight:700; letter-spacing:-.01em; }
.iconbtn{ width:34px; height:34px; border-radius:9px; border:0; background:transparent; color:var(--ink); display:grid; place-items:center; }
.iconbtn:hover{ background:var(--paper-2); }
.iconbtn svg{ width:18px; height:18px; stroke:currentColor; fill:none; stroke-width:2; stroke-linecap:round; }
.tabs{ display:flex; gap:2px; padding:6px 12px 0; border-bottom:1px solid var(--line); }
.tab{ border:0; background:transparent; padding:9px 11px 11px; font-weight:600; font-size:14px; color:var(--ink-2); border-bottom:2px solid transparent; margin-bottom:-1px; }
.tab[aria-selected="true"]{ color:var(--ink); border-bottom-color:var(--accent); }
.pane{ flex:1; overflow:auto; padding:16px 18px 28px; }
.pane h3{ margin:22px 0 10px; font-family:var(--font-display); font-size:15px; font-weight:700; }
.pane h3:first-child{ margin-top:0; }
.note{ font-size:13px; line-height:1.5; color:var(--ink-2); margin:10px 0 0; }
.field{ display:grid; gap:6px; margin-bottom:14px; }
.field > label, .lbl{ font-size:13px; font-weight:600; color:var(--ink-2); }
.field input[type=text], .field input[type=number], .field select, .field textarea, .pane input[type=text], .pane select, .pane textarea{ width:100%; background:var(--field); border:1px solid var(--line); border-radius:9px; padding:9px 11px; font-size:14px; color:var(--ink); }
.field textarea, .pane textarea{ resize:vertical; min-height:72px; line-height:1.45; }
.field input[type=color]{ width:48px; height:36px; padding:2px; border:1px solid var(--line); border-radius:9px; background:var(--field); }
.field input[type=range]{ width:100%; accent-color:var(--accent); }
.field .val{ font-weight:500; color:var(--ink); }
.lblrow{ display:flex; justify-content:space-between; align-items:baseline; }
.check{ display:flex; align-items:center; gap:10px; margin:0 0 12px; font-size:14px; color:var(--ink); }
.check input{ width:18px; height:18px; accent-color:var(--accent); }
.btn{ display:inline-flex; align-items:center; justify-content:center; gap:6px; padding:9px 14px; border-radius:9px; border:1px solid var(--line); background:var(--paper-2); color:var(--ink); font-weight:600; font-size:13.5px; }
.btn:hover{ border-color:var(--ink-2); }
.btn.primary{ background:var(--accent); border-color:transparent; color:#fff; }
.btn.primary:hover{ filter:brightness(1.08); }
.btn.danger{ color:#d63a3a; }
.btn.armed{ background:#d63a3a; color:#fff; border-color:transparent; }
.btn.full{ width:100%; box-sizing:border-box; }
.btns{ display:flex; flex-wrap:wrap; gap:8px; margin-top:10px; }
.row{ display:flex; align-items:center; gap:10px; padding:8px; border:1px solid var(--line); border-radius:11px; margin-bottom:8px; background:var(--field); }
.row.active{ border-color:var(--accent); box-shadow:inset 0 0 0 1px var(--accent); }
.row .thumb{ width:64px; height:40px; border-radius:7px; border:0; background:#1a2036 center/cover no-repeat; flex:0 0 auto; }
.row .grow{ flex:1; min-width:0; display:grid; }
.row .grow strong{ font-size:14px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.row .grow .sub{ font-size:12.5px; color:var(--ink-2); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.mini{ width:28px; height:28px; border-radius:7px; border:1px solid var(--line); background:var(--paper-2); color:var(--ink); font-size:14px; line-height:1; }
.mini:disabled{ opacity:.35; cursor:default; }
.hs{ border:1px solid var(--line); background:var(--field); border-radius:12px; padding:12px; margin-bottom:10px; display:grid; gap:9px; }
.hs .top{ display:flex; gap:8px; align-items:center; }
.hs .dot{ width:12px; height:12px; border-radius:50%; background:var(--accent); flex:0 0 auto; }
.hs .dot.info{ background:transparent; border:3px solid var(--accent); }
.empty{ border:1px dashed var(--line); border-radius:12px; padding:18px; text-align:center; color:var(--ink-2); font-size:14px; line-height:1.5; }
.mono{ font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace; font-size:12px !important; min-height:150px; }
.pane hr{ border:0; border-top:1px solid var(--line); margin:20px 0; }

body.present .toolbar .tbtn.accent, body.present .drawer, body.present .banner{ display:none !important; }

@media (min-width:761px){
  body.drawer-open .toolbar, body.drawer-open .side-stack{ right:396px; }
  body.drawer-open .map-panel[data-pos="center"]{ left:calc(50% - 190px); width:min(var(--mp-w, 760px), calc(100vw - 32px - 380px)); }
  body.drawer-open .map-panel[data-pos="right"]{ right:396px; }
  body.drawer-open .strip{ left:calc(50% - 190px); max-width:calc(100vw - 32px - 380px); }
  body.drawer-open .info-card, body.drawer-open .hint{ left:calc(50% - 190px); }
}
@media (max-width:760px){
  .tbtn.accent .txt{ display:none; }
  .title-card{ top:calc(14px + env(safe-area-inset-top,0px)); max-width:calc(100vw - 32px - 64px); padding:11px 52px 12px 13px; }
  body.edit .title-card, body.host .title-card{ max-width:calc(100vw - 32px - 116px); }
  #btnCta{ display:none !important; }
  .title-card .desc{ display:none; }
  .side-stack{ top:calc(70px + env(safe-area-inset-top,0px)); }
  .chip{ width:96px; height:60px; }
  .hint{ bottom:calc(92px + env(safe-area-inset-bottom,0px)); }
  .info-card{ bottom:calc(96px + env(safe-area-inset-bottom,0px)); }
  .drawer{ top:auto; left:0; right:0; width:auto; height:64vh; border-radius:18px 18px 0 0; padding-top:0; padding-bottom:env(safe-area-inset-bottom,0px); transform:translateY(104%); box-shadow:0 -14px 44px rgba(0,0,0,.4); }
  .drawer.open{ transform:none; }
  body.drawer-open .strip, body.drawer-open .hint, body.drawer-open .info-card{ display:none; }
}
@media (prefers-reduced-motion: reduce){
  #fade{ transition:none; } .drawer{ transition:none; } .info-card{ animation:none; }
}

.brand img{ height:22px; max-width:130px; object-fit:contain; }
.tbtn.cta{ background:var(--accent); border-color:transparent; font-weight:600; font-size:14px; text-decoration:none; }
.tbtn.cta:hover{ background:var(--accent); filter:brightness(1.08); }
.toolbar{ flex-wrap:wrap; justify-content:flex-end; max-width:calc(100vw - 32px); }
.loader{ position:fixed; left:50%; top:50%; transform:translate(-50%,-50%); z-index:6; display:flex; align-items:center; gap:12px; padding:12px 16px; border-radius:12px; font-size:14px; background:var(--glass); border:1px solid var(--glass-line); -webkit-backdrop-filter:blur(14px); backdrop-filter:blur(14px); }
.loader i{ width:18px; height:18px; border-radius:50%; border:2.5px solid rgba(255,255,255,.3); border-top-color:#fff; animation:spin .8s linear infinite; }
@keyframes spin{ to{ transform:rotate(360deg); } }
.fatal{ position:fixed; inset:0; z-index:30; display:grid; place-items:center; padding:24px; background:#0a0f1e; }
.fatal-card{ max-width:460px; padding:22px 24px; }
.fatal-card h2{ margin:0 0 8px; font-family:var(--font-display); font-size:22px; }
.fatal-card p{ margin:0; line-height:1.5; font-size:15px; opacity:.9; }
.inline{ display:flex; gap:8px; }
.inline input{ flex:1; min-width:0; }
body.no-title .title-card{ display:none; }
@media (prefers-reduced-motion: reduce){ .loader i{ animation:none; } }

.empty-state{ position:fixed; inset:0; z-index:12; display:grid; place-items:center; padding:24px; background:#0a0f1e; }
.empty-card{ max-width:440px; padding:24px 26px; text-align:left; }
.empty-card h2{ margin:0 0 8px; font-family:var(--font-display); font-size:24px; }
.empty-card p{ margin:0 0 16px; line-height:1.5; font-size:15px; opacity:.9; }

.media-modal{ position:fixed; inset:0; z-index:15; display:grid; place-items:center; padding:16px; background:rgba(6,9,20,.8); -webkit-backdrop-filter:blur(6px); backdrop-filter:blur(6px); }
.mm-box{ --mm-w:1080px; width:min(var(--mm-w), 100%); max-height:100%; display:flex; flex-direction:column; gap:10px; padding:12px 14px 14px; overflow:hidden; }
.media-modal[data-size="small"] .mm-box{ --mm-w:480px; }
.media-modal[data-size="medium"] .mm-box{ --mm-w:720px; }
.media-modal[data-size="large"] .mm-box{ --mm-w:1080px; }
.media-modal[data-size="fit"] .mm-box{ --mm-w:100%; height:100%; }
.mm-head{ display:flex; align-items:center; justify-content:space-between; gap:12px; }
.mm-head h3{ margin:0; font-family:var(--font-display); font-size:18px; font-weight:700; line-height:1.25; }
.mm-close{ flex:0 0 auto; padding:8px 18px; border-radius:10px; border:1px solid var(--glass-line); background:rgba(255,255,255,.16); color:#fff; font-weight:600; font-size:14px; }
.mm-close:hover{ background:rgba(255,255,255,.28); }
.mm-body{ min-height:0; flex:1 1 auto; display:grid; place-items:center; overflow:hidden; border-radius:10px; background:#000; }
.mm-body img, .mm-body video{ display:block; max-width:100%; max-height:calc(100vh - 190px); width:auto; height:auto; object-fit:contain; }
.mm-body video{ width:100%; }
.media-modal[data-size="fit"] .mm-body img, .media-modal[data-size="fit"] .mm-body video{ max-height:100%; height:100%; }
.mm-cap{ margin:0; font-size:14px; line-height:1.5; opacity:.92; white-space:pre-wrap; }
body.vr .media-modal{ display:none !important; }
.hsmedia{ display:grid; gap:9px; }
.hsmedia .field{ margin:0; }
.hsmedia .check{ margin:0; }
.badge-note{ font-size:12.5px; color:var(--ink-2); margin:0; }

/* title panel: collapse and sizes */
/* collapsed: only the scene title stays; the brand, client line and description are hidden */
body.title-collapsed .title-card .brand, body.title-collapsed .title-card .meta, body.title-collapsed .title-card .desc{ display:none; }
body.title-collapsed .title-card{ padding:10px 56px 11px 14px; }
body.title-collapsed .title-card h1{ margin:0; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; font-size:clamp(17px,1.6vw,20px); }
body.no-title #btnInfo{ display:none; }
.title-card[data-tsize="h1"] h1{ font-size:clamp(22px,2.6vw,30px); }
.title-card[data-tsize="h2"] h1{ font-size:clamp(19px,2.2vw,25px); }
.title-card[data-tsize="h3"] h1{ font-size:clamp(17px,1.8vw,21px); }
.title-card[data-tsize="h4"] h1{ font-size:17px; }
.title-card[data-tsize="h5"] h1{ font-size:15px; }
.title-card[data-dsize="s"] .desc{ font-size:12.5px; } .title-card[data-dsize="s"] .meta{ font-size:12px; }
.title-card[data-dsize="l"] .desc{ font-size:16.5px; } .title-card[data-dsize="l"] .meta{ font-size:14.5px; }

/* map / floor plan */
.map-backdrop{ position:fixed; inset:0; z-index:3; background:rgba(6,9,20,.55); }
.map-panel{ position:fixed; z-index:4; display:flex; flex-direction:column; padding:8px; overflow:hidden; --map-alpha:1;
  bottom:calc(108px + env(safe-area-inset-bottom,0px));
  width:min(var(--mp-w, 420px), calc(100vw - 32px)); height:max(180px, min(var(--mp-h, 440px), calc(100vh - 150px)));
  background:rgba(10,15,30,calc(.62 * var(--map-alpha))); }
.map-panel[data-pos="left"]{ left:16px; }
.map-panel[data-pos="right"]{ right:16px; }
.map-panel[data-pos="center"]{ left:50%; bottom:auto; top:50%; transform:translate(-50%,-50%); width:min(var(--mp-w, 760px), calc(100vw - 32px)); height:max(180px, min(var(--mp-h, 540px), calc(100vh - 80px))); }
.map-panel[data-clear="1"]{ -webkit-backdrop-filter:none; backdrop-filter:none; }
.mp-head{ display:flex; align-items:center; gap:8px; padding:2px 2px 8px 6px; }
.mp-head strong{ flex:1; font-family:var(--font-display); font-size:15px; }
.mp-x{ width:30px; height:30px; border-radius:8px; border:0; background:transparent; color:#fff; display:grid; place-items:center; }
.mp-x:hover{ background:rgba(255,255,255,.14); }
.mp-x svg{ width:16px; height:16px; stroke:currentColor; fill:none; stroke-width:2; stroke-linecap:round; }
.mp-place{ display:flex; align-items:center; justify-content:space-between; gap:10px; margin:0 0 8px; padding:8px 10px; border-radius:9px; background:var(--accent); font-size:13px; font-weight:500; }
.mp-place button{ flex:0 0 auto; border:0; border-radius:7px; padding:5px 11px; background:rgba(255,255,255,.22); color:#fff; font-weight:600; }
.mp-body{ position:relative; flex:1 1 auto; min-height:0; border-radius:10px; overflow:hidden; background:rgba(16,24,40,var(--map-alpha)); }
#mapEl{ position:absolute; inset:0; }
#mapEl.leaflet-container{ font-family:var(--font-body); background:rgba(207,216,227,var(--map-alpha)); }
#mapEl .leaflet-tile-pane, #mapEl .leaflet-image-layer{ opacity:var(--map-alpha) !important; }
.map-panel.placing #mapEl{ cursor:crosshair; }
.mk-wrap{ background:none !important; border:0 !important; overflow:visible; }
.mk-dot{ position:absolute; inset:0; z-index:1; display:grid; place-items:center; border-radius:50%; background:var(--accent); color:#fff; border:3px solid #fff; box-shadow:0 2px 8px rgba(0,0,0,.45); font:600 12px/1 var(--font-body); }
.mk-dot.cur{ box-shadow:0 0 0 5px rgba(255,255,255,.55), 0 2px 8px rgba(0,0,0,.45); }
.mk-dot.poi{ background:#fff; color:var(--accent); border:2px solid var(--accent); border-radius:8px; }
.mk-dot svg{ width:14px; height:14px; stroke:currentColor; fill:currentColor; stroke-width:2; stroke-linecap:round; }
.mk-cone{ position:absolute; left:50%; top:50%; width:120px; height:120px; margin:-60px 0 0 -60px; z-index:0; overflow:visible; pointer-events:none; transform:rotate(var(--rot, 0deg)); }
.mk-cone path{ fill:var(--accent); fill-opacity:.38; stroke:var(--accent); stroke-opacity:.75; stroke-width:1.5; }
@media (max-width:760px){
  .map-panel:not([data-shape="circle"]):not([data-big="1"]){ left:12px !important; right:12px !important; width:auto !important; top:auto !important; bottom:calc(96px + env(safe-area-inset-bottom,0px)) !important; transform:none !important; height:min(52vh, 420px) !important; }
}

/* drawer extras */
.tabs{ overflow-x:auto; scrollbar-width:none; }
.tabs::-webkit-scrollbar{ display:none; }
.tab{ flex:0 0 auto; }
.row .num{ flex:0 0 auto; width:24px; height:24px; border-radius:50%; background:var(--accent); color:#fff; display:grid; place-items:center; font-size:12px; font-weight:600; }
.adv{ margin-top:18px; }
.adv summary{ cursor:pointer; font-weight:600; font-size:13px; color:var(--ink-2); margin-bottom:8px; }
.linkbtn{ background:none; border:0; padding:0; color:var(--accent); text-decoration:underline; font:inherit; cursor:pointer; }
.badge-note.warn{ color:#b45309; }

/* map size inputs */
.pane input[type=number]{ width:100%; background:var(--field); border:1px solid var(--line); border-radius:9px; padding:9px 11px; font-size:14px; color:var(--ink); }
.inline.sizes{ align-items:flex-end; }
.sz{ flex:1; display:grid; gap:4px; font-size:12.5px; font-weight:600; color:var(--ink-2); }
.inline.sizes .x{ padding-bottom:10px; color:var(--ink-2); }

/* About tab */
.about p{ margin:0 0 12px; line-height:1.55; font-size:14.5px; }
.about .thanks{ font-weight:600; }
.donate{ margin:18px 0 20px; }
.donate .btn{ padding:12px 18px; font-size:14.5px; }
.donate-menu{ display:grid; gap:8px; margin-top:10px; }
.donate-menu .btn{ justify-content:space-between; text-decoration:none; }
.donate-menu .btn span{ font-weight:500; color:var(--ink-2); font-size:13px; }
.about .connect a{ color:var(--accent); font-weight:600; }
.about .ver{ margin-top:22px; font-size:12.5px; color:var(--ink-2); }
a.btn{ text-decoration:none; }

/* YouTube popup: a 16:9 player that always fits the screen */
.mm-yt{ position:relative; width:min(100%, calc((100vh - 200px) * 16 / 9)); aspect-ratio:16 / 9; background:#000; }
.mm-yt iframe{ position:absolute; inset:0; width:100%; height:100%; border:0; }
.media-modal[data-size="fit"] .mm-yt{ width:min(100%, calc((100vh - 130px) * 16 / 9)); }

/* share button and pop-up */
.sharebtn{ pointer-events:auto; }
.share-backdrop{ position:fixed; inset:0; z-index:13; background:rgba(6,9,20,.55); }
.share-panel{ position:fixed; z-index:14; left:50%; top:50%; transform:translate(-50%,-50%); width:min(480px, calc(100vw - 32px)); max-height:calc(100vh - 32px); overflow:auto; padding:24px 22px 22px; text-align:center; }
.share-panel .x{ position:absolute; top:8px; right:8px; width:32px; height:32px; border-radius:8px; border:0; background:transparent; color:#fff; display:grid; place-items:center; }
.share-panel .x:hover{ background:rgba(255,255,255,.14); }
.share-panel .x svg{ width:16px; height:16px; stroke:currentColor; fill:none; stroke-width:2; stroke-linecap:round; }
.share-panel h3{ margin:0 0 8px; padding:0 30px; font-family:var(--font-display); font-size:22px; font-weight:700; line-height:1.2; }
.share-text{ margin:0; font-size:14.5px; line-height:1.55; opacity:.94; white-space:pre-wrap; }
.share-label{ margin:0 0 12px; font-size:13px; font-weight:600; letter-spacing:.02em; opacity:.75; }
.share-about{ margin-bottom:16px; padding-bottom:16px; border-bottom:1px solid var(--glass-line); }
.share-icons{ display:flex; flex-wrap:wrap; justify-content:center; gap:10px; }
.share-ico{ width:42px; height:42px; border-radius:50%; display:grid; place-items:center; border:0; padding:0; background:var(--ico, #566074); color:#fff; text-decoration:none; box-shadow:inset 0 0 0 1px rgba(255,255,255,.22); transition:transform .15s ease; }
.share-ico:hover, .share-ico:focus-visible{ transform:translateY(-2px) scale(1.07); }
.share-ico svg{ width:21px; height:21px; stroke:currentColor; fill:none; stroke-width:1.9; stroke-linecap:round; stroke-linejoin:round; }
.share-ico svg .f{ fill:currentColor; stroke:none; }
@media (min-width:761px){ body.drawer-open .share-panel{ left:calc(50% - 190px); } }
@media (prefers-reduced-motion: reduce){ .share-ico{ transition:none; } }
body.vr .share-panel, body.vr .share-backdrop{ display:none !important; }

/* image popup: several images with arrows */
.mm-gal{ position:relative; display:grid; place-items:center; width:100%; }
.mm-gal img{ display:block; max-width:100%; max-height:calc(100vh - 190px); width:auto; height:auto; object-fit:contain; }
.media-modal[data-size="fit"] .mm-gal{ height:100%; }
.media-modal[data-size="fit"] .mm-gal img{ max-height:100%; height:100%; }
.mm-nav{ position:absolute; top:50%; transform:translateY(-50%); width:44px; height:44px; border-radius:50%; border:1px solid rgba(255,255,255,.35); background:rgba(10,15,30,.55); color:#fff; font-size:28px; line-height:1; display:grid; place-items:center; padding:0 0 3px; }
.mm-nav:hover, .mm-nav:focus-visible{ background:rgba(10,15,30,.82); }
.mm-nav.prev{ left:10px; } .mm-nav.next{ right:10px; }
.mm-count{ position:absolute; bottom:10px; left:50%; transform:translateX(-50%); padding:3px 11px; border-radius:999px; background:rgba(10,15,30,.68); color:#fff; font-size:12.5px; font-weight:600; }

/* button under a caption */
.cta-btn{ display:inline-flex; align-items:center; justify-content:center; margin-top:14px; padding:11px 22px; border-radius:10px; background:var(--accent); color:#fff; font-weight:600; font-size:14.5px; text-decoration:none; }
.cta-btn:hover, .cta-btn:focus-visible{ filter:brightness(1.12); }
.mm-box .cta-btn{ margin-top:0; align-self:flex-start; }

/* builder: image gallery and scene thumbnail */
.thumbs{ display:flex; flex-wrap:wrap; gap:8px; margin:6px 0 10px; }
.gthumb{ position:relative; width:84px; }
.gthumb img{ display:block; width:84px; height:56px; object-fit:cover; border-radius:8px; border:1px solid var(--line); background:#1a2036; }
.gthumb .gnum{ position:absolute; top:4px; left:4px; min-width:18px; height:18px; padding:0 5px; border-radius:9px; background:var(--accent); color:#fff; font-size:11px; font-weight:600; display:grid; place-items:center; }
.gthumb .gacts{ display:flex; gap:3px; margin-top:4px; justify-content:space-between; }
.gthumb .gacts .mini{ width:24px; height:24px; font-size:13px; }
.btnfields{ display:grid; gap:0; margin-top:4px; }
.thumb-ed{ display:flex; align-items:center; gap:12px; flex-wrap:wrap; }
.thumb-prev{ width:96px; height:60px; border-radius:9px; border:1px solid var(--line); background:#1a2036 center/cover no-repeat; flex:0 0 auto; }

/* ---------- 2.1: price labels, WhatsApp button, lead form ---------- */
.price-pill{ display:inline-block; margin:2px 0 8px; padding:3px 10px; border-radius:999px; background:rgba(255,255,255,.16); border:1px solid var(--glass-line); font-weight:600; font-size:13.5px; }
.mm-head .price-pill{ margin:0 0 0 10px; vertical-align:middle; }
.info-card .cta-btn{ margin-right:8px; }
.cta-btn.wa-btn{ background:#1f9d55; gap:8px; }
.cta-btn.wa-btn svg{ width:20px; height:20px; fill:none; stroke:#fff; stroke-width:1.6; stroke-linejoin:round; }
.cta-btn.wa-btn svg path + path{ fill:#fff; }
.lead-box{ --mm-w:460px; overflow:auto; gap:12px; padding:16px 18px 18px; }
.lead-box .mm-cap{ margin-top:-2px; }
.lf-fields{ display:flex; flex-direction:column; gap:10px; }
.lf-field{ display:flex; flex-direction:column; gap:5px; font-size:13.5px; font-weight:600; }
.lf-field input, .lf-field textarea{ width:100%; padding:10px 12px; border-radius:10px; border:1px solid var(--glass-line); background:rgba(255,255,255,.1); color:#fff; font-size:15px; font-weight:400; }
.lf-field input:focus, .lf-field textarea:focus{ outline:2px solid var(--accent); outline-offset:1px; border-color:transparent; }
.lf-field input[type=date]{ color-scheme:dark; }
.lf-field textarea{ resize:vertical; min-height:76px; line-height:1.45; }
.lf-hp{ position:absolute !important; left:-9999px; width:1px; height:1px; overflow:hidden; }
.lf-status{ margin:0; font-size:14px; line-height:1.45; }
.lf-status.err{ color:#ffb4b4; }
.lead-box .cta-btn{ margin-top:2px; align-self:flex-start; border:0; cursor:pointer; }
.lead-box .cta-btn[disabled]{ opacity:.6; cursor:default; }
.lead-box.sent .lf-fields, .lead-box.sent #lfSend{ display:none; }
.lead-box.sent .lf-status{ font-size:16px; }

/* ---------- 2.2: screensaver mode ---------- */
#stage canvas{ transition:filter .75s ease, transform .75s ease; }
#stage.ss-blur canvas{ filter:blur(18px) brightness(.92); transform:scale(1.03); }
body.ss-on #stage{ cursor:none; }
.toolbar, .side-stack, .strip, .title-card .brand, .title-card .meta, .title-card .desc{ transition:opacity .35s ease; }
body.ss-on .toolbar, body.ss-on .side-stack, body.ss-on .strip, body.ss-on .hint, body.ss-on .info-card, body.ss-on .tip,
body.ss-on .map-panel, body.ss-on .map-backdrop, body.ss-on .share-panel, body.ss-on .share-backdrop{ opacity:0 !important; visibility:hidden !important; pointer-events:none !important; transition:opacity .6s ease, visibility 0s linear .6s; }
/* Only the scene title stays, in a compact card. */
body.ss-on .title-card .brand, body.ss-on .title-card .meta, body.ss-on .title-card .desc{ display:none !important; }
body.ss-on .title-card h1{ margin-top:0; }
@media (prefers-reduced-motion: reduce){ #stage canvas{ transition:filter .3s linear; } #stage.ss-blur canvas{ transform:none; } }

/* ---------- 2.3: sharp zoom progress ---------- */
.tz-bar{ height:6px; margin:10px 0 4px; border-radius:99px; background:var(--paper-2); overflow:hidden; }
.tz-bar i{ display:block; height:100%; width:0; background:var(--accent); transition:width .25s ease; }

/* ---------- 2.3: pop-up style ---------- */
.info-card.glass, .mm-box.glass, .share-panel.glass{ background:var(--pop-bg, var(--glass)); border-radius:var(--r, 14px); }
body.pop-light .info-card, body.pop-light .mm-box, body.pop-light .share-panel{ color:#10182b; border-color:rgba(16,24,40,.16); }
body.pop-light .info-card .x, body.pop-light .share-panel .x{ color:#10182b; }
body.pop-light .info-card .x:hover, body.pop-light .share-panel .x:hover{ background:rgba(16,24,40,.08); }
body.pop-light .mm-close{ background:rgba(16,24,40,.07); border-color:rgba(16,24,40,.2); color:#10182b; }
body.pop-light .mm-close:hover{ background:rgba(16,24,40,.14); }
body.pop-light .price-pill{ background:rgba(16,24,40,.06); border-color:rgba(16,24,40,.18); }
body.pop-light .lf-field input, body.pop-light .lf-field textarea{ background:#fff; border-color:rgba(16,24,40,.22); color:#10182b; }
body.pop-light .lf-field input[type=date]{ color-scheme:light; }
body.pop-light .lf-status.err{ color:#b42318; }
body.pop-light .share-about{ border-bottom-color:rgba(16,24,40,.14); }

/* ---------- 2.3: map panel in the corners, as a circle, enlarged ---------- */
.map-panel[data-pos="bottom-left"]{ left:16px; bottom:calc(16px + env(safe-area-inset-bottom,0px)); }
.map-panel[data-pos="bottom-right"]{ right:16px; bottom:calc(16px + env(safe-area-inset-bottom,0px)); }
.map-panel[data-big="1"]{ width:min(1200px, calc(100vw - 48px)) !important; height:min(860px, calc(100vh - 64px)) !important; }
@media (min-width:761px){ body.drawer-open .map-panel[data-big="1"]{ left:calc(50% - 190px); width:min(1100px, calc(100vw - 48px - 380px)) !important; } }
.map-panel{ transition:width .25s ease, height .25s ease; }
/* Circle: the map sits in a round frame; the buttons float beside it. */
.map-panel[data-shape="circle"]{ width:var(--mp-d, 260px); height:var(--mp-d, 260px); padding:0; overflow:visible; background:none; border:0; border-radius:50%; -webkit-backdrop-filter:none; backdrop-filter:none; }
.map-panel[data-shape="circle"] .mp-body{ position:absolute; inset:0; border-radius:50%; border:3px solid rgba(255,255,255,.88); box-shadow:0 6px 24px rgba(0,0,0,.45); -webkit-mask-image:-webkit-radial-gradient(white, black); }
.map-panel[data-shape="circle"] .mp-head{ position:absolute; top:-4px; right:-4px; z-index:5; flex-direction:column; padding:0; gap:6px; }
.map-panel[data-shape="circle"] .mp-head strong{ display:none; }
.map-panel[data-shape="circle"] .mp-x{ width:32px; height:32px; border-radius:50%; background:var(--glass); border:1px solid var(--glass-line); -webkit-backdrop-filter:blur(10px); backdrop-filter:blur(10px); }
.map-panel[data-shape="circle"] .mp-place{ position:absolute; left:50%; top:-48px; transform:translateX(-50%); white-space:nowrap; }
.map-panel[data-shape="circle"] .leaflet-control-zoom{ display:none; }
.map-panel[data-shape="circle"] .leaflet-control-attribution{ position:absolute; left:50%; bottom:14%; transform:translateX(-50%); max-width:72%; font-size:9.5px; line-height:1.2; text-align:center; border-radius:6px; padding:1px 5px; }
.map-panel[data-shape="circle"][data-pos="left"]{ bottom:calc(108px + env(safe-area-inset-bottom,0px)); }
/* Floor plans: no background behind the image, so a PNG with a transparent background floats over the panorama. */
.map-panel[data-mode="plan"]:not([data-big="1"]){ background:none; border-color:transparent; -webkit-backdrop-filter:none; backdrop-filter:none; }
.map-panel[data-mode="plan"]:not([data-big="1"]) .mp-head{ align-self:flex-start; padding:4px 4px 4px 10px; margin-bottom:6px; border-radius:10px; background:var(--glass); border:1px solid var(--glass-line); -webkit-backdrop-filter:blur(10px); backdrop-filter:blur(10px); }
.map-panel[data-mode="plan"][data-shape="circle"] .mp-head{ padding:0; margin:0; background:none; border:0; -webkit-backdrop-filter:none; backdrop-filter:none; }
.map-panel[data-mode="plan"] .mp-body, .map-panel[data-mode="plan"] #mapEl.leaflet-container{ background:transparent; }
.map-panel[data-mode="plan"][data-shape="circle"] .mp-body{ box-shadow:none; }
@media (max-width:760px){
  .map-panel[data-shape="circle"]{ --mp-d:min(var(--mp-w, 220px), 46vw) !important; left:12px !important; right:auto !important; top:auto !important; transform:none !important; bottom:calc(104px + env(safe-area-inset-bottom,0px)) !important; width:var(--mp-d) !important; height:var(--mp-d) !important; }
  .map-panel[data-shape="circle"][data-pos="right"], .map-panel[data-shape="circle"][data-pos="bottom-right"]{ left:auto !important; right:12px !important; }
  .map-panel[data-big="1"]{ left:10px !important; right:10px !important; top:calc(64px + env(safe-area-inset-top,0px)) !important; bottom:calc(16px + env(safe-area-inset-bottom,0px)) !important; width:auto !important; height:auto !important; transform:none !important; }
}

/* ---------- 2.3.1: quality check panel ---------- */
.t360-qinfo{ position:fixed; left:12px; bottom:12px; z-index:30; margin:0; max-width:calc(100vw - 24px); padding:8px 10px; border-radius:8px; background:rgba(0,0,0,.78); color:#9ef59e; font:11.5px/1.45 ui-monospace, Consolas, monospace; white-space:pre-wrap; pointer-events:none; }

/* ---------- 3.0 Customize panel: modes, folding sections, objects, inspector ---------- */
.head-acts{ display:flex; gap:2px; }
.modes{ display:grid; grid-template-columns:1fr 1fr; gap:4px; margin:6px 16px 0 18px; padding:4px; background:var(--paper-2); border-radius:11px; }
.mode{ border:0; background:transparent; padding:8px 10px; border-radius:8px; font-weight:600; font-size:14px; color:var(--ink-2); }
.mode:hover{ color:var(--ink); }
.mode[aria-selected="true"]{ background:var(--field); color:var(--ink); box-shadow:0 1px 3px rgba(0,0,0,.14); }
.scene-pick{ display:grid; gap:5px; margin-bottom:10px; }
details.sec{ border-top:1px solid var(--line); }
details.sec:last-child{ border-bottom:1px solid var(--line); }
details.sec > summary{ list-style:none; cursor:pointer; display:flex; align-items:center; gap:8px; padding:13px 2px; font-family:var(--font-display); font-weight:700; font-size:15px; color:var(--ink); }
details.sec > summary::-webkit-details-marker{ display:none; }
details.sec > summary::after{ content:''; margin-left:auto; width:7px; height:7px; border-right:2px solid var(--ink-2); border-bottom:2px solid var(--ink-2); transform:translateY(-2px) rotate(45deg); transition:transform .2s; }
details.sec[open] > summary::after{ transform:translateY(2px) rotate(-135deg); }
.sec-body{ padding:2px 2px 18px; }
.sec-body > h3:first-child{ margin-top:2px; }
.count{ font-family:var(--font-body); font-size:12px; font-weight:700; line-height:18px; min-width:18px; text-align:center; background:var(--accent); color:#fff; border-radius:99px; padding:0 6px; }
.count:empty{ display:none; }
.addwrap{ position:relative; margin-bottom:12px; }
.add-menu{ position:absolute; left:0; right:0; top:calc(100% + 6px); z-index:3; max-height:min(60vh, 420px); overflow:auto; background:var(--field); border:1px solid var(--line); border-radius:12px; padding:6px; box-shadow:0 14px 34px rgba(0,0,0,.28); }
.add-grp{ margin:6px 8px 4px; font-size:11.5px; font-weight:700; letter-spacing:.06em; text-transform:uppercase; color:var(--ink-2); }
.add-item{ display:flex; align-items:center; gap:10px; width:100%; border:0; background:transparent; color:var(--ink); padding:7px 8px; border-radius:8px; font:inherit; font-size:14px; text-align:left; cursor:pointer; }
.add-item:hover, .add-item:focus-visible{ background:var(--paper-2); }
.oi{ width:26px; height:26px; flex:0 0 auto; border-radius:8px; display:grid; place-items:center; background:rgba(58,99,255,.14); background:color-mix(in srgb, var(--accent) 15%, transparent); color:var(--accent); font-size:14px; font-weight:700; line-height:1; }
.oi::before{ content:'\2022'; }
.oi-link::before{ content:'\2192'; }
.oi-info::before{ content:'i'; font-family:Georgia,'Times New Roman',serif; font-style:italic; font-size:15px; }
.oi-media::before{ content:'\25A3'; }
.oi-youtube::before{ content:'\25B6'; font-size:11px; }
.oi-whatsapp{ background:rgba(37,211,102,.16); color:#1c9d50; }
.oi-whatsapp::before{ content:'\2706'; }
.oi-lead::before{ content:'\2709'; }
.oi-sun, .oi-lamp{ background:rgba(255,196,90,.22); color:#b7740b; box-shadow:inset 0 0 0 2px var(--c, transparent); }
.oi-sun::before{ content:'\2600'; }
.oi-lamp::before{ content:'\273A'; }
.objrow{ display:flex; align-items:center; gap:6px; margin-bottom:6px; }
.objmain{ flex:1; min-width:0; display:flex; align-items:center; gap:10px; padding:8px 8px 8px 10px; border:1px solid var(--line); border-radius:11px; background:var(--field); color:var(--ink); font:inherit; text-align:left; cursor:pointer; }
.objmain:hover{ border-color:var(--ink-2); }
.objmain .grow{ flex:1; min-width:0; display:grid; }
.objmain strong{ font-size:14px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.objmain .sub{ font-size:12.5px; color:var(--ink-2); }
.objmain .chev{ font-size:22px; line-height:1; color:var(--ink-2); padding:0 2px; }
.mini.look{ width:36px; height:36px; display:grid; place-items:center; border-radius:10px; color:var(--ink-2); }
.mini.look:hover{ color:var(--accent); }
.look-ico{ width:14px; height:14px; border:2px solid currentColor; border-radius:50%; position:relative; }
.look-ico::after{ content:""; position:absolute; inset:3px; background:currentColor; border-radius:50%; }
.inspector .insp-head{ position:sticky; top:-16px; margin:-16px -18px 14px; padding:12px 18px; background:var(--paper); border-bottom:1px solid var(--line); display:flex; align-items:center; gap:10px; z-index:2; }
.insp-head strong{ min-width:0; font-family:var(--font-display); font-size:16px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.insp-back{ padding:6px 10px; flex:0 0 auto; }
.inspector .hs{ border:0; padding:0; background:transparent; }
.preview-exit{ position:fixed; z-index:10; right:16px; bottom:calc(16px + env(safe-area-inset-bottom,0px)); background:var(--accent); border-color:transparent; color:#fff; font-weight:600; font-size:14px; }

/* ---------- 3.0 objects in the panorama ---------- */
#stage canvas.t360-areas{ position:absolute; inset:0; pointer-events:none; }
.banner #bannerDone{ background:#fff; color:var(--accent); }
.oi-area::before{ content:''; width:12px; height:10px; border:2px solid currentColor; border-radius:2px 6px 2px 6px; transform:skewX(-12deg); }
.oi-plane-image::before{ content:'\25A8'; }
.oi-plane-video::before{ content:'\25B7'; font-size:13px; }
.oi-plane-presenter{ background:rgba(0,177,64,.16); color:#0f8f3c; }
.oi-plane-presenter::before{ content:'\263A'; font-size:15px; }
.pane h4.sub-h, .inspector h4.sub-h{ margin:8px 0 0; font-family:var(--font-display); font-size:14px; font-weight:700; color:var(--ink); }
.field .inline{ display:flex; gap:8px; align-items:center; }
/* 3.0 share: link to this view and QR code */
.share-extra{ display:flex; flex-wrap:wrap; justify-content:center; align-items:center; gap:10px 16px; margin-top:16px; font-size:13.5px; }
.share-view{ display:flex; align-items:center; gap:8px; cursor:pointer; }
.share-view input{ width:16px; height:16px; accent-color:var(--accent); }
.share-qr-btn{ border:1px solid rgba(255,255,255,.35); background:transparent; color:inherit; border-radius:99px; padding:6px 14px; font:inherit; font-weight:600; cursor:pointer; }
body.pop-light .share-qr-btn{ border-color:rgba(16,24,40,.25); }
.share-qr{ margin-top:14px; display:grid; justify-items:center; gap:8px; }
.share-qr canvas{ width:180px; height:180px; border-radius:8px; image-rendering:pixelated; }
.share-qr a{ color:inherit; font-size:13px; font-weight:600; }
.linkqr .inline input{ flex:1; min-width:0; }
.linkqr canvas.qr{ display:block; width:160px; height:160px; margin:10px 0; border-radius:6px; border:1px solid var(--line); image-rendering:pixelated; }
/* 3.0 motion */
#stage.fly-blur canvas{ filter:blur(6px) brightness(1.04); transform:scale(1.06); transition:filter .3s ease, transform .3s ease; }
body.intro-on .strip, body.intro-on .hint, body.intro-on canvas.t360-areas{ opacity:0; }
.oi-sound{ background:rgba(255,140,60,.16); color:#c25a12; }
.oi-sound::before{ content:'\266A'; font-size:15px; }


/* ---------- 3.1: title panel toggle, Options menu, theme on every element ---------- */
.title-card{ padding-right:58px; }
.title-toggle{ position:absolute; top:10px; right:10px; width:38px; height:38px; padding:0; display:grid; place-items:center; border-radius:var(--r-sm, 9px); border:1px solid var(--glass-line); background:var(--glass-soft, rgba(255,255,255,.1)); color:inherit; cursor:pointer; }
.title-toggle:hover{ box-shadow:inset 0 0 0 100px var(--glass-soft, rgba(255,255,255,.08)); }
.title-toggle svg{ width:18px; height:18px; stroke:currentColor; fill:none; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; transition:transform .2s ease; }
body.title-collapsed .title-toggle{ top:50%; transform:translateY(-50%); }
body.title-collapsed .title-toggle svg{ transform:rotate(180deg); }
.title-card .meta, .title-card .desc, .title-card .brand{ color:inherit; }
.optbtn[aria-expanded="true"]{ background:var(--accent); border-color:transparent; color:#fff; }
.opt-backdrop{ position:fixed; inset:0; z-index:8; background:rgba(0,0,0,.28); }
.opt-menu{ position:fixed; z-index:9; right:16px; top:calc(66px + env(safe-area-inset-top,0px)); width:316px; max-height:calc(100vh - 90px); overflow:auto; box-sizing:border-box; padding:10px; background:var(--glass-menu, rgba(10,15,30,.86)); box-shadow:0 18px 50px rgba(0,0,0,.32); }
.opt-head{ display:none; align-items:center; justify-content:space-between; margin:0 2px 8px; }
.opt-head strong{ font-family:var(--font-display); font-size:16px; }
.opt-x{ width:40px; height:40px; margin:-6px -6px -6px 0; padding:0; display:grid; place-items:center; border:0; background:transparent; color:inherit; cursor:pointer; }
.opt-x svg{ width:18px; height:18px; stroke:currentColor; fill:none; stroke-width:2; stroke-linecap:round; }
.opt-tiles{ display:grid; grid-template-columns:repeat(4, minmax(0, 1fr)); gap:6px; }
.opt-tile{ min-height:62px; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:5px; padding:6px 2px; border:1px solid var(--glass-line); background:var(--glass-soft, rgba(255,255,255,.1)); color:inherit; border-radius:var(--r-sm, 9px); font:inherit; font-size:11.5px; font-weight:600; line-height:1.15; text-align:center; cursor:pointer; transition:background .15s; }
.opt-tile:hover{ box-shadow:inset 0 0 0 100px var(--glass-soft, rgba(255,255,255,.08)); }
.opt-tile svg{ width:22px; height:22px; stroke:currentColor; fill:none; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }
.opt-tile[aria-pressed="true"]{ background:var(--accent); border-color:var(--accent); color:#fff; }
.opt-tile .ico-off{ display:none; }
.opt-tile[aria-pressed="true"] .ico-on{ display:none; }
.opt-tile[aria-pressed="true"] .ico-off{ display:inline; }
.opt-sound{ margin-top:10px; padding-top:4px; border-top:1px solid var(--glass-line); }
.opt-vol{ display:flex; align-items:center; gap:10px; min-height:40px; padding:0 4px; }
.opt-vol svg{ flex:0 0 20px; width:20px; height:20px; stroke:currentColor; fill:none; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }
.opt-vol label{ flex:0 0 98px; font-size:13px; line-height:1.2; }
.opt-vol input{ flex:1; min-width:0; accent-color:var(--accent); cursor:pointer; }
.opt-vol output{ flex:0 0 38px; text-align:right; font-size:12.5px; font-variant-numeric:tabular-nums; opacity:.8; }
.opt-sound.muted .opt-vol{ opacity:.45; }
.opt-cta{ display:flex; margin-top:10px; min-height:48px; align-items:center; justify-content:center; background:var(--accent); color:#fff; text-decoration:none; font-weight:600; font-size:14.5px; border-radius:var(--r-sm, 9px); }
@media (min-width:761px){
  .opt-backdrop, .opt-cta{ display:none !important; }
  body.drawer-open .opt-menu{ right:396px; }
}
@media (max-width:760px){
  .opt-menu{ left:0; right:0; top:auto; bottom:0; width:auto; max-height:82vh; border-bottom:0; border-left:0; border-right:0; border-radius:var(--r, 14px) var(--r, 14px) 0 0; padding:8px 14px calc(18px + env(safe-area-inset-bottom,0px)); }
  .opt-menu::before{ content:''; display:block; width:40px; height:4px; margin:2px auto 8px; border-radius:99px; background:var(--glass-line); }
  .opt-head{ display:flex; }
}
body.vr .opt-menu, body.vr .opt-backdrop, body.ss-on .opt-menu, body.ss-on .opt-backdrop{ display:none !important; }
body.hotspots-off canvas.t360-areas{ opacity:0; }
.menu-opts{ display:grid; grid-template-columns:repeat(2, minmax(0, 1fr)); gap:0 12px; }
.chip span{ color:#fff; }
.mp-x{ color:inherit; }
body.pop-light .mp-place button{ background:rgba(16,24,43,.1); color:#10182b; }
body.pop-light .loader{ color:#10182b; }
body.pop-light .loader i{ border-color:rgba(16,24,43,.25); border-top-color:#10182b; }

/* 3.1: subtitles above the scene thumbnails; the size is a share of the viewer height */
.subs{ position:fixed; left:50%; transform:translateX(-50%); bottom:var(--subs-bottom, 112px); width:min(82vw, 980px); display:flex; justify-content:center; text-align:center; pointer-events:none; z-index:3; transition:bottom .25s ease; }
.subs span{ display:inline; padding:.28em .6em; background:var(--subs-box, rgba(10,15,30,.74)); color:var(--subs-box-ink, #fff); border-radius:var(--r-sm, 8px); font-size:max(14px, calc(var(--subs-vh, 2.6) * 1vh)); line-height:1.4; font-weight:600; text-shadow:0 1px 2px rgba(0,0,0,.55); -webkit-box-decoration-break:clone; box-decoration-break:clone; }
@media (max-width:760px){ .subs{ width:calc(100vw - 24px); } }
body.vr .subs, body.ss-on .subs{ display:none !important; }
.opt-lang{ display:flex; align-items:center; justify-content:space-between; gap:10px; margin-top:10px; padding:8px 4px 0; border-top:1px solid var(--glass-line); font-size:13px; }
.opt-seg{ display:flex; gap:4px; padding:3px; border-radius:var(--r-sm, 9px); background:var(--glass-soft, rgba(255,255,255,.1)); }
.opt-seg button{ min-height:34px; padding:4px 10px; border:0; border-radius:calc(var(--r-sm, 9px) - 2px); background:transparent; color:inherit; font:inherit; font-size:13px; font-weight:600; cursor:pointer; }
.opt-seg button[aria-checked="true"]{ background:var(--accent); color:#fff; }
/* builder: subtitle editor */
.subs-ed .seg2{ display:grid; grid-template-columns:repeat(2, minmax(0, 1fr)); gap:4px; padding:4px; background:#e5e9f1; border-radius:10px; }
.subs-ed .seg2 button{ min-height:34px; border:0; border-radius:7px; background:transparent; color:#4a5470; font:inherit; font-size:13px; font-weight:600; cursor:pointer; }
.subs-ed .seg2 button[aria-selected="true"]{ background:#fff; color:#10182b; box-shadow:0 1px 3px rgba(0,0,0,.14); }
.subs-ed textarea{ width:100%; box-sizing:border-box; margin-top:8px; }
.subs-ed .sub-row{ display:flex; gap:4px; align-items:flex-start; margin:4px 0; }
.subs-ed .sub-row textarea{ flex:1; min-width:0; margin:0; padding:5px 7px; font-size:13px; line-height:1.35; resize:vertical; }
.subs-ed .sub-row input[type=number]{ flex:0 0 58px; width:58px; box-sizing:border-box; padding:6px 4px; font-variant-numeric:tabular-nums; }
.subs-ed .sub-row input[type=text]{ flex:1; min-width:0; }
.subs-ed .sub-row .x{ flex:0 0 30px; height:32px; border:0; background:transparent; color:#8a93a8; font-size:18px; cursor:pointer; border-radius:6px; }
.subs-ed .sub-row .x:hover{ color:#c0392b; background:#f6e5e3; }
.subs-ed .sub-row.now textarea{ border-color:var(--accent); box-shadow:0 0 0 1px var(--accent); }
.subs-ed .sub-head{ display:flex; gap:4px; font-size:11.5px; color:#5a6478; margin-top:8px; }
.subs-ed .sub-head span:nth-child(-n+2){ flex:0 0 58px; }

@media (min-width:761px){ body.drawer-open .subs{ left:calc(50% - 190px); width:min(70vw, 860px); } }

/* 3.1: subtitle styles (owner's choice in Look > Subtitles) */
.subs[data-style="light"] span, .subs-sample[data-style="light"]{ background:var(--subs-light, rgba(255,255,255,.85)); color:#10182b; text-shadow:none; }
.subs[data-style="outline"] span, .subs-sample[data-style="outline"]{ background:transparent; color:#fff;
  text-shadow:-.06em -.06em 0 #000, .06em -.06em 0 #000, -.06em .06em 0 #000, .06em .06em 0 #000, 0 -.08em 0 #000, 0 .08em 0 #000, -.08em 0 0 #000, .08em 0 0 #000, 0 .12em .3em rgba(0,0,0,.6); }
.subs[data-style="outline-dark"] span, .subs-sample[data-style="outline-dark"]{ background:transparent; color:#10182b;
  text-shadow:-.06em -.06em 0 #fff, .06em -.06em 0 #fff, -.06em .06em 0 #fff, .06em .06em 0 #fff, 0 -.08em 0 #fff, 0 .08em 0 #fff, -.08em 0 0 #fff, .08em 0 0 #fff, 0 .12em .3em rgba(255,255,255,.5); }
.subs-styles{ display:grid; grid-template-columns:repeat(2, minmax(0, 1fr)); gap:6px; margin-top:4px; }
.subs-styles button{ display:flex; flex-direction:column; align-items:center; gap:6px; padding:12px 6px 8px; border:1px solid #d0d7e3; border-radius:10px; background:linear-gradient(135deg, #8aa4c8, #c9b79a 60%, #4f5d6e); font:inherit; cursor:pointer; }
.subs-styles button[aria-checked="true"]{ border-color:var(--accent); box-shadow:0 0 0 2px var(--accent); }
.subs-styles small{ font-size:11.5px; color:#10182b; background:rgba(255,255,255,.85); padding:1px 6px; border-radius:99px; }
.subs-sample{ padding:.25em .55em; border-radius:var(--r-sm, 8px); font-size:15px; font-weight:700; background:var(--subs-box, rgba(10,15,30,.74)); color:var(--subs-box-ink, #fff); }

/* 3.1.0-alpha6: scene narration button below Share */
.narrbtn{ pointer-events:auto; position:relative; }
.narrbtn[aria-pressed="true"]{ border-color:var(--glass-line); box-shadow:none; }
.narrbtn .narr-ico{ width:20px; height:20px; }
.narrbtn .narr-ico circle{ fill:currentColor; stroke:none; }
.narrbtn .narr-ico .w1, .narrbtn .narr-ico .w2{ opacity:.45; }
.narrbtn.on .narr-ico .w1{ animation:t360NarrWave 1.2s ease-in-out infinite; }
.narrbtn.on .narr-ico .w2{ animation:t360NarrWave 1.2s ease-in-out .3s infinite; }
@keyframes t360NarrWave{ 0%,100%{ opacity:.25; } 50%{ opacity:1; } }
.narrbtn .narr-badge{ position:absolute; right:-5px; bottom:-5px; width:18px; height:18px; border-radius:50%; background:var(--accent); display:flex; align-items:center; justify-content:center; box-shadow:0 1px 4px rgba(0,0,0,.35); }
.narrbtn .narr-badge svg{ width:10px; height:10px; fill:#fff; stroke:none; }
.narrbtn .narr-badge .st{ display:none; }
.narrbtn.on .narr-badge .pl{ display:none; }
.narrbtn.on .narr-badge .st{ display:inline; }
.narrbtn .narr-ring{ position:absolute; inset:-7px; width:calc(100% + 14px); height:calc(100% + 14px); transform:rotate(-90deg); pointer-events:none; opacity:0; transition:opacity .25s; }
.narrbtn.on .narr-ring{ opacity:1; }
.narrbtn .narr-ring circle{ fill:none; stroke-width:2.6; }
.narrbtn .narr-ring .trk{ stroke:rgba(255,255,255,.18); }
.narrbtn .narr-ring .bar{ stroke:var(--accent); stroke-dasharray:100; stroke-dashoffset:100; transition:stroke-dashoffset .3s linear; stroke-linecap:round; }
.narrbtn.nudge{ animation:t360NarrNudge 1s ease-in-out 2; }
@keyframes t360NarrNudge{ 0%,100%{ transform:scale(1); box-shadow:0 0 0 0 rgba(255,255,255,0); } 50%{ transform:scale(1.12); box-shadow:0 0 0 6px color-mix(in srgb, var(--accent) 35%, transparent); } }
@media (prefers-reduced-motion: reduce){ .narrbtn.on .narr-ico .w1, .narrbtn.on .narr-ico .w2, .narrbtn.nudge{ animation:none; } .narrbtn.nudge{ border-color:var(--accent); } }
.narrbtn.on.indet .narr-ring{ animation:t360NarrSpin 1.4s linear infinite; }
@keyframes t360NarrSpin{ from{ transform:rotate(-90deg); } to{ transform:rotate(270deg); } }
@media (prefers-reduced-motion: reduce){ .narrbtn.on.indet .narr-ring{ animation:none; } }
