/* ============================================================================
   Fornecedores & Normas — MS Group
   Componentes próprios desta aplicação, por cima do sistema de design comum
   (app.css, partilhado com as Devoluções e as Finanças). Mesma regra: a
   interface é neutra; só tem cor o que comunica estado.
   ============================================================================ */

/* O atributo hidden ganha sempre (alguns componentes têm display próprio). */
[hidden] { display: none !important; }

/* ---------------------------------------------------------------- Idioma (EN | PT) */
.seletor-idioma { display: inline-flex; gap: 2px; }
.botao-idioma {
  border: 1px solid transparent; background: transparent; color: var(--barra-texto-suave);
  font: inherit; font-size: .68rem; font-weight: 700; letter-spacing: .04em; padding: .15rem .32rem; border-radius: 5px; cursor: pointer;
}
.botao-idioma:hover { color: var(--barra-texto-forte); background: var(--barra-hover); }
.botao-idioma.ativo { color: var(--barra-texto-forte); border-color: var(--barra-borda); background: var(--barra-hover); }
.seletor-idioma-login { display: flex; justify-content: center; gap: .9rem; }
.seletor-idioma-login a { color: var(--texto-ténue); }
.seletor-idioma-login a.ativo { color: var(--texto); font-weight: 650; }

/* ---------------------------------------------------------------- Tema: ícone do botão */
.so-escuro { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-tema="claro"]) .so-escuro { display: inline; }
  :root:not([data-tema="claro"]) .so-claro { display: none; }
}
:root[data-tema="escuro"] .so-escuro { display: inline; }
:root[data-tema="escuro"] .so-claro { display: none; }
.icone-rodape {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: var(--raio-sm);
  border: 0; background: transparent; color: var(--barra-texto-suave); cursor: pointer;
}
.icone-rodape:hover { background: var(--barra-hover); color: var(--barra-texto-forte); }

/* ---------------------------------------------------------------- Topo: migalhas */
.titulo-topo { min-width: 0; }
.migalhas { font-size: .74rem; color: var(--texto-ténue); display: flex; flex-wrap: wrap; gap: .3rem; margin-bottom: .1rem; }
.migalhas a { color: var(--texto-suave); }
.migalhas a:hover { color: var(--texto); }
.migalhas span { opacity: .6; }

.introducao { color: var(--texto-suave); max-width: 70ch; margin: 0 0 1rem; }
.estreito { max-width: 820px; }
.grelha-2.lado-maior { grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); }
.fundo-suave { background: var(--superficie-2); border-bottom: 1px solid var(--borda); }
.pequeno-titulo { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--texto-suave); margin: 0 0 .45rem; font-weight: 700; }
.texto-erro { color: var(--erro); }
.numero-erro { font-size: 2.6rem; font-weight: 700; color: var(--texto-ténue); line-height: 1; }
.detalhe-erro { text-align: left; overflow: auto; max-height: 320px; background: var(--superficie-2); padding: .7rem; border-radius: var(--raio-sm); font-size: .75rem; }
fieldset.sem-moldura { border: 0; padding: 0; margin: 0; min-width: 0; }
.caixa-opcao { display: inline-flex; align-items: center; gap: .4rem; cursor: pointer; font-size: .86rem; }
.caixa-opcao.pequeno { font-size: .78rem; }
.mt-pequena { margin-top: .4rem; }
.campos > .campo-largo { grid-column: 1 / -1; }
.cartao.destaque { border-color: var(--marca-clara); box-shadow: var(--sombra-md); }
.alternar-vista a.btn { border-radius: 0; }
.alternar-vista a.btn.ativo-vista { background: var(--marca); color: var(--marca-sobre); }

/* ---------------------------------------------------------------- Pesquisa rápida (painel) */
.pesquisa-rapida {
  display: flex; align-items: center; gap: .6rem;
  background: var(--superficie); border: 1px solid var(--borda-forte); border-radius: var(--raio);
  padding: .45rem .5rem .45rem .85rem; margin-bottom: 1.1rem; box-shadow: var(--sombra);
}
.pesquisa-rapida .icone { color: var(--texto-ténue); flex: 0 0 auto; }
.pesquisa-rapida input { border: 0 !important; box-shadow: none !important; background: transparent !important; flex: 1; padding-left: 0; font-size: .95rem; }

