/* ── /listings/:slug/tour/walk — the Walk editor (mockup A) ────────────────
   Reproduces artboard A's layout, sizes, spacing, glass, type and icons. The
   360 under the chrome is the buyer's own viewer (tour-viewer.js/css), so the
   marker look cannot drift. This sheet only styles the editor chrome and the
   selection/tap overlays that sit on top of it. */

.tw-stage {
  --cream: #fffdf4;
  --ink-90: hsla(47, 100%, 97.78%, .9);
  --ink-60: hsla(47, 100%, 97.78%, .6);
  --ink-40: hsla(47, 100%, 97.78%, .4);
  --hair: hsla(47, 100%, 97.78%, .09);
  --hair-soft: hsla(47, 100%, 97.78%, .05);
  --emerald: #3EE092;
  --sel: #fff083;
  --glass: hsla(0, 0%, 3%, .52);
  --glass-2: hsla(0, 0%, 3%, .62);
  --r: 6px;

  position: fixed;
  inset: 0;
  z-index: 50;
  isolation: isolate;
  background: #050505;
  color: var(--ink-90);
  font-family: "Geist", "Geist Sans", "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  user-select: none;
}

/* ── the buyer viewer, filling the frame ─────────────────────────────────── */
.tw-stage .pk-stage { position: absolute; inset: 0; }
.tw-stage .pk-stage,
.tw-stage .pk-stage * { pointer-events: auto; }
/* Hide the buyer chrome: the editor draws its own top bar, strip and panels. */
.tw-stage .pk-ui { display: none !important; }
/* The editor draws its OWN pointers (dashed rings) over the 360, so the buyer's
   markers and their hover labels stay off — the 360 renderer, scenes, poses and
   saved views are still the buyer's; only the marker chrome is the editor's. */
.tw-stage .pk-stage .pk-pt,
.tw-stage .pk-stage .pk-ptf,
.tw-stage .pk-stage .pk-pt-label,
.tw-stage .pk-stage .pk-ptl { display: none !important; }

/* ── editor layers above the 360 ─────────────────────────────────────────── */
.tw-view { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block; }
.tw-drag {
  position: absolute; inset: 0; z-index: 10; cursor: grab;
  background: transparent; touch-action: none;
}
.tw-drag.dragging { cursor: grabbing; }
.tw-overlay { position: absolute; inset: 0; z-index: 12; pointer-events: none; }
.tw-overlay > * { pointer-events: auto; }
.tw-tag-layer { position: absolute; inset: 0; z-index: 13; pointer-events: none; overflow: visible; }
.tw-tag-layer > * { pointer-events: auto; }

