/*
 * J6 PRIME — ajuste para CELULAR.
 *
 * Carregado só em tela estreita (<link media="(max-width: 767px)"> no header): no PC, no tablet e no sistema local da loja
 * o navegador nem baixa este arquivo. Regras só acrescentam por cima do style.css; nada do desenho de PC é alterado.
 * Conferência: tools/visual/capture.mjs tira as mesmas telas em 1366 px antes e depois e compara os hashes.
 *
 * Decisões do Ideal (16/11/2026): sem menu lateral no celular (o Painel tem o atalho de tudo, e as telas ganham "← Painel");
 * no celular só existe o PDV/DAV (o DAV, que emite venda simples e NFC-e, com a seleção de produtos por quadradinhos).
 */
@media (max-width: 767px) {
    /* ---------- Casca: sem menu lateral, topo compacto, moldura fina ---------- */
    html body aside.app-sidebar,
    html body #mobileSidebarBackdrop,
    html body #mobileSidebarToggle {
        display: none !important;
    }

    html body header.app-topbar {
        height: auto !important;
        min-height: 3.25rem;
        padding: .35rem .6rem !important;
        gap: .4rem;
    }
    html body header.app-topbar h1 {
        font-size: .78rem !important;
        line-height: 1.1;
    }
    html body header.app-topbar .app-topbar-identity > div > span {
        font-size: .62rem !important;
    }

    html body .mobile-home-link {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        gap: .3rem;
        min-height: 2.4rem;
        padding: 0 .7rem;
        border-radius: .65rem;
        font-size: .68rem;
        font-weight: 900;
        letter-spacing: .04em;
        text-transform: uppercase;
        text-decoration: none;
        background: var(--ct-container-solid, #eaf2f9);
        color: var(--ct-page-text, #0b315b);
        border: 1px solid var(--ct-field-border, #7fb0d0);
        white-space: nowrap;
    }

    html body main.app-screen-frame {
        padding: .45rem !important;
        border-radius: .8rem !important;
        /* A tela media 100% da altura mas começa abaixo da barra do topo: o fim ficava fora do aparelho e a rolagem parava antes do último botão. */
        flex: 1 1 0% !important;
        height: auto !important;
        min-height: 0 !important;
    }

    /* Balão do suporte: só no Painel (nas telas de emissão e venda ele cobria botões e valores). */
    html:not([data-active-menu="painel"]) body #floatingSupportButton {
        display: none !important;
    }
    html body #floatingSupportButton {
        width: 2.6rem !important;
        height: 2.6rem !important;
        right: .6rem !important;
        bottom: .6rem !important;
    }

    /* ---------- Painel: um atalho só para venda (PDV/DAV); nomes inteiros ---------- */
    html body .op-quick-link[href="/frente-de-caixa"],
    html body .op-quick-link[href="/pdv"] {
        display: none !important;
    }
    html body .op-quick-link[href="/dav"] .op-quick-copy strong {
        font-size: 0 !important;
    }
    html body .op-quick-link[href="/dav"] .op-quick-copy strong::before {
        content: "PDV/DAV";
        font-size: .82rem;
    }
    html body .op-quick-link[href="/dav"] .op-quick-copy > span {
        font-size: 0 !important;
    }
    html body .op-quick-link[href="/dav"] .op-quick-copy > span::before {
        content: "Venda e NFC-e";
        font-size: .62rem;
    }
    html body .op-quick-link .op-quick-copy strong,
    html body .op-quick-link .op-quick-copy > span {
        white-space: normal !important;
        overflow: visible !important;
        text-overflow: clip !important;
        line-height: 1.15;
    }

    /* ---------- Telas de emissão (janela): fundo sólido, sem a tela de trás aparecendo ---------- */
    html[data-ui="crystal-tech"][data-crystal-theme] body main.app-screen-frame #modalNfse,
    html[data-ui="crystal-tech"][data-crystal-theme] body main.app-screen-frame #modalMdfe {
        background-color: var(--ct-canvas, #b8d4ea) !important;
        background-image: none !important;
        padding: 0 !important;
        align-items: stretch !important;
    }
    html[data-ui="crystal-tech"][data-crystal-theme] body main.app-screen-frame #modalNfse .nfse-modal-shell,
    html[data-ui="crystal-tech"][data-crystal-theme] body main.app-screen-frame #modalMdfe .mdfe-modal-shell {
        background-color: var(--ct-canvas, #b8d4ea) !important;
        background-image: none !important;
        border-radius: 0 !important;
        border: 0 !important;
        width: 100% !important;
        max-width: none !important;
        height: 100% !important;
        max-height: none !important;
        box-shadow: none !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
    }

    /* Painel: nomes compridos (Transportadoras...) cabem, e o balão não cobre o último atalho. */
    html body .op-quick-link .op-quick-copy strong {
        font-size: .74rem !important;
        letter-spacing: .01em !important;
    }
    html[data-active-menu="painel"] body main.app-screen-frame {
        padding-bottom: 4rem !important;
    }
    /* Cabeçalho das emissões: título em linha própria e legenda abaixo (antes o título quebrava em 3 a 5 linhas). */
    html[data-ui="crystal-tech"][data-crystal-theme] body main.app-screen-frame :is(#modalNfse, #modalMdfe) > div > header.module-page-hero,
    html[data-ui="crystal-tech"][data-crystal-theme] body main.app-screen-frame :is(#modalNfse, #modalMdfe) header.module-page-hero {
        flex-wrap: wrap !important;
        gap: .4rem .6rem !important;
        padding: .6rem .7rem !important;
    }
    html[data-ui="crystal-tech"][data-crystal-theme] body main.app-screen-frame :is(#modalNfse, #modalMdfe) header.module-page-hero h2,
    html[data-ui="crystal-tech"][data-crystal-theme] body main.app-screen-frame :is(#modalNfse, #modalMdfe) header.module-page-hero h3 {
        flex: 1 1 100% !important;
        font-size: .95rem !important;
        line-height: 1.15 !important;
    }

    /* Barra de ações: GRAVAR e PRÉVIA lado a lado, EMITIR em linha própria, sempre alinhados (no MDF-e estavam soltos à direita). */
    html[data-ui="crystal-tech"][data-crystal-theme] body main.app-screen-frame #mdfeActions,
    html[data-ui="crystal-tech"][data-crystal-theme] body main.app-screen-frame #nfseActions {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: .5rem !important;
        padding: .5rem !important;
    }
    html[data-ui="crystal-tech"][data-crystal-theme] body main.app-screen-frame #mdfeActions > *,
    html[data-ui="crystal-tech"][data-crystal-theme] body main.app-screen-frame #nfseActions > * {
        width: 100% !important;
        margin: 0 !important;
    }
    html[data-ui="crystal-tech"][data-crystal-theme] body main.app-screen-frame #mdfeSubmitButton,
    html[data-ui="crystal-tech"][data-crystal-theme] body main.app-screen-frame #nfseSubmitButton {
        grid-column: 1 / -1 !important;
    }
    /* ---------- Janelas pequenas (abrir caixa, pagamento, consulta...): caixa sólida sobre fundo escurecido ---------- */
    html[data-ui="crystal-tech"][data-crystal-theme] body div.fixed.inset-0:is([id$="Modal"], [id^="modal"]) {
        background-color: rgba(10, 28, 48, .55) !important;
        padding: .6rem !important;
    }
    html[data-ui="crystal-tech"][data-crystal-theme] body div.fixed.inset-0:is([id$="Modal"], [id^="modal"]) > div:first-child {
        background-color: var(--ct-container-solid, #eaf2f9) !important;
        background-image: none !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        max-height: calc(100dvh - 1.2rem);
        overflow-y: auto;
    }

    /* ---------- PDV/DAV no celular: um nome só e cabeçalho que cabe ---------- */
    html body #pdvViewport .pdv-mode-title {
        font-size: 0 !important;
    }
    html body #pdvViewport .pdv-mode-title::before {
        content: "PDV/DAV";
        font-size: 1.05rem;
        font-weight: 900;
    }
    html body #pdvViewport .pdv-brand-header {
        flex-wrap: wrap !important;
        height: auto !important;
        gap: .3rem .5rem !important;
    }
    html body #pdvViewport #terminalActiveItemBanner {
        position: static !important;
        flex: 1 1 100% !important;
        order: 3;
        font-size: .72rem !important;
        justify-content: center !important;
        text-align: center !important;
    }

    /* ---------- NF-e (página): título inteiro e legenda embaixo ---------- */
    html[data-ui="crystal-tech"][data-crystal-theme] body main.app-screen-frame header.nfe-form-header {
        flex-wrap: wrap !important;
        gap: .4rem .6rem !important;
        padding: .6rem .7rem !important;
    }
    html[data-ui="crystal-tech"][data-crystal-theme] body main.app-screen-frame header.nfe-form-header > div:first-child {
        flex: 1 1 100% !important;
        min-width: 0 !important;
    }
    html[data-ui="crystal-tech"][data-crystal-theme] body main.app-screen-frame header.nfe-form-header h2 {
        font-size: .95rem !important;
        line-height: 1.15 !important;
        width: auto !important;
    }
    /* ---------- PDV/DAV: um fluxo só, de cima para baixo (catálogo, cupom, pagamento); a página rola, nada se sobrepõe ---------- */
    html body:not(.sidebar-hidden) #pdvViewport,
    html body:not(.sidebar-hidden) #pdvViewport #pdvScaleStage,
    html body:not(.sidebar-hidden) #pdvViewport .pdv-monitor-container,
    html body:not(.sidebar-hidden) #pdvViewport .pdv-workspace {
        height: auto !important;
        max-height: none !important;
        min-height: 0 !important;
        flex: 0 0 auto !important;
        overflow: visible !important;
        transform: none !important;
        zoom: 1 !important;
    }
    html body:not(.sidebar-hidden) main.app-screen-frame:has(#pdvViewport) {
        overflow-y: auto !important;
        overflow-x: hidden !important;
    }
    html body:not(.sidebar-hidden) #pdvViewport .pdv-monitor-container {
        border-width: 4px !important;
        padding: .25rem !important;
        margin-bottom: .5rem !important;
    }
    html body:not(.sidebar-hidden) #pdvViewport .pdv-workspace {
        display: flex !important;
        flex-direction: column !important;
        gap: .6rem !important;
        padding: .4rem !important;
    }
    html body:not(.sidebar-hidden) #pdvViewport .pdv-workspace > * {
        flex: 0 0 auto !important;
        height: auto !important;
        max-height: none !important;
        min-height: 0 !important;
        width: 100% !important;
        grid-column: auto !important;
    }
    html body:not(.sidebar-hidden) #pdvViewport .commercial-product-grid {
        height: 19rem !important;
        max-height: 19rem !important;
        overflow-y: auto !important;
        overscroll-behavior: contain;
    }
    html body:not(.sidebar-hidden) #pdvViewport .pdv-receipt-panel,
    html body:not(.sidebar-hidden) #pdvViewport .pdv-receipt-column {
        height: auto !important;
        min-height: 12rem !important;
        max-height: none !important;
    }
    html body:not(.sidebar-hidden) #pdvViewport .pdv-checkout-panel {
        height: auto !important;
        overflow: visible !important;
    }
    html body:not(.sidebar-hidden) #pdvViewport .pdv-shortcuts-bar {
        display: none !important;
    }
    html body:not(.sidebar-hidden) #pdvViewport .commercial-product-grid {
        height: auto !important;
        max-height: 16rem !important;
        grid-auto-rows: min-content !important;
        align-content: start !important;
    }
    html body:not(.sidebar-hidden) #pdvViewport .commercial-product-grid > * {
        min-height: 0 !important;
        height: auto !important;
    }
    html body:not(.sidebar-hidden) #pdvViewport .pdv-checkout-footer {
        position: sticky !important;
        bottom: 0;
        z-index: 5;
    }
    html body:not(.sidebar-hidden) #pdvViewport .commercial-product-grid {
        flex: 0 0 auto !important;
    }
    html body:not(.sidebar-hidden) #pdvViewport .commercial-product-browser {
        padding-bottom: .6rem !important;
    }

    /* ---------- MDF-e: Motorista/Veículo em dupla e Transportadora abaixo, como os botões do rodapé ---------- */
    html body #modalMdfe .mdfe-inline-registers {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: .5rem !important;
        width: 100% !important;
    }
    html body #modalMdfe .mdfe-inline-registers > a {
        width: 100% !important;
        justify-content: center !important;
        text-align: center;
    }
    html body #modalMdfe .mdfe-inline-registers > a:nth-child(3) {
        grid-column: 1 / -1 !important;
    }
    /* Listas internas (notas de entrada): ao chegar no fim, a rolagem continua na tela, sem precisar achar a barrinha. */
    html body #modalMdfe .mdfe-nfe-list,
    html body #modalMdfe .mdfe-imported-list,
    html body #modalMdfe .mdfe-inserted-list {
        overscroll-behavior: auto !important;
    }
    /* ---------- PDV/DAV (ajustes do teste real) ---------- */
    /* Cabeçalho (PDV/DAV + caixa) fixo no topo enquanto a tela rola. */
    html body:not(.sidebar-hidden) #pdvViewport .pdv-brand-header {
        position: sticky !important;
        top: 0;
        z-index: 30;
    }
    /* Ao chegar no fim da lista de produtos / itens, a rolagem continua na tela. */
    html body:not(.sidebar-hidden) #pdvViewport .commercial-product-grid,
    html body:not(.sidebar-hidden) #pdvViewport .pdv-cart-surface {
        overscroll-behavior: auto !important;
    }
    /* Moldura do catálogo: borda única, sem sombra interna que desenhava uma segunda linha. */
    html body:not(.sidebar-hidden) #pdvViewport .commercial-product-browser,
    html body:not(.sidebar-hidden) #pdvViewport .commercial-product-grid {
        box-shadow: none !important;
        outline: none !important;
    }
    html body:not(.sidebar-hidden) #pdvViewport .commercial-product-grid {
        border: 0 !important;
        background: transparent !important;
    }

    /* Nome do cupom. */
    html body .cupom-pc { display: none !important; }
    html body .cupom-phone { display: inline !important; }

    /* Itens do cupom: campos numéricos na primeira linha e a descrição inteira embaixo. */
    html body:not(.sidebar-hidden) #pdvViewport .pdv-cart-surface {
        flex: 0 0 auto !important;
        height: auto !important;
        min-height: 8rem !important;
        max-height: 14.5rem !important;
        overflow-y: auto !important;
    }
    html body:not(.sidebar-hidden) #pdvViewport .pdv-cart-surface .pdv-cart-grid {
        display: grid !important;
        grid-template-columns: 2.5rem 3.1rem minmax(0, 1fr) 2.6rem 1.7rem 3.6rem 1.4rem !important;
        width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box !important;
        gap: .25rem !important;
        align-items: center !important;
    }
    html body:not(.sidebar-hidden) #pdvViewport .pdv-cart-surface .pdv-cart-head > :nth-child(2) {
        display: none !important;
    }
    html body:not(.sidebar-hidden) #pdvViewport .pdv-cart-surface .pdv-cart-row > :nth-child(1) { grid-column: 1; grid-row: 1; }
    html body:not(.sidebar-hidden) #pdvViewport .pdv-cart-surface .pdv-cart-row > :nth-child(3) { grid-column: 2; grid-row: 1; }
    html body:not(.sidebar-hidden) #pdvViewport .pdv-cart-surface .pdv-cart-row > :nth-child(4) { grid-column: 3; grid-row: 1; }
    html body:not(.sidebar-hidden) #pdvViewport .pdv-cart-surface .pdv-cart-row > :nth-child(5) { grid-column: 4; grid-row: 1; }
    html body:not(.sidebar-hidden) #pdvViewport .pdv-cart-surface .pdv-cart-row > :nth-child(6) { grid-column: 5; grid-row: 1; }
    html body:not(.sidebar-hidden) #pdvViewport .pdv-cart-surface .pdv-cart-row > :nth-child(7) { grid-column: 6; grid-row: 1; }
    html body:not(.sidebar-hidden) #pdvViewport .pdv-cart-surface .pdv-cart-row > :nth-child(8) { grid-column: 7; grid-row: 1; }
    html body:not(.sidebar-hidden) #pdvViewport .pdv-cart-surface .pdv-cart-row > :nth-child(2) { grid-column: 1 / -1; grid-row: 2; }
    html body:not(.sidebar-hidden) #pdvViewport .pdv-cart-surface .pdv-cart-row {
        padding: .3rem !important;
        margin-bottom: .4rem !important;
    }
    html body:not(.sidebar-hidden) #pdvViewport .pdv-cart-surface .pdv-cart-row .pdv-cart-name {
        font-size: .74rem !important;
    }
    html body:not(.sidebar-hidden) #pdvViewport .pdv-cart-surface .pdv-cart-row > * {
        min-width: 0 !important;
    }
    html body:not(.sidebar-hidden) #pdvViewport .pdv-cart-surface .pdv-cart-row .pdv-cart-input,
    html body:not(.sidebar-hidden) #pdvViewport .pdv-cart-surface .pdv-cart-row .pdv-cart-total {
        font-size: .68rem !important;
        padding-left: .2rem !important;
        padding-right: .2rem !important;
    }
    html body:not(.sidebar-hidden) #pdvViewport #terminalReceiptTapeList {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        overflow-x: hidden !important;
    }

    /* Atalho de teclado (Ctrl+F) não faz sentido no celular. */
    html body .pdv-close-cash-btn .pdv-kbd {
        display: none !important;
    }
    /* Nome da empresa um pouco mais abaixo, longe dos botões PDV/DAV e caixa. */
    html body:not(.sidebar-hidden) #pdvViewport #terminalActiveItemBanner {
        margin-top: .55rem !important;
    }
    /* Abrir/fechar caixa: texto digitado em azul-marinho (antes saía branco sobre campo claro). */
    html body #pdvAbrirCaixaModal :is(input, select, textarea),
    html body #pdvFecharCaixaModal :is(input:not([type="checkbox"]), select, textarea) {
        color: #111c2d !important;
        -webkit-text-fill-color: #111c2d !important;
        caret-color: #111c2d;
    }
    html body #pdvAbrirCaixaModal :is(input, textarea)::placeholder,
    html body #pdvFecharCaixaModal :is(input, textarea)::placeholder {
        color: #5b6b82 !important;
        -webkit-text-fill-color: #5b6b82 !important;
    }
    /* CPF/CNPJ na nota: no celular só números; a lista de clientes por nome não é usada. */
    html body #destClienteToggle {
        display: none !important;
    }

    /* Cupom: no celular o desconto se chama DESC. e os totais quebram em linhas limpas. */
    html body .desc-pc { display: none !important; }
    html body .desc-phone { display: inline !important; }
    html body:not(.sidebar-hidden) #pdvViewport .pdv-receipt-totals {
        display: flex !important;
        flex-wrap: wrap !important;
        align-items: baseline !important;
        justify-content: space-between !important;
        gap: .1rem .8rem !important;
    }
    html body:not(.sidebar-hidden) #pdvViewport .pdv-receipt-totals > div {
        display: inline-flex !important;
        margin: 0 !important;
        gap: .4rem !important;
        white-space: nowrap;
        border: 0 !important;
        padding-top: 0 !important;
    }
    html body:not(.sidebar-hidden) #pdvViewport .pdv-receipt-totals > div.hidden {
        display: none !important;
    }
    html body:not(.sidebar-hidden) #pdvViewport .pdv-receipt-totals-net {
        flex: 1 1 11rem;
        justify-content: space-between !important;
    }
    /* Catálogo: cartão com foto não estica o vizinho e a foto tem altura fixa. */
    html body:not(.sidebar-hidden) #pdvViewport .commercial-product-grid {
        align-items: start !important;
    }
    html body:not(.sidebar-hidden) #pdvViewport .commercial-product-tile.has-image {
        min-height: 0 !important;
    }
    html body:not(.sidebar-hidden) #pdvViewport .commercial-product-tile.has-image .commercial-product-img {
        height: 5.2rem !important;
        object-fit: cover !important;
    }

    /* Total do item: mesmo tamanho e mesmo acabamento dos outros campos da linha. */
    html body:not(.sidebar-hidden) #pdvViewport .pdv-cart-surface .pdv-cart-row .pdv-cart-total {
        display: flex !important;
        align-items: center !important;
        justify-content: flex-end !important;
        align-self: center !important;
        height: 1.5rem !important;
        min-height: 0 !important;
        padding: 0 .2rem !important;
        border: 1px solid #94a3b8 !important;
        border-radius: .4rem !important;
        background: transparent !important;
        color: #1e293b !important;
        -webkit-text-fill-color: #1e293b !important;
        font-size: .62rem !important;
        font-weight: 800 !important;
        white-space: nowrap;
    }
    /* Nomes das colunas centralizados sobre cada campo (mesma margem lateral da linha do item). */
    html body:not(.sidebar-hidden) #pdvViewport .pdv-cart-surface .pdv-cart-head {
        padding-left: calc(.3rem + 1px) !important;
        padding-right: calc(.3rem + 1px) !important;
    }
    html body:not(.sidebar-hidden) #pdvViewport .pdv-cart-surface .pdv-cart-head > * {
        text-align: center !important;
    }

    /* Janela aberta: o dedo rola só o conteúdo da janela, nunca a tela do fundo. */
    html body:has(div.fixed.inset-0:not(.hidden)) main.app-screen-frame,
    html body:not(.sidebar-hidden):has(#pdvViewport):has(div.fixed.inset-0:not(.hidden)) main.app-screen-frame:has(#pdvViewport),
    html body:has(div.fixed.inset-0:not(.hidden)) {
        overflow: hidden !important;
    }
    html body div.fixed.inset-0 {
        overscroll-behavior: contain;
        touch-action: pan-y;
    }

    /* Janela final da venda: campos de WhatsApp/e-mail legíveis (texto azul-marinho, tamanho de toque). */
    html body #nfceSuccessModal :is(input, textarea) {
        color: #111c2d !important;
        -webkit-text-fill-color: #111c2d !important;
        caret-color: #111c2d;
        font-size: 1.05rem !important;
        min-height: 2.9rem;
    }
    html body #nfceSuccessModal :is(input, textarea)::placeholder {
        color: #5b6b82 !important;
        -webkit-text-fill-color: #5b6b82 !important;
    }

    /* O tema escuro desenha em todo <aside> a moldura decorativa do menu lateral (aside::before); o catálogo do PDV/DAV
       também é um <aside> e ganhava uma segunda linha cinza, menor que o quadro, cortando os cartões. */
    html body .commercial-product-browser::before,
    html body .commercial-product-browser::after,
    html body .pdv-selection-panel::before,
    html body .pdv-selection-panel::after {
        content: none !important;
        display: none !important;
    }

    /* Avisos (OK / confirmar) por cima de outra janela: caixa opaca, sem enxergar a janela de trás. */
    html body #pdvDialogModal {
        background-color: rgba(10, 28, 48, .6) !important;
    }
    html body #pdvDialogModal #pdvDialogCard {
        background-image: none !important;
        background-color: var(--ct-container-solid, #14181f) !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
    }

    /* ---------- NF-e no celular ---------- */
    /* Título em amarelo (Obsidian). */
    html[data-ui="crystal-tech"][data-crystal-theme="obsidian"] body.nfe-create-screen #nfeForm header.nfe-form-header h2 {
        color: #facc15 !important;
        -webkit-text-fill-color: #facc15 !important;
    }

    /* Destinatário: NF-e nº e CADASTRAR NOVO CLIENTE lado a lado; os demais campos na largura toda. */
    body.nfe-create-screen #nfeForm .nfe-dest-fields {
        display: flex !important;
        flex-wrap: wrap !important;
        align-items: flex-end !important;
        gap: .6rem !important;
    }
    body.nfe-create-screen #nfeForm .nfe-dest-fields > .nfe-number-field {
        order: 1;
        flex: 0 0 7.5rem !important;
        width: 7.5rem !important;
        min-width: 0;
    }
    body.nfe-create-screen #nfeForm .nfe-dest-fields > .nfe-customer-field {
        display: contents !important;
    }
    body.nfe-create-screen #nfeForm .nfe-dest-fields > .nfe-customer-field > .nfe-register-customer {
        order: 2;
        flex: 1 1 0 !important;
        width: auto !important;
        min-width: 0;
        margin: 0 !important;
        align-self: flex-end !important;
        height: 40px !important;
        min-height: 40px !important;
        padding-top: 0 !important;
        padding-bottom: 0 !important;
        transform: none !important;
        font-size: .7rem !important;
        white-space: normal;
        line-height: 1.1;
    }
    html body.nfe-create-screen #nfeForm .nfe-dest-fields > .nfe-customer-field > .nfe-register-customer:not(#j6-sz-a):not(#j6-sz-b) {
        margin: 0 !important;
    }
    body.nfe-create-screen #nfeForm .nfe-dest-fields > .nfe-customer-field > :not(.nfe-register-customer) {
        order: 3;
        flex: 1 1 100% !important;
        width: 100% !important;
        max-width: none !important;
    }
    body.nfe-create-screen #nfeForm .nfe-dest-fields > div:not(.nfe-number-field):not(.nfe-customer-field) {
        order: 4;
        flex: 1 1 100% !important;
        width: 100% !important;
        max-width: none !important;
    }
    body.nfe-create-screen #nfeForm .nfe-dest-fields > div:not(.nfe-number-field):not(.nfe-customer-field) :is(input, select) {
        width: 100% !important;
        max-width: none !important;
    }

    /* Produtos: a lista cresce com os itens (no PC ela é uma área de altura fixa), botões menores. */
    body.nfe-create-screen #nfeForm .nfe-products-compact {
        display: block !important;
        flex: none !important;
        min-height: 0 !important;
        overflow: visible !important;
    }
    body.nfe-create-screen #nfeForm .nfe-products-compact > .overflow-x-auto {
        display: block !important;
        overflow: visible !important;
    }
    body.nfe-create-screen #nfeForm .nfe-products-compact .overflow-x-auto > div,
    body.nfe-create-screen #nfeForm .nfe-products-compact .nfe-products-track {
        height: auto !important;
        display: block !important;
        min-width: 0 !important;
    }
    body.nfe-create-screen #nfeForm .nfe-products-compact #items {
        display: flex !important;
        flex-direction: column !important;
        gap: .6rem !important;
        height: auto !important;
        max-height: none !important;
        overflow: visible !important;
        padding-right: 0 !important;
    }
    body.nfe-create-screen #nfeForm .nfe-products-compact .nfe-products-track > .product-head {
        display: none !important;
    }
    body.nfe-create-screen #nfeForm #clearNfeNote {
        padding: .3rem .7rem !important;
        font-size: .68rem !important;
        min-height: 0 !important;
        height: auto !important;
        width: auto !important;
        flex: 0 0 auto !important;
    }
    body.nfe-create-screen #nfeForm #addItem {
        display: inline-flex !important;
        align-items: center;
        width: auto !important;
        margin: .6rem 0 0 0 !important;
        padding: .4rem .9rem !important;
        min-height: 0 !important;
        font-size: .72rem !important;
    }

    /* Item: campos em linhas com o nome de cada campo em cima, e o produto embaixo. */
    body.nfe-create-screen #nfeForm .nfe-compact-grid .nfe-item.product-grid {
        display: grid !important;
        grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
        column-gap: .35rem !important;
        row-gap: .15rem !important;
        align-items: end !important;
        padding: .5rem !important;
        overflow: visible !important;
    }
    body.nfe-create-screen #nfeForm .nfe-compact-grid .nfe-item .nfe-row-head-fiscal {
        display: contents !important;
    }
    body.nfe-create-screen #nfeForm .nfe-compact-grid .nfe-item .nfe-row-head-fiscal > span {
        font-size: .58rem !important;
        padding: 0 .1rem !important;
        white-space: normal;
        line-height: 1.05;
    }
    body.nfe-create-screen #nfeForm:not(.is-fiscal) .nfe-compact-grid .nfe-item .nfe-row-head-fiscal > span:is(:nth-child(2), :nth-child(n+8)) {
        display: none !important;
    }
    body.nfe-create-screen #nfeForm .nfe-compact-grid .nfe-item .unidade {
        display: none !important;
    }
    body.nfe-create-screen #nfeForm .nfe-compact-grid .nfe-item :is(input, select, .subtotal, .qty-control) {
        min-width: 0;
    }
    body.nfe-create-screen #nfeForm .nfe-compact-grid .nfe-item > .remove {
        justify-self: end;
        width: 2.4rem;
    }
    /* Sem regime fiscal (Simples): Código, CFOP, CSOSN, Qtd. / Valor unit., Valor total / Produto */
    body.nfe-create-screen #nfeForm:not(.is-fiscal) .nfe-item .nfe-row-head-fiscal > span:nth-child(1) { grid-column: 1; grid-row: 1; }
    body.nfe-create-screen #nfeForm:not(.is-fiscal) .nfe-item .nfe-row-head-fiscal > span:nth-child(3) { grid-column: 2; grid-row: 1; }
    body.nfe-create-screen #nfeForm:not(.is-fiscal) .nfe-item .nfe-row-head-fiscal > span:nth-child(4) { grid-column: 3; grid-row: 1; }
    body.nfe-create-screen #nfeForm:not(.is-fiscal) .nfe-item .nfe-row-head-fiscal > span:nth-child(5) { grid-column: 4; grid-row: 1; }
    body.nfe-create-screen #nfeForm:not(.is-fiscal) .nfe-item .nfe-row-head-fiscal > span:nth-child(6) { grid-column: 1; grid-row: 3; }
    body.nfe-create-screen #nfeForm:not(.is-fiscal) .nfe-item .nfe-row-head-fiscal > span:nth-child(7) { grid-column: 2 / span 2; grid-row: 3; }
    body.nfe-create-screen #nfeForm:not(.is-fiscal) .nfe-item > .codigo { grid-column: 1; grid-row: 2; }
    body.nfe-create-screen #nfeForm:not(.is-fiscal) .nfe-item > .cfop { grid-column: 2; grid-row: 2; }
    body.nfe-create-screen #nfeForm:not(.is-fiscal) .nfe-item > .csosn { grid-column: 3; grid-row: 2; }
    body.nfe-create-screen #nfeForm:not(.is-fiscal) .nfe-item > .qty-control { grid-column: 4; grid-row: 2; }
    body.nfe-create-screen #nfeForm:not(.is-fiscal) .nfe-item > .preco { grid-column: 1; grid-row: 4; }
    body.nfe-create-screen #nfeForm:not(.is-fiscal) .nfe-item > .subtotal { grid-column: 2 / span 2; grid-row: 4; align-self: center; text-align: right; }
    body.nfe-create-screen #nfeForm:not(.is-fiscal) .nfe-item > .remove { grid-column: 4; grid-row: 4; }
    body.nfe-create-screen #nfeForm:not(.is-fiscal) .nfe-item > .nfe-search-combo,
    body.nfe-create-screen #nfeForm:not(.is-fiscal) .nfe-item > select.product { grid-column: 1 / -1; grid-row: 5; margin-top: .25rem; }
    /* Regime normal (fiscal): 4 colunas, impostos em linhas próprias */
    body.nfe-create-screen #nfeForm.is-fiscal .nfe-item .nfe-row-head-fiscal > span:nth-child(1) { grid-column: 1; grid-row: 1; }
    body.nfe-create-screen #nfeForm.is-fiscal .nfe-item .nfe-row-head-fiscal > span:nth-child(2) { grid-column: 2; grid-row: 1; }
    body.nfe-create-screen #nfeForm.is-fiscal .nfe-item .nfe-row-head-fiscal > span:nth-child(3) { grid-column: 3; grid-row: 1; }
    body.nfe-create-screen #nfeForm.is-fiscal .nfe-item .nfe-row-head-fiscal > span:nth-child(4) { grid-column: 4; grid-row: 1; }
    body.nfe-create-screen #nfeForm.is-fiscal .nfe-item .nfe-row-head-fiscal > span:nth-child(5) { grid-column: 1; grid-row: 3; }
    body.nfe-create-screen #nfeForm.is-fiscal .nfe-item .nfe-row-head-fiscal > span:nth-child(6) { grid-column: 2; grid-row: 3; }
    body.nfe-create-screen #nfeForm.is-fiscal .nfe-item .nfe-row-head-fiscal > span:nth-child(7) { grid-column: 3; grid-row: 3; }
    body.nfe-create-screen #nfeForm.is-fiscal .nfe-item .nfe-row-head-fiscal > span:nth-child(8) { grid-column: 1; grid-row: 5; }
    body.nfe-create-screen #nfeForm.is-fiscal .nfe-item .nfe-row-head-fiscal > span:nth-child(9) { grid-column: 2; grid-row: 5; }
    body.nfe-create-screen #nfeForm.is-fiscal .nfe-item .nfe-row-head-fiscal > span:nth-child(10) { grid-column: 3; grid-row: 5; }
    body.nfe-create-screen #nfeForm.is-fiscal .nfe-item .nfe-row-head-fiscal > span:nth-child(11) { grid-column: 1; grid-row: 7; }
    body.nfe-create-screen #nfeForm.is-fiscal .nfe-item .nfe-row-head-fiscal > span:nth-child(12) { grid-column: 2; grid-row: 7; }
    body.nfe-create-screen #nfeForm.is-fiscal .nfe-item .nfe-row-head-fiscal > span:nth-child(13) { grid-column: 3; grid-row: 7; }
    body.nfe-create-screen #nfeForm.is-fiscal .nfe-item .nfe-row-head-fiscal > span:nth-child(14) { display: none !important; }
    body.nfe-create-screen #nfeForm.is-fiscal .nfe-item > .codigo { grid-column: 1; grid-row: 2; }
    body.nfe-create-screen #nfeForm.is-fiscal .nfe-item > .fi-ncm { grid-column: 2; grid-row: 2; }
    body.nfe-create-screen #nfeForm.is-fiscal .nfe-item > .cfop { grid-column: 3; grid-row: 2; }
    body.nfe-create-screen #nfeForm.is-fiscal .nfe-item > .csosn,
    body.nfe-create-screen #nfeForm.is-fiscal .nfe-item > .fi-cst-icms { grid-column: 4; grid-row: 2; }
    body.nfe-create-screen #nfeForm.is-fiscal .nfe-item > .qty-control { grid-column: 1; grid-row: 4; }
    body.nfe-create-screen #nfeForm.is-fiscal .nfe-item > .preco { grid-column: 2; grid-row: 4; }
    body.nfe-create-screen #nfeForm.is-fiscal .nfe-item > .subtotal { grid-column: 3; grid-row: 4; align-self: center; text-align: right; }
    body.nfe-create-screen #nfeForm.is-fiscal .nfe-item > .remove { grid-column: 4; grid-row: 4; }
    body.nfe-create-screen #nfeForm.is-fiscal .nfe-item .nfe-fiscal-line > label:nth-child(1) { grid-column: 1; grid-row: 6; }
    body.nfe-create-screen #nfeForm.is-fiscal .nfe-item .nfe-fiscal-line > label:nth-child(2) { grid-column: 2; grid-row: 6; }
    body.nfe-create-screen #nfeForm.is-fiscal .nfe-item .nfe-fiscal-line > label:nth-child(3) { grid-column: 3; grid-row: 6; }
    body.nfe-create-screen #nfeForm.is-fiscal .nfe-item .nfe-fiscal-line > label:nth-child(4) { grid-column: 1; grid-row: 8; }
    body.nfe-create-screen #nfeForm.is-fiscal .nfe-item .nfe-fiscal-line > label:nth-child(5) { grid-column: 2; grid-row: 8; }
    body.nfe-create-screen #nfeForm.is-fiscal .nfe-item .nfe-fiscal-line > label:nth-child(6) { grid-column: 3; grid-row: 8; }
    body.nfe-create-screen #nfeForm.is-fiscal .nfe-item > .nfe-search-combo,
    body.nfe-create-screen #nfeForm.is-fiscal .nfe-item > select.product { grid-column: 1 / -1; grid-row: 9; margin-top: .25rem; }
    html body.nfe-create-screen #nfeForm .nfe-products-heading #clearNfeNote.nfe-clear-note {
        height: 1.9rem !important;
        min-height: 0 !important;
        padding: 0 .8rem !important;
        font-size: .62rem !important;
        letter-spacing: .03em !important;
        width: auto !important;
        flex: 0 0 auto !important;
    }
    html body.nfe-create-screen #nfeForm .nfe-products-compact #addItem {
        height: 1.9rem !important;
        min-height: 0 !important;
        padding: 0 .8rem !important;
        font-size: .64rem !important;
        letter-spacing: .03em !important;
        width: auto !important;
        flex: 0 0 auto !important;
    }
    html body.nfe-create-screen #nfeForm.is-fiscal .nfe-compact-grid .nfe-item.product-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
        column-gap: .35rem !important;
        row-gap: .15rem !important;
        align-items: end !important;
    }
    html body.nfe-create-screen #nfeForm.is-fiscal .nfe-compact-grid .nfe-item .nfe-row-head-fiscal {
        display: contents !important;
    }

    /* ---------- NF-e (Simples) no celular: item como no DAV, uma linha de campos pequenos e o produto embaixo ---------- */
    html body.nfe-create-screen #nfeForm:not(.is-fiscal) .nfe-products-compact {
        padding: .45rem !important;
    }
    /* nomes das colunas uma vez só, no topo da lista (como o cabeçalho do cupom do DAV) */
    html body.nfe-create-screen #nfeForm:not(.is-fiscal) .nfe-products-compact .nfe-products-track > .product-head {
        display: grid !important;
        grid-template-columns: 2.5rem 2.6rem 2.6rem 3.1rem minmax(0, 1fr) 3.3rem 1.3rem !important;
        column-gap: .2rem !important;
        padding: 0 .3rem .15rem !important;
        font-size: .55rem !important;
        letter-spacing: 0 !important;
        text-align: center;
    }
    html body.nfe-create-screen #nfeForm:not(.is-fiscal) .nfe-products-compact .product-head > span {
        text-align: center;
        padding: 0 !important;
        white-space: nowrap;
    }
    html body.nfe-create-screen #nfeForm:not(.is-fiscal) .nfe-products-compact .product-head > :is(:nth-child(2), :nth-child(7)) {
        display: none !important;
    }
    html body.nfe-create-screen #nfeForm:not(.is-fiscal) .nfe-compact-grid .nfe-item .nfe-row-head-fiscal {
        display: none !important;
    }
    html body.nfe-create-screen #nfeForm:not(.is-fiscal) .nfe-compact-grid .nfe-item.product-grid {
        grid-template-columns: 2.5rem 2.6rem 2.6rem 3.1rem minmax(0, 1fr) 3.3rem 1.3rem !important;
        column-gap: .2rem !important;
        row-gap: .3rem !important;
        padding: .3rem !important;
        align-items: center !important;
    }
    html body.nfe-create-screen #nfeForm:not(.is-fiscal) .nfe-item > .codigo { grid-column: 1; grid-row: 1; }
    html body.nfe-create-screen #nfeForm:not(.is-fiscal) .nfe-item > .cfop { grid-column: 2; grid-row: 1; }
    html body.nfe-create-screen #nfeForm:not(.is-fiscal) .nfe-item > .csosn { grid-column: 3; grid-row: 1; }
    html body.nfe-create-screen #nfeForm:not(.is-fiscal) .nfe-item > .qty-control { grid-column: 4; grid-row: 1; }
    html body.nfe-create-screen #nfeForm:not(.is-fiscal) .nfe-item > .preco { grid-column: 5; grid-row: 1; }
    html body.nfe-create-screen #nfeForm:not(.is-fiscal) .nfe-item > .subtotal { grid-column: 6; grid-row: 1; align-self: center; }
    html body.nfe-create-screen #nfeForm:not(.is-fiscal) .nfe-item > .remove { grid-column: 7; grid-row: 1; justify-self: stretch; width: auto; }
    html body.nfe-create-screen #nfeForm:not(.is-fiscal) .nfe-item > .nfe-search-combo,
    html body.nfe-create-screen #nfeForm:not(.is-fiscal) .nfe-item > select.product { grid-column: 1 / -1; grid-row: 2; margin-top: 0; }
    /* campos pequenos e bem ajustados */
    html body.nfe-create-screen #nfeForm:not(.is-fiscal) .nfe-compact-grid .nfe-item :is(.codigo, .cfop, .csosn, .preco):not(#j6-sz-a):not(#j6-sz-b):not(#j6-sz-c):not(#j6-sz-d),
    html body.nfe-create-screen #nfeForm:not(.is-fiscal) .nfe-compact-grid .nfe-item .qty-control .qtd:not(#j6-sz-a):not(#j6-sz-b):not(#j6-sz-c):not(#j6-sz-d) {
        height: 1.55rem !important;
        min-height: 0 !important;
        padding: 0 .15rem !important;
        font-size: .68rem !important;
        text-align: center !important;
        letter-spacing: 0 !important;
        border-radius: .4rem !important;
    }
    html body.nfe-create-screen #nfeForm:not(.is-fiscal) .nfe-compact-grid .nfe-item select.csosn:not(#j6-sz-a):not(#j6-sz-b):not(#j6-sz-c):not(#j6-sz-d) {
        -webkit-appearance: none !important;
        appearance: none !important;
        background-image: none !important;
        text-align-last: center;
    }
    html body.nfe-create-screen #nfeForm:not(.is-fiscal) .nfe-compact-grid .nfe-item .preco:not(#j6-sz-a):not(#j6-sz-b):not(#j6-sz-c):not(#j6-sz-d) {
        text-align: right !important;
        padding-right: .25rem !important;
    }
    html body.nfe-create-screen #nfeForm:not(.is-fiscal) .nfe-compact-grid .nfe-item .qty-control:not(#j6-sz-a):not(#j6-sz-b):not(#j6-sz-c):not(#j6-sz-d) {
        height: 1.55rem !important;
        min-height: 0 !important;
    }
    html body.nfe-create-screen #nfeForm:not(.is-fiscal) .nfe-compact-grid .nfe-item .qty-control .qtd:not(#j6-sz-a):not(#j6-sz-b):not(#j6-sz-c):not(#j6-sz-d) {
        padding-right: .9rem !important;
        text-align: left !important;
        padding-left: .25rem !important;
    }
    html body.nfe-create-screen #nfeForm:not(.is-fiscal) .nfe-compact-grid .nfe-item .qty-control button {
        width: .85rem !important;
        font-size: .5rem !important;
    }
    html body.nfe-create-screen #nfeForm:not(.is-fiscal) .nfe-compact-grid .nfe-item > .subtotal {
        height: 1.55rem;
        display: flex;
        align-items: center;
        justify-content: flex-end;
        padding: 0 .2rem !important;
        font-size: .6rem !important;
        letter-spacing: -.02em;
    }
    html body.nfe-create-screen #nfeForm:not(.is-fiscal) .nfe-compact-grid .nfe-item > .remove {
        height: 1.55rem !important;
        min-height: 0 !important;
        padding: 0 !important;
        font-size: .7rem !important;
    }
    html body.nfe-create-screen #nfeForm:not(.is-fiscal) .nfe-compact-grid .nfe-item .nfe-search-combo :is(input, select, .nfe-input):not(#j6-sz-a):not(#j6-sz-b):not(#j6-sz-c):not(#j6-sz-d) {
        height: 1.8rem !important;
        min-height: 0 !important;
        font-size: .72rem !important;
    }
    html body.nfe-create-screen #nfeForm:not(.is-fiscal) .nfe-compact-grid .nfe-item > .subtotal:not(#j6-st-a):not(#j6-st-b):not(#j6-st-c):not(#j6-st-d):not(#j6-st-e),
    html body.nfe-create-screen #nfeForm:not(.is-fiscal) .nfe-item > .subtotal:not(#j6-st-a):not(#j6-st-b):not(#j6-st-c):not(#j6-st-d):not(#j6-st-e) {
        display: flex !important;
        align-items: center !important;
        justify-content: flex-end !important;
        height: 1.55rem !important;
        min-height: 0 !important;
        padding: 0 .2rem !important;
        font-size: .6rem !important;
        letter-spacing: -.02em !important;
        white-space: nowrap;
        overflow: hidden;
    }
    html body.nfe-create-screen #nfeForm:not(.is-fiscal) .nfe-item > .remove:not(#j6-st-a):not(#j6-st-b):not(#j6-st-c):not(#j6-st-d):not(#j6-st-e),
    html body.nfe-create-screen #nfeForm:not(.is-fiscal) .nfe-item > .nfe-remove-item:not(#j6-st-a):not(#j6-st-b):not(#j6-st-c):not(#j6-st-d):not(#j6-st-e) {
        height: 1.55rem !important;
        min-height: 0 !important;
        width: 100% !important;
        padding: 0 !important;
        font-size: .7rem !important;
        line-height: 1 !important;
    }
    html body.nfe-create-screen #nfeForm:not(.is-fiscal) .nfe-products-compact .product-head > span {
        justify-content: center !important;
        font-size: .52rem !important;
        letter-spacing: 0 !important;
        overflow: hidden;
    }
    html body.nfe-create-screen #nfeForm:not(.is-fiscal) .nfe-products-compact .product-head > span:nth-child(8) {
        font-size: 0 !important;
    }
    html body.nfe-create-screen #nfeForm:not(.is-fiscal) .nfe-products-compact .product-head > span:nth-child(8)::before {
        content: "Total";
        font-size: .52rem;
    }

    /* ---------- NF-e fiscal (regime Normal ou devolucao) no celular: mesmos campos pequenos do DAV ----------
       6 colunas iguais: linha 1 nomes, linha 2 Codigo/NCM/CFOP/CST/Qtd./Valor, linha 3 produto + total + X,
       linhas 4 e 5 impostos (base, aliquota e valor de ICMS e IPI). */
    html body.nfe-create-screen #nfeForm.is-fiscal .nfe-compact-grid .nfe-item.product-grid {
        grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
        column-gap: .2rem !important;
        row-gap: .12rem !important;
        padding: .3rem !important;
        align-items: end !important;
    }
    html body.nfe-create-screen #nfeForm.is-fiscal .nfe-compact-grid .nfe-item .nfe-row-head-fiscal > span {
        font-size: .52rem !important;
        padding: 0 !important;
        text-align: center;
        white-space: nowrap;
        letter-spacing: 0 !important;
    }
    html body.nfe-create-screen #nfeForm.is-fiscal .nfe-item .nfe-row-head-fiscal > span:nth-child(1) { grid-column: 1; grid-row: 1; }
    html body.nfe-create-screen #nfeForm.is-fiscal .nfe-item .nfe-row-head-fiscal > span:nth-child(2) { grid-column: 2; grid-row: 1; }
    html body.nfe-create-screen #nfeForm.is-fiscal .nfe-item .nfe-row-head-fiscal > span:nth-child(3) { grid-column: 3; grid-row: 1; }
    html body.nfe-create-screen #nfeForm.is-fiscal .nfe-item .nfe-row-head-fiscal > span:nth-child(4) { grid-column: 4; grid-row: 1; }
    html body.nfe-create-screen #nfeForm.is-fiscal .nfe-item .nfe-row-head-fiscal > span:nth-child(5) { grid-column: 5; grid-row: 1; }
    html body.nfe-create-screen #nfeForm.is-fiscal .nfe-item .nfe-row-head-fiscal > span:nth-child(6) { grid-column: 6; grid-row: 1; }
    html body.nfe-create-screen #nfeForm.is-fiscal .nfe-item .nfe-row-head-fiscal > span:is(:nth-child(7), :nth-child(14)) { display: none !important; }
    html body.nfe-create-screen #nfeForm.is-fiscal .nfe-item .nfe-row-head-fiscal > span:nth-child(8) { grid-column: 1; grid-row: 4; }
    html body.nfe-create-screen #nfeForm.is-fiscal .nfe-item .nfe-row-head-fiscal > span:nth-child(9) { grid-column: 2; grid-row: 4; }
    html body.nfe-create-screen #nfeForm.is-fiscal .nfe-item .nfe-row-head-fiscal > span:nth-child(10) { grid-column: 3; grid-row: 4; }
    html body.nfe-create-screen #nfeForm.is-fiscal .nfe-item .nfe-row-head-fiscal > span:nth-child(11) { grid-column: 4; grid-row: 4; }
    html body.nfe-create-screen #nfeForm.is-fiscal .nfe-item .nfe-row-head-fiscal > span:nth-child(12) { grid-column: 5; grid-row: 4; }
    html body.nfe-create-screen #nfeForm.is-fiscal .nfe-item .nfe-row-head-fiscal > span:nth-child(13) { grid-column: 6; grid-row: 4; }
    html body.nfe-create-screen #nfeForm.is-fiscal .nfe-item > .codigo { grid-column: 1; grid-row: 2; }
    html body.nfe-create-screen #nfeForm.is-fiscal .nfe-item > .fi-ncm { grid-column: 2; grid-row: 2; }
    html body.nfe-create-screen #nfeForm.is-fiscal .nfe-item > .cfop { grid-column: 3; grid-row: 2; }
    html body.nfe-create-screen #nfeForm.is-fiscal .nfe-item > :is(.csosn, .fi-cst-icms) { grid-column: 4; grid-row: 2; }
    html body.nfe-create-screen #nfeForm.is-fiscal .nfe-item > .qty-control { grid-column: 5; grid-row: 2; }
    html body.nfe-create-screen #nfeForm.is-fiscal .nfe-item > .preco { grid-column: 6; grid-row: 2; }
    html body.nfe-create-screen #nfeForm.is-fiscal .nfe-item > .nfe-search-combo,
    html body.nfe-create-screen #nfeForm.is-fiscal .nfe-item > select.product { grid-column: 1 / span 4; grid-row: 3; margin-top: 0; }
    html body.nfe-create-screen #nfeForm.is-fiscal .nfe-item > .subtotal { grid-column: 5; grid-row: 3; align-self: center; }
    html body.nfe-create-screen #nfeForm.is-fiscal .nfe-item > .remove { grid-column: 6; grid-row: 3; justify-self: stretch; width: auto; }
    html body.nfe-create-screen #nfeForm.is-fiscal .nfe-item .nfe-fiscal-line > label:nth-child(1) { grid-column: 1; grid-row: 5; }
    html body.nfe-create-screen #nfeForm.is-fiscal .nfe-item .nfe-fiscal-line > label:nth-child(2) { grid-column: 2; grid-row: 5; }
    html body.nfe-create-screen #nfeForm.is-fiscal .nfe-item .nfe-fiscal-line > label:nth-child(3) { grid-column: 3; grid-row: 5; }
    html body.nfe-create-screen #nfeForm.is-fiscal .nfe-item .nfe-fiscal-line > label:nth-child(4) { grid-column: 4; grid-row: 5; }
    html body.nfe-create-screen #nfeForm.is-fiscal .nfe-item .nfe-fiscal-line > label:nth-child(5) { grid-column: 5; grid-row: 5; }
    html body.nfe-create-screen #nfeForm.is-fiscal .nfe-item .nfe-fiscal-line > label:nth-child(6) { grid-column: 6; grid-row: 5; }
    /* campos pequenos */
    html body.nfe-create-screen #nfeForm.is-fiscal .nfe-compact-grid .nfe-item :is(.codigo, .cfop, .csosn, .fi-cst-icms, .fi-ncm, .preco, .fi-base-icms, .fi-aliq-icms, .fi-valor-icms, .fi-base-ipi, .fi-aliq-ipi, .fi-valor-ipi):not(#j6-sz-a):not(#j6-sz-b),
    html body.nfe-create-screen #nfeForm.is-fiscal .nfe-compact-grid .nfe-item .qty-control .qtd:not(#j6-sz-a):not(#j6-sz-b) {
        height: 1.55rem !important;
        min-height: 0 !important;
        padding: 0 .12rem !important;
        font-size: .64rem !important;
        letter-spacing: 0 !important;
        border-radius: .4rem !important;
        text-align: center !important;
    }
    html body.nfe-create-screen #nfeForm.is-fiscal .nfe-compact-grid .nfe-item :is(.preco, .fi-base-icms, .fi-valor-icms, .fi-base-ipi, .fi-valor-ipi, .fi-aliq-icms, .fi-aliq-ipi):not(#j6-sz-a):not(#j6-sz-b) {
        text-align: right !important;
        padding-right: .2rem !important;
    }
    html body.nfe-create-screen #nfeForm.is-fiscal .nfe-compact-grid .nfe-item .qty-control:not(#j6-sz-a):not(#j6-sz-b) { height: 1.55rem !important; min-height: 0 !important; }
    html body.nfe-create-screen #nfeForm.is-fiscal .nfe-compact-grid .nfe-item .qty-control .qtd:not(#j6-sz-a):not(#j6-sz-b) {
        text-align: left !important;
        padding-left: .2rem !important;
        padding-right: .85rem !important;
    }
    html body.nfe-create-screen #nfeForm.is-fiscal .nfe-compact-grid .nfe-item .qty-control button { width: .8rem !important; font-size: .5rem !important; }
    html body.nfe-create-screen #nfeForm.is-fiscal .nfe-compact-grid .nfe-item :is(select.csosn, select.fi-cst-icms):not(#j6-sz-a):not(#j6-sz-b) {
        -webkit-appearance: none !important;
        appearance: none !important;
        background-image: none !important;
        text-align-last: center;
    }
    html body.nfe-create-screen #nfeForm.is-fiscal .nfe-compact-grid .nfe-item > .subtotal {
        height: 1.55rem;
        min-height: 0 !important;
        padding: 0 .1rem !important;
        font-size: .52rem !important;
        letter-spacing: -.02em;
    }
    html body.nfe-create-screen #nfeForm.is-fiscal .nfe-compact-grid .nfe-item > .remove {
        height: 1.55rem !important;
        min-height: 0 !important;
        padding: 0 !important;
        font-size: .7rem !important;
    }
    html body.nfe-create-screen #nfeForm.is-fiscal .nfe-compact-grid .nfe-item .nfe-search-combo :is(input, select, .nfe-input):not(#j6-sz-a):not(#j6-sz-b) {
        height: 1.8rem !important;
        min-height: 0 !important;
        font-size: .72rem !important;
    }

    /* ---------- NF-e: botoes do final como os do PDV/DAV (Gravar ao lado de Previa, Emitir/Transmitir sozinho embaixo) ---------- */
    html body.nfe-create-screen #nfeForm #nfeFiscalActions {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: .5rem !important;
        width: 100%;
    }
    html body.nfe-create-screen #nfeForm #nfeFiscalActions > button {
        width: 100% !important;
        min-width: 0;
        height: 2.75rem !important;
        min-height: 0 !important;
        padding: 0 .5rem !important;
        margin: 0 !important;
        font-size: .78rem !important;
        font-weight: 900 !important;
        letter-spacing: .03em;
        text-transform: uppercase;
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        gap: .4rem;
        white-space: nowrap;
    }
    html body.nfe-create-screen #nfeForm #nfeFiscalActions > button > i { margin: 0 !important; }
    html body.nfe-create-screen #nfeForm #nfeFiscalActions > button[type="submit"] {
        grid-column: 1 / -1;
    }

    /* NF-e: o botao de tela cheia nao serve no celular e travava a tela. */
    html body.nfe-create-screen #nfeExpandBtn { display: none !important; }
}
