html, body {
  margin: 0;
  height: 100%;
  background: #d5e8f2;
  color: #1b1b1b;
  font-family: "Noto Sans", "Segoe UI", Helvetica, Arial, sans-serif;
}

#map {
  position: absolute;
  inset: 0;
  background: #d5e8f2;
}

.legend, .panel {
  position: absolute;
  z-index: 800;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 2px 14px rgba(0, 0, 0, 0.18);
}

.legend {
  top: 12px;
  left: 12px;
  width: min(340px, calc(100vw - 24px));
  max-height: calc(100% - 24px);
  overflow: auto;
  padding: 12px 14px 14px;
  border-radius: 6px;
}

.legend h1 {
  font-size: 18px;
  line-height: 1.25;
  margin: 0 0 8px;
}

.legend button.legend-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin: 2px 0 6px;
  padding: 2px 0;
  border: 0;
  background: transparent;
  border-radius: 0;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

.legend button.legend-heading::after {
  content: "";
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-bottom: 6px solid #333;
}

.legend.collapsed button.legend-heading {
  margin-bottom: 0;
}

.legend.collapsed button.legend-heading::after {
  border-bottom: 0;
  border-top: 6px solid #333;
}

.legend.collapsed .legend-body {
  display: none;
}

.legend p, .legend li {
  font-size: 12.5px;
  line-height: 1.4;
  margin: 0 0 8px;
}

.legend .tools {
  display: flex;
  gap: 6px;
  margin-bottom: 8px;
}

.legend input[type="search"] {
  flex: 1;
  font: inherit;
  font-size: 14px;
  padding: 6px 8px;
  border: 1px solid #b9b9b9;
  border-radius: 4px;
}

.legend button, .panel button, .island-list button {
  font: inherit;
  cursor: pointer;
  border: 1px solid #c8c8c8;
  background: #f4f4f4;
  border-radius: 4px;
}

.legend .tools button {
  padding: 6px 8px;
}

.search-hits {
  list-style: none;
  margin: 0 0 8px;
  padding: 0;
  border: 1px solid #ddd;
  border-radius: 4px;
}

.search-hits:empty {
  display: none;
}

.search-hits button {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  border-bottom: 1px solid #eee;
  background: #fff;
  padding: 6px 8px;
  border-radius: 0;
}

.swatches {
  list-style: none;
  margin: 0 0 8px;
  padding: 0;
}

.swatches li {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 3px;
}

.swatch {
  width: 18px;
  height: 12px;
  border: 1px solid #333;
  flex: 0 0 auto;
}

.swatch.line {
  height: 0;
  border: 0;
  border-top: 3px solid #111;
  width: 18px;
}

.swatch.road {
  border-top-color: #ababab;
}

.notes {
  margin: 0 0 8px 18px;
  padding: 0;
}

.notes li {
  margin: 0 0 4px;
}

.island-list {
  margin: 4px 0 8px;
}

.island-list summary {
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
}

.island-list h2 {
  font-size: 12.5px;
  margin: 8px 0 4px;
}

.island-list ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.island-list button {
  background: none;
  border: 0;
  padding: 1px 0;
  color: #163a78;
  text-decoration: underline;
}

.fine {
  font-size: 11px;
  color: #333;
}

.fine a {
  color: #163a78;
}

.panel {
  top: 12px;
  right: 12px;
  width: min(460px, calc(100vw - 24px));
  max-height: calc(100% - 24px);
  display: flex;
  flex-direction: column;
  border-radius: 6px;
}

.panel[hidden] {
  display: none;
}

.panel header {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid #e4e4e4;
}

.panel header h2 {
  flex: 1;
  margin: 0;
  font-size: 20px;
  line-height: 1.25;
}

.panel-actions {
  display: flex;
  gap: 4px;
  flex: 0 0 auto;
}

.panel.minimized .panel-body {
  display: none;
}

.panel.minimized header {
  border-bottom: 0;
}

.panel header button {
  padding: 2px 8px;
  font-size: 18px;
  line-height: 1;
}

.panel-body {
  overflow: auto;
  padding: 10px 14px 16px;
  font-size: 15px;
  line-height: 1.45;
}

.panel-body img {
  max-width: 100% !important;
  height: auto !important;
}

.panel-body div[style*="flex"] {
  flex-wrap: wrap !important;
}

.panel-body div[style*="width"] {
  width: auto !important;
  max-width: 100%;
  box-sizing: border-box;
}

.panel-body p, .panel-body li {
  margin: 0 0 8px;
}

.panel-body .credit {
  margin-top: 16px;
  font-size: 13px;
}

.parcel-popup .leaflet-popup-content {
  margin: 8px 10px;
  font-size: 14px;
  line-height: 1.35;
}

.north {
  position: absolute;
  z-index: 800;
  right: 18px;
  bottom: 28px;
  width: 36px;
  text-align: center;
  font-weight: 700;
  color: #111;
  text-shadow: 0 0 3px #fff;
  pointer-events: none;
}

.north span {
  display: block;
  font-size: 16px;
}

.north i {
  display: block;
  width: 0;
  height: 0;
  margin: 0 auto 2px;
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-bottom: 16px solid #111;
}

.parcel-label-icon {
  background: transparent;
  border: none;
  color: #3f3f3f;
  font-weight: 600;
  font-size: 11px;
  line-height: 14px;
  text-align: center;
  white-space: nowrap;
  pointer-events: none;
  text-shadow:
    -1px -1px 0 #fff,
    1px -1px 0 #fff,
    -1px 1px 0 #fff,
    1px 1px 0 #fff,
    0 0 3px #fff;
}

.leaflet-top.leaflet-left {
  top: 12px;
  left: 390px;
}

.island-label-icon {
  background: transparent;
  border: none;
  color: #161616;
  font-weight: 700;
  font-size: 11px;
  line-height: 14px;
  text-align: center;
  white-space: nowrap;
  text-shadow:
    -1px -1px 0 #fff,
    1px -1px 0 #fff,
    -1px 1px 0 #fff,
    1px 1px 0 #fff,
    0 0 3px #fff;
}

.leaflet-tooltip.beach-label {
  background: transparent;
  border: none;
  box-shadow: none;
  border-radius: 0;
  padding: 0;
  color: #161616;
  font-weight: 700;
  font-size: 11px;
  line-height: 1.1;
  white-space: nowrap;
  text-shadow:
    -1px -1px 0 #fff,
    1px -1px 0 #fff,
    -1px 1px 0 #fff,
    1px 1px 0 #fff,
    0 0 3px #fff;
}

.leaflet-tooltip.island-label::before,
.leaflet-tooltip.beach-label::before {
  display: none;
}

.leaflet-tooltip.beach-label {
  font-size: 10px;
  font-weight: 600;
}

.leaflet-container {
  background: #d5e8f2;
  font-family: inherit;
}

@media (max-width: 700px) {
  .panel {
    top: auto;
    bottom: 0;
    right: 0;
    left: 0;
    width: auto;
    max-height: 62%;
    border-radius: 10px 10px 0 0;
  }

  .north {
    display: none;
  }
}
