:root {
  --paper: #f4f0e7;
  --ink: #1d201c;
  --muted: #77766e;
  --line: #cec8ba;
  --red: #db4d37;
  --weekend: #e5e0d5;
  --sunday: #88bbff;
  --sunday-ink: #ffffff;
  --personal-rest: #eee6d8;
  --school: #b9d8ca;
  --zone-a: #b23b4b;
  --zone-b: #a9640c;
  --zone-c: #24734a;
  --bridge: #f2cd72;
  --traffic: #741d1d;
  --white: #fffdf8;
}
/* Thèmes visuels : les mêmes repères restent conservés, seules les surfaces changent. */
body[data-theme="encre"] {
  --paper: #171a1d;
  --ink: #f6f1e8;
  --muted: #b8b7b0;
  --line: #4b4e4d;
  --red: #f0795e;
  --weekend: #292d31;
  --sunday: #2d6ca1;
  --sunday-ink: #ffffff;
  --personal-rest: #34302b;
  --school: #34564b;
  --bridge: #8f6e26;
  --traffic: #a74d4d;
  --white: #23272b;
}
body[data-theme="sauge"] {
  --paper: #eef3ed;
  --ink: #1d2d25;
  --muted: #64736b;
  --line: #c4d3c9;
  --red: #aa4f3f;
  --weekend: #dce8df;
  --sunday: #91c0d6;
  --sunday-ink: #173c4c;
  --personal-rest: #e5eee5;
  --school: #c5dfd1;
  --bridge: #e9c96f;
  --traffic: #7d3737;
  --white: #fbfdf8;
}
body[data-theme="today"] {
  --paper: #edf4fa;
  --ink: #1b2a38;
  --muted: #627385;
  --line: #c3d2df;
  --red: #2c6f9f;
  --weekend: #dce8f2;
  --sunday: #6ea8d6;
  --sunday-ink: #102f4a;
  --personal-rest: #e4edf5;
  --school: #c9dfd4;
  --bridge: #e8c76d;
  --traffic: #7f3e4a;
  --white: #fbfdff;
}
body.a11y-contrast {
  --paper: #ffffff;
  --ink: #000000;
  --muted: #202020;
  --line: #000000;
  --red: #9f0000;
  --weekend: #e3e3e3;
  --sunday: #07549b;
  --sunday-ink: #ffffff;
  --personal-rest: #eeeeee;
  --school: #b6d9c1;
  --bridge: #f2c400;
  --traffic: #650000;
  --white: #ffffff;
}
* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
  overflow-x: clip;
}
body {
  margin: 0;
  overflow-x: clip;
  background: var(--paper);
  color: var(--ink);
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    sans-serif;
}
.masthead {
  height: 72px;
  padding: 0 clamp(18px, 3vw, 48px);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  background: color-mix(in srgb, var(--paper) 94%, transparent);
  backdrop-filter: blur(12px);
  z-index: 20;
}
.header-actions {
  justify-self: end;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  position: relative;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none;
  font-weight: 750;
}
.monogram {
  position: relative;
  display: grid;
  place-items: center;
  width: 29px;
  height: 29px;
  border: 1.5px solid var(--ink);
  border-radius: 50%;
  background: var(--white);
}
.monogram-sun {
  width: 11px;
  height: 11px;
  border: 2px solid var(--red);
  border-radius: 50%;
}
.monogram-sun::before,
.monogram-sun::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 19px;
  height: 1px;
  background: var(--ink);
  transform: translate(-50%, -50%);
}
.monogram-sun::after {
  transform: translate(-50%, -50%) rotate(90deg);
}
.year-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}
.year-nav button,
#todayButton {
  border: 1px solid var(--line);
  background: transparent;
  height: 38px;
  padding: 0 14px;
  border-radius: 20px;
  cursor: pointer;
  color: inherit;
}
.year-nav button {
  width: 38px;
  padding: 0;
}
.year-nav button:hover,
#todayButton:hover {
  background: var(--ink);
  color: var(--paper);
}
.year-nav select {
  font: 600 1rem inherit;
  border: 0;
  background: transparent;
  padding: 8px;
  color: inherit;
}
#todayButton {
  justify-self: end;
}
.appearance-menu {
  position: relative;
  z-index: 30;
}
.appearance-menu summary,
.accessibility-toggle {
  list-style: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: transparent;
  color: inherit;
  font: 600 0.82rem inherit;
  cursor: pointer;
}
.appearance-menu summary::-webkit-details-marker {
  display: none;
}
.appearance-menu[open] summary,
.appearance-menu summary:hover,
.accessibility-toggle:hover {
  background: var(--ink);
  color: var(--paper);
}
.appearance-popover {
  position: absolute;
  right: 0;
  top: calc(100% + 9px);
  width: 190px;
  padding: 12px;
  border: 1px solid var(--line);
  background: var(--paper);
  box-shadow: 0 14px 32px rgb(20 24 20 / 14%);
}
.appearance-title {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.69rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.appearance-popover button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 9px;
  border: 0;
  padding: 8px 7px;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
  border-radius: 4px;
}
.appearance-popover button:hover,
.appearance-popover button[aria-pressed="true"] {
  background: color-mix(in srgb, var(--line) 28%, transparent);
}
.appearance-popover button[aria-pressed="true"]::after {
  content: "✓";
  margin-left: auto;
  color: var(--red);
  font-weight: 800;
}
.theme-dot {
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  border: 1px solid var(--line);
  border-radius: 50%;
}
.theme-dot-almanach { background: #db4d37; }
.theme-dot-encre { background: #171a1d; }
.theme-dot-sauge { background: #91b9a0; }
.theme-dot-today { background: #6ea8d6; }
.accessibility-dialog {
  width: min(430px, calc(100vw - 28px));
  max-width: 100%;
  padding: 0;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 24px 80px rgb(20 24 20 / 30%);
}
.accessibility-dialog::backdrop {
  background: rgb(20 24 20 / 35%);
  backdrop-filter: blur(2px);
}
.accessibility-panel {
  padding: 25px;
}
.accessibility-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}
.accessibility-head h2 {
  margin: 7px 0 0;
  font: 400 2rem/1 Georgia, serif;
}
.dialog-close {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: inherit;
  font-size: 1.3rem;
  cursor: pointer;
}
.accessibility-intro {
  color: var(--muted);
  line-height: 1.5;
  font-size: 0.84rem;
  margin: 18px 0;
}
.accessibility-field {
  display: grid;
  gap: 7px;
  margin-bottom: 14px;
  font-weight: 700;
}
.accessibility-field select {
  min-height: 40px;
  border: 1px solid var(--line);
  background: var(--white);
  color: inherit;
  padding: 7px 9px;
  font: inherit;
}
.accessibility-options {
  display: grid;
  gap: 12px;
  padding: 15px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.accessibility-options label {
  display: flex;
  align-items: center;
  gap: 10px;
  line-height: 1.35;
  cursor: pointer;
}
.accessibility-options input {
  width: 18px;
  height: 18px;
  accent-color: var(--red);
}
.accessibility-actions {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 18px;
}
.accessibility-actions button {
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--line);
  background: transparent;
  color: inherit;
  cursor: pointer;
}
.accessibility-actions .accessibility-done {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--paper);
}
body.a11y-font-large { font-size: 112.5%; }
body.a11y-font-xlarge { font-size: 125%; }
body.a11y-spacing { letter-spacing: 0.025em; word-spacing: 0.08em; }
body.a11y-spacing .day-row { line-height: 1.45; }
body.a11y-underline a { text-decoration: underline; text-underline-offset: 0.16em; }
body.a11y-focus *:focus-visible {
  outline: 3px solid var(--red) !important;
  outline-offset: 3px;
}
body.a11y-reduced-motion,
body.a11y-reduced-motion * {
  scroll-behavior: auto !important;
  animation-duration: 0.001ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.001ms !important;
}
body[data-theme="today"] .day-row.today {
  box-shadow: inset 0 0 0 2px var(--red), inset 0 0 0 999px color-mix(in srgb, var(--red) 11%, transparent);
  font-weight: 800;
}
main {
  padding: 0 clamp(18px, 3vw, 48px) 60px;
}
.heading {
  min-height: 300px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 40px;
  padding: 50px 0 42px;
}
.eyebrow,
.filter-label {
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-size: 0.67rem;
  font-weight: 800;
  color: var(--red);
}
h1 {
  font:
    400 clamp(3rem, 6.5vw, 6.5rem)/0.9 Georgia,
    serif;
  letter-spacing: -0.055em;
  margin: 18px 0 0;
}
h1 em {
  font-weight: 400;
  color: var(--red);
}
.lede {
  max-width: 390px;
  color: var(--muted);
  line-height: 1.55;
  margin: 0 0 7px;
}
.controls {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(540px, 1.1fr);
  align-items: stretch;
  gap: 24px;
  padding: 18px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 72px;
  background: var(--paper);
  z-index: 15;
}
.control-main {
  display: flex;
  align-items: center;
  align-content: center;
  gap: 9px 18px;
  flex-wrap: wrap;
  min-width: 0;
}
.filter-group {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.filter-group label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.78rem;
  cursor: pointer;
}
.filter-group input {
  position: absolute;
  opacity: 0;
}
.filter-group label:has(input:not(:checked)) {
  opacity: 0.35;
  text-decoration: line-through;
}
.swatch {
  width: 11px;
  height: 11px;
  border-radius: 2px;
  background: var(--line);
}
.swatch.weekend {
  background: var(--weekend);
}
.swatch.personal-rest {
  background: var(--personal-rest);
  border: 1px solid color-mix(in srgb, var(--ink) 18%, transparent);
}
.swatch.holiday {
  background: var(--red);
}
.swatch.bridge {
  background: var(--bridge);
}
.swatch.school {
  background: linear-gradient(
    90deg,
    var(--zone-a) 0 33.333%,
    var(--zone-b) 33.333% 66.666%,
    var(--zone-c) 66.666%
  );
}
.swatch.traffic {
  background: var(--traffic);
}
.zone-group {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding-left: 20px;
  border-left: 1px solid var(--line);
}
.zone-heading {
  min-width: max-content;
}
.zone-heading small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.52rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.zone-columns {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  min-width: 0;
}
.zone-choice {
  --zone-color: var(--line);
  display: grid;
  grid-template-columns: 4px minmax(0, 1fr);
  grid-template-rows: auto 1fr;
  column-gap: 7px;
  align-items: start;
  min-width: 0;
  min-height: 48px;
  padding: 5px 6px;
  border: 1px solid transparent;
  border-radius: 3px;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
  opacity: 0.46;
  transition:
    opacity 140ms ease,
    background-color 140ms ease,
    border-color 140ms ease;
}
.zone-choice.zone-a {
  --zone-color: var(--zone-a);
}
.zone-choice.zone-b {
  --zone-color: var(--zone-b);
}
.zone-choice.zone-c {
  --zone-color: var(--zone-c);
}
.zone-choice i {
  grid-row: 1 / 3;
  width: 4px;
  height: 100%;
  min-height: 36px;
  border-radius: 2px;
  background: var(--zone-color);
}
.zone-choice strong {
  color: var(--zone-color);
  font-size: 0.67rem;
  line-height: 1.1;
}
.zone-choice span {
  margin-top: 2px;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.52rem;
  line-height: 1.25;
}
.zone-choice:hover {
  opacity: 0.78;
}
.zone-choice.active {
  border-color: color-mix(in srgb, var(--zone-color) 42%, var(--line));
  background: color-mix(in srgb, var(--zone-color) 9%, transparent);
  opacity: 1;
}
.zone-choice:focus-visible {
  outline: 2px solid var(--zone-color);
  outline-offset: 2px;
}
.traffic-filters {
  display: flex;
  align-items: center;
  gap: 7px;
}
.traffic-filters select {
  height: 30px;
  max-width: 170px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: transparent;
  color: inherit;
  padding: 0 24px 0 9px;
  font-size: 0.68rem;
}
.status {
  font-size: 0.7rem;
  color: var(--muted);
  padding: 10px 0;
  text-align: right;
}
.data-statuses {
  display: flex;
  justify-content: space-between;
  gap: 18px;
}
.ad-slot {
  min-height: 74px;
  margin: 10px 0;
  border: 1px dashed color-mix(in srgb, var(--line) 75%, transparent);
  background: color-mix(in srgb, var(--white) 62%, transparent);
  color: var(--muted);
  display: grid;
  place-items: center;
  font-size: 0.58rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.ad-slot::before {
  content: "Emplacement publicitaire horizontal";
}
.year-board {
  display: grid;
  grid-template-columns: repeat(6, minmax(145px, 1fr));
  border-top: 1px solid var(--ink);
  border-left: 1px solid var(--line);
  min-width: 960px;
  background: var(--white);
  box-shadow: 0 18px 55px rgba(40, 34, 24, 0.08);
}
.year-board.annual {
  grid-template-columns: repeat(12, minmax(0, 1fr));
}
.month {
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--ink);
  min-width: 0;
}
.month-head {
  height: 67px;
  padding: 13px 9px;
  background: var(--ink);
  color: var(--paper);
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
}
.month-head h2 {
  font:
    400 1.3rem Georgia,
    serif;
  margin: 0;
  text-transform: capitalize;
}
.month-head span {
  font-size: 0.62rem;
  opacity: 0.6;
}
.days {
  display: grid;
  grid-template-rows: repeat(31, 22px);
}
.day-row {
  border: 0;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 58%, transparent);
  background: transparent;
  color: inherit;
  display: grid;
  grid-template-columns: 8px 22px 18px minmax(0, 1fr) 24px;
  align-items: center;
  text-align: left;
  padding: 0 5px;
  font: 500 0.66rem inherit;
  cursor: pointer;
  position: relative;
}
.day-row.empty {
  cursor: default;
  background: repeating-linear-gradient(
    -45deg,
    transparent,
    transparent 3px,
    rgba(0, 0, 0, 0.025) 3px,
    rgba(0, 0, 0, 0.025) 4px
  );
}
.day-row:not(.empty):hover {
  box-shadow: inset 0 -1px var(--ink);
  z-index: 3;
}
.day-row.selected {
  border-bottom-color: var(--ink);
  z-index: 3;
}
.day-row.selected .date-num {
  color: var(--red);
  font-weight: 800;
}
.day-row:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: -2px;
}
.day-row.today {
  box-shadow: inset 0 2px var(--red);
  z-index: 2;
}
.day-row.weekend {
  background: var(--weekend);
}
.day-row.sunday {
  border-bottom-color: color-mix(in srgb, var(--ink) 42%, transparent);
  font-weight: 650;
}
.day-row.weekend.sunday {
  background: var(--sunday);
  color: var(--sunday-ink);
}
.day-row.weekend.sunday .date-num,
.day-row.weekend.sunday .day-name,
.day-row.weekend.sunday .day-label,
.day-row.weekend.sunday .week-num {
  color: var(--sunday-ink);
}
.day-row.personal-rest {
  background: var(--personal-rest);
}
.zone-rails {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  align-self: center;
  width: 8px;
  height: calc(100% - 4px);
}
.zone-rail {
  display: block;
  min-width: 0;
  border-radius: 1px;
  opacity: 0;
}
.zone-rail.zone-a {
  background: var(--zone-a);
}
.zone-rail.zone-b {
  background: var(--zone-b);
}
.zone-rail.zone-c {
  background: var(--zone-c);
}
.day-row.school.zone-a .zone-rail.zone-a,
.day-row.school.zone-b .zone-rail.zone-b,
.day-row.school.zone-c .zone-rail.zone-c {
  opacity: 1;
}
.day-row.bridge {
  background: var(--bridge);
}
.day-row.holiday {
  background: var(--red);
  color: white;
}
.day-row.holiday.sunday {
  background: var(--red);
  color: white;
}
.day-row.holiday.selected .date-num {
  color: white;
}
.day-row.holiday.sunday .date-num,
.day-row.holiday.sunday .day-name {
  color: white;
}
.day-row.traffic:after {
  content: "";
  position: absolute;
  right: 2px;
  top: 4px;
  width: 4px;
  height: 14px;
  border-radius: 3px;
  background: #e69231;
}
.day-row.traffic-2:after {
  background: #d7352f;
}
.day-row.traffic-3:after {
  background: #171714;
}
.day-row.traffic-estimated:after {
  background: repeating-linear-gradient(
    180deg,
    #d7352f 0 3px,
    transparent 3px 5px
  );
}
.date-num {
  font-weight: 800;
}
.day-name {
  color: var(--muted);
  font-weight: 700;
}
.holiday .day-name {
  color: white;
}
.day-label {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.week-num {
  justify-self: end;
  min-width: 22px;
  padding: 1px 2px;
  border-radius: 2px;
  background: var(--ink);
  color: var(--paper);
  font-size: 0.52rem;
  font-weight: 850;
  line-height: 1;
  text-align: center;
  letter-spacing: 0.01em;
}
.week-num:empty {
  display: none;
}
.insight {
  margin-top: 35px;
  padding: 26px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 25px;
}
.insight h2 {
  font:
    400 clamp(1.6rem, 3vw, 2.5rem) Georgia,
    serif;
  margin: 7px 0 0;
}
.insight-tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
}
.tag {
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 7px 10px;
  font-size: 0.72rem;
}
.tag.red {
  background: var(--red);
  border-color: var(--red);
  color: white;
}
.tag.school-zone-tag {
  --zone-color: var(--school);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-color: color-mix(in srgb, var(--zone-color) 42%, var(--line));
  background: color-mix(in srgb, var(--zone-color) 11%, var(--white));
}
.tag.school-zone-tag::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--zone-color);
}
.tag.school-zone-tag.zone-a {
  --zone-color: var(--zone-a);
}
.tag.school-zone-tag.zone-b {
  --zone-color: var(--zone-b);
}
.tag.school-zone-tag.zone-c {
  --zone-color: var(--zone-c);
}
.tag.gold {
  background: var(--bridge);
}
.tag.personal-rest-tag {
  background: var(--personal-rest);
}
footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  padding: 25px clamp(18px, 3vw, 48px);
  border-top: 1px solid var(--line);
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
@media (max-width: 1280px) {
  .controls {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
    position: static;
  }
  .control-main {
    justify-content: space-between;
  }
  .zone-group {
    padding-top: 8px;
    padding-left: 0;
    border-top: 1px solid var(--line);
    border-left: 0;
  }
}
@media (max-width: 1050px) {
  main {
    overflow-x: auto;
  }
  .heading,
  .status,
  .insight {
    min-width: 700px;
  }
  .controls {
    min-width: 0;
  }
  .filter-group {
    flex-wrap: nowrap;
    min-width: max-content;
  }
  .zone-group {
    min-width: 0;
  }
  .traffic-filters {
    min-width: max-content;
  }
  .year-board {
    grid-template-columns: repeat(6, 160px);
  }
  .year-board.annual {
    grid-template-columns: repeat(12, minmax(145px, 1fr));
  }
  .semester-switch {
    display: flex;
    margin-bottom: 10px;
  }
  .semester-switch button {
    border: 1px solid var(--line);
    background: transparent;
    color: inherit;
    padding: 7px 10px;
  }
  .semester-switch button.active {
    background: var(--ink);
    color: var(--paper);
  }
}
@media (max-width: 700px) {
  main {
    max-width: 100vw;
    contain: inline-size;
  }
  .masthead {
    grid-template-columns: 1fr auto;
  }
  .header-actions {
    gap: 4px;
  }
  .appearance-menu summary,
  .accessibility-toggle {
    width: 38px;
    padding: 0;
    font-size: 0;
  }
  .appearance-menu summary::before {
    content: "◐";
    font-size: 1rem;
  }
  .accessibility-toggle {
    font-size: 0.8rem;
  }
  .appearance-popover {
    right: -45px;
  }
  #todayButton {
    display: none;
  }
  .heading {
    min-width: 0;
    min-height: 180px;
    align-items: flex-start;
    flex-direction: column;
    justify-content: flex-end;
  }
  .lede {
    font-size: 0.85rem;
  }
  .controls {
    min-width: 0;
    position: static;
    display: block;
  }
  .control-main {
    display: grid;
    gap: 10px;
  }
  .filter-group {
    min-width: 0;
    max-width: 100%;
    overflow-x: auto;
    contain: inline-size;
    padding-bottom: 10px;
  }
  .zone-group {
    grid-template-columns: 1fr;
    min-width: 0;
    margin-top: 8px;
  }
  .zone-heading {
    min-width: 0;
  }
  .zone-columns {
    grid-template-columns: 1fr;
  }
  .zone-choice {
    min-height: 44px;
  }
  .traffic-filters {
    min-width: 0;
    max-width: 100%;
    overflow-x: auto;
    contain: inline-size;
    margin-top: 8px;
  }
  .data-statuses {
    display: block;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
  }
  .status {
    min-width: 0;
    overflow-wrap: anywhere;
    text-align: left;
  }
  .year-board {
    grid-template-columns: repeat(6, 155px);
    width: 100%;
    min-width: 0;
    overflow-x: auto;
    scroll-snap-type: x proximity;
  }
  .year-board .month {
    scroll-snap-align: start;
  }
  .year-board.annual {
    grid-template-columns: repeat(12, minmax(145px, 1fr));
    min-width: 0;
  }
  .insight {
    min-width: 0;
    align-items: flex-start;
    flex-direction: column;
  }
  .insight-tags {
    justify-content: flex-start;
  }
  h1 {
    font-size: 2.7rem;
  }
}
@media print {
  .masthead,
  .controls,
  .status,
  .insight,
  footer,
  .heading .lede {
    display: none;
  }
  main {
    padding: 0;
  }
  .heading {
    min-height: auto;
    padding: 0 0 12px;
  }
  .heading h1 {
    font-size: 32px;
  }
  .year-board {
    min-width: 0;
    box-shadow: none;
    grid-template-columns: repeat(6, 1fr);
  }
  .year-board.annual {
    grid-template-columns: repeat(12, 1fr);
  }
  .month-head {
    height: 45px;
  }
  .days {
    grid-template-rows: repeat(31, 16px);
  }
  .year-board.annual .days {
    grid-template-rows: repeat(31, 12px);
  }
  .year-board.annual .month-head {
    height: 30px;
    padding: 4px 6px;
  }
  .day-row {
    font-size: 7px;
    grid-template-columns: 8px 14px 12px 1fr 18px;
    padding: 0 2px;
  }
  .week-num {
    min-width: 16px;
    padding: 0 1px;
    font-size: 5px;
  }
  @page {
    size: A3 landscape;
    margin: 8mm;
  }
}
@media (min-width: 1051px) {
  :root {
    --row-height: clamp(14px, calc((100svh - 245px) / 31), 26px);
  }
  .masthead {
    height: 54px;
  }
  .heading {
    min-height: 0;
    height: 82px;
    padding: 15px 0;
    align-items: center;
  }
  .heading h1 {
    font-size: clamp(2rem, 3vw, 3.4rem);
    line-height: 1;
    margin: 5px 0 0;
  }
  .heading .lede {
    font-size: 0.8rem;
  }
  .controls {
    top: 54px;
    padding: 6px 0;
    min-height: 43px;
  }
  .status {
    padding: 4px 0;
  }
  .year-board {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    min-width: 0;
  }
  .year-board.annual {
    grid-template-columns: repeat(12, minmax(0, 1fr));
  }
  .year-board.annual .month-head {
    height: 40px;
    padding: 6px 5px;
  }
  .year-board.annual .month-head h2 {
    font-size: 0.82rem;
  }
  .year-board.annual .days {
    grid-template-rows: repeat(31, var(--row-height));
  }
  .year-board.annual .day-row {
    grid-template-columns: 8px 14px 11px minmax(0, 1fr) 19px;
    padding: 0 2px;
    font-size: clamp(0.38rem, 0.42vw, 0.52rem);
  }
  .year-board.annual .week-num {
    min-width: 18px;
    padding: 1px;
    font-size: clamp(0.4rem, 0.44vw, 0.48rem);
  }
  .month-head {
    height: 40px;
    padding: 6px 9px;
  }
  .month-head h2 {
    font-size: 1.05rem;
  }
  .days {
    grid-template-rows: repeat(31, var(--row-height));
  }
  .day-row {
    font-size: clamp(0.56rem, 0.62vw, 0.7rem);
  }
  .insight {
    margin-top: 8px;
    padding: 8px 0;
  }
  .insight h2 {
    font-size: 1.15rem;
    margin-top: 2px;
  }
  .tag {
    padding: 3px 7px;
  }
  .semester-switch {
    display: flex;
    border: 1px solid var(--line);
    border-radius: 18px;
    overflow: hidden;
    flex: none;
  }
  .semester-switch button {
    border: 0;
    border-right: 1px solid var(--line);
    background: transparent;
    color: inherit;
    height: 29px;
    padding: 0 11px;
    cursor: pointer;
    font-size: 0.72rem;
  }
  .semester-switch button:last-child {
    border: 0;
  }
  .semester-switch button.active {
    background: var(--ink);
    color: var(--paper);
  }
}

