/* Calendar module (modules/calendar/views): the page's main box (components/box.css: its name on the 48px anthracite
   bar, as Account), a grey bar of buttons, the grid, and the key in a grey footer. The box is the screen's height and
   the hours scroll inside it, the day names staying at the top (the hours grow taller when there is room, never shorter
   than 64px). Each day is a column of cells, one per quarter of an hour: white when
   bookable, softly hatched when not. Week view: every day side by side from 992px; below that, and in the day view, a
   strip of the week's days and one day's column. */

/* The page is the screen's height (under the phone's top bar), never shorter than --client-min-h (a shorter screen
   scrolls the page instead), as Users. */
.admin__page:has(.calendar) {
  display: flex;
  flex-direction: column;
  height: calc(100vh - var(--admin-top-h));
  height: calc(100dvh - var(--admin-top-h)); /* 100vh first for browsers without dvh */
  min-height: var(--client-min-h);
}

@media (min-width: 1200px) {
  .admin__page:has(.calendar) {
    height: 100vh;
    height: 100dvh; /* no top bar beside the sidebar */
  }
}

.calendar {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0; /* the box's corners and border come from .box */
}

.calendar > .box__bar,
.calendar__bar,
.calendar__foot {
  flex: none;
}

/* The Availability drop-down can reach past the box's bottom on phones, so the box does not clip (.box does): its bar
   and its footer follow its round corners themselves, inside its border. */
.calendar.box {
  overflow: visible;
}

.calendar > .box__bar {
  border-radius: calc(var(--radius-4) - var(--border-1)) calc(var(--radius-4) - var(--border-1)) 0 0;
}

.calendar__sr {
  position: absolute;
  width: var(--border-1);
  height: var(--border-1);
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Dates in full from 576px, short on phones (Sat, 7 Nov), so they stay on one line. */
.calendar__long {
  display: none;
}

@media (min-width: 576px) {
  .calendar__long {
    display: inline;
  }

  .calendar__short {
    display: none;
  }
}

.calendar__head {
  position: relative;
  isolation: isolate; /* holds the linen behind the words */
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  color: var(--c-page);
  background-color: var(--c-anthracite);
  border-radius: var(--radius-2) var(--radius-2) 0 0;
}

/* Linen: a very faint crosshatch of white lines over the band. */
.calendar__head::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    repeating-linear-gradient(
      45deg,
      var(--c-linen) 0 var(--border-1),
      transparent var(--border-1) var(--sp-1)
    ),
    repeating-linear-gradient(
      -45deg,
      var(--c-linen) 0 var(--border-1),
      transparent var(--border-1) var(--sp-1)
    );
  border-radius: inherit;
}

.calendar__title {
  font-family: var(
    --font-body
  ); /* small capitals, like the other bands' titles (Availability, the dashboard's tiles) */
  font-size: var(--fs-body);
  font-weight: 400;
  line-height: var(--lh-heading);
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  white-space: nowrap; /* no overflow: hidden, which would move its baseline off the dates' */
  color: inherit;
}

.calendar__dates {
  flex: none;
  font-size: var(--fs-small);
  white-space: nowrap;
  color: inherit;
}

/* The grey bar: ‹ Today › Day Week as one block on the left; Availability on the right, on one line at every width
   (below 576px the buttons are tighter, below 400px narrower still). */
.calendar__bar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  padding: var(--sp-4);
  background-color: var(--c-surface);
  border-bottom: var(--border-1) solid var(--c-line);
}

/* The strip's buttons sit in a form (they post, so no date in the address); the form adds no box. */
.calendar__go {
  display: contents;
}

/* The block: joined buttons sharing one line, lifted a little; the chosen view pressed in. */
.calendar__block {
  display: flex;
  border-radius: var(--radius-1);
  box-shadow: var(--shadow-seg);
}

.calendar__nav,
.calendar__modes {
  display: flex;
}

.calendar__button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-1);
  min-height: var(--button-h-sm);
  padding-inline: var(--sp-4);
  font-size: var(--fs-small);
  font-weight: 500;
  white-space: nowrap;
  color: var(--c-text);
  text-decoration: none;
  background-color: var(--c-page);
  border: var(--border-1) solid var(--c-line);
  border-radius: var(--radius-1);
  cursor: pointer;
  transition:
    background-color var(--duration-fast) var(--ease),
    box-shadow var(--duration-fast) var(--ease);
}

