/* Busca (21/10/2026) — only what is this screen's (prefix bsc-). The rest are
   the reference board's pieces: cm-* (comercial/funil.css), cg-* (Garantia card),
   cx-* (comex card). Colours from the theme tokens; the grey of the waiting and
   cemetery cards is PADROES §40. */

#bscRoot .bsc-barra { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
#bscRoot .bsc-titulo .painel-title { margin: 0; }
#bscRoot .bsc-barra .cm-busca-caixa { min-width: 360px; }

/* miniature */
#bscRoot .bsc-card { position: relative; }
#bscRoot .bsc-card-sub { font-size: 10.5px; color: var(--text-2, var(--text-secondary)); line-height: 1.35; margin: 2px 0 4px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
#bscRoot .bsc-qtd { font-size: 10px; color: var(--text-2, var(--text-secondary)); white-space: nowrap; }
#bscRoot .bsc-qtd--pdf { font-weight: 700; font-size: 9px; color: #c0392b; border: 1px solid rgba(192,57,43,.35); border-radius: 3px; padding: 0 3px; }
#bscRoot .bsc-antigos { display: block; width: 100%; margin-top: 6px; padding: 7px; background: none; cursor: pointer;
  border: 1px dashed var(--border, var(--card-border)); border-radius: 8px; color: var(--text-2, var(--text-secondary)); font-size: 11.5px; }
#bscRoot .bsc-antigos:hover { color: var(--ink, var(--text-primary)); }

/* Stand by (waiting) and Concluído (cemetery): grey miniature, text included — it still opens (§40) */
#bscRoot .bsc-board .cm-col--espera .bsc-card,
#bscRoot .bsc-board .cm-col--fim .bsc-card { background: #ecebe6; border-color: #dcdad3; box-shadow: none; }
#bscRoot .bsc-board .cm-col--espera .bsc-card *,
#bscRoot .bsc-board .cm-col--fim .bsc-card * { color: #8d8b84 !important; }
#bscRoot .bsc-board .cm-col--espera .bsc-card .cm-chip,
#bscRoot .bsc-board .cm-col--fim .bsc-card .cm-chip,
#bscRoot .bsc-board .cm-col--espera .bsc-card .cm-resp,
#bscRoot .bsc-board .cm-col--fim .bsc-card .cm-resp { background: #e4e2db; border-color: #d6d4cc; }
#bscRoot .bsc-board .cm-col--espera .bsc-qtd--pdf,
#bscRoot .bsc-board .cm-col--fim .bsc-qtd--pdf { border-color: #d6d4cc; }

