/* Padrão dos selects de escolha única.
   Mantém o comportamento do formulário, teclado e eventos existentes. */
   body select:not([multiple]):not([size]),
   body select:not([multiple])[size="1"] {
       --select-inset: 12px;
       --select-arrow-size: 16px;
       --select-arrow-gap: 12px;
   
       -webkit-appearance: none;
       appearance: none;
   
       padding-left: var(--select-inset);
       padding-right: calc(
           var(--select-inset) + var(--select-arrow-size) + var(--select-arrow-gap)
       );
   
       background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath d='M3 6l5 5 5-5' fill='none' stroke='%235d6d7e' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
       background-repeat: no-repeat;
       background-position: right var(--select-inset) center;
       background-size: var(--select-arrow-size) var(--select-arrow-size);
   }
   
   /* Desktop compatível: o próprio select oferece uma lista personalizável.
      A regra não substitui o seletor nativo em dispositivos de toque. */
   @supports (appearance: base-select) and (width: anchor-size(width)) {
       @media (hover: hover) and (pointer: fine) and (forced-colors: none) {
           body select:not([multiple]):not([size]),
           body select:not([multiple])[size="1"],
           body select:not([multiple]):not([size])::picker(select),
           body select:not([multiple])[size="1"]::picker(select) {
               appearance: base-select;
           }
   
           /* A seta já está desenhada no fundo; evita uma segunda seta. */
           body select:not([multiple]):not([size])::picker-icon,
           body select:not([multiple])[size="1"]::picker-icon {
               display: none;
           }
   
           /* Mesma largura e borda esquerda do campo.
              Abre abaixo quando há espaço; pode abrir acima perto do rodapé. */
           body select:not([multiple]):not([size])::picker(select),
           body select:not([multiple])[size="1"]::picker(select) {
               box-sizing: border-box;
               position: fixed;
               inset: auto;
               top: anchor(bottom);
               left: anchor(left);
   
               width: anchor-size(width);
               min-width: 0;
               max-width: calc(100vw - 24px);
               max-height: min(320px, 60vh);
   
               margin: 4px 0;
               padding: 4px;
               overflow: auto;
   
               border: 1px solid #aebdcb;
               border-radius: 8px;
               color: var(--text);
               background: var(--surface);
               box-shadow: 0 8px 24px rgb(20 35 54 / 16%);
               font: inherit;
   
               position-try-fallbacks: flip-block;
           }
   
           /* Espaçamento e quebra de texto das opções da lista. */
           body select:not([multiple]):not([size]) option,
           body select:not([multiple])[size="1"] option {
               min-height: 40px;
               padding: 9px 12px;
               border-radius: 5px;
               white-space: normal;
               overflow-wrap: anywhere;
           }
   
           /* Identifica a opção selecionada. */
           body select:not([multiple]):not([size]) option:checked,
           body select:not([multiple])[size="1"] option:checked {
               color: #104d9c;
               background: #e9f0fa;
           }
   
           /* Feedback ao navegar com mouse ou teclado. */
           body select:not([multiple]):not([size]) option:not(:disabled):is(:hover, :focus-visible),
           body select:not([multiple])[size="1"] option:not(:disabled):is(:hover, :focus-visible) {
               color: #ffffff;
               background: var(--accent);
           }
       }
   }
   
   /* Em alto contraste, respeita a apresentação nativa do navegador. */
   @media (forced-colors: active) {
       body select:not([multiple]):not([size]),
       body select:not([multiple])[size="1"] {
           -webkit-appearance: auto;
           appearance: auto;
           background-image: none;
           padding-right: var(--select-inset);
       }
   }