/* ---------------------------------------------------------------- Catálogo em mosaico */
.mosaico {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(178px, 1fr));
  gap: .85rem; margin-bottom: 1.2rem;
}
.ladrilho {
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  gap: .35rem; min-height: 150px; padding: 1.1rem .8rem;
  background: var(--superficie); border: 1px solid var(--borda); border-radius: var(--raio);
  box-shadow: var(--sombra); color: var(--texto);
  transition: border-color .12s, box-shadow .12s, transform .12s;
}
.ladrilho:hover { text-decoration: none; border-color: var(--marca-clara); box-shadow: var(--sombra-md); transform: translateY(-1px); }
.ladrilho-icone { color: var(--marca-clara); opacity: .9; }
.ladrilho-nome { font-weight: 650; font-size: .95rem; line-height: 1.25; }
.ladrilho-sub { font-size: .74rem; color: var(--texto-ténue); text-transform: uppercase; letter-spacing: .05em; }
.ladrilho-info { font-size: .74rem; color: var(--texto-suave); }
.ladrilho.vazio-ladrilho { opacity: .55; }
.ladrilho.vazio-ladrilho:hover { opacity: .85; }

/* ---------------------------------------------------------------- Pílulas (etiquetas de material) */
.pilulas { display: flex; flex-wrap: wrap; gap: .3rem; }
.pilula {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .16rem .5rem; border: 1px solid var(--borda-forte); border-radius: 999px;
  font-size: .76rem; background: var(--superficie); color: var(--texto); cursor: pointer; white-space: nowrap;
  user-select: none;
}
a.pilula:hover { text-decoration: none; border-color: var(--marca-clara); }
.pilula input[type=checkbox] { width: 13px; height: 13px; margin: 0; }
.pilula .contagem {
  font-size: .68rem; font-variant-numeric: tabular-nums; color: var(--texto-suave);
  background: var(--superficie-2); border-radius: 999px; padding: 0 .35rem; min-width: 1.2rem; text-align: center;
}
.pilula.sem-forn { border-style: dashed; color: var(--texto-suave); }
.pilula.sem-forn .contagem { color: var(--cor-ambar); }
.pilula.selecionada { background: var(--marca); color: var(--marca-sobre); border-color: var(--marca); }
.pilula.selecionada .contagem { background: color-mix(in srgb, var(--marca-sobre) 22%, transparent); color: var(--marca-sobre); }
.pilulas.grandes .pilula { font-size: .84rem; padding: .3rem .7rem; }
.marcas-artigo { display: flex; flex-wrap: wrap; gap: .25rem; margin-top: .25rem; }
.marcas-artigo .etiqueta { font-size: .66rem; }

.tabela-artigos td { vertical-align: top; }
.tabela-artigos .col-sel { width: 30px; }

/* ---------------------------------------------------------------- Códigos de norma */
.codigos { display: flex; flex-wrap: wrap; gap: .4rem; }
.codigo-norma {
  display: inline-flex; align-items: center; gap: .35rem;
  font-family: var(--fonte-mono); font-size: .8rem;
  border: 1px solid var(--borda-forte); border-radius: var(--raio-sm); padding: .15rem .45rem;
  background: var(--superficie); color: var(--texto); margin: 0 .2rem .2rem 0;
}
a.codigo-norma:hover { text-decoration: none; border-color: var(--marca-clara); }
.codigo-norma small { font-family: var(--fonte); font-size: .66rem; color: var(--texto-ténue); }
.codigo-norma.principal { background: var(--marca); color: var(--marca-sobre); border-color: var(--marca); }
.codigo-norma.principal a, .codigo-norma.principal small { color: var(--marca-sobre); }
.codigo-norma.chemitool { border-style: dashed; }
.codigo-norma a { color: inherit; }
.remover-codigo { border: 0; background: transparent; color: var(--texto-ténue); cursor: pointer; font-size: 1rem; line-height: 1; padding: 0 .1rem; }
.remover-codigo:hover { color: var(--erro); }

