/* biblioteca.css :: Biblioteca e Apresentação (prefixo bb-; lâminas bbl- ficam em LAMINA_CSS no biblioteca.js; memorial bbm-) */

.bb { display: flex; flex-direction: column; gap: 14px; max-width: 1280px; min-width: 0; }
.bb .sc { margin-bottom: 0; }
.bb-intro p { color: var(--body); margin: 0; max-width: 760px; }
.bb-tabs { margin-bottom: 0; }
.bb-carregando { display: flex; align-items: center; gap: 12px; color: var(--muted); }
.bb-carregando .rd-spin { width: 28px; height: 28px; border-width: 3px; }
.bb input[type=date], .bb input[type=url] {
  font-family: var(--font-ui); font-size: 13px; font-weight: 500; color: var(--ink); background: var(--bg-surface);
  border: 1px solid #D1D5E8; border-radius: var(--r-sm); padding: 8px 10px; width: 100%; outline: none; line-height: 1.4; min-width: 0;
}
.bb input[type=date]:focus, .bb input[type=url]:focus { border-color: var(--navy-700); box-shadow: 0 0 0 3px rgba(22,34,71,0.09); }
.bb .field { min-width: 0; }
.bb .rd-acoes { margin-bottom: 0; }
.bb-status { font-size: 12.5px; color: var(--muted); }
#bbPalStatus { min-height: 3.2em; margin: 8px 0 0; } /* altura fixa: salvar no blur não desloca o botão seguinte */
.bb-vazio { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 28px 16px;
  border: 1px dashed var(--border); border-radius: 12px; background: var(--bg-surface); }
.bb-vazio > .av-ic { width: 44px; height: 44px; }
.bb-vazio p { margin: 0; max-width: 520px; }

/* seletor de projeto */
.bb-proj { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.bb-proj label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .11em; color: var(--muted); }
.bb-proj select { flex: 1 1 240px; max-width: 480px; }