/* opened card: comments · header · history */
#bscModal .cm-modal-split.bsc-split { grid-template-columns: 300px minmax(0, 1fr) 300px; }
@media (max-width: 1100px) { #bscModal .cm-modal-split.bsc-split { grid-template-columns: 1fr; overflow-y: auto; } }
#bscRoot .bsc-faixa { margin: 0 0 10px; padding: 8px 12px; border-radius: 6px; font-size: 12.5px; line-height: 1.5;
  background: var(--surface-2, #f3f3f1); color: var(--text-2, var(--text-secondary)); }
#bscRoot .bsc-obrig { font-style: normal; color: #d93025; }
#bscRoot a.bsc-pdf { display: block; text-decoration: none; color: var(--ink, var(--text-primary)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#bscRoot a.bsc-pdf:hover { text-decoration: underline; }
#bscRoot .bsc-hist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
#bscRoot .bsc-hist li { padding-left: 12px; border-left: 2px solid var(--border, var(--card-border)); }
#bscRoot .bsc-hist-o { font-size: 12.5px; font-weight: 600; color: var(--ink, var(--text-primary)); }
#bscRoot .bsc-hist-t { font-size: 12px; color: var(--text-2, var(--text-secondary)); margin-top: 2px; white-space: pre-line; }
#bscRoot .bsc-hist-ass { font-size: 9.5px; color: var(--text-2, var(--text-secondary)); margin-top: 3px; }

/* the opening modal: the /busca/nova page in an iframe, with the height of the form (§42) */
#bscNovo .bsc-novo-dialog { width: min(1240px, 96vw); max-width: none; display: flex; flex-direction: column; }
#bscNovo .cm-modal-head { padding: 14px 18px 6px; }
#bscNovo .bsc-novo-corpo { padding: 0 6px 6px; }
#bscNovo .bsc-novo-frame { display: block; width: 100%; height: 260px; border: 0; background: transparent; }

/* the opening page itself (inside the iframe) */
html.bsc-nova-pg .bsc-aviso { margin-top: 10px; font-size: 12.5px; color: #a1281e; }

/* leaving the opening with something typed (§37: two buttons + ✕ = keep editing) */
.bsc-pergunta { position: fixed; inset: 0; z-index: 10050; background: rgba(15,20,30,.35); display: flex; align-items: center; justify-content: center; }
.bsc-pergunta-caixa { position: relative; background: var(--surface, #fff); border: 1px solid var(--border); border-radius: 12px; padding: 18px 20px;
  width: min(420px, calc(100vw - 32px)); box-shadow: 0 12px 40px rgba(0,0,0,.18); }
.bsc-pergunta-tit { font-weight: 700; font-size: 14px; color: var(--ink); margin-bottom: 6px; padding-right: 26px; }
.bsc-pergunta-txt { font-size: 12.5px; color: var(--text-2); margin-bottom: 14px; }
.bsc-pergunta-acts { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.bsc-pergunta-x { position: absolute; top: 10px; right: 10px; width: 26px; height: 26px; border-radius: 7px; border: 1px solid var(--border);
  background: var(--surface, #fff); color: var(--text-2); font-size: 12px; line-height: 1; cursor: pointer; }
.bsc-pergunta-x:hover { color: var(--ink); border-color: var(--ink); }

/* "A fazer" de Tarefas (§34): the miniature drawn in Tarefas exactly as on the
   board; opened embedded (?embed=afazer) only the card's modal and side panel show. */
.afz-lote--busca .bsc-card { position: relative; }
.afz-lote--busca .bsc-card-sub { font-size: 10.5px; color: var(--text-2, var(--text-secondary)); line-height: 1.35; margin: 2px 0 4px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.afz-lote--busca .bsc-qtd { font-size: 10px; color: var(--text-2, var(--text-secondary)); white-space: nowrap; }
.afz-lote--busca .bsc-qtd--pdf { font-weight: 700; font-size: 9px; color: #c0392b; border: 1px solid rgba(192,57,43,.35); border-radius: 3px; padding: 0 3px; }
html.em-afazer #bscModal, html.em-afazer #bscSec { visibility: visible; }

/* Busca ⇄ Sourcing (21/10/2026): the discreet seal of the origin sourcing on
   the miniature, the link in the opened card, and the Fornecedores section */
#bscRoot .bsc-origem, .afz-lote--busca .bsc-origem { font-family: var(--font-mono, monospace); font-size: 9px; letter-spacing: .03em;
  color: var(--text-2, var(--text-secondary)); margin: 1px 0 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#bscRoot a.bsc-origem-link { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
#bscRoot .bsc-extras { display: flex; align-items: center; gap: 10px; min-height: 38px; }
#bscRoot .bsc-forn { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--border, var(--card-border)); }
#bscRoot .bsc-forn-tit { font-size: 13px; font-weight: 700; color: var(--ink, var(--text-primary)); margin-bottom: 8px; }
#bscRoot .bsc-forn-tit .cm-f-nota { font-weight: 400; margin-left: 6px; }
#bscRoot .bsc-forn-linha { border: 1px solid var(--border, var(--card-border)); border-radius: 8px; padding: 10px; margin-bottom: 8px; background: var(--surface, #fff); }
#bscRoot .bsc-forn-linha.is-inativo { opacity: .6; }
#bscRoot .bsc-forn-cab { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 12.5px; }
#bscRoot .bsc-forn-x { margin-left: auto; width: 24px; height: 24px; border-radius: 6px; border: 1px solid var(--border); background: none;
  color: var(--text-2); cursor: pointer; font-size: 11px; }
#bscRoot .bsc-forn-x:hover { color: #c0392b; border-color: #c0392b; }
#bscRoot .bsc-forn-grade { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px 8px; }
@media (max-width: 1300px) { #bscRoot .bsc-forn-grade { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
/* Supplier takes two slots and the country follows it (27/10/2026) */
#bscRoot .bsc-forn-grade .bsc-forn-nome { grid-column: span 2; }
#bscRoot .bsc-forn-pais .cm-input.is-erro { border-color: #c0392b; }
#bscRoot .bsc-forn-f { display: flex; flex-direction: column; gap: 2px; font-size: 9.5px; text-transform: uppercase; letter-spacing: .04em;
  color: var(--text-2, var(--text-secondary)); }
#bscRoot .bsc-forn-f .cm-input { font-size: 12px; text-transform: none; letter-spacing: 0; background: #fff; }
#bscRoot .bsc-chip-ok { background: #e8f4ec; color: #1e6b3a; border-color: transparent; }
#bscRoot .bsc-chip-falta { background: #fdecea; color: #a1281e; border-color: transparent; }
#bscRoot .bsc-forn-falta { color: #a1281e; margin-top: 6px; }
#bscRoot button.bsc-origem-link { background: none; border: 0; padding: 0; font: inherit; cursor: pointer; }
.afz-overlay.bsc-camada { z-index: 10070; } /* above the opened card (§49) */

/* COMPACT miniature (2026-10-21, Felipe): many more cards than the sourcing
   board — three dense lines, small type, tight column. */
#bscRoot .bsc-board .cm-col-body { gap: 5px; }
#bscRoot .bsc-mini { padding: 6px 8px 5px; border-radius: 7px; }
#bscRoot .bsc-mini .bsc-l1 { display: flex; align-items: center; gap: 6px; min-width: 0; }
#bscRoot .bsc-mini .bsc-pn { font-family: var(--font-mono, monospace); font-size: 11.5px; font-weight: 700; color: var(--ink, var(--text-primary));
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
#bscRoot .bsc-mini .bsc-un { font-size: 10.5px; color: var(--text-2, var(--text-secondary)); white-space: nowrap; }
#bscRoot .bsc-mini .bsc-sinais { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; flex-shrink: 0; }
#bscRoot .bsc-mini .bsc-resp { width: 18px; height: 18px; font-size: 8px; }
#bscRoot .bsc-mini .bsc-l2 { font-size: 11px; line-height: 1.3; color: var(--ink, var(--text-primary)); margin: 1px 0 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#bscRoot .bsc-mini .bsc-l3 { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 7px; font-family: var(--font-mono, monospace);
  font-size: 9.5px; color: var(--text-2, var(--text-secondary)); letter-spacing: .02em; }
#bscRoot .bsc-mini .bsc-num { font-weight: 700; }
#bscRoot .bsc-mini .bsc-o { color: var(--accent, #a67550); }
#bscRoot .bsc-mini .bsc-volta { font-weight: 700; }
#bscRoot .bsc-mini .bsc-atraso { color: #c0392b; font-weight: 700; }
#bscRoot .bsc-mini .cg-timer { margin-left: auto; }

/* the card's Searchers (26/10/2026): the flags ticked in the sourcing's Building,
   in place of who opened it; the tooltip is the same "Name — Country" */
#bscRoot .bsc-mini .bsc-srch { font-size: 14px; line-height: 1; cursor: help; }
/* one under the other on the right edge, left of the » (27/10/2026, Felipe);
   the card keeps room for them (and for the », whose padding the compact
   miniature's own padding used to override) */
:is(#bscRoot, .afz-lote--busca) .bsc-mini.bsc-card--avanca { padding-right: 28px; }
:is(#bscRoot, .afz-lote--busca) .bsc-mini.bsc-card--srch { padding-right: 28px; }
:is(#bscRoot, .afz-lote--busca) .bsc-mini.bsc-card--srch.bsc-card--avanca { padding-right: 46px; }
.bsc-mini .bsc-srchs { position: absolute; top: 6px; right: 7px; display: flex; flex-direction: column; align-items: center; gap: 3px; }
.bsc-mini.bsc-card--avanca .bsc-srchs { right: 25px; }

/* the card header, denser (26/10/2026, Felipe): four columns — BU · Part
   number · HSC/NCM · Quantity, then the two descriptions side by side, then
   Tags · Group · Datasheet — and lower fields */
#bscRoot .bsc-gfields { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px 8px; padding-bottom: 8px; }
#bscRoot .bsc-gfields .cm-f { gap: 2px; }
#bscRoot .bsc-gfields .cm-f--wide { grid-column: span 2; }
#bscRoot .bsc-gfields .cm-val { min-height: 26px; padding: 3px 8px; font-size: 12px; }
#bscRoot .bsc-gfields .cm-val.cm-input { height: 26px; }
@media (max-width: 760px) {
  #bscRoot .bsc-gfields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* empty Datasheet: the field is the upload button (26/10/2026) */
#bscRoot .bsc-ds-add { cursor: pointer; border-style: dashed; color: var(--accent, #8a5a3c); font-weight: 600; gap: 4px; }
#bscRoot .bsc-ds-add:hover { background: var(--surface-2, rgba(0,0,0,.03)); }

/* the moon on the Stand by segment of the ruler: puts the card to sleep (26/10/2026) */
#bscRoot .cm-ruler-seg--pending .bsc-sono { width: 26px; height: 20px; color: #5b6170; background: rgba(91,97,112,.10); border: 1px solid rgba(91,97,112,.28); }
#bscRoot .cm-ruler-seg--pending .bsc-sono:hover { background: #5b6170; color: #fff; }
/* "Anexar PDF ou Excel" is a <label> inside .cm-f: undo the field-caption look */
#bscRoot .cm-f label.bsc-ds-add { font-family: inherit; font-size: 12px; text-transform: none; letter-spacing: normal; }

/* the chat (27/10/2026): tab on the left of the card, one conversation per Searcher */
#bscRoot .bsc-chat-badge { display: inline-block; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: #d93025; color: #fff;
  font: 700 10px/16px var(--font-sans, system-ui); text-align: center; letter-spacing: 0; vertical-align: middle; }
#bscRoot .bsc-chat { display: flex; flex-direction: column; gap: 8px; padding: 12px; min-height: 100%; }
#bscRoot .bsc-chat-abas { display: flex; flex-wrap: wrap; gap: 5px; }
#bscRoot .bsc-chat-aba { border: 1px solid var(--border, #e2dfd5); background: none; border-radius: 14px; padding: 3px 9px; font-size: 11.5px; cursor: pointer; }
#bscRoot .bsc-chat-aba.is-on { background: #7a5d1a; border-color: #7a5d1a; color: #fff; }
#bscRoot .bsc-chat-msgs { display: flex; flex-direction: column; gap: 7px; max-height: 52vh; overflow: auto; }
#bscRoot .bsc-msg { max-width: 88%; padding: 6px 9px; border-radius: 9px; font-size: 12.5px; line-height: 1.4; }
#bscRoot .bsc-msg--eu { align-self: flex-end; background: #f1e6d8; }
#bscRoot .bsc-msg--outro { align-self: flex-start; background: var(--surface, #fff); border: 1px solid var(--border, #e2dfd5); }
#bscRoot .bsc-msg--inicial { align-self: stretch; max-width: none; border: 1px dashed var(--border, #d6d2c6); font-style: italic; }
#bscRoot .bsc-msg-ass { margin-top: 3px; font-size: 10px; color: var(--text-2, #8a8780); }
#bscRoot .bsc-mini .bsc-chat-mini { position: relative; font-size: 13px; line-height: 1; }
#bscRoot .bsc-mini .bsc-chat-mini b { position: absolute; top: -7px; right: -9px; min-width: 15px; height: 15px; padding: 0 4px; border-radius: 8px;
  background: #d93025; color: #fff; font: 700 9.5px/15px var(--font-sans, system-ui); text-align: center; box-shadow: 0 0 0 2px #fff; }

#bscRoot .bsc-msg { position: relative; }
#bscRoot .bsc-msg-ok { position: absolute; top: -8px; right: -8px; font-size: 13px; }

/* the miniature's » to the next stage, as the sourcing board's (27/10/2026) */
.bsc-card--avanca{position:relative;padding-right:26px}
.bsc-avanca{position:absolute;right:0;top:0;bottom:0;width:20px;display:grid;place-items:center;cursor:pointer;
  border:0;border-left:1px solid var(--border);border-radius:0 8px 8px 0;background:var(--surface-2);
  color:var(--text-secondary,var(--text-2));transition:background .14s,color .14s;padding:0}
.bsc-avanca span{font-size:14px;font-weight:700;line-height:1;letter-spacing:-1px}
.bsc-avanca:hover{background:#7a5d1a;color:#fff;border-left-color:#7a5d1a}
.bsc-avanca:focus-visible{outline:2px solid #c8956d;outline-offset:-2px}
.bsc-avanca:disabled{cursor:wait;opacity:.6}

/* Concluído em nome de um Searcher (27/10/2026) */
.bsc-pelo { display: flex; flex-direction: column; gap: 6px; }
#bscRoot .cm-f label.bsc-pelo-op { display: flex; align-items: center; gap: 8px; font-weight: 400; cursor: pointer; text-transform: none; letter-spacing: normal; font-family: inherit; font-size: 13px; }
