.name-generator-toggle {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  padding: 0;
  margin: 0;
  border: 0 !important;
  border-radius: 0;
  background: transparent;
  color: #5d776b;
  align-self: center;
  line-height: 0;
}
.name-generator-toggle svg {
  display: block;
  width: 20px;
  height: 20px;
  fill: currentColor;
}
.name-generator-toggle:hover,
.name-generator-toggle:focus-visible {
  background: #dcebe2;
  color: #286b52;
  outline: 0;
}
.name-generator-input-wrap {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 2px;
}
.name-generator-input-wrap input { min-width: 0; }
.workspace aside .name-generator-input-wrap > input { margin: 0; }
.map-label-editor-wrap {
  position: absolute;
  z-index: 12;
  display: flex;
  align-items: center;
  box-sizing: border-box;
  padding: 0;
  border: 0;
  background: transparent;
  transform: translate(-50%, -50%);
  pointer-events: auto;
  width: max-content;
  min-width: 0;
}
.map-label-editor {
  box-sizing: border-box;
  min-width: 0;
  width: 100% !important;
  max-width: none !important;
  min-height: 0;
  height: 100% !important;
  padding: 0;
  border: 0;
  border-radius: 0;
  outline: 0;
  /* The editor sits directly over the map.  Keep the map visible through the
     text area instead of introducing a white card that hides nearby objects. */
  background: transparent !important;
  background-color: transparent !important;
  color: transparent !important;
  caret-color: #273832;
  font: 600 14px/1.25 "Segoe UI", "Microsoft YaHei", sans-serif;
  text-align: center;
  white-space: pre-wrap;
  overflow: hidden;
  resize: none;
  box-shadow: none !important;
  border-radius: 0 !important;
  appearance: none;
  -webkit-appearance: none;
  opacity: 1;
  cursor: text;
  user-select: text;
}
.map-label-editor:focus { border: 0; box-shadow: none; }
.map-label-editor::selection { background: #4b83d688; color: transparent; }
.map-label-editor-wrap[hidden],
.map-label-editor-wrap .name-generator-toggle[hidden] { display: none; }
/* The SVG label remains the only rendered text surface while editing. The
   transparent input supplies the caret and keyboard editing without creating
   a second visual text box or hiding other labels. */
body[data-editing-label] [data-label-selection] { display: block; }
body[data-editing-label] [data-label] { visibility: visible; }
/* The map editor is the single editing surface for a place name.  The
   inspector keeps its object controls, but showing its duplicate name field
   at the same time creates two carets and two competing borders. */
body[data-editing-label] .inspector .name-generator-field { display: none; }
.map-label-editor-wrap .name-generator-toggle {
  position: absolute;
  right: -24px;
  top: 50%;
  bottom: auto;
  transform: translateY(-50%);
  margin: 0;
  padding: 0;
  background: transparent;
}
.name-generator-popover {
  position: fixed;
  z-index: 1600;
  width: 350px;
  max-width: min(350px, calc(100vw - 20px));
  max-height: min(590px, calc(100vh - 20px));
  overflow: hidden;
  border: 1px solid #a8adb2;
  border-radius: 0;
  background: #282b2ff2;
  color: #eceef0;
  box-shadow: 0 18px 44px #00000042;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  font-size: 12px;
}
.name-generator-popover[hidden] { display: none; }
.name-generator-heading {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 0 12px;
  border-bottom: 1px solid #a8adb266;
}
.name-generator-heading strong { color: #f4f5f6; font-size: 14px; font-weight: 650; }
.name-generator-heading > span { min-width: 0; overflow: hidden; color: #b5bac0; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.name-generator-heading button {
  width: 22px;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #c1c6cb;
  font-size: 20px;
  line-height: 20px;
}
.name-generator-heading button:hover { background: #454b52; color: white; }
.name-generator-options {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 9px;
  padding: 11px 12px 9px;
  border-bottom: 1px solid #a8adb252;
}
.name-generator-options label { display: grid; min-width: 0; gap: 5px; margin: 0; color: #bec3c9; font-size: 10px; }
.name-generator-options .name-generator-source { grid-column: 1 / -1; }
.name-generator-options label[hidden] { display: none; }
.name-generator-options select {
  box-sizing: border-box;
  min-width: 0;
  max-width: 100%;
  text-overflow: ellipsis;
  width: 100%;
  height: 31px;
  padding: 5px 7px;
  border: 1px solid #626970;
  border-radius: 0;
  background: #1e2126;
  color: #eef0f2;
  outline: 0;
}
.name-generator-options select:focus { border-color: #8faac2; box-shadow: 0 0 0 2px #8faac22b; }
.name-generator-results-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 35px;
  padding: 7px 12px 3px;
  color: #e1e4e8;
  font-weight: 600;
}
.name-generator-results-head small { margin-left: 5px; color: #a5adb5; font-size: 10px; font-weight: 400; }
.name-generator-results-head button {
  width: 26px;
  height: 26px;
  padding: 0;
  border: 1px solid #626b75;
  border-radius: 0;
  background: #353b43;
  color: #e0e6ed;
  font-size: 18px;
  line-height: 22px;
}
.name-generator-results-head button:hover { background: #495461; }
.name-generator-results {
  display: grid;
  gap: 1px;
  max-height: 390px;
  overflow: auto;
  padding: 0 8px 9px;
}
.name-generator-result {
  display: block;
  width: 100%;
  min-height: 34px;
  min-width: 0;
  padding: 7px 9px;
  border: 0;
  border-radius: 0;
  background: #202429;
  color: #edf0f3;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}
.name-generator-result:hover,
.name-generator-result:focus-visible {
  background: #3f6385;
  color: #fff;
  outline: 0;
  box-shadow: inset 3px 0 #aac6e0;
}
.name-generator-loading { min-height: 160px; display: grid; place-items: center; padding: 22px; color: #bdc5ce; text-align: center; }
.inspector .name-generator-field { margin-bottom: 11px; }
.inspector .name-generator-input-wrap { width: 100%; max-width: none; }
.inspector .name-generator-field input {
  border: 1px dashed #426a58;
  border-radius: 0;
  background: transparent;
  color: var(--ui-field-text, #e7eef1);
}
.inspector .name-generator-input-wrap input { flex: 1 1 auto; width: 100%; }
.inspector .name-generator-input-wrap input,
.inspector .name-generator-input-wrap textarea { min-width: 0; }

