/* V6.7.2 — Componentes mobile partilhados entre Categorias e Regras. */
@media(max-width:820px){
  /* Ritmo vertical comum */
  :is(.gf-cat-mobile,.gf-rule-mobile){display:flex;flex-direction:column;gap:12px}
  .gf-rule-results{gap:12px}

  /* Pesquisa + criar */
  :is(.gf-cat-searchbar,.gf-rule-searchbar){display:grid;grid-template-columns:minmax(0,1fr) 46px;gap:10px;align-items:center;margin-bottom:0}
  :is(.gf-cat-search,.gf-rule-search){min-height:46px;border:1px solid #d0d5dd;border-radius:14px;background:#fff;display:grid;grid-template-columns:20px 1fr;align-items:center;gap:8px;padding:0 13px;color:#667085;box-shadow:none}
  :is(.gf-cat-search,.gf-rule-search) .gf-icon,:is(.gf-cat-search,.gf-rule-search) svg{width:20px;height:20px}
  :is(.gf-cat-search,.gf-rule-search) input{border:0;outline:0;background:transparent;font:inherit;color:#101828;min-width:0;width:100%}
  :is(.gf-cat-search,.gf-rule-search) input::placeholder{color:#98a2b3}
  :is(.gf-cat-add,.gf-rule-add){width:46px;height:46px;border:0;border-radius:14px;background:#1570ef;color:#fff;display:grid;place-items:center;box-shadow:0 4px 12px rgba(21,112,239,.22)}
  :is(.gf-cat-add,.gf-rule-add) .gf-icon,:is(.gf-cat-add,.gf-rule-add) svg{width:20px;height:20px}

  /* Tabs de estado */
  :is(.gf-cat-tabs,.gf-rule-tabs){display:grid;grid-template-columns:repeat(3,1fr);gap:6px;padding:4px;background:#f2f4f7;border-radius:13px;margin-bottom:0}
  :is(.gf-cat-tabs,.gf-rule-tabs) button{min-height:38px;border:0;border-radius:10px;background:transparent;color:#667085;font-weight:800;font-size:12px}
  :is(.gf-cat-tabs,.gf-rule-tabs) button span{font-weight:700;opacity:.7;color:inherit;margin-left:0}
  :is(.gf-cat-tabs,.gf-rule-tabs) button.active{background:#fff;color:#175cd3;box-shadow:0 1px 4px rgba(16,24,40,.08)}
  :is(.gf-cat-tabs,.gf-rule-tabs) button.active span{font-weight:700;opacity:.7;color:inherit;margin-left:0}

  /* Chips horizontais */
  :is(.gf-cat-group-chips,.gf-rule-group-chips){display:flex;gap:8px;overflow-x:auto;padding:1px 1px 4px;scrollbar-width:none}
  :is(.gf-cat-group-chips,.gf-rule-group-chips)::-webkit-scrollbar{display:none}
  :is(.gf-cat-group-chip,.gf-rule-group-chip){flex:0 0 auto;min-width:82px;min-height:auto;border:1px solid #eaecf0;border-radius:14px;background:#fff;padding:8px 10px;display:grid;grid-template-columns:auto 1fr auto;gap:5px;align-items:center;color:#475467;font-size:11px;font-weight:800}
  :is(.gf-cat-group-chip,.gf-rule-group-chip).active{border-color:#84adff;background:#eff4ff;color:#175cd3}
  :is(.gf-cat-chip-icon,.gf-rule-chip-icon){width:28px;height:28px;border-radius:9px;background:#f2f4f7;display:grid;place-items:center}
  :is(.gf-cat-group-chip,.gf-rule-group-chip).active :is(.gf-cat-chip-icon,.gf-rule-chip-icon){background:#dbeafe}
  :is(.gf-cat-chip-icon,.gf-rule-chip-icon) .gf-icon,:is(.gf-cat-chip-icon,.gf-rule-chip-icon) svg{width:20px;height:20px}
  :is(.gf-cat-group-chip,.gf-rule-group-chip) small{font-size:10px;font-weight:900;color:inherit}

  /* Estado vazio */
  :is(.gf-cat-empty,.gf-rule-empty){padding:28px 16px;text-align:center;border:1px dashed #d0d5dd;border-radius:16px;background:#fff;color:#667085}
  :is(.gf-cat-empty,.gf-rule-empty) strong,:is(.gf-cat-empty,.gf-rule-empty) span{display:block}
  :is(.gf-cat-empty,.gf-rule-empty) strong{color:#344054;margin-bottom:5px;font-size:inherit}
  :is(.gf-cat-empty,.gf-rule-empty) span{margin-top:0;font-size:inherit}

  /* Botão de menu da linha/cartão */
  :is(.gf-cat-menu,.gf-rule-menu){border:0;background:#fff;color:#475467;font-size:18px;font-weight:900;letter-spacing:1px}

  /* Popover de ações */
  :is(.gf-cat-action-layer,.gf-rule-action-layer){position:fixed;inset:0;z-index:370;background:rgba(15,23,42,.16)}
  :is(.gf-cat-actions,.gf-rule-actions){position:absolute;width:min(290px,calc(100vw - 24px));background:#fff;border:1px solid #eaecf0;border-radius:15px;box-shadow:0 14px 40px rgba(16,24,40,.22);overflow:hidden}
  :is(.gf-cat-actions-title,.gf-rule-actions-title){padding:12px 14px;background:#f9fafb;border-bottom:1px solid #eaecf0}
  :is(.gf-cat-actions-title,.gf-rule-actions-title) strong,:is(.gf-cat-actions-title,.gf-rule-actions-title) span{display:block}
  :is(.gf-cat-actions-title,.gf-rule-actions-title) strong{font-size:13px}
  :is(.gf-cat-actions-title,.gf-rule-actions-title) span{font-size:10px;color:#667085;margin-top:2px}
  :is(.gf-cat-actions,.gf-rule-actions) button{width:100%;min-height:48px;border:0;border-top:1px solid #f2f4f7;background:#fff;display:grid;grid-template-columns:22px 1fr;gap:10px;align-items:center;text-align:left;padding:0 14px;color:#344054;font-weight:750}
  :is(.gf-cat-actions,.gf-rule-actions) button:first-of-type{border-top:0}
  :is(.gf-cat-actions,.gf-rule-actions) button.danger{color:#d92d20}
  :is(.gf-cat-actions,.gf-rule-actions) .gf-icon,:is(.gf-cat-actions,.gf-rule-actions) svg{width:20px;height:20px}

  /* Bottom sheet */
  :is(.gf-cat-sheet-layer,.gf-rule-sheet-layer){position:fixed;inset:0;z-index:380;background:rgba(15,23,42,.45);display:flex;align-items:flex-end;padding:0}
  :is(.gf-cat-sheet,.gf-rule-sheet){width:100%;max-height:min(88vh,760px);background:#fff;border-radius:24px 24px 0 0;box-shadow:0 -18px 48px rgba(15,23,42,.28);display:flex;flex-direction:column;padding-bottom:calc(12px + env(safe-area-inset-bottom))}
  :is(.gf-cat-sheet-handle,.gf-rule-sheet-handle){width:42px;height:4px;border-radius:999px;background:#d0d5dd;margin:8px auto 2px;flex:0 0 auto}
  :is(.gf-cat-sheet-head,.gf-rule-sheet-head){display:grid;grid-template-columns:1fr 38px;gap:8px;align-items:center;padding:10px 16px 8px}
  :is(.gf-cat-sheet-head,.gf-rule-sheet-head) h2{margin:0;font-size:18px;color:#101828}
  :is(.gf-cat-sheet-head,.gf-rule-sheet-head) button{width:36px;height:36px;border:0;border-radius:999px;background:#f2f4f7;color:#475467;display:grid;place-items:center}
  :is(.gf-cat-sheet-head,.gf-rule-sheet-head) .gf-icon,:is(.gf-cat-sheet-head,.gf-rule-sheet-head) svg{width:20px;height:20px}
  :is(.gf-cat-sheet-body,.gf-rule-sheet-body){padding:4px 16px 8px;overflow:auto}
  :is(.gf-cat-sheet-actions,.gf-rule-sheet-actions){padding:8px 16px 0;display:grid;gap:8px}
  body:is(.gf-cat-sheet-open,.gf-rule-sheet-open){overflow:hidden}

  /* Campos */
  :is(.gf-cat-field,.gf-rule-field){margin-bottom:14px}
  :is(.gf-cat-field,.gf-rule-field) label{display:block;margin-bottom:6px;font-size:12px;font-weight:800;color:#344054}
  :is(.gf-cat-field,.gf-rule-field) .input,:is(.gf-cat-field,.gf-rule-field) .select{width:100%;min-height:48px;border-radius:12px}
  :is(.gf-cat-field,.gf-rule-field)>small{display:block;margin-top:5px;font-size:10px;color:#98a2b3;line-height:1.35}

  /* Switch */
  :is(.gf-cat-switch-row,.gf-rule-switch-row){min-height:62px;border-top:1px solid #f2f4f7;display:grid;grid-template-columns:minmax(0,1fr) auto;gap:12px;align-items:center;padding:10px 0}
  :is(.gf-cat-switch-row,.gf-rule-switch-row) strong,:is(.gf-cat-switch-row,.gf-rule-switch-row) small{display:block}
  :is(.gf-cat-switch-row,.gf-rule-switch-row) strong{font-size:13px;color:#344054}
  :is(.gf-cat-switch-row,.gf-rule-switch-row) small{font-size:10px;color:#98a2b3;margin-top:3px;line-height:1.35}
  :is(.gf-cat-switch,.gf-rule-switch){position:relative;width:46px;height:26px}
  :is(.gf-cat-switch,.gf-rule-switch) input{position:absolute;opacity:0;pointer-events:none}
  :is(.gf-cat-switch,.gf-rule-switch) i{position:absolute;inset:0;background:#e4e7ec;border-radius:999px;transition:.18s}
  :is(.gf-cat-switch,.gf-rule-switch) i::after{content:'';position:absolute;width:22px;height:22px;top:2px;left:2px;border-radius:50%;background:#fff;box-shadow:0 1px 4px rgba(16,24,40,.25);transition:.18s}
  :is(.gf-cat-switch,.gf-rule-switch) input:checked+i{background:#12b76a}
  :is(.gf-cat-switch,.gf-rule-switch) input:checked+i::after{transform:translateX(20px)}

  /* Blocos informativos */
  :is(.gf-cat-info,.gf-rule-info){margin-top:10px;border-radius:12px;padding:11px 12px;font-size:11px;line-height:1.45;background:#eff8ff;color:#175cd3}
  .gf-rule-info{margin-top:0;margin-bottom:12px}

  /* Ações de sheet */
  :is(.gf-cat-sheet-primary,.gf-rule-save){width:100%;min-height:48px;border-radius:13px;font-weight:850}
  .gf-cat-sheet-secondary{width:100%;min-height:48px;border-radius:13px;font-weight:850;background:#fff;border:1px solid #d0d5dd;color:#344054}

  /* Confirmação destrutiva */
  :is(.gf-cat-delete-icon,.gf-rule-delete-icon){width:58px;height:58px;border-radius:50%;margin:8px auto 10px;background:#fee4e2;color:#d92d20;display:grid;place-items:center}
  :is(.gf-cat-delete-icon,.gf-rule-delete-icon) .gf-icon,:is(.gf-cat-delete-icon,.gf-rule-delete-icon) svg{width:27px;height:27px}
  :is(.gf-cat-delete-copy,.gf-rule-delete-copy){text-align:center}
  :is(.gf-cat-delete-copy,.gf-rule-delete-copy) h3{margin:0 0 6px;font-size:17px}
  :is(.gf-cat-delete-copy,.gf-rule-delete-copy) p{margin:0;color:#667085;font-size:12px;line-height:1.45}
}
