* { box-sizing: border-box; }

body {
  font-family: system-ui, sans-serif;
  margin: 0;
  padding: 1rem;
  background: #f5f5f5;
  color: #222;
}

#resolve-form {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

#url-input {
  flex: 1;
  min-width: 260px;
  padding: 0.5rem;
}

button {
  padding: 0.5rem 0.9rem;
  cursor: pointer;
}

#error-box {
  margin-top: 0.5rem;
  padding: 0.5rem;
  background: #ffe0e0;
  border: 1px solid #cc0000;
  color: #900;
}

section {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid #ddd;
}

section h2 {
  font-size: 1.1rem;
  margin: 0 0 0.75rem;
}

.action-bar {
  margin-top: 0.75rem;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
}

#zoom-label,
#show-name-label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.9rem;
  color: #555;
}

.hint {
  margin: 0 0 0.75rem;
  font-size: 0.85rem;
  color: #666;
}

#video-status {
  margin-top: 0.5rem;
  font-size: 0.9rem;
  color: #555;
}

#boundary-video,
#hotspot-video {
  display: block;
  margin-top: 0.75rem;
  width: min(450px, 80vw);
  aspect-ratio: 9 / 16;
  background: #000;
}

#hotspot-video-status {
  margin-top: 0.5rem;
  font-size: 0.9rem;
  color: #555;
}

#top-n-label {
  display: inline-block;
  margin-bottom: 0.75rem;
  font-size: 0.9rem;
}

#content {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.map-col {
  width: min(450px, 80vw);
}

#section-boundary .map-wrap {
  width: min(450px, 80vw);
}

.map-wrap {
  position: relative;
  width: 100%;
  /* Matches the logo-cropped map content (720x1152); the video itself stays 9:16. */
  aspect-ratio: 5 / 8;
  background: #ddd;
}

.map-wrap img,
.map-wrap canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

#radius-control {
  margin-top: 0.5rem;
}

#radius-control label {
  display: block;
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
}

#radius-control input[type="range"] {
  width: 100%;
}

#sidebar {
  flex: 1;
  min-width: 220px;
  max-height: min(800px, 80vh);
  overflow-y: auto;
  background: #fff;
  border: 1px solid #ddd;
  padding: 0.5rem 0.75rem;
}

#sidebar fieldset {
  margin-bottom: 0.5rem;
  border: 1px solid #ddd;
}

#sidebar legend {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 600;
  text-transform: capitalize;
}

#sidebar label {
  display: block;
  font-size: 0.9rem;
  padding: 0.15rem 0;
}

.swatch {
  display: inline-block;
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 50%;
}
