.editor { max-width: 960px; margin: 0 auto; padding: 0 16px 32px; }
.aviso-leitura { background: var(--soft); border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; font-size: 15px; }
.painel { background: var(--tile); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; margin: 12px 0; }
.painel label { display: block; font-weight: 600; margin: 8px 0 4px; }
.painel select, .painel textarea { width: 100%; font: inherit; padding: 8px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.painel textarea { font-family: ui-monospace, monospace; font-size: 13px; }
.quadro { border: 1px solid var(--line); border-radius: 8px; background: #fff; touch-action: none; cursor: grab; outline-offset: 2px; }
.quadro:focus-visible { outline: 3px solid var(--green); }
.quadro:active { cursor: grabbing; }
.barra-zoom { display: flex; gap: 8px; margin: 6px 0; }
.barra-zoom button { min-width: 44px; min-height: 44px; font-size: 18px; border: 1px solid var(--line); border-radius: 8px; background: #fff; cursor: pointer; }
.g-svg { width: 100%; height: auto; display: block; max-height: 70vh; }
.g-contorno { fill: var(--soft); stroke: var(--ink); stroke-width: 2; vector-effect: non-scaling-stroke; }
.g-recorte { fill: var(--paper); stroke: var(--green); stroke-width: 2; vector-effect: non-scaling-stroke; }
.g-superficie { stroke: var(--amber); stroke-linecap: butt; opacity: .85; }
.g-erro { stroke: var(--red); stroke-width: 3.5; }
.g-contorno.g-erro { fill: #f6e3e3; }
.g-recorte.g-erro { fill: #f6e3e3; }
.g-superficie.g-erro { stroke: var(--red); }
.g-cota { fill: var(--ink); font-weight: 600; paint-order: stroke; stroke: #fff; stroke-width: 3px; stroke-linejoin: round; }
.g-cota-leve { fill: #566; paint-order: stroke; stroke: #fff; stroke-width: 3px; }
#estado-validacao[data-tipo="ok"] { color: var(--green); font-weight: 600; }
#estado-validacao[data-tipo="erro"] { color: var(--red); font-weight: 600; }
.tabela-rolavel { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 15px; }
th, td { border-bottom: 1px solid var(--line); padding: 6px 8px; text-align: left; white-space: nowrap; }
#medidas dl { display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; margin: 0; }
#medidas dt { font-weight: 600; }
#medidas dd { margin: 0; }

/* ---- edição (M2) ---- */
.linha-campos { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 8px 12px; }
.linha-campos input, .painel input[type=text] { width: 100%; font: inherit; padding: 8px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.opcoes-encaixe { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 6px 0; }
.opcoes-encaixe label { display: inline-flex; gap: 6px; align-items: center; font-weight: 400; margin: 0; }
.quadro-edicao { cursor: default; }
.g-aresta-alvo { stroke: transparent; cursor: pointer; }
.g-aresta-alvo.g-sel { stroke: rgba(31, 110, 74, .35); }
.g-aresta-alvo:hover { stroke: rgba(31, 110, 74, .18); }
.g-no { cursor: grab; outline: none; }
.g-no-alvo { fill: transparent; }
.g-no-ponto { fill: #fff; stroke: var(--green); stroke-width: 2; vector-effect: non-scaling-stroke; }
.g-no.g-sel .g-no-ponto { fill: var(--green); }
.g-no:focus-visible .g-no-ponto { stroke: var(--ink); stroke-width: 3; }
.g-guia { stroke: var(--amber); stroke-dasharray: 6 4; stroke-width: 1.5; vector-effect: non-scaling-stroke; fill: none; }
#painel-selecao h2 { font-size: 17px; margin: 0 0 6px; }
.linha-acao { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; margin-top: 8px; }
.linha-acao > div { flex: 1 1 140px; }
.linha-acao button, .barra-zoom button { min-height: 44px; }
.recusa { color: var(--red); font-weight: 600; }
textarea[readonly] { background: #f6f6f0; }
.g-apice { cursor: ns-resize; outline: none; }
.g-apice-ponto { fill: var(--amber); stroke: #fff; stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.g-apice:focus-visible .g-apice-ponto { stroke: var(--ink); stroke-width: 3; }
.linha-acao select { width: 100%; font: inherit; padding: 8px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.info-arco { font-size: 15px; color: #566; margin: 6px 0 0; }

/* ---- 3D leve ---- */
.par-vistas { display: grid; grid-template-columns: 1fr; gap: 0 16px; }
@media (min-width: 980px) { .editor { max-width: 1280px; } .par-vistas { grid-template-columns: 3fr 2fr; align-items: start; } }
.titulo-vista { font-size: 17px; margin: 0 0 6px; }
.g3d-barra { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.g3d-barra button { min-height: 44px; min-width: 44px; border: 1px solid var(--line); border-radius: 8px; background: #fff; cursor: pointer; font: inherit; padding: 0 10px; }
.g3d-tela { border: 1px solid var(--line); border-radius: 8px; background: linear-gradient(#fbfbf7, #eef2ec); touch-action: none; cursor: grab; min-height: 220px; outline-offset: 2px; }
.g3d-tela:focus-visible { outline: 3px solid var(--green); }
.g3d-svg { width: 100%; height: auto; display: block; max-height: 60vh; }
.g3d-aviso { background: #fbf1df; border: 1px solid #e6cf9d; color: var(--amber); border-radius: 8px; padding: 6px 10px; font-size: 14px; }
.g3d-vazio { padding: 24px; color: #566; text-align: center; }
.g3d-nota { margin: 6px 0 0; }
.g-recorte[data-rid] { cursor: move; }
.g-recorte.g-sel { stroke: var(--amber); stroke-width: 3; }
.g-recorte:focus-visible { stroke: var(--ink); stroke-width: 3; outline: none; }
.g-ralca { cursor: nwse-resize; outline: none; }
.g-ralca-ponto { fill: #fff; stroke: var(--amber); stroke-width: 2; vector-effect: non-scaling-stroke; }
.g-ralca:focus-visible .g-ralca-ponto { stroke: var(--ink); stroke-width: 3; }
.barra-recorte { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; margin-top: 6px; }
.barra-recorte > div { flex: 1 1 130px; }
.barra-recorte select { width: 100%; font: inherit; padding: 8px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.g-superficie-alvo { stroke: transparent; cursor: pointer; outline: none; }
.g-superficie.g-sel { stroke: var(--green); opacity: 1; }
.g-superficie-alvo:focus-visible { stroke: rgba(22, 36, 31, .35); }
.lista-superficies { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.lista-superficies button { min-height: 40px; }

/* ---- importação de DXF ---- */
.escolha-peca { border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; margin: 8px 0; }
.escolha-peca legend { font-weight: 600; padding: 0 6px; }
.escolha-peca label { display: flex; gap: 8px; align-items: center; font-weight: 400; margin: 4px 0; min-height: 36px; }
.previa-importacao { border: 1px solid var(--line); border-radius: 8px; background: #fff; max-width: 520px; }
.previa-importacao .g-svg { max-height: 260px; }
#importar-conteudo select { width: 100%; font: inherit; padding: 8px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }

/* ---- ordem de corte / salvar ---- */
#painel-ordem select, #painel-ordem input[type=text], #painel-ordem input[type=password] { width: 100%; font: inherit; padding: 8px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
#o-msg[data-tipo="ok"] { color: var(--green); font-weight: 600; }
#o-msg[data-tipo="erro"] { color: var(--red); font-weight: 600; }
#painel-ordem .aviso-leitura { margin: 8px 0; }
.g3d-recursos { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; margin: 6px 0; font-size: 15px; }
.g3d-recursos label { display: inline-flex; gap: 6px; align-items: center; font-weight: 400; margin: 0; }
.g3d-recursos select { font: inherit; padding: 6px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.g3d-recursos input[type=range] { width: 120px; }
.g3d-recursos button { min-height: 44px; border: 1px solid var(--line); border-radius: 8px; background: #fff; cursor: pointer; font: inherit; padding: 0 12px; }
.barra-recorte button, #painel-ordem button, #painel-importar button { min-height: 44px; }
.pular { position: absolute; left: -9999px; top: 0; background: var(--ink); color: #fff; padding: 10px 14px; border-radius: 0 0 8px 0; z-index: 10; }
.pular:focus { left: 0; }

/* alvos de toque em PIXELS de tela (não em unidades do desenho): ~44 px nos vértices e alças, ~26 px nos lados */
.g-no-alvo { fill: transparent; stroke: transparent; stroke-width: 40px; vector-effect: non-scaling-stroke; pointer-events: all; }
.g-aresta-alvo { stroke-width: 26px; vector-effect: non-scaling-stroke; stroke-linecap: round; }
.g-superficie-alvo { stroke-width: 26px; vector-effect: non-scaling-stroke; }
