/* ==========================================================================
   Biblioteca do hub. Carrega depois do pele.css, só nas telas da Biblioteca.
   Usa os tokens do base.css e as classes do hub e da pele. Aqui entra só o
   que nenhuma classe existente resolve, sempre com o prefixo bib-.
   Os dois temas saem dos tokens. A arte da capa padrão e do selo de tipo é
   desenho, como uma imagem, e fica igual nos dois temas.
   ========================================================================== */

/* ------------------------------------------------------- arte por tipo */

/* Fundo Casca de Ovo com grade, a mesma textura do guia, em tamanho menor. */
.bib-arte {
  background-color: #e4e3d1;
  background-image:
    linear-gradient(rgba(0, 0, 0, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 0, 0, 0.07) 1px, transparent 1px);
  background-size: 12px 12px;
}

/* Selo de tipo. Miniatura da capa padrão, no cartão da lista. */
.bib-selo {
  flex: none;
  display: block;
  width: 44px;
  height: 44px;
  border: 2px solid var(--borda);
  border-radius: 8px;
  overflow: hidden;
}
.bib-selo svg { display: block; width: 100%; height: 100%; }

/* Capa grande, 16 por 9. Só onde o item tem capa própria, e na referência. */
.bib-capa {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 16 / 9;
  overflow: hidden;
}
.bib-capa > svg { width: auto; height: 62%; }
.bib-capa img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.bib-capa-nome {
  position: absolute;
  left: 7%;
  bottom: 9%;
  padding: 2px 12px;
  font-family: var(--display);
  font-size: clamp(14px, 2.4vw, 18px);
  font-weight: 800;
  letter-spacing: -0.01em;
  color: #000000;
  background: #ffffff;
  border: 3px solid #000000;
  border-radius: 999px;
  box-shadow: 3px 3px 0 0 #000000;
  transform: rotate(-3deg);
  white-space: nowrap;
}

/* --------------------------------------------- janela de recomendados */

.bib-janela {
  margin: 28px 0 0;
  background: var(--superficie);
  border: var(--traco) solid var(--borda);
  border-radius: var(--raio);
  box-shadow: var(--sombra-g);
  overflow: hidden;
}
.bib-janela-barra {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0;
  padding: 9px 12px 9px 16px;
  font-family: var(--display);
  font-size: var(--t-rotulo);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0;
  color: var(--preto);
  background: var(--laranja);
  border-bottom: var(--traco) solid var(--borda);
}
.bib-janela-barra::after {
  content: "";
  flex: none;
  width: 66px;
  height: 18px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 66 18' opacity='.5'%3E%3Cg fill='%23fff' stroke='%23000' stroke-width='2'%3E%3Crect x='1' y='1' width='16' height='16'/%3E%3Crect x='25' y='1' width='16' height='16'/%3E%3Crect x='49' y='1' width='16' height='16'/%3E%3C/g%3E%3Cg stroke='%23000' stroke-width='2' fill='none'%3E%3Cpath d='M5 13h8'/%3E%3Crect x='29.5' y='5.5' width='7' height='7'/%3E%3Cpath d='M53 5l8 8M61 5l-8 8'/%3E%3C/g%3E%3C/svg%3E") center / contain no-repeat;
}
.bib-janela-corpo { padding: clamp(16px, 4vw, 22px); }
.bib-rec {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px 20px;
  padding: 16px;
}
.bib-rec + .bib-rec { border-top: 2px solid var(--linha); }
.bib-rec-titulo { margin: 0 0 8px; font-size: var(--t-destaque); font-weight: 700; line-height: 1.25; overflow-wrap: anywhere; }
.bib-rec-titulo a { color: var(--tinta); text-decoration: none; }
.bib-rec-titulo a:hover { text-decoration: underline; text-decoration-color: var(--laranja); }

/* Balão Âmbar, a única cor da paleta além do laranja nesta tela. Texto preto. */
.bib-recado {
  display: block;
  max-width: 60ch;
  margin: 0;
  padding: 8px 12px;
  font-size: var(--t-pequeno);
  line-height: 1.4;
  color: var(--preto);
  background: var(--ambar);
  border: 2px solid var(--borda);
  border-radius: var(--raio-p);
  border-top-left-radius: 0;
  box-shadow: var(--sombra-p);
}
@media (max-width: 560px) {
  .bib-rec { grid-template-columns: minmax(0, 1fr); }
  .bib-rec .btn { width: 100%; }
}

/* Estado vazio escrito, sempre com o próximo passo. */
/* Estado vazio. No eixo da Estante, com a figura ao lado do texto no
   computador e em cima no celular. Uma linha de Kalam e um rabisco, sem
   animação. A figura é uma estante de capas vazias, só contorno e ícone. */
.bib-vazio { display: flex; flex-wrap: wrap; align-items: center; gap: 22px 40px; margin: 28px 0 0; }
.bib-vazio-fig { flex: 0 1 300px; min-width: 220px; display: flex; align-items: flex-end; gap: 10px; padding-bottom: 10px; border-bottom: var(--traco) solid var(--borda); }
.bib-vazio-capa { flex: 1; aspect-ratio: 16 / 10; border: var(--traco) solid var(--borda); border-radius: var(--raio-p); background: transparent; }
.bib-vazio-meio { flex: 1.5; display: grid; place-items: center; background: var(--superficie); box-shadow: var(--sombra-p); }
.bib-vazio-meio svg { width: 42%; height: auto; color: var(--tinta); }
.bib-vazio-txt { flex: 1 1 320px; min-width: 0; max-width: 34em; }
.bib-vazio-mao { position: relative; display: inline-block; margin: 0 0 14px; padding-bottom: 6px; font-family: var(--mao); font-weight: 700; font-size: clamp(16px, 5.6vw, 20px); line-height: 1.2; color: var(--tinta); white-space: nowrap; }
.bib-rabisco { position: absolute; left: -2px; right: -6px; bottom: -6px; width: calc(100% + 8px); height: 12px; color: var(--laranja); }
.bib-vazio h2 { margin: 0 0 6px; }
.bib-vazio-txt > p:not(.bib-vazio-mao) { margin: 0; color: var(--fumaca); max-width: 30em; }
@media (max-width: 600px) { .bib-vazio-fig { flex-basis: 100%; max-width: 280px; } }


/* Linha de pé da Biblioteca, acima do rodapé comum do hub. */
.bib-nota-pe { margin: 56px 0 0; padding-top: 16px; border-top: 2px solid var(--linha); font-size: var(--t-pequeno); color: var(--fumaca); }

/* -------------------------------------------------------- página do item */

.bib-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 22px 0 12px; font-size: var(--t-rotulo); font-weight: 700; }
.bib-codigo { color: var(--fumaca); }
.bib-pilula {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 1px 10px;
  color: var(--tinta);
  background: var(--superficie);
  border: 2px solid var(--borda);
  border-radius: 999px;
  white-space: nowrap;
}
.bib-pilula.etapa { background: var(--casca); color: var(--casca-tinta); }
.bib-pilula.leve { border-style: solid; border-color: var(--linha); font-weight: 600; }
.bib-tambem-em { color: var(--fumaca); font-weight: 600; }
.bib-item-cab h1 { max-width: 26ch; }
.bib-item-cab .bib-assin { margin-top: 6px; font-size: var(--t-corpo); }
.bib-item-resumo { margin: 10px 0 0; max-width: 60ch; font-size: 17px; color: var(--fumaca); }
.bib-credito { margin: 10px 0 0; font-size: var(--t-rotulo); color: var(--fumaca); }
.bib-acoes { display: flex; flex-wrap: wrap; gap: 12px; margin: 22px 0 30px; }
.bib-acoes .btn svg { width: 18px; height: 18px; flex: none; }
.bib-acoes [aria-pressed="true"] { background: var(--superficie); color: var(--tinta); }
.bib-acoes [aria-pressed="true"] .bib-ico-estrela { width: 18px; height: 18px; }
.bib-acoes .bib-ico-estrela { width: 18px; height: 18px; }

