.page-title {
  text-align: center;
  margin-bottom: 1em;
}

.year-container {
  width: 100%;
  display: block;
  text-align: center;
  overflow-x: hidden;
}

.year-grid {
  display: grid;
  grid-template-columns: repeat(3, 14rem);
  gap: 1.5em;
  justify-content: center;
  align-items: start;
  width: max-content;
  max-width: 100%;
  margin: 0 auto 3em auto;
}

.month {
  border: 1px solid #ccc;
  padding: 0.6em 0.8em;
  box-sizing: border-box;
  width: 14rem;
  max-width: 100%;
  aspect-ratio: 5 / 4;
}

.month h3 {
  margin: 0 0 0.5em 0;
}

.month-name {
  font-weight: bold;
  margin-bottom: 0.4em;
}

.days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px 8px;
  font-size: 0.92em;
  height: 15em;
}

.days span {
  display: block;
  padding: 2px;
  box-sizing: border-box;
}

.day-name {
  font-weight: bold;
  background: #eee;
}

.days span:hover {
  font-weight: bold;
  text-decoration: none;
  box-shadow: 0 0 3px rgba(0, 0, 0, 0.3);
  cursor: pointer;
  background-color: rgba(0, 0, 0, 0.03);
  border-radius: 2px;
  transition: all 0.2s ease-in-out;
}

/* Kolory dni */
.sunday,
.holiday {
  color: #c00;
  font-weight: bold;
}

.free-extra,
.saturday {
  color: green;
  font-weight: 700;
}

.saturday33 {
  color: #000099;
  font-weight: 700;
}

.free-day {
  background-color: #fffae5;
  font-style: italic;
}

.saturday-holiday {
  color: #085;
  background-color: #fffae5;
  font-weight: bold;
}

.work-saturday {
  color: #000;
}

/* Dzisiejsza data — zielone kółko */
.days .day-link.today {
  display: flex;
  align-items: center;
  justify-content: center;

  width: 1.8em;
  height: 1.8em;
  padding: 0;
  margin: 0 auto;

  border-radius: 50%;
  background: #e8f8ec;
  outline: 2px solid #168a3a;
  box-shadow: 0 0 0 3px rgba(22, 138, 58, 0.14);

  color: #064e1f;
  font-weight: 800;
}

/* Pozostałości pod stare tabele / ewentualne przyszłe użycie */
td.empty {
  visibility: hidden;
}

td.selected {
  outline: 2px solid #3399ff;
  background-color: #e0f0ff;
}

.day-number-wrapper {
  display: inline;
}

/* Tablet: 2 miesiące w rzędzie */
@media screen and (max-width: 760px) {
  .year-grid {
    grid-template-columns: repeat(2, 14rem);
    gap: 1.2em;
  }

  .month {
    width: 14rem;
  }
}

/* Telefon: 1 miesiąc pod drugim */
@media screen and (max-width: 520px) {
  body {
    padding-left: 0.5em;
    padding-right: 0.5em;
  }

  .page-title {
    margin-bottom: 0.5em;
  }

  .page-title h1 {
    font-size: 1.7em;
  }

  h2 {
    font-size: 1.05em;
    line-height: 1.35;
    margin-bottom: 1em;
  }

  form {
    font-size: 0.95em;
  }

  .year-grid {
    grid-template-columns: 1fr;
    width: 100%;
    max-width: 22rem;
    gap: 1em;
  }

  .month {
    width: 100%;
    max-width: 22rem;
    aspect-ratio: auto;
    padding: 0.65em 0.75em;
  }

  .month h3 {
    font-size: 1.15em;
  }

  .days {
    height: auto;
    gap: 4px 6px;
    font-size: 0.95em;
  }

  .days span {
    padding: 0.25em 0;
  }

  .days .day-link.today {
    width: 1.9em;
    height: 1.9em;
  }
}

/* Bardzo wąskie ekrany */
@media screen and (max-width: 360px) {
  .year-grid {
    max-width: 20rem;
  }

  .days {
    font-size: 0.88em;
    gap: 3px 4px;
  }
}