/* ============================================================================
   VERSÃO DE CELULAR — "C · Barra navy + Criar" (rodada 1; escolha do dono em 10/10/2026: "reverter para essa versão").
   Só vale até 760 px de largura: as regras moram em @media (max-width: 760px); as poucas fora dele só ESCONDEM peças que
   existem apenas no celular. O comportamento mora em js/celular.js, que marca o <html> com a classe "cel" ao carregar.
   · Barra inferior navy (a cor do menu lateral) com 5 itens: Meu Dia · Tarefas · Criar (centro) · Conversas · Menu.
     O menu é o menu lateral real numa gaveta. Topo enxuto (título, sino e foto). Tarefas com as áreas em abas no topo;
     tarefa aberta em tela cheia com as abas Detalhes e Comunicação.
   · Medido antes, a 375 px: menu lateral fixo de 240 px deixava 129 px para o conteúdo; 197 elementos passando da tela no
     Painel, 241 no Meu Dia; na tarefa aberta a coluna dos campos ficava com 0 px.
   · Este arquivo é o mockup (R102, página celular-r1.html, variação C) extraído por programa, na MESMA ORDEM e com a MESMA
     especificidade: o prefixo de mockup virou "html.cel" (mesmo peso). Fora do mockup, só sai o que era das outras
     variações (inclusive o botão de menu no topo, .cel-ham).
   ============================================================================ */

