/* ============================================================================================
   Celular (Mendes, 2026-11-06: mockup celular-responsivo/hub-celular.html aprovado, "gostei, ficou
   bom"). Tudo aqui só vale em tela estreita; o desktop não muda. Carregado depois de
   components.css (ui/base.html). Peças:
   - barra de baixo (ui/tabbar.html, itens escolhidos pela pessoa) e o + "Create" no topo;
   - folhas que sobem de baixo (<dialog class="msheet">, ui/mobile_sheets.html e ui/mobile.js);
   - até 640px: tabelas viram lista, números do topo numa linha que desliza, Filtros e ⋯ em folha
     (montados pelo ui/mobile.js), abas que deslizam numa linha só.
   Alvos de toque de pelo menos 44px (revisão de acessibilidade do mockup).
   ============================================================================================ */
.tabbar,.appbar__create,.side__tabbar{display:none}
.msheet{font-family:var(--font-sans);font-size:14px;position:fixed;inset:auto 0 0 0;width:100%;max-width:560px;max-height:85vh;margin:0 auto;padding:8px 0 max(18px, env(safe-area-inset-bottom));box-sizing:border-box;border:1px solid var(--color-border-strong);border-bottom:0;border-radius:24px 24px 0 0;background:var(--color-surface-top);color:var(--color-text);box-shadow:0 -20px 60px rgba(0,0,0,.5);overflow:auto}
.msheet::backdrop{background:rgba(0,0,0,.55)}
.msheet[open]{animation:msheetIn .22s ease-out}
@keyframes msheetIn{from{transform:translateY(40px);opacity:.4}to{transform:none;opacity:1}}
.msheet::before{content:"";display:block;width:40px;height:4px;margin:2px auto 10px;border-radius:2px;background:var(--color-border-strong)}
.msheet__head{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:0 20px 8px}
.msheet__title{margin:0;font-size:17px;font-weight:700}
.msheet__close,.msheet__link{appearance:none;min-width:44px;min-height:44px;border:0;background:none;color:var(--color-accent);font:inherit;font-size:14px;font-weight:600;cursor:pointer}
.msheet__close{font-size:26px;line-height:1;color:var(--color-text-muted)}
.msheet__body{display:flex;flex-direction:column;gap:12px;padding:0 20px 8px}
.msheet__hint{margin:0;font-size:13px;color:var(--color-text-muted)}
.msheet__opt{display:flex;align-items:center;gap:14px;min-height:52px;padding:4px 2px;border-bottom:1px solid var(--color-divider);color:var(--color-text);font-size:15px;font-weight:600;text-decoration:none}
.msheet__opt:last-child{border-bottom:0}
.msheet__ico{flex:none;width:22px;height:22px;background:var(--color-accent);-webkit-mask-size:contain;mask-size:contain;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-position:center;mask-position:center}
.msheet__picks{list-style:none;margin:0;padding:0;border:1px solid var(--color-border);border-radius:16px;overflow:hidden}
.msheet__pick{display:flex;align-items:center;gap:10px;min-height:56px;padding:6px 12px;border-top:1px solid var(--color-divider)}
.msheet__pick:first-child{border-top:0}
.msheet__pick-label{flex:1;min-width:0;font-weight:600}
.msheet__mv{appearance:none;width:38px;height:38px;border:1px solid var(--color-border-strong);border-radius:10px;background:var(--color-surface-2);color:var(--color-text);font:inherit;cursor:pointer}
.msheet__pick:not(:has(:checked)) .msheet__mv{visibility:hidden}
.msheet__mv:disabled{opacity:.3}
.msheet__switch{appearance:none;flex:none;width:48px;height:30px;margin:0;border:1px solid var(--color-border-strong);border-radius:15px;background:var(--color-track);position:relative;cursor:pointer}
.msheet__switch::before{content:"";position:absolute;top:3px;left:3px;width:22px;height:22px;border-radius:50%;background:var(--color-text-muted);transition:transform .15s}
.msheet__switch:checked{background:var(--color-accent);border-color:var(--color-accent)}
.msheet__switch:checked::before{transform:translateX(18px);background:var(--color-on-accent)}
.msheet__switch:disabled{opacity:.35;cursor:not-allowed}
.msheet__switch:focus-visible,.msheet__mv:focus-visible{outline:2px solid var(--color-accent);outline-offset:2px}
.msheet .btn--block{width:100%;min-height:48px;justify-content:center}
.msheet__body>.btn--primary{background:var(--color-accent);border-color:var(--color-accent);color:var(--color-on-accent)}
.msheet__actions{display:flex;flex-direction:column;gap:0}
.msheet__actions>*{width:100%}
.msheet__actions .btn,.msheet__actions form .btn{width:100%;min-height:48px;justify-content:flex-start;border-radius:0;border-width:0 0 1px;border-color:var(--color-divider);background:none;box-shadow:none;font-size:15px}
.msheet__actions form{display:block;margin:0}
.msheet__filters{display:flex;flex-direction:column;gap:14px}
.msheet__filters select,.msheet__filters .field__control{width:100%;min-height:44px}