/* ---------------------------------------------------------------- Pesquisa por tags */
.pesquisa-app { display: flex; flex-direction: column; gap: .6rem; }
.caixa-tags {
  position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: .35rem;
  background: var(--superficie); border: 1px solid var(--borda-forte); border-radius: var(--raio);
  padding: .45rem .6rem; box-shadow: var(--sombra);
}
.caixa-tags:focus-within { border-color: var(--marca-clara); box-shadow: 0 0 0 3px color-mix(in srgb, var(--marca-clara) 18%, transparent); }
.caixa-tags > .icone { color: var(--texto-ténue); }
.caixa-tags input#entrada-tags {
  flex: 1; min-width: 220px; border: 0 !important; box-shadow: none !important; background: transparent !important;
  padding: .3rem .2rem; font-size: .95rem;
}
.chips { display: contents; }
.chip {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .18rem .25rem .18rem .5rem; border-radius: 999px; font-size: .8rem; font-weight: 600;
  background: var(--superficie-2); border: 1px solid var(--borda-forte); color: var(--texto);
}
.chip small { font-weight: 500; font-size: .64rem; text-transform: uppercase; letter-spacing: .05em; color: var(--texto-ténue); }
.chip button { border: 0; background: transparent; cursor: pointer; color: var(--texto-ténue); font-size: 1rem; line-height: 1; padding: 0 .25rem; border-radius: 999px; }
.chip button:hover { color: var(--erro); background: color-mix(in srgb, var(--erro) 10%, transparent); }
/* Cada tipo de filtro tem um traço de cor própria — é informação: diz que coluna está a filtrar. */
.chip-gama { border-left: 3px solid var(--cor-roxo); }
.chip-cat  { border-left: 3px solid var(--cor-azul); }
.chip-mat  { border-left: 3px solid var(--cor-ambar); }
.chip-din  { border-left: 3px solid var(--cor-verde); }
.chip-tag  { border-left: 3px solid var(--cor-ciano); }
.chip-med  { border-left: 3px solid var(--cor-vermelho); }
.chip-texto { border-left: 3px solid var(--cor-cinza); }
.sugestoes {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 30;
  list-style: none; margin: 0; padding: .3rem; max-height: 360px; overflow-y: auto;
  background: var(--superficie); border: 1px solid var(--borda-forte); border-radius: var(--raio); box-shadow: var(--sombra-lg);
}
.sugestoes li { padding: .42rem .55rem; border-radius: var(--raio-sm); cursor: pointer; font-size: .88rem; display: flex; align-items: center; gap: .45rem; }
.sugestoes li.ativa, .sugestoes li:hover:not(.dica) { background: var(--superficie-2); }
.sugestoes li.dica { cursor: default; font-size: .72rem; color: var(--texto-ténue); border-top: 1px solid var(--borda); margin-top: .2rem; border-radius: 0; }
.tipo-sugestao {
  font-size: .62rem; text-transform: uppercase; letter-spacing: .06em; font-weight: 700; color: var(--texto-suave);
  padding: .1rem .4rem; border-radius: 4px; background: var(--superficie-2); min-width: 5.2rem; text-align: center;
}
.barra-pesquisa { font-size: .8rem; }
.caixa-lista-din { background: var(--superficie); border: 1px solid var(--borda); border-radius: var(--raio); padding: .7rem; display: flex; flex-direction: column; gap: .5rem; }

.pesquisa-corpo { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 1rem; align-items: start; }
.facetas {
  position: sticky; top: 4.4rem; max-height: calc(100vh - 5.5rem); overflow-y: auto;
  background: var(--superficie); border: 1px solid var(--borda); border-radius: var(--raio); padding: .6rem .7rem;
}
.faceta + .faceta { border-top: 1px solid var(--borda); margin-top: .5rem; padding-top: .55rem; }
.faceta h3 { font-size: .68rem; text-transform: uppercase; letter-spacing: .08em; color: var(--texto-suave); margin: 0 0 .3rem; }
.faceta-opcao {
  display: flex; align-items: center; gap: .45rem; padding: .2rem .25rem; border-radius: 5px;
  font-size: .82rem; cursor: pointer; line-height: 1.3;
}
.faceta-opcao:hover { background: var(--superficie-2); }
.faceta-opcao .nome { flex: 1; min-width: 0; }
.faceta-opcao .conta-faceta { font-size: .7rem; color: var(--texto-ténue); font-variant-numeric: tabular-nums; }
.faceta-opcao.sem { opacity: .45; }
.faceta-opcao.nivel-2 { padding-left: .4rem; }
.faceta-opcao.nivel-3 { padding-left: 1.3rem; font-size: .78rem; }
.faceta-opcao.nivel-4 { padding-left: 2.2rem; font-size: .76rem; }
.faceta-opcao.forte { font-weight: 650; }
.faceta.longa .faceta-lista { max-height: 15rem; overflow-y: auto; }
.faceta-opcao.sugerida { background: color-mix(in srgb, var(--cor-ambar) 12%, transparent); }

