/* Le Mie Ore ♡ — V21: esperienza calendario simile ad app nativa.
   Nessun blocco del pinch-to-zoom: resta disponibile per accessibilità. */
.v21-calendar-head,.v21-editor-head,.v21-add-day{display:none}
@media screen and (max-width:760px), screen and (orientation:landscape) and (max-height:500px) and (max-width:1024px){
  /* iOS fa uno zoom automatico sui controlli con testo inferiore a 16px. */
  input:not([type="checkbox"]):not([type="radio"]), select, textarea{font-size:16px!important}
  button, a, [role="button"]{touch-action:manipulation}
  html{overflow-x:hidden}
  body{overflow-x:hidden}
  body.v21-calendar-active{height:100dvh;overflow:hidden;overscroll-behavior:none}
  body.v21-calendar-active>header,body.v21-calendar-active>footer{display:none!important}
  body.v21-calendar-active>main{height:100dvh;min-height:0;padding:0;margin:0;max-width:none;overflow:hidden}
  body.v21-calendar-active #appShell{height:100dvh;min-height:0;overflow:hidden}
  body.v21-calendar-active #appShell>.accountBar,
  body.v21-calendar-active #appShell>.offline-sync-panel,
  body.v21-calendar-active #appShell>.nav{display:none!important}
  body.v21-calendar-active #calendarPage{
    display:block!important;height:100dvh;min-height:0;max-height:100dvh;
    overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain;
    -webkit-overflow-scrolling:touch;padding:0 0 calc(96px + env(safe-area-inset-bottom,0px));
    background:#fff9fc;scrollbar-width:none;
  }
  body.v21-calendar-active #calendarPage::-webkit-scrollbar,
  #dayEditorCard::-webkit-scrollbar{display:none}
  body.v21-calendar-active #calendarPage>.card:first-child{
    border:0;border-radius:0;box-shadow:none;background:transparent;
    margin:0;padding:0 12px 14px;
  }
  .v21-calendar-head{
    position:sticky;top:0;z-index:12;display:grid;align-items:center;
    grid-template-columns:48px 1fr 48px;gap:8px;
    margin:0 -12px 14px;padding:calc(9px + env(safe-area-inset-top,0px)) 14px 10px;
    background:rgba(255,248,252,.98);border-bottom:1px solid #efd7e3;
    box-shadow:0 2px 9px #9f4c7510;
  }
  .v21-calendar-head h2{font-size:17px;color:#8f355f;text-align:center;margin:0;font-weight:800}
  .v21-icon-button{
    height:43px;width:43px;min-height:43px;border-radius:50%;display:grid;place-items:center;
    font-size:27px;line-height:1;padding:0;background:#f7e5ef;color:#87355e;
    border:1px solid #efd3e1;box-shadow:none;
  }
  #v21Settings{font-size:23px}
  #calendarPage>.card:first-child>.bar{margin:0 2px 4px!important;gap:7px}
  #calendarPage>.card:first-child>.bar>.month-heading{
    background:transparent;border:0;padding:6px 2px!important;
    color:#8f355f;font-size:19px!important;text-transform:capitalize;
  }
  #calendarPage .calendar-navigation-hint{display:none}
  #calendarPage .calendar{gap:5px!important;margin-top:7px!important}
  #calendarPage .wd{padding:5px 0 8px;font-size:12px;color:#97798b}
  #calendarPage .day{
    display:flex;flex-direction:column;align-items:center;justify-content:flex-start;
    min-height:65px!important;height:65px!important;max-height:65px!important;
    padding:4px 1px!important;overflow:hidden!important;
    border-radius:9px;border:1px solid #f2e1e9;box-shadow:none;
    line-height:1.12;background:#f6ebf0;color:#5c394d;font-size:17px;
  }
  #calendarPage .day::before{
    content:' ';display:block;height:12px;min-height:12px;line-height:12px;
    font-size:9px;letter-spacing:.025em;color:#84596e;font-weight:750;
  }
  #calendarPage .day.type-mattina::before{content:'MAT'}
  #calendarPage .day.type-centrale::before{content:'CEN'}
  #calendarPage .day.type-serale::before{content:'SER'}
  #calendarPage .day.only-planned::before{content:'PROG';color:#16754a}
  #calendarPage .day.ferie::before{content:'FERIE'}
  #calendarPage .day.malattia::before{content:'MAL'}
  #calendarPage .day.permesso::before{content:'PERM'}
  #calendarPage .day.riposo::before{content:'RIP'}
  #calendarPage .day .shift-times{display:none!important}
  #calendarPage .day .day-hours{
    font-size:9px!important;font-weight:750;line-height:1.15;margin-top:3px;
    max-width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
  }
  #calendarPage .day .planned-label{display:none!important}
  #calendarPage .day small{font-size:9px!important;line-height:1.1;margin-top:2px}
  #calendarPage .day .note-indicator{position:absolute;right:1px;top:1px;font-size:8px}
  #calendarPage .day{position:relative}
  #calendarPage .day.selected{
    outline:2px solid #b64f7b!important;outline-offset:-2px;
    box-shadow:0 2px 9px #b64f7b20;
  }
  #calendarPage .calendar-preview{
    padding:14px!important;background:transparent!important;border:0!important;
    border-top:1px solid #efd7e3!important;border-radius:0!important;
    margin:14px 0 4px!important;
  }
  #calendarPage .calendar-preview-title{font-size:17px!important;color:#8c355e;text-transform:capitalize}
  #calendarPage .calendar-preview .day-preview-shift{
    background:#fff;border:1px solid #f0dce6;border-radius:13px;padding:12px;
    font-size:14px;line-height:1.55;
  }
  #calendarPage .calendar-preview .preview-actions{grid-template-columns:repeat(2,minmax(0,1fr));}
  #calendarPage .calendar-fast-label{margin-top:17px}
  #calendarPage .legend{margin-bottom:8px}
  .v21-add-day{
    position:fixed;display:grid;place-items:center;
    right:calc(16px + env(safe-area-inset-right,0px));
    bottom:calc(18px + env(safe-area-inset-bottom,0px));
    width:62px;height:62px;z-index:20;border-radius:50%;
    background:#b64f7b;color:#fff;font-size:39px;font-weight:400;
    line-height:1;padding:0;box-shadow:0 6px 20px #87355e40;
  }
  body.v21-editor-open .v21-add-day{display:none!important}
  /* L'editor è una schermata separata; il contenuto, non l'intera PWA, scorre. */
  #calendarPage #dayEditorCard:not([hidden]){
    position:fixed!important;z-index:100;inset:0;
    height:100dvh;max-height:100dvh;width:100vw;max-width:none;
    overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain;
    -webkit-overflow-scrolling:touch;
    margin:0!important;padding:0 14px calc(32px + env(safe-area-inset-bottom,0px))!important;
    border:0;border-radius:0;box-shadow:none;background:#fff9fc;
    scrollbar-width:none;
  }
  #calendarPage #dayEditorCard>.panel-heading{display:none!important}
  .v21-editor-head{
    display:grid;grid-template-columns:48px minmax(0,1fr) 48px;gap:8px;align-items:center;
    position:sticky;top:0;z-index:110;isolation:isolate;overflow:hidden;
    margin:0 -14px 15px;
    padding:calc(8px + env(safe-area-inset-top,0px)) calc(14px + env(safe-area-inset-right,0px)) 10px calc(14px + env(safe-area-inset-left,0px));
    min-height:65px;background:#fff9fc;
    border-bottom:1px solid #efdae4;box-shadow:0 2px 10px #9f4c7510;
  }
  .v21-editor-head strong{display:block;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-align:center;font-size:17px;line-height:1.2;color:#84355b;padding:0 4px}
  #v21EditorCheck{font-size:25px;background:#b64f7b;color:#fff;border-color:#b64f7b}
  #dayEditorCard>.v21-field-row{
    display:grid;grid-template-columns:minmax(105px,.85fr) minmax(0,1.15fr);
    gap:12px;align-items:center;min-height:65px;padding:10px 5px;
    border-bottom:1px solid #f0e0e9;
  }
  #dayEditorCard>.v21-field-row>label{
    display:block;margin:0;font-size:15px;line-height:1.3;
    color:#604357;font-weight:600;
  }
  #dayEditorCard>.v21-field-row>input,
  #dayEditorCard>.v21-field-row>select,
  #dayEditorCard>.v21-field-row>.date-field{
    width:100%;max-width:100%;min-width:0;
  }
  #dayEditorCard>.v21-field-row>select,
  #dayEditorCard>.v21-field-row>input,
  #dayEditorCard>.v21-field-row .date-field>input{
    border:0!important;border-radius:12px;background:#faedf4!important;
    text-align:right;padding:12px 9px!important;min-height:45px;
    color:#73415b;
  }
  #dayEditorCard>.v21-field-row:has(textarea){
    display:block;
  }
  #dayEditorCard>.v21-field-row textarea{margin-top:9px;border-radius:12px}
  #dayEditorCard #workArea,#dayEditorCard .favorite-quick-section,
  #dayEditorCard .hint{margin-top:15px}
  #dayEditorCard .shift{background:#fff;border:1px solid #ecd4e2;border-radius:13px;padding:12px!important}
  #dayEditorCard>.actions>#save{display:none!important} /* ✓ in alto esegue lo stesso salvataggio */
  #dayEditorCard>.actions{grid-template-columns:1fr!important;margin-top:22px}
  #dayEditorCard>.actions>#remove{background:#fce9ec;color:#963e57}
  body.v21-editor-open{overflow:hidden!important}
}
@media screen and (max-width: 390px){
 .v21-editor-head{grid-template-columns:44px minmax(0,1fr) 44px;padding:calc(7px + env(safe-area-inset-top,0px)) calc(12px + env(safe-area-inset-right,0px)) 9px calc(12px + env(safe-area-inset-left,0px))}
 .v21-editor-head strong{font-size:clamp(15px,5.1vw,17px)}
 .v21-icon-button{height:42px;width:42px;min-height:42px}
}
@media screen and (max-width: 360px){
 #calendarPage .day{min-height:59px!important;height:59px!important;max-height:59px!important;font-size:16px}
 #calendarPage .day::before{height:10px;min-height:10px;font-size:8px}
 .v21-calendar-head h2,.v21-editor-head strong{font-size:16px}
 #dayEditorCard>.v21-field-row{grid-template-columns:minmax(94px,.83fr) minmax(0,1.17fr);gap:8px}
}
@media print{
 .v21-calendar-head,.v21-editor-head,.v21-add-day{display:none!important}
}
