/* Shared mobile form rhythm. Desktop layouts and the fixed navigation are unchanged. */
.category-periodicity-form{margin:12px 0}
@media screen and (max-width:760px){
  body main{padding-bottom:calc(24px + env(safe-area-inset-bottom));overflow-wrap:anywhere}
  body main .panel{padding:16px;border-radius:12px;margin-top:16px;margin-bottom:16px}
  body main form,body main label,body main fieldset{min-width:0;max-width:100%}
  body main form{display:grid;grid-template-columns:minmax(0,1fr);gap:12px}
  body main form .flex{display:grid;grid-template-columns:minmax(0,1fr);align-items:stretch;gap:12px}
  body main form .flex>*{min-width:0;max-width:100%;width:100%}
  body main form>p{margin:0}
  body main form label:not(:has(input[type=checkbox])):not(:has(input[type=radio])){display:block;width:100%;font-size:14px;line-height:1.5;font-weight:400}
  body main :is(input:not([type=hidden]):not([type=checkbox]):not([type=radio]),select,textarea){box-sizing:border-box;display:block;width:100%;inline-size:100%;min-width:0;min-inline-size:0;max-width:100%;max-inline-size:100%;margin:6px 0 0;padding:10px 12px;font-family:inherit;font-size:16px;font-weight:400;line-height:22px;color:#202124;background:#fff;border:1px solid #c8cacf;border-radius:10px}
  body main :is(input:not([type=hidden]):not([type=checkbox]):not([type=radio]),select){height:44px;min-height:44px}
  body main textarea{height:auto;min-height:100px;resize:vertical}
  /* Safari's native date editor otherwise keeps its intrinsic width inside narrow cards. */
  body main input:is([type=date],[type=datetime-local],[type=time]){-webkit-appearance:none;appearance:none;text-align:left}
  body main input:is([type=date],[type=datetime-local],[type=time])::-webkit-date-and-time-value{text-align:left;min-height:22px}
  body main input:is([type=date],[type=datetime-local],[type=time])::-webkit-datetime-edit{min-width:0;padding:0}
  body main :is(button,a.btn),body main :is(form,.filter-actions,.bulk-actions,.devices-table) :is(button,a.btn),body main .devices-table :is(button,a.btn):not(.danger){box-sizing:border-box;display:flex;align-items:center;justify-content:center;width:100%;min-width:0;max-width:100%;min-height:44px;height:auto;margin:0;padding:10px 12px;font-family:inherit;font-size:16px;font-weight:400;line-height:22px;border-radius:999px;white-space:normal;overflow-wrap:anywhere;justify-self:stretch}
  body main :is(input[type=checkbox],input[type=radio]){box-sizing:border-box;width:20px;height:20px;min-width:20px;min-height:20px;margin:0;flex:0 0 20px}
  body main :is(.email-recipient-table,.recipient-modules,.access-check) input[type=checkbox]{width:20px;height:20px;min-width:20px;min-height:20px;flex:0 0 20px}
  body main label:has(>input:is([type=checkbox],[type=radio])){display:flex;align-items:center;gap:10px;min-height:44px;font-size:14px;line-height:1.5;font-weight:400}
  body main :is(.device-check-actions,.device-tag-form,.fire-edit,.fire-tools,.notification-form,.email-recipient-add,.access-form,.qr-check-form,.device-filter-form,.device-bulk-form),body main form.flex{display:grid;grid-template-columns:minmax(0,1fr);align-items:stretch;gap:12px;min-width:0}
  body main form.flex>*,body main .device-check-actions>*,body main .qr-check-form>*{min-width:0;max-width:100%;width:100%;flex:none;grid-column:1/-1}
  body main .devices-table td[data-label="Azioni"]>.device-check-actions{grid-template-columns:minmax(0,1fr);align-items:stretch;gap:12px}
  body main :is(.fire-form-grid,.notification-grid,.access-modules){grid-template-columns:minmax(0,1fr);gap:12px}
  body main :is(.fire-edit,.access-form,.notification-form,form.flex)>p{margin:0}
  body main .device-filter-form .filter-search,body main .device-bulk-form .bulk-actions{grid-column:1/-1}
  body main :is(.filter-actions,.bulk-actions){display:grid;grid-template-columns:minmax(0,1fr);gap:12px;width:100%;grid-column:1/-1}
  body main .device-history-links{gap:12px;margin-bottom:12px}
  body main .device-more-content{padding:12px;gap:12px}
  body main .device-more-content .device-tag-form{gap:12px}
  body main .device-more-content .device-qr-action{gap:12px}
  body main .fire-field{padding:16px}
  body main .fire-group>h3{padding:14px 16px}
  body main .fire-field .fire-edit{padding-top:12px}
  body main .category-periodicity-card{border-top:1px solid #d5d7da;padding:16px 0}
  body main .category-periodicity-card>form,body main .category-periodicity-card>.category-periodicity-form{margin:0}
  body main .category-periodicity-card>form+form{display:grid;gap:12px;margin-top:12px}
  body main .category-periodicity-card small{display:block;line-height:1.5}
  body main .notification-box{padding:14px}
  body main .custom-alert-row{display:grid;grid-template-columns:minmax(0,1fr);gap:12px;align-items:stretch;padding:14px 0}
  body main .custom-alert-row form{width:100%;margin:0}
  body main .site-card{padding:14px}
  body main .site-actions{display:grid;gap:12px;padding-top:12px;margin-top:12px}
  body main .site-actions p{margin:0}
  body main .email-recipient-table thead tr{display:block;width:100%;margin:0 0 12px;padding:0}
  body main .email-recipient-table thead th:last-child{width:100%;padding:0}
  body main .email-recipient-save{width:100%;min-width:0}
  body main #archive-switch>form{width:100%}
}