/* ---------------------------------------------------------------- Fornecedores: filtros */
.filtros-fornecedores .filtros { align-items: end; }
/* Cards that hold a drop-down (multi-select, suggestions) must not clip it. */
.filtros-fornecedores, .cartao:has(.multi-seletor), .cartao:has(.sugestoes) { overflow: visible; }
.cartao:has(.multi-seletor) > header { border-radius: var(--raio) var(--raio) 0 0; }
.multi-seletor { position: relative; }
.multi-seletor > summary {
  list-style: none; cursor: pointer; min-width: 190px; max-width: 290px;
  padding: .5rem .7rem; border: 1px solid var(--borda-forte); border-radius: var(--raio-sm); background: var(--superficie);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: .86rem;
}
.multi-seletor > summary::-webkit-details-marker { display: none; }
.multi-seletor > summary::after { content: "▾"; float: right; color: var(--texto-ténue); margin-left: .5rem; }
.multi-painel {
  position: absolute; z-index: 40; top: calc(100% + 4px); left: 0; width: 300px; max-height: 380px; overflow-y: auto;
  background: var(--superficie); border: 1px solid var(--borda-forte); border-radius: var(--raio); box-shadow: var(--sombra-lg); padding: .5rem;
}
.multi-painel input[type=search] { width: 100%; margin-bottom: .4rem; }
.multi-grupo + .multi-grupo { border-top: 1px solid var(--borda); margin-top: .3rem; padding-top: .3rem; }
.mais-filtros > summary { cursor: pointer; color: var(--texto-suave); font-size: .82rem; margin-top: .6rem; }

/* ---------------------------------------------------------------- Ficha do fornecedor */
.cabecalho-ficha .contactos-rapidos { margin-top: .5rem; }
.contactos-rapidos { display: flex; flex-wrap: wrap; gap: .3rem 1rem; align-items: center; font-size: .86rem; }
.contactos-rapidos span { display: inline-flex; align-items: center; gap: .3rem; }
.acoes-ficha { margin-left: auto; }
.contacto { display: flex; gap: .8rem; align-items: flex-start; padding: .75rem 1rem; border-bottom: 1px solid var(--borda); }
.contacto:last-child { border-bottom: 0; }
.contacto-resumo { flex: 1; min-width: 0; }
.contacto-editar { flex: 0 0 auto; }
.contacto-editar[open] { flex: 1 1 100%; }
.contacto-editar > summary { list-style: none; }
.contacto-editar > summary::-webkit-details-marker { display: none; }
.historico-simples { list-style: none; margin: 0; padding: 0; font-size: .82rem; }
.historico-simples li { padding: .4rem 0; border-bottom: 1px solid var(--borda); }
.historico-simples li:last-child { border-bottom: 0; }
.lista-simples { margin: 0; padding-left: 1.1rem; font-size: .86rem; }
.lista-simples li { margin: .2rem 0; }
.lista-pares { display: flex; flex-wrap: wrap; gap: .4rem; }
.lista-pares .par {
  display: inline-flex; gap: .5rem; align-items: baseline; padding: .25rem .55rem;
  border: 1px solid var(--borda); border-radius: var(--raio-sm); font-size: .8rem; color: var(--texto);
}
a.par:hover { text-decoration: none; border-color: var(--marca-clara); }
.descricao-fornecedor { max-width: 90ch; }
.factos-categorizar { margin-bottom: .6rem; }

