html, body { margin: 0; padding: 0; height: 100%; font: 14px/1.35 system-ui, -apple-system, sans-serif; }
#map { position: absolute; inset: 0; }

#legend {
  position: absolute; top: 12px; left: 12px; z-index: 1;
  background: rgba(255,255,255,0.95); padding: 8px 12px; border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.15); min-width: 110px;
}
.legend-title { font-weight: 600; margin-bottom: 4px; font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px; color: #555; }
.legend-row { display: flex; align-items: center; gap: 8px; padding: 2px 0; }
.sw { width: 18px; height: 4px; border-radius: 2px; display: inline-block; }
.sw-1 { background: #d73027; }
.sw-2 { background: #fc8d59; }
.sw-3 { background: #fee08b; }
.sw-4 { background: #91cf60; }
.sw-5 { background: #1a9850; }
.sw-0 { background: #888; opacity: 0.4; }

#filter {
  position: absolute; top: 12px; right: 12px; z-index: 1;
  background: rgba(255,255,255,0.95); padding: 8px 12px; border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.15); cursor: pointer; user-select: none;
}
#filter input { vertical-align: middle; margin-right: 6px; }

#panel {
  position: absolute; top: 0; right: 0; bottom: 0; width: 360px;
  background: #fff; box-shadow: -2px 0 8px rgba(0,0,0,0.15);
  z-index: 2; padding: 20px; overflow-y: auto; box-sizing: border-box;
  transform: translateX(100%); transition: transform 0.2s ease;
}
#panel:not([hidden]) { transform: translateX(0); }
#panel .close {
  position: absolute; top: 8px; right: 12px;
  background: none; border: none; font-size: 24px; cursor: pointer; color: #888;
}
#panel h2 { margin: 0 24px 4px 0; font-size: 18px; }
#panel h3 { margin: 20px 0 6px; font-size: 13px; text-transform: uppercase; letter-spacing: 0.5px; color: #555; }
.cur-rating { font-size: 28px; font-weight: 600; margin: 6px 0 14px; }
.cur-rating.unrated { color: #888; font-size: 16px; font-weight: 400; }

.rating-buttons { display: flex; gap: 6px; margin-bottom: 10px; }
.rating-buttons button {
  flex: 1; padding: 10px 0; font-size: 16px; font-weight: 600;
  border: 1px solid #ccc; background: #f8f8f8; border-radius: 6px; cursor: pointer;
}
.rating-buttons button:hover { background: #eee; }
.rating-buttons button.selected { background: #333; color: #fff; border-color: #333; }

#panel textarea {
  width: 100%; box-sizing: border-box; min-height: 60px;
  padding: 8px; border: 1px solid #ccc; border-radius: 6px;
  font: inherit; resize: vertical; margin-bottom: 8px;
}
#panel .submit {
  width: 100%; padding: 10px; background: #1a9850; color: #fff;
  border: none; border-radius: 6px; font-size: 14px; font-weight: 600; cursor: pointer;
}
#panel .submit:disabled { background: #ccc; cursor: not-allowed; }

#panel .history { list-style: none; padding: 0; margin: 0; }
#panel .history li {
  padding: 8px 0; border-bottom: 1px solid #eee; font-size: 13px;
}
#panel .history .stars { color: #1a9850; font-weight: 600; margin-right: 6px; }
#panel .history .date { color: #888; font-size: 12px; }
#panel .history .empty { color: #888; font-style: italic; padding: 8px 0; }

#tooltip {
  position: absolute; z-index: 3; pointer-events: none;
  background: rgba(0,0,0,0.85); color: #fff; padding: 6px 10px;
  border-radius: 4px; font-size: 12px; max-width: 320px;
}

#api-error {
  position: absolute; bottom: 8px; left: 50%; transform: translateX(-50%);
  z-index: 1; background: rgba(255,220,220,0.95); color: #8a0000;
  padding: 6px 14px; border-radius: 4px; font-size: 12px;
}
#api-error code { background: rgba(0,0,0,0.08); padding: 1px 4px; border-radius: 2px; }

.submit-error {
  background: #fee; color: #8a0000; padding: 6px 10px; border-radius: 4px;
  margin-top: 8px; font-size: 12px;
}
