.editor-shell {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
}
.editor-boundary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 18px;
  padding: 14px 18px;
  border: 1px solid #d8e6fa;
  background: #f0f6ff;
  border-radius: 10px;
  font-size: 12px;
  line-height: 1.65;
}
.editor-boundary span {
  color: var(--muted);
}
.editor-layout {
  display: grid;
  grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}
.editor-list {
  padding: 18px !important;
  position: sticky;
  top: 20px;
  min-width: 0;
}
.editor-list-heading,
.editor-inspector-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.editor-list-heading h2 {
  font-size: 16px;
  margin: 0;
}
.editor-list-heading button {
  white-space: nowrap;
  padding: 9px 11px;
  font-size: 12px;
}
.editor-states {
  display: flex;
  gap: 2px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--line);
  margin: 8px 0 14px;
}
.editor-states button {
  font-size: 11px;
  padding: 9px 7px;
  border-radius: 7px 7px 0 0;
}
.editor-states button.active {
  color: var(--blue);
  background: #edf4ff;
  box-shadow: inset 0 -2px var(--blue);
}
.editor-list input {
  width: 100%;
  min-width: 0;
  margin: 0 0 14px;
}
.editor-items {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 480px;
  overflow: auto;
}
.editor-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  gap: 6px;
  background: transparent;
  padding: 14px 12px;
  border-radius: 9px;
  width: 100%;
  line-height: 1.45;
}
.editor-item strong {
  font-size: 12px;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.editor-item span {
  font-size: 11px;
  color: var(--muted);
}
.editor-item:hover {
  background: #f5f8fc;
}
.editor-item.selected {
  background: #edf4ff;
  box-shadow: inset 3px 0 var(--blue);
}
.editor-list-empty {
  padding: 30px 5px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}
.editor-list-note {
  font-size: 10px;
  margin: 15px 0;
}
.editor-work {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}
.editor-preview-panel {
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}
.editor-map-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  gap: 10px;
  border-bottom: 1px solid var(--line);
  font-size: 11px;
  color: var(--muted);
}
.editor-map-toolbar button {
  font-size: 12px;
  padding: 8px 12px;
}
.editor-map {
  height: 340px;
  position: relative;
  width: 100%;
  background: #f4f6f8;
}
.editor-map .maplibregl-canvas {
  position: absolute;
  inset: 0;
}
.editor-map .maplibregl-ctrl-attrib {
  font-size: 9px;
}
.editor-map-notice {
  font-size: 11px;
  color: var(--red);
  padding: 0 14px;
  margin: 0;
  line-height: 1.5;
}
.editor-map-notice:not(:empty) {
  padding: 10px 14px;
}
.editor-inspector {
  padding: 22px !important;
  min-width: 0;
}
.editor-inspector-heading h2 {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
}
.editor-state-label {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
}
.editor-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 17px;
}
.editor-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.5;
  min-width: 0;
  margin: 0 !important;
}
.editor-field input,
.editor-field textarea,
.editor-field select {
  box-sizing: border-box;
  margin: 0 !important;
  width: 100%;
  min-width: 0;
  border: 1px solid #dce3ed;
  border-radius: 8px;
  padding: 11px 12px;
  background: #fff;
  color: var(--ink);
  font:
    400 13px/1.5 "DejaVu Sans",
    Arial,
    sans-serif;
}
.editor-field textarea {
  resize: vertical;
  font:
    11px/1.65 ui-monospace,
    monospace;
  min-height: 100px;
}
.editor-field input:disabled,
.editor-field textarea:disabled,
.editor-field select:disabled {
  background: #f7f9fc;
  color: #718095;
}
.editor-field input:focus,
.editor-field textarea:focus,
.editor-field select:focus {
  outline: 2px solid #a7cbff;
  outline-offset: 1px;
}
.editor-form .wide {
  grid-column: 1/-1;
}
.editor-more {
  padding-top: 5px;
}
.editor-more summary {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  padding: 4px 0 15px;
}
.editor-more .editor-field {
  margin-bottom: 14px !important;
}
.editor-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  border-top: 1px solid var(--line);
  padding-top: 18px;
}
.editor-actions button {
  font-size: 12px;
  padding: 10px 13px;
}
.danger {
  color: var(--red) !important;
}
.editor-history {
  padding-top: 20px;
  margin-top: 18px;
  border-top: 1px solid var(--line);
}
.editor-revision {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px 12px;
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
  font-size: 11px;
}
.editor-revision code {
  width: 100%;
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 10px;
}
.editor-dialog {
  max-width: 500px;
  width: calc(100% - 32px);
  padding: 24px !important;
}
.editor-dialog h2 {
  font-size: 20px;
}
.editor-import {
  max-width: 720px;
  max-height: 90dvh;
  overflow: auto;
}
.editor-import input[type="file"] {
  font-size: 12px;
  margin: 12px 0;
  width: 100%;
}
.editor-import .notice {
  font-size: 12px;
  line-height: 1.65;
}
.editor-import .editor-field textarea {
  min-height: 240px;
}
.editor-dialog .dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 22px;
}
.editor-dialog .muted {
  font-size: 13px;
}
.editor-boundary strong {
  color: #1c4f8c;
}
.editor-shell .notice {
  font-size: 12px;
  line-height: 1.6;
  margin: 0;
}
#editor-nav[hidden] {
  display: none !important;
}
@media (min-width: 1600px) {
  .editor-map {
    height: 390px;
  }
}
@media (max-width: 1100px) {
  .editor-layout {
    grid-template-columns: minmax(185px, 235px) minmax(0, 1fr);
    gap: 14px;
  }
  .editor-list {
    padding: 14px !important;
  }
  .editor-list-heading {
    flex-wrap: wrap;
  }
  .editor-states button {
    font-size: 10px;
    padding: 9px 6px;
  }
  .editor-inspector {
    padding: 18px !important;
  }
  .editor-actions {
    gap: 7px;
  }
  .editor-actions button {
    font-size: 11px;
  }
}
@media (max-width: 800px) {
  .editor-layout {
    grid-template-columns: 1fr;
  }
  .editor-list {
    position: static;
  }
  .editor-list-heading {
    flex-wrap: nowrap;
  }
  .editor-items {
    max-height: 180px;
  }
  .editor-list-note {
    margin: 10px 0;
  }
  .editor-map {
    height: 285px;
  }
  .editor-states button {
    font-size: 12px;
    padding: 9px 12px;
  }
  .editor-boundary {
    font-size: 11px;
  }
  .editor-inspector-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }
  .editor-actions {
    gap: 8px;
  }
  .editor-map-toolbar {
    padding: 12px;
  }
  .editor-map-toolbar span {
    font-size: 10px;
  }
  .editor-dialog .dialog-actions {
    flex-wrap: wrap;
  }
}
@media (max-width: 440px) {
  .editor-form {
    grid-template-columns: 1fr;
  }
  .editor-inspector {
    padding: 16px !important;
  }
  .editor-actions button {
    font-size: 12px;
  }
  .editor-states button {
    font-size: 11px;
    padding: 9px 10px;
  }
  .editor-dialog {
    padding: 20px !important;
  }
  .editor-map {
    height: 260px;
  }
}

.editor-actions .danger {
  background: #fff;
  border: 1px solid #e5bdc2;
  color: #a51e2d !important;
}
.editor-states {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
@media (max-width: 800px) {
  .editor-states {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .editor-states button {
    padding: 9px 5px;
  }
}