/* ---------------------------------------------------------------- Categorização */
.arvore-categorias, .arvore-categorias ul, .arvore-admin, .arvore-admin ul { list-style: none; margin: 0; padding: 0; }
.arvore-categorias ul { padding-left: 1.1rem; border-left: 1px dashed var(--borda-forte); margin-left: .55rem; }
.arvore-categorias li.coberta > label { opacity: .55; }
.arvore-categorias li.coberta > label::after { content: "incluída"; font-size: .64rem; color: var(--texto-ténue); margin-left: .3rem; }
.resultados-artigos {
  list-style: none; margin: .4rem 0 0; padding: .3rem; max-height: 300px; overflow-y: auto;
  border: 1px solid var(--borda-forte); border-radius: var(--raio); background: var(--superficie); box-shadow: var(--sombra-md);
}
.resultados-artigos li { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .35rem .4rem; border-bottom: 1px solid var(--borda); font-size: .84rem; }
.resultados-artigos li:last-child { border-bottom: 0; }
.resultados-artigos li.acoes-lista { justify-content: flex-end; }
.adicionar-rapido { position: relative; flex: 1; min-width: 260px; max-width: 560px; }
.adicionar-rapido input { width: 100%; }
.adicionar-rapido .resultados-artigos { position: absolute; left: 0; right: 0; z-index: 30; }
.barra-gravar { position: sticky; bottom: 0; background: color-mix(in srgb, var(--fundo) 88%, transparent); backdrop-filter: blur(6px); padding: .8rem 0; border-top: 1px solid var(--borda); }

.arvore-admin ul { padding-left: 1.2rem; }
.cat-editar > summary { display: flex; align-items: center; gap: .5rem; padding: .4rem .3rem; cursor: pointer; border-radius: var(--raio-sm); flex-wrap: wrap; }
.cat-editar > summary:hover { background: var(--superficie-2); }
.cat-editar[open] { background: var(--superficie-2); border-radius: var(--raio-sm); padding: 0 .5rem .6rem; margin-bottom: .4rem; }
.cat-editar.inativa > summary { opacity: .55; }
.cat-editar > .cat-resumo { display: flex; align-items: center; gap: .5rem; padding: .4rem .3rem; border-radius: var(--raio-sm); flex-wrap: wrap; color: inherit; text-decoration: none; }
.cat-editar > .cat-resumo:hover { background: var(--superficie-2); }
.cat-editar.inativa > .cat-resumo { opacity: .55; }

/* ---------------------------------------------------------------- Painel */
.barra-mini { height: 7px; border-radius: 99px; background: var(--superficie-2); overflow: hidden; min-width: 80px; }
.barra-mini span { display: block; height: 100%; background: var(--cor-verde); border-radius: 99px; }

/* ---------------------------------------------------------------- Pedido de preço */
.passos-pedido {
  display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin-bottom: 1rem;
}
.passos-pedido .passo {
  display: inline-flex; align-items: center; gap: .45rem; padding: .35rem .75rem .35rem .4rem;
  border: 1px solid var(--borda); border-radius: 999px; font-size: .82rem; color: var(--texto-suave); background: var(--superficie);
}
.passos-pedido .passo span {
  display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%;
  background: var(--superficie-2); font-weight: 700; font-size: .75rem;
}
.passos-pedido .passo:hover { text-decoration: none; border-color: var(--marca-clara); }
.passos-pedido .passo.feito span { background: var(--cor-verde); color: #fff; }
.passos-pedido .passo.atual { border-color: var(--marca-clara); color: var(--texto); font-weight: 600; }
.passos-pedido .passo.atual span { background: var(--marca); color: var(--marca-sobre); }
.tabela-linhas input[type=text] { width: 100%; min-width: 0; padding: .32rem .45rem; font-size: .82rem; }
.tabela-linhas .campo-curto { width: 7.5rem; }
.tabela-linhas .campo-mini { width: 4rem; }
.retirar { display: inline-flex; align-items: center; gap: .2rem; color: var(--texto-ténue); cursor: pointer; }
.retirar:has(input:checked) { color: var(--erro); }
.filtros-sugestoes select { max-width: 220px; }
.cobertura { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--texto-suave); }
.cobertura.total { color: var(--cor-verde); }
.lista-anexos { list-style: none; margin: 0; padding: 0; font-size: .86rem; }
.lista-anexos li { display: flex; align-items: center; gap: .4rem; padding: .25rem 0; }
.envios { display: grid; gap: .8rem; }
.envio { border: 1px solid var(--borda); border-radius: var(--raio); padding: .7rem .85rem; background: var(--superficie); }
.envio > header { margin-bottom: .35rem; }
.envio .para { color: var(--texto-suave); margin-bottom: .5rem; overflow-wrap: anywhere; }
.botoes-envio { margin-bottom: .4rem; }
.previsao > summary { cursor: pointer; font-size: .8rem; color: var(--texto-suave); margin: .3rem 0; }
.texto-email {
  white-space: pre-wrap; font-family: var(--fonte); font-size: .82rem; line-height: 1.5;
  background: var(--superficie-2); border: 1px solid var(--borda); border-radius: var(--raio-sm); padding: .7rem .8rem; max-height: 420px; overflow: auto;
}
.envio .resposta { margin-top: .5rem; }
.envio .resposta input[type=text] { flex: 1; min-width: 200px; }