/* biblioteca */
.bb-link { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.bb-link input { flex: 1 1 260px; }
.bb-filtros { display: flex; flex-direction: column; gap: 8px; }
.bb-busca { max-width: 460px; }
#bbChips { display: flex; flex-direction: column; gap: 6px; }
.bb-chips-tag { align-items: center; }
.bb-chips-rot { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .11em; color: var(--muted); margin-right: 2px; }
.bb-grade { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.bb-card { display: flex; flex-direction: column; background: var(--bg-surface); border: 1px solid var(--border); border-radius: 12px;
  overflow: hidden; box-shadow: var(--sh-card); min-width: 0; }
.bb-card:hover { border-color: var(--orange-border); }
.bb-card-main { display: flex; flex-direction: column; text-align: left; border: 0; background: none; padding: 0; cursor: pointer;
  font-family: var(--font-ui); color: var(--body); flex: 1; min-width: 0; }
.bb-card-img, .bb-prev-img { position: relative; display: flex; align-items: center; justify-content: center; background: var(--bg-zebra); overflow: hidden; }
.bb-card-img { aspect-ratio: 4 / 3; width: 100%; }
.bb-card-img > .av-ic, .bb-prev-img > .av-ic { width: 40px; height: 40px; opacity: .45; }
.bb-card-img img:not(.av-ic), .bb-prev-img img:not(.av-ic) { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #fff; }
.bb-card-txt { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px 8px; min-width: 0; }
.bb-card-cat { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--orange); }
.bb-card-nome { font-weight: 700; color: var(--ink); font-size: 13.5px; line-height: 1.3; overflow-wrap: anywhere;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.bb-card-forn { font-size: 12px; color: var(--body); overflow-wrap: anywhere; }
.bb-card-preco { font-size: 15px; font-weight: 700; color: var(--navy-700); margin-top: 2px; }
.bb-card-visto { font-size: 11px; color: var(--muted); }
.bb-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.bb-tag { font-size: 10.5px; padding: 1px 8px; border-radius: 20px; background: var(--navy-100); color: var(--navy-700); }
.bb-card-acoes { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 12px 12px; }
.bb-card-acoes .btn { flex: 1 1 auto; padding: 7px 10px; }

/* selo e botão "Compartilhar no catálogo" no produto da biblioteca */
.bb-card-ct { padding: 0 12px 12px; margin-top: -4px; min-width: 0; }
.bb-ct-comp { border: 0; background: none; padding: 2px 0; cursor: pointer; font-family: var(--font-ui); font-size: 11.5px; font-weight: 600;
  color: var(--navy-700); display: inline-flex; align-items: center; gap: 5px; text-align: left; }
.bb-ct-comp:hover { color: var(--orange); }
.bb-ct-comp .av-ic, .bb-ct-selo .av-ic { width: 14px; height: 14px; flex: none; }
.bb-ct-selo { display: inline-flex; align-items: center; gap: 5px; align-self: flex-start; font-size: 10.5px; font-weight: 700; padding: 2px 9px;
  border-radius: 20px; background: var(--navy-100); color: var(--navy-700); margin-top: 4px; max-width: 100%; }
.bb-ct-selo.cur { background: #FFF4E5; color: #9A5B00; }
.bb-ct-selo.ok { background: #E7F6EC; color: #067647; }

/* aba Catálogo Archveer */
.bb-tab-ct { display: inline-flex; align-items: center; gap: 6px; }
.bb-tab-ct .av-ic { width: 20px; height: 20px; flex: none; }
.bb-ct-topo .sc-body { display: flex; flex-direction: column; gap: 10px; }
.bb-ct-topo .rd-dica { margin: 0; }
.bb-ct-q { max-width: 640px; width: 100%; }
.bb-ct-filtros { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.bb-ct-filtros .field { margin: 0; }
.bb-ct-info { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 14px; font-size: 13px; color: var(--body); min-height: 20px; }
.bb-ct-info > .bb-vazio, .bb-ct-info > .rd-aviso { flex: 1 1 100%; }
.bb-ct-link { border: 0; background: none; padding: 0; cursor: pointer; font-family: var(--font-ui); font-size: 12.5px; font-weight: 700;
  color: var(--orange); text-decoration: underline; text-underline-offset: 3px; }
.bb-ct-card { position: relative; }
.bb-ct-card.sel { border-color: var(--orange); box-shadow: 0 0 0 2px var(--orange-light), var(--sh-card); }
.bb-ct-check { position: absolute; top: 8px; left: 8px; z-index: 2; width: 30px; height: 30px; border-radius: 8px; background: rgba(255,255,255,.94);
  border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; cursor: pointer; margin: 0; }
.bb-ct-check input { width: 18px; height: 18px; accent-color: var(--orange); cursor: pointer; margin: 0; }
.bb-ct-sp { color: var(--muted); font-size: 13px; }
.bb-ct-card .bb-card-acoes .btn { display: inline-flex; align-items: center; justify-content: center; gap: 5px; text-decoration: none; min-width: 0; }
.bb-ct-card .bb-card-acoes .btn-p { flex: 2 1 auto; }
/* a foto só cobre o ícone da categoria depois de carregar (e some se a loja falhar) */
.bb-ct-card .bb-card-img img:not(.av-ic) { opacity: 0; background: transparent; transition: opacity .2s; }
.bb-ct-card .bb-card-img img.ok { opacity: 1; background: #fff; }
.bb-ct-card .bb-card-acoes .av-ic { width: 14px; height: 14px; }
.bb-ct-mais { display: flex; justify-content: center; min-height: 44px; align-items: center; }
.bb-ct-barra { position: sticky; bottom: 12px; z-index: 1100; transition: bottom .2s; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 10px 14px;
  background: var(--navy-900); color: #fff; border-radius: 14px; box-shadow: 0 8px 24px rgba(12,21,37,.28); }
.bb-ct-barra[hidden] { display: none; }
/* o aviso do app (#nv-aviso) fica no rodapé: enquanto aparece, a barra sobe; escondido, não pode segurar o clique */
body:has(#nv-aviso.show) .bb-ct-barra { bottom: 96px; }
#nv-aviso:not(.show) { pointer-events: none; }
.bb-ct-barra strong { font-size: 13.5px; margin-right: auto; }
.bb-ct-barra .btn { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.bb-ct-barra .btn-g { background: transparent; color: #fff; border-color: rgba(255,255,255,.5); }
.bb-ct-barra .av-ic { width: 16px; height: 16px; }
.bb-ct-det-corpo { display: grid; grid-template-columns: minmax(0, 40%) minmax(0, 1fr); gap: 18px; align-items: start; }
.bb-ct-det-img { position: relative; display: flex; align-items: center; justify-content: center; aspect-ratio: 1 / 1; background: var(--bg-zebra);
  border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.bb-ct-det-img > .av-ic { width: 56px; height: 56px; opacity: .45; }
.bb-ct-det-img img:not(.av-ic) { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; opacity: 0; transition: opacity .2s; }
.bb-ct-det-img img.ok { opacity: 1; background: #fff; }
.bb-ct-det-txt { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.bb-ct-det-txt h3 { margin: 0; font-size: 17px; line-height: 1.3; color: var(--ink); overflow-wrap: anywhere; }
.bb-ct-det-preco { margin: 0; display: flex; flex-direction: column; }
.bb-ct-det-preco strong { font-size: 20px; color: var(--navy-700); }
.bb-ct-det-preco small { color: var(--muted); font-size: 12px; }
.bb-ct-dl { margin: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; }
.bb-ct-dl div { display: grid; grid-template-columns: 118px minmax(0, 1fr); gap: 8px; font-size: 12.5px; border-bottom: 1px solid var(--border); padding-bottom: 5px; }
.bb-ct-dl dt { font-weight: 700; color: var(--muted); font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; padding-top: 2px; }
.bb-ct-dl dd { margin: 0; color: var(--ink); overflow-wrap: anywhere; }
.bb-ct-arqs { margin: 0; font-size: 12.5px; }
.bb-ct-arqs a { color: var(--orange); font-weight: 600; }
.bb-ct-det .bb-modal-acoes .btn { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; }
.bb-ct-det .bb-modal-acoes .av-ic { width: 16px; height: 16px; }
.bb-ct-lk { color: var(--muted); overflow-wrap: anywhere; word-break: break-all; }
.bb-usar-prod > span:last-child { min-width: 0; }

/* conceito com IA (lâmina Conceito) */
.bb-ia { display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; border: 1px dashed var(--orange-border); border-radius: 10px; background: #FFFBF7; }
.bb-ia .rd-dica, .bb-ia .rd-acoes { margin: 0; }
.bb-ia .btn { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.bb-ia .rd-acoes .btn { align-self: auto; }
.bb-ia .av-ic { width: 18px; height: 18px; }
.bb-ia .bb-carregando { margin: 0; font-size: 13px; }

/* aba Referências: estilo do projeto e biblioteca de estilos */
.bb-est-atual { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 12px 14px; border: 1px solid var(--orange-border);
  background: #FFFBF7; border-radius: 12px; margin-bottom: 10px; }
.bb-est-atual-txt { display: flex; flex-direction: column; gap: 2px; flex: 1 1 240px; min-width: 0; }
.bb-est-atual-txt strong { font-family: var(--font-title); font-size: 19px; color: var(--ink); }
.bb-est-atual-txt p { margin: 2px 0 0; font-size: 13px; color: var(--body); }
.bb-est-rot { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--orange); }
.bb-est-atual-imgs { display: flex; gap: 6px; flex-wrap: wrap; }
.bb-est-atual-imgs img { width: 72px; height: 72px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); }
.bb-est-cores { display: inline-flex; gap: 0; border-radius: 8px; overflow: hidden; border: 1px solid var(--border); flex: none; }
.bb-est-cores span { width: 22px; height: 30px; }
.bb-est-grade { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin: 6px 0 12px; align-items: start; }
.bb-est { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: 10px; background: var(--bg-surface); overflow: hidden; min-width: 0; }
.bb-est.on { border-color: var(--orange); box-shadow: 0 0 0 2px var(--orange-light); }
.bb-est-main { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 10px; border: 0; background: none; cursor: pointer;
  text-align: left; font-family: var(--font-ui); color: var(--ink); min-width: 0; }
.bb-est-main strong { font-size: 13px; line-height: 1.25; }
.bb-est-img { display: block; width: 100%; aspect-ratio: 16 / 9; border-radius: 6px; overflow: hidden; background: var(--bg-zebra); }
.bb-est-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.bb-est-sel { display: inline-flex; align-items: center; gap: 4px; font-size: 10.5px; font-weight: 700; color: #067647; }
.bb-est-sel .av-ic { width: 14px; height: 14px; }
.bb-est-acoes { display: flex; gap: 6px; padding: 0 10px 10px; align-items: center; }
.bb-est-acoes .btn { padding: 6px 10px; min-width: 0; }
.bb-est-ed-cores { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.bb-est-ed-cores .bb-cor { gap: 4px; }
.bb-est-ed-imgs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.bb-est-ed-img { position: relative; width: 96px; height: 72px; border-radius: 8px; overflow: hidden; border: 1px solid var(--border); background: var(--bg-zebra); }
.bb-est-ed-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.bb-est-ed-img .bb-ib { position: absolute; top: 4px; right: 4px; width: 26px; height: 26px; background: rgba(255,255,255,.92); }

/* referências do projeto */
.bb-ref-add { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.bb-ref-add input[type=url] { flex: 1 1 240px; }
.bb-ref-add .btn { min-width: 0; }
.bb-ref-grade { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin-top: 12px; }
.bb-ref { position: relative; display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: 12px; overflow: hidden;
  background: var(--bg-surface); box-shadow: var(--sh-card); min-width: 0; }
.bb-ref.amou { border-color: #86CFA0; }
.bb-ref.vetou { border-color: #F2A7A7; }
.bb-ref.vetou .bb-ref-img img { filter: grayscale(.85); opacity: .7; }
.bb-ref-img { position: relative; display: flex; align-items: center; justify-content: center; aspect-ratio: 4 / 3; background: var(--bg-zebra); }
.bb-ref-img > .av-ic { width: 40px; height: 40px; opacity: .4; }
.bb-ref-img img:not(.av-ic) { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.bb-ref-reacao { position: absolute; top: 8px; left: 8px; font-size: 10.5px; font-weight: 700; padding: 3px 9px; border-radius: 20px; }
.bb-ref-reacao.amou { background: #E7F6EC; color: #067647; }
.bb-ref-reacao.vetou { background: #FDECEC; color: #B42318; }
.bb-ref-txt { display: flex; flex-direction: column; gap: 5px; padding: 10px 12px 4px; min-width: 0; }
.bb-ref-nota { margin: 0; font-size: 12.5px; color: var(--body); white-space: pre-line; overflow-wrap: anywhere; }
.bb-ref-link { font-size: 11px; color: var(--muted); }
.bb-ref-acoes { display: flex; flex-direction: column; gap: 8px; padding: 6px 12px 12px; margin-top: auto; }
.bb-ref-conc { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 600; color: var(--ink); cursor: pointer; }
.bb-ref-conc input { width: 17px; height: 17px; accent-color: var(--orange); }
.bb-ref-conc.off { color: var(--muted); cursor: default; }
.bb-ref-bts { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.bb-ref-ib { display: inline-flex; gap: 6px; margin-left: auto; }
.bb-ref-ib .bb-ib { width: 30px; height: 30px; }
.bb-chip-r { border: 1px solid var(--border); background: var(--bg-surface); color: var(--body); border-radius: 20px; padding: 4px 11px;
  font-family: var(--font-ui); font-size: 11.5px; font-weight: 600; cursor: pointer; }
.bb-chip-r.on { background: #E7F6EC; border-color: #86CFA0; color: #067647; }
.bb-chip-r.v.on { background: #FDECEC; border-color: #F2A7A7; color: #B42318; }
.bb-ref-prev { display: flex; align-items: center; justify-content: center; max-height: 320px; overflow: hidden; border-radius: 10px; background: var(--bg-zebra); }
.bb-ref-prev img { max-width: 100%; max-height: 320px; object-fit: contain; display: block; }

/* modais */
.bb-modal { position: fixed; inset: 0; z-index: 1200; background: rgba(12,21,37,.55); display: flex; align-items: flex-start; justify-content: center;
  overflow-y: auto; padding: 32px 12px; }
.bb-modal-box { background: var(--bg-surface); border-radius: 14px; width: 100%; max-width: 680px; padding: 18px 20px 20px;
  box-shadow: var(--sh-raised); display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.bb-modal-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.bb-modal-top h2 { font-family: var(--font-title); font-size: 20px; color: var(--ink); margin: 0; }
.bb-x { border: 0; background: var(--navy-100); color: var(--navy-700); width: 34px; height: 34px; border-radius: 50%; font-size: 22px; line-height: 1;
  cursor: pointer; flex: none; }
.bb-x:hover { background: var(--orange-light); color: var(--orange); }
.bb-modal-sub { margin: 0; font-size: 13px; color: var(--body); }
.bb-modal-acoes { margin-top: 12px; }
.bb-modal .fg { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
.bb-span { grid-column: 1 / -1; }
.bb-form-img { display: flex; gap: 12px; align-items: flex-end; margin-bottom: 12px; }
.bb-prev-img { width: 96px; height: 96px; border-radius: 10px; border: 1px solid var(--border); flex: none; }
.bb-grow { flex: 1; }
.bb-usar-prod { display: flex; gap: 12px; align-items: center; }
.bb-usar-prod .bb-prev-img { width: 64px; height: 64px; }
.bb-usar-prod small { color: var(--muted); }
/* uso do produto no orçamento dos projetos (Compras e Obra) */
.bb-card-uso { display: flex; gap: 5px; align-items: flex-start; margin-top: 6px; font-size: 11.5px; font-weight: 600; color: #23683A; line-height: 1.35; }
.bb-card-uso .av-ic { flex: none; width: 14px; height: 14px; margin-top: 1px; }
.bb-card-uso.bb-uso-0 { color: var(--muted); font-weight: 500; }
.bb-uso-lista { background: var(--bg-zebra); border-radius: 10px; padding: 10px 12px; }
.bb-uso-tit { display: flex; gap: 6px; align-items: center; margin: 0 0 6px; font-size: 12.5px; font-weight: 700; color: var(--ink); }
.bb-uso-tit .av-ic { width: 16px; height: 16px; flex: none; }
.bb-uso-lista ul { list-style: none; margin: 0; padding: 0; }
.bb-uso-lista li { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; justify-content: space-between; padding: 6px 0; border-top: 1px solid var(--border); font-size: 13px; }
.bb-uso-lista li:first-child { border-top: 0; }
.bb-uso-lista li > span { flex: 1 1 180px; min-width: 0; overflow-wrap: anywhere; }
.bb-uso-lista .btn { padding: 6px 10px; font-size: 12px; }
/* link da loja na janela Compartilhar no catálogo: inteiro, numa caixa própria, quebrando linha */
.bb-comp-lk { display: block; margin-top: 6px; padding: 6px 9px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg-zebra);
  font-size: 12px; line-height: 1.45; color: var(--body); text-decoration: none; overflow-wrap: anywhere; word-break: break-all; }
.bb-comp-lk:hover { border-color: var(--orange-border, var(--orange)); color: var(--ink); }
.bb-preco-form { border: 1px solid var(--border); border-radius: 12px; padding: 12px; background: var(--bg-zebra); }
.bb-hist-res { margin: 0; font-size: 13px; }
.bb-hist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.bb-hist li { display: flex; align-items: center; gap: 10px; padding: 9px 2px; border-bottom: 1px solid var(--border); }
.bb-hist-p { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.bb-hist-p strong { color: var(--ink); font-size: 14px; }
.bb-hist-p small { color: var(--muted); font-size: 11.5px; overflow-wrap: anywhere; }
.bb-var { font-size: 11.5px; font-weight: 700; padding: 3px 9px; border-radius: 20px; background: var(--navy-100); color: var(--navy-700); white-space: nowrap; }
.bb-var.sobe { background: #FDECEC; color: #B42318; }
.bb-var.desce { background: #E7F6EC; color: #067647; }

/* botões pequenos */
.bb-ib { width: 32px; height: 32px; border: 1px solid var(--navy-border); background: var(--bg-surface); color: var(--navy-700); border-radius: 8px;
  cursor: pointer; font-size: 16px; line-height: 1; display: inline-flex; align-items: center; justify-content: center; flex: none; padding: 0; }
.bb-ib:hover:not(:disabled) { background: var(--navy-100); }
.bb-ib:disabled { opacity: .35; cursor: default; }
.bb-ib .av-ic { width: 18px; height: 18px; }
.bb-ib-del:hover:not(:disabled) { background: #FEF2F2; border-color: #F5C2C2; color: #B42318; }

/* identidade */
.bb-ident summary { cursor: pointer; padding: 12px 16px; font-weight: 700; color: var(--ink); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.bb-ident summary small { font-weight: 500; color: var(--muted); font-size: 12px; }
.bb-ident summary .av-ic { width: 22px; height: 22px; }
.bb-ident-corpo { padding: 0 16px 16px; display: flex; flex-direction: column; gap: 12px; }
.bb-ident-logo { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.bb-ident-logo img { max-height: 48px; max-width: 180px; object-fit: contain; }
.bb-ident-logo p { margin: 0; }
.bb-ident-sem { font-size: 12px; color: var(--muted); border: 1px dashed var(--border); border-radius: 8px; padding: 10px 14px; }
.bb-cor { display: flex; align-items: center; gap: 10px; }
.bb-cor input[type=color] { width: 48px; height: 36px; border: 1px solid #D1D5E8; border-radius: var(--r-sm); padding: 2px; background: #fff; cursor: pointer; }
.bb-cor span { font-size: 12.5px; color: var(--body); font-variant-numeric: tabular-nums; text-transform: uppercase; }

/* apresentação */
.bb-barra { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-bottom: 12px; }
.bb-switch { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 13px; color: var(--ink); cursor: pointer; }
.bb-switch input { width: 18px; height: 18px; accent-color: var(--orange); }
.bb-add { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 12px 0 14px; }
.bb-add label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .11em; color: var(--muted); }
.bb-add select { flex: 0 1 240px; width: auto; min-width: 0; }
.bb-deck { display: flex; flex-direction: column; gap: 14px; }
.bb-lam { border: 1px solid var(--border); border-radius: 12px; background: var(--bg-zebra); padding: 10px; min-width: 0; }
.bb-lam.aberta { border-color: var(--orange-border); background: #FFFBF7; }
.bb-lam-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.bb-lam-n { font-family: var(--font-title); font-size: 18px; color: var(--orange); }
.bb-lam-t { color: var(--ink); font-size: 13.5px; flex: 1; min-width: 80px; }
.bb-lam-acoes { display: flex; gap: 6px; align-items: center; margin-left: auto; }
.bb-lam-acoes .btn { padding: 7px 12px; }
.bb-lam-corpo { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.bb-lam-prev { max-width: 760px; width: 100%; cursor: pointer; box-shadow: 0 1px 6px rgba(0,0,0,.12); border-radius: 2px; overflow: hidden; }
.bb-lam-ed { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.bb-lam-ed .field label a { text-transform: none; }
@media (min-width: 1100px) {
  .bb-lam.aberta .bb-lam-corpo { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); align-items: start; }
}
.bb-pick { display: flex; flex-direction: column; gap: 8px; }
.bb-pick-grade { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.bb-pick-i { border: 2px solid var(--border); border-radius: 8px; padding: 0; overflow: hidden; background: var(--bg-surface); cursor: pointer; text-align: left; min-width: 0; }
.bb-pick-i img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; background: var(--bg-zebra); }
.bb-pick-i span { display: block; font-size: 10.5px; padding: 4px 6px; color: var(--body); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bb-pick-i.on { border-color: var(--orange); box-shadow: 0 0 0 2px var(--orange-light); }
.bb-pick-i.on span { color: var(--orange); font-weight: 700; }
.bb-pick-pe { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.bb-up { position: relative; overflow: hidden; }
.bb-up input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.bb-itens { display: flex; flex-direction: column; gap: 4px; max-height: 320px; overflow-y: auto; border: 1px solid var(--border); border-radius: 8px;
  background: var(--bg-surface); padding: 6px; }
.bb-itens > .rd-dica { margin: 4px; }
.bb-itens .bb-item { display: flex; align-items: center; gap: 10px; padding: 5px 6px; border-radius: 6px; cursor: pointer; min-width: 0;
  text-transform: none; letter-spacing: normal; font-weight: 500; font-size: 12.5px; color: var(--ink); }
.bb-item:hover { background: var(--bg-zebra); }
.bb-item input { width: 18px; height: 18px; flex: none; accent-color: var(--orange); }
.bb-item-img { position: relative; width: 40px; height: 40px; flex: none; background: var(--bg-zebra); border-radius: 6px; overflow: hidden; }
.bb-item-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #fff; }
.bb-item-t { display: flex; flex-direction: column; font-size: 12.5px; color: var(--ink); min-width: 0; overflow-wrap: anywhere; }
.bb-item-t em { font-style: normal; color: var(--orange); font-weight: 700; }
.bb-item-t small { color: var(--muted); font-size: 11px; }
.bb-pal-prev { max-width: 760px; box-shadow: 0 1px 6px rgba(0,0,0,.12); }

/* tela cheia */
.bb-modal-tela .bb-modal-box.bb-tela { max-width: 1160px; background: #E9E7E3; }
.bb-tela-deck { display: flex; flex-direction: column; gap: 16px; }
.bb-tela-deck .bbl { box-shadow: 0 1px 6px rgba(0,0,0,.14); }

/* memorial: o documento (.bbm) fica em MEM_CSS no biblioteca.js, igual na tela, no PDF e no portal */
.bb-doc { min-width: 0; }
.bb-doc > .rd-aviso { max-width: 880px; margin-bottom: 10px; }
.bb-doc .bbm { box-shadow: var(--sh-card); }

/* planta numerada (editor) */
.bb-pl { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; align-items: start; }
.bb-pl-area { min-width: 0; }
.bb-pl-box { position: relative; line-height: 0; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; background: #fff; cursor: crosshair;
  user-select: none; -webkit-user-select: none; }
.bb-pl-box img { display: block; width: 100%; height: auto; pointer-events: none; }
.bb-pl-mk { cursor: pointer; }
.bb-pl-mk.sel { outline: 3px solid var(--orange); outline-offset: 1px; z-index: 2; }
.bb-pl-dica { font-size: 12.5px; color: var(--body); margin: 8px 0 0; min-height: 1.6em; }
.bb-pl-lado { max-height: 520px; overflow-y: auto; border: 1px solid var(--border); border-radius: 8px; padding: 6px; background: var(--bg-surface);
  display: flex; flex-direction: column; gap: 2px; }
.bb-pl-cat { display: flex; align-items: center; gap: 7px; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em;
  color: var(--muted); padding: 8px 6px 4px; }
.bb-pl-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.bb-pl-it { display: flex; align-items: center; gap: 9px; border: 1px solid transparent; background: none; border-radius: 8px; padding: 6px; cursor: pointer;
  text-align: left; font-family: var(--font-ui); color: var(--ink); min-width: 0; }
.bb-pl-it:hover { background: var(--bg-zebra); }
.bb-pl-it.sel { border-color: var(--orange); background: #FFFBF7; }
.bb-pl-n { flex: none; min-width: 24px; height: 24px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: #fff; background: #B8BDCC; padding: 0 4px; }
.bb-pl-it-t { display: flex; flex-direction: column; font-size: 12.5px; line-height: 1.3; min-width: 0; overflow-wrap: anywhere; }
.bb-pl-it-t small { color: var(--muted); font-size: 11px; }
.bb-ocupado { opacity: .6; pointer-events: none; }

/* celular */
@media (max-width: 600px) {
  .bb-tabs { flex-wrap: wrap; }
  .bb-tabs .tab-btn { flex: 1 1 auto; padding: 12px 8px; font-size: 11px; letter-spacing: .03em; }
  .bb-grade { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .bb-card-txt { padding: 8px 10px 6px; }
  .bb-card-nome { font-size: 12.5px; }
  .bb-card-preco { font-size: 14px; }
  .bb-card-acoes { padding: 0 8px 10px; gap: 5px; }
  .bb-card-acoes .btn { font-size: 10px; letter-spacing: .03em; padding: 7px 6px; white-space: normal; }
  .bb .btn-p { min-width: 0; }
  .bb-link .btn { flex: 1 1 auto; }
  .bb-modal { padding: 10px 8px; }
  .bb-modal-box { padding: 14px 14px 16px; }
  .bb-form-img { flex-direction: column; align-items: stretch; }
  .bb-prev-img { width: 100%; height: 150px; }
  .bb-usar-prod .bb-prev-img { width: 64px; height: 64px; }
  .bb-lam { padding: 8px; }
  .bb-pl { grid-template-columns: minmax(0, 1fr); }
  .bb-pl-lado { max-height: 340px; }
  .bb-est-grade { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bb-ref-grade { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .bb-ref-txt { padding: 8px 8px 2px; }
  .bb-ref-acoes { padding: 4px 8px 10px; }
  .bb-ref-ib .bb-ib { width: 28px; height: 28px; }
  .bb-chip-r { padding: 4px 8px; font-size: 10.5px; }
  .bb-ref-conc { font-size: 11px; }
  .bb-lam-acoes { margin-left: 0; }
  .bb-tabs .bb-tab-ct .av-ic { width: 16px; height: 16px; }
  .bb-ct-filtros { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bb-ct-filtros .field:last-child { grid-column: 1 / -1; }
  .bb-card-ct { padding: 0 8px 10px; }
  .bb-ct-comp { font-size: 10.5px; }
  .bb-ct-check { width: 28px; height: 28px; top: 6px; left: 6px; }
  .bb-ct-barra { bottom: 8px; padding: 10px; gap: 8px; }
  body:has(#nv-aviso.show) .bb-ct-barra { bottom: 132px; }
  .bb-ct-barra strong { flex: 1 1 100%; }
  .bb-ct-barra .btn { flex: 1 1 auto; justify-content: center; font-size: 11px; padding: 9px 8px; }
  .bb-ct-det-corpo { grid-template-columns: minmax(0, 1fr); }
  .bb-ct-det-img { max-height: 280px; aspect-ratio: auto; height: 240px; }
  .bb-ct-dl div { grid-template-columns: 96px minmax(0, 1fr); }
}

/* impressão: só o que o módulo montou em #bbPrint (fora da tela) */
@media screen { #bbPrint { display: none; } }
@media print {
  body.bb-imprimindo { display: block !important; background: #fff !important; margin: 0 !important; }
  body.bb-imprimindo > *:not(#bbPrint) { display: none !important; }
  body.bb-imprimindo #bbPrint, body.bb-imprimindo #bbPrint * { visibility: visible !important; }
  #bbPrint { display: block; position: static; }
  #bbPrint.bb-print-paisagem { width: 297mm; }
  #bbPrint .bbl-w { width: 297mm; break-after: page; page-break-after: always; }
  #bbPrint .bbl-w:last-child { break-after: auto; page-break-after: auto; }
  #bbPrint .bbl { aspect-ratio: auto; height: 209.5mm; }
  #bbPrint .bbm { border: 0; box-shadow: none; max-width: none; padding: 0; border-radius: 0; }
}