.calendar__button:hover {
  background-color: var(--c-off-white);
}

.calendar__button:focus-visible {
  position: relative; /* the focus ring shows over its neighbours */
}

.calendar__block .calendar__button {
  margin-left: calc(-1 * var(--border-1)); /* neighbours share one line */
  border-radius: 0;
}

.calendar__nav > :first-child {
  margin-left: 0;
  border-radius: var(--radius-1) 0 0 var(--radius-1);
}

.calendar__nav-arrow {
  width: var(--button-h-sm);
  padding-inline: 0;
}

.calendar__button[aria-current="page"] {
  font-weight: 600;
  background-color: var(--c-off-white);
  box-shadow: var(--shadow-pressed);
}

/* Week only from 992px, where the week grid shows; below that every view is one day, so Day is the one shown, pressed. */
.calendar__week {
  display: none;
}

.calendar__modes > :first-child {
  font-weight: 600;
  background-color: var(--c-off-white);
  border-radius: 0 var(--radius-1) var(--radius-1) 0;
  box-shadow: var(--shadow-pressed);
}

@media (min-width: 992px) {
  .calendar__week {
    display: inline-flex;
    border-radius: 0 var(--radius-1) var(--radius-1) 0;
  }

  .calendar__modes > :first-child:not([aria-current="page"]) {
    font-weight: 500;
    background-color: var(--c-page);
    border-radius: 0;
    box-shadow: none;
  }

  .calendar__modes > :first-child[aria-current="page"] {
    border-radius: 0;
  }

  .calendar__modes > :first-child:not([aria-current="page"]):hover {
    background-color: var(--c-off-white);
  }
}

@media (max-width: 575.98px) {
  .calendar__bar {
    gap: var(--sp-2);
  }

  .calendar__block .calendar__button {
    padding-inline: var(--sp-2);
  }

  .calendar__block .calendar__nav-arrow {
    width: var(--sp-8);
    padding-inline: 0;
  }
}

@media (max-width: 399.98px) {
  .calendar__block .calendar__nav-arrow {
    width: calc(
      var(--sp-6) + var(--sp-1)
    ); /* 28px: still big enough for a finger */
  }
}

/* Availability: a glassy square with the clock and, from 576px, a small caret. */
.calendar__button--glass {
  flex: none;
  min-width: var(--button-h-sm);
  padding-inline: var(--sp-3);
  background-color: transparent;
  background-image: linear-gradient(var(--c-glass-top), var(--c-glass-bottom));
  border-color: var(--c-glass-edge);
  box-shadow: var(--shadow-glass);
}

.calendar__button--glass:hover {
  background-color: var(--c-page);
  box-shadow: var(--shadow-glass-hover);
}

.calendar__caret {
  display: none;
  font-size: var(--fs-xs);
  color: var(--c-text-muted);
  transition: transform var(--duration-fast) var(--ease);
}

@media (min-width: 576px) {
  .calendar__caret {
    display: inline;
  }
}

@media (max-width: 399.98px) {
  .calendar__button--glass {
    min-width: var(--sp-8);
    padding-inline: var(--sp-2);
  }
}

[open] > .calendar__button .calendar__caret {
  transform: rotate(180deg);
}

/* The Availability drop-down: under the bar, the width of the box on phones, a panel at the right from 576px. */
.calendar__panel {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 2;
  display: none;
  gap: var(--sp-4);
  padding: var(--sp-4);
  background-color: var(--c-page);
  border: var(--border-1) solid var(--c-line);
  border-radius: var(--radius-2);
  box-shadow: var(--shadow-1);
}

[open] > .calendar__panel {
  display: grid;
}

.calendar__drop > summary {
  list-style: none; /* no triangle: the caret shows it opens */
  cursor: pointer;
}

.calendar__drop > summary::-webkit-details-marker {
  display: none; /* Safari: its own triangle ignores list-style */
}

