/* =====================================================================
 * bimbarraopcoes.css — a BARRA DE OPÇÕES da ferramenta (sob a fita do BIM)
 * e a prévia de MODELAR NA PLANTA (js/bimbarraopcoes.js,
 * js/bimplantamodelar.js). Só tokens da casca (--rv-*) e da planta
 * (--d2-*): o tema escuro do BIM vem junto, sem cor escrita aqui. Só existe
 * com a prévia do modelador (a barra não é criada sem ela).
 * ===================================================================== */

/* ------------------------------------------------------------- a barra */
/* ⚠ ALTURA FIXA, UMA LINHA, nasce com a casca (js/gestao.js): a barra que aparecesse no 1º
   comando, ou que quebrasse em duas linhas numa ferramenta e não na outra, mudaria a altura
   do palco no meio do uso — o canvas do 3D se mede de novo e o clique já mirado cai fora (foi
   o que a e2e-bim-b3 pegou). Tela estreita: rola na horizontal; a ordem põe à esquerda o que
   se usa a cada traço (formas e precisão) e por último o que também está em Propriedades. */
.bbo {
  position: relative; flex: 0 0 auto; display: flex; align-items: center; gap: 4px;
  height: 32px; box-sizing: border-box; padding: 0 8px; border-bottom: 1px solid var(--rv-linha-forte);
  background: var(--rv-fita-bg); color: var(--rv-fita-tx); font-size: var(--t-micro); white-space: nowrap;
}
.bbo-corpo { display: flex; align-items: center; flex-wrap: nowrap; gap: 4px; flex: 1 1 auto; min-width: 0; height: 100%; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.bbo-corpo::-webkit-scrollbar { display: none; }
.bbo-nome { font-weight: var(--p-forte); padding-right: 6px; border-right: 1px solid var(--rv-linha); }
.bbo-vazio { color: var(--rv-tx-fraco); font-weight: var(--p-medio); border-right: 0; }
.bbo-grupo { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 3px; padding-right: 5px; border-right: 1px solid var(--rv-linha); }
.bbo-grupo:last-child { border-right: 0; }
.bbo-rot { color: var(--rv-tx-fraco); margin-right: 2px; }
.bbo-campo { display: inline-flex; align-items: center; gap: 4px; color: var(--rv-tx-fraco); }
.bbo-campo input, .bbo-campo select {
  height: 24px; padding: 0 4px; border: 1px solid var(--rv-linha-forte); border-radius: 3px;
  background: var(--rv-tela); color: var(--rv-fita-tx); font-size: var(--t-micro); font-variant-numeric: tabular-nums;
}
.bbo-campo input { width: 4.5em; }
.bbo-campo select { max-width: 8em; text-overflow: ellipsis; }
.bbo-campo input:focus-visible, .bbo-campo select:focus-visible { outline: 2px solid var(--rv-foco); outline-offset: 0; }

/* liga/desliga (Ortogonal, Snaps, Grade, Encadear) e os botões de forma */
.bbo-liga, .bbo-menu-bt, .bbo-forma {
  display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 6px;
  border: 1px solid transparent; border-radius: 3px; background: transparent; color: var(--rv-fita-tx);
  font: inherit; cursor: pointer;
}
.bbo-forma { width: 28px; justify-content: center; padding: 0; }
.bbo-liga:hover, .bbo-menu-bt:hover, .bbo-forma:hover { background: var(--rv-hover); }
.bbo-liga[aria-pressed="true"], .bbo-forma[aria-pressed="true"] { background: var(--rv-ativo); border-color: var(--rv-ativo-borda); }
.bbo-liga:focus-visible, .bbo-menu-bt:focus-visible, .bbo-forma:focus-visible { outline: 2px solid var(--rv-foco); outline-offset: 1px; }
.bbo-liga svg, .bbo-menu-bt svg, .bbo-forma svg { flex: 0 0 auto; }
.bbo-so-seta { padding: 0 3px; margin-left: -4px; }
.bbo-seta { font-size: var(--t-mini); color: var(--rv-tx-fraco); }

/* menus (incrementos de ângulo, tipos de snap) */
.bbo-pop {
  position: absolute; top: 100%; z-index: 30; min-width: 170px; padding: 6px 10px;
  border: 1px solid var(--rv-linha-forte); border-radius: 4px; background: var(--rv-painel-bg);
  color: var(--rv-painel-tx); box-shadow: 0 6px 18px var(--rv-sombra); white-space: normal;
}
.bbo-pop-tit { font-weight: var(--p-forte); margin-bottom: 4px; }
.bbo-pop-item { display: flex; align-items: center; gap: 6px; padding: 2px 0; cursor: pointer; }
.bbo-pop-nota { margin-top: 4px; color: var(--rv-tx-fraco); max-width: 200px; }
/* a barra fica por cima do palco quando um menu abre (o overflow-x da barra cortaria o menu) */
.bbo:has(.bbo-pop) { z-index: 30; }

/* as opções de Mover/Copiar/Girar (js/bimprecisaoui.js) dentro da barra */
.bbo-slot { display: inline-flex; align-items: center; }
.bbo .bp-opcoes { position: static; transform: none; box-shadow: none; border: 0; background: transparent; padding: 0; color: inherit; font-size: var(--t-micro); }

/* ------------------------------------------------------------- a planta */
.d2-vista-tela[data-pm-ferr] { cursor: crosshair; }
.pm-elastico { fill: none; stroke: var(--d2-sel); stroke-width: 1.5; }
.pm-faixa { fill: var(--d2-sel); fill-opacity: .12; stroke: var(--d2-sel); stroke-width: 1; stroke-dasharray: 4 3; }
.pm-fecho { fill: none; stroke: var(--d2-sel); stroke-width: 1; stroke-dasharray: 3 4; }
.pm-forma { fill: none; stroke: var(--d2-sel); stroke-width: 1.5; stroke-dasharray: 6 3; }
.pm-vert { fill: var(--d2-papel); stroke: var(--d2-sel); stroke-width: 1.5; }
.pm-guia { fill: none; stroke: var(--d2-fraco); stroke-width: 1; stroke-dasharray: 2 4; }
.pm-mira { stroke: var(--d2-sel); stroke-width: 1; }
.pm-snap { fill: none; stroke: var(--d2-sel); stroke-width: 2; }
.pm-snap-intersecao, .pm-snap-perpendicular { stroke-width: 2.2; }
.pm-hospede { fill: var(--d2-sel); fill-opacity: .08; stroke: var(--d2-sel); stroke-width: 1.5; }
.pm-vao { fill: var(--d2-papel); stroke: var(--d2-sel); stroke-width: 2; }
.pm-folha { fill: none; stroke: var(--d2-sel); stroke-width: 2; }
.pm-seta { cursor: pointer; }
.pm-seta-fundo { fill: var(--d2-papel); stroke: var(--d2-sel); stroke-width: 1; vector-effect: non-scaling-stroke; }
.pm-seta path { fill: none; stroke: var(--d2-sel); stroke-width: 1.6; }
.pm-seta:hover .pm-seta-fundo { fill: var(--d2-sel); }
.pm-seta:hover path { stroke: var(--d2-papel); }

/* comprimento · ângulo junto ao cursor, e a caixa de digitar */
.pm-rot, .pm-dig {
  position: absolute; z-index: 7; padding: 2px 6px; border: 1px solid var(--d2-sel); border-radius: 3px;
  background: var(--d2-papel); color: var(--d2-tinta); font-size: var(--t-micro); font-variant-numeric: tabular-nums; white-space: nowrap;
}
.pm-rot { pointer-events: none; }
.pm-dig { display: none; align-items: center; gap: 8px; }
.pm-dig label { display: inline-flex; align-items: center; gap: 4px; }
.pm-dig input { width: 5em; height: 22px; padding: 0 4px; border: 1px solid var(--d2-fraco); border-radius: 3px; background: var(--d2-papel); color: var(--d2-tinta); font-size: var(--t-micro); }
.pm-dig input:focus-visible { outline: 2px solid var(--d2-sel); outline-offset: 0; }

/* ------------------------------------------------- a PRECISÃO na barra de baixo (14/10/2026)
   js/bimbarrasnaps.js: Snap (F3) e Orto (F8), com os menus dos tipos e dos incrementos. Mora na
   `.rv-vistabar` (rodapé da área, FORA do palco): nunca fica por cima do desenho. A luz diz se está
   aceso ou apagado mesmo sem passar o mouse. */
.bbs { display: inline-flex; align-items: center; gap: 2px; margin-left: auto; padding-left: 8px; border-left: 1px solid var(--rv-linha); flex: 0 0 auto; }
.bbs-tit { color: var(--rv-tx-fraco); margin-right: 4px; white-space: nowrap; }
.rv-vb.bbs-bt { width: auto; padding: 0 7px; gap: 5px; }
.rv-vb.bbs-seta { width: auto; min-width: 16px; padding: 0 4px; gap: 4px; margin-left: -1px; }
.bbs-rot, .bbs-txt { font-size: inherit; white-space: nowrap; }
.bbs-txt { color: var(--rv-tx-fraco); font-variant-numeric: tabular-nums; }
.bbs-v { font-size: var(--t-mini); color: var(--rv-tx-fraco); }
.bbs-n { font-size: var(--t-mini); color: var(--rv-tx-fraco); font-variant-numeric: tabular-nums; }
.bbs-luz { width: 7px; height: 7px; border-radius: 50%; flex: 0 0 auto; background: var(--rv-tx-off); box-shadow: inset 0 0 0 1px var(--rv-linha-forte); }
.bbs-bt[aria-pressed="true"] .bbs-luz { background: var(--verde, #15803d); box-shadow: 0 0 0 2px color-mix(in srgb, var(--verde, #15803d) 25%, transparent); }
.bbs-bt[aria-pressed="false"] .bbs-rot { color: var(--rv-tx-fraco); }
.bbs-bt:focus-visible, .bbs-seta:focus-visible { outline: 2px solid var(--rv-foco); outline-offset: 1px; }
.bbs-seta[aria-expanded="true"] { background: var(--rv-ativo); border-color: var(--rv-ativo-borda); }
/* o menu sobe da barra (position fixed, preso à casca — o overflow da barra cortaria) */
.bbs-pop {
  position: fixed; z-index: 80; min-width: 210px; max-width: 280px; padding: 8px 10px;
  border: 1px solid var(--rv-linha-forte); border-radius: 4px; background: var(--rv-painel-bg);
  color: var(--rv-painel-tx); box-shadow: 0 -6px 18px var(--rv-sombra); font-size: var(--t-micro); white-space: normal;
}
.bbs-pop-tit { display: flex; align-items: center; justify-content: space-between; font-weight: var(--p-forte); margin-bottom: 4px; }
.bbs-tecla { font-weight: var(--p-medio); font-size: var(--t-mini); padding: 0 4px; border: 1px solid var(--rv-linha-forte); border-radius: 3px; color: var(--rv-tx-fraco); }
.bbs-pop-item { display: flex; align-items: center; gap: 6px; padding: 3px 0; min-height: 22px; cursor: pointer; }
.bbs-pop-geral { font-weight: var(--p-forte); border-bottom: 1px solid var(--rv-linha); padding-bottom: 5px; margin-bottom: 3px; }
.bbs-glifo { display: inline-flex; width: 16px; height: 16px; }
.bbs-glifo svg { width: 14px; height: 14px; }
.bbs-pop-passo { border-top: 1px solid var(--rv-linha); margin-top: 3px; padding-top: 6px; cursor: default; }
.bbs-pop-passo input { width: 4em; height: 22px; padding: 0 4px; border: 1px solid var(--rv-linha-forte); border-radius: 3px; background: var(--rv-tela); color: var(--rv-painel-tx); font-size: var(--t-micro); }
.bbs-pop-passo input:focus-visible { outline: 2px solid var(--rv-foco); outline-offset: 0; }
.bbs-pop-nota { margin-top: 5px; color: var(--rv-tx-fraco); line-height: 1.35; }
@media (max-width: 640px) { .bbs-tit { display: none; } }
/* com a Precisão na barra, o botão "Snap" antigo da mesma barra (o da TRENA, que mora também em
   Anotar › Medir › Snap) sai dela: dois "Snap" lado a lado confundiam qual era o do desenho */
.rv-vistabar:has(.bbs) [data-rv-vb="snap"] { display: none; }
/* O SELO DA DISCIPLINA (canto de baixo da vista, js/bimshell.js) apaga enquanto uma ferramenta de CRIAR
   está armada (a barra de opções mostra o comando): ele fica por cima do canto do desenho, onde a parede,
   a viga ou a cota caem. Sem ferramenta ele volta — é o que sai no print da tela. (A cota 2D já apaga
   pelo css/bimcotas.css; esta regra vale para todo comando.) */
.bim-revit:has(.bbo[data-bbo-sub]:not([data-bbo-sub=""])) .rv-disc-selo { opacity: 0; transition: opacity .15s ease; }
/* SNAPS COMPLETOS (14/10/2026): o menu do Snap agrupado (Pontos · Geometria · Relações · Referências ·
   Rastreamento), em duas colunas; tela baixa rola dentro do menu */
.bbs-pop[data-bbs-pop="snapMenu"] { max-width: min(520px, calc(100vw - 16px)); min-width: 300px; max-height: calc(100vh - 120px); overflow-y: auto; }
.bbs-pop-acoes { display: flex; flex-wrap: wrap; gap: 4px; margin: 2px 0 6px; }
.bbs-pop-grupos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px 14px; }
.bbs-pop-grupo { min-width: 0; }
.bbs-pop-gtit { font-weight: var(--p-forte); font-size: var(--t-mini); color: var(--rv-tx-fraco); text-transform: uppercase; letter-spacing: .04em; margin: 6px 0 2px; }
@media (max-width: 640px) { .bbs-pop-grupos { grid-template-columns: 1fr; } }
/* as guias do rastreamento e os pontos adquiridos ficam no 3D (js/bimprecisaoui.js); aqui só o menu */