/* ---------------------------------------------------------------- Aviso flutuante */
.aviso-flutuante {
  position: fixed; right: 1.2rem; bottom: 1.2rem; z-index: 100; max-width: 420px;
  padding: .75rem 1rem; border-radius: var(--raio); box-shadow: var(--sombra-lg);
  background: var(--superficie); border: 1px solid var(--borda-forte); border-left: 4px solid var(--sucesso); font-size: .88rem;
}
.aviso-flutuante.erro { border-left-color: var(--erro); }
.aviso-flutuante.aviso { border-left-color: var(--aviso); }

/* ---------------------------------------------------------------- Responsivo */
@media (max-width: 1100px) {
  /* minmax(0, …): the results table scrolls inside its card instead of widening the page. */
  .pesquisa-corpo { grid-template-columns: minmax(0, 1fr); }
  .pesquisa-corpo > * { min-width: 0; }
  .facetas { position: static; max-height: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: .4rem 1rem; }
  .faceta + .faceta { border-top: 0; margin-top: 0; padding-top: 0; }
  .grelha-2.lado-maior { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .facetas { grid-template-columns: minmax(0, 1fr); }
  .resultados .cartao > header { flex-wrap: wrap; gap: .5rem; }
  .mosaico { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  .ladrilho { min-height: 120px; }
  .multi-painel { width: min(300px, 86vw); }
  .acoes-ficha { margin-left: 0; }
}

/* ---------------------------------------------------------------- Documents (docs/*.md shown in the app) */
.documento-md { max-width: 72rem; line-height: 1.55; }
.documento-md h2 { font-size: 1.15rem; margin: 1.6rem 0 .6rem; }
.documento-md h2:first-child { margin-top: 0; }
.documento-md h3 { font-size: 1rem; margin: 1.2rem 0 .5rem; }
.documento-md p, .documento-md ul, .documento-md ol, .documento-md blockquote { margin: 0 0 .8rem; }
.documento-md ul, .documento-md ol { padding-left: 1.4rem; }
.documento-md li { margin: .25rem 0; }
.documento-md blockquote { border-left: 3px solid var(--borda); padding: .2rem 0 .2rem .9rem; color: var(--texto-suave); }
.documento-md pre { background: var(--superficie-2); border-radius: var(--raio-sm); padding: .6rem .8rem; overflow-x: auto; font-size: .85rem; }
.documento-md code { font-size: .88em; }
.documento-md .tabela-envolvente { margin: 0 0 1rem; }
.documento-md hr { border: 0; border-top: 1px solid var(--borda); margin: 1.4rem 0; }

/* Item whose suppliers only supply the whole category (none names the standard). */
.pilula.so-categoria { border-style: dashed; }

/* ---------------------------------------------------------------- Quotes and reminders (RFQ page) */
.envio .lembrete { margin-top: .4rem; padding-top: .4rem; border-top: 1px dashed var(--borda); }
.envio .cotacao { margin-top: .5rem; }
.envio .cotacao > summary { cursor: pointer; color: var(--texto-suave); }
.tabela-cotacao input[type=text] { width: 100%; min-width: 4.5rem; }
.tabela-cotacao td:first-child { min-width: 12rem; }
.tabela-comparar td.melhor { background: color-mix(in srgb, var(--sucesso) 13%, transparent); }
.tabela-comparar td.melhor strong::after { content: " ★"; color: var(--sucesso); }
.tabela-comparar tfoot th, .tabela-comparar tfoot td { border-top: 2px solid var(--borda-forte); font-weight: 600; }

/* ---------------------------------------------------------------- Business cards */
.foto-cartao { max-width: 100%; height: auto; border-radius: var(--raio-sm); border: 1px solid var(--borda); display: block; }

/* ---------------------------------------------------------------- Sign-in: "or" between password and Microsoft 365 */
.separador-login { display: flex; align-items: center; gap: .6rem; margin: 1rem 0 .8rem; color: var(--texto-ténue); font-size: .8rem; }
.separador-login::before, .separador-login::after { content: ""; flex: 1; border-top: 1px solid var(--borda); }

/* Grid columns may shrink below their content (a wide table scrolls inside its wrapper instead of widening the page). */
.grelha-2 > *, .grelha-2.lado-maior > * { min-width: 0; }

/* ===================================================================
   User manual (views/manual/index.php). Read as running text, unlike the
   rest of the app: shorter lines, more air. The figures keep their own
   width (a section capture is not stretched past its pixels).
   =================================================================== */
.manual-texto p { margin: 0 0 .75rem; line-height: 1.62; max-width: 82ch; }
.manual-texto p.sem-margem { margin: 0; }
.manual-texto h3 { font-size: 1rem; font-weight: 700; margin: 1.4rem 0 .45rem; }
.manual-texto ul, .manual-texto ol { margin: 0 0 .9rem; padding-left: 1.2rem; max-width: 82ch; }
.manual-texto li { margin-bottom: .3rem; line-height: 1.55; }
.manual-texto .destaque-paragrafo { font-size: 1.04rem; color: var(--texto-suave); line-height: 1.6; margin-bottom: 1.1rem; }
.manual-texto .alerta { max-width: 82ch; margin: .9rem 0 1rem; }
.manual-texto .tabela-envolvente { max-width: 100ch; margin: .3rem 0 1rem; }
.manual-texto .figura-manual img { width: auto; max-width: 100%; }
.itens-manual { display: grid; grid-template-columns: minmax(9rem, 13rem) minmax(0, 1fr); gap: .5rem 1.1rem; margin: .5rem 0 1.1rem; max-width: 100ch; }
.itens-manual dt { font-weight: 650; font-size: .86rem; padding-top: .08rem; }
.itens-manual dd { margin: 0; font-size: .9rem; line-height: 1.55; }
@media (max-width: 640px) {
  .itens-manual { grid-template-columns: minmax(0, 1fr); gap: .15rem; }
  .itens-manual dd { margin-bottom: .6rem; }
}
.capa-manual { display: none; }

@media print {
  @page { size: A4; margin: 14mm 13mm 17mm; }
  .manual-ecra, .principal > .topo { display: none !important; }
  .conteudo { padding: 0 !important; max-width: none !important; }
  .capa-manual {
    display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center;
    height: 245mm; break-after: page; page-break-after: always;
  }
  .capa-manual .capa-logo { width: 62mm; filter: brightness(.35); margin-bottom: 18mm; }
  .capa-manual h1 { font-size: 30pt; margin: 0 0 4mm; letter-spacing: -.4px; }
  .capa-manual .capa-sub { font-size: 14pt; color: #555; margin-bottom: 26mm; }
  .capa-manual .capa-meta { font-size: 10pt; color: #777; line-height: 1.8; }
  #indice { break-after: page; page-break-after: always; border: 0 !important; box-shadow: none !important; }
  #indice .corpo { columns: 2; column-gap: 12mm; }
  .grupo-indice, ol.indice-manual li { break-inside: avoid; }
  .seccao-manual { break-before: page; page-break-before: always; break-inside: auto !important; border: 0 !important; box-shadow: none !important; margin: 0 !important; }
  .seccao-manual > header { border-bottom: 2px solid #111 !important; padding: 0 0 2mm !important; margin-bottom: 4mm; break-after: avoid; }
  .seccao-manual > header h2 { font-size: 16pt; }
  .seccao-manual > .corpo { padding: 0 !important; }
  .manual-texto p, .manual-texto li, .itens-manual dd { font-size: 10pt; }
  .manual-texto p, .manual-texto ul, .manual-texto ol, .itens-manual, .manual-texto .alerta { max-width: none; }
  .figura-manual { break-inside: avoid; page-break-inside: avoid; margin: 4mm 0 5mm; }
  .figura-manual img { max-height: 150mm; width: auto; max-width: 100%; object-fit: contain; }
  .itens-manual dt, .itens-manual dd, .alerta, table, tr { break-inside: avoid; }
  .manual-texto h3 { break-after: avoid; }
  a { color: inherit !important; text-decoration: none !important; }
}
/* Two-digit section numbers need room before the title. */
.seccao-manual .num-seccao { min-width: 2.1rem; margin-right: .35rem; }