@media (min-width: 576px) {
  .calendar__panel {
    left: auto;
    right: var(--sp-4); /* under its button, at the right end of the bar */
    width: var(--calendar-panel-w);
  }
}

/* --- Availability: the drop-down's contents (views/availability.php), after the old site's. An anthracite heading
   flush with the panel's top, then Date & time and Slots. Phones: each day's name and date on one row, its chips
   sharing the row below. From 576px: day | date | chips on one row, chips as wide as their times. --- */
.availability {
  gap: var(--sp-6);
}

.availability__bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--sp-3);
  margin: calc(-1 * var(--sp-4)) calc(-1 * var(--sp-4)) 0; /* flush with the panel's top and sides */
  padding: var(--sp-3) var(--sp-4);
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--c-page);
  background-color: var(--c-anthracite);
  border-radius: var(--radius-2) var(--radius-2) 0 0;
}

.availability__title {
  font: inherit;
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  color: inherit;
}

.availability__week {
  font-variant-numeric: tabular-nums;
}

.availability__section {
  display: grid;
  gap: var(--sp-3);
}

.availability__sub {
  font-family: var(--font-body);
  font-size: var(--fs-small);
  font-weight: 600;
  color: var(--c-anthracite);
}

/* Day on its own row, From and To side by side; from 768px all three on one row. */
.availability__form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--sp-3);
  align-items: start;
}

.availability__form .field:first-of-type {
  grid-column: 1 / -1;
}

/* From and To: a little less room for the arrow, so "13:00" shows in full on phones. */
.availability__form .field:not(:first-of-type) select.field__input {
  padding-right: var(--sp-8);
}

@media (min-width: 768px) {
  .availability__form {
    grid-template-columns: minmax(0, 1fr) repeat(2, var(--calendar-time-pick-w)); /* Day gets the room; the times only what they need */
  }

  .availability__form .field:first-of-type {
    grid-column: auto;
  }
}

/* Add (or, while a slot is being changed, Save changes and Cancel). */
.availability__actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end; /* the buttons sit on the right */
  align-items: center;
  gap: var(--sp-3);
}

.availability__actions [hidden] {
  display: none;
}

.availability__cancel {
  order: -1; /* Cancel left of Save changes */
  padding: 0;
  font: inherit;
  font-size: var(--fs-small);
  color: var(--c-text-muted);
  text-decoration: underline;
  background: none;
  border: 0;
  cursor: pointer;
}

/* Add and Save changes: small bright blue buttons (the site's button--bright colours). */
.availability__add {
  min-height: var(--button-h-sm);
  padding-inline: var(--sp-3);
  font-size: var(--fs-small);
  font-weight: 600;
  color: var(--c-menu-button-text);
  background-color: var(--c-menu-button);
  border: var(--border-1) solid var(--c-menu-button);
  border-radius: var(--radius-1);
  cursor: pointer;
}

.availability__add:hover {
  background-color: var(--c-menu-button-hover);
  border-color: var(--c-menu-button-hover);
}

.availability__days {
  border-top: var(--border-1) solid var(--c-line);
}

.availability__day {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--sp-2);
  align-items: center;
  padding: var(--sp-2) 0 var(--sp-2) var(--sp-3);
  font-size: var(--fs-small);
  border-bottom: var(--border-1) solid var(--c-line);
}

.availability__name,
.availability__date {
  font-weight: 600;
  color: var(--c-heading);
  font-variant-numeric: tabular-nums;
}

.availability__date-short {
  display: none;
}

.availability__chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
}

.availability__chips,
.availability__none {
  grid-column: 1 / -1;
}

/* A slot: its times (tap to change them), and an × that removes it. */
.availability__chip,
.availability__none {
  display: inline-flex;
  flex: 1;
  justify-content: center;
  align-items: center;
  gap: var(--sp-1);
  padding: var(--sp-1) var(--sp-3);
  font: inherit;
  font-variant-numeric: tabular-nums;
  border: var(--border-1) solid var(--c-chip-border);
  border-radius: var(--radius-pill);
}

.availability__chip {
  padding-block: 0;
  padding-right: var(--sp-1);
  color: var(--c-text);
  background-color: var(--c-chip);
}