@media (max-width:900px){
  .tabbar{position:fixed;left:0;right:0;bottom:0;z-index:34;display:grid;grid-template-columns:repeat(var(--tabs,5), minmax(0,1fr));padding:6px 6px max(8px, env(safe-area-inset-bottom));border-top:1px solid var(--color-divider);background:var(--color-surface)}
  @supports (backdrop-filter:blur(1px)){.tabbar{background:color-mix(in srgb, var(--color-surface) 92%, transparent);backdrop-filter:blur(14px)}}
  .tabbar[data-count="2"]{--tabs:2}.tabbar[data-count="3"]{--tabs:3}.tabbar[data-count="4"]{--tabs:4}.tabbar[data-count="5"]{--tabs:5}
  .tabbar__item{appearance:none;position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;min-height:50px;padding:4px 0;border:0;background:none;color:var(--color-text-dim);font:inherit;font-size:10.5px;font-weight:600;text-decoration:none;cursor:pointer}
  .tabbar__item[aria-current="page"]{color:var(--color-accent)}
  .tabbar__icon{width:22px;height:22px;background:currentColor;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-size:contain;mask-size:contain;-webkit-mask-position:center;mask-position:center}
  .tabbar__label{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .tabbar__badge{position:absolute;top:2px;left:calc(50% + 6px);min-width:16px;height:16px;padding:0 4px;box-sizing:border-box;border-radius:8px;background:var(--color-danger);color:#1a0505;font-size:10px;font-weight:800;line-height:16px;text-align:center}
  .tabbar__item:focus-visible{outline:2px solid var(--color-accent);outline-offset:-2px;border-radius:12px}
  .shell:has(.tabbar) .page{padding-bottom:calc(96px + env(safe-area-inset-bottom))}
  .shell:has(.tabbar) .appbar__menu{display:none}
  .appbar{padding-top:max(10px, env(safe-area-inset-top));min-height:60px}
  .appbar .topbar__actions>.btn{display:none}
  .appbar .theme-toggle{width:44px;height:44px}
  .appbar__create{appearance:none;display:inline-flex;align-items:center;justify-content:center;width:44px;height:44px;flex:none;border:1px solid var(--color-accent);border-radius:12px;background:var(--color-accent);color:var(--color-on-accent);cursor:pointer}
  .appbar__create svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round}
  .appbar__create:focus-visible{outline:2px solid var(--color-accent);outline-offset:2px}
  .side__tabbar{appearance:none;display:flex;align-items:center;min-height:44px;padding:0 12px;border:1px solid var(--color-border);border-radius:10px;background:none;color:var(--color-text-soft);font:inherit;font-size:13.5px;font-weight:600;cursor:pointer}
  .topbar.side{padding-bottom:max(16px, env(safe-area-inset-bottom))}
}

@media (max-width:640px){
  .page{gap:16px;padding-top:16px}
  /* topo das telas */
  .hero{padding:18px;gap:14px;border-radius:20px}
  .hero__title{font-size:24px}
  .hero__title--lg{font-size:24px}
  .hero__lead{font-size:13.5px}
  .hero__actions{width:100%;gap:12px}
  .hero__stats{display:flex;flex:1 1 100%;min-width:0;overflow-x:auto;scrollbar-width:none;margin:0 -18px;padding:2px 18px}
  .hero__stats::-webkit-scrollbar{display:none}
  .hero__stats .hero__stat{flex:none;padding:0 14px;border-radius:0;background:none;box-shadow:none;border-left:1px solid var(--color-divider)}
  .hero__stats .hero__stat:first-child{padding-left:0;border-left:0}
  .hero__stat-value{font-size:18px;white-space:nowrap}
  .hero__stat-label{white-space:nowrap}
  .hero__buttons .btn,.hero__actions>.btn{min-height:44px}
  .m-more{appearance:none;width:44px;height:44px;flex:none;border:1px solid var(--color-border-strong);border-radius:12px;background:var(--color-surface-2);color:var(--color-text);font:inherit;font-size:20px;line-height:1;cursor:pointer}
  /* abas e chips numa linha que desliza */
  .project-tabs__tabs,.card__chips,.chips{flex-wrap:nowrap;overflow-x:auto;scrollbar-width:none;-webkit-overflow-scrolling:touch}
  .project-tabs__tabs::-webkit-scrollbar,.card__chips::-webkit-scrollbar,.chips::-webkit-scrollbar{display:none}
  .project-tabs__tabs>*,.card__chips>*,.chips>*{flex:none}
  .project-tabs{flex-wrap:nowrap;min-width:0}
  .project-tabs__tabs{min-width:0;flex:1}
  .chip{min-height:38px}
  /* busca e filtros */
  .card__head{padding:14px 16px}
  .card__tools{width:100%}
  .card__tools form{width:100%;flex-wrap:wrap}
  .m-filter-row{display:flex;gap:8px;width:100%}
  .m-filter-row .search__input,.m-filter-row input[type=search]{flex:1;min-width:0;width:auto!important;min-height:44px}
  .m-filter-btn{appearance:none;display:inline-flex;align-items:center;gap:6px;min-height:44px;padding:0 14px;border:1px solid var(--color-border-strong);border-radius:12px;background:var(--color-surface-2);color:var(--color-text);font:inherit;font-size:13.5px;font-weight:600;white-space:nowrap;cursor:pointer}
  .m-filter-btn b{min-width:18px;height:18px;padding:0 5px;box-sizing:border-box;border-radius:9px;background:var(--color-accent);color:var(--color-on-accent);font-size:11px;line-height:18px;text-align:center}
  /* tabelas viram lista */
  .table{overflow:visible}
  .table__inner{min-width:0!important}
  .table__row--head{display:none!important}
  .table .table__row:not(.table__row--head){display:flex!important;flex-wrap:wrap;align-items:center;gap:4px 12px;padding:12px 16px!important}
  .table .table__row>[role=cell]{min-width:0;max-width:100%;font-size:12.5px;color:var(--color-text-soft)}
  .table .table__row>[role=cell]:first-child{flex:1 1 100%;font-size:14px;color:var(--color-text)}
  .table .table__row>[role=cell][data-label]:not(:first-child)::before{content:attr(data-label) " · ";color:var(--color-text-dim);font-size:11.5px}
  .table .table__row>[role=cell]:empty,.table .table__row>[role=cell].m-empty{display:none}
  .table .table__row .form-actions,.table .table__row .table__actions,.table .table__row .cl-actions{flex:1 1 100%;display:flex;flex-wrap:wrap;gap:8px}
  .table .table__row .form-actions::before,.table .table__row .table__actions::before,.table .table__row .cl-actions::before{display:none}
  .table__primary{font-size:14.5px}
  /* Equipamentos: os cartões grandes com foto viram linhas com foto pequena */
  .gear-grid{grid-template-columns:minmax(0,1fr);gap:8px;padding:4px 12px 14px}
  .gear-card{flex-direction:row;align-items:center}
  .gear-card:hover{transform:none}
  .gear-card__photo{flex:none;width:64px;aspect-ratio:1;margin:10px 0 10px 10px}
  .gear-card__qty{display:none}
  .gear-card__badge{display:none}
  .gear-card__body{min-width:0;padding:10px 14px;gap:2px}
  .gear-card__foot{padding-top:4px}
  /* fichas: rótulo e valor */
  .columns{gap:16px}
  .columns__main,.columns__side{flex-basis:100%;gap:16px}
}
[data-key="dashboard"]>.tabbar__icon,.msheet__ico[data-key="dashboard"]{-webkit-mask-image:url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23000' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'><rect x='1.5' y='1.5' width='5.5' height='5.5' rx='1.5'></rect><rect x='9' y='1.5' width='5.5' height='5.5' rx='1.5'></rect><rect x='1.5' y='9' width='5.5' height='5.5' rx='1.5'></rect><rect x='9' y='9' width='5.5' height='5.5' rx='1.5'></rect></svg>");mask-image:url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23000' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'><rect x='1.5' y='1.5' width='5.5' height='5.5' rx='1.5'></rect><rect x='9' y='1.5' width='5.5' height='5.5' rx='1.5'></rect><rect x='1.5' y='9' width='5.5' height='5.5' rx='1.5'></rect><rect x='9' y='9' width='5.5' height='5.5' rx='1.5'></rect></svg>")}
[data-key="projects"]>.tabbar__icon,.msheet__ico[data-key="projects"]{-webkit-mask-image:url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23000' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'><path d='M8 1.5l6.5 3.5L8 8.5 1.5 5z'></path><path d='M1.5 8.5L8 12l6.5-3.5'></path></svg>");mask-image:url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23000' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'><path d='M8 1.5l6.5 3.5L8 8.5 1.5 5z'></path><path d='M1.5 8.5L8 12l6.5-3.5'></path></svg>")}
[data-key="tasks"]>.tabbar__icon,.msheet__ico[data-key="tasks"]{-webkit-mask-image:url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23000' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'><path d='M3 8.5l3 3 7-7'></path></svg>");mask-image:url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23000' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'><path d='M3 8.5l3 3 7-7'></path></svg>")}
[data-key="clients"]>.tabbar__icon,.msheet__ico[data-key="clients"]{-webkit-mask-image:url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23000' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'><circle cx='6' cy='5.5' r='2.8'></circle><path d='M1.5 14c0-2.5 2-4.3 4.5-4.3s4.5 1.8 4.5 4.3M11 3a2.6 2.6 0 010 5M12.5 9.8c1.3.6 2 2 2 4.2'></path></svg>");mask-image:url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23000' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'><circle cx='6' cy='5.5' r='2.8'></circle><path d='M1.5 14c0-2.5 2-4.3 4.5-4.3s4.5 1.8 4.5 4.3M11 3a2.6 2.6 0 010 5M12.5 9.8c1.3.6 2 2 2 4.2'></path></svg>")}
[data-key="quotes"]>.tabbar__icon,.msheet__ico[data-key="quotes"]{-webkit-mask-image:url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23000' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'><path d='M4 1.5h6l3 3v10H4z'></path><path d='M6.5 8h4M6.5 11h4'></path></svg>");mask-image:url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23000' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'><path d='M4 1.5h6l3 3v10H4z'></path><path d='M6.5 8h4M6.5 11h4'></path></svg>")}
[data-key="team"]>.tabbar__icon,.msheet__ico[data-key="team"]{-webkit-mask-image:url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23000' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'><circle cx='8' cy='5' r='3'></circle><path d='M2.5 14.5c0-3 2.5-5 5.5-5s5.5 2 5.5 5'></path></svg>");mask-image:url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23000' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'><circle cx='8' cy='5' r='3'></circle><path d='M2.5 14.5c0-3 2.5-5 5.5-5s5.5 2 5.5 5'></path></svg>")}
[data-key="equipment"]>.tabbar__icon,.msheet__ico[data-key="equipment"]{-webkit-mask-image:url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23000' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'><rect x='1.5' y='4' width='13' height='9.5' rx='2'></rect><circle cx='8' cy='8.7' r='2.6'></circle><path d='M5.5 4l1-2h3l1 2'></path></svg>");mask-image:url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23000' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'><rect x='1.5' y='4' width='13' height='9.5' rx='2'></rect><circle cx='8' cy='8.7' r='2.6'></circle><path d='M5.5 4l1-2h3l1 2'></path></svg>")}
[data-key="finance"]>.tabbar__icon,.msheet__ico[data-key="finance"]{-webkit-mask-image:url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23000' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'><path d='M1.5 12.5V4.5L8 1.5l6.5 3v8M5 14.5v-5h6v5'></path></svg>");mask-image:url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23000' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'><path d='M1.5 12.5V4.5L8 1.5l6.5 3v8M5 14.5v-5h6v5'></path></svg>")}
[data-key="leads"]>.tabbar__icon,.msheet__ico[data-key="leads"]{-webkit-mask-image:url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23000' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'><circle cx='8' cy='8' r='6.5'></circle><circle cx='8' cy='8' r='3'></circle></svg>");mask-image:url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23000' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'><circle cx='8' cy='8' r='6.5'></circle><circle cx='8' cy='8' r='3'></circle></svg>")}
[data-key="more"]>.tabbar__icon,.msheet__ico[data-key="more"]{-webkit-mask-image:url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23000' stroke-width='1.7' stroke-linecap='round'><path d='M2 4h12M2 8h12M2 12h12'></path></svg>");mask-image:url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23000' stroke-width='1.7' stroke-linecap='round'><path d='M2 4h12M2 8h12M2 12h12'></path></svg>")}
.hero__stats{display:contents}
@media (max-width:640px){.hero__stats{display:flex}}
