.editor-shell {
  width: calc(100vw - 24px);
  max-width: 1800px;
  margin: 0 auto 10px;
  background: #20242a;
  border: 1px solid #343a42;
  border-radius: 7px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .12);
  overflow: hidden;
}

.editor-shell .editor-bar {
  max-width: none;
  margin: 0;
  padding: 8px 10px;
  border-radius: 0;
  gap: 8px;
  flex-wrap: wrap;
}

.tool-brand {
  display: flex;
  align-items: baseline;
  gap: 4px;
  margin-right: 6px;
  color: #f5f5f3;
  font: 700 15px/1 'Barlow Condensed', sans-serif;
  letter-spacing: .8px;
}

.tool-brand span { color: #e0ae18; }
.tool-brand small { color: #89919b; font: 10px 'IBM Plex Mono', monospace; }

.tool-group {
  display: flex;
  align-items: center;
  gap: 3px;
  padding-right: 8px;
  border-right: 1px solid #424851;
}

.editor-shell .editor-bar button {
  min-height: 30px;
  padding: 5px 9px;
  color: #e9eaeb;
  background: #343a42;
  border: 1px solid #4a515c;
  border-radius: 4px;
  font: 600 12px 'Barlow Condensed', sans-serif;
  letter-spacing: .35px;
  text-transform: uppercase;
}

.editor-shell .editor-bar button:hover:not(:disabled) {
  color: #20242a;
  background: #e0ae18;
  border-color: #e0ae18;
}

.editor-shell .editor-bar button:disabled {
  color: #707781;
  background: #292e35;
  border-color: #343a42;
  cursor: not-allowed;
}

.tool-secondary { margin-left: auto; border-right: 0; padding-right: 0; }
.zoom-tools output { min-width: 44px; color: #d7d9dc; text-align: center; }

.editor-help {
  padding: 6px 12px;
  color: #aeb4bc;
  background: #292e35;
  border-top: 1px solid #3a4048;
  font: 10px/1.4 'IBM Plex Mono', monospace;
}

.plano-wrap {
  width: calc(100vw - 24px);
  max-width: 1800px;
  overflow: hidden;
  user-select: none;
  padding: 4px;
}

.plano-wrap svg { cursor: grab; touch-action: none; }
.plano-wrap svg.panning { cursor: grabbing; }
.plano-wrap image.drag { cursor: move; }
.equipment-perimeter { vector-effect: non-scaling-stroke; }
.safety-buffer { vector-effect: non-scaling-stroke; }
.cad-footprint { pointer-events: none; }
.cad-body { fill: #f7f3e7; stroke: #2c55c4; stroke-width: 2; vector-effect: non-scaling-stroke; }
.cad-axis { stroke: #68717c; stroke-width: 1; stroke-dasharray: 4 3; vector-effect: non-scaling-stroke; }
/* Flecha de sentido oculta a pedido del usuario (2026-07-02); para reactivarla: display: initial. */
.cad-front { display: none; }
.cad-source-image { opacity: .9; }

@media (max-width: 760px) {
  .tool-brand { width: 100%; }
  .tool-secondary { margin-left: 0; }
  .editor-help { font-size: 9px; }
}

/* Medición */
.medicion-linea { stroke: #2C55C4; stroke-width: 1.5; stroke-dasharray: 6 4; }
.medicion-punto { fill: #2C55C4; }
.medicion-texto {
  fill: #1B2A5E; font: 700 12px system-ui, sans-serif;
  paint-order: stroke; stroke: #fff; stroke-width: 3px;
}
.guia-distancia { stroke: #DE7527; stroke-width: 1.2; stroke-dasharray: 4 4; }
.guia-texto {
  fill: #8A4A16; font: 600 11px system-ui, sans-serif;
  paint-order: stroke; stroke: #fff; stroke-width: 3px;
}
.dim-propia {
  fill: #2C55C4; font: 700 12px system-ui, sans-serif;
  paint-order: stroke; stroke: #fff; stroke-width: 3.5px;
}
svg.midiendo, svg.midiendo image.drag, svg.midiendo * { cursor: crosshair; }
button.activo { background: #2C55C4; color: #fff; }

/* Zonas editables */
.zona-rect { fill: rgba(44, 85, 196, .06); stroke: #2C55C4; stroke-width: 1.2; stroke-dasharray: 8 5; }
.zona-rect.seleccionada { fill: rgba(44, 85, 196, .14); stroke-width: 2; stroke-dasharray: none; }
.zona-nombre {
  fill: #2C55C4; font: 700 13px system-ui, sans-serif;
  paint-order: stroke; stroke: #fff; stroke-width: 3px; pointer-events: none;
}
.zona-handle { fill: #fff; stroke: #2C55C4; stroke-width: 1.5; cursor: nwse-resize; }
svg.editando-zonas image.drag { pointer-events: none; opacity: .55; }

/* Rejilla de 1 m */
.rejilla-menor { stroke: #A8B6CC; stroke-width: 0.8; vector-effect: non-scaling-stroke; fill: none; }
.rejilla-mayor { stroke: #6E86A6; stroke-width: 1.4; vector-effect: non-scaling-stroke; fill: none; }

/* Vista 3D */
#vista3d { display: none; position: relative; width: 100%; height: 78vh; background: #252A33; border-radius: 10px; overflow: hidden; }
body.modo-3d .plano-wrap { display: none; }
body.modo-3d #vista3d { display: block; }
#vista3d canvas { display: block; }
#btn-fit-3d { position: absolute; top: 10px; left: 10px; z-index: 2; }
#ficha3d { position: absolute; top: 10px; right: 10px; z-index: 2; width: 250px; background: #fff; border-radius: 10px; padding: 12px 14px; box-shadow: 0 10px 28px rgba(0, 0, 0, .35); font-size: 13px; }
#ficha3d img { width: 100%; height: 110px; object-fit: contain; }
#ficha3d h3 { margin: 6px 0 2px; font-size: 15px; }
#ficha3d .cod { color: #5A5E64; font-size: 12px; margin-bottom: 6px; }
#ficha3d .dato { display: flex; justify-content: space-between; gap: 8px; padding: 3px 0; border-top: 1px solid #EEE; }
#ficha3d .dato span { color: #5A5E64; }
#ficha3d .cerrar { float: right; border: none; background: none; cursor: pointer; font-size: 14px; }