.availability__chip > form {
  display: contents;
}

.availability__chip-edit,
.availability__chip-remove {
  padding: var(--sp-1) 0;
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  border-radius: var(--radius-pill);
  cursor: pointer;
}

.availability__chip-edit {
  flex: 1;
  white-space: nowrap; /* "09:00–12:00" never breaks over two lines */
}

.availability__chip-remove {
  display: grid;
  place-items: center;
  width: var(--sp-6);
  height: var(--sp-6);
  padding: 0;
  font-size: var(--fs-xxs);
  color: var(--c-text-muted);
}

.availability__chip-remove:hover {
  color: var(--c-text);
  background-color: var(--c-chip-border);
}

.availability__chip:has(
  .availability__chip-edit:not([aria-pressed="true"]):hover
) {
  background-color: var(--c-accent);
}

/* The slot being changed: filled blue. */
.availability__chip:has([aria-pressed="true"]) {
  color: var(--c-menu-button-text);
  background-color: var(--c-menu-button);
  border-color: var(--c-menu-button);
}

.availability__chip:has([aria-pressed="true"]) .availability__chip-remove {
  color: inherit;
}

/* Slots' heading row: the title, and the Templates drop-down on the right. */
.availability__head {
  position: relative; /* the Templates and Edit menus open from this row's right end (full width on phones) */
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--sp-2);
}

.availability__head > form {
  display: none; /* empty: the Templates menu's buttons post them (form="…") */
}

/* SLOTS: small capitals, like the bars' titles. */
.availability__sub--caps {
  font-size: var(--fs-xs);
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
}

/* Templates and Edit, side by side on the right. */
.availability__tools {
  display: flex;
  gap: var(--sp-2);
}

/* Phones: the buttons without their first icon, so SLOTS, Templates and Edit fit on one row at 320px. */
@media (max-width: 575.98px) {
  .availability__templates-button > .bi:first-child {
    display: none;
  }
}

.availability__templates-button {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  min-height: var(--button-h-sm);
  padding-inline: var(--sp-3);
  font-size: var(--fs-small);
  color: var(--c-text);
  background-color: var(--c-page);
  border: var(--border-1) solid var(--c-line);
  border-radius: var(--radius-1);
  list-style: none; /* no triangle */
  cursor: pointer;
}

.availability__templates-button::-webkit-details-marker {
  display: none; /* Safari: its own triangle ignores list-style */
}

.availability__templates-button .bi {
  font-size: var(--fs-xxs);
  color: var(--c-text-muted);
}

.availability__menu {
  position: absolute;
  top: calc(100% + var(--sp-2));
  right: 0;
  left: 0;
  z-index: 3;
  display: grid;
  padding: 0 var(--menu-pad) var(--menu-pad); /* the title bar sits flush at the top */
  overflow: hidden;                            /* the bar keeps the rounded corners */
  background-color: var(--c-page);
  border: var(--border-1) solid var(--c-line);
  border-radius: var(--radius-2);
  box-shadow: var(--shadow-1);
  --menu-pad: var(--sp-2);
}

/* Edit: Add a slot (Day across, From and To side by side at every width). */
.availability__menu--edit {
  gap: var(--sp-3);
  --menu-pad: var(--sp-3);
}

.availability__menu--edit .availability__form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.availability__menu--edit .availability__form .field:first-of-type {
  grid-column: 1 / -1;
}

/* Clear all slots this week: at the bottom right of Availability. */
.availability__clear-form {
  margin-left: auto;
}

.availability__clear {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--fs-small);
  color: var(--c-error);
}

.availability__clear:hover {
  color: var(--c-error-hover);
  text-decoration: underline;
}

/* The menus' title: a small anthracite bar across the top, like Availability's own. */
.availability__menu-title {
  margin: 0 calc(-1 * var(--menu-pad)) var(--sp-2);
  padding: var(--sp-2) var(--sp-3);
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  color: var(--c-page);
  background-color: var(--c-anthracite);
}

.availability__menu--edit .availability__menu-title {
  margin-bottom: 0; /* the menu's own gap follows */
}

.availability__menu-item {
  display: flex;
  align-items: center;
}

