/*  Mobile  */
  @media screen and (max-width: 440px) {

    #Calendario {
      margin-top: 0rem;
    }


    table.ReplCalendar {
      /* border-collapse: collapse; */
      width: 100%;
      display: flex;
      justify-content: center;
      margin: 0 auto;
      overflow: hidden;
      overflow-x: auto;
      margin-top: 0rem;
      margin-bottom: 2rem;
      flex-direction: row;
    }
    table.ReplCalendar tbody {
      display: flex;
      width: 100%;
      overflow: hidden;
      overflow-x: auto;
      height: 6rem;
      position: relative;

      padding-top: 5.5rem;
    }
    table.ReplCalendar tbody tr:first-child {
      color: var(--Palette3);
      display: flex;
      width: 100%;
      justify-content: center;
      background: var(--Palette2);
      height: 5.5rem;
      align-items: center;
      border-radius: 0rem;
      position: absolute;
      left: 0rem;
      top: 0rem;
      z-index: 50;

      position: sticky;      /* <-- questa è la chiave */
         top: 0;
         left: 0;               /* <-- blocca anche lo scroll orizzontale */
         z-index: 999;
         width: 100%;
         height: 5.5rem;
         border-radius: 0;
    }
    table.ReplCalendar tbody tr:first-child{
      transform: translateZ(0);
    }
    table.ReplCalendar tbody tr:first-child th {
      width: 18rem;
      display: block;
      color: var(--Palette2light);
      text-transform: uppercase;
      font-weight: 500;
      font-size: 1.5rem;
      letter-spacing: -0.03rem;
      cursor: default;
      text-align: center;

      position: sticky;
          left: 0;
          width: 100%;
    }
    table.ReplCalendar tbody tr:first-child th span {
      cursor: pointer;
      width: 15%;
      text-align: center;
    }
    table.ReplCalendar tbody tr:first-child th span.ChangeMonth.Left {
      position: absolute;
      left: 0rem;
    }
    table.ReplCalendar tbody tr:first-child th span.ChangeMonth.Right {
      position: absolute;
      right: 0rem;
    }
    table.ReplCalendar tbody tr:nth-child(2) {
      display: none;
    }
    table.ReplCalendar tbody tr {
      display: flex;
      flex-wrap: nowrap;
    }
    tbody tr td {
      display: flex;
      flex-direction: column;
      box-sizing: border-box;
      text-align: center;
      vertical-align: top;
      width: 6rem;
      height: 6rem;
      border-radius: 0.1875rem;
      background: #c2e6e6;
      margin: 0rem 0.13rem;
      align-items: center;
      justify-content: center;
    }
    tbody tr td.Empty {
      display: none;
    }

    /*----------------------------------------------------------------*/


        table.ReplCalendar tbody tr td {
          gap: 0.25rem;
          justify-content: center;
          border-bottom: 0.1rem solid var(--Box_Evento_Border_Color);
          border-radius: 0rem;
          border-left: 0.1rem solid var(--Box_Evento_Border_Color);
          border-right: 0.1rem solid var(--Box_Evento_Border_Color);
          transition: all 0.2s ease;
        }
        table.ReplCalendar tbody tr td.normal.has-event {
          background-color: var(--Palette2light);
          cursor: pointer;
          pointer-events: auto;
        }
        table.ReplCalendar tbody tr td.normal.has-event:hover {
          border-bottom: 0.1rem solid var(--Palette1dark);
          border-left: 0.1rem solid var(--Palette1dark);
          border-right: 0.1rem solid var(--Palette1dark);
        }

        td.normal.has-event .WeekDay {
          font-size: 1.05rem;
          line-height: 1;
          opacity: 0.85;
          font-weight: 700;
          text-transform: capitalize;
          color: var(--Palette1);
          margin-bottom: -0.2rem;
        }

        td.normal.has-event .DayNumber {
          font-size: 1.8rem;
          font-weight: 500;
          color: var(--Palette1dark);
        }

        table.ReplCalendar tbody tr td.normal {
          background: var(--Palette2light);
          cursor: default;
          pointer-events: none;
        }
        td.normal .WeekDay {
          font-size: 0.75rem;
          line-height: 1;
          opacity: 0.85;
          font-weight: 700;
          text-transform: capitalize;
          color: var(--Palette2dark);
        }
        table.ReplCalendar tbody tr td.normal.IsToday {
          border-bottom: 0.2rem solid #9f9f9f;
          border-radius: 0rem;
          border-left: 0.2rem solid #9f9f9f;
          border-right: 0.2rem solid #9f9f9f;
        }
        table.ReplCalendar tbody tr td.normal.IsToday .WeekDay {
          color: #9f9f9f;
          font-size: 0.95rem;
          opacity: 1;
          margin-bottom: -0.3rem;
        }
        table.ReplCalendar tbody tr td.normal.IsToday .DayNumber {
          color: #9f9f9f;
          font-size: 1.6rem;
          opacity: 1;
        }

        td.normal .DayNumber {
          font-size: 1.3rem;
          font-weight: 500;
          color: var(--Palette2dark);
        }

        /* --- Wrapper per bottoni freccia --- */
        #Calendario .HomeCalWrap {
          position: relative;
        }

        /* spazio a destra per non coprire le ultime celle */
        #Calendario .HomeCalWrap table.ReplCalendar tbody {
          padding-top: 5.5rem;
        }

        /* Bottoni freccia a destra */
        #Calendario .CalArrows {
          /*position: absolute;
          right: 0.6rem;
          top: 50%;
          transform: translateY(-50%);
          display: flex;
          gap: 0.5rem;
          z-index: 5;*/
          position: absolute;
          right: 0rem;
          top: 50%;
          transform: translateY(-50%);
          display: flex;
          column-gap: 0.1rem;
          z-index: 5;
          background: var(--Box_Evento_Background_Color);

          display: none;
        }

        #Calendario .CalArrow {
          width: 5rem;
          height: 4rem;
          font-size: 2.3rem;
          border: 0;
          border-radius: 0rem;
          background: var(--Palette2);
          color: var(--Palette2light);
          display: flex;
          align-items: center;
          justify-content: center;
          cursor: pointer;
          padding-bottom: 0.4rem;
        }

        #Calendario .CalArrow:active {
          transform: translateY(1px);
        }

        #Calendario .HomeCalWrap {
          position: relative;
          display: block;
        }


        table.ReplCalendar tbody {
          overflow-x: auto;
          scrollbar-width: none;        /* Firefox */
          -ms-overflow-style: none;     /* IE / Edge legacy */
        }

        table.ReplCalendar tbody::-webkit-scrollbar {
          display: none;                /* Chrome, Safari, Edge */
        }





  }


  /*  Desktop  */
    @media screen and (min-width: 441px) {


      #Calendario {
        margin-top: 0.1rem;
      }


      table.ReplCalendar {
        /* border-collapse: collapse; */
        width: 100%;
        display: flex;
        justify-content: center;
        margin: 0 auto;
        overflow: hidden;
        overflow-x: auto;
        margin-top: 0rem;
        margin-bottom: 2rem;
        flex-direction: row;
      }
      table.ReplCalendar tbody {
        display: flex;
        width: 100%;
        overflow: hidden;
        overflow-x: auto;
        height: 4rem;
        position: relative;
      }
      table.ReplCalendar tbody tr:first-child {
        color: var(--Palette3);
        display: flex;
        width: 18rem;
        justify-content: center;
        background: var(--Palette2);
        height: 4rem;
        align-items: center;
        border-radius: 0rem;
        position: sticky;
        left: 0rem;
        top: 0rem;
        z-index: 50;
      }
      table.ReplCalendar tbody tr:first-child th {
        width: 18rem;
        display: block;
        color: var(--Palette2light);
        text-transform: uppercase;
        font-weight: 500;
        font-size: 1.2rem;
        letter-spacing: -0.03rem;
        cursor: default;
        text-align: center;
      }
      table.ReplCalendar tbody tr:first-child th span {
        cursor: pointer;
        width: 15%;
        text-align: center;
      }
      table.ReplCalendar tbody tr:first-child th span.ChangeMonth.Left {
        position: absolute;
        left: 0rem;
      }
      table.ReplCalendar tbody tr:first-child th span.ChangeMonth.Right {
        position: absolute;
        right: 0rem;
      }
      table.ReplCalendar tbody tr:nth-child(2) {
        display: none;
      }
      table.ReplCalendar tbody tr {
        display: flex;
        flex-wrap: nowrap;
      }
      tbody tr td {
        display: flex;
        flex-direction: column;
        box-sizing: border-box;
        text-align: center;
        vertical-align: top;
        width: 4.2125rem;
        border-radius: 0.1875rem;
        background: #c2e6e6;
        margin: 0rem 0.13rem;
        align-items: center;
        justify-content: center;
      }
      tbody tr td.Empty {
        display: none;
      }


  /*----------------------------------------------------------------*/


      table.ReplCalendar tbody tr td {
        gap: 0.25rem;
        justify-content: center;
        border-bottom: 0.1rem solid var(--Box_Evento_Border_Color);
        border-radius: 0rem;
        border-left: 0.1rem solid var(--Box_Evento_Border_Color);
        border-right: 0.1rem solid var(--Box_Evento_Border_Color);
        transition: all 0.2s ease;
      }
      table.ReplCalendar tbody tr td.normal.has-event {
        background-color: var(--Palette2light);
        cursor: pointer;
        pointer-events: auto;
      }
      table.ReplCalendar tbody tr td.normal.has-event:hover {
        border-bottom: 0.1rem solid var(--Palette1dark);
        border-left: 0.1rem solid var(--Palette1dark);
        border-right: 0.1rem solid var(--Palette1dark);
      }

      td.normal.has-event .WeekDay {
        font-size: 0.75rem;
        line-height: 1;
        opacity: 0.85;
        font-weight: 700;
        text-transform: capitalize;
        color: var(--Palette1);
      }

      td.normal.has-event .DayNumber {
        font-size: 1.3rem;
        font-weight: 500;
        color: var(--Palette1dark);
      }
      table.ReplCalendar tbody tr td.normal.has-event.IsToday {
        border-bottom: 0.15rem solid var(--Palette1);
        border-radius: 0rem;
        border-left: 0.15rem solid var(--Palette1);
        border-right: 0.15rem solid var(--Palette1);
      }

      table.ReplCalendar tbody tr td.normal {
        background: var(--Palette2light);
        cursor: default;
        pointer-events: none;
      }
      table.ReplCalendar tbody tr td.normal.IsToday {
        border-bottom: 0.15rem solid #9f9f9f;
        border-radius: 0rem;
        border-left: 0.15rem solid #9f9f9f;
        border-right: 0.15rem solid #9f9f9f;
      }
      table.ReplCalendar tbody tr td.normal.has-event.IsToday .WeekDay,
      table.ReplCalendar tbody tr td.normal.has-event.IsToday .DayNumber {
        color: var(--Palette1);
      }

      table.ReplCalendar tbody tr td.normal.IsToday .WeekDay,
      table.ReplCalendar tbody tr td.normal.IsToday .DayNumber {
        color: #9f9f9f;
      }
      td.normal .WeekDay {
        font-size: 0.75rem;
        line-height: 1;
        opacity: 0.85;
        font-weight: 700;
        text-transform: capitalize;
        color: var(--Palette2dark);
      }

      td.normal .DayNumber {
        font-size: 1.3rem;
        font-weight: 500;
        color: var(--Palette2dark);
      }

      /* --- Wrapper per bottoni freccia --- */
      #Calendario .HomeCalWrap {
        position: relative;
      }

      /* spazio a destra per non coprire le ultime celle */
      #Calendario .HomeCalWrap table.ReplCalendar tbody {
        padding-right: 10rem;
      }

      /* Bottoni freccia a destra */
      #Calendario .CalArrows {
        /*position: absolute;
        right: 0.6rem;
        top: 50%;
        transform: translateY(-50%);
        display: flex;
        gap: 0.5rem;
        z-index: 5;*/
        position: absolute;
        right: 0rem;
        top: 50%;
        transform: translateY(-50%);
        display: flex;
        column-gap: 0.1rem;
        z-index: 5;
        background: var(--Box_Evento_Background_Color);
      }

      #Calendario .CalArrow {
        width: 5rem;
        height: 4rem;
        font-size: 2.3rem;
        border: 0;
        border-radius: 0rem;
        background: var(--Palette2);
        color: var(--Palette2light);
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        padding-bottom: 0.4rem;
      }

      #Calendario .CalArrow:active {
        transform: translateY(1px);
      }

      #Calendario .HomeCalWrap {
        position: relative;
        display: block;
      }


      table.ReplCalendar tbody {
        overflow-x: auto;
        scrollbar-width: none;        /* Firefox */
        -ms-overflow-style: none;     /* IE / Edge legacy */
      }

      table.ReplCalendar tbody::-webkit-scrollbar {
        display: none;                /* Chrome, Safari, Edge */
      }

      #HomeMonthBar {
        display: none;
      }






    }