/* ── top bar (spec 25), exactly mockup A ─────────────────────────────────── */
.tw-bar {
  position: absolute; left: 0; right: 0; top: 0; height: 60px; z-index: 30;
  display: flex; align-items: center; gap: 8px; padding: 0 14px;
}
.tw-bar-blur {
  position: absolute; inset: 0; z-index: -1;
  backdrop-filter: blur(22px) saturate(1.1);
  -webkit-backdrop-filter: blur(22px) saturate(1.1);
}
.tw-bar-tint {
  position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(to bottom, hsla(0,0%,3%,.62), hsla(0,0%,3%,.28) 60%, transparent);
}
.tw-back {
  display: flex; align-items: center; gap: 7px; height: 32px; padding: 0 10px 1px;
  border-radius: var(--r); color: var(--ink-60); font-size: 13px; font-weight: 500;
  background: transparent; border: 0; cursor: pointer;
}
.tw-back:hover { color: var(--ink-90); background: hsla(47,100%,97.78%,.06); }
.tw-tname { font-size: 15px; font-weight: 600; letter-spacing: -.01em; color: var(--ink-90); }
.tw-spring { flex: 1; }
.tw-seg { display: flex; padding: 3px; border-radius: var(--r); background: hsla(47,100%,97.78%,.08); }
.tw-seg button {
  display: flex; align-items: center; height: 26px; padding: 0 12px 1px; border-radius: 4px;
  font-size: 13px; font-weight: 600; color: var(--ink-60); background: transparent; border: 0; cursor: pointer;
}
.tw-seg button.on { background: hsla(47,100%,97.78%,.12); color: var(--ink-90); }
.tw-ic {
  display: flex; align-items: center; justify-content: center; width: 32px; height: 32px;
  border-radius: var(--r); color: var(--ink-90); background: hsla(47,100%,97.78%,.08);
  border: 0; cursor: pointer;
}
.tw-ic:hover { background: hsla(47,100%,97.78%,.16); }
.tw-btn {
  display: flex; align-items: center; gap: 8px; height: 32px; padding: 0 14px 1px;
  border-radius: var(--r); font-size: 13px; font-weight: 600; color: var(--ink-90);
  background: hsla(47,100%,97.78%,.08); border: 0; cursor: pointer;
}
.tw-btn:hover { background: hsla(47,100%,97.78%,.16); }
.tw-btn.pri { background: var(--emerald); color: #1c1708; }
.tw-btn.pri:hover { filter: brightness(1.05); }

/* ── flag (spec 26): half-transparent until it marks the start ───────────── */
.tw-flag {
  position: absolute; left: 24px; z-index: 20; display: flex; align-items: center;
  justify-content: center; width: 40px; height: 40px; border-radius: var(--r);
  background: var(--glass-2); border: 0; cursor: pointer; color: var(--ink-90);
  backdrop-filter: blur(30px) saturate(1.15); -webkit-backdrop-filter: blur(30px) saturate(1.15);
  opacity: .5;
}
.tw-flag.on { opacity: 1; color: var(--sel); }

/* ── selection ring + tap halo + toolbox overlays ───────────────────────── */
/* Each hotspot is its own pointer overlay: a dashed ring, the arrow glyph, its
   label and the large soft tap halo. It IS the hit target — click selects,
   double click travels, a drag moves the pointer. Hidden sits at 50% (spec 5). */
.tw-mark {
  position: absolute; z-index: 14; width: 64px; height: 64px; margin: -32px 0 0 -32px;
  pointer-events: auto; cursor: pointer; touch-action: none;
}
.tw-mark.hidden { opacity: .5; }
.tw-mark .tap {
  position: absolute; left: 50%; top: 50%; width: 260px; height: 260px;
  margin: -130px 0 0 -130px; border-radius: 50%; pointer-events: none; z-index: -1;
  opacity: 0; transition: opacity .14s ease;
  background: radial-gradient(circle, hsla(47,100%,97.78%,.16) 0%, hsla(47,100%,97.78%,.07) 38%,
    hsla(47,100%,97.78%,.02) 64%, transparent 78%);
}
.tw-mark:hover .tap,
.tw-mark.sel .tap { opacity: .5; }
.tw-mark.sel .tap {
  background: radial-gradient(circle, hsla(56,100%,76%,.22) 0%, hsla(56,100%,76%,.09) 38%,
    hsla(56,100%,76%,.03) 64%, transparent 78%);
}
.tw-mark .ring {
  position: absolute; inset: 0; border-radius: 50%;
  border: 1.4px dashed hsla(47,100%,97.78%,.55);
  background: hsla(0,0%,3%,.22);
  backdrop-filter: blur(14px) saturate(1.1); -webkit-backdrop-filter: blur(14px) saturate(1.1);
  display: flex; align-items: center; justify-content: center; color: var(--ink-90);
}
.tw-mark.sel .ring { border-color: var(--sel); color: var(--sel); }
.tw-mark .glyph { width: 20px; height: 20px; }
.tw-mark.sel .glyph { width: 22px; height: 22px; }
.tw-mark.sel { cursor: move; }
.tw-mark .plabel {
  position: absolute; top: 72px; left: 50%; transform: translateX(-50%); white-space: nowrap;
  font-size: 13px; font-weight: 500; color: var(--ink-90);
}
.tw-mark.sel .plabel { color: var(--sel); }
.tw-toolbox {
  position: absolute; left: 50%; transform: translateX(-50%); top: -52px;
  display: flex; gap: 2px; padding: 3px; border-radius: var(--r);
  background: var(--glass-2);
  backdrop-filter: blur(30px) saturate(1.15); -webkit-backdrop-filter: blur(30px) saturate(1.15);
  pointer-events: auto;
}
.tw-toolbox button {
  display: flex; align-items: center; justify-content: center; width: 30px; height: 30px;
  border-radius: 4px; color: var(--ink-90); background: transparent; border: 0; cursor: pointer;
}
.tw-toolbox button:hover { background: hsla(47,100%,97.78%,.12); }
.tw-toolbox button.on { color: var(--sel); }
.tw-toolbox button.warn:hover { color: #ff6b6b; }
.tw-rotate {
  position: absolute; left: 50%; top: 50%; width: 20px; height: 20px; margin: -34px 0 0 -10px;
  border-radius: 50%; background: var(--sel); color: #1c1708; border: 0; cursor: grab;
  display: none; align-items: center; justify-content: center; pointer-events: auto;
}
.tw-mark.sel .tw-rotate { display: flex; }

/* ── tags (spec 11): palette colour, shape, leader line with end dot ─────── */
.tw-tag {
  position: absolute; z-index: 14; display: flex; align-items: center; gap: 8px;
  height: 32px; padding: 0 12px 1px; border-radius: var(--r);
  background: var(--glass-2); backdrop-filter: blur(30px) saturate(1.15);
  -webkit-backdrop-filter: blur(30px) saturate(1.15);
  pointer-events: auto;
}
.tw-tag .dot { width: 7px; height: 7px; border-radius: 50%; }
.tw-tag span { font-size: 13px; font-weight: 500; color: var(--ink-90); }
.tw-tag.sel { box-shadow: 0 0 0 1.4px var(--sel); }
.tw-leader { position: absolute; left: 0; top: 0; z-index: 13; pointer-events: none; }

/* ── right panel (spec 20) ──────────────────────────────────────────────── */
.tw-panel {
  position: absolute; z-index: 25; right: 20px; top: 76px; bottom: 152px; width: 316px;
  display: flex; flex-direction: column; border-radius: var(--r); overflow: hidden;
  background: var(--glass-2); backdrop-filter: blur(30px) saturate(1.15);
  -webkit-backdrop-filter: blur(30px) saturate(1.15);
}
.tw-panel .ph { padding: 14px 16px 10px; }
.tw-panel .ph b { font-size: 15px; font-weight: 600; color: var(--ink-90); }
.tw-panel .ph em { font-style: normal; font-size: 13px; color: var(--ink-60); margin-left: 8px; }
.tw-panel .rows { padding: 0 16px; overflow-y: auto; }
.tw-row { display: flex; align-items: center; justify-content: space-between; min-height: 34px; }
.tw-row + .tw-row { border-top: 1px solid var(--hair-soft); }
.tw-row .k { font-size: 13px; color: var(--ink-60); font-weight: 500; }
.tw-row .v { font-size: 13px; color: var(--ink-90); font-weight: 500; display: flex; align-items: center; gap: 8px; }
.tw-row .v.ghost { color: var(--ink-40); cursor: pointer; }
.tw-stack { padding: 10px 0; }
.tw-stack + .tw-stack { border-top: 1px solid var(--hair-soft); }
.tw-stack .k { font-size: 13px; color: var(--ink-60); font-weight: 500; display: block; margin-bottom: 9px; }
.tw-field {
  width: 100%; box-sizing: border-box; padding: 8px 10px 9px; border-radius: 4px;
  background: hsla(47,100%,97.78%,.07); font-size: 13px; font-weight: 500;
  color: var(--ink-90); border: 0; outline: none; font-family: inherit;
}
.tw-field:focus { background: hsla(47,100%,97.78%,.12); }
.tw-styles { display: flex; gap: 6px; }
.tw-styles button {
  flex: 1; display: flex; align-items: center; justify-content: center; height: 38px;
  border-radius: 4px; background: hsla(47,100%,97.78%,.07); color: var(--ink-60); border: 0; cursor: pointer;
}
.tw-styles button.on { background: hsla(56,100%,76%,.16); color: var(--sel); }
.tw-pal { display: flex; gap: 9px; flex-wrap: wrap; }
.tw-pal button { position: relative; width: 20px; height: 20px; border-radius: 50%; border: 0; cursor: pointer; display: block; padding: 0; }
.tw-pal button.on::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 1.4px solid var(--ink-60); }
.tw-sl { position: relative; height: 16px; display: flex; align-items: center; }
.tw-sl input[type="range"] {
  position: absolute; inset: 0; width: 100%; margin: 0; -webkit-appearance: none; appearance: none;
  background: transparent; cursor: pointer;
}
.tw-sl input[type="range"]::-webkit-slider-runnable-track { height: 2px; background: hsla(47,100%,97.78%,.14); border-radius: 2px; }
.tw-sl input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 12px; height: 12px; border-radius: 50%;
  background: var(--cream); margin-top: -5px;
}
.tw-tgl { position: relative; width: 34px; height: 20px; border-radius: 10px; background: hsla(47,100%,97.78%,.14); border: 0; cursor: pointer; padding: 0; }
.tw-tgl i { position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: var(--ink-60); transition: left .12s, background .12s; }
.tw-tgl.on { background: var(--emerald); }
.tw-tgl.on i { left: 17px; background: #1c1708; }
.tw-pfoot { display: flex; align-items: center; justify-content: space-between; padding: 10px 16px; border-top: 1px solid var(--hair-soft); }
.tw-pfoot .scan { font-size: 13px; color: var(--ink-40); }
.tw-del { display: flex; align-items: center; gap: 8px; height: 32px; padding: 0 12px 1px; border-radius: var(--r); background: transparent; border: 0; color: var(--ink-60); font-size: 13px; font-weight: 500; cursor: pointer; }
.tw-del:hover { color: #ff6b6b; background: hsla(0,80%,60%,.12); }
.tw-type-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 16px; border-bottom: 1px solid var(--hair-soft); }
.tw-type-chips button {
  height: 26px; padding: 0 10px 1px; border-radius: 13px; font-size: 12px; font-weight: 600;
  color: var(--ink-60); background: hsla(47,100%,97.78%,.07); border: 0; cursor: pointer;
}
.tw-type-chips button.on { background: var(--emerald); color: #1c1708; }

/* ── peek (spec 19/21/23): frameless image on the glass, options below ───── */
.tw-peek {
  position: absolute; z-index: 26; left: 24px; width: 376px; overflow: hidden;
  display: flex; flex-direction: column; border-radius: var(--r);
  background: var(--glass-2); backdrop-filter: blur(30px) saturate(1.15);
  -webkit-backdrop-filter: blur(30px) saturate(1.15);
}
.tw-peek-img { position: relative; overflow: hidden; border-radius: var(--r) var(--r) 0 0; height: 212px; background: #0b0b0b; }
.tw-peek-view { position: absolute; inset: 0; }
.tw-peek-img .name {
  position: absolute; left: 12px; bottom: 10px; font-size: 13px; font-weight: 600;
  color: var(--cream); z-index: 2;
}
.tw-peek-img .scrim { position: absolute; inset: auto 0 0 0; height: 60px; z-index: 1; background: linear-gradient(to top, hsla(0,0%,3%,.55), transparent); }
.tw-popts { padding: 8px 16px 12px; }
.tw-puse {
  margin-top: 12px; display: flex; align-items: center; justify-content: center; height: 34px;
  border-radius: var(--r); background: var(--emerald); color: #1c1708;
  font-size: 13px; font-weight: 600; border: 0; cursor: pointer; width: 100%;
}
.tw-puse:hover { filter: brightness(1.05); }

/* ── film strip (spec 22): large cards, floor chips, hover < 100 ms ──────── */
.tw-strip {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 22; height: 152px;
  display: flex; align-items: center; gap: 12px; padding: 0 20px;
  background: linear-gradient(to top, hsla(0,0%,3%,.68), transparent);
}
.tw-floors { display: flex; flex-direction: column; gap: 6px; padding-right: 8px; }
.tw-floors button {
  display: flex; align-items: center; height: 30px; padding: 0 12px 1px; border-radius: var(--r);
  font-size: 13px; font-weight: 600; color: var(--ink-60); background: hsla(47,100%,97.78%,.07); border: 0; cursor: pointer;
}
.tw-floors button.on { color: var(--ink-90); background: hsla(47,100%,97.78%,.12); }
.tw-cards { display: flex; gap: 12px; overflow-x: auto; align-items: center; flex: 1; padding: 8px 4px; }
.tw-card {
  position: relative; flex: 0 0 auto; width: 186px; height: 112px; border-radius: var(--r);
  overflow: hidden; border: 0; padding: 0; cursor: pointer; background: #111;
}
.tw-card img { display: block; width: 100%; height: 100%; object-fit: cover; opacity: .86; }
.tw-card .cn { position: absolute; left: 10px; bottom: 8px; font-size: 13px; font-weight: 600; color: var(--cream); z-index: 2; }
.tw-card .cs { position: absolute; inset: auto 0 0 0; height: 52px; background: linear-gradient(to top, hsla(0,0%,3%,.6), transparent); }
.tw-card.on::after { content: ""; position: absolute; inset: 0; border-radius: var(--r); box-shadow: inset 0 0 0 2px var(--sel); }
.tw-card.hidden-scene img { opacity: .45; }

/* ── toast ──────────────────────────────────────────────────────────────── */
.tw-toast {
  position: absolute; left: 50%; bottom: 176px; transform: translateX(-50%); z-index: 40;
  padding: 9px 16px; border-radius: var(--r); font-size: 13px; font-weight: 500;
  background: var(--glass-2); color: var(--ink-90); opacity: 0; transition: opacity .18s;
  pointer-events: none;
}
.tw-toast.show { opacity: 1; }