.availability__use,
.availability__new,
.availability__pencil {
  font: inherit;
  font-size: var(--fs-small);
  color: var(--c-text);
  background: none;
  border: 0;
  border-radius: var(--radius-1);
  cursor: pointer;
}

.availability__use {
  display: grid;
  flex: 1;
  padding: var(--sp-2);
  text-align: left;
}

.availability__use small {
  font-size: var(--fs-xs);
  color: var(--c-text-muted);
}

.availability__pencil {
  display: grid;
  place-items: center;
  width: var(--sp-8);
  height: var(--sp-8);
  color: var(--c-text-muted);
}

.availability__new {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin-top: var(--sp-2);
  padding: var(--sp-3) var(--sp-2) var(--sp-2);
  text-align: left;
  border-top: var(--border-1) solid var(--c-line);
  border-radius: 0;
}

.availability__use:hover,
.availability__pencil:hover,
.availability__new:hover {
  background-color: var(--c-accent);
}

/* The template editor (views/availability-template.php): the sections in one form, then Delete | Cancel and Save. */
.availability__template {
  display: grid;
  gap: var(--sp-6);
}

.availability__day--weekday {
  grid-template-columns: var(--sp-10) minmax(0, 1fr);
}

@media (min-width: 576px) {
  .availability__menu {
    left: auto;
    width: var(--calendar-menu-w);
  }

  .availability__menu--edit {
    width: var(--calendar-edit-w);
  }
}

.availability__error {
  font-size: var(--fs-small);
  color: var(--c-error);
}

.availability__foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--sp-3);
}

.availability__foot-actions {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin-left: auto; /* on the right, also when there is no Delete */
}

/* Cancel: light grey, like the dialogs' Cancel. */
.availability__dismiss {
  min-height: var(--button-h-sm);
  padding-inline: var(--sp-3);
  font-size: var(--fs-small);
  font-weight: 600;
  color: var(--c-text);
  background-color: var(--c-surface);
  border: var(--border-1) solid var(--c-line);
  border-radius: var(--radius-1);
}

.availability__dismiss:hover {
  background-color: var(--c-line);
}

.availability__delete {
  padding: 0;
  font: inherit;
  font-size: var(--fs-small);
  color: var(--c-error);
  text-decoration: underline;
  background: none;
  border: 0;
  cursor: pointer;
}

.availability__delete:hover {
  color: var(--c-error-hover);
}

/* Not available: the calendar's soft hatching on white, light enough to read the words. */
.availability__none {
  color: var(--c-text-muted);
  background: repeating-linear-gradient(
    -45deg,
    var(--c-surface) 0 var(--sp-1),
    var(--c-page) var(--sp-1) var(--sp-2)
  );
  border-color: var(--c-line);
}

@media (min-width: 576px) {
  .availability__day {
    grid-template-columns: var(--sp-10) var(--sp-8) minmax(0, 1fr);
  }

  .availability__day--weekday {
    grid-template-columns: var(--sp-12) minmax(0, 1fr);
  }

  .availability__date {
    margin-right: var(--sp-4);
    text-align: right;
  }

  .availability__date-short {
    display: inline;
  }

  .availability__date-long {
    display: none;
  }

  .availability__chips,
  .availability__none {
    grid-column: auto;
  }

  .availability__chip,
  .availability__none {
    flex: none;
  }

  .availability__none {
    justify-self: start;
  }
}

/* The grid: the hours, then one column per day, edge to edge in the box, stretching down to the footer. */
.calendar__grid {
  display: grid;
  flex: 1;
  grid-template-rows: 1fr;
  min-height: 0;
  overflow-y: auto; /* the hours scroll inside the box */
  overscroll-behavior: contain;
}

.calendar__one {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
}

.calendar__strip,
.calendar__dayhead {
  flex: none;
}

.calendar__times,
.calendar__day {
  display: grid;
  grid-template-rows: auto 1fr; /* the day names, then the hours */
}

.calendar__grid--day .calendar__times,
.calendar__grid--day .calendar__day {
  grid-template-rows: 1fr;
}

.calendar__grid--week {
  display: none;
  grid-template-columns: var(--calendar-time-w) repeat(7, minmax(0, 1fr));
}

