* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  font-family: system-ui, sans-serif;
}

#map {
  position: absolute;
  inset: 0;
}

.panel {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 1000;
  width: 300px;
  background: rgba(255, 255, 255, 0.96);
  border-radius: 10px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.panel h1 {
  margin: 0 0 6px;
  font-size: 1.15rem;
}

.panel label {
  font-size: 0.78rem;
  font-weight: 600;
  color: #444;
  margin-top: 4px;
}

.panel input,
.panel select {
  width: 100%;
  padding: 7px 8px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 0.9rem;
}

.panel button {
  margin-top: 10px;
  padding: 9px;
  border: none;
  border-radius: 6px;
  background: #2563eb;
  color: #fff;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
}

.panel button:disabled {
  background: #93b4f5;
  cursor: wait;
}

.resolved {
  font-size: 0.75rem;
  color: #2563eb;
  min-height: 1em;
}

.status {
  font-size: 0.78rem;
  color: #555;
  min-height: 1.2em;
}

.status.error {
  color: #c0392b;
}

.iso-legend {
  position: absolute;
  bottom: 24px;
  left: 12px;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.92);
  border-radius: 8px;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.2);
  padding: 8px 10px;
  font-size: 0.78rem;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.iso-legend-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.iso-legend-swatch {
  width: 14px;
  height: 4px;
  border-radius: 2px;
  display: inline-block;
}

.map-context-menu {
  position: absolute;
  z-index: 1500;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
  overflow: hidden;
}

.map-context-item {
  display: block;
  width: 100%;
  border: none;
  background: none;
  padding: 9px 14px;
  font-size: 0.88rem;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  white-space: nowrap;
}

.map-context-item:hover {
  background: #eff6ff;
}

.poi-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.poi-modal {
  position: relative;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.35);
  padding: 20px 22px;
  width: 100%;
  max-width: 420px;
  max-height: 85vh;
  overflow-y: auto;
}

.poi-modal h2 {
  margin: 0 24px 2px 0;
  font-size: 1.2rem;
}

.poi-modal-sub {
  color: #666;
  font-size: 0.85rem;
  margin-bottom: 12px;
}

.poi-modal-close {
  position: absolute;
  top: 10px;
  right: 12px;
  border: none;
  background: none;
  font-size: 1.6rem;
  line-height: 1;
  color: #888;
  cursor: pointer;
  padding: 2px 6px;
}

.poi-modal-close:hover {
  color: #000;
}

.poi-modal-row {
  font-size: 0.88rem;
  margin: 5px 0;
}

.poi-modal-label {
  display: inline-block;
  width: 110px;
  font-weight: 600;
  color: #444;
  vertical-align: top;
}

.poi-modal-desc {
  font-size: 0.85rem;
  color: #333;
  margin: 10px 0 0;
}

.poi-modal-actions {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}

.poi-modal-btn {
  flex: 1;
  text-align: center;
  padding: 9px 10px;
  border-radius: 6px;
  background: #2563eb;
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
}

.poi-modal-btn.secondary {
  background: #e5e7eb;
  color: #1f2937;
}

button.poi-modal-btn {
  border: none;
  cursor: pointer;
  font-family: inherit;
}

.site-viewer-overlay {
  position: fixed;
  inset: 0;
  z-index: 3000;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.site-viewer {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.4);
  width: 100%;
  max-width: 1100px;
  height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.site-viewer-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid #e5e7eb;
}

.site-viewer-title {
  font-weight: 600;
  font-size: 0.9rem;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.site-viewer-newtab {
  font-size: 0.85rem;
  white-space: nowrap;
}

.site-viewer-close {
  position: static;
}

.site-viewer-hint {
  font-size: 0.72rem;
  color: #888;
  padding: 4px 14px;
}

.site-viewer-frame {
  flex: 1;
  border: none;
  width: 100%;
}

@media (max-width: 480px) {
  .panel {
    left: 12px;
    width: auto;
  }
}
