:root {
  color-scheme: dark;
  background: #111;
}

body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr;
  background: #111;
}

.top-bar {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 24px;
  padding: 12px 16px;
  background: #222;
  color: #fff;
  font: 16px system-ui, sans-serif;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
  background-color: white;
  padding-left: 10px;
  padding-right: 10px;
}

.brand img {
  display: block;
  width: 54px;
  margin: 6px
  object-fit: contain;
}

.brand h1 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  color: black;
  font-weight: bold;
}

.map-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-left: auto;
  min-width: 0;
}

@media (max-width: 640px) {
  .top-bar {
    flex-wrap: wrap;
  }
}

.file-control {
  display: grid;
  gap: 4px;
}

.file-control input {
  box-sizing: border-box;
  width: 200px;
  min-width: 0;
  padding: 4px;
  font-size: 12px;
}

.overlay-status {
  flex-basis: 100%;
  margin: 0;
  font-size: 13px;
}

select,
input {
  min-width: 150px;
  padding: 6px 8px;
  color: inherit;
  background: #333;
  border: 1px solid #777;
  border-radius: 4px;
  font: inherit;
}

.image-stage {
  min-height: 0;
  overflow: hidden;
}

.image-container {
  position: relative;
  width: 100%;
  height: 100%;
}

#map {
  width: 100%;
  height: 100%;
}

.crop-rectangle {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1100;
  pointer-events: none;
  box-sizing: border-box;
  border: 2px solid #fff;
  background: rgb(255 255 255 / 12%);
  box-shadow: 0 0 0 1px rgb(0 0 0 / 70%), 0 0 12px rgb(0 0 0 / 45%);
}

.crop-drag-handle {
  position: absolute;
  top: 8px;
  left: 50%;
  display: grid;
  place-items: center;
  width: 52px;
  height: 24px;
  transform: translateX(-50%);
  border: 1px solid #fff;
  border-radius: 4px;
  background: #222;
  color: #fff;
  font: 12px system-ui, sans-serif;
  cursor: grab;
  pointer-events: auto;
  touch-action: none;
}

.crop-drag-handle:active {
  cursor: grabbing;
}

.crop-margin {
  position: absolute;
  border: 2px dashed #f44;
  pointer-events: none;
}