.trace-editor {
  position: absolute;
  z-index: 650;
  inset: 0;
  pointer-events: none;
}

.editor-toolbar {
  position: absolute;
  top: calc(84px + var(--safe-top));
  right: 10px;
  left: 10px;
  display: grid;
  gap: 8px;
  padding: 10px;
  pointer-events: auto;
}

.editor-row {
  display: flex;
  gap: 6px;
  align-items: center;
  overflow-x: auto;
  scrollbar-width: none;
}

.editor-row::-webkit-scrollbar {
  display: none;
}

.editor-button,
.feature-button,
.tool-button {
  min-height: 38px;
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--panel2);
  color: var(--dim);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.feature-button.is-active,
.tool-button.is-active,
.editor-button.primary {
  border-color: var(--green);
  background: var(--green);
  color: var(--bg);
}

.editor-button:disabled,
.tool-button:disabled {
  opacity: 0.42;
}

.hole-control {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--panel2);
}

.hole-control button {
  width: 36px;
  height: 36px;
  border: 0;
  background: var(--clear);
}

.hole-control strong {
  min-width: 34px;
  text-align: center;
}

.shape-warning {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  padding: 9px 11px;
  border: 1px solid var(--red);
  border-radius: var(--radius-card);
  background: var(--panel2);
  color: var(--ink);
  font-size: 11px;
}

.shape-warning span {
  flex: 1;
}

.shape-warning button {
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--panel);
}

.editor-active .mode-toggle,
.editor-active .fcb-card,
.editor-active .distance-badge,
.editor-active .drag-hint {
  display: none;
}

.editor-active #map {
  touch-action: manipulation;
}

.setup-menu {
  display: grid;
  gap: 10px;
}

.setup-dialog {
  max-height: calc(100vh - 28px);
  overflow-y: auto;
}

.setup-course-picker,
.setup-field input {
  width: 100%;
  min-height: 44px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  outline: 0;
  background: var(--panel2);
  color: var(--ink);
}

.setup-field {
  display: grid;
  gap: 6px;
  margin-top: 10px;
  color: var(--dim);
  font-size: 11px;
}

.setup-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.setup-divider {
  height: 1px;
  margin: 16px 0;
  border: 0;
  background: var(--line);
}

.download-progress {
  width: 100%;
  height: 7px;
  margin-top: 10px;
  accent-color: var(--green);
}

.download-progress-label {
  display: block;
  margin-top: 5px;
  color: var(--dim);
  font-size: 10px;
  text-align: center;
}

@media (min-width: 760px) {
  .editor-toolbar {
    right: auto;
    width: 640px;
  }
}
