/* The calendar of a stay, on the office's edit page (templates/event/_stay_calendar.html.twig),
   and read only on the registration's page (templates/event/_stay_days.html.twig, at the end).
   One colour per thing taken, as on the mock-up shown to Kurukha on 2026-11-26:
   a box filled is taken, a box outlined is open that day but not taken, a grey
   box does not exist that day. The boxes of the arrival and departure days are
   the ones the office clicks, each on its own (assets/stay-calendar.js): ringed
   in their colour, where the days in between are not. */
.stay-cal,
.stay-days,
.stay-days__keys {
  --stay-night: #3d55a6;
  --stay-breakfast: #b07a0c;
  --stay-lunch: #23845a;
  --stay-dinner: #8a4fb0;
  --stay-teaching: #a2462e;
  --stay-off: #eef2f6;
  --stay-edge: #d5dde5;
}
.stay-cal__scroller { overflow-x: auto; padding-bottom: 4px; }
.stay-cal__grid { border-collapse: separate; border-spacing: 4px; min-width: 520px; }
.stay-cal__grid th { font-size: .8rem; font-weight: 600; text-align: center; color: var(--sdl-muted, #626a6f); padding: 2px; }
.stay-cal__grid th[scope="row"] { text-align: left; white-space: nowrap; color: var(--sdl-ink, #202325); padding-right: 8px; }
.stay-cal__grid td { padding: 0; text-align: center; }
.stay-cal__dow { display: block; text-transform: lowercase; }
.stay-cal__num { display: block; font-size: 1rem; color: var(--sdl-ink, #202325); font-variant-numeric: tabular-nums; }
.stay-cal__tag { display: block; font-size: .65rem; letter-spacing: .04em; text-transform: uppercase; }
.stay-cal__key { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.stay-cal__key--night, .stay-cal__box--night { --c: var(--stay-night); }
.stay-cal__key--breakfast, .stay-cal__box--breakfast { --c: var(--stay-breakfast); }
.stay-cal__key--lunch, .stay-cal__box--lunch { --c: var(--stay-lunch); }
.stay-cal__key--dinner, .stay-cal__box--dinner { --c: var(--stay-dinner); }
.stay-cal__key--teaching, .stay-cal__box--teaching { --c: var(--stay-teaching); }
.stay-cal__key { background: var(--c); }

/* Square boxes, as on the mock-up (Kurukha, 2026-11-26: « les cases carrées ou presque de l'artefact »). */
.stay-cal__box { display: grid; place-items: center; width: 44px; height: 40px; margin: 0 auto; border-radius: 9px;
  border: 1.5px solid var(--stay-edge); background: #fff; color: #fff; font-size: 18px; transition: background .12s, border-color .12s; }
.stay-cal__box.is-taken { background: var(--c); border-color: var(--c); }
.stay-cal__box.is-none { background: var(--stay-off); border-color: transparent; }
.stay-cal__box.is-none::before { content: "—"; color: var(--sdl-muted, #626a6f); opacity: .5; font-size: 12px; }
/* A box of an end day ticks and unticks: ringed, a hand under the mouse. */
.stay-cal__box.is-toggle { cursor: pointer; box-shadow: 0 0 0 2px #fff, 0 0 0 3.5px var(--c); }
.stay-cal__box.is-toggle:hover { border-color: var(--c); }
.stay-cal__box.is-toggle:focus-visible { outline: 2px solid var(--admin-accent, #1d3f95); outline-offset: 4px; }
/* A little air before the teaching. */
.stay-cal__sep th, .stay-cal__sep td { padding-top: 10px; }

/* Arrival and departure: a square per day with its date in it, filled when chosen.
   The radio stays the form's own, out of sight but focusable. */
.stay-cal__end { position: relative; display: block; margin: 0; cursor: pointer; }
.stay-cal__radio { position: absolute; top: 0; left: 0; width: 1px; height: 1px; opacity: 0; margin: 0; }
.stay-cal__date { display: grid; place-content: center; width: 44px; height: 40px; margin: 0 auto; border-radius: 9px;
  border: 1.5px solid var(--stay-edge); background: #fff; color: var(--sdl-ink, #202325); line-height: 1.05;
  font-variant-numeric: tabular-nums; transition: background .12s, border-color .12s; }
.stay-cal__date b { font-size: 14px; }
.stay-cal__date small { font-size: 9.5px; color: var(--sdl-muted, #626a6f); text-transform: lowercase; }
.stay-cal__end:hover .stay-cal__date { border-color: var(--admin-accent, #1d3f95); }
.stay-cal__radio:checked + .stay-cal__date { background: var(--admin-accent, #1d3f95); border-color: var(--admin-accent, #1d3f95); color: #fff; }
.stay-cal__radio:checked + .stay-cal__date small { color: #fff; }
.stay-cal__radio:focus-visible + .stay-cal__date { outline: 2px solid var(--admin-accent, #1d3f95); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .stay-cal__box, .stay-cal__date { transition: none; } }
/* The days of the retreat are not changed (Kurukha, 2026-11-26): said plainly, under the table. */
.stay-cal__fixed { margin: 10px 0 4px; max-width: 75ch; font-size: .875rem; color: var(--sdl-ink, #202325); }
.stay-cal__hint { margin: 4px 0 12px; max-width: 75ch; }
/* The boxes of the two end days as the form's own checkboxes. */
.stay-cal__ticks { display: flex; flex-wrap: wrap; gap: 12px 32px; margin-bottom: 12px; }
.stay-cal__end-day { margin: 0; padding: 0; border: 0; min-width: 0; }
.stay-cal__end-day legend { float: none; width: auto; margin-bottom: 4px; font-size: .875rem; font-weight: 600; }
.stay-cal__tick { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; margin-right: 14px; font-size: .875rem; cursor: pointer; }
.stay-cal__tick input { width: 1.05em; height: 1.05em; margin: 0; accent-color: var(--admin-accent, #1d3f95); }
.stay-cal__live { font-variant-numeric: tabular-nums; }
.stay-cal__live:empty { display: none; }

/* Read only, in the « Montants » card of a registration's page (Kurukha, 2026-11-27,
   mock-up B): the same days and colours, nothing to click. A dot in its colour
   where the stay takes it, a pale grey one everywhere else. Its words are the
   page's own size, and the dots follow them (« de la même taille que le
   reste »): no font size of its own here. On a phone the days are their
   numbers alone, so that the eight of them fit beside the row names; should a
   stay be longer, they scroll sideways under the row names, which stay put. */
.stay-days { overflow-x: auto; overflow-y: hidden; }
/* Across the whole card, the days sharing what the row names leave (Kurukha,
   2026-11-27: « ennuyé par la zone blanche à droite du calendrier »). */
.stay-days__grid { border-collapse: separate; border-spacing: 4px; width: 100%; }
.stay-days__grid th { font-weight: 400; text-align: center; color: var(--sdl-muted, #626a6f); padding: 0; }
.stay-days__grid th[scope="row"] { width: 1%; text-align: left; white-space: nowrap; padding-right: 12px; color: var(--sdl-ink, #202325); }
.stay-days__grid tr > :first-child { position: sticky; left: 0; background: var(--bs-card-bg, #fff); }
.stay-days__grid td { padding: 0; text-align: center; width: 2.6em; height: 1.75em; }
.stay-days__dow { display: block; line-height: 1.2; }
.stay-days__num { display: block; font-weight: 600; color: var(--sdl-ink, #202325); font-variant-numeric: tabular-nums; }
/* The eve and the day after, outside the teaching: quieter. */
.stay-days__day.is-eve .stay-days__num, .stay-days__day.is-after .stay-days__num { color: var(--sdl-muted, #626a6f); font-weight: 400; }
.stay-days__dot { display: inline-block; width: 1.15em; height: 1.15em; border-radius: 50%; vertical-align: middle; background: var(--stay-off); }
.stay-days__dot--night { --c: var(--stay-night); }
.stay-days__dot--breakfast { --c: var(--stay-breakfast); }
.stay-days__dot--lunch { --c: var(--stay-lunch); }
.stay-days__dot--dinner { --c: var(--stay-dinner); }
.stay-days__dot--teaching { --c: var(--stay-teaching); }
.stay-days__dot.is-taken { background: var(--c); }
.stay-days__sep th, .stay-days__sep td { padding-top: 8px; }
/* « Le calendrier chiffré » (Kurukha, 2026-11-27): on a wide screen the rows end with
   what they cost — what they count in grey, the sum, the body under it; the three
   meal rows share theirs behind a brace. As narrow as their words, the days sharing
   the rest. */
.stay-days__grid td.stay-days__price { width: 1%; white-space: nowrap; text-align: right; padding: 0 0 0 16px; color: var(--sdl-muted, #626a6f); }
.stay-days__grid td.stay-days__sum { width: 1%; white-space: nowrap; text-align: right; padding: 0 0 0 12px; color: var(--sdl-ink, #202325); font-variant-numeric: tabular-nums; line-height: 1.2; }
.stay-days__grid td.stay-days__brace { border-left: 2px solid var(--stay-edge); }
/* The same colours as keys, before each price listed under the calendar. */
.stay-days__keys { display: inline-flex; flex: none; gap: 3px; margin-top: .45em; }
.stay-days__keys .stay-days__dot { width: .65em; height: .65em; }
@media (max-width: 767.98px) {
  .stay-days__dow { display: none; }
}
