.lookup-form-year_calendar { grid-template-columns: minmax(0, 14rem) auto; }
.calendar-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.calendar { display: grid; gap: 18px; min-width: 0; }
.calendar [data-group="official"] { --mark: var(--mark-official); --mark-text: var(--mark-official-text); }
.calendar [data-group="remembrance"] { --mark: var(--mark-remembrance); --mark-text: var(--mark-remembrance-text); }
.calendar [data-group="other"] { --mark: var(--mark-other); --mark-text: var(--mark-other-text); }
.calendar-years { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 18px; }
.calendar-legend { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 24px; font-size: 15px; }
.calendar-legend li { display: flex; align-items: center; gap: 8px; min-height: 40px; }
.calendar-filter { display: flex; align-items: center; gap: 10px; min-height: 40px; }
.calendar-filter input { -webkit-appearance: none; appearance: none; flex: none; margin: 0; width: 42px; height: 24px; border-radius: 12px; border: 2px solid var(--field-border); background: radial-gradient(circle at 10px 50%, var(--field-border) 6px, transparent 7px); cursor: pointer; }
.calendar-filter input:checked { border-color: var(--mark); background: radial-gradient(circle at calc(100% - 10px) 50%, var(--mark-text) 6px, var(--mark) 7px); }
.calendar-filter input:not([hidden]) + .calendar-swatch { display: none; }
.calendar-filter:has(input:not([hidden])) { cursor: pointer; }
.calendar-swatch { display: inline-block; flex: none; width: 18px; height: 18px; border-radius: 5px; background: var(--mark); }
.calendar-swatch.is-today { background: none; outline: 3px solid var(--text); outline-offset: -3px; }
.calendar-months { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); grid-auto-rows: 1fr; gap: 16px; }
.calendar-month { padding: 14px; display: grid; gap: 8px; align-content: start; min-width: 0; }
.calendar-title { font-size: 16px; }
.calendar-title::first-letter, .calendar-dialog-when::first-letter, .calendar-dialog .info-title::first-letter { text-transform: uppercase; }
.calendar-table { width: 100%; table-layout: fixed; border-collapse: separate; border-spacing: 2px; font-variant-numeric: tabular-nums; font-size: 14px; }
.calendar-table th { padding: 0; font-size: 12px; font-weight: 600; color: var(--muted); text-align: center; }
.calendar-table abbr { text-decoration: none; }
.calendar-table .calendar-week { width: 12.5%; font-weight: 400; }
.calendar-table td { height: 36px; padding: 0; text-align: center; border-radius: 8px; }
.calendar-table td:nth-child(n+7) { color: var(--muted); }
.calendar-table td[data-group] { background: var(--mark); color: var(--mark-text); font-weight: 700; }
.calendar-table td.is-today { outline: 3px solid var(--text); outline-offset: -1px; }
.calendar-day { display: block; width: 100%; height: 36px; padding: 0; border: 0; border-radius: 8px; background: none; color: inherit; font: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.calendar-day:hover { text-decoration: underline; }
.calendar-overview { padding: 18px; display: grid; gap: 8px; min-width: 0; }
.calendar-overview h3 { font-size: 18px; }
.calendar-rows { list-style: none; margin: 0; padding: 0; }
.calendar-row { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 2fr) minmax(0, 1.3fr); gap: 2px 16px; padding: 9px 0; border-top: 1px solid var(--border); align-items: baseline; }
.calendar-row:first-child { border-top: 0; }
.calendar-row-date { font-variant-numeric: tabular-nums; }
.calendar-row-name { font-weight: 650; }
.calendar-kind { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); }
.calendar-kind .calendar-swatch { width: 14px; height: 14px; border-radius: 4px; }
.calendar-dialog-day + .calendar-dialog-day { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); }
.calendar-dialog-name { font-size: 17px; margin-bottom: 6px; }
.calendar-dialog-when { font-weight: 600; margin-bottom: 6px; }
.calendar-dialog .calendar-kind { margin-bottom: 10px; }
@media (max-width: 760px) {
  .calendar-row { grid-template-columns: minmax(0, 1fr); }
  .calendar-row-name { order: -1; }
}
@media (max-width: 640px) {
  .lookup-form-year_calendar { grid-template-columns: minmax(0, 1fr); }
  .calendar-actions .button { width: 100%; }
  .calendar-month { padding: 12px 10px; }
  .calendar-overview { padding: 14px; }
  .calendar-table td, .calendar-day { height: 40px; }
}
@media print {
  @page { size: A4 portrait; margin: 9mm; }
  :root, :root[data-theme="dark"], :root:not([data-theme="light"]) {
    --bg: white; --surface: white; --surface-2: white; --text: black; --muted: black; --border: black;
    --mark-official: gold; --mark-official-text: black; --mark-remembrance: mediumorchid; --mark-remembrance-text: black;
    --mark-other: mediumturquoise; --mark-other-text: black; color-scheme: light;
  }
  html, body { background: white !important; color: black !important; min-height: 0; }
  .site-header, .site-footer, .skip-link, .crumbs, .fav-button, .lead, .used-count, .tool-widget, .lookup-disclaimer, .lookup-form,
  main > .row, main > dialog, body > dialog, .consent-float, .calendar-head, .calendar-years, .calendar-links, .calendar-dialog,
  .calendar-none, .calendar-filter input, .calendar-legend [data-calendar-today-key], .calendar-legend li:has(input:not(:checked)) { display: none !important; }
  main.wrap { max-width: none; padding: 0; }
  .title-row { margin: 0 0 2mm; }
  h1 { font-size: 16pt; color: black; }
  .lookup-result { margin: 0; display: block; }
  .calendar { display: block; }
  .calendar-legend { gap: 1mm 6mm; margin-bottom: 2.5mm; font-size: 8pt; }
  .calendar-legend li, .calendar-filter { gap: 1.5mm; min-height: 0; }
  .calendar-swatch, .calendar-filter input:not([hidden]) + .calendar-swatch, .calendar-kind .calendar-swatch { display: inline-block; width: 3.4mm; height: 3.4mm; border-radius: 0; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .calendar-months { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 3mm 5mm; }
  .calendar-month { padding: 0; gap: .8mm; border: 0; border-radius: 0; box-shadow: none; background: none; break-inside: avoid; page-break-inside: avoid; }
  .calendar-title { font-size: 10pt; color: black; }
  .calendar-table { border-spacing: 0; font-size: 8.5pt; line-height: 1; }
  .calendar-table th { padding-bottom: .6mm; font-size: 7pt; color: black; }
  .calendar-table td, .calendar-day { height: 6mm; line-height: 6mm; color: black; border-radius: 0; }
  .calendar-table td.is-today { outline: 0; }
  .calendar-table td[data-group] { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .calendar-table td[data-group="official"], [data-group="official"] .calendar-swatch { box-shadow: inset 0 0 0 1.4pt black; }
  .calendar-table td[data-group="other"], [data-group="other"] .calendar-swatch { box-shadow: inset 0 0 0 .5pt black; }
  .calendar-table td[data-group="remembrance"], [data-group="remembrance"] .calendar-swatch { outline: 1pt dashed black; outline-offset: -1pt; }
  .calendar-overview { display: block; margin-top: 3mm; padding: 0; border: 0; border-radius: 0; box-shadow: none; background: none; break-inside: avoid; }
  .calendar-overview h3 { font-size: 10pt; color: black; margin-bottom: 1mm; }
  .calendar-rows { columns: 2; column-gap: 6mm; font-size: 7.5pt; line-height: 1.2; }
  .calendar-row { grid-template-columns: 36mm minmax(0, 1fr) 25.5mm; gap: 1.5mm; padding: .5mm 0; border-top: .25pt solid gray; break-inside: avoid; }
  .calendar-row:first-child { border-top: .25pt solid gray; }
  .calendar-row-name { order: 0; }
  .calendar-row a { color: black; text-decoration: none; }
  .calendar-kind { gap: 1mm; font-size: 6pt; color: black; white-space: nowrap; }
  .calendar-kind .calendar-swatch { width: 2.4mm; height: 2.4mm; outline-offset: 0; outline-width: .5pt; }
}