@media (max-width: 760px) {
  /* ── 1. CASCO (igual nas 3 variações) ─────────────────────────────────────── */
  html.cel .app { grid-template-columns: minmax(0, 1fr); }
  /* o menu lateral REAL (mesmos itens, contadores, chat e IA) vira gaveta por cima do conteúdo */
  html.cel .sidebar { position: fixed; top: 0; left: 0; bottom: 0; width: min(86vw, 300px); height: 100dvh; z-index: 1300; transform: translateX(-100%); transition: transform .22s cubic-bezier(.4, 0, .2, 1); padding-bottom: calc(20px + env(safe-area-inset-bottom)); }
  html.cel-menu-aberto .sidebar { transform: none; box-shadow: 0 24px 80px rgba(0, 0, 0, .4); }
  html.cel .cel-veu { position: fixed; inset: 0; z-index: 1250; background: rgba(15, 23, 42, .5); opacity: 0; pointer-events: none; transition: opacity .22s cubic-bezier(.4, 0, .2, 1); }
  html.cel-menu-aberto .cel-veu { opacity: 1; pointer-events: auto; }
  html.cel-menu-aberto body { overflow: hidden; }
  /* barra do topo: título + sino + foto. Atalhos, ponto, busca e função saem (vão para o menu) */
  html.cel .topbar { padding: calc(10px + env(safe-area-inset-top)) 12px 10px; gap: 8px; }
  html.cel .topbar-left { min-width: 0; display: flex; align-items: center; gap: 8px; }
  html.cel .topbar-left h1 { font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  html.cel .topbar-hotlinks,
  html.cel .topbar-sep,
  html.cel #pontoContainer,
  html.cel #topbarQuickActions,
  html.cel #globalSearchWrap,
  html.cel #userFuncaoChip { display: none !important; }
  html.cel #sectionsContainer { padding: 12px !important; }
  html.cel #sectionsContainer { padding-bottom: calc(84px + env(safe-area-inset-bottom)) !important; }
  /* abas de página (.pgtabs, LEI §13.14): rolam de lado em vez de estourar a tela */
  html.cel .pgtabs { overflow-x: auto; overflow-y: hidden; max-width: 100%; scrollbar-width: none; }
  html.cel .pgtabs::-webkit-scrollbar { display: none; }
  html.cel .pgtab { flex: 0 0 auto; }
  /* Meu Dia: cartões 2 por linha; colunas uma embaixo da outra */
  html.cel .md-stats { grid-template-columns: 1fr 1fr !important; }
  html.cel .md-stats > .pstat { min-width: 0 !important; }
  html.cel .md-grid { grid-template-columns: minmax(0, 1fr) !important; }
  html.cel .md-col { min-width: 0; }
  /* faixa "Dados reais": é flex com texto solto, e cada <b> virava uma coluna; no celular corre como parágrafo */
  html.cel .md-demo { display: block; line-height: 1.5; }
  html.cel .md-demo i { margin-right: 4px; vertical-align: -2px; }
  html.cel .chp-wrap { height: calc(100dvh - 186px - env(safe-area-inset-bottom)) !important; }
  /* Tarefas: abas das áreas no topo (o subitem do menu, sem abrir o menu) */
  html.cel .cel-areas { margin-bottom: 12px; }
  /* Tarefa aberta: janela em tela cheia; Detalhes e Comunicação viram 2 abas */
  html.cel #tarModalOverlay { padding: 0 !important; }
  html.cel #tarModalOverlay > div { max-width: 100vw !important; height: 100dvh !important; border-radius: 0 !important; }
  html.cel #tarModalOverlay #tmDragBar { padding: calc(10px + env(safe-area-inset-top)) 12px 10px !important; flex-wrap: wrap; row-gap: 6px; cursor: default !important; }
  html.cel #tarModalOverlay #tmFechar { font-size: 24px !important; padding: 6px 8px; }
  html.cel #tarModalOverlay .cel-tm-abas { margin: 8px 12px 0; }
  html.cel #tarModalOverlay .cel-tm-corpo { flex-direction: column !important; }
  html.cel #tarModalOverlay .cel-tm-corpo > * { flex: 1 1 auto !important; width: auto !important; max-width: none !important; min-width: 0 !important; min-height: 0 !important; }
  html.cel #tarModalOverlay .cel-tm-campos { padding: 12px !important; }
  /* linhas de campo (Responsável · Status · Quando executar…): quebram em pares rótulo + campo, alinhados a 122 px */
  html.cel #tarModalOverlay .cel-tm-campos > div { flex-wrap: wrap !important; row-gap: 10px !important; }
  html.cel #tarModalOverlay .cel-tm-campos > div > label { min-width: 122px !important; }
  html.cel #tarModalOverlay .cel-tm-campos > div > div { flex: 1 1 160px !important; }
  html.cel #tarModalOverlay .cel-tm-campos > div > select { flex: 1 1 140px !important; min-width: 0 !important; }
  html.cel #tarModalOverlay[data-cel-aba="detalhes"] .cel-tm-chat,
  html.cel #tarModalOverlay[data-cel-aba="conversa"] .cel-tm-campos { display: none !important; }
  html.cel .cel-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 200;   /* acima da topbar (100), abaixo das janelas (210+) e da gaveta */ display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 2px; padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); font-family: var(--font); }
  .cel-bar-i { position: relative; min-height: 54px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; border: 0; background: transparent; border-radius: 12px; cursor: pointer; font: 600 10.5px/1.1 var(--font); letter-spacing: .1px; -webkit-tap-highlight-color: transparent; transition: color .22s cubic-bezier(.4, 0, .2, 1); }
  .cel-bar-i .cel-ic { display: inline-flex; align-items: center; justify-content: center; width: 52px; height: 28px; border-radius: 999px; font-size: 16px; transition: background-color .22s cubic-bezier(.4, 0, .2, 1); }
  .cel-bar-i:active { transform: scale(.97); }
  .cel-bar-i:focus-visible { outline: 2px solid #2A4575; outline-offset: 1px; box-shadow: 0 0 0 3px rgba(42, 69, 117, .25); }
  .cel-bar-n { position: absolute; top: 3px; left: calc(50% + 7px); min-width: 18px; height: 18px; padding: 0 5px; box-sizing: border-box; border-radius: 999px; font: 800 10px/18px var(--font); text-align: center; pointer-events: none; }
  /* C · navy (a cor do menu lateral) + botão Criar no centro */
  html.cel .cel-bar { background: var(--sidebar); border-top: 1px solid var(--sidebar-border); }
  html.cel .cel-bar-i { color: rgba(255, 255, 255, .72); }
  html.cel .cel-bar-i.on { color: #fff; font-weight: 800; }
  html.cel .cel-bar-i.on .cel-ic { background: rgba(255, 255, 255, .12); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .15); }
  html.cel .cel-bar-i:focus-visible { outline-color: #fff; box-shadow: 0 0 0 3px rgba(255, 255, 255, .25); }
  html.cel .cel-bar-n { background: #fff; color: var(--sidebar); box-shadow: 0 0 0 2px var(--sidebar); }
  html.cel .cel-bar-criar .cel-ic { width: 48px; height: 48px; margin-top: -20px; background: #fff; color: var(--sidebar); font-size: 18px;   /* sobe 20 px: o rótulo fica na mesma linha dos vizinhos */ box-shadow: 0 2px 8px rgba(0, 0, 0, .28); }
  html.cel .cel-bar-criar { color: #fff; }
}
@media (max-width: 760px) and (prefers-reduced-motion: reduce) {
  html.cel .sidebar,
  html.cel .cel-veu,
  .cel-bar-i,
  .cel-bar-i .cel-ic { transition: none; }
  .cel-bar-i:active { transform: none; }
}
@media (max-width: 760px) {
  @keyframes celToastIn { from { opacity: 0; } to { opacity: 1; } }
}
@media (min-width: 761px) {
  .cel-bar,
  .cel-veu { display: none !important; }
}

/* ── CORREÇÕES DE DIAGRAMAÇÃO (decisão do dono, 10/10/2026: "C + correções de diagramação") ────────────────────────
   Só ESTRUTURA, trazida das correções que a régua exigiu na M1 (rodadas 2-3); as cores, os fundos e os chips da C ficam.
   Medido na C a 375 px antes: título do cartão da tarefa com 61-93 px (3 a 12 linhas, quebrando palavras); nº do processo
   por baixo do botão "Processo" nos Prazos finais; "Análise do seu dia" e menções espremidos; a engrenagem do Alimentador
   (#tmIACfg, absolute) em cima da engrenagem do editor na tarefa. */
@media (max-width: 760px) {
  /* cartão da tarefa: o título ganha a largura da linha e o "Tempo" desce para baixo dele
     (medido na C: data 54 + folga 12 + foto 26 + folga 12 = 104 px) */
  html.cel .tpg-card { flex-wrap: wrap !important; row-gap: 6px !important; }
  html.cel .tpg-card > div:nth-child(3) { flex: 1 1 calc(100% - 104px) !important; min-width: 0 !important; }
  html.cel .tpg-card > div:nth-child(3) > div:first-child > span:first-child { display: -webkit-box !important; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  html.cel .tpg-card > select.tpg-tempo { flex: 0 0 auto !important; order: 9; width: auto !important; max-width: calc(100% - 104px); margin-left: 104px; }
  /* Prazos finais: grade [data | título e responsável | urgência]; o botão do processo vira ícone de 32 px na coluna da
     direita, sob a urgência (o nº do processo ficava por baixo do botão) */
  html.cel #slot-prazos-finais div[role="button"] { display: grid !important; grid-template-columns: 38px minmax(0, 1fr) auto; grid-template-rows: auto 1fr; grid-template-areas: "data corpo urg" "data corpo acao" !important; column-gap: 10px !important; row-gap: 6px !important; align-items: start !important; }
  html.cel #slot-prazos-finais div[role="button"] > div:first-of-type { grid-area: data; padding-top: 1px; }
  html.cel #slot-prazos-finais div[role="button"] > div:last-of-type { grid-area: corpo; min-width: 0; }
  html.cel #slot-prazos-finais div[role="button"] > div:last-of-type > div:first-child { white-space: normal !important; display: -webkit-box !important; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  html.cel #slot-prazos-finais div[role="button"] > div:last-of-type > div:last-child { flex-wrap: wrap !important; row-gap: 4px !important; }
  html.cel #slot-prazos-finais div[role="button"] > div:last-of-type > div:last-child > span { white-space: nowrap !important; }
  html.cel #slot-prazos-finais div[role="button"] > button { grid-area: acao; justify-self: end; align-self: end; width: 32px; height: 32px; min-height: 32px !important; padding: 0 !important; font-size: 0 !important; display: inline-flex !important; align-items: center; justify-content: center; }
  html.cel #slot-prazos-finais div[role="button"] > button i { font-size: 15px !important; }
  html.cel #slot-prazos-finais div[role="button"] > span:last-child { grid-area: urg; white-space: nowrap; }
  /* Menções (Painel e Meu Dia): "há 4d" quebrava; o botão Resolver desce e vai para a direita */
  html.cel .agm-card div > span:last-child { white-space: nowrap; flex-shrink: 0; }
  html.cel .md-ment { flex-wrap: wrap !important; row-gap: 6px; }
  html.cel .md-ment-open { flex: 1 1 100% !important; }
  html.cel .md-solve { margin-left: auto !important; white-space: nowrap !important; }
  /* Análise do seu dia: o cabeçalho tinha 5 itens numa linha (título com 57 px em 3 linhas). Ordem nova: robô, título e
     tag; subtítulo; botões; o resto embaixo */
  html.cel .md-ia-h { flex-wrap: wrap !important; row-gap: 8px !important; }
  html.cel .md-ia-h h3 { flex: 1 1 140px !important; white-space: nowrap; }
  html.cel .md-ia-h .md-ia-btn { white-space: nowrap !important; }
  html.cel .md-ia-top { display: flex !important; flex-wrap: wrap; align-items: center; column-gap: 8px; row-gap: 8px; }
  html.cel .md-ia-top > .md-ia-h { display: contents !important; }
  html.cel .md-ia-top > .md-ia-h > .md-ia-sp { display: none !important; }
  html.cel .md-ia-top > .md-ia-h > .md-robo { order: 1; }
  html.cel .md-ia-top > .md-ia-h > h3 { order: 2; flex: 1 1 120px !important; }
  html.cel .md-ia-top > .md-ia-h > .md-tag { order: 3; }
  html.cel .md-ia-top > .md-ia-sub { order: 4; flex: 1 1 100%; margin: 0 !important; }
  html.cel .md-ia-top > .md-ia-h > .md-ia-btn,
  html.cel .md-ia-top > .md-ia-h > #mdIaVotoWrap { order: 5; }
  html.cel .md-ia-top > :not(.md-ia-h):not(.md-ia-sub) { order: 6; flex: 1 1 100%; }
  /* engrenagem do "Alimentador do prompt" (só o Renato): sai de cima da engrenagem do editor e entra na fila do anexo,
     do @ e da IA (o js/celular.js a move para lá) */
  html.cel #tarModalOverlay #tmIACfg { position: static !important; display: inline-flex !important; align-items: center; justify-content: center; }
}

/* ── ÁREA DE TOQUE DE 32 px NA C (decisão do dono, 10/10/2026: "manter 32 px") ─────────────────────────────────────
   O mesmo critério da M1 (no ar desde 08:45), sobre a C: controles com texto e botões que cabem crescem até 32 px; onde
   crescer muda o desenho, só a área de toque cresce, por dentro (::after invisível). Medido na C a 375 px: 53 alvos
   abaixo de 32 px (sino "Ver todas" 13 px de altura; buscas 14; Status e Quando 18; caixa de marcar 15; excluir
   comentário 10 x 13; anexo, @ e IA da tarefa 19-22). */
@media (max-width: 760px) {
  /* controles com texto: altura mínima de 32 px (a largura fica) */
  html.cel :is(#lockBtn, #chpBusca, #chpEnviar, #mdPessoaL, #mdPessoa, .md-leg-btn, .agm-res, .md-solve, .md-ia-btn, #tpgBusca, #tpgNova, #pnTodas, .chp-pill-base) { min-height: 32px !important; }
  html.cel .pgtabs .pgtab { min-height: 32px !important; }
  html.cel [id^="slot-t-"] .tpg-pill { min-height: 32px !important; }
  html.cel .tpg-card > select.tpg-tempo { min-height: 32px !important; }
  html.cel #pnTodas,
  html.cel #tmBaixarTudo,
  html.cel #tmcMais { display: inline-flex !important; align-items: center; }
  html.cel #tarModalOverlay :is(#tmStatus, #tmLogBtn, #tmTitulo, #tmFluxo, #tmTempo, #tmInicio, #tmPrazo, #tmPrazoFinal, #tmPrio, #tmProcBusca, #tmCliente, #tmItNovo, #tmBaixarTudo, #tmExcluir, #tmcMais, #tmChatEnviar) { min-height: 32px !important; }
  html.cel .sidebar button[onclick*="openMenuModal"] { min-height: 32px !important; }
  html.cel .cc-bolha button:not([class]):not([id]) { min-height: 32px !important; }
  /* botões só de ícone que cabem: quadrado de 32 px */
  html.cel :is(#userAvatarBtn, #mdTmInfoBtn, #mdDonutInfoBtn) { min-width: 32px !important; min-height: 32px !important; }
  html.cel #tarModalOverlay :is(#tmProcAbrir, #tmCliNovo, #tmAnexo, #tmAt, #tmIA, #tmIACfg, .tmc-del, .tmc-edit) { min-width: 32px !important; min-height: 32px !important; display: inline-flex !important; align-items: center; justify-content: center; }
  html.cel #tarModalOverlay .tm-it-chk { width: 32px !important; height: 32px !important; }
  /* onde crescer muda o desenho: a área de toque cresce por dentro */
  html.cel :is(#chpVoltar, #chpReuniao, #chpReuniaoExt, #chpBusM, #chpCfg, #chpInfo)::after { content: ""; position: absolute; left: 50%; top: 50%; width: 32px; height: 32px; transform: translate(-50%, -50%); }
  html.cel #chpNova { position: relative; }
  html.cel #chpNova::after { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 32px; }
  html.cel .pedit-bt { position: relative; }
  html.cel .pedit-bt::after { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 32px; transform: translateY(-50%); }
  html.cel .md-goal-pen { position: relative; }
  html.cel .md-goal-pen::after { content: ""; position: absolute; left: 50%; top: 50%; width: 32px; height: 32px; transform: translate(-50%, -50%); }
  html.cel :is(.chp-copiar, .chp-responder, .chp-edit, .chp-del) { position: relative; }
  html.cel :is(.chp-copiar, .chp-responder, .chp-edit, .chp-del)::after { content: ""; position: absolute; left: -3px; right: -3px; top: 50%; height: 32px; transform: translateY(-50%); }
  html.cel .chp-reac::after { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 32px; transform: translateY(-50%); }
}
