/* Редактор расстановок. Опирается на viewer.css: topbar, brand, connection,
   scene-tools и кнопки берутся оттуда — тут только то, чего там нет. */

.editor-body { display: flex; flex-direction: column; height: 100vh; overflow: hidden; }
.editor-body .topbar {
  position: relative; inset: auto; flex: 0 0 var(--top-height);
  grid-template-columns: 220px minmax(180px, 1fr) auto;
}
.editor-body .scene-tools button { width: auto; min-width: 46px; padding: 0 8px; }

.editor-main { display: grid; grid-template-columns: 350px 1fr; flex: 1; min-height: 0; }

.editor-panel {
  display: flex; flex-direction: column; gap: 18px;
  padding: 16px; overflow-y: auto;
  background: #0e141b; border-right: 1px solid rgba(255, 255, 255, .08);
}
.editor-panel section { display: flex; flex-direction: column; gap: 8px; }
.editor-panel h2 {
  margin: 0; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: #7c8899;
}
.editor-panel select,
.editor-panel input[type="color"],
.editor-panel input[type="password"],
.editor-panel input[type="search"],
.editor-panel input[type="text"],
.editor-panel input[type="number"] {
  width: 100%; padding: 7px 9px; font: inherit; font-size: 13px;
  color: #eef1f5; background: #131a23;
  border: 1px solid rgba(255, 255, 255, .12); border-radius: 3px;
}
.editor-panel input[type="color"] { min-height: 34px; padding: 3px; }
.counter { color: #eef1f5; }
.placed-total { color: #526071; font-size: 10px; letter-spacing: 0; text-transform: none; }
.hint { margin: 0; font-size: 11px; line-height: 1.45; color: #7c8899; }
.hint.error { color: #ff7a72; }
.editor-auth {
  padding: 12px; background: rgba(226, 27, 37, .07);
  border: 1px solid rgba(226, 27, 37, .28); border-radius: 4px;
}
.editor-key-form { display: grid; gap: 7px; }

/* Списки схематик и размещённых объектов: скроллятся сами, чтобы панель не росла. */
.schematic-list, .placed-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.schematic-list { max-height: 30vh; overflow-y: auto; }
.placed-list { max-height: 24vh; overflow-y: auto; }
.schematic-list button, .placed-list button {
  display: flex; justify-content: space-between; align-items: baseline; gap: 8px;
  width: 100%; padding: 7px 9px; text-align: left; cursor: pointer;
  color: #eef1f5; background: #131a23;
  border: 1px solid rgba(255, 255, 255, .08); border-radius: 3px;
}
.schematic-list button:hover, .placed-list button:hover { border-color: rgba(226, 27, 37, .5); }
.schematic-list small, .placed-list small { color: #7c8899; font-size: 11px; }
.placed-list li.active button { border-color: #e21b25; background: rgba(226, 27, 37, .12); }

.pivot-row { display: grid; gap: 6px; }
.pivot-row .pivot-head { color: var(--muted); font-size: 11px; }
.pivot-row .pivot-head span { color: var(--text); }
.pivot-coordinates { margin-top: 2px; }
.pivot-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.pivot-hint { margin: 0; }
.coord-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.precision-grid { grid-template-columns: repeat(2, 1fr); }
.coord-grid label {
  display: grid; gap: 3px; font-size: 10px; letter-spacing: .1em; color: #7c8899; text-transform: uppercase;
}
.note-field {
  display: grid; gap: 4px; font-size: 10px; letter-spacing: .1em;
  color: #7c8899; text-transform: uppercase;
}
.optimization-panel {
  display: grid; gap: 8px; padding: 9px;
  border: 1px solid rgba(76, 212, 192, .2); border-radius: 4px;
  background: rgba(76, 212, 192, .035);
}
.optimization-panel[hidden], #builder-collision-properties[hidden] { display: none; }
.optimization-toggle {
  display: flex; align-items: center; gap: 8px;
  color: #c9d1db; font-size: 12px; letter-spacing: 0; text-transform: none;
}
.optimization-toggle input { margin: 0; accent-color: #4cd4c0; }
.optimization-fine {
  display: grid; gap: 9px; padding-top: 8px;
  border-top: 1px solid rgba(76, 212, 192, .16);
}
.optimization-fine[hidden] { display: none; }
.optimization-numbers { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.optimization-checks { display: grid; gap: 7px; }
.optimization-fine input:disabled,
.optimization-fine label:has(input:disabled) { opacity: .48; }
.optimization-fine .hint b { color: #b9c6d5; font-weight: 600; }

.editor-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.room-actions { display: grid; grid-template-columns: 1fr auto; gap: 6px; }
.builder-panel {
  padding: 12px; border: 1px solid rgba(76, 212, 192, .22); border-radius: 4px;
  background: rgba(76, 212, 192, .035);
}
.builder-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px; }
.builder-row-three { grid-template-columns: minmax(0, 1fr) 46px auto; }
.builder-actions { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
.builder-actions .primary { grid-column: 1 / -1; }
.editor-panel button {
  padding: 8px 10px; font: inherit; font-size: 12px; cursor: pointer;
  color: #eef1f5; background: #1a222d;
  border: 1px solid rgba(255, 255, 255, .12); border-radius: 3px;
}
.editor-panel button:hover { border-color: rgba(255, 255, 255, .28); }
.editor-panel button.active { border-color: #e21b25; background: rgba(226, 27, 37, .12); }
.editor-panel button:disabled { opacity: .38; cursor: default; }
.editor-panel button.danger:hover { border-color: #ff5a52; color: #ff8b84; }
/* Телепорт без пары ничего не делает в игре — та же оранжевая тревога, что и на его
   рамке в 3D-сцене (TELEPORT_UNLINKED), чтобы недостроенную точку было видно и в списке. */
.editor-panel button.warning { border-color: #ff9c3d; }
.editor-panel button.warning small { color: #ffb066; }
.editor-panel button.primary { background: #e21b25; border-color: #e21b25; font-weight: 600; }
/* Несохранённые изменения видно по кнопке — иначе легко уйти со страницы зря. */
.editor-panel button.primary.unsaved { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { background: #ff3040; } }

.editor-scene { position: relative; min-width: 0; }
.editor-scene canvas { display: block; width: 100%; height: 100%; }
.editor-help {
  position: absolute; left: 12px; bottom: 10px; margin: 0;
  font-size: 11px; color: #7c8899; pointer-events: none;
}

.button-link {
  padding: 6px 10px; font-size: 12px; color: #eef1f5; text-decoration: none;
  border: 1px solid rgba(255, 255, 255, .12); border-radius: 3px;
}
.button-link:hover { border-color: rgba(255, 255, 255, .28); }
.tool-separator { width: 1px; height: 22px; background: rgba(255, 255, 255, .1); margin: 0 3px; }
.scene-tools button:disabled { opacity: .35; cursor: default; }

@media (max-width: 900px) {
  .editor-body .topbar { grid-template-columns: 150px 1fr; }
  .editor-body .scene-tools {
    position: absolute; top: var(--top-height); right: 8px; height: 38px;
    background: rgba(14, 20, 27, .92); border: 1px solid rgba(255, 255, 255, .08);
  }
  .editor-main { grid-template-columns: 1fr; grid-template-rows: minmax(0, 45vh) 1fr; }
  .editor-panel { border-right: none; border-bottom: 1px solid rgba(255, 255, 255, .08); }
}
