  /* the Calendar page. Month and Week are a grid of days; where the page is narrow (a phone) Week is a day-by-day list
     of the days with something on (and today), and Month a small grid of days with the chosen day's list under it. */
  #calendarPage { display: none; }
  body.calendar-open #calendarPage { display: block; }
  .cal-bar { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: space-between; margin: 4px 0 8px; }
  .cal-bar .row-buttons { margin: 0; }
  .cal-span { margin: 0; font-size: 1.15rem; flex: 1 1 auto; text-align: center; } /* takes the free space, so the buttons stay put between views */
  .cal-views [aria-pressed="true"] { border-color: var(--accent); color: var(--accent-text); }
  .cal-legend { list-style: none; padding: 0; margin: 0 0 10px; display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 0.85rem; color: var(--ink-soft); }
  .cal-legend li { display: flex; align-items: center; }
  .cal-dot { display: inline-block; width: 0.65em; height: 0.65em; border-radius: var(--r-round); background: var(--cal, var(--accent)); margin-right: 0.35em; flex: none; }
  .cal-flag { color: var(--accent-text); flex: none; }
  #calGrid { container-type: inline-size; }
  .cal-head, .cal-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
  .cal-head span { padding: 4px 6px; font-size: 0.8rem; color: var(--ink-soft); }
  .cal-week { border-top: var(--bw) var(--bs) var(--line); }
  .cal-weeks { border-bottom: var(--bw) var(--bs) var(--line); }
  .cal-day { min-height: 6.5em; padding: 4px; border-left: var(--bw) var(--bs) var(--line); min-width: 0; }
  .cal-day:first-child { border-left: 0; }
  .cal-weekview .cal-day { min-height: 14em; }
  .cal-date { font-size: 0.85rem; margin: 0 0 2px; font-weight: 600; display: flex; gap: 6px; align-items: baseline; }
  .cal-out { background: var(--hover-wash); } /* another month's days, at both ends */
  .cal-out .cal-dnum { color: var(--ink-soft); font-weight: 400; }
  .cal-today .cal-dnum { color: var(--accent-text); text-decoration: underline; text-underline-offset: 3px; }
  .cal-day.cal-today { background: var(--accent-soft); } /* idea 95: shaded on the desktop too */
  .cal-evs { list-style: none; margin: 0; padding: 0; }
  /* In the grid an event is its dot (or flag), then its time over its title; in the list, one line. */
  .cal-ev { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 0.3em; align-items: baseline; width: 100%; text-align: left; background: none; border: 0; padding: 2px 3px; font: inherit; font-size: 0.82rem; line-height: 1.3; color: var(--ink); cursor: pointer; border-radius: var(--r-sm); min-width: 0; }
  .cal-ev > .cal-time, .cal-ev > .cal-ttl { grid-column: 2; }
  .cal-ev:hover { background: var(--hover-wash); }
  .cal-ev .cal-dot { align-self: center; }
  .cal-extra { display: none; }
  .cal-time { color: var(--ink-soft); white-space: nowrap; flex: none; }
  .cal-ttl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
  .cal-weekview .cal-ttl { white-space: normal; overflow-wrap: anywhere; }
  .cal-more { font-size: 0.82rem; margin: 2px 3px; }
  .cal-details { margin: 8px 0 12px; }
  /* a wide page: the details and the form beside the grid, which keeps its place */
  #calendarPage.cal-side > #calDetails { float: right; width: 300px; margin-left: 20px; position: sticky; top: 8px; }
  #calendarPage.cal-side > #calGrid { display: flow-root; }
  .cal-details h3 { margin: 0 0 4px; }
  .cal-details p { margin: 4px 0; }
  .cal-notes { white-space: pre-wrap; overflow-wrap: anywhere; max-width: 680px; }
  .cal-none { margin: 10px 0; }
  /* the form, and what a write did. */
  .cal-result:not([hidden]) { margin: 4px 0 10px; }
  #calForm label { display: block; margin: 10px 0 4px; }
  #calForm label.check-row { display: flex; margin: 10px 0 0; }
  #calForm input[type="text"], #calForm select, #calForm textarea { width: 100%; max-width: 100%; box-sizing: border-box; }
  .cal-fwhen { border: 0; padding: 0; margin: 10px 0 0; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
  .cal-fwhen legend { font-size: 13px; color: var(--ink-soft); padding: 0; margin-bottom: 4px; }
  .cal-fwhen input[hidden] { display: none; }
  #calForm .cal-on { margin: 12px 0 0; }
  /* Invite in the form, and a guest's answer and the organizer's list in the details (idea 96) */
  .cal-finvite { border: 0; padding: 0; margin: 12px 0 0; min-width: 0; }
  .cal-finvite legend { padding: 0; font-weight: 600; }
  .cal-fgroup { margin: 10px 0 0; font-size: 13px; color: var(--ink-soft); }
  .cal-guests { margin: 2px 0 6px; padding-left: 1.2em; }
  .cal-answer { align-items: center; margin: 6px 0; }
  .cal-myanswer { flex-basis: 100%; }
  .cal-answer .btn-secondary[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
  .cal-day { cursor: default; }
  .cal-today-tag { display: none; }
  /* the phone's month grid (idea 117): a day's button and the chosen day's list, only where the page is narrow */
  .cal-pick, .cal-pday { display: none; }
  .cal-pick { flex-direction: column; align-items: center; gap: 2px; width: 100%; min-height: 44px; padding: 3px 0; background: none; border: 0; font: inherit; color: var(--ink); cursor: pointer; }
  .cal-pnum { display: inline-flex; align-items: center; justify-content: center; width: 2em; height: 2em; border-radius: var(--r-round); font-size: 0.95rem; }
  .cal-today .cal-pnum { color: var(--accent-text); font-weight: 600; }
  .cal-out .cal-pick { color: var(--ink-soft); }
  .cal-pick[aria-pressed="true"] .cal-pnum { background: var(--accent); color: var(--on-accent); }
  .cal-pdots { display: flex; gap: 3px; height: 6px; }
  .cal-pdots .cal-dot { width: 6px; height: 6px; margin: 0; }
  .cal-pday .cal-date { font-size: 1rem; margin: 0 0 4px; }
  @container (max-width: 560px) {
    /* Week: a day-by-day list of the days with something on (and today). */
    .cal-weekview .cal-head { display: none; }
    .cal-weekview .cal-week { display: block; border-top: 0; }
    .cal-weekview .cal-weeks { border-bottom: 0; }
    .cal-weekview .cal-day { min-height: 0; border-left: 0; border-top: var(--bw) var(--bs) var(--line); padding: 8px 0; }
    .cal-weekview .cal-out, .cal-weekview .cal-empty:not(.cal-today) { display: none; }
    .cal-weekview .cal-dnum { display: none; }
    .cal-weekview .cal-date .cal-dname { position: static !important; width: auto; height: auto; margin: 0; overflow: visible; clip: auto; white-space: normal; }
    .cal-ev { display: flex; gap: 0.3em; font-size: 0.95rem; padding: 4px 3px; }
    .cal-weekview .cal-extra { display: list-item; }
    .cal-more { display: none; }
    .cal-ttl { white-space: normal; overflow-wrap: anywhere; }
    /* today stands out in the list: a soft wash, and Today beside its date. */
    .cal-weekview .cal-day.cal-today { background: var(--accent-soft); padding: 8px 10px; border-radius: var(--r-md); border-top-color: transparent; }
    .cal-weekview .cal-today-tag { display: inline-block; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--accent-text); font-weight: 600; }
    /* Month: a small grid of days, each with a dot for what's on; the chosen day's list under it. */
    .cal-monthview .cal-head span { padding: 4px 0; text-align: center; }
    .cal-monthview .cal-week { border-top: 0; }
    .cal-monthview .cal-weeks { border-bottom: var(--bw) var(--bs) var(--line); padding-bottom: 6px; }
    .cal-monthview .cal-day { min-height: 0; padding: 0; border-left: 0; }
    .cal-monthview .cal-date, .cal-monthview .cal-day > .cal-evs { display: none; }
    .cal-monthview .cal-pick { display: flex; }
    .cal-pday { display: block; margin: 12px 0 8px; }
  }
