.calendar-tool {
  box-sizing: border-box;
  width: 680px;
  max-width: 100%;
  margin: 0 auto 18px;
  padding: 14px;
  background: #ffffff;
  border: 1px solid #b7c6d2;
  color: #20364a;
  font-family: Arial, Helvetica, sans-serif;
  text-align: left;
}

.calendar-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px;
  margin-bottom: 14px;
  padding: 12px;
  background: #eef6fb;
  border: 1px solid #c5dbe8;
}

.calendar-controls label {
  display: grid;
  gap: 4px;
  font-size: 12px;
  font-weight: bold;
  color: #345269;
}

.calendar-controls select,
.calendar-controls input {
  box-sizing: border-box;
  min-width: 110px;
  padding: 7px 8px;
  border: 1px solid #9fb7c8;
  background: #ffffff;
  color: #1d3448;
  font-size: 14px;
}

.calendar-controls button {
  padding: 8px 12px;
  border: 1px solid #1e6f91;
  background: #197da1;
  color: #ffffff;
  font-weight: bold;
  cursor: pointer;
}

.calendar-controls button:hover {
  background: #125f7d;
}

.calendar-print-area {
  background: #ffffff;
}

.calendar-title {
  margin: 2px 0 12px;
  color: #172d40;
  font-size: 26px;
  line-height: 1.15;
  text-align: center;
}

.calendar-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  background: #ffffff;
}

.calendar-table th {
  padding: 7px 4px;
  border: 1px solid #7f98aa;
  background: #d9ebf4;
  color: #1e3a50;
  font-size: 13px;
  text-align: center;
}

.calendar-table td {
  vertical-align: top;
  height: 82px;
  border: 1px solid #9eb0bd;
  background: #ffffff;
}

.calendar-day {
  min-height: 78px;
  padding: 5px;
}

.calendar-date {
  display: block;
  margin-bottom: 3px;
  color: #20364a;
  font-size: 13px;
  font-weight: bold;
}

.calendar-muted {
  background: #f2f5f7;
  color: #8b9aa5;
}

.calendar-note {
  min-height: 48px;
  outline: none;
  color: #253c51;
  font-size: 12px;
  line-height: 1.25;
  white-space: pre-wrap;
}

.weekly-table td {
  height: 390px;
}

.weekly-day {
  min-height: 380px;
}

.weekly-note {
  min-height: 330px;
}

.year-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.mini-month {
  break-inside: avoid;
  page-break-inside: avoid;
}

.mini-month h2 {
  margin: 0;
  padding: 6px 4px;
  border: 1px solid #7f98aa;
  border-bottom: 0;
  background: #d9ebf4;
  color: #1e3a50;
  font-size: 15px;
  text-align: center;
}

.mini-month table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.mini-month th,
.mini-month td {
  width: 14.285%;
  border: 1px solid #aab8c2;
  text-align: center;
}

.mini-month th {
  padding: 3px 1px;
  background: #eef6fb;
  color: #345269;
  font-size: 10px;
}

.mini-month td {
  height: 24px;
  background: #ffffff;
  color: #20364a;
  font-size: 11px;
}

.mini-month .calendar-muted {
  color: #c1c9cf;
}

.calendar-links {
  margin: 12px 0;
  text-align: center;
}

@media (max-width: 720px) {
  .calendar-tool {
    width: calc(100% - 16px);
    padding: 10px;
  }

  .calendar-table td {
    height: 68px;
  }

  .calendar-day {
    min-height: 64px;
  }

  .year-grid {
    grid-template-columns: 1fr;
  }
}

@media print {
  body {
    background: #ffffff !important;
  }

  .calendar-controls,
  .calendar-links,
  .breadcrumb,
  #hdrcnt,
  textarea,
  .aclass {
    display: none !important;
  }

  .calendar-tool {
    width: 100%;
    margin: 0;
    padding: 0;
    border: 0;
  }

  .calendar-title {
    margin-top: 0;
  }

  .calendar-table th,
  .calendar-table td,
  .mini-month th,
  .mini-month td,
  .mini-month h2 {
    border-color: #333333;
  }

  .year-grid {
    gap: 7px;
  }
}