.fullscreen-toggle {
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font-size: 1.15rem;
  line-height: 1;
}
.fullscreen-toggle:hover {
  background: var(--ink);
  color: var(--paper);
}
html:fullscreen {
  background: var(--paper);
}
@media (min-width: 1051px) {
  html:fullscreen {
    --row-height: clamp(14px, calc((100svh - 280px) / 31), 26px);
  }
  html:fullscreen .masthead {
    height: 48px;
  }
  html:fullscreen main {
    height: calc(100svh - 48px);
  }
  html:fullscreen .controls {
    top: 48px;
  }
}
@media print {
  html,
  body {
    height: auto;
    overflow: visible;
  }
  main {
    height: auto;
    overflow: visible;
  }
  .heading {
    height: auto;
    min-height: 0;
    padding: 0 0 8px;
  }
  .heading h1 {
    font-size: 28px;
  }
  .year-board.annual {
    grid-template-columns: repeat(12, minmax(0, 1fr));
  }
  .year-board.annual .month {
    break-inside: avoid;
  }
  .year-board.annual .month-head {
    height: 30px;
    padding: 3px 5px;
  }
  .year-board.annual .month-head h2 {
    font-size: 10px;
  }
  .year-board.annual .days {
    grid-template-rows: repeat(31, 14px);
  }
  .year-board.annual .day-row {
    grid-template-columns: 8px 14px 11px minmax(0, 1fr) 16px;
    padding: 0 2px;
    font-size: 6px;
  }
}
