/* Layout: full-bleed 360 view; glass panels float over it (brand top-left, tools top-right,
   unit card right, floor plan bottom-left, room strip bottom-centre). Single dark-glass look on purpose. */
:root {
  --glass: rgba(10, 24, 30, 0.62);
  --glass-strong: rgba(10, 24, 30, 0.86);
  --line: rgba(255, 255, 255, 0.14);
  --text: #f4efe6;
  --muted: #b9c2c0;
  --sand: #d9c29a;
  --teal: #2f7d80;
  --display: 'Bodoni Moda', Georgia, serif;
  --body: 'Figtree', 'Segoe UI', system-ui, sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #0a181e; color: var(--text); font: 15px/1.45 var(--body); }
button { font: inherit; color: inherit; cursor: pointer; }
#viewer { position: fixed; inset: 0; touch-action: none; }
#viewer canvas { display: block; width: 100%; height: 100%; cursor: grab; }
#viewer canvas:active { cursor: grabbing; }

.panel, .brand, .tools, .unit, .plan, .rooms button, .credit { backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }

.brand { position: fixed; top: 16px; left: 16px; padding: 12px 16px; background: var(--glass); border: 1px solid var(--line); border-radius: 14px; max-width: calc(100vw - 200px); }
.brand-name { font-family: var(--display); font-size: 22px; font-weight: 600; letter-spacing: .01em; line-height: 1.1; }
.brand-sub { color: var(--muted); font-size: 13px; margin-top: 2px; }
.demo-tag { display: inline-block; margin-top: 8px; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--sand); border: 1px solid rgba(217, 194, 154, .4); border-radius: 99px; padding: 2px 8px; }

