/* CRM phone layout: app-style shell, bottom tab bar, bottom sheets, 44px+ touch targets */
@media (max-width:860px){
  html,body{overscroll-behavior-y:contain}
  .app{display:block}
  .side,.top,.d-only{display:none!important}
  .mtop{display:flex;position:sticky;top:0;z-index:30;align-items:center;gap:4px;height:calc(56px + env(safe-area-inset-top));padding:env(safe-area-inset-top) 4px 0 8px;background:var(--shell);color:var(--shell-ink)}
  .mtop img.mk{width:32px;height:32px;margin:0 4px;border-radius:8px}
  .mtop .tt{flex:1;min-width:0;font-family:var(--f-display);font-size:22px;line-height:1.1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .mtop .icon-btn{color:var(--shell-ink)}.mtop .icon-btn:hover{background:#1A2E3D}
  .mtop .av{width:36px;height:36px;border-radius:50%;background:#3CCFC8;color:#0B1B27;font-weight:600;font-size:12px;display:grid;place-items:center;border:0;margin:0 8px 0 2px}
  .page{padding:14px 16px calc(96px + env(safe-area-inset-bottom))}
  .ph{margin-bottom:14px}.ph h1{display:none}.ph .sub{margin-top:0}
  .ph .acts{width:100%}.ph .acts .btn{flex:1}
  .mbar{display:grid;grid-auto-flow:column;grid-auto-columns:1fr;position:fixed;left:0;right:0;bottom:0;z-index:40;background:var(--card);border-top:1px solid var(--border);padding:4px 4px calc(4px + env(safe-area-inset-bottom));box-shadow:0 -4px 16px rgba(11,27,39,.06)}
  .mbar a,.mbar button{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;min-height:56px;font-size:11px;font-weight:500;color:var(--muted);text-decoration:none;border:0;background:none;border-radius:12px;position:relative;cursor:pointer}
  .mbar svg.i{width:24px;height:24px}
  .mbar .on{color:var(--primary)}
  .mbar .on::before{content:"";position:absolute;top:0;left:30%;right:30%;height:3px;border-radius:0 0 3px 3px;background:var(--primary)}
  .mbar .cnt{position:absolute;top:4px;left:calc(50% + 6px);background:var(--primary);color:var(--on-primary);font-size:10px;font-weight:700;border-radius:99px;min-width:16px;padding:0 4px;line-height:16px;text-align:center}
  .fab{display:grid;place-items:center;position:fixed;right:16px;bottom:calc(76px + env(safe-area-inset-bottom));width:56px;height:56px;border-radius:50%;border:0;background:var(--ink);color:var(--bg);box-shadow:var(--shadow-lg);z-index:35;cursor:pointer}
  .fab svg.i{width:26px;height:26px}
  .fab.hidden{display:none}
  body.typing .mbar,body.typing .fab{display:none}

  .grid-k{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
  .kpi .v{font-size:24px}
  .cols2,.cols2e,.cols3,.calwrap{grid-template-columns:minmax(0,1fr)}
  .card{padding:14px;border-radius:var(--r-lg)}
  .toolbar .search{max-width:none;min-width:100%}
  .toolbar select{flex:1}
  .hero h1{font-size:28px}

  /* sheets become bottom sheets */
  .sheet-wrap{align-items:flex-end;padding:0}
  .sheet,.sheet.wide{width:100%;max-height:92vh;border-radius:24px 24px 0 0;animation:up .22s ease-out;padding-bottom:env(safe-area-inset-bottom)}
  .sheet-h{position:relative;padding-top:18px}
  .sheet-h::before{content:"";position:absolute;top:6px;left:50%;width:40px;height:4px;margin-left:-20px;border-radius:4px;background:var(--border)}
  .sheet-f{position:sticky;bottom:0;background:var(--card)}
  .sheet-f .btn{flex:1}
  .toast{bottom:calc(84px + env(safe-area-inset-bottom))}
  .field input,.field select,.field textarea{font-size:16px}  /* stops iOS zoom on focus */

  /* kanban: one column per swipe */
  .kan{scroll-snap-type:x mandatory;margin:0 -16px;padding:0 16px 8px;scroll-padding:0 16px}
  .kcol{width:86vw;scroll-snap-align:center}
  /* calendar: compact month with dots, agenda below */
  .calh h2{font-size:20px;min-width:0;flex:1;white-space:nowrap;text-align:center}
  .cd{min-height:54px;align-items:center;padding:3px 0}
  .cd .evc,.cd .more{display:none}
  .cd .dots{display:flex}
  .cd .dots i{width:6px;height:6px;border-radius:50%;background:var(--kc,var(--muted))}
  .cal .dh{padding:6px 0;font-size:10px}
  .brd{grid-template-columns:120px repeat(14,72px)}
  .prow{grid-template-columns:minmax(0,1.3fr) repeat(2,minmax(60px,1fr));font-size:12px}
  .prow>.hide-m{display:none}
  .prow.src{grid-template-columns:minmax(0,1.4fr) 44px 1fr}
  .heat{grid-template-columns:54px repeat(7,1fr)}
  .tabs{margin:0 -16px;padding:0 12px}
}
@media (max-width:860px){.btn.tiny{min-height:44px}}
@media (max-width:420px){.fgrid{grid-template-columns:1fr}.kpi .v{font-size:22px}}
@media (min-width:861px){.m-only{display:none!important}}
@media (max-width:860px){.m-only{display:revert}}
