/* ShardsDiet 3.3.4 — stable mobile browser chrome. Desktop remains untouched. */
@media(max-width:820px){
  :root{--mobile-nav-height:72px;--mobile-nav-clearance:156px;--mobile-header-space:76px;--mobile-visual-height:100dvh}
  html,body{scroll-padding-bottom:calc(var(--mobile-nav-clearance) + env(safe-area-inset-bottom));overscroll-behavior-y:contain}
  body{padding-bottom:0!important}
  .siteFooter{display:none!important}
  #appView>main,.desktopWorkspace>main{padding-bottom:calc(var(--mobile-nav-clearance) + env(safe-area-inset-bottom))!important;scroll-padding-bottom:calc(var(--mobile-nav-clearance) + env(safe-area-inset-bottom))}
  .desktopWorkspace>main>*:last-child{margin-bottom:18px}
  #appView>main::after,.desktopWorkspace>main::after{content:"";display:block;height:calc(var(--mobile-nav-clearance) + 30px + env(safe-area-inset-bottom));width:100%}


  /* Header stabile con barra indirizzi Safari sia in alto sia in basso */
  .mobileCompactHeader{display:flex!important;position:fixed!important;top:0!important;left:0!important;right:0!important;width:100%!important;height:auto!important;min-height:64px!important;margin:0!important;padding:calc(8px + env(safe-area-inset-top)) 10px 9px!important;z-index:260!important;background:rgba(248,251,253,.985)!important;border-bottom:1px solid rgba(191,218,213,.96)!important;box-shadow:0 10px 28px rgba(18,32,51,.08)!important;backdrop-filter:blur(18px);-webkit-backdrop-filter:blur(18px);transform:translateZ(0);will-change:transform;isolation:isolate}
  #appView>main,.desktopWorkspace>main{padding-top:calc(var(--mobile-header-space) + 10px)!important;scroll-padding-top:calc(var(--mobile-header-space) + 10px)!important}
  .mobileClientStickyToolbar,.mobileFoodStickyToolbar,.mobileArchiveSticky,.mobileAgendaToolbar{top:calc(var(--mobile-header-space) + 2px)!important}
  .mobileAgendaDayTitle{top:calc(var(--mobile-header-space) + 2px)!important}
  .mobileBottomNav{position:fixed!important;left:0!important;right:0!important;bottom:0!important;transform:translateZ(0);will-change:transform}
  html.sd-mobile-keyboard-open .mobileBottomNav{visibility:hidden;pointer-events:none}
  html.sd-mobile-keyboard-open #appView>main,html.sd-mobile-keyboard-open .desktopWorkspace>main{padding-bottom:24px!important}
  .mobileFullScreenCard,.mobileWizardCard{height:var(--mobile-visual-height)!important;max-height:var(--mobile-visual-height)!important}
  .mobileBottomSheetCard{max-height:min(calc(var(--mobile-visual-height) * .86),760px)!important}

  /* Bottom navigation */
  .mobileBottomNav{height:calc(var(--mobile-nav-height) + env(safe-area-inset-bottom));padding:8px 7px calc(7px + env(safe-area-inset-bottom));display:grid!important;grid-template-columns:repeat(5,minmax(0,1fr));align-items:end;overflow:visible;background:#fff;border-top:1px solid rgba(207,224,224,.92);box-shadow:0 -12px 34px rgba(18,32,51,.12);backdrop-filter:blur(18px)}
  .mobileBottomNav>button{position:relative;min-width:0;height:54px;padding:5px 2px;border:0;border-radius:16px;background:transparent;color:#66778a;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;font-size:10px;font-weight:850;box-shadow:none!important;overflow:visible}
  .mobileBottomNav>button.active:not(.mobileNavPrimary){color:#008f78;background:#ebfff8}
  .mobileBottomNav .mobileNavIcon{width:25px;height:25px;display:grid;place-items:center}
  .mobileBottomNav .mobileNavIcon svg{width:22px;height:22px;display:block}
  .mobileBottomNav .mobileNavLabel{line-height:1;white-space:nowrap}
  .mobileBottomNav .mobileNavPrimary{height:68px;margin-top:-20px;color:#fff;z-index:2}
  .mobileBottomNav .mobileNavPrimary .mobileNavIcon{width:52px;height:52px;border-radius:999px;background:linear-gradient(135deg,#00d4a1,#1bbfea);border:5px solid #fff;box-shadow:0 12px 26px rgba(0,176,158,.3);color:#fff}
  .mobileBottomNav .mobileNavPrimary .mobileNavIcon svg{width:25px;height:25px}
  .mobileBottomNav .mobileNavPrimary .mobileNavLabel{margin-top:-1px;color:#087b69;font-weight:950}
  .mobileBottomNav .mobileNavPrimary.active .mobileNavIcon{background:linear-gradient(135deg,#00bb8c,#0b9fe2);transform:translateY(-2px)}
  .mobileNativeIcon{display:inline-grid;width:22px;height:22px;place-items:center;flex:0 0 auto}
  .mobileNativeIcon svg{width:100%;height:100%;display:block}

  /* Login mobile in stile PWA */
  #loginView.hero{width:100%;min-height:100dvh;padding:calc(18px + env(safe-area-inset-top)) 14px calc(22px + env(safe-area-inset-bottom));justify-content:center;gap:0;background:radial-gradient(circle at 10% 8%,rgba(0,217,155,.22),transparent 31%),radial-gradient(circle at 92% 18%,rgba(127,85,255,.16),transparent 32%),linear-gradient(180deg,#f5fffc 0%,#f4f9ff 54%,#eef6f8 100%);overflow:hidden}
  #loginView .loginPwaCard{width:100%;max-width:430px;margin:auto;display:flex!important;flex-direction:column;gap:12px}
  #loginView .loginPwaIntro{position:relative;padding:20px 18px 18px!important;border:0!important;border-radius:26px!important;background:rgba(255,255,255,.72)!important;box-shadow:0 18px 46px rgba(18,32,51,.08)!important;backdrop-filter:blur(20px);text-align:center;align-items:center;overflow:hidden}
  #loginView .loginPwaIntro::after{content:"";position:absolute;inset:auto -35px -62px;width:190px;height:190px;border-radius:50%;background:radial-gradient(circle,rgba(0,210,164,.22),transparent 68%);pointer-events:none}
  #loginView .loginPwaIntro>.badge{align-self:center;position:relative;z-index:1;background:#effff9;border-color:#bcebdd;color:#08755e;font-size:10px}
  #loginView .loginBrandStrip{display:flex!important;flex-direction:column;align-items:center;gap:10px;margin-top:14px;position:relative;z-index:1}
  #loginView .loginBrandLogo{order:-1;width:96px!important;max-width:96px!important;height:96px;display:grid;place-items:center;padding:8px;border:1px solid rgba(202,223,222,.95);border-radius:25px;background:#fff;box-shadow:0 14px 30px rgba(0,183,166,.15)}
  #loginView .loginBrandLogo .heroLogo{width:100%;height:100%;object-fit:contain;margin:0;filter:none}
  #loginView .loginBrandText{display:grid;gap:7px}
  #loginView .loginBrandText h2,#loginView .heroCopy .loginBrandText h2{margin:0;font-size:33px;line-height:1;letter-spacing:-.065em}
  #loginView .loginBrandText p{margin:0 auto;max-width:330px;font-size:13px;line-height:1.5;color:#607286}
  #loginView .loginPwaForm{padding:20px!important;border:1px solid rgba(205,221,223,.98)!important;border-radius:26px!important;background:rgba(255,255,255,.96)!important;box-shadow:0 22px 58px rgba(18,32,51,.12)!important}
  #loginView .loginPwaForm>.brand{justify-content:center;text-align:center;gap:0}
  #loginView .loginPwaForm>.brand .logoMark{display:none}
  #loginView .loginPwaForm>.brand h1{font-size:21px;letter-spacing:-.035em}
  #loginView .loginPwaForm>.brand p{margin-top:4px;font-size:11px;color:var(--muted)}
  #loginView .loginPwaForm .space{height:14px}
  #loginView .loginPwaForm label{font-size:11px;letter-spacing:.06em}
  #loginView .loginPwaForm input[type=email],#loginView .loginPwaForm input[type=password]{min-height:54px;border-radius:17px;padding:14px 15px;background:#fbfefd;border-color:#d5e3e4;font-size:16px}
  #loginView .loginPwaForm label:has(input[type=checkbox]){padding:4px 2px;color:#516274;font-size:13px!important;font-weight:800}
  #loginView .loginPwaSubmit{min-height:54px;border-radius:17px!important;font-size:15px;font-weight:950;background:linear-gradient(135deg,#00d19d,#18bce6)!important;color:#07333a!important;box-shadow:0 14px 28px rgba(0,190,165,.2)!important}
  #loginView .loginSecurityNote{display:flex;align-items:center;justify-content:center;gap:7px;margin-top:13px;color:#738294;font-size:10px;font-weight:750;text-align:center;line-height:1.4}
  #loginView .loginSecurityNote span{width:7px;height:7px;border-radius:50%;background:#12b886;box-shadow:0 0 0 4px rgba(18,184,134,.11);flex:0 0 auto}
  #loginView>.siteFooter{display:none!important}

  /* Common sticky search/toolbars */
  .mobileClientWorkspace,.mobileFoodWorkspace,.mobileAgendaWorkspace{display:grid;gap:14px;margin-top:-4px}
  .mobileClientStickyToolbar,.mobileFoodStickyToolbar,.mobileAgendaToolbar{position:sticky;top:66px;z-index:32;margin:0 -14px;padding:10px 14px 12px;background:linear-gradient(180deg,rgba(247,252,253,.99) 78%,rgba(247,252,253,0));backdrop-filter:blur(14px)}
  .mobileClientStickyToolbar{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:9px;align-items:center}
  .mobileSearchField{min-width:0;height:46px;display:flex;align-items:center;gap:9px;padding:0 12px;border:1px solid var(--stroke);border-radius:15px;background:#fff;box-shadow:0 8px 22px rgba(18,32,51,.06)}
  .mobileSearchField .mobileNativeIcon{width:20px;height:20px;color:#708096}
  .mobileSearchField input{width:100%;min-width:0;height:42px;min-height:0;padding:0;border:0!important;box-shadow:none!important;background:transparent!important}
  .mobileNewClientButton,.mobileFoodAddButton{height:46px;min-width:46px;padding:0 13px!important;border-radius:15px!important;display:flex;align-items:center;justify-content:center;gap:6px;white-space:nowrap;background:linear-gradient(135deg,#00cf9b,#18bce6)!important;color:#062f33!important;box-shadow:0 10px 22px rgba(0,190,165,.18)!important}
  .mobileNewClientButton .mobileNativeIcon,.mobileFoodAddButton .mobileNativeIcon{width:19px;height:19px}

  /* Compact client cards */
  .mobileClientCards{display:grid;gap:11px}
  .mobilePatientCard{border:1px solid var(--stroke);border-radius:19px;background:#fff;box-shadow:0 10px 26px rgba(18,32,51,.06);overflow:hidden}
  .mobilePatientMain{width:100%;display:grid;grid-template-columns:50px minmax(0,1fr) 20px;gap:12px;align-items:center;padding:15px;border:0;background:linear-gradient(135deg,#fff,#fbfffe);color:var(--text);text-align:left;box-shadow:none}
  .mobilePatientAvatar{width:50px;height:50px;border-radius:16px;display:grid;place-items:center;background:linear-gradient(135deg,#dffff6,#e9f2ff);border:1px solid #ccebe4;color:#087963;font-size:16px;font-weight:1000}
  .mobilePatientInfo{min-width:0;display:grid;gap:4px}
  .mobilePatientInfo b{font-size:16px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .mobilePatientInfo span{font-size:13px;color:#45566a;font-weight:850}
  .mobilePatientInfo small{font-size:11px;color:var(--muted);font-weight:750}
  .mobilePatientMain>.mobileNativeIcon{color:#8a99aa;width:18px;height:18px}
  .mobilePatientFooter,.mobileFoodCardFooter{display:flex;align-items:center;justify-content:space-between;padding:9px 12px;border-top:1px solid var(--stroke);background:#fbfefd}
  .mobilePatientFooter .btn,.mobileFoodCardFooter .btn{min-width:92px;min-height:38px;margin:0}
  .mobileEllipsisButton{width:40px;height:38px;padding:0;border:1px solid var(--stroke);border-radius:13px;background:#fff;color:#45566a;display:grid;place-items:center;box-shadow:none}
  .mobileEllipsisButton .mobileNativeIcon{width:20px;height:20px}

  /* Native empty state */
  .mobileNativeEmpty{min-height:160px;padding:28px 20px;border:1px dashed var(--stroke-strong);border-radius:20px;background:rgba(255,255,255,.7);display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;text-align:center;color:var(--muted)}
  .mobileNativeEmpty b{color:var(--text);font-size:16px}
  .mobileNativeEmpty span{font-size:13px;line-height:1.45}

  /* Bottom sheets and full-screen routes */
  .modalBackdrop.mobileSheetBackdrop{align-items:flex-end!important;padding:0!important;background:rgba(9,22,35,.48)!important}
  .mobileBottomSheetCard{width:100%!important;max-width:none!important;max-height:min(86dvh,760px)!important;margin:0!important;border-radius:24px 24px 0 0!important;border-bottom:0!important;padding:0 15px calc(18px + env(safe-area-inset-bottom))!important;overflow:auto!important;box-shadow:0 -22px 70px rgba(9,22,35,.24)!important}
  .mobileSheetHandle{position:sticky;top:0;z-index:6;width:42px;height:5px;margin:8px auto 5px;border-radius:999px;background:#cbd7dd;touch-action:none}
  .mobileBottomSheetCard>.modalHead{position:sticky!important;top:0!important;z-index:5;margin:0 -2px 12px!important;padding:12px 2px!important;min-height:70px;background:#fff!important;border-bottom:1px solid var(--stroke);box-shadow:0 10px 22px rgba(18,32,51,.08);display:grid!important;grid-template-columns:minmax(0,1fr) auto;align-items:center!important;gap:12px!important}
  .mobileBottomSheetCard>.modalHead h3{font-size:19px!important;margin:0!important;min-height:44px;display:flex;align-items:center;line-height:1.15!important}
  .mobileBottomSheetCard>.modalHead .modalControls{height:44px;display:flex!important;align-items:center!important;align-self:center!important}
  .mobileFullScreenBackdrop{padding:0!important;background:#fff!important}
  .mobileFullScreenCard{width:100%!important;height:100dvh!important;max-width:none!important;max-height:none!important;margin:0!important;border:0!important;border-radius:0!important;padding:0 14px calc(16px + env(safe-area-inset-bottom))!important;overflow:auto!important;box-shadow:none!important}
  .mobileFullScreenCard>.mobileSheetHandle{display:none}
  .mobileFullScreenCard>.modalHead{position:sticky!important;top:0!important;z-index:12;margin:0 -14px 0!important;padding:12px 14px!important;min-height:70px;background:rgba(255,255,255,.98)!important;border-bottom:1px solid var(--stroke);backdrop-filter:blur(16px);display:grid!important;grid-template-columns:minmax(0,1fr) auto;align-items:center!important;gap:12px!important}
  .mobileFullScreenCard>.modalHead h3{font-size:19px!important;margin:0!important;min-height:44px;display:flex;align-items:center;line-height:1.15!important}
  .mobileFullScreenCard>.modalHead .modalControls{height:44px;display:flex!important;align-items:center!important;align-self:center!important}
  .mobileFullScreenCard .modalClose,.mobileBottomSheetCard .modalClose{width:42px!important;height:42px!important;min-width:42px!important;border-radius:14px!important;align-self:center!important}
  .mobileActionList{display:grid;gap:7px}
  .mobileActionList>button{width:100%;min-height:62px;padding:11px 8px;border:0;border-bottom:1px solid var(--stroke);border-radius:0;background:transparent;color:var(--text);display:grid;grid-template-columns:28px minmax(0,1fr) 18px;gap:10px;align-items:center;text-align:left;box-shadow:none}
  .mobileActionList>button:last-child{border-bottom:0}
  .mobileActionList>button>span:nth-child(2){display:grid;gap:3px;min-width:0}
  .mobileActionList>button b{font-size:14px}
  .mobileActionList>button small{font-size:11px;color:var(--muted);font-weight:700}
  .mobileActionList>button>.mobileNativeIcon:first-child{width:23px;height:23px;color:#0a8f7a}
  .mobileActionList>button>.mobileNativeIcon:last-child{width:17px;height:17px;color:#96a3b0}
  .mobileActionList>button.danger,.mobileActionList>button.danger>.mobileNativeIcon:first-child{color:#c93154}

  /* Guided forms */
  .mobileWizardCard{height:100dvh!important;max-height:100dvh!important;overflow:hidden!important;display:flex!important;flex-direction:column!important;min-height:0!important}
  .mobileWizardProgress{position:relative;z-index:10;flex:0 0 auto;margin:0 -14px;padding:12px 16px;background:rgba(250,253,253,.98);border-bottom:1px solid var(--stroke);backdrop-filter:blur(14px)}
  .mobileWizardProgressTop{display:flex;align-items:center;justify-content:space-between;gap:12px;font-size:12px;color:var(--muted)}
  .mobileWizardProgressTop b{color:var(--text);font-size:13px}
  .mobileWizardProgressTrack{display:grid;grid-template-columns:repeat(4,1fr);gap:6px;margin-top:10px}
  .mobileWizardProgressTrack i{height:5px;border-radius:999px;background:#dce7e9;transition:.2s ease}
  .mobileWizardProgressTrack i.active{background:linear-gradient(90deg,#00cc98,#20b9e8)}
  form[data-mobile-wizard="1"]{display:block!important;flex:1 1 auto!important;min-height:0!important;overflow-y:auto!important;-webkit-overflow-scrolling:touch;overscroll-behavior:contain;padding:14px 0 0!important;scroll-padding-bottom:112px;padding-bottom:104px!important}
  .mobileWizardStep{display:none!important;grid-template-columns:1fr!important;gap:13px!important;animation:mobileStepIn .2s ease}
  .mobileWizardStep.active{display:grid!important;padding-bottom:16px!important}
  .mobileWizardStep>div,.mobileWizardStep>.panel{grid-column:1/-1!important;min-width:0}
  .mobileWizardStep .bodyCompRow{grid-template-columns:minmax(0,1fr) auto!important}
  .mobileWizardStep .bodyCompEditBtn{width:auto!important;min-width:88px!important}
  .mobileWizardStep .checkTopRow{display:grid!important;grid-template-columns:1fr!important;gap:12px!important}
  .mobileWizardStep .checkSourceRow{display:grid!important;grid-template-columns:1fr!important;gap:10px!important}
  .mobileWizardStep .checkSourceRow .btn{width:100%!important}
  .mobileWizardFooter{position:fixed;left:0;right:0;bottom:0;z-index:430;display:grid;grid-template-columns:1fr 1fr;gap:10px;margin:0;padding:10px 14px calc(10px + env(safe-area-inset-bottom));background:rgba(255,255,255,.99);border-top:1px solid var(--stroke);box-shadow:0 -10px 30px rgba(18,32,51,.1);backdrop-filter:blur(16px)}
  .mobileWizardFooter .btn{height:48px;margin:0;display:flex;align-items:center;justify-content:center;gap:7px}
  .mobileWizardFooter .mobileNativeIcon{width:19px;height:19px}
  .mobileWizardNativeSubmit{display:none!important}
  @keyframes mobileStepIn{from{opacity:0;transform:translateX(10px)}to{opacity:1;transform:none}}

  /* Food catalogue cards */
  .mobileFoodStickyToolbar{display:grid;gap:9px}
  .mobileFoodPrimaryRow{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px}
  .mobileFoodSecondaryRow{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px}
  .mobileFoodSecondaryRow select{height:44px;min-height:44px;border-radius:14px;background:#fff}
  .mobileBarcodeButton{height:44px;padding:0 12px;border:1px solid #ffd19b;border-radius:14px;background:#fff7eb;color:#8c540b;display:flex;align-items:center;gap:7px;font-weight:900;white-space:nowrap;box-shadow:none}
  .mobileBarcodeButton .mobileNativeIcon{width:20px;height:20px}
  .mobileFoodScopeRow{display:flex;gap:7px;overflow-x:auto;padding-bottom:2px;scrollbar-width:none}
  .mobileFoodScopeRow::-webkit-scrollbar{display:none}
  .mobileFoodScopeRow label{display:flex;align-items:center;gap:6px;flex:0 0 auto;margin:0;padding:7px 10px;border:1px solid var(--stroke);border-radius:999px;background:#fff;font-size:11px;font-weight:850}
  .mobileFoodScopeRow input{width:auto;min-height:0;accent-color:#00ba8a}
  .mobileFoodCards{display:grid;gap:11px}
  .mobileFoodResultMeta{padding:0 2px;color:var(--muted);font-size:12px}
  .mobileFoodCard{border:1px solid var(--stroke);border-radius:19px;background:#fff;overflow:hidden;box-shadow:0 10px 25px rgba(18,32,51,.06)}
  .mobileFoodCardMain{width:100%;padding:15px;border:0;background:#fff;color:var(--text);display:grid;gap:13px;text-align:left;box-shadow:none}
  .mobileFoodCardTitle{display:grid;gap:4px}
  .mobileFoodCardTitle b{font-size:16px;line-height:1.25}
  .mobileFoodCardTitle small{font-size:12px;color:var(--muted);font-weight:750}
  .mobileFoodMacros{display:grid;grid-template-columns:repeat(3,1fr);gap:7px}
  .mobileFoodMacros span{min-width:0;padding:9px 6px;border:1px solid #dceae8;border-radius:13px;background:#f8fcfb;color:#617083;font-size:10px;font-weight:800;text-align:center}
  .mobileFoodMacros b{display:block;margin-bottom:2px;color:var(--text);font-size:14px}
  .mobileLoadMore{width:100%;min-height:46px;margin:2px 0 0}
  .mobileFullScreenCard form[id$="FoodForm"]{display:grid!important;grid-template-columns:1fr!important;padding:14px 0 78px!important}
  .mobileFullScreenCard form[id$="FoodForm"]>div{grid-column:1/-1!important}
  .mobileFullScreenCard form[id$="FoodForm"]>button:last-child{position:fixed;left:14px;right:14px;bottom:calc(10px + env(safe-area-inset-bottom));z-index:421;height:50px;margin:0;box-shadow:0 12px 30px rgba(0,189,153,.25)}



  /* v3.2.8: compact day headers on phones */
  .dietDay>.daySummary{display:flex!important;align-items:center!important;flex-wrap:nowrap!important;gap:10px!important;min-height:68px!important;padding:13px 14px 13px 16px!important}
  .dietDay>.daySummary .daySummaryTitle{width:auto!important;flex:1 1 auto!important;min-width:0!important;display:block!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important}
  .dietDay>.daySummary:after{flex:0 0 auto!important;margin-left:auto!important;display:grid!important;place-items:center!important;width:36px!important;height:36px!important;border:1px solid var(--stroke)!important;border-radius:12px!important;background:#fff!important;font-size:22px!important;line-height:1!important}

  /* Mobile diet archive */
  .mobileArchiveWorkspace{display:grid;gap:13px;margin-top:-3px}
  .mobileArchiveSummary{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:14px;padding:16px;border:1px solid var(--stroke);border-radius:21px;background:linear-gradient(135deg,#fff,#eafff7 62%,#eaf5ff);box-shadow:0 10px 28px rgba(18,32,51,.06)}
  .mobileArchiveSummary>div:first-child{min-width:0}.mobileArchiveSummary>div:first-child>span{display:inline-flex;padding:4px 8px;border-radius:999px;background:#dcfff4;color:#08755e;font-size:9px;font-weight:1000;letter-spacing:.06em;text-transform:uppercase}.mobileArchiveSummary h3{margin:7px 0 3px;font-size:20px;letter-spacing:-.04em}.mobileArchiveSummary p{margin:0;color:var(--muted);font-size:11px}
  .mobileArchiveNewButton{align-self:start;min-height:42px;padding:0 11px;border:0;border-radius:14px;background:linear-gradient(135deg,#00ce9a,#18bce6);color:#06353a;display:flex;align-items:center;gap:6px;font-size:11px;font-weight:950;box-shadow:0 10px 22px rgba(0,190,165,.18)}.mobileArchiveNewButton .mobileNativeIcon{width:18px;height:18px}
  .mobileArchiveStats{grid-column:1/-1;display:grid;grid-template-columns:repeat(3,1fr);gap:7px}.mobileArchiveStats>button,.mobileArchiveStats>div{min-width:0;padding:10px 6px;border:1px solid rgba(198,222,218,.92);border-radius:14px;background:rgba(255,255,255,.8);color:var(--text);display:grid;gap:2px;text-align:center;box-shadow:none}.mobileArchiveStats>button.active{border-color:#51d0b4;background:#effff9}.mobileArchiveStats b{font-size:20px;letter-spacing:-.04em}.mobileArchiveStats span{color:var(--muted);font-size:9px;font-weight:900}
  .mobileArchiveSticky{position:sticky;top:66px;z-index:31;margin:0 -14px;padding:9px 14px 11px;background:linear-gradient(180deg,rgba(247,252,253,.99) 88%,rgba(247,252,253,0));backdrop-filter:blur(14px);display:grid;gap:8px}
  .mobileArchiveTabs{display:grid;grid-template-columns:1fr 1fr;gap:4px;padding:4px;border-radius:14px;background:#edf3f5}.mobileArchiveTabs button{min-height:38px;padding:7px;border:0;border-radius:11px;background:transparent;color:#647587;font-size:11px;font-weight:950;box-shadow:none}.mobileArchiveTabs button.active{background:#fff;color:var(--text);box-shadow:0 4px 12px rgba(18,32,51,.08)}.mobileArchiveTabs span{display:inline-grid;place-items:center;min-width:20px;height:20px;margin-left:4px;padding:0 5px;border-radius:999px;background:#e5eef1;font-size:9px}.mobileArchiveTabs button.active span{background:#dffff5;color:#08755e}
  .mobileArchiveFilters{display:grid;grid-template-columns:1fr 1fr;gap:7px}.mobileArchiveFilters select{height:42px;min-height:42px;padding:7px 9px;border-radius:13px;background:#fff;font-size:11px}
  .mobileArchiveResults{display:flex;align-items:center;gap:5px;padding:0 2px;color:var(--muted);font-size:10px;font-weight:800}.mobileArchiveResults b{color:var(--text);font-size:12px}.mobileArchiveResults button{margin-left:auto;padding:4px 7px;border:0;border-radius:8px;background:#fff0f3;color:#b42546;font-size:9px;font-weight:950}
  .mobileArchiveGroups{display:grid;gap:12px}.mobileArchivePatientCard{border:1px solid var(--stroke);border-radius:19px;background:#fff;overflow:hidden;box-shadow:0 9px 25px rgba(18,32,51,.05)}
  .mobileArchivePatientHead{display:grid;grid-template-columns:44px minmax(0,1fr) auto;gap:10px;align-items:center;padding:13px 14px;border-bottom:1px solid var(--stroke);background:linear-gradient(135deg,#fbfefe,#f2fbf8)}.mobileArchivePatientAvatar{width:44px;height:44px;display:grid;place-items:center;border-radius:14px;background:linear-gradient(135deg,#dffff5,#def4ff);color:#08755e;font-size:14px;font-weight:1000}.mobileArchivePatientInfo{min-width:0;display:grid;gap:3px}.mobileArchivePatientInfo b{font-size:14px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.mobileArchivePatientInfo small{color:var(--muted);font-size:9px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.mobileArchivePatientCount{display:grid;text-align:right}.mobileArchivePatientCount b{font-size:19px}.mobileArchivePatientCount small{color:var(--muted);font-size:8px;font-weight:850}
  .mobileArchiveDietList{display:grid}.mobileArchiveDietCard{border-bottom:1px solid #edf2f4}.mobileArchiveDietCard:last-child{border-bottom:0}.mobileArchiveDietMain{width:100%;padding:13px 14px 10px;border:0;background:#fff;color:var(--text);display:grid;gap:5px;text-align:left;box-shadow:none}.mobileArchiveDietTitle{display:flex;align-items:center;gap:7px;min-width:0}.mobileArchiveDietTitle b{min-width:0;font-size:13px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.mobileArchiveStatus{flex:0 0 auto;padding:4px 6px;border-radius:999px;font-size:7px;font-weight:1000;letter-spacing:.05em;text-transform:uppercase}.mobileArchiveStatus.saved{background:#e1fff5;color:#08755e}.mobileArchiveStatus.draft{background:#fff2d8;color:#9f5900}.mobileArchiveDietMain>small{color:var(--muted);font-size:9px}.mobileArchiveMeta{display:flex;gap:4px;flex-wrap:wrap;margin-top:3px}.mobileArchiveMeta i{padding:4px 6px;border:1px solid #e1eaed;border-radius:999px;background:#f8fbfc;color:#607486;font-size:7px;font-style:normal;font-weight:850}
  .mobileArchiveDietFooter{display:flex;align-items:center;justify-content:space-between;padding:8px 12px 10px;background:#fbfefd}.mobileArchiveDietFooter .btn{min-width:112px;min-height:37px;margin:0}.mobileArchiveEmpty{min-height:230px;padding:26px 18px;border:1px dashed var(--stroke-strong);border-radius:20px;background:rgba(255,255,255,.75);display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;text-align:center}.mobileArchiveEmpty>span{width:52px;height:52px;display:grid;place-items:center;border-radius:17px;background:linear-gradient(135deg,#e2fff6,#e4f4ff);color:#11856e}.mobileArchiveEmpty>span .mobileNativeIcon{width:27px;height:27px}.mobileArchiveEmpty b{font-size:16px}.mobileArchiveEmpty p{margin:0 0 3px;color:var(--muted);font-size:12px;line-height:1.45}.mobileArchiveEmpty .btn{width:100%;margin:0}

  /* Mobile agenda */

  .mobileBottomNav{padding:8px 7px calc(12px + env(safe-area-inset-bottom));background:rgba(255,255,255,.98)}
  .clientRecordBody,.mobileArchiveWorkspace,.mobileFoodWorkspace,.mobileClientWorkspace,.mobileAgendaWorkspace{padding-bottom:18px}
  .mobileClientHeader{gap:14px}
  .mobileClientHeaderActions{display:grid;grid-template-columns:1fr 1fr;gap:10px}
  .mobileClientHeaderActions .btn{min-height:44px;margin:0;border-radius:15px;padding:0 12px;font-size:14px}
  .mobileClientTabs{display:grid;grid-auto-flow:column;grid-auto-columns:max-content;gap:8px;overflow-x:auto;padding:4px 2px 10px;margin:10px 0 0;scrollbar-width:none}
  .mobileClientTabs::-webkit-scrollbar{display:none}
  .mobileClientTabs button{min-height:42px;padding:9px 14px;border-radius:14px;background:#fff;color:#66778a;border:1px solid var(--stroke);font-size:13px;font-weight:900;box-shadow:none}
  .mobileClientTabs button.active{background:linear-gradient(135deg,#e5fff7,#edf5ff);color:#0b4a4a;border-color:#4ed0b7;box-shadow:0 8px 18px rgba(0,190,165,.14)}
  .mobileClientOverviewPanel{display:grid;gap:14px}
  .mobileClientStatGrid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
  .mobileClientStatGrid .stat{min-width:0}
  .mobileClientInfoList{display:grid;gap:10px}
  .mobileClientInfoRow{display:flex;align-items:flex-start;justify-content:space-between;gap:14px;padding:12px 14px;border:1px solid var(--stroke);border-radius:16px;background:#fbfefd}
  .mobileClientInfoRow span{flex:1 1 auto;color:#617083;font-size:13px;font-weight:800;line-height:1.35}
  .mobileClientInfoRow b{flex:0 0 auto;max-width:60%;text-align:right;color:var(--text);font-size:15px;line-height:1.35}
  .mobileClientNotesCard{padding:14px 15px;border:1px solid var(--stroke);border-radius:18px;background:linear-gradient(135deg,#fff,#fbfffe)}
  .mobileClientNotesCard h3{margin:0 0 8px;font-size:16px}
  .mobileClientNotesCard p{margin:0;color:#425363;line-height:1.6;white-space:pre-wrap}
  .mobileClientNotesCard.standalone p{min-height:80px}
  .mobileClientActionGrid{display:grid;grid-template-columns:1fr 1fr;gap:10px}
  .mobileClientActionGrid .btn{min-height:44px;margin:0;border-radius:15px;padding:0 12px;font-size:13px}
  .mobileClientRecordBody .between{gap:10px;align-items:center}
  .mobileClientRecordBody .between .btn.small{min-height:38px;padding:0 11px;border-radius:12px}
  .mobileClientRecordList{display:grid;gap:10px}
  .mobileClientRecordCard{display:grid;gap:10px;padding:14px;border:1px solid var(--stroke);border-radius:18px;background:#fff}
  .mobileClientRecordCard b{display:block;font-size:15px}
  .mobileClientRecordCard small{display:block;margin-top:4px;color:var(--muted)}
  .mobileClientRecordActions{display:flex;flex-wrap:wrap;gap:8px;align-items:center}
  .mobileClientRecordActions .btn{margin:0}
  .mobileClientRecordActions .pill{margin-right:auto}
  .mobileFullScreenCard .detailTable,.mobileFullScreenCard .detailGrid,.mobileFullScreenCard .grid{background:#fff}
  .mobileFullScreenCard>.modalHead{box-shadow:0 10px 24px rgba(18,32,51,.08)}
  .mobileMonthCard{padding:14px;border:1px solid var(--stroke);border-radius:20px;background:#fff;box-shadow:0 8px 24px rgba(18,32,51,.05)}
  .mobileMonthNav{display:grid;grid-template-columns:38px 1fr 38px;gap:8px;align-items:center;margin-bottom:12px}
  .mobileMonthNav>button{width:38px;height:38px;padding:0;border:1px solid var(--stroke);border-radius:12px;background:#fff;color:var(--text);display:grid;place-items:center;box-shadow:none}
  .mobileMonthNav>button .mobileNativeIcon{width:18px;height:18px}
  .mobileMonthNav>b{text-align:center;font-size:15px;text-transform:capitalize}
  .mobileMonthDow{display:grid;grid-template-columns:repeat(7,1fr);gap:6px;margin-bottom:8px}
  .mobileMonthDow span{text-align:center;font-size:10px;font-weight:900;color:var(--muted);text-transform:uppercase}
  .mobileMonthGrid{display:grid;grid-template-columns:repeat(7,1fr);gap:6px}
  .mobileMonthCell{min-width:0;min-height:58px;padding:7px 4px;border:1px solid var(--stroke);border-radius:15px;background:#fff;color:var(--text);display:grid;align-content:space-between;justify-items:center;gap:7px;box-shadow:none}
  .mobileMonthCell.otherMonth{background:#f7fafc;color:#96a3af}
  .mobileMonthCell.today{border-color:#77dcca}
  .mobileMonthCell.active{background:linear-gradient(135deg,#e2fff7,#e9f4ff);border-color:#46d6bc;box-shadow:0 8px 18px rgba(0,190,165,.12)}
  .mobileMonthCell.hasEvents .mobileMonthDayNum{font-weight:1000}
  .mobileMonthDayNum{font-size:14px;font-weight:850}
  .mobileMonthIndicators{display:flex;align-items:center;justify-content:center;gap:3px;min-height:10px}
  .mobileMonthIndicators i{width:5px;height:5px;border-radius:999px;background:#00b993;display:block}
  .mobileMonthIndicators b{font-size:9px;color:#00a685}
  .mobileAgendaDayBlock{display:grid;gap:9px}
  .mobileAgendaDayTitle{position:sticky;top:66px;z-index:22;padding:10px 12px;border-radius:13px;background:rgba(232,245,245,.98);color:#3b5664;font-size:11px;font-weight:1000;letter-spacing:.05em;backdrop-filter:blur(12px)}
  .mobileUpcomingPanel h3{margin:0}
  .mobileUpcomingDays{display:grid;gap:9px}
  .mobileUpcomingDay{width:100%;padding:12px 14px;border:1px solid var(--stroke);border-radius:16px;background:#fff;color:var(--text);display:flex;align-items:center;justify-content:space-between;gap:10px;text-align:left;box-shadow:none}
  .mobileUpcomingDay b{font-size:14px}
  .mobileUpcomingDay span{font-size:12px;color:var(--muted);font-weight:800}


  .mobileAgendaToolbar{display:grid;gap:9px}
  .mobileWeekNav{display:grid;grid-template-columns:38px 1fr 38px;gap:7px;align-items:center}
  .mobileWeekNav>button{width:38px;height:38px;padding:0;border:1px solid var(--stroke);border-radius:12px;background:#fff;color:var(--text);display:grid;place-items:center;box-shadow:none}
  .mobileWeekNav>button .mobileNativeIcon{width:18px;height:18px}
  .mobileWeekNav>b{text-align:center;text-transform:capitalize;font-size:14px}
  .mobileWeekStrip{display:grid;grid-template-columns:repeat(7,1fr);gap:5px}
  .mobileWeekStrip button{min-width:0;height:58px;padding:6px 2px;border:1px solid var(--stroke);border-radius:14px;background:#fff;color:#617083;display:grid;place-items:center;gap:1px;box-shadow:none}
  .mobileWeekStrip button span{font-size:9px;text-transform:uppercase;font-weight:900}
  .mobileWeekStrip button b{font-size:16px;color:var(--text)}
  .mobileWeekStrip button.today{border-color:#77dcca}
  .mobileWeekStrip button.active{background:linear-gradient(135deg,#e2fff7,#e9f4ff);border-color:#46d6bc;color:#007e69}
  .mobileAgendaActions{display:grid;grid-template-columns:auto 1fr;gap:8px}
  .mobileAgendaActions .btn{min-height:43px;margin:0;display:flex;align-items:center;justify-content:center;gap:6px;padding:8px 11px}
  .mobileAgendaActions .mobileNativeIcon{width:18px;height:18px}
  .mobileAgendaGroups{display:grid;gap:13px}
  .mobileAgendaDay{display:grid;gap:7px}
  .mobileAgendaDate{position:sticky;top:247px;z-index:20;padding:8px 10px;border-radius:11px;background:rgba(232,245,245,.96);color:#3b5664;font-size:10px;font-weight:1000;letter-spacing:.055em;backdrop-filter:blur(12px)}
  .mobileAgendaItems{display:grid;gap:7px}
  .mobileAgendaItem{width:100%;min-height:68px;padding:11px 12px;border:1px solid var(--stroke);border-radius:17px;background:#fff;color:var(--text);display:grid;grid-template-columns:48px minmax(0,1fr) 18px;gap:10px;align-items:center;text-align:left;box-shadow:0 8px 22px rgba(18,32,51,.05)}
  .mobileAgendaItem time{font-size:14px;font-weight:1000;color:#008973}
  .mobileAgendaItem>span:nth-child(2){display:grid;gap:3px;min-width:0}
  .mobileAgendaItem b{font-size:14px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .mobileAgendaItem small{font-size:11px;color:var(--muted);font-weight:700;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .mobileAgendaItem>.mobileNativeIcon{width:17px;height:17px;color:#9aa7b3}
  .mobileAgendaEmpty{padding:15px;border:1px dashed var(--stroke-strong);border-radius:16px;background:#fbfefd;color:var(--muted);font-size:12px;text-align:center}
  .mobileAgendaEmpty button{border:0;background:transparent;color:#008f77;font-weight:950}

  /* More menu */
  .mobileMoreSections{display:grid;gap:18px}
  .mobileMoreSections section>h4{margin:0 0 5px;padding:0 7px;color:#7b8997;font-size:10px;font-weight:1000;letter-spacing:.08em;text-transform:uppercase}
  .mobileMoreSections .mobileActionList{border:1px solid var(--stroke);border-radius:17px;background:#fff;overflow:hidden}

  /* General native cleanup */
  .mobileCompactHeader{height:auto!important;min-height:64px!important}
  .mobileCompactHeader .mobileHeaderLogo{width:38px!important;height:38px!important}
  .mobileCompactHeader .mobileHeaderActionButton{width:40px!important;height:40px!important;border-radius:13px!important}
  .pageTitle{margin-bottom:12px!important}
  .pageTitle h2{font-size:24px!important}
  .pageTitle p{font-size:13px!important;line-height:1.45!important}
}
@media(max-width:390px){
  .mobileNewClientButton span,.mobileFoodAddButton span{display:none}
  .mobileNewClientButton,.mobileFoodAddButton{width:46px;padding:0!important}
  .mobileAgendaActions{grid-template-columns:1fr}
  .mobileAgendaDate{top:292px}
  .mobileAgendaDayTitle{top:66px}
}

/* ShardsDiet 3.3.4 — archivio cliente e lista spesa mobile */
@media(max-width:820px){
  .mobileArchiveClientToolbar{position:sticky;top:calc(var(--mobile-header-space,64px) - 1px);z-index:30;display:grid;grid-template-columns:minmax(0,1fr) 125px;gap:8px;margin:0 -14px;padding:10px 14px 12px;background:linear-gradient(180deg,rgba(247,252,253,.99) 86%,rgba(247,252,253,0));backdrop-filter:blur(14px)}
  .mobileArchiveClientToolbar select{height:46px;min-height:46px;border-radius:15px;background:#fff;font-size:11px}.mobileArchiveClientToolbar .mobileArchiveResults{grid-column:1/-1}
  .mobileArchiveClientList{display:grid;gap:10px}.mobileArchiveClientCard{width:100%;min-width:0;display:grid;grid-template-columns:48px minmax(0,1fr) auto 18px;gap:11px;align-items:center;padding:14px;border:1px solid var(--stroke);border-radius:19px;background:#fff;color:var(--text);text-align:left;box-shadow:0 9px 25px rgba(18,32,51,.055)}
  .mobileArchiveClientInfo{min-width:0;display:grid;gap:3px}.mobileArchiveClientInfo b{font-size:15px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.mobileArchiveClientInfo small{color:var(--muted);font-size:9px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.mobileArchiveClientInfo i{color:#597081;font-size:9px;font-style:normal;font-weight:800;line-height:1.35}
  .mobileArchiveClientCount{display:grid;text-align:right}.mobileArchiveClientCount b{font-size:22px;line-height:1}.mobileArchiveClientCount small{margin-top:3px;color:var(--muted);font-size:8px;font-weight:900}.mobileArchiveClientCard>.mobileNativeIcon{width:17px;height:17px;color:#96a4b1}
  .mobileArchivePatientDetail{display:grid;gap:13px}.mobileArchivePatientHero{display:grid;gap:13px;padding:15px;border:1px solid var(--stroke);border-radius:21px;background:linear-gradient(135deg,#fff,#eafff7 65%,#eaf5ff);box-shadow:0 10px 28px rgba(18,32,51,.06)}
  .mobileArchiveBack{justify-self:start;min-height:38px;padding:0 10px;border:1px solid var(--stroke);border-radius:13px;background:#fff;color:var(--text);display:flex;align-items:center;gap:6px;font-size:11px;font-weight:900;box-shadow:none}.mobileArchiveBack .mobileNativeIcon{width:17px;height:17px}
  .mobileArchivePatientHeroIdentity{display:flex;align-items:center;gap:12px;min-width:0}.mobileArchivePatientHeroIdentity>span:last-child{min-width:0}.mobileArchivePatientHeroIdentity small{color:#08755e;font-size:8px;font-weight:1000;text-transform:uppercase;letter-spacing:.07em}.mobileArchivePatientHeroIdentity h2{margin:3px 0 4px;font-size:21px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.mobileArchivePatientHeroIdentity p{margin:0;color:var(--muted);font-size:10px;line-height:1.4}.mobileArchivePatientHero>.btn{width:100%;margin:0;display:flex;align-items:center;justify-content:center;gap:7px}
  .mobileArchivePatientSection{border:1px solid var(--stroke);border-radius:19px;background:#fff;overflow:hidden}.mobileArchivePatientSection>header{display:flex;align-items:center;justify-content:space-between;padding:13px 14px;border-bottom:1px solid var(--stroke);background:#fbfefd}.mobileArchivePatientSection h3{margin:0;font-size:15px}.mobileArchivePatientSection>header span{min-width:24px;height:24px;padding:0 7px;border-radius:999px;background:#e5fff6;color:#08755e;display:grid;place-items:center;font-size:10px;font-weight:1000}
  .shoppingListToggle{display:flex;align-items:flex-start;gap:10px;margin:0 0 13px;padding:13px;border:1px solid var(--stroke);border-radius:16px;background:#fbfefd;text-transform:none;letter-spacing:0;color:var(--text)}.shoppingListToggle input{width:20px;min-height:20px;margin-top:1px;accent-color:#00b98b}.shoppingListToggle span{display:grid;gap:3px}.shoppingListToggle b{font-size:13px}.shoppingListToggle small{font-size:10px;color:var(--muted);line-height:1.4}
}
@media(max-width:390px){.mobileArchiveClientToolbar{grid-template-columns:1fr}.mobileArchiveClientToolbar .mobileArchiveResults{grid-column:1}.mobileArchiveClientCard{grid-template-columns:44px minmax(0,1fr) auto 16px}}
