* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", Roboto, sans-serif;
  background: #1c1c1a;
  color: #f1efe8;
}

header {
  padding: 16px 24px;
  border-bottom: 1px solid #35342f;
  display: flex;
  align-items: baseline;
  gap: 16px;
}

header h1 {
  font-size: 18px;
  font-weight: 500;
  margin: 0;
}

#loc-label {
  font-size: 14px;
  color: #b4b2a9;
  margin: 0;
}

main {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 16px;
  padding: 16px;
  height: calc(100vh - 64px);
}

#plan-panel {
  background: #26251f;
  border-radius: 10px;
  padding: 12px;
  overflow: auto;
}

#plan-wrap {
  position: relative;
  width: 100%;
}

#plan-img {
  width: 100%;
  display: block;
  border-radius: 6px;
}

#markers {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
}

.marker {
  position: absolute;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid #f1efe8;
  background: #378add;
  transform: translate(-50%, -50%);
  cursor: pointer;
}

.marker.active {
  width: 20px;
  height: 20px;
  border-width: 3px;
}

#pano-panel {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  background: #000;
}

#pano {
  width: 100%;
  height: 100%;
  display: block;
  cursor: grab;
}

#pano:active { cursor: grabbing; }

#hint {
  position: absolute;
  top: 12px;
  left: 12px;
  font-size: 12px;
  background: rgba(0,0,0,0.5);
  padding: 4px 10px;
  border-radius: 20px;
}

#nav-arrows {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  pointer-events: none;
}

.nav-arrow {
  position: absolute;
  width: 44px;
  height: 44px;
  margin-left: -22px;
  margin-top: -22px;
  border-radius: 50%;
  background: rgba(20, 20, 18, 0.55);
  border: 2px solid rgba(255,255,255,0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  pointer-events: auto;
  transition: background 0.15s, transform 0.15s;
}

.nav-arrow:hover {
  background: rgba(55, 138, 221, 0.85);
  transform: scale(1.08);
}

#hotspots {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  pointer-events: none;
}

.hotspot {
  position: absolute;
  width: 28px;
  height: 28px;
  margin-left: -14px;
  margin-top: -14px;
  border-radius: 50%;
  background: rgba(216, 90, 48, 0.9);
  border: 2px solid #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  pointer-events: auto;
  animation: pulse 2s infinite;
}

.hotspot span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #fff;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(216, 90, 48, 0.5); }
  50% { box-shadow: 0 0 0 8px rgba(216, 90, 48, 0); }
}

#modal {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.7);
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 100;
}

#modal-card {
  background: #26251f;
  border-radius: 12px;
  padding: 24px;
  max-width: 520px;
  width: 100%;
  max-height: 88vh;
  overflow-y: auto;
  position: relative;
}

#modal-close {
  position: absolute;
  top: 12px;
  right: 16px;
  background: none;
  border: none;
  color: #f1efe8;
  font-size: 22px;
  cursor: pointer;
}

#modal-title {
  font-size: 17px;
  font-weight: 500;
  margin: 0 0 12px;
}

#modal-photo {
  width: 100%;
  border-radius: 8px;
  margin-bottom: 12px;
}

#modal-audio {
  width: 100%;
  margin-bottom: 16px;
}

#modal-card h3 {
  font-size: 13px;
  color: #b4b2a9;
  margin: 16px 0 6px;
  font-weight: 500;
}

#modal-card p, #modal-card li {
  font-size: 14px;
  line-height: 1.5;
}

#modal-card ul {
  margin: 0;
  padding-left: 18px;
}

#modal-transcript-toggle {
  margin-top: 16px;
  background: rgba(255,255,255,0.08);
  color: #f1efe8;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 13px;
  cursor: pointer;
}

#modal-transcript {
  display: none;
  margin-top: 10px;
  color: #b4b2a9;
  font-style: italic;
}

@media (max-width: 700px) {
  main { grid-template-columns: 1fr; height: auto; }
  #pano-panel { height: 60vh; }
}