.calendar__grid--day {
  grid-template-columns: var(--calendar-time-w) minmax(0, 1fr);
}

@media (min-width: 992px) {
  .calendar__grid--week {
    display: grid;
  }

  .calendar__one--week {
    display: none;
  }
}

/* Each day's name above its column: the short name over the date; today's tinted blue. */
.calendar__corner,
.calendar__date {
  position: sticky; /* stays at the top while the hours scroll */
  top: 0;
  z-index: 1;
  display: block;
  height: var(--sp-16);
  background-color: var(--c-page);
  border-bottom: var(--border-1) solid var(--c-line);
}

.calendar__date {
  display: grid;
  place-content: center;
  font-family: var(--font-body);
  font-size: var(--fs-small);
  font-weight: 400;
  line-height: var(--lh-heading);
  text-align: center;
  color: var(--c-text);
}

.calendar__date strong {
  font-family: var(--font-heading);
  font-size: var(--fs-lead);
  font-weight: 500;
}

.calendar__day--today .calendar__date {
  color: var(--c-accent-text);
  background-color: var(--c-accent);
}

.calendar__hours,
.calendar__cells {
  display: grid;
  grid-auto-rows: minmax(
    var(--calendar-row),
    1fr
  ); /* taller when the box has room */
}

/* Each hour's time at the top of its row, under the hour's line. */
.calendar__hour {
  grid-row: span 4;
  padding: var(--sp-1) var(--sp-2);
  font-size: var(--fs-xs);
  text-align: right;
  color: var(--c-text-muted);
  font-variant-numeric: tabular-nums;
  border-top: var(--border-1) solid var(--c-line);
}

.calendar__hours > :first-child,
.calendar__cells > :first-child {
  border-top: 0; /* the line above is the day names' or the day's heading's */
}

.calendar__day {
  border-left: var(--border-1) solid var(--c-line); /* the line between days runs up through their names */
}

/* Not bookable: soft diagonal lines, fixed to the screen so they run on unbroken from cell to cell. */
.calendar__cell {
  background-color: var(--c-page);
  background-image: repeating-linear-gradient(
    -45deg,
    var(--c-surface) 0 var(--sp-1),
    transparent var(--sp-1) var(--sp-2)
  );
  background-attachment: fixed;
}

.calendar__cell--open {
  background: var(--c-page);
}

.calendar__cell--hour {
  border-top: var(--border-1) solid var(--c-line);
}

/* Phones and the day view: the week's days as a strip (each opens its day; a dot under days with bookings; today's
   date in blue; days without availability paler), then one day. */
.calendar__strip {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: var(--sp-1);
  padding: var(--sp-3) var(--sp-4);
  border-bottom: var(--border-1) solid var(--c-line);
}

.calendar__strip-day {
  display: grid;
  justify-items: center;
  gap: var(--sp-1);
  padding-block: var(--sp-2);
  font-size: var(--fs-xs);
  font-weight: 500;
  text-transform: uppercase;
  color: var(--c-text-muted);
  background: none;
  border: 0;
  border-radius: var(--radius-2);
  cursor: pointer;
  transition: background-color var(--duration-fast) var(--ease);
}

.calendar__strip-day strong {
  font-family: var(--font-heading);
  font-size: var(--fs-lead);
  font-weight: 500;
  line-height: var(--lh-heading);
  color: var(--c-heading);
}

.calendar__strip-day:hover {
  background-color: var(--c-off-white);
}

.calendar__strip-day--today strong {
  color: var(--c-accent-text);
}

.calendar__strip-day--off {
  opacity: 0.6;
}

.calendar__strip-day[aria-current="date"] {
  background-color: var(--c-off-white);
  box-shadow: var(--shadow-pressed);
}

.calendar__strip-dot {
  width: var(--sp-1);
  height: var(--sp-1);
  border-radius: var(--radius-pill);
}

.calendar__strip-dot--on {
  background-color: var(--c-text-muted);
}

/* The chosen day's name and how many are booked, on one line, over the day's grid. */
.calendar__dayhead {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--sp-3);
  padding: var(--sp-4);
  font-size: var(--fs-small);
  color: var(--c-text-muted);
  border-bottom: var(--border-1) solid var(--c-line);
}

