:root {
  color-scheme: light;
  --orange: #fa4616;
  --blue: #0021a5;
  --ink: #242823;
  --paper: #faf8f4;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--ink);
  background: var(--paper);
}
* { box-sizing: border-box; }
body { margin: 0; padding: 2.5rem 2rem; }
main { max-width: 1180px; margin: auto; }
a { color: #234f80; text-underline-offset: .2em; }
h1 { font: normal 2.2rem/1.15 Georgia, serif; margin: 0; }
h1 span { white-space: nowrap; }
.legend { display: flex; flex-wrap: wrap; gap: .7rem 1.5rem; list-style: none; padding: 0; margin: 1.3rem 0 .8rem; font-size: .78rem; }
.legend li { display: flex; align-items: center; gap: .45rem; }
.swatch { display: inline-grid; place-content: center; width: 1.6rem; height: 1.5rem; font-size: .65rem; border-radius: 2px; }
.calendar { margin-top: 1.8rem; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2.8rem; }
.term h2 { border-top: 3px solid #243e3b; padding-top: .65rem; margin: 0 0 1.2rem; font-size: .85rem; text-transform: uppercase; letter-spacing: .12em; }
.month { width: 100%; table-layout: fixed; border-collapse: separate; border-spacing: 3px; margin: 0 0 1.2rem; }
caption { text-align: left; font: normal 1.12rem Georgia, serif; padding: 0 3px .4rem; }
th { font-size: .65rem; font-weight: 500; color: #5a6059; padding-bottom: .2rem; }
td { padding: 0; height: 32px; }
.day { width: 100%; min-height: 32px; height: 100%; display: flex; align-items: center; justify-content: center; position: relative; border: 1px solid transparent; border-radius: 2px; font: inherit; font-size: .8rem; color: inherit; background: transparent; }
button.day { cursor: pointer; }
.number { font-size: 1.3em; font-weight: 700; }
.classes { background: var(--orange); color: white; }
.exams { background: var(--blue); color: white; }
.holiday { background: #e7e8e1; color: #303b32; }
.reading { background: #fff; border: 1px solid #757a74; color: #303b32; }
.event { outline: 1px dashed currentColor; outline-offset: -3px; }
.classes.event { outline-color: white; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 3px solid #0021a5; outline-offset: 3px; }
.past-semesters { display: none; margin-top: 1rem; font-size: .8rem; }
button.day:hover { box-shadow: 0 0 0 2px #243e3b; }
.tooltip { position: fixed; z-index: 10; width: max-content; max-width: min(330px, calc(100vw - 16px)); background: #202e2c; color: #fff; border-radius: .35rem; padding: .85rem 1rem; box-shadow: 0 5px 24px #0003; font-size: .8rem; line-height: 1.5; }
.tooltip p { margin: .4rem 0 0; }
.credit { margin-top: 1.2rem; font-size: .72rem; line-height: 1.6; color: #50574f; }
.credit .separator { margin: 0 .65em; }
@media (max-width: 850px) {
  body { padding: 1.5rem 1rem; }
  .calendar { gap: 1.2rem; }
  h1 { font-size: 1.8rem; }
}
@media (max-width: 640px) {
  .calendar { grid-template-columns: 1fr; gap: 1.5rem; max-width: 440px; margin: 1.8rem auto 0; }
  td, .day { height: 40px; }
  .day { font-size: .9rem; }
}
@media screen and (max-width: 640px) {
  .past-semesters:not([hidden]) { display: block; }
  body:not(.show-past) .term.past { display: none; }
}
@media screen and (min-width: 641px) {
  body.fitted { padding: 16px; }
  .fitted .page-frame {
    position: relative;
    width: var(--page-width);
    height: var(--page-height);
    margin: 0 auto;
  }
  .fitted main {
    position: absolute;
    width: 1180px;
    max-width: none;
    transform: scale(var(--page-scale));
    transform-origin: top left;
  }
  .fitted h1 { font-size: 2.2rem; }
  .fitted .calendar { gap: 2.8rem; }
}
@page { size: landscape; margin: 9mm; }
@media print {
  :root { background: white; }
  body { padding: 0; }
  main { max-width: none; height: calc(100vh - 2mm); display: flex; flex-direction: column; }
  .tooltip, .credit { display: none !important; }
  h1 { font-size: 19pt; }
  header, .legend { flex-shrink: 0; }
  .legend { margin: 2mm 0 0; gap: 5mm; font-size: 7pt; break-inside: avoid; }
  .legend li:has(.event) { display: none; }
  .event, button:focus-visible { outline: none; }
  button.day:hover { box-shadow: none; }
  .swatch { width: 5mm; height: 4mm; font-size: 5pt; }
  .calendar { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9mm; max-width: none; margin-top: 3mm; flex: 1; }
  .term { display: block; }
  .term h2 { border-top-width: 1pt; font-size: 8pt; padding-top: 1.5mm; margin-bottom: 2mm; }
  .month { border-spacing: 1mm .3mm; margin-bottom: 1mm; break-inside: avoid; }
  caption { font-size: 9pt; padding-bottom: 1mm; }
  th { font-size: 6pt; padding-bottom: 0; }
  td { height: 4.2mm; }
  .day { height: 4.2mm; min-height: 4.2mm; padding: 0; border-width: 0; font-size: 8pt; line-height: 1; }
  .day.reading { box-shadow: inset 0 0 0 .5pt #757a74; }
  .classes, .exams, .holiday, .reading { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
}

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