.tools { position: fixed; top: 16px; right: 16px; display: flex; gap: 8px; padding: 6px; background: var(--glass); border: 1px solid var(--line); border-radius: 14px; }
.seg { display: flex; background: rgba(255,255,255,.06); border-radius: 10px; padding: 2px; }
.seg button { border: 0; background: none; padding: 7px 14px; border-radius: 8px; color: var(--muted); }
.seg button[aria-pressed="true"] { background: var(--sand); color: #14231f; font-weight: 600; }
.icon { border: 0; background: rgba(255,255,255,.06); width: 38px; border-radius: 10px; font-size: 17px; }
.icon[aria-pressed="true"] { background: var(--teal); }

.unit { position: fixed; right: 16px; top: 76px; width: 280px; background: var(--glass); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.unit-toggle { display: none; width: 100%; border: 0; background: none; padding: 12px 16px; text-align: left; font-weight: 600; }
.unit-body { padding: 18px; display: grid; gap: 10px; }
.price-label { color: var(--muted); font-size: 12px; letter-spacing: .06em; text-transform: uppercase; }
.price { font-family: var(--display); font-size: 28px; font-weight: 600; margin-top: -6px; font-variant-numeric: tabular-nums; }
.facts { display: grid; grid-template-columns: 1fr auto; gap: 7px 12px; margin: 4px 0 6px; padding: 12px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); font-size: 14px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.cta, .ghost { border-radius: 11px; padding: 12px; font-weight: 600; width: 100%; }
.cta { background: var(--sand); color: #14231f; border: 0; }
.cta:hover { filter: brightness(1.05); }
.ghost { background: none; border: 1px solid var(--line); }

.plan { position: fixed; left: 16px; bottom: calc(16px + var(--safe-b)); width: 230px; padding: 10px; background: var(--glass); border: 1px solid var(--line); border-radius: 16px; }
.plan svg { display: block; width: 100%; height: auto; }
.plan .room { fill: rgba(255,255,255,.07); stroke: rgba(255,255,255,.35); stroke-width: .05; }
.plan .room.balc { fill: rgba(47,125,128,.18); stroke-dasharray: .15 .1; }
.plan .room-label { fill: var(--muted); font: .32px var(--body); text-anchor: middle; pointer-events: none; }
.plan .dot { fill: #fff; opacity: .55; cursor: pointer; }
.plan .dot:hover { opacity: 1; }
.plan .here { fill: var(--sand); opacity: 1; }
.plan .cone { fill: var(--sand); opacity: .35; pointer-events: none; }

.rooms { position: fixed; left: 50%; bottom: calc(16px + var(--safe-b)); transform: translateX(-50%); display: flex; gap: 6px; max-width: calc(100vw - 540px); overflow-x: auto; padding: 2px; scrollbar-width: none; }
.rooms button { border: 1px solid var(--line); background: var(--glass); border-radius: 12px; padding: 9px 14px; white-space: nowrap; font-size: 14px; color: var(--muted); }
.rooms button[aria-current="true"] { background: var(--sand); color: #14231f; border-color: var(--sand); font-weight: 600; }

#hotspots { position: fixed; inset: 0; pointer-events: none; }
.hs { position: absolute; left: 0; top: 0; pointer-events: auto; will-change: transform; }
.hs-nav { display: flex; flex-direction: column; align-items: center; gap: 6px; transform-origin: center; }
.hs-nav .ring { width: 54px; height: 54px; border-radius: 50%; border: 3px solid rgba(255,255,255,.95); background: rgba(255,255,255,.18); box-shadow: 0 0 0 6px rgba(255,255,255,.12); transition: transform .2s; }
.hs-nav:hover .ring { transform: scale(1.1); background: rgba(217,194,154,.45); }
.hs-nav .lbl { font-size: 13px; font-weight: 600; background: var(--glass-strong); padding: 4px 10px; border-radius: 99px; white-space: nowrap; }
.hs-info .pin { width: 30px; height: 30px; border-radius: 50%; border: 0; background: var(--sand); color: #14231f; font-weight: 700; font-size: 18px; line-height: 30px; box-shadow: 0 0 0 5px rgba(217,194,154,.3); }
.hs-info .card { position: absolute; left: 40px; top: -6px; width: 230px; background: var(--glass-strong); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; font-size: 13px; color: var(--muted); }
.hs-info .card b { display: block; color: var(--text); font-size: 14px; margin-bottom: 2px; }
.hs-info .card[hidden] { display: none; }

.loader { position: fixed; inset: 0; display: grid; place-items: center; pointer-events: none; transition: opacity .4s; }
.loader span { width: 44px; height: 44px; border-radius: 50%; border: 3px solid rgba(255,255,255,.2); border-top-color: var(--sand); animation: spin 1s linear infinite; }
.loader.done { opacity: 0; }
@keyframes spin { to { transform: rotate(360deg); } }
.hint { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); background: var(--glass-strong); padding: 10px 16px; border-radius: 99px; font-size: 14px; pointer-events: none; transition: opacity .6s; }
.hint.gone { opacity: 0; }
.credit { position: fixed; right: 16px; bottom: calc(16px + var(--safe-b)); font-size: 12px; color: var(--muted); background: var(--glass); border: 1px solid var(--line); border-radius: 99px; padding: 5px 10px; }
.credit a { color: var(--sand); text-decoration: none; }

dialog { border: 1px solid var(--line); border-radius: 16px; background: #10242b; color: var(--text); padding: 22px; width: min(380px, calc(100vw - 32px)); }
dialog::backdrop { background: rgba(0,0,0,.55); }
dialog h2 { font-family: var(--display); margin: 0 0 6px; font-weight: 600; }
dialog .muted { color: var(--muted); font-size: 13px; margin: 0 0 14px; }
dialog label { display: grid; gap: 5px; font-size: 13px; color: var(--muted); margin-bottom: 12px; }
dialog input { font: inherit; color: var(--text); background: rgba(255,255,255,.06); border: 1px solid var(--line); border-radius: 10px; padding: 10px; }
.dlg-actions { display: flex; gap: 8px; margin-top: 6px; }
.toast { position: fixed; left: 50%; top: 84px; transform: translate(-50%, -10px); opacity: 0; background: var(--glass-strong); border: 1px solid var(--line); padding: 10px 16px; border-radius: 12px; transition: all .3s; pointer-events: none; max-width: calc(100vw - 32px); font-size: 14px; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
button:focus-visible, a:focus-visible { outline: 2px solid var(--sand); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

@media (max-width: 860px) {
  .brand { top: 10px; left: 10px; padding: 9px 12px; max-width: calc(100vw - 150px); }
  .brand-name { font-size: 17px; }
  .demo-tag { display: none; }
  .tools { top: 10px; right: 10px; }
  .icon#fsBtn { display: none; }
  .seg button { padding: 6px 10px; }
  .unit { top: auto; bottom: calc(66px + var(--safe-b)); right: 10px; width: 210px; }
  .unit-toggle { display: block; }
  .unit[data-open="false"] .unit-body { display: none; }
  .unit-body { padding: 0 14px 14px; }
  .plan { left: 10px; bottom: calc(66px + var(--safe-b)); width: 130px; padding: 6px; }
  .rooms { left: 10px; right: 10px; transform: none; max-width: none; bottom: calc(10px + var(--safe-b)); }
  .credit { display: none; }
}
