/* Public tour page */
html, body { margin: 0; height: 100%; background: #111; overflow: hidden; }
body { font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: #fff; }
#pano { position: fixed; inset: 0; width: 100%; height: 100%; }

/* pannellum's own info box is not used */
.pnlm-panorama-info { display: none !important; }
.pnlm-controls-container { top: auto; bottom: 120px; left: 12px; }

.tour-head {
  position: fixed; top: 0; left: 0; right: 0; z-index: 5;
  display: flex; justify-content: space-between; align-items: flex-start; gap: 12px;
  padding: max(14px, env(safe-area-inset-top)) 18px 30px;
  background: linear-gradient(rgba(0,0,0,.65), rgba(0,0,0,0));
  pointer-events: none;
}
.tour-titles { min-width: 0; }
.eyebrow { margin: 0 0 2px !important; font-size: 12px !important; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #ffb4ab; }
.tour-head .meta { font-size: 13px; opacity: .85; }
.tour-buttons { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; align-items: center; pointer-events: auto; }
.pill {
  display: inline-block; padding: 8px 14px; border-radius: 99px; border: 1px solid rgba(255,255,255,.7);
  background: rgba(0,0,0,.45); color: #fff; font-family: inherit; font-size: 14px; font-weight: 600; line-height: 1.2; text-decoration: none; cursor: pointer; white-space: nowrap;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.pill.solid { background: #fff; color: #10213a; border-color: #fff; }
.finding-pill { background: rgba(205,40,40,.92); border-color: rgba(255,255,255,.9); }
.info-inner .pill { border-color: #10213a; color: #10213a; background: #fff; backdrop-filter: none; }
.info-inner .pill.solid { background: #10213a; color: #fff; }
.muted-dark { color: #666; font-size: 14px; margin-top: -4px !important; }
.findings-list { list-style: none; padding: 0; margin: 0 0 14px; }
.findings-list li { border-top: 1px solid #eee; }
.findings-list button {
  display: block; width: 100%; text-align: left; background: none; border: 0; padding: 11px 4px 11px 28px; cursor: pointer;
  position: relative; font: inherit; color: inherit;
}
.findings-list button::before { content: "!"; position: absolute; left: 2px; top: 12px; width: 18px; height: 18px; border-radius: 50%; background: #c62828; color: #fff; font: 700 12px/18px system-ui; text-align: center; }
.findings-list button:hover { background: #fdf3f2; }
.findings-list strong { display: block; }
.findings-list span { font-size: 13px; color: #666; }
.facts { font-weight: 700; font-size: 16px; }
.agent { border-top: 1px solid #eee; margin-top: 14px; padding-top: 14px; }
.agent strong, .agent span { display: block; }
.agent span { color: #666; font-size: 14px; }
.agent-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.tour-head h1 { margin: 0; font-size: 20px; font-weight: 650; text-shadow: 0 1px 4px rgba(0,0,0,.6); }
.tour-head p { margin: 2px 0 0; font-size: 14px; opacity: .9; text-shadow: 0 1px 4px rgba(0,0,0,.6); }
.tour-head .room { font-weight: 600; opacity: 1; margin-top: 6px; }
.preview-badge { background: #e8a400; color: #000; font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 99px; white-space: nowrap; }

.strip {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 5;
  display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none;
  padding: 26px 14px max(14px, env(safe-area-inset-bottom));
  background: linear-gradient(rgba(0,0,0,0), rgba(0,0,0,.7));
}
.strip::-webkit-scrollbar { display: none; }
.strip-item {
  flex: 0 0 auto; position: relative; width: 132px; height: 74px;
  border: 2px solid rgba(255,255,255,.35); border-radius: 8px;
  background: #333 center/cover no-repeat; cursor: pointer; padding: 0; overflow: hidden;
}
.strip-item span {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 4px 6px;
  font-size: 12px; color: #fff; text-align: left; background: rgba(0,0,0,.6);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.strip-item.active { border-color: #fff; box-shadow: 0 0 0 2px rgba(20,110,190,.9); }
.strip-item:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

.info-card {
  position: fixed; inset: 0; z-index: 20; display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,.45); padding: 16px;
}
.info-card[hidden] { display: none; }
.info-inner {
  position: relative; width: 100%; max-width: 440px; max-height: 80vh; overflow: auto;
  background: #fff; color: #1d1d1f; border-radius: 14px; padding: 22px 22px 18px;
  box-shadow: 0 20px 60px rgba(0,0,0,.4);
}
.info-kind { margin: 0 0 4px; font-size: 13px; font-weight: 600; color: #555; }
.info-card.finding .info-kind { color: #c62828; }
.info-card.finding .info-inner { border-top: 5px solid #c62828; }
.info-card .info-inner h2 { padding-right: 30px; }
.info-inner h2 { margin: 0 0 10px; font-size: 19px; }
.info-inner p { margin: 0 0 10px; line-height: 1.5; }
.info-close {
  position: absolute; top: 8px; right: 10px; width: 34px; height: 34px;
  border: 0; border-radius: 50%; background: #f0f0f2; font-size: 22px; line-height: 1; cursor: pointer; color: #333;
}

@media (max-width: 600px) {
  .tour-head { flex-direction: column; }
  .tour-buttons { justify-content: flex-start; }
  .tour-head h1 { font-size: 17px; }
  .pill { padding: 7px 12px; font-size: 13px; }
  .strip-item { width: 104px; height: 60px; }
  .pnlm-controls-container { bottom: 100px; }
}

/* hotspot hover label (krpano) */
.iv-krtip {
  position: fixed; z-index: 30; transform: translate(-50%, -100%); pointer-events: none;
  max-width: 260px; padding: 5px 10px; border-radius: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  background: rgba(0,0,0,.8); color: #fff; font: 600 13px/1.3 system-ui, -apple-system, "Segoe UI", sans-serif;
}

/* floor plan mini map */
.minimap {
  position: fixed; right: 12px; bottom: 112px; z-index: 6; width: 240px;
  background: rgba(255,255,255,.95); border-radius: 10px; box-shadow: 0 6px 24px rgba(0,0,0,.35); overflow: hidden;
  transition: width .2s ease;
}
.minimap.big { width: min(520px, calc(100vw - 24px)); }
.minimap[hidden] { display: none; }
.minimap-head { display: flex; align-items: center; gap: 6px; padding: 5px 6px 5px 10px; background: #10213a; color: #fff; font-size: 13px; font-weight: 600; }
.minimap-title { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.minimap-head select { flex: 1; font: inherit; font-weight: 600; background: transparent; color: #fff; border: 0; }
.minimap-head select option { color: #000; }
.minimap-head button { background: rgba(255,255,255,.15); color: #fff; border: 0; border-radius: 6px; width: 26px; height: 24px; cursor: pointer; font-size: 14px; }
#minimap-box { padding: 6px; max-height: 60vh; overflow: auto; }
.map-pill { position: fixed; right: 12px; bottom: 112px; z-index: 6; }
.ivpm-stage { position: relative; line-height: 0; user-select: none; }
.ivpm-img { width: 100%; height: auto; display: block; }
.ivpm-dot {
  position: absolute; width: 14px; height: 14px; margin: -7px 0 0 -7px; padding: 0; z-index: 2;
  border-radius: 50%; border: 2px solid #fff; background: #146ebe; box-shadow: 0 1px 4px rgba(0,0,0,.45); cursor: pointer;
}
.ivpm-dot.on { background: #e8a400; width: 18px; height: 18px; margin: -9px 0 0 -9px; z-index: 3; }
.ivpm-cone { position: absolute; width: 90px; height: 90px; z-index: 1; pointer-events: none; }
.ivpm-cone path { fill: rgba(232,164,0,.35); stroke: rgba(232,164,0,.9); stroke-width: 1.5; }
@media (max-width: 600px) {
  .minimap, .map-pill { bottom: 92px; }
  .minimap { width: 180px; }
}

/* dollhouse (3D model) */
.dh-wrap { position: relative; width: 100%; height: 100%; overflow: hidden; background: radial-gradient(ellipse at center, #f7f8fa 0%, #dfe3e9 100%); touch-action: none; }
.dh-wrap canvas { display: block; width: 100%; height: 100%; }
.dh-labels { position: absolute; inset: 0; pointer-events: none; }
.dh-dot { position: absolute; left: 0; top: 0; pointer-events: auto; background: none; border: 0; padding: 0; cursor: pointer; }
.dh-dot-mark { position: absolute; left: -9px; top: -9px; width: 18px; height: 18px; border-radius: 50%; background: #146ebe; border: 3px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.4); }
.dh-dot.on .dh-dot-mark { background: #e8a400; }
.dh-dot-label { position: absolute; left: 50%; top: -38px; transform: translateX(-50%); white-space: nowrap; padding: 3px 8px; border-radius: 6px; background: rgba(16,33,58,.88); color: #fff; font: 600 12px/1.3 system-ui, -apple-system, "Segoe UI", sans-serif; }
.dh-ui { position: absolute; left: 10px; right: 10px; bottom: 10px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font: 600 13px/1.3 system-ui, -apple-system, "Segoe UI", sans-serif; color: #10213a; pointer-events: none; }
.dh-ui > * { pointer-events: auto; }
.dh-cut { display: flex; align-items: center; gap: 8px; background: rgba(255,255,255,.92); padding: 6px 10px; border-radius: 99px; box-shadow: 0 2px 8px rgba(0,0,0,.15); margin: 0; font-weight: 600; font-size: 13px; }
.dh-cut input { width: 140px; margin: 0; padding: 0; }
.dh-reset { background: rgba(255,255,255,.92); border: 0; padding: 7px 12px; border-radius: 99px; box-shadow: 0 2px 8px rgba(0,0,0,.15); cursor: pointer; font: inherit; color: inherit; }
.dh-status { background: rgba(255,255,255,.85); padding: 5px 10px; border-radius: 6px; }
.dh-status:empty { display: none; }

/* 3D view overlay on the public tour */
.dh-overlay { position: fixed; inset: 0; z-index: 25; background: #e9ecf1; display: flex; flex-direction: column; }
.dh-overlay[hidden] { display: none; }
.dh-bar { display: flex; align-items: center; gap: 8px; padding: max(10px, env(safe-area-inset-top)) 12px 10px; background: #10213a; color: #fff; }
.dh-bar strong { flex: 1; font-size: 15px; }
.dh-bar select { font: inherit; background: rgba(255,255,255,.15); color: #fff; border: 0; border-radius: 6px; padding: 4px 6px; }
.dh-bar select option { color: #000; }
.dh-bar button { background: rgba(255,255,255,.15); color: #fff; border: 0; border-radius: 8px; padding: 6px 12px; font: 600 14px system-ui, sans-serif; cursor: pointer; }
#dh-box { flex: 1; min-height: 0; }
.dh-level { background: rgba(255,255,255,.92); border: 0; padding: 6px 10px; border-radius: 99px; box-shadow: 0 2px 8px rgba(0,0,0,.15); font: inherit; color: inherit; }
.dh-level[hidden] { display: none; }

/* empty / staged switch */
.ba-toggle { position: fixed; left: 50%; bottom: 122px; transform: translateX(-50%); z-index: 6; display: flex; padding: 4px; gap: 4px;
  background: rgba(0,0,0,.55); border-radius: 99px; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); box-shadow: 0 4px 16px rgba(0,0,0,.35); }
.ba-toggle[hidden] { display: none; }
.ba-toggle button { border: 0; border-radius: 99px; padding: 9px 20px; background: transparent; color: #fff; font: 600 15px/1.1 system-ui, -apple-system, "Segoe UI", sans-serif; cursor: pointer; }
.ba-toggle button.on { background: #fff; color: #10213a; }
@media (max-width: 600px) { .ba-toggle { bottom: 98px; } .ba-toggle button { padding: 8px 16px; font-size: 14px; } }

/* sliding before / after line */
.cmp-layer { position: fixed; inset: 0; z-index: 2; pointer-events: none; }
.cmp-layer[hidden], .cmp-divider[hidden], .cmp-tag[hidden] { display: none; }
#cmp-pano { position: absolute; inset: 0; width: 100%; height: 100%; }
.cmp-divider { position: fixed; top: 0; bottom: 0; left: 50%; width: 44px; margin-left: -22px; z-index: 4; cursor: ew-resize; touch-action: none; }
.cmp-divider::before { content: ""; position: absolute; top: 0; bottom: 0; left: 50%; width: 3px; margin-left: -1.5px; background: #fff; box-shadow: 0 0 6px rgba(0,0,0,.5); }
.cmp-handle { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 46px; height: 46px; border-radius: 50%;
  background: #fff; color: #10213a; display: flex; align-items: center; justify-content: center; font-size: 13px; letter-spacing: -2px; box-shadow: 0 2px 10px rgba(0,0,0,.45); }
.cmp-divider:focus-visible .cmp-handle { outline: 3px solid #146ebe; }
.cmp-tag { position: fixed; top: 50%; z-index: 4; margin: 34px 12px 0; padding: 4px 10px; border-radius: 6px; background: rgba(0,0,0,.6); color: #fff;
  font: 600 13px/1.3 system-ui, -apple-system, "Segoe UI", sans-serif; pointer-events: none; white-space: nowrap; }

/* buttons that are switched off must stay hidden */
.pill[hidden], .tour-buttons [hidden] { display: none !important; }