/* Ícone de confirmação que troca com o de copiar. */
.bib-ico-certo { display: none; }
[data-copiado] .bib-ico-copiar { display: none; }
[data-copiado] .bib-ico-certo { display: block; animation: bib-certo var(--tq-t-aperto) var(--tq-chegada); }

/* Bloco Para copiar. O texto sai igual ao do item, com as linhas em branco. */
.bib-copiar {
  margin: 0 0 34px;
  background: var(--poco);
  border: var(--traco) solid var(--borda);
  border-radius: var(--raio);
  box-shadow: var(--sombra-m);
  overflow: hidden;
}
.bib-copiar-cab {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  padding: 8px 8px 8px 16px;
  color: var(--casca-tinta);
  background: var(--casca);
  border-bottom: var(--traco) solid var(--borda);
}
.bib-copiar-cab h2 { margin: 0; font-size: var(--t-corpo); }
.bib-copiar-cab p { margin: 0; font-size: var(--t-rotulo); }
.bib-copiar-texto {
  margin: 0;
  padding: 16px clamp(14px, 3vw, 20px) 18px;
  font-family: var(--display);
  font-size: var(--t-corpo);
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.btn.bib-noite, .btn.bib-noite:hover { background: var(--inverso); color: var(--inverso-tinta); }
.btn svg { flex: none; width: 18px; height: 18px; }

.bib-secoes { display: grid; gap: 26px; max-width: 66ch; margin: 0 0 38px; }
.bib-secao h2 { margin: 0 0 6px; font-size: var(--t-h3); }
.bib-secao p { margin: 0; font-size: 17px; white-space: pre-line; }

.bib-passos { list-style: none; counter-reset: passo; margin: 0; padding: 18px clamp(16px, 3vw, 22px) 20px; display: grid; gap: 14px; }
.bib-passos li { counter-increment: passo; display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 12px; align-items: start; font-size: 17px; }
.bib-passos li::before {
  content: counter(passo);
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: var(--t-pequeno);
  color: var(--tinta);
  background: var(--superficie);
  border: 2px solid var(--borda);
  border-radius: 50%;
}

.bib-combina { margin: 38px 0 0; }
.bib-combina > h2 { font-size: var(--t-h3); margin: 0 0 12px; }
.bib-rel { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 16px; }
.bib-rel a {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 12px 14px;
  color: var(--tinta);
  text-decoration: none;
  background: var(--superficie);
  border: var(--traco) solid var(--borda);
  border-radius: var(--raio-p);
  box-shadow: var(--sombra-p);
}
@media (hover: hover) { .bib-rel a:hover b { text-decoration: underline; text-decoration-color: var(--laranja); text-decoration-thickness: 2px; text-underline-offset: 3px; } }
.bib-rel a:active { transform: translate(3px, 3px); box-shadow: 0 0 0 0 var(--sombra); }
.bib-rel span { display: block; min-width: 0; }
.bib-rel .fraco { display: block; }
.bib-rel b { display: block; font-size: 17px; line-height: 1.25; overflow-wrap: anywhere; }

/* ---------------------------------------------------- cartão no hub */

.bib-hub-cab { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 4px; }
.bib-hub-cab h2 { margin: 0; }
.bib-hub-selos { display: flex; flex: none; }
.bib-hub-selos .bib-selo { width: 36px; height: 36px; box-shadow: 2px 2px 0 0 var(--sombra); }
.bib-hub-selos .bib-selo + .bib-selo { margin-left: -8px; }
.bib-hub-selos .bib-selo:nth-child(1) { transform: rotate(-6deg); }
.bib-hub-selos .bib-selo:nth-child(3) { transform: rotate(5deg); }
.bib-hub-linhas { list-style: none; margin: 8px 0 14px; padding: 0; }
.bib-hub-linhas li { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 2px solid var(--linha); }

/* ======================================================================= ADM */

.bib-adm-topo { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; align-items: start; }
.bib-adm-cab { align-items: center; margin-bottom: 6px; }
.bib-adm-cab h1 { margin: 0; }
.bib-adm-cab .linha-botoes { margin: 0; }
.bib-adm-sub { margin: 0 0 22px; }
.bib-sug-grupos { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); gap: 8px 32px; margin-top: 8px; }
.bib-sug-cliente { min-width: 0; scroll-margin-top: calc(90px - var(--barra-h, 64px) - 16px); }
.bib-sug-cliente h3 { margin: 16px 0 4px; font-size: var(--t-destaque); }
.bib-sug-cliente h3 .fraco { font-size: var(--t-pequeno); font-weight: 600; margin-left: 6px; }
.bib-sug-mais { margin: 8px 0 0; font-size: var(--t-pequeno); }
.bib-adm-item { display: flex; align-items: center; gap: 12px; }
.bib-adm-item .bib-mini { width: 88px; }
.bib-receita-linha { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; align-items: start; }
@media (min-width: 720px) { .bib-receita-linha { grid-template-columns: 240px minmax(0, 1fr); } }
.bib-receita-linha .bib-capa-previa { max-width: 360px; }
.bib-moldes { margin-top: 10px; }
.bib-moldes > summary { cursor: pointer; font-weight: 700; min-height: 44px; display: inline-flex; align-items: center; }
.bib-moldes-lista { list-style: none; margin: 6px 0 10px; padding: 0; display: grid; gap: 10px; }
.bib-moldes-lista li { display: flex; align-items: center; gap: 12px; }
.bib-moldes-lista li > span:last-child { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.bib-moldes-lista code { font-size: 13px; overflow-wrap: anywhere; color: var(--fumaca); }
.bib-sugestao { display: grid; gap: 4px; }
.bib-sugestao .bib-recado { margin-top: 6px; }
.bib-busca-linha { margin: 0; padding: 12px 0; border-top: 1px solid var(--linha); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; }
.bib-busca-linha:first-child { border-top: none; }
.bib-busca-linha b { font-size: var(--t-destaque); }
.bib-busca-linha form { margin: 0; }

.bib-atalhos { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 18px; }
.bib-atalhos .rotulo-sec { margin: 0 6px 0 0; }
.bib-atalho {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 6px 4px 12px;
  font-weight: 700;
  font-size: var(--t-pequeno);
  color: var(--tinta);
  text-decoration: none;
  background: var(--superficie);
  border: 2px solid var(--borda);
  border-radius: 999px;
}
.bib-atalho:hover { background: var(--secundaria); }
@media (pointer: coarse) { .bib-atalho { min-height: var(--toque); } }
@media (max-width: 720px) { .bib-atalho { min-height: 44px; } }
.filtros-adm select { width: auto; min-width: 150px; }
@media (max-width: 720px) { .filtros-adm select, .filtros-adm input[type="search"] { width: 100%; max-width: none; } .filtros-adm .btn { width: 100%; } }

table.lista.bib-tabela td:first-child { white-space: nowrap; }
.bib-marcas { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.bib-marcas .etiqueta { font-size: 13px; }
table.lista td.acoes .btn[disabled] { opacity: .45; }
/* Entre 1024 e 1279 px a tabela ainda é tabela, e os dois botões lado a lado
   empurravam a página para o lado. Ali eles empilham, alinhados à direita. */
@media (min-width: 1024px) and (max-width: 1279px) {
  table.lista.bib-tabela td.acoes { white-space: normal; }
  table.lista.bib-tabela td.acoes > * { display: flex; justify-content: center; width: 100%; margin: 0 0 8px; }
  table.lista.bib-tabela td.acoes > * + * { margin-left: 0; }
  table.lista.bib-tabela td.acoes > .fraco { justify-content: flex-end; }
}
@media (max-width: 1023px) {
  table.lista.bib-tabela td:first-child { color: var(--fumaca); }
}

/* Edição do item. Ficha à esquerda, painel interno à direita. */
.bib-edicao { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 28px; align-items: start; }
@media (min-width: 1024px) { .bib-edicao { grid-template-columns: minmax(0, 1fr) 340px; } }
.bib-contagem { float: right; font-weight: 600; color: var(--fumaca); font-size: var(--t-miudo); }
.bib-par { margin: 0 0 14px; padding: 14px 14px 2px; border: 2px solid var(--linha); border-radius: var(--raio-p); min-width: 0; }
.bib-par legend { padding: 0 6px; font-weight: 700; font-size: var(--t-pequeno); }
.bib-par.vazio-par { border-style: dashed; }
.bib-etapas-marcar { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 0 12px; }
.bib-etapas-marcar .marcar[aria-disabled="true"] { color: var(--fumaca); cursor: default; }
.bib-rel-linha { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 12px; align-items: center; margin-bottom: 10px; }
.bib-rel-linha input { text-transform: uppercase; }
.bib-rel-titulo { display: flex; align-items: center; gap: 8px; font-size: var(--t-pequeno); overflow-wrap: anywhere; }
.bib-rel-titulo::before {
  content: "";
  flex: none;
  width: 1.4em;
  height: 1.4em;
  border: 2px solid var(--borda);
  border-radius: 4px;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3 8.5l3.2 3.2L13 4.8' fill='none' stroke='%23fff' stroke-width='2.6'/%3E%3C/svg%3E") center / 70% no-repeat,
    var(--feito);
}
.bib-capa-previa { max-width: 360px; border: var(--traco) solid var(--borda); border-radius: var(--raio-p); overflow: hidden; }

.bib-interno { margin-bottom: 28px; background: var(--superficie); border: var(--traco) solid var(--borda); border-radius: var(--raio); box-shadow: var(--sombra-p); overflow: hidden; }
.bib-interno-cab { margin: 0; padding: 9px 16px; font-size: var(--t-rotulo); font-weight: 700; color: var(--casca-tinta); background: var(--casca); border-bottom: var(--traco) solid var(--borda); }
.bib-interno .ficha { padding: 4px 16px 8px; }
.bib-interno .ficha > div { grid-template-columns: minmax(0, 1fr); gap: 4px; }
.bib-interno dd { overflow-wrap: anywhere; font-size: var(--t-pequeno); }
.bib-nota {
  max-height: 240px;
  overflow: auto;
  padding: 10px 12px;
  font-size: var(--t-pequeno);
  line-height: 1.5;
  background: var(--fundo);
  border: 2px solid var(--borda);
  border-radius: var(--raio-p);
}
.bib-historico { list-style: none; margin: 0; padding: 0; }
.bib-historico li { padding: 6px 0; }

/* Importação. */
.bib-etapas-import { list-style: none; margin: 0 0 22px; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; counter-reset: etapa; }
.bib-etapas-import li {
  counter-increment: etapa;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 4px 14px 4px 6px;
  font-weight: 700;
  font-size: var(--t-pequeno);
  color: var(--fumaca);
  border: 2px solid var(--linha);
  border-radius: 999px;
}
.bib-etapas-import li::before {
  content: counter(etapa);
  width: 28px; height: 28px;
  display: grid; place-items: center;
  border: 2px solid currentColor;
  border-radius: 50%;
}
.bib-etapas-import li[aria-current="step"] { color: var(--inverso-tinta); background: var(--inverso); border-color: var(--borda); }
.bib-etapas-import li[data-feito] { color: var(--tinta); border-color: var(--borda); }
.bib-trava { font-size: var(--t-pequeno); max-width: 52ch; }
.bib-escolha { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; }
.bib-escolha select { width: auto; min-width: 170px; }

/* --------------------------------------------------------- movimento */

/* Só em resposta a uma ação, uma por ação, com o tempo da tabela de
   assinaturas do Modelo web v1.4.0. A estrela estala porque é rara. O copiado
   é resposta seca, porque copiar é frequente. Cada keyframe tem a versão
   reduzida logo abaixo, sem deslocamento, escala nem giro. */
@keyframes bib-pop { 0% { transform: scale(1); } 45% { transform: scale(1.4) rotate(-14deg); } 100% { transform: scale(1); } }
@keyframes bib-lupa { 0% { transform: rotate(0); } 50% { transform: rotate(-16deg) scale(1.12); } 100% { transform: rotate(0); } }
@keyframes bib-desce { from { transform: scale(.96); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes bib-certo { from { opacity: 0; } to { opacity: 1; } }
@keyframes bib-sobe { from { transform: translateY(calc(16px * var(--tq-k))); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes bib-carimbo { from { transform: scale(.96) rotate(-2deg); opacity: 0; } to { transform: rotate(-2deg); opacity: 1; } }
@keyframes bib-esmaece { from { opacity: 0; } to { opacity: 1; } }
@keyframes bib-esmaece-meio { from { opacity: .35; } to { opacity: 1; } }
.bib-pop { animation: bib-pop 340ms var(--tq-chegada); }
.bib-sobe { animation: bib-sobe 260ms var(--tq-chegada); }
/* Carimbo do aviso do ADM. Entrada simples de 200 ms, sem estalo, porque aviso
   é ação de vez em quando (decisão do Paulo de 18/10, 01h10). */
.bib-carimbo { display: inline-block; transform: rotate(-2deg); animation: bib-carimbo var(--tq-t-rotina) var(--tq-chegada) both; }

/* A versão reduzida de cada keyframe fica no fim da folha, para vencer as
   regras de cada componente. */
@media print {
  .bib-fav, .bib-acoes, .bib-busca, .bib-abas, .bib-indice, .bib-ver-cab, .bib-ver-todos { display: none !important; }
  .bib-cp { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .bib-arte { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* Recado sugerido na lista do ADM. Citação discreta, o balão Âmbar fica para o cliente. */
.bib-recado-sugerido { display: block; margin-top: 4px; padding: 4px 0 4px 12px; border-left: 4px solid var(--linha); font-size: var(--t-pequeno); color: var(--fumaca); max-width: 62ch; }
table.lista.bib-tabela td[data-rotulo="Situação"] .fraco, table.lista.bib-tabela td[data-rotulo="Tipo e etapa"] { white-space: nowrap; }
@media (max-width: 560px) {
  .bib-janela .hoje-acoes { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
  .bib-janela .hoje-acoes form, .bib-janela .hoje-acoes .btn { width: 100%; }
}

/* Endereço longo na mensagem pronta quebra dentro da caixa, no celular. */
.mensagem-texto { overflow-wrap: anywhere; }

/* Nota no pé do material, para o material geral não brigar com o combinado. */
.bib-vale-plano { margin: 28px 0 0; padding: 12px 16px; font-size: var(--t-pequeno); color: var(--fumaca); border: 2px dashed var(--linha); border-radius: var(--raio-p); }


/* ======================================================================
   Estante, passos 3 e 4 da Biblioteca visual (decisões 12 a 16 de 16/10/2026).
   Um eixo só, na largura da grade. Cartão só no que é objeto.
   ====================================================================== */

/* ------------------------------------------------------- capa por receita */

/* A capa é desenho, como uma thumbnail. Igual nos dois temas, medida pela
   largura do próprio quadro, então serve no cartão, na linha do celular e
   na miniatura do ADM. */
.bib-cp {
  container-type: inline-size;
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #e4e3d1;
  color: #161616;
  font-family: var(--display);
  line-height: 1.1;
}
.cp-in {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4cqw;
  padding: 6cqw;
  background-image:
    linear-gradient(rgba(0, 0, 0, .07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 0, 0, .07) 1px, transparent 1px);
  background-size: 6cqw 6cqw;
}
.cp-in.cp-col { flex-direction: column; gap: 2cqw; }
.cp-in.cp-junto { gap: 1cqw; }
.cp-in i, .cp-in b { font-style: normal; }

.cp-cartao { min-width: 21cqw; padding: 0 2cqw; height: 30cqw; background: #fff; border: .9cqw solid #000; border-radius: 2.6cqw; box-shadow: 1.6cqw 1.6cqw 0 #000; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1.4cqw; }
.cp-cartao b { font-size: 15cqw; font-weight: 800; line-height: 1; }
.cp-cartao span { font-size: 3.6cqw; font-weight: 800; line-height: 1; }
.cp-cartao.on { background: #fe5b18; }
.cp-cartao.cp-g2 b { font-size: 12cqw; }
.cp-cartao.cp-g3 b { font-size: 8.6cqw; letter-spacing: -.02em; }

.cp-num { font-size: 31cqw; font-weight: 800; line-height: .9; letter-spacing: -.04em; color: #fe5b18; -webkit-text-stroke: .9cqw #000; paint-order: stroke fill; text-shadow: 2cqw 2cqw 0 #000; white-space: nowrap; }
.cp-num.cp-n-3 { font-size: 27cqw; }
.cp-num.cp-n-4 { font-size: 22cqw; }
.cp-etq { background: #fff; border: .7cqw solid #000; border-radius: 999px; padding: 1cqw 3cqw; font-size: 4.4cqw; font-weight: 800; box-shadow: 1cqw 1cqw 0 #000; white-space: nowrap; }

.cp-caixa { background: #fff; border: .8cqw solid #000; border-radius: 2.2cqw; box-shadow: 1.4cqw 1.4cqw 0 #000; padding: 3cqw 2.4cqw; font-size: 4.2cqw; font-weight: 800; line-height: 1.05; text-align: center; min-width: 19cqw; white-space: nowrap; }
.cp-caixa.on { background: #fe5b18; }
.cp-apertado .cp-caixa { min-width: 14cqw; padding: 2.6cqw 1.8cqw; font-size: 3.5cqw; }
.cp-apertado .cp-seta { width: 3.6cqw; margin-right: 1.4cqw; }
.cp-seta { width: 5cqw; height: 1.2cqw; background: #000; position: relative; flex: none; margin-right: 1.6cqw; }
.cp-seta::after { content: ""; position: absolute; right: -2.2cqw; top: 50%; transform: translateY(-50%); border-left: 2.4cqw solid #000; border-top: 1.8cqw solid transparent; border-bottom: 1.8cqw solid transparent; }

.cp-escada { display: flex; align-items: flex-end; height: 38cqw; }
.cp-degrau { width: 15cqw; background: #fff; border: .8cqw solid #000; border-right: 0; display: flex; justify-content: center; padding-top: 1.6cqw; font-size: 2.9cqw; font-weight: 800; overflow: hidden; white-space: nowrap; letter-spacing: -.01em; }
.cp-degrau:last-child { border-right: .8cqw solid #000; background: #fe5b18; }
.cp-n3 .cp-degrau { width: 21cqw; font-size: 3.6cqw; }
.cp-n4 .cp-degrau { width: 17.5cqw; font-size: 3.4cqw; }
.cp-n6 .cp-degrau { width: 12.6cqw; font-size: 2.45cqw; }

.cp-janela { width: 66cqw; background: #fff; border: .8cqw solid #000; border-radius: 2.6cqw; box-shadow: 1.8cqw 1.8cqw 0 #000; overflow: hidden; display: block; }
.cp-barra { height: 7cqw; background: #fe5b18; border-bottom: .8cqw solid #000; display: flex; align-items: center; justify-content: space-between; gap: 1.2cqw; padding: 0 2cqw; font-size: 3.4cqw; font-weight: 800; }
.cp-ctrl { display: flex; gap: 1.2cqw; }
.cp-ctrl i { width: 2.6cqw; height: 2.6cqw; border: .5cqw solid #000; background: #fff; display: block; }
.cp-corpo { padding: 3cqw 3.4cqw 3.6cqw; display: flex; flex-direction: column; gap: 2.6cqw; }
.cp-pergunta { font-size: 5.2cqw; font-weight: 800; line-height: 1.1; }
.cp-bts { display: flex; gap: 2.4cqw; }
.cp-bt { border: .7cqw solid #000; border-radius: 1.8cqw; background: #e4e3d1; padding: 1cqw 3.4cqw; font-size: 3.8cqw; font-weight: 800; box-shadow: 1cqw 1cqw 0 #000; }
.cp-bt.on { background: #fe5b18; }

.cp-feed { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2.4cqw; width: 76cqw; }
.cp-f4 { width: 60cqw; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cp-f12 { width: 70cqw; gap: 1.8cqw; }
.cp-thumb { aspect-ratio: 16 / 9; border: .6cqw solid #000; border-radius: 1.4cqw; background: var(--azul-claro); }
.cp-thumb.c2 { background: #fff; }
.cp-thumb.on { background: #fe5b18; box-shadow: 1.2cqw 1.2cqw 0 #000; display: grid; place-items: center; font-size: 3cqw; font-weight: 800; }
.cp-f4 .cp-thumb.on { font-size: 4.4cqw; }

.cp-lista { display: flex; flex-direction: column; gap: 2.2cqw; width: 60cqw; }
.cp-linha { display: flex; align-items: center; gap: 2.4cqw; }
.cp-linha b { width: 7cqw; height: 7cqw; flex: none; border: .7cqw solid #000; border-radius: 1.4cqw; background: #fff; display: grid; place-items: center; font-size: 4cqw; font-weight: 800; }
.cp-linha i { flex: 1; height: 2.4cqw; border-radius: 1cqw; background: rgba(0, 0, 0, .22); display: block; }
.cp-linha.on b { background: #fe5b18; }

.cp-risco { display: flex; flex-direction: column; align-items: center; }
.cp-errado { font-size: 12cqw; font-weight: 800; line-height: 1; letter-spacing: -.03em; position: relative; white-space: nowrap; }
.cp-errado::after { content: ""; position: absolute; left: -4%; right: -4%; top: 58%; height: 1.4cqw; background: #fe5b18; border: .35cqw solid #000; transform: rotate(-5deg); }
.cp-longo .cp-errado { font-size: 9cqw; }
.cp-longo .cp-certo { font-size: 8.6cqw; }
/* A correção é Bricolage 800, porque a capa se repete na Estante e a letra à
   mão não entra em peça que se repete (item 7 do Modelo web v1.5.0). Mantém o
   tamanho que a Kalam tinha no ar, como pede o mesmo item, e fica acima da
   palavra riscada, sem encostar no risco. */
.cp-certo { font-family: var(--display); font-weight: 800; font-size: 11cqw; line-height: 1; letter-spacing: -.02em; transform: rotate(-4deg); margin-bottom: 3.4cqw; white-space: nowrap; }

/* Reserva, para material sem receita. O número da etapa vazado, o ícone e o tipo. */
.cp-a-num { position: absolute; left: -2cqw; bottom: -9cqw; font-size: 44cqw; font-weight: 800; line-height: 1; letter-spacing: -.06em; color: transparent; -webkit-text-stroke: .8cqw #000; }
.cp-a-icone { position: absolute; right: 7cqw; top: 9cqw; width: 22cqw; height: 22cqw; display: grid; place-items: center; color: #000; background: #fff; border: .9cqw solid #000; border-radius: 3cqw; box-shadow: 1.6cqw 1.6cqw 0 #000; }
.cp-a-icone svg { width: 60%; height: 60%; }
.cp-a-rot { position: absolute; right: 7cqw; bottom: 8cqw; font-size: 4.6cqw; font-weight: 800; background: #fff; border: .7cqw solid #000; border-radius: 999px; padding: 1cqw 3cqw; white-space: nowrap; }

/* Capa pequena, na linha do celular e nas miniaturas. Some o texto miúdo. */
@container (max-width: 220px) {
  .cp-cartao span, .cp-degrau, .cp-barra > span:first-child, .cp-etq, .cp-a-rot, .cp-thumb.on { font-size: 0; }
  .cp-etq, .cp-a-rot { display: none; }
  .cp-caixa, .cp-apertado .cp-caixa { font-size: 0; min-width: 12cqw; height: 10cqw; padding: 0; }
  .cp-bt { font-size: 0; width: 14cqw; height: 7cqw; padding: 0; }
  .cp-pergunta { font-size: 8cqw; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
}

/* ------------------------------------------------------------ cabeçalho */

.bib-cab { display: flex; flex-direction: column; gap: 6px; margin: 0 0 22px; }
.bib-cab h1 { margin: 0; font-size: clamp(34px, 5.4vw, 52px); letter-spacing: -0.03em; line-height: 1; }
.bib-cab .subtitulo { margin: 0; max-width: 36em; font-size: 17px; }

/* Abas em pasta, com a busca e os Filtros na mesma linha a partir de 1024 px. */
.bib-barra-lista { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 14px 24px; margin: 0 0 18px; }
.bib-abas { flex: 1 1 100%; display: flex; gap: 6px; border-bottom: var(--traco) solid var(--borda); }
.bib-abas a {
  margin-bottom: calc(-1 * var(--traco));
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  font-family: var(--display);
  font-size: 16px;
  font-weight: 600;
  color: var(--fumaca);
  text-decoration: none;
  white-space: nowrap;
  border: var(--traco) solid transparent;
  border-radius: 12px 12px 0 0;
}
.bib-abas a:hover { color: var(--tinta); }
.bib-abas a[aria-current="page"] { background: var(--fundo); color: var(--tinta); font-weight: 800; border-color: var(--borda); border-bottom-color: var(--fundo); }
.bib-abas a:focus-visible { outline-offset: -6px; }

.bib-bolinha {
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  display: inline-grid;
  place-items: center;
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
  color: var(--preto);
  background: var(--branco);
  border: 2px solid #000000;
  border-radius: 999px;
}
.bib-bolinha.chama { background: var(--laranja); }

.bib-busca { position: relative; flex: 1 1 100%; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; }
.bib-campo-busca { position: relative; min-width: 0; }
.bib-campo-busca input[type="search"] { padding-left: 46px; min-height: 48px; }
.bib-campo-busca svg { position: absolute; left: 14px; top: 50%; width: 20px; height: 20px; margin-top: -10px; color: var(--tinta); pointer-events: none; }
/* A lupa só gira quando o foco vem do mouse ou do toque. Quem chega pelo
   teclado não vê movimento. O hub.js marca a origem na raiz da página. */
:root[data-foco="ponteiro"] .bib-campo-busca:focus-within svg { animation: bib-lupa var(--tq-t-rotina) var(--tq-chegada); }
.bib-filtros > summary { list-style: none; min-height: 48px; }
.bib-filtros > summary::-webkit-details-marker { display: none; }
.bib-filtros > summary svg { width: 18px; height: 18px; }
.bib-filtros[open] > summary { background: var(--inverso); color: var(--inverso-tinta); }
.bib-painel {
  position: absolute;
  z-index: 16;
  left: 0;
  right: 0;
  top: calc(100% + 10px);
  display: grid;
  gap: 16px;
  padding: 18px;
  background: var(--superficie);
  border: var(--traco) solid var(--borda);
  border-radius: var(--raio);
  box-shadow: var(--sombra-m);
  transform-origin: top right;
  animation: bib-desce 220ms var(--tq-chegada);
}
.bib-painel fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
.bib-painel fieldset + fieldset { padding-top: 14px; border-top: 2px solid var(--linha); }
.bib-painel legend { padding: 0; margin-bottom: 6px; font-weight: 800; font-size: var(--t-destaque); }
.bib-opcoes { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0 12px; }
.bib-opcoes .marcar { font-size: var(--t-corpo); font-weight: 500; }
.bib-opcoes .marcar input { width: 22px; height: 22px; }
.bib-painel-acoes { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; }

@media (min-width: 1024px) {
  .bib-barra-lista { flex-wrap: nowrap; border-bottom: var(--traco) solid var(--borda); }
  .bib-abas { flex: none; border-bottom: 0; }
  .bib-busca { flex: 0 1 520px; margin-left: auto; padding-bottom: 12px; }
}
@media (max-width: 600px) {
  .bib-abas a { flex: 1 1 0; padding: 10px 6px; font-size: 15px; }
  .bib-filtros-rot { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .bib-filtros > summary { padding-left: 12px; padding-right: 12px; }
}
/* Abaixo de 320 px de largura útil, que só acontece com texto aumentado ou
   zoom, as três abas cabem quebrando o rótulo em duas linhas. */
@media (max-width: 319px) {
  .bib-abas { gap: 2px; }
  .bib-abas a { min-width: 0; padding: 8px 4px; font-size: 14px; line-height: 1.15; white-space: normal; text-align: center; gap: 4px; }
}

/* Filtros ativos, que saem com um toque. */
.bib-ativos { margin: 0 0 4px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.bib-ativos:empty { display: none; }
.bib-chip {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 6px 14px;
  font-weight: 700;
  font-size: var(--t-pequeno);
  color: var(--inverso-tinta);
  background: var(--inverso);
  border: 2px solid var(--borda);
  border-radius: 999px;
  text-decoration: none;
}
.bib-chip:hover { color: var(--inverso-tinta); text-decoration: line-through; text-decoration-color: var(--laranja); }
.bib-chip svg { width: 14px; height: 14px; flex: none; }
.bib-chip .fraco { color: inherit; opacity: .75; font-weight: 600; }
.bib-achados { font-size: var(--t-pequeno); color: var(--fumaca); }
.bib-limpar { display: inline-flex; align-items: center; min-height: 44px; font-weight: 700; font-size: var(--t-pequeno); }

/* Índice de etapas. Uma linha, sem contagem e sem caixa. No celular rola de lado. */
.bib-indice {
  display: flex;
  gap: 0 22px;
  margin: -4px 0 22px;
  overflow-x: auto;
  scrollbar-width: none;
}
.bib-indice::-webkit-scrollbar { display: none; }
.bib-indice a {
  flex: none;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-family: var(--display);
  font-size: 15px;
  font-weight: 600;
  color: var(--fumaca);
  text-decoration: none;
  white-space: nowrap;
  border-bottom: 3px solid transparent;
}
.bib-indice a:hover { color: var(--tinta); border-bottom-color: var(--laranja); }
/* O esmaecimento da direita só aparece enquanto há mais para rolar. O bib.js
   marca data-rola="mais". Sem JavaScript, a lista rola sem máscara. */
.bib-indice[data-rola="mais"] { -webkit-mask-image: linear-gradient(to right, #000 85%, transparent); mask-image: linear-gradient(to right, #000 85%, transparent); }

/* ------------------------------------------------------- cartões */

/* Rótulo do tipo com ícone, sem caixa. Estrela sem caixa. */
.bib-tipo { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 700; line-height: 1.2; color: var(--fumaca); }
.bib-tipo svg { width: 16px; height: 16px; flex: none; }
.bib-tipo-forte { color: var(--tinta); font-weight: 800; }
.bib-cartao-topo { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; min-height: 32px; }
.bib-fav { position: relative; z-index: 2; margin: -6px -12px -6px auto; }
.bib-estrela {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  padding: 0;
  color: var(--tinta);
  background: transparent;
  border: 0;
  border-radius: var(--raio-p);
  cursor: pointer;
}
.bib-estrela:hover .bib-ico-estrela { stroke-width: 2.6; }
.bib-ico-estrela { width: 22px; height: 22px; fill: none; stroke: var(--tinta); stroke-width: 2; stroke-linejoin: miter; }
[aria-pressed="true"] > .bib-ico-estrela { fill: var(--laranja); stroke: var(--tinta); }

.bib-novo {
  display: inline-block;
  padding: 0 8px;
  font-size: var(--t-rotulo);
  font-weight: 700;
  line-height: 1.6;
  color: var(--inverso-tinta);
  background: var(--inverso);
  border: 2px solid var(--borda);
  border-radius: 6px;
  transform: rotate(-3deg);
}

.bib-grade { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 24px; }
.bib-cartao {
  position: relative;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--superficie);
  border: var(--traco) solid var(--borda);
  border-radius: var(--raio);
  box-shadow: var(--sombra-p);
  overflow: hidden;
}
.bib-cartao-capa { border-bottom: var(--traco) solid var(--borda); }
.bib-cartao-corpo { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 6px; padding: 12px 16px 18px; }
.bib-titulo { margin: 0; font-size: 19px; font-weight: 700; line-height: 1.25; letter-spacing: -0.01em; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.bib-titulo a, .bib-largo-titulo a { color: var(--tinta); text-decoration: none; }
.bib-titulo a::after, .bib-largo-titulo a::after { content: ""; position: absolute; inset: 0; z-index: 1; border-radius: var(--raio); }
.bib-assin { margin: 0; font-size: 14px; color: var(--fumaca); }
.bib-resumo { margin: 2px 0 0; font-size: 15px; line-height: 1.5; color: var(--fumaca); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.bib-rodape { margin: auto 0 0; padding-top: 4px; font-size: var(--t-rotulo); color: var(--fumaca); }
@media (hover: hover) {
  .bib-cartao:hover .bib-titulo a, .bib-largo:hover .bib-largo-titulo a, .bib-passo:hover b { text-decoration: underline; text-decoration-color: var(--laranja); text-decoration-thickness: 2px; text-underline-offset: 3px; }
}
.bib-cartao:active, .bib-passo:active { transform: translate(3px, 3px); box-shadow: 0 0 0 0 var(--sombra); }
@supports selector(:has(a)) {
  .bib-titulo a:focus-visible, .bib-largo-titulo a:focus-visible { outline: none; }
  .bib-cartao:has(.bib-titulo a:focus-visible), .bib-largo:has(.bib-largo-titulo a:focus-visible) { outline: 3px solid var(--tinta); outline-offset: 3px; }
  :root[data-tema="escuro"] .bib-cartao:has(.bib-titulo a:focus-visible), :root[data-tema="escuro"] .bib-largo:has(.bib-largo-titulo a:focus-visible) { outline-color: var(--laranja); }
}

/* Cartão largo. Capa ao lado do texto. */
.bib-largos { display: grid; gap: 24px; }
.bib-largo {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  background: var(--superficie);
  border: var(--traco) solid var(--borda);
  border-radius: var(--raio);
  box-shadow: var(--sombra-p);
  overflow: hidden;
}
.bib-largo-destaque { box-shadow: var(--sombra-g); }
.bib-largo-capa { flex: 1 1 340px; max-width: 460px; border-right: var(--traco) solid var(--borda); }
.bib-largo-corpo { flex: 999 1 340px; min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: 12px; padding: 24px clamp(18px, 3vw, 30px); }
.bib-largo-titulo { margin: 0; font-size: clamp(22px, 2.6vw, 30px); font-weight: 800; line-height: 1.1; letter-spacing: -0.02em; overflow-wrap: anywhere; }
.bib-largo .bib-resumo { margin: 0; font-size: 16px; max-width: 36em; -webkit-line-clamp: 4; }
.bib-largo .bib-recado { position: relative; z-index: 2; align-self: flex-start; max-width: 36em; padding: 10px 14px; font-size: 15px; border-width: var(--traco); box-shadow: 4px 4px 0 0 var(--sombra); }
.bib-largo-pe { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-top: 4px; }
.bib-largo-pe:empty { display: none; }
.btn.bib-abrir { --placa-d: 4px; position: relative; z-index: 2; background: var(--laranja); color: var(--preto); border-color: #000000; font-weight: 800; }
.btn.bib-abrir:hover { background: var(--laranja); color: var(--preto); }
.btn.bib-abrir:focus-visible { outline-color: var(--foco-fora); }
.bib-assin-leve { font-size: 14px; color: var(--fumaca); }
.bib-topo-para-voce { margin: 0 0 12px; }
.bib-mais-recs { margin: 14px 0 0; font-weight: 700; font-size: var(--t-pequeno); }
@media (max-width: 720px) {
  .bib-largo-capa { flex-basis: 100%; max-width: none; border-right: 0; border-bottom: var(--traco) solid var(--borda); }
  .bib-largo-corpo { padding: 14px 16px 18px; gap: 10px; }
  .btn.bib-abrir { width: 100%; justify-content: center; }
}

/* Comece por aqui. Ordem de uso, sem contador de progresso. */
.bib-comece { margin: 0 0 12px; }
.bib-comece-cab { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; margin: 0 0 14px; }
.bib-comece-cab h2 { margin: 0; font-size: 30px; letter-spacing: -0.02em; }
.bib-comece-cab p { margin: 0; color: var(--fumaca); font-size: var(--t-pequeno); }
.bib-comece-lista { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 255px), 1fr)); gap: 14px 18px; }
.bib-comece-lista > li { display: flex; }
.bib-passo {
  flex: 1;
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-height: 86px;
  padding: 0 12px 0 0;
  color: var(--tinta);
  text-decoration: none;
  background: var(--superficie);
  border: var(--traco) solid var(--borda);
  border-radius: var(--raio-p);
  box-shadow: var(--sombra-p);
  overflow: hidden;
}
.bib-passo:hover { color: var(--tinta); }
.bib-passo-capa { position: relative; align-self: stretch; display: flex; align-items: center; background: #e4e3d1; border-right: var(--traco) solid var(--borda); }
.bib-passo-capa .bib-cp { width: 100%; }
.bib-passo-n {
  position: absolute;
  z-index: 1;
  left: 5px;
  top: 5px;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  font-size: 14px;
  font-weight: 800;
  color: #ffffff;
  background: #161616;
  border: 2px solid #000000;
  border-radius: 50%;
}
.bib-passo-txt { display: flex; flex-direction: column; gap: 2px; padding: 10px 0; min-width: 0; }
.bib-passo-txt b { font-size: 15px; line-height: 1.25; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.bib-passo-txt .bib-tipo { font-size: 13px; }

/* -------------------------------------------------- grupos por etapa */

.bib-grupo { margin-top: 44px; scroll-margin-top: calc(90px - var(--barra-h, 64px) - 16px); }
.bib-grupo-cab {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px 16px;
  margin: 0 0 22px;
  border-bottom: var(--traco) solid var(--borda);
  overflow: hidden;
}
.bib-grupo-nome { display: flex; align-items: flex-end; gap: 16px; min-width: 0; }
.bib-grupo-num {
  flex: none;
  margin-bottom: -16px;
  font-family: var(--display);
  font-size: 116px;
  font-weight: 800;
  line-height: .74;
  letter-spacing: -0.05em;
  color: transparent;
  -webkit-text-stroke: 2px var(--tinta);
}
.bib-grupo-nome > div { display: flex; flex-direction: column; gap: 2px; padding-bottom: 10px; min-width: 0; }
.bib-grupo-cab h2 { margin: 0; font-size: 30px; letter-spacing: -0.02em; line-height: 1.05; }
.bib-grupo-conta { font-size: 15px; color: var(--fumaca); }
.bib-ver-cab { display: inline-flex; align-items: center; min-height: 44px; padding-bottom: 6px; font-size: 15px; font-weight: 700; text-decoration-thickness: 2px; text-underline-offset: 4px; }
.bib-tambem { margin: 40px 0 16px; padding-bottom: 8px; border-bottom: 2px solid var(--linha); }
.bib-tambem h2 { margin: 0; font-size: var(--t-h3); }
.bib-tambem p { margin: 4px 0 0; }
.bib-resultado { margin-top: 8px; }

/* Quantos aparecem por etapa antes do Ver os N. Seis no computador, quatro abaixo. */
.bib-ver-todos { display: none; margin: 16px 0 0; }
.bib-grade.bib-corta > .bib-cartao:nth-child(n+7) { display: none; }
@media (max-width: 1023px) {
  .bib-grade.bib-corta > .bib-cartao:nth-child(n+5) { display: none; }
  .bib-ver-cab.so-tablet { display: inline-flex; }
}
@media (min-width: 1024px) { .bib-ver-cab.so-tablet { display: none; } }

/* Celular. O cartão vira linha, com a capa pequena à esquerda e o título ao lado. */
@media (max-width: 600px) {
  .bib-grupo { margin-top: 36px; }
  .bib-grupo-num { font-size: 84px; margin-bottom: -12px; -webkit-text-stroke-width: 1.5px; }
  .bib-grupo-cab { margin-bottom: 14px; }
  .bib-grupo-cab h2 { font-size: 24px; }
  .bib-ver-cab { display: none !important; }
  .bib-ver-todos { display: block; }
  .bib-ver-todos .btn { width: 100%; justify-content: center; }
  .bib-grupo { scroll-margin-top: calc(110px - var(--barra-h, 64px) - 16px); }
  .bib-grade { gap: 16px; }
  /* Lista simples. A capa é o objeto, com borda e sombra, e o texto fica ao lado sem caixa. */
  .bib-cartao { flex-direction: row; align-items: center; gap: 14px; padding: 0; background: transparent; border: 0; border-radius: 0; box-shadow: none; overflow: visible; }
  .bib-cartao-capa { flex: none; width: 128px; border: var(--traco) solid var(--borda); border-radius: var(--raio-p); box-shadow: var(--sombra-p); }
  .bib-cartao-corpo { padding: 0; gap: 2px; justify-content: center; }
  .bib-cartao:active { transform: none; }
  .bib-cartao:active .bib-cartao-capa { transform: translate(3px, 3px); box-shadow: none; }
  .bib-cartao .bib-assin, .bib-cartao .bib-resumo { display: none; }
  .bib-cartao .bib-titulo { font-size: 16px; -webkit-line-clamp: 3; }
  .bib-cartao-topo { min-height: 0; }
  .bib-cartao .bib-tipo { font-size: 13px; }
  .bib-cartao .bib-fav { margin: -10px -10px -10px auto; }
  .bib-passo { grid-template-columns: 112px minmax(0, 1fr); }
}

/* Miniatura da capa nos relacionados da página do material e no ADM. */
.bib-rel-capa, .bib-mini { flex: none; display: block; width: 96px; border: 2px solid var(--borda); border-radius: 6px; overflow: hidden; }

.bib-largos-grupo .bib-largo-capa { max-width: 380px; }
.bib-arquivo { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.bib-arquivo input:focus-visible + label { outline: 3px solid var(--tinta); outline-offset: 3px; }
@media (max-width: 600px) { .bib-comece-cab h2 { font-size: 24px; } }

/* ------------------------------------------------- movimento reduzido */
@media (prefers-reduced-motion: reduce) {
  .bib-pop { animation: bib-esmaece-meio 150ms var(--tq-chegada); }
  .bib-sobe { animation: bib-esmaece 150ms var(--tq-chegada); }
  .bib-carimbo { animation: bib-esmaece 150ms var(--tq-chegada) both; }
  .bib-painel { animation: bib-esmaece 150ms var(--tq-chegada); }
  :root[data-foco="ponteiro"] .bib-campo-busca:focus-within svg { animation: none; }
  [data-copiado] .bib-ico-certo { animation: none; }
}

/* ===================================================== página em blocos, passo 5
   Regime de leitura do Modelo web v1.5.0. Um eixo só: tudo começa na mesma
   borda, com o cabeçalho e os cartões na largura da grade e a leitura numa
   coluna de cerca de 70 caracteres (34em a 18 px). O palco é o Como aplicar,
   a única janela de barra laranja. O texto mora em folhas, e os blocos (aviso,
   frase para levar e figura) ficam entre elas, para não haver caixa dentro de
   caixa nem texto solto no fundo. */

.bmat-voltar { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font-weight: 700; color: var(--tinta); text-decoration: underline; text-decoration-color: var(--laranja); text-decoration-thickness: 2px; text-underline-offset: 4px; }
.bmat-voltar svg { flex: none; }

.bmat-cab { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; align-items: center; margin: 8px 0 0; }
/* No celular, título e linha de mão primeiro e a capa menor depois, para o
   Para que serve subir (revisão cega de 18/10). */
.bmat-capa { width: 100%; max-width: 320px; }
.bmat-capa .bib-cp, .bmat-fig .bib-cp { border: var(--traco) solid var(--borda); border-radius: var(--raio); box-shadow: var(--sombra-p); }
.bmat-cab .bib-meta { margin: 0 0 12px; }
.bmat-titulo { margin: 0; max-width: 18em; }
.bmat-mao { position: relative; display: inline-block; margin: 14px 0 0; padding-bottom: 6px; font-family: var(--mao); font-weight: 700; font-size: clamp(17px, 4.8vw, 22px); line-height: 1.2; color: var(--tinta); white-space: nowrap; }
.bmat-assin { margin: 12px 0 0; font-size: 15px; color: var(--fumaca); }
.bmat-acoes { margin: 20px 0 0; }
@media (min-width: 1024px) {
  .bmat-cab { grid-template-columns: minmax(0, 1fr) minmax(320px, 400px); gap: 48px; }
  .bmat-capa { max-width: none; }
}
/* No celular e no tablet, a capa menor fica no centro da coluna. No celular, os
   botões da página ocupam a largura toda. O texto segue alinhado à esquerda,
   pela seção 4.5 do guia visual (Paulo, 18/10/2026). */
@media (max-width: 1023px) {
  .bmat-capa { margin-inline: auto; }
}
@media (max-width: 559px) {
  .bmat-acoes { display: grid; grid-template-columns: minmax(0, 1fr); }
  .bmat-acoes form, .bmat-acoes .btn, .bmat-copiar .bib-copiar-cab .btn, .bmat-dobra-pe .btn { width: 100%; justify-content: center; }
  .bmat-copiar .bib-copiar-cab { padding-right: 16px; }
}

.bmat-h2 { margin: 0; font-family: var(--display); font-size: clamp(26px, 1rem + 1.4vw, 30px); font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; }
.bmat-serve { margin: 48px 0 0; }
.bmat-resumo { margin: 12px 0 22px; max-width: 34em; font-size: 20px; line-height: 1.5; }
.bmat-cartoes { list-style: none; margin: 0; padding: 0; counter-reset: bmat; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 18px; }
.bmat-cartoes li { counter-increment: bmat; display: flex; flex-direction: column; gap: 8px; padding: 16px 18px 20px; background: var(--superficie); border: var(--traco) solid var(--borda); border-radius: var(--raio); box-shadow: var(--sombra-p); }
.bmat-cartoes li::before { content: counter(bmat); display: grid; place-items: center; width: 44px; height: 44px; margin-bottom: 4px; font-family: var(--display); font-size: 24px; font-weight: 800; line-height: 1; color: var(--preto); background: #ffffff; border: var(--traco) solid #000000; border-radius: var(--raio-p); }
.bmat-cartoes b { font-family: var(--display); font-size: 19px; font-weight: 800; line-height: 1.2; }
.bmat-cartoes span { font-size: 16px; line-height: 1.45; }
@media (max-width: 560px) {
  .bmat-cartoes li { display: grid; grid-template-columns: 40px minmax(0, 1fr); column-gap: 14px; row-gap: 4px; align-items: start; }
  .bmat-cartoes li::before { grid-row: span 2; width: 40px; height: 40px; margin: 0; font-size: 21px; }
}

.bmat-aplicar { max-width: 760px; margin: 48px 0 0; }
.bmat-passos { list-style: none; counter-reset: bmat-p; margin: 0; padding: 6px clamp(18px, 3.4vw, 28px) 10px; }
.bmat-passos li { counter-increment: bmat-p; display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 14px; align-items: start; padding: 16px 0; font-size: 17px; line-height: 1.55; }
.bmat-passos li + li { border-top: 2px solid var(--linha); }
.bmat-passos li::before { content: counter(bmat-p); display: grid; place-items: center; width: 34px; height: 34px; font-family: var(--display); font-weight: 800; font-size: 17px; color: var(--tinta); border: var(--traco) solid var(--borda); border-radius: 50%; }

.bmat-copiar { max-width: 760px; margin: 48px 0 0; }
.bmat-copiar > summary { display: flex; align-items: center; gap: 10px; min-height: 44px; cursor: pointer; list-style: none; }
.bmat-copiar > summary::-webkit-details-marker { display: none; }
.bmat-copiar > summary::after { content: ""; width: 12px; height: 12px; border-right: 3px solid currentColor; border-bottom: 3px solid currentColor; transform: rotate(45deg) translateY(-3px); }
.bmat-copiar[open] > summary::after { transform: rotate(-135deg) translateY(-3px); }
.bmat-copiar .bib-copiar { margin-top: 14px; }

.bmat-texto { display: grid; gap: 26px; max-width: 760px; margin: 56px 0 0; }
.bmat-folha { padding: clamp(20px, 4vw, 34px); background: var(--superficie); border: var(--traco) solid var(--borda); border-radius: var(--raio); box-shadow: var(--sombra-p); }
.bmat-sec + .bmat-sec { margin-top: 28px; padding-top: 28px; border-top: 2px solid var(--linha); }
.bmat-sec h2 { scroll-margin-top: 40px; margin: 0 0 12px; font-size: clamp(25px, 1rem + 0.9vw, 28px); font-weight: 800; letter-spacing: -0.02em; line-height: 1.15; max-width: 22em; }
.bmat-sec p { margin: 0; max-width: 34em; font-size: 18px; line-height: 1.62; white-space: pre-line; }
.bmat-sec p + p { margin-top: 14px; }

.bmat-aviso { margin: 0; max-width: 40em; padding: 16px 20px 18px; color: #000000; background: var(--ambar); border: var(--traco) solid #000000; border-radius: var(--raio-p); border-top-left-radius: 0; box-shadow: var(--sombra-m); }
.bmat-aviso p { margin: 0; font-size: 17px; line-height: 1.5; white-space: pre-line; }
.bmat-aviso .bmat-aviso-t { margin-bottom: 6px; font-family: var(--display); font-size: 18px; font-weight: 800; }

.bmat-levar { position: relative; margin: 6px 0; max-width: 34em; padding: 22px 40px 22px 26px; font-family: var(--display); font-size: clamp(19px, 1rem + 0.7vw, 23px); font-weight: 800; line-height: 1.3; color: #000000; background: var(--laranja); border: var(--traco) solid #000000; border-radius: var(--raio); border-top-right-radius: 0; box-shadow: var(--sombra-g); }
.bmat-levar::before { content: ""; position: absolute; top: calc(-1 * var(--traco)); right: calc(-1 * var(--traco)); border-left: 26px solid #000000; border-bottom: 26px solid transparent; }

.bmat-fig { display: grid; gap: 10px; max-width: 520px; margin: 4px 0; }
.bmat-fig figcaption { font-size: 15px; line-height: 1.45; color: var(--fumaca); max-width: 30em; }

/* Sumário da lateral, só a partir de 1080 px, onde a coluna de leitura deixa
   sobra à direita. Painel Casca, parado no topo enquanto a página rola. */
.bmat-sumario { display: none; }
@media (min-width: 1080px) {
  .bmat-corpo { display: grid; grid-template-columns: minmax(0, 760px) minmax(220px, 280px); justify-content: space-between; column-gap: 40px; align-items: start; }
  .bmat-sumario { display: block; position: sticky; top: calc(var(--barra-h, 64px) + 24px); margin-top: 48px; max-height: calc(100vh - var(--barra-h, 64px) - 48px); overflow: auto; padding: 16px 20px 18px; background: var(--casca); color: var(--casca-tinta); border-radius: var(--raio); }
}
.bmat-sumario-t { margin: 0 0 6px; font-family: var(--display); font-size: 16px; font-weight: 800; }
.bmat-sumario ol { list-style: none; margin: 0; padding: 0; }
.bmat-sumario a { display: block; padding: 7px 0; font-size: 15px; line-height: 1.35; color: inherit; text-decoration: none; }
.bmat-sumario li + li a { border-top: 1px solid color-mix(in srgb, currentColor 18%, transparent); }
.bmat-sumario a:hover { text-decoration: underline; text-decoration-color: var(--laranja); text-decoration-thickness: 2px; text-underline-offset: 3px; }

.bmat-pe { max-width: 760px; margin: 64px 0 0; }
.bmat-origem { padding: 18px 22px 20px; background: var(--casca); color: var(--casca-tinta); border-radius: var(--raio); }
.bmat-origem h2 { margin: 0 0 8px; font-size: var(--t-h3); font-weight: 800; }
.bmat-origem p { margin: 0; max-width: 34em; font-size: 16px; line-height: 1.55; }
.bmat-origem .bmat-origem-linha { margin-top: 10px; font-size: 14px; font-weight: 700; }
.bmat-origem .bmat-origem-linha:empty { display: none; }
.bmat-pe .bib-combina { margin-top: 36px; }

/* Lista dentro da seção, acabamento de 18/10/2026. Apoio, sem caixa e sem sombra.
   A de marcador põe o termo curto em negrito. A numerada guarda o número do original. */
.bmat-lista { list-style: none; margin: 14px 0 0; padding: 0; max-width: 34em; font-size: 18px; }
.bmat-sec h2 + .bmat-lista { margin-top: 0; }
.bmat-lista + p { margin-top: 14px; }
.bmat-lista + .bmat-lista { margin-top: 0; }
.bmat-lista + .bmat-lista > li:first-child { border-top: 2px solid var(--linha); }
.bmat-lista li { position: relative; padding: 9px 0 9px 24px; font-size: 18px; line-height: 1.55; }
.bmat-lista li + li { border-top: 2px solid var(--linha); }
.bmat-lista li::before { content: ""; position: absolute; left: 1px; top: 18px; width: 10px; height: 10px; background: var(--laranja); border: 2px solid var(--borda); border-radius: 2px; }
.bmat-lista b { font-weight: 800; }
.bmat-lista-num li { display: grid; grid-template-columns: 34px minmax(0, 1fr); column-gap: 12px; align-items: start; padding-left: 0; }
.bmat-lista-num li::before { content: none; }
.bmat-n { display: grid; place-items: center; width: 34px; height: 34px; margin-top: -3px; font-family: var(--display); font-size: 15px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; border: var(--traco) solid var(--borda); border-radius: 50%; }

/* Para copiar. Largura de leitura e corpo de 17 px. O modelo longo fica dobrado pelo
   bib.js, com o botão Ver o modelo inteiro, e sem JavaScript aparece inteiro. */
.bmat-copiar .bib-copiar-texto { max-width: calc(36em + 40px); font-size: 17px; }
.bmat-copiar .bib-copiar-texto:focus-visible { outline-offset: -4px; }
.bmat-copiar .bib-copiar-texto b { font-weight: 800; }
.bib-copiar.dobrado .bib-copiar-texto { max-height: 26em; overflow: hidden; -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 5em), transparent); mask-image: linear-gradient(to bottom, #000 calc(100% - 5em), transparent); }
.bmat-dobra-pe { padding: 4px 16px 16px; }
.bmat-dobra-pe[hidden] { display: none !important; }

/* A janela desenhada na capa e nas figuras da página fica no degrau calmo, com a
   barra Ciano e o botão sem sombra. A janela laranja da página é o Como aplicar. */
.bmat-capa .cp-barra, .bmat-fig .cp-barra { background: #17939b; }
.bmat-capa .cp-bt, .bmat-fig .cp-bt { box-shadow: none; }

/* Colunas do Para que serve pela quantidade de cartões, sem cartão sozinho na linha.
   Quatro ficam dois por dois na largura média. Três e cinco ficam numa coluna até
   700 px, e depois três numa linha, ou três em cima e dois embaixo. */
@media (min-width: 470px) and (max-width: 1023px) {
  .bmat-cartoes:has(> li:nth-child(4):last-child) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 699px) {
  .bmat-cartoes:has(> li:nth-child(3):last-child), .bmat-cartoes:has(> li:nth-child(5):last-child) { grid-template-columns: minmax(0, 1fr); }
}
@media (min-width: 700px) {
  .bmat-cartoes:has(> li:nth-child(3):last-child) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .bmat-cartoes:has(> li:nth-child(5):last-child) { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .bmat-cartoes:has(> li:nth-child(5):last-child) > li { grid-column: span 2; }
  .bmat-cartoes:has(> li:nth-child(5):last-child) > li:nth-child(n+4) { grid-column: span 3; }
}

@media print {
  .bmat-voltar, .bmat-acoes, .bmat-sumario, .bmat-dobra-pe { display: none !important; }
  .bib-copiar.dobrado .bib-copiar-texto { max-height: none; overflow: visible; -webkit-mask-image: none; mask-image: none; }
  .bmat-sec h2, .bmat-h2 { break-after: avoid; }
  .bmat-lista li { break-inside: avoid; }
  .bmat-folha, .bmat-cartoes li, .bmat-capa .bib-cp, .bmat-fig .bib-cp, .bmat-aviso, .bmat-levar { box-shadow: none; }
  .bmat-copiar:not([open]) > .bib-copiar { display: block; }
  .bmat-texto, .bmat-pe, .bmat-aplicar { max-width: none; }
}
