/* Ainsley - the walkthrough. Palette from the house: limestone cream, black steel,
   white oak, marble; the UI stays calm and out of the way. */
@font-face { font-family: "Inter"; src: url("../fonts/Inter.ttf") format("truetype"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Cormorant"; src: url("../fonts/CormorantGaramond.ttf") format("truetype"); font-weight: 300 700; font-display: swap; }

:root {
  --bg: #12110f;
  --bg-2: #1a1916;
  --glass: rgba(24, 23, 20, 0.72);
  --glass-line: rgba(255, 250, 240, 0.10);
  --ink: #f3eee6;
  --ink-2: rgba(243, 238, 230, 0.72);
  --ink-3: rgba(243, 238, 230, 0.48);
  --paper: #f2ece3;
  --paper-ink: #2a2622;
  --steel: #15171a;
  --oak: #b8895a;
  --oak-soft: rgba(184, 137, 90, 0.22);
  --brass: #c9a36a;
  --f-ui: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-display: "Cormorant", "Cormorant Garamond", Georgia, serif;
  --r: 14px;
  --bar-h: 64px;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); font-family: var(--f-ui); -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; cursor: pointer; }
#app { position: fixed; inset: 0; display: flex; flex-direction: column; overflow: hidden; }

/* ------------------------------------------------------------------ top bar */
.bar { height: var(--bar-h); flex: none; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px;
  padding: 0 20px; border-bottom: 1px solid var(--glass-line); background: linear-gradient(#171613, #12110f); z-index: 20; }
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-mark { width: 26px; height: 26px; fill: none; stroke: var(--brass); stroke-width: 1.6; stroke-linejoin: round; flex: none; }
.brand-text b { display: block; font-family: var(--f-display); font-weight: 500; font-size: 21px; letter-spacing: 0.01em; line-height: 1; white-space: nowrap; }
.brand-text small { display: block; font-size: 10.5px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--ink-3); margin-top: 4px; }

.views { position: relative; display: inline-flex; padding: 4px; gap: 2px; border-radius: 999px; background: rgba(255, 250, 240, 0.05); border: 1px solid var(--glass-line); }
.views button { border: 0; background: none; padding: 8px 20px; border-radius: 999px; font-size: 13.5px; letter-spacing: 0.02em; color: var(--ink-2); transition: background 0.25s, color 0.25s; }
.views button[aria-selected="true"] { background: var(--ink); color: var(--steel); font-weight: 550; }
.views button:not([aria-selected="true"]):hover { color: var(--ink); }

.bar-right { display: flex; justify-content: flex-end; }
.levels { display: inline-flex; gap: 4px; }
.levels button { border: 1px solid var(--glass-line); background: none; padding: 7px 14px; border-radius: 10px; font-size: 12.5px; color: var(--ink-2); }
.levels button[aria-selected="true"] { border-color: var(--brass); color: var(--ink); background: rgba(201, 163, 106, 0.12); }

/* ------------------------------------------------------------------ views */
main { position: relative; flex: 1; min-height: 0; }
.view { position: absolute; inset: 0; display: none; }
#app[data-view="plan"] .view-plan, #app[data-view="walk"] .view-3d, #app[data-view="dollhouse"] .view-3d, #app[data-view="gallery"] .view-gallery { display: block; }
#app[data-view="walk"] .doll-hud, #app[data-view="dollhouse"] .walk-hud { display: none; }
#app:not([data-view="plan"]) .levels { visibility: hidden; }
.bar-right { align-items: center; gap: 12px; }
.xr-link { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--brass); padding: 6px 13px; border-radius: 10px; font-size: 12.5px;
  color: var(--ink); text-decoration: none; background: rgba(201, 163, 106, 0.12); white-space: nowrap; }
.xr-link svg { width: 18px; height: 18px; fill: none; stroke: var(--brass); stroke-width: 1.5; stroke-linejoin: round; }
.xr-link:hover { background: rgba(201, 163, 106, 0.24); }
@media (max-width: 720px) { .xr-link span { display: none; } .xr-link { padding: 6px 8px; } }

/* ------------------------------------------------------------------ plan */
.view-plan { background: radial-gradient(1200px 700px at 50% 40%, #1d1b18, var(--bg)); }
.paper { position: absolute; inset: 18px; border-radius: 18px; overflow: hidden; background: var(--paper);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55), inset 0 0 0 1px rgba(0, 0, 0, 0.06); }
.paper::after { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(120% 90% at 50% 45%, transparent 60%, rgba(60, 45, 30, 0.08)); }
.plan-stage { position: absolute; inset: 0; cursor: grab; touch-action: none; outline: none; }
.plan-stage.dragging { cursor: grabbing; }
.plan-stage svg { width: 100%; height: 100%; display: block; user-select: none; }
.plan-stage path { vector-effect: non-scaling-stroke; fill: none; stroke: var(--paper-ink); stroke-linecap: round; stroke-linejoin: round; }
.plan-stage .ink-fine { stroke-width: 0.55px; stroke: rgba(42, 38, 34, 0.62); }
.plan-stage .ink-mid { stroke-width: 0.8px; stroke: rgba(42, 38, 34, 0.85); }
.plan-stage .ink-wall { stroke-width: 1.2px; }
.plan-stage .poche { fill: #2f2a25; stroke: none; }
.plan-stage .hl { fill: var(--oak-soft); stroke: var(--oak); stroke-width: 1.5px; }
.plan-stage .sel { fill: rgba(184, 137, 90, 0.32); stroke: var(--oak); stroke-width: 2px; }
.plan-stage .names text { font-family: var(--f-display); font-weight: 600; fill: #7a5530; paint-order: stroke; stroke: var(--paper); stroke-width: 0.35px; text-anchor: middle; }
.plan-stage .names .fc { font-family: var(--f-ui); font-weight: 500; fill: rgba(42, 38, 34, 0.6); }

.plan-tools { position: absolute; left: 34px; bottom: 32px; display: flex; gap: 8px; }
.chip { border: 1px solid rgba(42, 38, 34, 0.18); background: rgba(255, 252, 247, 0.86); color: var(--paper-ink); backdrop-filter: blur(8px);
  padding: 8px 14px; border-radius: 999px; font-size: 12.5px; box-shadow: 0 6px 18px rgba(40, 30, 20, 0.12); }
.chip[aria-pressed="true"] { background: var(--paper-ink); color: var(--paper); }
.zoom { position: absolute; right: 34px; bottom: 32px; display: flex; flex-direction: column; border-radius: 12px; overflow: hidden;
  background: rgba(255, 252, 247, 0.9); box-shadow: 0 6px 18px rgba(40, 30, 20, 0.14); border: 1px solid rgba(42, 38, 34, 0.14); }
.zoom button { width: 40px; height: 38px; border: 0; background: none; color: var(--paper-ink); font-size: 18px; }
.zoom button + button { border-top: 1px solid rgba(42, 38, 34, 0.1); }
.zoom button:hover { background: rgba(184, 137, 90, 0.14); }

.hover-chip { position: absolute; pointer-events: none; padding: 7px 12px; border-radius: 10px; background: rgba(20, 19, 17, 0.9); color: var(--ink);
  font-size: 12px; white-space: nowrap; transform: translate(14px, 14px); box-shadow: 0 8px 22px rgba(0, 0, 0, 0.3); }
.hover-chip b { font-family: var(--f-display); font-size: 17px; font-weight: 600; margin-right: 8px; }
.hover-chip span { color: var(--ink-2); }

.room-card { position: absolute; top: 34px; right: 34px; width: 340px; max-height: calc(100% - 68px); overflow-y: auto; padding: 22px 22px 18px; border-radius: var(--r);
  background: var(--glass); backdrop-filter: blur(16px) saturate(1.2); border: 1px solid var(--glass-line); box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45); }
.card-x { position: absolute; top: 10px; right: 12px; border: 0; background: none; font-size: 22px; color: var(--ink-3); }
.card-level { font-size: 10.5px; letter-spacing: 0.24em; text-transform: uppercase; color: var(--brass); }
.card-name { font-family: var(--f-display); font-weight: 500; font-size: 36px; line-height: 1.05; margin: 8px 0 14px; }
.card-facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0 0 12px; font-size: 13px; }
.card-facts dt { color: var(--ink-3); }
.card-facts dd { margin: 0; color: var(--ink); }
.card-notes { font-size: 13px; line-height: 1.55; color: var(--ink-2); margin: 0 0 16px; }
.btn { border: 1px solid var(--glass-line); background: rgba(255, 250, 240, 0.06); padding: 10px 16px; border-radius: 12px; font-size: 13.5px; }
.btn.primary { background: var(--ink); color: var(--steel); border-color: var(--ink); font-weight: 550; }
.btn:disabled { opacity: 0.45; cursor: default; }
.card-hint { font-size: 11.5px; color: var(--ink-3); margin: 10px 0 0; }

.calib-pop { position: absolute; left: 34px; bottom: 78px; width: 420px; padding: 18px 20px; border-radius: var(--r); background: var(--glass);
  backdrop-filter: blur(16px); border: 1px solid var(--glass-line); box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45); font-size: 13px; }
.calib-pop h3 { font-family: var(--f-display); font-weight: 500; font-size: 22px; margin: 0 0 10px; }
.calib-pop table { width: 100%; border-collapse: collapse; }
.calib-pop td { padding: 7px 0; border-top: 1px solid var(--glass-line); vertical-align: top; }
.calib-pop td:last-child { text-align: right; color: var(--brass); white-space: nowrap; padding-left: 12px; }
.calib-pop small { display: block; color: var(--ink-3); margin-top: 2px; }
.calib-pop p { color: var(--ink-3); margin: 10px 0 0; line-height: 1.5; }

/* ------------------------------------------------------------------ coming next */
.soon { position: absolute; left: 50%; top: 46%; transform: translate(-50%, -50%); text-align: center; max-width: 520px; padding: 0 24px; }
.soon-kicker { font-size: 11px; letter-spacing: 0.26em; text-transform: uppercase; color: var(--brass); }
.soon h2 { font-family: var(--f-display); font-weight: 400; font-size: 54px; margin: 12px 0; }
.soon p { color: var(--ink-2); line-height: 1.6; }

@media (max-width: 760px) {
  :root { --bar-h: 108px; }
  .bar { grid-template-columns: 1fr auto; grid-template-rows: 52px 48px; padding: 0 14px; }
  .views { grid-column: 1 / -1; grid-row: 2; justify-self: center; }
  .paper { inset: 10px; }
  .room-card { left: 16px; right: 16px; top: auto; bottom: 16px; width: auto; }
  .plan-tools { left: 20px; bottom: 20px; }
  .zoom { right: 20px; bottom: 20px; }
  .calib-pop { left: 16px; right: 16px; width: auto; }
}

/* ------------------------------------------------------------------ 3D */
.view-3d { background: #cfd9df; }
.stage3d { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; }
.stage3d:active { cursor: grabbing; }
.loading { position: absolute; inset: 0; display: grid; place-content: center; gap: 14px; justify-items: center; background: var(--bg); z-index: 5; transition: opacity 0.6s; }
.loading span { font-family: var(--f-display); font-size: 22px; color: var(--ink-2); }
.loading-bar { width: 220px; height: 2px; background: rgba(255, 250, 240, 0.1); overflow: hidden; border-radius: 2px; }
.loading-bar i { display: block; height: 100%; width: 40%; background: var(--brass); animation: load 1.2s ease-in-out infinite; }
@keyframes load { from { transform: translateX(-100%); } to { transform: translateX(260%); } }
.loading.done { opacity: 0; pointer-events: none; }

.room-now { position: absolute; top: 22px; left: 22px; padding: 14px 18px 12px; border-radius: var(--r); background: var(--glass);
  backdrop-filter: blur(14px) saturate(1.2); border: 1px solid var(--glass-line); box-shadow: 0 14px 40px rgba(0, 0, 0, 0.25); min-width: 200px; }
.room-now-level { font-size: 10px; letter-spacing: 0.24em; text-transform: uppercase; color: var(--brass); }
.room-now-name { font-family: var(--f-display); font-size: 30px; line-height: 1.05; margin-top: 4px; }
.room-now-fc { font-size: 12px; color: var(--ink-2); margin-top: 4px; }
.minimap { position: absolute; left: 22px; bottom: 22px; width: 220px; height: 220px; border-radius: 16px; overflow: hidden;
  background: var(--paper); border: 1px solid rgba(0, 0, 0, 0.12); box-shadow: 0 14px 40px rgba(0, 0, 0, 0.28); }
.minimap-svg, .minimap-svg svg { width: 100%; height: 100%; display: block; }
.minimap-svg path { vector-effect: non-scaling-stroke; fill: none; stroke: var(--paper-ink); }
.minimap-svg .ink-fine { stroke-width: 0.4px; stroke: rgba(42, 38, 34, 0.45); }
.minimap-svg .ink-mid { stroke-width: 0.6px; stroke: rgba(42, 38, 34, 0.7); }
.minimap-svg .ink-wall { stroke-width: 0.8px; }
.minimap-svg .poche { fill: #2f2a25; stroke: none; }
.minimap-svg .me-cone { fill: rgba(201, 163, 106, 0.35); stroke: none; }
.minimap-svg .me-dot { fill: #b8732f; stroke: #fff; stroke-width: 1.5px; }
.minimap-label { position: absolute; top: 8px; right: 10px; font-size: 10px; letter-spacing: 0.1em; color: rgba(42, 38, 34, 0.55); }
.walk-hint { position: absolute; left: 50%; bottom: 26px; transform: translateX(-50%); padding: 10px 16px; border-radius: 999px; background: var(--glass);
  backdrop-filter: blur(12px); border: 1px solid var(--glass-line); font-size: 12.5px; color: var(--ink-2); white-space: nowrap; transition: opacity 0.8s; }
.walk-hint b { color: var(--ink); font-weight: 600; }
.walk-hint.gone { opacity: 0; pointer-events: none; }
.stick { position: absolute; right: 30px; bottom: 30px; width: 124px; height: 124px; border-radius: 50%; background: rgba(20, 19, 17, 0.35);
  border: 1px solid rgba(255, 250, 240, 0.25); backdrop-filter: blur(8px); touch-action: none; }
.stick i { position: absolute; left: 50%; top: 50%; width: 52px; height: 52px; margin: -26px 0 0 -26px; border-radius: 50%; background: rgba(243, 238, 230, 0.85); }
.doll-tools { position: absolute; left: 50%; bottom: 26px; transform: translateX(-50%); display: flex; align-items: center; gap: 14px; padding: 8px 10px 8px 8px;
  border-radius: 999px; background: var(--glass); backdrop-filter: blur(12px); border: 1px solid var(--glass-line); }
.doll-tools .chip { background: var(--ink); color: var(--steel); border: 0; box-shadow: none; }
.doll-tools .chip[aria-pressed="false"] { background: transparent; color: var(--ink-2); border: 1px solid var(--glass-line); }
.doll-tip { font-size: 12.5px; color: var(--ink-2); padding-right: 8px; }
.doll-pick { position: absolute; top: 22px; left: 22px; padding: 14px 18px; border-radius: var(--r); background: var(--glass); backdrop-filter: blur(14px);
  border: 1px solid var(--glass-line); }
.doll-pick b { display: block; font-family: var(--f-display); font-size: 28px; font-weight: 500; }
.doll-pick span { font-size: 12px; color: var(--ink-2); }
.tod { position: absolute; top: 22px; right: 22px; display: flex; gap: 2px; padding: 4px; border-radius: 999px; background: var(--glass);
  backdrop-filter: blur(12px); border: 1px solid var(--glass-line); z-index: 2; }
.tod button { display: flex; align-items: center; gap: 7px; border: 0; background: none; color: var(--ink-2); padding: 7px 13px 7px 10px;
  border-radius: 999px; font: 500 12.5px var(--f-ui); cursor: pointer; transition: background 0.25s, color 0.25s; }
.tod svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.tod button:hover { color: var(--ink); }
.tod button[aria-checked="true"] { background: var(--ink); color: var(--steel); }
.tod button[data-tod="golden"][aria-checked="true"] svg { stroke: #b8732f; }
@media (max-width: 760px) {
  .tod { top: 14px; right: 14px; }
  .tod span { display: none; }
  .tod button { padding: 8px; }
  .minimap { width: 150px; height: 150px; left: 14px; bottom: 14px; }
  .walk-hint { display: none; }
  .room-now { top: 14px; left: 14px; min-width: 0; padding: 10px 14px; }
  .room-now-name { font-size: 24px; }
}

/* ------------------------------------------------------------------ 360 gallery */
.view-gallery { background: radial-gradient(1400px 800px at 50% 0%, #1f1d19, var(--bg)); }
.gal-scroll { position: absolute; inset: 0; overflow-y: auto; padding: 34px 36px 48px; }
.gal-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; max-width: 1400px; margin: 0 auto 26px; }
.gal-kicker { font-size: 11px; letter-spacing: 0.26em; text-transform: uppercase; color: var(--brass); }
.gal-head h1 { font-family: var(--f-display); font-weight: 500; font-size: 42px; line-height: 1.05; margin: 8px 0 8px; }
.gal-head p { margin: 0; color: var(--ink-2); font-size: 14px; }
.seg { display: inline-flex; gap: 2px; padding: 4px; border-radius: 999px; background: var(--glass); border: 1px solid var(--glass-line); backdrop-filter: blur(12px); }
.seg button { border: 0; background: none; color: var(--ink-2); padding: 7px 16px; border-radius: 999px; font: 500 13px var(--f-ui); cursor: pointer; }
.seg button[aria-checked="true"] { background: var(--ink); color: var(--steel); }
.seg button:disabled { opacity: 0.35; cursor: default; }
.gal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; max-width: 1400px; margin: 0 auto; }
.gal-card { border: 0; padding: 0; background: var(--bg-2); border-radius: 16px; overflow: hidden; text-align: left; color: var(--ink); cursor: pointer;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.3); border: 1px solid var(--glass-line); transition: transform 0.35s, box-shadow 0.35s; }
.gal-card:hover { transform: translateY(-3px); box-shadow: 0 24px 50px rgba(0, 0, 0, 0.42); }
.gal-img { position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: #26241f; }
.gal-img img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.8s ease; }
.gal-card:hover .gal-img img { transform: scale(1.05); }
.gal-360 { position: absolute; top: 12px; right: 12px; padding: 4px 9px; border-radius: 999px; background: rgba(18, 17, 15, 0.62); font-size: 11px; letter-spacing: 0.08em; }
.gal-meta { padding: 14px 16px 16px; }
.gal-meta b { display: block; font-family: var(--f-display); font-weight: 500; font-size: 24px; }
.gal-meta span { font-size: 12px; color: var(--ink-3); }
.gal-empty { color: var(--ink-2); font-family: var(--f-display); font-size: 22px; }
.pano { position: absolute; inset: 0; background: #000; z-index: 6; }
.pano-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; }
.pano-canvas:active { cursor: grabbing; }
.pano-busy { position: absolute; top: 0; left: 0; right: 0; height: 2px; overflow: hidden; opacity: 0; transition: opacity 0.3s; }
.pano.busy .pano-busy { opacity: 1; }
.pano-busy i { display: block; width: 30%; height: 100%; background: var(--brass); animation: load 1.2s ease-in-out infinite; }
.pano-title { position: absolute; top: 22px; left: 22px; padding: 14px 18px 12px; border-radius: var(--r); background: var(--glass); backdrop-filter: blur(14px);
  border: 1px solid var(--glass-line); min-width: 200px; }
.pano-level { font-size: 10px; letter-spacing: 0.24em; text-transform: uppercase; color: var(--brass); }
.pano-name { font-family: var(--f-display); font-size: 30px; line-height: 1.05; margin-top: 4px; }
.pano-count { font-size: 12px; color: var(--ink-3); margin-top: 4px; }
.pano-top { position: absolute; top: 22px; right: 22px; display: flex; gap: 10px; align-items: center; }
.pano-x { width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--glass-line); background: var(--glass); color: var(--ink); font-size: 22px; cursor: pointer; backdrop-filter: blur(12px); }
.pano-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 48px; height: 48px; border-radius: 50%; border: 1px solid var(--glass-line);
  background: var(--glass); color: var(--ink); font-size: 30px; line-height: 1; cursor: pointer; backdrop-filter: blur(12px); }
.pano-nav.prev { left: 22px; } .pano-nav.next { right: 22px; }
.pano-plan { position: absolute; left: 22px; bottom: 22px; width: 190px; height: 190px; border-radius: 16px; overflow: hidden; background: var(--paper);
  border: 1px solid rgba(0, 0, 0, 0.12); box-shadow: 0 14px 40px rgba(0, 0, 0, 0.35); }
.pano-plan-svg, .pano-plan-svg svg { width: 100%; height: 100%; display: block; }
.pano-plan-svg path { vector-effect: non-scaling-stroke; fill: none; stroke: var(--paper-ink); }
.pano-plan-svg .ink-fine { stroke-width: 0.4px; stroke: rgba(42, 38, 34, 0.45); }
.pano-plan-svg .ink-mid { stroke-width: 0.6px; stroke: rgba(42, 38, 34, 0.7); }
.pano-plan-svg .ink-wall { stroke-width: 0.8px; }
.pano-plan-svg .poche { fill: #2f2a25; stroke: none; }
.pano-plan-svg .me-cone { fill: rgba(201, 163, 106, 0.4); stroke: none; }
.pano-plan-svg .me-dot { fill: #b8732f; stroke: #fff; stroke-width: 1.5px; }
.pano-walk { position: absolute; right: 22px; bottom: 22px; }
.pano-strip { position: absolute; left: 234px; right: 230px; bottom: 22px; display: flex; gap: 8px; overflow-x: auto; padding: 6px; border-radius: 14px;
  background: var(--glass); border: 1px solid var(--glass-line); backdrop-filter: blur(12px); scrollbar-width: none; }
.pano-strip button { flex: none; width: 118px; border: 0; padding: 0; background: none; color: var(--ink-2); cursor: pointer; border-radius: 9px; overflow: hidden;
  opacity: 0.72; transition: opacity 0.25s; text-align: left; }
.pano-strip button[aria-current="true"] { opacity: 1; outline: 2px solid var(--brass); outline-offset: -2px; }
.pano-strip img { width: 118px; height: 52px; object-fit: cover; display: block; }
.pano-strip span { display: block; font-size: 11px; padding: 4px 6px 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pano-hint { position: absolute; left: 50%; top: 26px; transform: translateX(-50%); padding: 9px 15px; border-radius: 999px; background: var(--glass);
  font-size: 12px; color: var(--ink-2); white-space: nowrap; backdrop-filter: blur(12px); pointer-events: none; }
.pano-hint b { color: var(--ink); font-weight: 600; }
@media (max-width: 1100px) { .pano-hint { display: none; } }
@media (max-width: 760px) {
  .gal-scroll { padding: 22px 14px 40px; }
  .gal-head { flex-direction: column; align-items: flex-start; }
  .gal-head h1 { font-size: 32px; }
  .pano-title { top: 14px; left: 14px; min-width: 0; padding: 10px 14px; }
  .pano-name { font-size: 22px; }
  .pano-top { top: 14px; right: 14px; }
  .pano-plan { display: none; }
  .pano-nav { display: none; }
  .pano-walk { right: 14px; bottom: 96px; }
  .pano-strip { left: 10px; right: 10px; bottom: 12px; }
}

/* ------------------------------------------------------------------ the guided tour */
.chip-tour { display: inline-flex; align-items: center; gap: 6px; background: var(--paper-ink); color: var(--paper); }
.chip-tour svg, .tour-go svg { width: 14px; height: 14px; fill: currentColor; }
.tour-go { position: absolute; right: 22px; bottom: 22px; display: flex; align-items: center; gap: 8px; padding: 12px 18px 12px 14px; border-radius: 999px;
  border: 0; background: var(--ink); color: var(--steel); font: 600 13.5px var(--f-ui); cursor: pointer; box-shadow: 0 14px 34px rgba(0, 0, 0, 0.3); }
.tour-go:hover { background: #fff; }
.tour-card { position: absolute; left: 50%; bottom: 24px; transform: translateX(-50%); width: min(560px, calc(100% - 280px)); padding: 18px 20px 14px;
  border-radius: 18px; background: var(--glass); backdrop-filter: blur(16px) saturate(1.2); border: 1px solid var(--glass-line);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35); overflow: hidden; }
.tour-kicker { font-size: 10.5px; letter-spacing: 0.24em; text-transform: uppercase; color: var(--brass); }
.tour-title { font-family: var(--f-display); font-size: 34px; line-height: 1.05; margin: 6px 0 4px; }
.tour-line { margin: 0 0 12px; color: var(--ink-2); font-size: 13.5px; line-height: 1.45; }
.tour-controls { display: flex; align-items: center; gap: 6px; }
.tour-controls button { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--glass-line); background: rgba(255, 250, 240, 0.06); color: var(--ink);
  display: grid; place-items: center; cursor: pointer; }
.tour-controls button svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tour-controls .tour-play { background: var(--ink); color: var(--steel); border: 0; }
.tour-controls .tour-play svg { fill: currentColor; stroke: none; }
.tour-controls .tour-x { width: auto; padding: 0 14px; border-radius: 999px; font: 500 12.5px var(--f-ui); margin-left: auto; color: var(--ink-2); }
.tour-dots { display: flex; gap: 5px; margin-left: 10px; }
.tour-dots i { width: 6px; height: 6px; border-radius: 50%; background: rgba(243, 238, 230, 0.25); }
.tour-dots i.done { background: rgba(201, 163, 106, 0.6); }
.tour-dots i.now { background: var(--brass); box-shadow: 0 0 0 3px rgba(201, 163, 106, 0.25); }
.tour-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: rgba(255, 250, 240, 0.06); }
.tour-bar i { display: block; height: 100%; width: 0; background: var(--brass); }
.fade { position: absolute; inset: 0; background: #0b0a09; opacity: 0; pointer-events: none; transition: opacity 0.42s ease; z-index: 4; }
.fade.on { opacity: 1; }
#app.touring .walk-hint, #app.touring .room-now, #app.touring .tour-go { display: none; }
@media (max-width: 760px) {
  .tour-go { top: 64px; bottom: auto; right: 14px; padding: 9px 14px 9px 11px; }
  .tour-card { width: calc(100% - 28px); bottom: 180px; padding: 14px 16px 12px; }
  .tour-title { font-size: 26px; }
  .tour-dots { display: none; }
}

/* ------------------------------------------------------------------ measure (plan) */
.plan-stage .measure line.dim { stroke: #b8732f; stroke-width: 2px; vector-effect: non-scaling-stroke; }
.plan-stage .measure line.dim.live { stroke-dasharray: 6 4; }
.plan-stage .measure line.dim-tick { stroke: #b8732f; stroke-width: 1.6px; vector-effect: non-scaling-stroke; }
.plan-stage .measure .dim-dot { fill: #fff; stroke: #b8732f; stroke-width: 1.6px; vector-effect: non-scaling-stroke; }
.plan-stage .measure .dim-label { fill: #6e3f14; font-family: var(--f-ui); font-weight: 650; text-anchor: middle; paint-order: stroke;
  stroke: var(--paper); stroke-width: 4px; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.measuring .plan-stage { cursor: crosshair; }

/* ------------------------------------------------------------------ saved views */
.views-pill { position: absolute; right: 22px; bottom: 76px; display: flex; gap: 2px; padding: 4px; border-radius: 999px; background: var(--glass);
  backdrop-filter: blur(12px); border: 1px solid var(--glass-line); }
.views-pill button { display: flex; align-items: center; gap: 6px; border: 0; background: none; color: var(--ink-2); padding: 7px 12px 7px 10px; border-radius: 999px;
  font: 500 12.5px var(--f-ui); cursor: pointer; }
.views-pill button:hover { color: var(--ink); background: rgba(255, 250, 240, 0.06); }
.views-pill svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.views-panel, .persp-panel, .edit-panel { position: absolute; right: 22px; bottom: 124px; width: 300px; max-height: 50vh; overflow: auto; border-radius: 16px; background: var(--glass);
  backdrop-filter: blur(16px); border: 1px solid var(--glass-line); box-shadow: 0 18px 44px rgba(0, 0, 0, 0.35); padding: 10px; }
.views-head { display: flex; align-items: center; justify-content: space-between; padding: 4px 6px 8px; }
.views-head b { font-family: var(--f-display); font-size: 22px; font-weight: 500; }
.views-head button { border: 0; background: none; color: var(--ink-2); font-size: 20px; cursor: pointer; }
.views-row { display: flex; align-items: center; gap: 8px; padding: 6px; border-radius: 10px; }
.views-row:hover { background: rgba(255, 250, 240, 0.05); }
.views-go { width: 34px; height: 34px; border-radius: 50%; border: 0; background: var(--ink); color: var(--steel); display: grid; place-items: center; cursor: pointer; flex: none; }
.views-go svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.views-meta { flex: 1; min-width: 0; }
.views-meta input { width: 100%; border: 0; background: none; color: var(--ink); font: 500 13.5px var(--f-ui); padding: 2px 0; }
.views-meta input:focus { outline: none; border-bottom: 1px solid var(--brass); }
.views-meta span { font-size: 11px; color: var(--ink-3); }
.views-del { border: 0; background: none; color: var(--ink-3); font-size: 18px; cursor: pointer; }
.views-empty { color: var(--ink-2); font-size: 13px; line-height: 1.5; margin: 4px 6px 8px; }
.toast { position: absolute; left: 50%; top: 22px; transform: translateX(-50%); padding: 9px 16px; border-radius: 999px; background: var(--ink); color: var(--steel);
  font: 600 12.5px var(--f-ui); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3); z-index: 3; }
#app.touring .views-pill, #app.touring .views-panel, #app.touring .persp-panel, #app.touring .edit-panel { display: none; }
@media (max-width: 760px) {
  .views-pill { top: 108px; bottom: auto; right: 14px; }
  .views-pill span { display: none; }
  .views-panel, .persp-panel, .edit-panel { top: 156px; bottom: auto; right: 14px; width: calc(100% - 28px); }
}

/* ------------------------------------------------------------------ measure (walk) */
.views-pill button[aria-pressed="true"] { background: var(--ink); color: var(--steel); }
.mlabel { position: absolute; transform: translate(-50%, -130%); padding: 7px 12px; border-radius: 10px; background: var(--ink); color: var(--steel);
  font: 700 14px var(--f-ui); pointer-events: none; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3); white-space: nowrap; z-index: 3; }
.mlabel span { font-weight: 500; font-size: 11.5px; color: #5d5448; margin-left: 8px; }
.wmeasuring .stage3d { cursor: crosshair; }

/* touch devices: the stick owns the bottom-right corner, the walk tools move under the time of day */
@media (pointer: coarse) {
  .views-pill { top: 76px; bottom: auto; right: 22px; }
  .views-panel, .persp-panel, .edit-panel { top: 124px; bottom: auto; right: 22px; }
  .tour-go { top: 128px; bottom: auto; right: 22px; }
  .views-panel:not([hidden]) ~ .tour-go { display: none; }
}
@media (pointer: coarse) and (max-width: 760px) {
  .views-pill { top: 64px; right: 14px; }
  .views-panel, .persp-panel, .edit-panel { top: 112px; right: 14px; }
  .tour-go { top: 112px; right: 14px; }
}

/* ------------------------------------------------------------------ 360 viewpoints on the plan */
.plan-stage .photo-cone { fill: rgba(184, 115, 47, 0.28); stroke: none; }
.plan-stage .photo-dot { fill: #b8732f; stroke: #fff; stroke-width: 2px; vector-effect: non-scaling-stroke; }
.plan-stage .photo:hover .photo-dot { fill: #8f5520; }

/* loading: a real progress bar once sizes are known; errors say what happened */
.loading.determinate .loading-bar i { animation: none; transition: width 0.3s ease; }
.loading span { text-align: center; }
.loading.failed span { font-family: var(--f-ui); font-size: 14px; max-width: 80vw; line-height: 1.5; }
.loading.failed .btn { margin-top: 14px; }
.loading.failed .loading-bar { display: none; }

/* ------------------------------------------------------------------ owner revisions on the plan (pipeline/revisions.json) */
.plan-stage .rev .rev-line, .minimap-svg .rev .rev-line { stroke: #b8732f; stroke-width: 1.5px; fill: rgba(184, 115, 47, 0.10); }
.plan-stage .rev .rev-fine, .minimap-svg .rev .rev-fine { stroke: #b8732f; stroke-width: 0.6px; }
.plan-stage .rev .rev-cloud, .minimap-svg .rev .rev-cloud { stroke: #b8732f; stroke-width: 1.1px; fill: none; }
.plan-stage .rev text, .minimap-svg .rev text { fill: #8a4f1c; font-family: var(--f-ui); font-weight: 650; text-anchor: middle; letter-spacing: 0.04em; }
.plan-stage .rev .rev-note, .minimap-svg .rev .rev-note { text-anchor: start; font-weight: 600; }

.chip.muted { opacity: 0.45; pointer-events: none; }

/* ------------------------------------------------------------------ perspective (walk) */
.persp-row { display: grid; grid-template-columns: 78px 1fr 52px; align-items: center; gap: 10px; padding: 6px 8px; font: 500 12.5px var(--f-ui); color: var(--ink-2); }
.persp-row output { text-align: right; color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.persp-row input[type="range"] { width: 100%; accent-color: var(--brass); cursor: pointer; }
.persp-presets { display: flex; gap: 6px; padding: 6px 8px 2px; flex-wrap: wrap; }
.persp-presets .chip { background: transparent; color: var(--ink-2); border: 1px solid var(--glass-line); box-shadow: none; }
.persp-presets .chip[aria-pressed="true"] { background: var(--ink); color: var(--steel); }
.persp-tip { margin: 8px 8px 4px; font: 400 12px/1.5 var(--f-ui); color: var(--ink-3); }
.persp-presets .chip i { font-style: normal; }

/* ------------------------------------------------------------------ finishes (the designer's selections) */
.card-finishes:empty { display: none; }
.card-finishes { margin: 0 0 16px; padding-top: 12px; border-top: 1px solid var(--glass-line); }
.fin-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 8px; }
.fin-head b { font-size: 10.5px; letter-spacing: 0.24em; text-transform: uppercase; color: var(--brass); font-weight: 600; }
.fin-src { font-size: 11px; color: var(--ink-3); }
.fin-list { display: grid; grid-template-columns: 86px 1fr; gap: 7px 12px; margin: 0; font-size: 12.5px; line-height: 1.4; }
.fin-list dt { color: var(--ink-3); }
.fin-list dd { margin: 0; color: var(--ink); }
.fin-paint { display: flex; align-items: center; gap: 8px; }
.fin-swatch { flex: none; width: 18px; height: 18px; border-radius: 5px; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18), 0 1px 2px rgba(0, 0, 0, 0.3); }
.fin-note { font-size: 12px; line-height: 1.5; color: var(--ink-3); margin: 10px 0 0; }

/* ------------------------------------------------------------------ edit (walk) */
.edit-body { padding: 4px 8px 8px; font: 500 12.5px var(--f-ui); color: var(--ink-2); }
.edit-body p { margin: 6px 0; line-height: 1.45; }
.edit-name { font: 600 15px var(--f-ui); color: var(--ink); margin: 4px 0 6px; text-transform: capitalize; }
.edit-scopes, .edit-row, .edit-removed li { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.edit-scopes { margin-bottom: 8px; }
.edit-scopes .chip, .edit-row .chip, .edit-removed .chip { background: transparent; color: var(--ink-2); border: 1px solid var(--glass-line); box-shadow: none; min-height: 34px; text-transform: capitalize; }
.edit-scopes .chip[aria-pressed="true"] { background: var(--brass); color: #fff; border-color: var(--brass); }
.edit-row { margin: 6px 0; }
.edit-row .chip.warn { color: #9a3b1c; border-color: #d9a48f; }
.edit-pad { display: grid; grid-template-columns: repeat(3, 40px); gap: 4px; }
.edit-pad button { height: 36px; border-radius: 10px; border: 1px solid var(--glass-line); background: transparent; color: var(--ink); cursor: pointer; font-size: 15px; }
.edit-removed { list-style: none; margin: 8px 0 0; padding: 8px 0 0; border-top: 1px solid var(--glass-line); }
.edit-removed li { justify-content: space-between; padding: 3px 0; text-transform: capitalize; }
.edit-foot { margin-top: 8px; font-size: 11.5px; opacity: 0.8; }
#app.wediting .walk-hint { display: none; }

/* ------------------------------------------------------------------ the tour on a phone (Jerry, 10-14:
   "the box is in the way"): a slim bar on the bottom edge, not a panel in the middle of the view.
   The tour drives, so the minimap and the stick step aside until it ends; title and controls share
   one row, the line underneath at most two short lines */
@media (max-width: 760px), (max-height: 520px) {
  #app.touring .minimap, #app.touring .stick { display: none; }
  .tour-card { bottom: calc(10px + env(safe-area-inset-bottom)); width: min(560px, calc(100% - 20px)); padding: 9px 10px 11px 14px;
    border-radius: 14px; display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 10px; align-items: center; }
  .tour-card[hidden] { display: none; }
  .tour-kicker { grid-column: 1; grid-row: 1; font-size: 9px; letter-spacing: 0.2em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .tour-title { grid-column: 1; grid-row: 2; font-size: 20px; margin: 2px 0 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .tour-controls { grid-column: 2; grid-row: 1 / span 2; gap: 4px; }
  .tour-controls button { width: 32px; height: 32px; }
  .tour-controls .tour-x { padding: 0 10px; font-size: 11.5px; margin-left: 2px; }
  .tour-line { grid-column: 1 / -1; grid-row: 3; margin: 6px 0 0; font-size: 12px; line-height: 1.4;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
}
