* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  display: flex;
  height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

#sidebar {
  width: 360px;
  min-width: 360px;
  background: #fff;
  display: flex;
  flex-direction: column;
  border-right: 1px solid #ddd;
  z-index: 1000;
}

#sidebar h1 {
  font-size: 1.25rem;
  padding: 16px;
  background: #d32f2f;
  color: #fff;
}

#search {
  margin: 12px;
  padding: 10px 12px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 0.9rem;
  outline: none;
}

#search:focus {
  border-color: #d32f2f;
}

#breadcrumb {
  padding: 0 12px 8px;
  font-size: 0.8rem;
  color: #666;
  display: none;
}

#breadcrumb.visible {
  display: block;
}

#breadcrumb a {
  color: #d32f2f;
  text-decoration: none;
  cursor: pointer;
}

#breadcrumb a:hover {
  text-decoration: underline;
}

#breadcrumb .sep {
  margin: 0 4px;
  color: #aaa;
}

#region-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 0 12px 8px;
}

.region-tag {
  font-size: 0.7rem;
  padding: 3px 8px;
  border-radius: 12px;
  cursor: pointer;
  border: 1px solid #ccc;
  background: #f5f5f5;
  transition: all 0.15s;
}

.region-tag:hover {
  background: #e0e0e0;
}

.region-tag.active {
  color: #fff;
  border-color: transparent;
}

#list {
  list-style: none;
  overflow-y: auto;
  flex: 1;
}

#list li {
  padding: 10px 16px;
  border-bottom: 1px solid #f0f0f0;
  cursor: pointer;
  transition: background 0.1s;
}

#list li:hover {
  background: #fff3f3;
}

#list li.active {
  background: #ffebee;
  border-left: 3px solid #d32f2f;
}

.item-name {
  font-weight: 600;
  font-size: 0.9rem;
}

.item-name-en {
  color: #888;
  font-size: 0.75rem;
}

.item-zip {
  font-family: "Courier New", monospace;
  color: #d32f2f;
  font-weight: 700;
  font-size: 0.85rem;
  float: right;
  margin-top: 4px;
}

.item-region {
  font-size: 0.7rem;
  color: #999;
}

.item-sub {
  font-size: 0.7rem;
  color: #888;
  margin-top: 2px;
}

.drill-arrow {
  float: right;
  color: #ccc;
  font-size: 1.1rem;
  margin-top: 2px;
  margin-left: 8px;
}

#map {
  flex: 1;
}

.zip-label {
  background: none;
  border: none;
  font-size: 11px;
  font-weight: 700;
  color: #333;
  text-shadow: 1px 1px 2px #fff, -1px -1px 2px #fff, 1px -1px 2px #fff, -1px 1px 2px #fff;
  white-space: nowrap;
}

#sidebar-footer {
  padding: 10px 12px;
  font-size: 0.7rem;
  color: #888;
  border-top: 1px solid #eee;
  line-height: 1.4;
}

#sidebar-footer .stale-warning {
  color: #b71c1c;
  margin-top: 4px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

@media (max-width: 768px) {
  body {
    flex-direction: column;
  }

  #sidebar {
    width: 100%;
    min-width: unset;
    max-height: 40vh;
    border-right: none;
    border-bottom: 1px solid #ddd;
  }
}