.calendar__dayname {
  min-width: 0;
  overflow: hidden;
  font-family: var(--font-body);
  font-size: var(--fs-body);
  font-weight: 600;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: var(--c-text);
}

.calendar__dayhead > span {
  flex: none;
}

/* The key, in the grey footer: short words on phones, the reason for the hatching from 1200px. */
.calendar__foot {
  padding: var(--sp-3) var(--sp-4);
  font-size: var(--fs-small);
  color: var(--c-text-muted);
  background-color: var(--c-surface);
  border-top: var(--border-1) solid var(--c-line);
  border-radius: 0 0 calc(var(--radius-4) - var(--border-1)) calc(var(--radius-4) - var(--border-1));
}

.calendar__key {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2) var(--sp-3);
}

@media (min-width: 576px) {
  .calendar__key {
    column-gap: var(--sp-6);
  }
}

.calendar__key li {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

.calendar__key-more {
  display: none;
}

@media (min-width: 1200px) {
  .calendar__key-more {
    display: inline;
  }
}

.calendar__swatch {
  width: var(--sp-3);
  height: var(--sp-3);
  background-color: var(--c-page);
  background-image: repeating-linear-gradient(
    -45deg,
    var(--c-surface) 0 var(--border-1),
    transparent var(--border-1) var(--sp-1)
  );
  border: var(--border-1) solid var(--c-line);
  border-radius: var(--radius-1);
}

.calendar__swatch--open {
  background: var(--c-page);
}

.calendar__swatch--booked {
  background: var(--c-accent);
  border-color: var(--c-menu-button);
}

/* Super admin: the list of consultants under their drop-down. */
.calendar__people {
  gap: 0;
  padding: var(--sp-2);
}

.calendar__person {
  text-align: start;
  padding: var(--sp-2) var(--sp-3);
  color: var(--c-text);
  text-decoration: none;
  border-radius: var(--radius-1);
}

.calendar__person:hover {
  background-color: var(--c-ground);
}

.calendar__person[aria-current="page"] {
  color: var(--c-menu-button-text);
  background-color: var(--c-menu-button);
}

/* A booking: a pale blue card over the quarters it takes (rows-1 is 15 minutes, rows-4 an hour): the name, then the
   time, kind and how it happens. */
.calendar__booking {
  display: grid;
  align-content: center;
  margin: var(--border-1) var(--sp-1);
  padding-inline: var(
    --sp-2
  ); /* no padding above and below, so a 30-minute booking still fits both lines */
  overflow: hidden;
  font-size: var(--fs-xs);
  line-height: var(--lh-heading);
  color: var(--c-text);
  background-color: var(--c-accent);
  border-left: var(--sp-1) solid var(--c-menu-button);
  border-radius: var(--radius-1);
}

.calendar__booking > * {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.calendar__booking strong {
  font-size: var(--fs-small);
  font-weight: 500;
}

/* 15 minutes (the free call): too low for two lines, so the name, time and kind run on one line. */
.calendar__booking--short {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

.calendar__booking--short strong {
  flex: none;
  max-width: 60%;
  font-size: var(--fs-xs);
}

/* In Week view a 15-minute booking is too narrow for its time and kind as well: only the name shows (where it sits
   gives its time); the rest is still read out, hidden like .visually-hidden (base.css). Day view shows it all. */
.calendar__grid--week .calendar__booking--short strong {
  max-width: 100%;
}

.calendar__grid--week .calendar__booking--short > span {
  position: absolute;
  width: var(--border-1);
  height: var(--border-1);
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.calendar__booking--rows-1 {
  grid-row: span 1;
}
.calendar__booking--rows-2 {
  grid-row: span 2;
}
.calendar__booking--rows-3 {
  grid-row: span 3;
}
.calendar__booking--rows-4 {
  grid-row: span 4;
}
.calendar__booking--rows-5 {
  grid-row: span 5;
}
.calendar__booking--rows-6 {
  grid-row: span 6;
}
.calendar__booking--rows-7 {
  grid-row: span 7;
}
.calendar__booking--rows-8 {
  grid-row: span 8;
}
