.map-tools {
  width: min(100%, 58rem);
  margin-inline: auto;
  padding: clamp(1rem, 4vw, 2.5rem);
}

.map-tools__header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: .5rem 1.25rem;
  margin-bottom: 1.25rem;
}

.map-tools h1,
.map-tools h2 {
  margin: 0;
  color: #f5d497;
  font-family: Georgia, serif;
}

.map-tools h2 {
  margin-bottom: .8rem;
  font-size: 1.35rem;
}

.map-tools a {
  color: #f5d497;
}

.map-tools__layout {
  display: grid;
  gap: 1rem;
  align-items: start;
}

@media (min-width: 46rem) {
  .map-tools__layout {
    grid-template-columns: 1fr 1fr;
  }

  .map-panel--catalog {
    grid-column: 1 / -1;
  }
}

.map-panel {
  min-width: 0;
  padding: 1.15rem;
  border: 1px solid #917447;
  border-radius: .65rem;
  background: #1d2b32;
}

.map-panel form,
.map-fields,
.map-fields label {
  display: grid;
  gap: .55rem;
}

.map-panel form+h2 {
  margin-top: 1.4rem;
}

.map-fields {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.map-panel details .map-fields {
  margin-top: .5rem;
}

.map-tools button,
.map-tools select,
.map-tools input,
.map-tools textarea {
  min-height: 2.3rem;
  padding: .4rem .65rem;
  border: 1px solid #917447;
  border-radius: .35rem;
  background: #152127;
  color: inherit;
  font: inherit;
}

.map-tools input {
  min-width: 0;
}

.map-tools button {
  justify-self: start;
  background: #e2b874;
  color: #17232a;
  font-weight: 650;
  cursor: pointer;
}

.map-tools button:disabled {
  opacity: .55;
  cursor: default;
}

.map-tools textarea {
  width: 100%;
  resize: vertical;
  overflow-wrap: anywhere;
  font-family: ui-monospace, monospace;
}

.map-preview {
  display: grid;
  grid-template-columns: repeat(var(--board-size), minmax(0, 1fr));
  width: min(100%, 20rem);
  overflow: hidden;
  border: 2px solid #917447;
  border-radius: .3rem;
}

.map-preview span {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  background: var(--region-color);
  color: #17232a;
  font: 650 clamp(.55rem, 2vw, .85rem)/1 system-ui, sans-serif;
  outline: 1px solid #17232a25;
  outline-offset: -1px;
}

.map-preview[data-region-labels] span::before {
  content: attr(data-region);
}

.map-preview-key {
  margin-top: .45rem;
}

.map-metrics {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: .35rem .6rem;
  font-size: .9rem;
}

.map-metrics dd {
  margin: 0;
  color: #f5d497;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.map-techniques {
  margin-bottom: .85rem;
}

.map-techniques ul {
  padding-inline-start: 1.4rem;
}

.map-status,
.map-note {
  margin-bottom: 0;
  font-size: .9rem;
}

.map-status:empty {
  display: none;
}

.map-catalog-controls,
.map-result-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem;
}
