/* Escolha com busca (ui/escolha.js): o botão em pílula e a lista que abre embaixo dele, por cima do que vem depois. */
.esc { position: relative; display: inline-flex; min-width: 0; }
.esc-botao { display: inline-flex; align-items: center; gap: 6px; height: 36px; max-width: 280px; padding: 0 10px 0 14px; border: var(--contorno-fino); border-radius: 999px; background: var(--snx-off-white); color: var(--tinta); box-shadow: 3px 3px 0 var(--tinta-sombra); font: 700 13px var(--body); cursor: pointer; }
/* O aberto e o hover na peça clara do tema (--superficie): o --papel-branco é o papel que fica claro também no alto contraste,
   e ali o texto do botão (a tinta, branca) sumia sobre ele. */
.esc-botao:hover:not(:disabled), .esc.aberta .esc-botao { background: var(--superficie); }
.esc-botao.com-escolha { background: var(--pastel-azul); }
.esc-botao:disabled { opacity: .55; cursor: default; }
.esc-texto { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.esc-conta { min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px; background: var(--tinta-fundo); color: var(--sobre-tinta); font: 700 11px/20px var(--body); text-align: center; }
.esc-seta { display: inline-flex; flex: none; transition: rotate .15s ease-out; }
.esc.aberta .esc-seta { rotate: 180deg; }

.esc-pop { position: absolute; top: calc(100% + 8px); left: 0; z-index: 5; width: max(100%, 280px); max-width: min(380px, 90vw); display: flex; flex-direction: column; gap: 6px; padding: 8px; border: var(--contorno-fino); border-radius: 14px; background: var(--superficie); color: var(--tinta); box-shadow: var(--sombra-peca); transform-origin: top left; }
/* Perto da borda direita do painel (escolha.js), a lista se prende à direita do botão. */
.esc-pop.a-direita { left: auto; right: 0; transform-origin: top right; }
/* O display: flex de cima venceria o hidden: a lista fechada ficava na tela (o "Limpar" de cada linha da Oficina › Usuários por cima da de baixo). */
.esc-pop[hidden] { display: none; }
.esc-busca { height: 34px; padding: 0 12px; border: var(--contorno-fino); border-radius: 999px; background: var(--snx-off-white); color: var(--tinta); font: 14px var(--body); }
.esc-busca:focus-visible, .esc-lista:focus-visible { outline: 2px solid var(--foco); outline-offset: 1px; }
.esc-lista { margin: 0; padding: 0; list-style: none; max-height: 280px; overflow-y: auto; border-radius: 8px; }
.esc-op { display: grid; grid-template-columns: 18px 1fr; column-gap: 8px; align-items: center; padding: 7px 8px; border-radius: 8px; cursor: pointer; font: 14px var(--body); }
.esc-op small { grid-column: 2; color: var(--muted); font-size: 12px; }
.esc-op-texto { min-width: 0; overflow-wrap: anywhere; }
.esc-op:hover, .esc-op.ativa { background: var(--pastel-gelo); }
.esc-op.ativa { box-shadow: inset 0 0 0 2px var(--tinta); }
.esc-marca { width: 16px; height: 16px; border: 2px solid var(--tinta-borda); border-radius: 4px; background: var(--superficie); }
.esc-op[aria-selected="true"] .esc-marca { background: var(--snx-azul) url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path d="M3.5 8.5l3 3 6-7" fill="none" stroke="%2300112B" stroke-width="2.4" stroke-linecap="round" stroke-linejoin="round"/></svg>') center / 12px no-repeat; }
.esc-lista:not([aria-multiselectable]) .esc-marca { border-radius: 50%; }
/* No vidro, a caixa não marcada é uma gota, e a marcada, o toque azul com o ✓ claro (o escuro sumia sobre o azul translúcido). */
:root[data-estilo="vidro"]:not([data-alto-contraste]) .esc-marca { border: 1px solid var(--gota-borda); background-color: var(--gota); }
:root[data-estilo="vidro"]:not([data-alto-contraste]) .esc-op[aria-selected="true"] .esc-marca { background: rgba(24, 147, 239, 0.45) url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path d="M3.5 8.5l3 3 6-7" fill="none" stroke="%23F4F2F2" stroke-width="2.4" stroke-linecap="round" stroke-linejoin="round"/></svg>') center / 12px no-repeat; border-color: rgba(168, 220, 255, 0.6); }
/* No alto contraste, o azul da marcada é escuro: o ✓ vai branco. */
:root[data-alto-contraste] .esc-op[aria-selected="true"] .esc-marca { background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path d="M3.5 8.5l3 3 6-7" fill="none" stroke="%23FFFFFF" stroke-width="2.4" stroke-linecap="round" stroke-linejoin="round"/></svg>'); }
.esc-vazio { margin: 4px 6px; color: var(--muted); font-size: 13px; }
.esc-limpar { align-self: flex-end; padding: 4px 10px; border: 0; border-radius: 999px; background: none; color: var(--accent-texto); font: 700 13px var(--body); cursor: pointer; }
.esc-limpar:disabled { opacity: .4; cursor: default; }
.esc-limpar:focus-visible { outline: 2px solid var(--foco); }
/* A peça sobe no hover e desce ao apertar, como os outros botões da marca (barra/vidro.css). */
.esc-botao { transition: transform .25s var(--mola), box-shadow .12s, background-color .15s; }
.esc-botao:hover:not(:disabled) { transform: translate(-1px, -2px); box-shadow: 5px 5px 0 var(--tinta-sombra); }
.esc-botao:focus-visible:not(:disabled) { transform: translate(-1px, -2px); box-shadow: 5px 5px 0 var(--tinta-sombra); outline: none; }
.esc-botao:active:not(:disabled) { transform: translate(3px, 3px); box-shadow: 0 0 0 var(--tinta); transition: transform .06s, box-shadow .06s; }
