/* resa — mobile-first UI. No external assets (self-hosted, iframe-embeddable).
   Two surfaces share these tokens:
   - Public booking pages: flow layout (they render inside an auto-resizing
     iframe on the marketing sites — no viewport-fixed chrome). Dark mode is
     suppressed when embedded (html.embed) so the widget matches its host site.
   - Admin: a standalone mobile app (sticky top bar, FAB, dark mode).
   Design language mirrors the sibling "todo" app: rounded cards, soft shadows,
   generous tap targets, a violet accent. */

:root {
  --bg: #eef1f8;
  --bg-elev: #f7f9fd;
  --card: #ffffff;
  --ink: #171d2b;
  --muted: #6a7488;
  --line: #e6eaf3;
  --line-strong: #d6dce9;

  --accent: #6c5ce7;
  --accent-2: #8b7bff;
  --accent-ink: #ffffff;
  --accent-soft: #efecfe;
  --accent-chip-ink: #4a3fc0; /* accent text on --accent-soft, AA-contrast */
  --sel-fill: #d6d0f7;        /* nightly stay band fill (darker than --accent-soft) */
  --sel-line: #9585ec;        /* nightly stay band contour (darker still) */
  --sel-cand: #e7e3fd;        /* reachable check-out days while picking */

  /* Planning: what a bar is, read before it is read. A stay wears Airbnb's own
     coral edge whatever its origin — left red = a night, left blue = an
     appointment — and the fill says where it came from: booked here, or imported. */
  --pl-stay-edge: #ff5a5f;
  --pl-stay-fill: #e8f1ff;
  --pl-ext-fill: #ffecec;

  --danger: #e5484d;
  --danger-soft: #fdecec;
  --danger-ink: #8f1d1f;
  --success: #16a34a;
  --success-soft: #e7f6ec;
  --success-ink: #10633a;

  --radius: 20px;
  --radius-md: 15px;
  --radius-sm: 11px;
  --pill: 999px;

  --shadow-sm: 0 1px 2px rgba(23, 29, 43, 0.06), 0 1px 3px rgba(23, 29, 43, 0.05);
  --shadow-md: 0 6px 20px rgba(23, 29, 43, 0.10);
  --shadow-lg: 0 16px 40px rgba(23, 29, 43, 0.22);
}

/* Dark mode — only when NOT embedded, so the iframe widget stays light to match
   the host marketing site. Admin pages are never embedded, so they get dark. */
@media (prefers-color-scheme: dark) {
  html:not(.embed) {
    --bg: #10131b;
    --bg-elev: #171b25;
    --card: #1b2029;
    --ink: #e9edf6;
    --muted: #98a2b6;
    --line: #29303d;
    --line-strong: #333c4b;

    --accent: #8b7bff;
    --accent-2: #a79bff;
    --accent-ink: #14101f;
    --accent-soft: #241f3c;
    --accent-chip-ink: #b7abff;
    --sel-fill: #3a3660;
    --sel-line: #6b60b8;
    --sel-cand: #2c2748;

    --pl-stay-edge: #ff7a7e;
    --pl-stay-fill: #142138;
    --pl-ext-fill: #351a1c;

    --danger: #ff6b6f;
    --danger-soft: #3a1f22;
    --danger-ink: #ffc9cb;
    --success: #22c55e;
    --success-soft: #14311f;
    --success-ink: #a7e8bf;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35);
    --shadow-md: 0 6px 20px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.55);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
/* Embedded (iframe) body is transparent so the host's page background shows at
   the edges instead of a hard band. */
html.embed body { background: transparent; }

h1 { font-size: 1.5rem; font-weight: 800; letter-spacing: -0.02em; margin: 0 0 0.35rem; }
h2 { font-size: 1.05rem; font-weight: 700; margin: 0 0 0.75rem; letter-spacing: -0.01em; }
p { margin: 0 0 0.75rem; }
.muted { color: var(--muted); }
.lead { color: var(--muted); margin: 0 0 1.25rem; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ================================================================= *
 *  Buttons (shared)                                                 *
 * ================================================================= */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.78rem 1.2rem;
  min-height: 46px;
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--card); color: var(--ink);
  font: inherit; font-weight: 700; font-size: 1rem;
  cursor: pointer; text-decoration: none;
  transition: filter 0.12s ease, background 0.12s ease, border-color 0.12s ease, transform 0.1s ease;
}
.btn:hover { text-decoration: none; background: var(--bg-elev); }
.btn:active { transform: scale(0.98); }
.btn svg { width: 20px; height: 20px; display: block; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { filter: brightness(1.06); background: var(--accent); }
.btn-ghost { background: var(--bg-elev); border-color: var(--line); color: var(--ink); }
.btn-danger { background: var(--danger-soft); border-color: transparent; color: var(--danger-ink); }
.btn-danger:hover { filter: brightness(0.98); }
.btn-block { display: flex; width: 100%; }
.btn-danger-solid { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger-solid:hover { filter: brightness(1.05); background: var(--danger); }
.btn-sm { min-height: 38px; padding: 0.5rem 0.9rem; font-size: 0.9rem; font-weight: 650; }

/* link-style destructive button (inside forms) */
.btn-link-danger {
  border: 0; background: none; color: var(--danger); cursor: pointer;
  padding: 0.5rem 0; font: inherit; font-weight: 650;
}
.btn-link-danger:hover { text-decoration: underline; }

/* ================================================================= *
 *  Chips & badges                                                   *
 * ================================================================= */
.chip {
  display: inline-flex; align-items: center; gap: 0.3rem;
  font-size: 0.78rem; font-weight: 650; line-height: 1;
  padding: 0.32rem 0.6rem; border-radius: var(--pill);
  background: var(--bg-elev); border: 1px solid var(--line); color: var(--muted);
  white-space: nowrap;
}
.chip-accent { background: var(--accent-soft); border-color: transparent; color: var(--accent-chip-ink); }
.chip-ok { background: var(--success-soft); border-color: transparent; color: var(--success-ink); }
.chip-off { background: var(--danger-soft); border-color: transparent; color: var(--danger-ink); }
.chip-airbnb { background: #ffe8ea; border-color: transparent; color: #c1264a; }
.chip-warn { background: #fff3d6; border-color: transparent; color: #8a5a00; }
.chip-booking { background: #e3ecf9; border-color: transparent; color: #003580; }
.chip-tag { background: var(--bg-elev); border-color: var(--line-strong); color: var(--muted); }
/* Stay total on a booking card: the ink of a figure, not of a status. */
.chip-price { border-color: var(--line-strong); color: var(--ink); font-variant-numeric: tabular-nums; }
/* Breakfasts ordered during a stay (escale-breakfast). The only chip that is a
   link: same size as its neighbours, but ::after widens the hit area to a
   thumb's worth without making it look taller. */
.chip-breakfast {
  position: relative; background: #fff3d6; border-color: transparent; color: #7a4b00;
  text-decoration: none; -webkit-tap-highlight-color: transparent;
}
.chip-breakfast::after { content: ""; position: absolute; inset: -8px -6px; }
.chip-breakfast:hover { background: #ffe9b8; color: #5f3a00; text-decoration: none; }
.chip-breakfast:active { transform: scale(0.97); }
@media (prefers-color-scheme: dark) {
  html:not(.embed) .chip-breakfast { background: #3a2c10; color: #f5d491; }
  html:not(.embed) .chip-breakfast:hover { background: #4a3814; color: #ffe3a8; }
}

/* Form hint text (under an input). */
.field-hint { margin: 0.3rem 0 0; font-size: 0.8rem; color: var(--muted); }

/* Literal values quoted in prose: an env var name, a Telegram getUpdates URL.
   `anywhere` (not `break-word`) is deliberate — it is the one that also shrinks
   the min-content width, so a long unbreakable token cannot widen the grid cell
   it sits in, and with it the whole page, on a narrow phone. */
code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.92em;
  overflow-wrap: anywhere;
}

/* Bookings tag filter bar. */
.tag-filter { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0 0 1rem; }
.tag-chip {
  border: 1.5px solid var(--line-strong); background: var(--card); color: var(--muted);
  border-radius: var(--pill); padding: 0.4rem 0.85rem; font: inherit; font-size: 0.85rem;
  font-weight: 650; cursor: pointer; transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}
.tag-chip:hover { border-color: var(--accent); color: var(--accent); }
.tag-chip.is-on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
/* Cards filtered out, and group headings/lists left empty by the filter. */
.bk-card[hidden], .bk-cards[hidden], .bk-group-title[hidden] { display: none !important; }

/* Airbnb reservation deep-link (small logo). */
.bk-airbnb-link { display: inline-flex; align-items: center; }
.ic-airbnb { width: 17px; height: 17px; fill: #ff5a5f; }
.bk-airbnb-link:hover .ic-airbnb { fill: #e0484d; }

/* ================================================================= *
 *  Cards & alerts (shared)                                          *
 * ================================================================= */
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius-md); box-shadow: var(--shadow-sm);
  padding: 1.15rem 1.1rem; margin-bottom: 1rem;
}
.card > h2 { margin-top: 0; }
.card-hint { margin: -0.25rem 0 1rem; color: var(--muted); font-size: 0.86rem; }
/* A hint that follows a form is not a subtitle: the negative top margin above
   would pull it onto the field it sits under (the mail preview's calendar
   selector), so it gets a real gap instead. */
.form + .card-hint { margin-top: 0.9rem; }

.alert { padding: 0.8rem 1rem; border-radius: var(--radius-sm); font-size: 0.92rem; font-weight: 600; margin: 0 0 1rem; }
.alert-error { background: var(--danger-soft); color: var(--danger-ink); }
.alert-ok { background: var(--success-soft); color: var(--success-ink); }

/* Inline result of a conversation's "Test" button on the Notifications page:
   an alert's colours without its block chrome, since it sits next to a button. */
.tg-test { font-size: 0.82rem; margin: 0.35rem 0 0; overflow-wrap: anywhere; }
.tg-test .ok { color: var(--success-ink); font-weight: 600; }
.tg-test .err { color: var(--danger-ink); font-weight: 600; }
/* On a conversation's row the result takes a line of its own once it exists,
   rather than squeezing the row it is triggered from. */
.opening-item .tg-test:empty { display: none; }
.opening-item .tg-test { flex: 1 0 100%; margin: 0; }
/* Which calendars notify a conversation — second line of its row. */
.tg-used { display: block; font-size: 0.82rem; font-weight: 500; color: var(--accent-chip-ink); }
.tg-used.muted { color: var(--muted); }
/* The "add a conversation" form, under the list it appends to. */
.tg-add { margin-top: 1.1rem; padding-top: 1.1rem; border-top: 1px solid var(--line); }

/* ================================================================= *
 *  Mail preview (/admin/mails)                                      *
 * ================================================================= */
/* The subject line, as the inbox shows it. */
/* The sample lines of the empty "Avant la venue" page: shown as the mail shows
   them (one fact per line, violet edge) so the shape is learnt from the example. */
.ar-example {
  /* .empty centres its prose; the lines themselves must read left-aligned, as
     they will in the mail — hence the auto margins rather than inheriting it. */
  margin: 0.5rem auto 0.7rem;
  max-width: 26rem;
  padding: 0.55rem 0.8rem;
  list-style: none;
  text-align: left;
  border-left: 3px solid var(--accent);
  background: var(--bg-elev);
  border-radius: var(--radius-sm);
  color: var(--ink);
  font-size: 0.9rem;
}
.ar-example li { padding: 0.12rem 0; }

/* The arrival note's one-tap starting lines, under its textarea. */
.ar-suggest { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem; margin-top: 0.5rem; }
.ar-suggest-label { font-size: 0.78rem; color: var(--muted); margin-right: 0.15rem; }
.ar-suggest .chip { cursor: pointer; border: 1px solid var(--line-strong); font: inherit; font-size: 0.78rem; }
.ar-suggest .chip:hover { background: var(--bg-elev); color: var(--ink); }
.ar-suggest .chip:active { transform: scale(0.97); }
/* Address + button on one line, the field wrapping under it on a phone. */
.ar-test-row { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.ar-test-row .input { flex: 1 1 14rem; min-width: 0; }

/* A preview card's title and its "does this one actually go out?" chip. Both
   pre-arrival mails are listed while only one of them is sent, so the answer has
   to sit next to the title rather than inside the prose below it. */
.mail-head {
  display: flex; align-items: baseline; justify-content: space-between;
  flex-wrap: wrap; gap: 0.4rem 0.6rem;
}
.mail-head h2 { margin: 0; }
.mail-subject { margin: 0.2rem 0 0.9rem; font-size: 0.92rem; overflow-wrap: anywhere; }
.mail-subject-label {
  display: inline-block; margin-right: 0.45rem;
  font-size: 0.68rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--muted);
}
/* The mail itself, in a frame: it is a whole document whose own stylesheet uses
   these very class names, so it cannot be inlined. The frame is sized by
   admin.js from the loaded document; the height attribute is the fallback. */
.mail-frame {
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg);
}
.mail-frame iframe { display: block; width: 100%; border: 0; }
/* The plain-text body the card doubles. */
.mail-alt { margin-top: 0.9rem; }
.mail-alt > summary {
  cursor: pointer; list-style: none;
  font-size: 0.86rem; font-weight: 600; color: var(--muted);
  display: flex; align-items: center; gap: 0.4rem;
}
.mail-alt > summary::-webkit-details-marker { display: none; }
.mail-alt > summary::before { content: "▸"; transition: transform 0.12s ease; }
.mail-alt[open] > summary::before { transform: rotate(90deg); }
.mail-alt pre {
  margin: 0.7rem 0 0;
  padding: 0.8rem 0.9rem;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow-x: auto;
  white-space: pre-wrap;
  font-size: 0.82rem; line-height: 1.6;
}

.empty { text-align: center; padding: 44px 20px; color: var(--muted); }
.empty-emoji { font-size: 2.6rem; margin-bottom: 6px; }
.empty-title { margin: 0 0 4px; font-size: 1.1rem; font-weight: 700; color: var(--ink); }
.empty-sub { margin: 0; font-size: 0.92rem; }

/* ================================================================= *
 *  PUBLIC — flow layout (iframe-safe)                               *
 * ================================================================= */
.pub {
  max-width: 620px;
  margin: 0 auto;
  padding: 22px 16px 40px;
}
html.embed .pub { padding-top: 14px; }
/* Embedded on a host site: that page already names the section (its own title +
   description just above the iframe), so hide the booking page's own title and
   description to avoid a doublon. The .bk-meta chips (duration, place, capacity)
   stay — the host doesn't repeat those. */
html.embed .bk-head h1,
html.embed .bk-head > p.muted { display: none; }
html.embed .bk-head { margin-bottom: 0.4rem; }

/* Airbnb integration page: one bordered block per listing, with its two sync
   URLs shown read-only for copy. */
.listing { border: 1.5px solid var(--line); border-radius: var(--radius-sm); padding: 12px 12px 4px; margin-bottom: 14px; }
.listing-head { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; margin-bottom: 0.6rem; }
.listing input[readonly] { background: var(--bg-elev); color: var(--muted); }

.back {
  display: inline-flex; align-items: center; gap: 0.3rem;
  margin-bottom: 0.9rem; font-size: 0.9rem; font-weight: 600; color: var(--muted);
}
.back:hover { color: var(--ink); text-decoration: none; }

/* Home — calendar picker cards */
.cal-cards { list-style: none; margin: 0.5rem 0 0; padding: 0; display: flex; flex-direction: column; gap: 0.7rem; }
.cal-card {
  display: flex; align-items: center; gap: 0.9rem;
  padding: 1rem 1.1rem;
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius-md); box-shadow: var(--shadow-sm);
  color: inherit;
  transition: transform 0.1s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.cal-card:hover { text-decoration: none; box-shadow: var(--shadow-md); border-color: var(--line-strong); transform: translateY(-1px); }
.cal-card:active { transform: scale(0.995); }
.cal-card-main { flex: 1 1 auto; min-width: 0; }
.cal-card-name { font-weight: 700; font-size: 1.05rem; letter-spacing: -0.01em; }
.cal-card-meta { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.5rem; }
.cal-card-go { flex: none; color: var(--muted); font-size: 1.3rem; line-height: 1; }

/* Booking page header + meta */
.bk-head { margin-bottom: 1.1rem; }
.bk-head p { margin: 0.35rem 0 0; }
.bk-meta { display: flex; flex-wrap: wrap; gap: 0.45rem; margin: 0.7rem 0 0; }

/* Booking layout: single column on mobile, two on wide */
.bk-grid { display: flex; flex-direction: column; gap: 1rem; margin-top: 0.25rem; }
.panel {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius-md); box-shadow: var(--shadow-sm);
  padding: 1.1rem 1rem;
}
@media (min-width: 720px) {
  .pub { max-width: 860px; }
  .bk-grid { flex-direction: row; align-items: flex-start; }
  .bk-grid > .bk-cal-col { flex: 0 0 340px; }
  .bk-grid > .bk-side-col { flex: 1 1 auto; min-width: 0; }
}

/* ================================================================= *
 *  Calendar (shared by nightly range-pick & appointment day-pick)   *
 * ================================================================= */
.cal { width: 100%; }
.cal-head { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; margin-bottom: 0.7rem; }
.cal-title { font-weight: 700; text-transform: capitalize; font-size: 1.02rem; }
.cal-nav {
  display: grid; place-items: center;
  width: 40px; height: 40px;
  border: 0; background: var(--bg-elev); color: var(--muted);
  border-radius: var(--pill); cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease, transform 0.1s ease;
}
.cal-nav:hover { background: var(--accent-soft); color: var(--accent); }
.cal-nav:active { transform: scale(0.9); }
.cal-nav[disabled] { opacity: 0.3; cursor: default; background: transparent; }
.cal-nav .chev { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-dow { text-align: center; font-size: 0.72rem; font-weight: 600; color: var(--muted); padding-bottom: 0.3rem; }
.cal-day {
  display: grid; place-items: center;
  min-height: 42px; padding: 0;
  border: 1.5px solid transparent; border-radius: var(--radius-sm);
  font-size: 0.95rem; font-weight: 600; font-variant-numeric: tabular-nums;
  color: var(--muted); background: transparent;
  font-family: inherit;
}
.cal-day.pad { visibility: hidden; }
.cal-day.off { color: var(--muted); opacity: 0.35; }
button.cal-day { cursor: pointer; }
.cal-day.avail {
  color: var(--accent); background: var(--card);
  border-color: var(--line-strong); cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease, transform 0.08s ease;
}
.cal-day.avail:hover { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-chip-ink); }
.cal-day.avail:active { transform: scale(0.94); }
.cal-day.today { box-shadow: inset 0 0 0 1.5px var(--accent); }
.cal-day.sel,
.cal-day.sel:hover { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.cal-day.sel:hover { filter: brightness(1.05); }
.cal-day.inrange { background: var(--accent-soft); color: var(--accent-chip-ink); border-color: transparent; }
/* Priced nights (nightly mode): the day number, then its price per night. The
   taller cell is set on the whole grid, not per cell — a per-cell bump would
   leave the unpriced neighbours of a row visibly shorter. */
.cal-grid.with-price .cal-day { min-height: 54px; }
.cal-day.has-price { align-content: center; gap: 1px; line-height: 1.05; }
.cal-day .cd-day { display: block; }
.cal-day .cd-price {
  display: block; font-size: 0.6rem; font-weight: 700;
  color: var(--muted); white-space: nowrap;
}
.cal-day.avail:hover .cd-price { color: inherit; }
.cal-day.rband .cd-price { color: inherit; opacity: 0.8; }
.cal-legend { display: flex; flex-wrap: wrap; gap: 0.9rem; margin-top: 0.8rem; font-size: 0.78rem; color: var(--muted); }
.cal-legend span { display: inline-flex; align-items: center; gap: 0.35rem; }
.cal-legend i { width: 12px; height: 12px; border-radius: 4px; display: inline-block; }
.cal-legend .sw-avail { background: var(--card); border: 1.5px solid var(--line-strong); }
.cal-legend .sw-sel { background: var(--sel-fill); border: 1.5px solid var(--sel-line); border-radius: 999px; }

/* ================================================================= *
 *  Slots (appointment)                                              *
 * ================================================================= */
.slots-day { font-weight: 700; margin: 0 0 0.7rem; text-transform: capitalize; }
.slots { min-height: 2rem; }
.slot-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 0.5rem; }
.slot {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  min-height: 46px; padding: 0.5rem 0.4rem;
  border: 1.5px solid var(--line-strong); border-radius: var(--radius-sm);
  background: var(--card); color: var(--accent);
  font: inherit; font-weight: 700; font-variant-numeric: tabular-nums; cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease, transform 0.08s ease;
}
.slot:hover { border-color: var(--accent); background: var(--accent-soft); }
.slot:active { transform: scale(0.96); }
.slot.sel,
.slot.sel:hover { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); box-shadow: 0 4px 12px color-mix(in srgb, var(--accent) 30%, transparent); }
.slot-time { line-height: 1.1; font-size: 0.98rem; }
/* Participant counter: its own muted colour + person glyph so it doesn't read as
   part of the time (which stays in the accent colour). */
.slot-count {
  display: inline-flex; align-items: center; gap: 3px;
  margin-top: 2px; font-size: 0.62rem; font-weight: 700;
  color: var(--muted); font-variant-numeric: tabular-nums;
}
.slot-count .ico-people { width: 11px; height: 11px; fill: currentColor; flex: none; }
.slot-full {
  color: var(--muted); background: var(--bg-elev); border-color: var(--line);
  cursor: default; font-weight: 600;
}
.slot-full:hover { background: var(--bg-elev); border-color: var(--line); }
/* Duplicate page: the slots are radios, not links — the chosen one is submitted
   with the pre-filled form around them. The input covers the pill and stays
   invisible; :focus-visible on it outlines the pill as a button would be. */
.slot-pick { position: relative; }
.slot-pick input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.slot-pick:has(input:checked) { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); box-shadow: 0 4px 12px color-mix(in srgb, var(--accent) 30%, transparent); }
.slot-pick:has(input:focus-visible) { outline: 3px solid var(--accent); outline-offset: 2px; }
.slot.sel .slot-count { color: var(--accent-ink); opacity: 0.82; }
.slots-empty { color: var(--muted); padding: 0.6rem 0; }
.next-info { margin: 0.8rem 0 0; font-size: 0.86rem; }
.stay-summary { margin: 0.1rem 0 0.3rem; min-height: 1.2rem; font-weight: 700; color: var(--accent); }

/* Nightly range picker: read-only arrival/departure driven by the calendar. */
.stay-pick {
  display: flex; align-items: stretch; gap: 0.6rem;
  margin-bottom: 0.7rem;
}
.stay-slot {
  flex: 1; display: flex; flex-direction: column; gap: 0.15rem;
  padding: 0.55rem 0.7rem; border: 1.5px solid var(--line-strong);
  border-radius: var(--radius-sm); background: var(--card); min-width: 0;
}
.stay-slot-label { font-size: 0.72rem; font-weight: 650; color: var(--muted); text-transform: uppercase; letter-spacing: 0.02em; }
.stay-slot-value { font-size: 1rem; font-weight: 700; color: var(--ink); }
.stay-arrow { display: flex; align-items: center; color: var(--muted); font-weight: 700; }
.stay-hint { margin: 0 0 0.3rem; font-size: 0.86rem; color: var(--muted); }
.stay-hint--warn { color: var(--danger); font-weight: 600; }
.stay-reset {
  border: 0; background: none; color: var(--muted); cursor: pointer;
  padding: 0.2rem 0; font: inherit; font-weight: 600; text-decoration: underline;
}
.stay-reset:hover { color: var(--ink); }
/* Price breakdown of the selected stay (nights, fees, total). */
.stay-price {
  margin: 0.2rem 0 0.8rem; padding: 0.7rem 0.8rem;
  border: 1.5px solid var(--line-strong); border-radius: var(--radius-sm);
  background: var(--card); font-variant-numeric: tabular-nums;
}
.stay-price .sp-line,
.stay-price .sp-total { display: flex; justify-content: space-between; gap: 0.8rem; font-size: 0.9rem; }
.stay-price .sp-line { color: var(--muted); padding: 0.12rem 0; }
/* The multi-night discount reads as a gain, not as one more fee. */
.stay-price .sp-discount { color: var(--success-ink); font-weight: 650; }
.stay-price .sp-total {
  margin-top: 0.45rem; padding-top: 0.45rem; border-top: 1px solid var(--line);
  font-weight: 800; font-size: 1rem; color: var(--ink);
}
.cal[data-picker="range"] .cal-day[data-date] { cursor: pointer; position: relative; }
/* Nights ruled out by the current selection (a gap, or min/max-nights): once a
   check-in is chosen they simply can't be clicked — no error message. */
.cal-day.cal-disabled { opacity: 0.22; cursor: default; pointer-events: none; }
/* Reachable check-out days while a check-in awaits its departure: kept visible
   so the customer sees exactly how far the stay can go. */
.cal-day.co-cand { background: var(--sel-cand); border-color: var(--sel-line); color: var(--accent-chip-ink); opacity: 1; }
.cal-day.co-cand:hover { background: var(--sel-fill); border-color: var(--sel-line); }
/* The chosen stay: one continuous rounded band, a single colour, drawn behind
   the day numbers. A ::before that bleeds ±3px bridges the 4px grid gap; the
   contour is drawn top/bottom on every segment and closed at the caps, which
   round at the true ends and at week-row edges. */
.cal-day.rband { color: var(--accent-chip-ink); background: transparent; border-color: transparent; opacity: 1; z-index: 0; }
.cal-day.rband:hover { background: transparent; border-color: transparent; }
.cal-day.rband::before {
  content: ""; position: absolute; z-index: -1;
  top: 3px; bottom: 3px; left: -3px; right: -3px;
  background: var(--sel-fill);
  border-top: 1.5px solid var(--sel-line);
  border-bottom: 1.5px solid var(--sel-line);
}
.cal-day.rband-l::before { left: 3px; border-left: 1.5px solid var(--sel-line); border-top-left-radius: 999px; border-bottom-left-radius: 999px; }
.cal-day.rband-r::before { right: 3px; border-right: 1.5px solid var(--sel-line); border-top-right-radius: 999px; border-bottom-right-radius: 999px; }
.cal-day.rband.today { box-shadow: none; }
.cal-day.rterm { font-weight: 800; color: var(--accent-chip-ink); } /* arrival & departure days: AA-contrast, set apart by weight */

/* ================================================================= *
 *  Forms (shared: public booking form + admin forms)               *
 * ================================================================= */
.form { display: grid; gap: 1rem; }
.field { display: grid; gap: 0.4rem; }
.field > label, .field-label { font-weight: 600; font-size: 0.88rem; color: var(--muted); }
.hint { color: var(--muted); font-size: 0.82rem; margin: 0.1rem 0 0; }
.input,
.form input[type="text"], .form input[type="url"], .form input[type="email"], .form input[type="tel"],
.form input[type="number"], .form input[type="date"], .form input[type="time"],
.form input:not([type]), .form textarea, .form select {
  font: inherit; width: 100%;
  padding: 0.8rem 0.85rem; min-height: 46px;
  border: 1.5px solid var(--line-strong); border-radius: var(--radius-sm);
  background: var(--bg-elev); color: var(--ink);
  transition: border-color 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}
.input:focus,
.form input:focus, .form textarea:focus, .form select:focus {
  outline: none; border-color: var(--accent); background: var(--card);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.form textarea { min-height: 4.5rem; resize: vertical; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
/* Two half-width fields leave ~150px each on a small phone — too little for a
   pair of selects or a labelled amount, so they stack instead. */
@media (max-width: 430px) { .grid-2 { grid-template-columns: 1fr; gap: 0.9rem; } }
.form-actions { display: flex; gap: 0.7rem; align-items: center; flex-wrap: wrap; }

/* pot-de-miel anti-robots : hors écran plutôt que display:none, que certains
   robots savent ignorer. Jamais visible ni atteignable au clavier. */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* input with a leading static prefix (the booking URL) */
.input-prefix { display: flex; align-items: stretch; border: 1.5px solid var(--line-strong); border-radius: var(--radius-sm); overflow: hidden; background: var(--bg-elev); }
.input-prefix:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input-prefix span { display: flex; align-items: center; padding: 0 0.65rem; background: var(--line); color: var(--muted); font-size: 0.85rem; white-space: nowrap; }
.input-prefix input { border: 0 !important; border-radius: 0 !important; box-shadow: none !important; background: var(--card) !important; }

/* toggle-style checkbox row */
.check-row { display: flex; align-items: center; gap: 0.6rem; }
.check-row input[type="checkbox"] { width: 1.25rem; height: 1.25rem; accent-color: var(--accent); flex: none; }
.check-row .check-label { font-weight: 600; font-size: 0.9rem; }

/* ================================================================= *
 *  Confirmation (public)                                            *
 * ================================================================= */
.confirm {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius-md); box-shadow: var(--shadow-sm);
  padding: 1.6rem 1.3rem; text-align: center;
}
.confirm-badge {
  width: 62px; height: 62px; margin: 0 auto 0.9rem;
  display: grid; place-items: center; border-radius: var(--pill);
  background: var(--success-soft); color: var(--success);
  font-size: 2rem; line-height: 1;
}
.confirm h2 { color: var(--ink); margin-bottom: 0.4rem; }
.confirm-when { font-weight: 700; font-size: 1.05rem; margin: 0.5rem 0; text-transform: capitalize; }
.confirm-price { margin: 0.2rem 0 0.6rem; font-variant-numeric: tabular-nums; }
.confirm-actions { display: flex; flex-direction: column; gap: 0.6rem; margin-top: 1.2rem; }
.confirm-foot { margin: 1rem 0 0; font-size: 0.86rem; color: var(--muted); }

/* ================================================================= *
 *  ADMIN — standalone app chrome                                    *
 * ================================================================= */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
  padding-top: env(safe-area-inset-top);
}
.topbar-inner {
  max-width: 760px; margin: 0 auto;
  padding: 0.7rem 1rem;
  display: flex; align-items: center; justify-content: space-between; gap: 0.75rem;
}
.brand {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-size: 1.2rem; font-weight: 800; letter-spacing: -0.02em; color: var(--ink);
}
.brand:hover { text-decoration: none; }
.brand-mark { width: 26px; height: 26px; display: block; }
.tabs {
  display: flex; gap: 0.25rem; min-width: 0;
  background: var(--bg-elev); border: 1px solid var(--line); border-radius: var(--pill); padding: 0.2rem;
  /* Three tabs on a very narrow phone: the bar scrolls inside itself rather than
     forcing the whole sticky header to scroll sideways. */
  overflow-x: auto; scrollbar-width: none; -ms-overflow-style: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab { padding: 0.4rem 0.85rem; border-radius: var(--pill); font-size: 0.86rem; font-weight: 650; color: var(--muted); white-space: nowrap; }
.tab:hover { color: var(--ink); text-decoration: none; }
.tab.active { background: var(--card); color: var(--accent); box-shadow: var(--shadow-sm); }
.topbar-right { display: flex; align-items: center; gap: 0.5rem; }

/* Settings (gear) dropdown menu */
.menu-wrap { position: relative; display: flex; }
.menu-btn { width: 40px; height: 40px; }
.menu-btn.active { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.menu-btn[aria-expanded="true"] { color: var(--ink); background: var(--bg-elev); border-color: var(--line-strong); }
.menu {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 40;
  min-width: 210px; padding: 6px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column; gap: 2px;
}
.menu[hidden] { display: none; }
.menu-form { margin: 0; display: flex; }
.menu-item {
  display: flex; align-items: center; gap: 0.6rem; width: 100%;
  padding: 0.6rem 0.7rem; border-radius: var(--radius-sm);
  font-size: 0.92rem; font-weight: 600; color: var(--ink);
  background: transparent; border: 0; text-align: left; cursor: pointer;
}
.menu-item:hover { background: var(--bg-elev); text-decoration: none; }
.menu-item.active { color: var(--accent); background: var(--accent-soft); }
.menu-item svg { flex: 0 0 auto; }
.menu-item-danger { color: var(--danger); }
.menu-item-danger:hover { background: var(--danger-soft); }
.menu-sep { height: 1px; background: var(--line); margin: 4px 2px; }

/* Very narrow phones (≤380px): collapse the brand to its mark and tighten the
   tabs so the sticky bar never forces the page to scroll sideways. */
@media (max-width: 420px) {
  .tab { padding: 0.4rem 0.6rem; font-size: 0.82rem; }
  .topbar-inner { padding: 0.7rem 0.7rem; gap: 0.5rem; }
}
@media (max-width: 360px) {
  .tab { padding: 0.35rem 0.45rem; font-size: 0.76rem; }
}

.wrap { max-width: 760px; margin: 0 auto; padding: 1.1rem 1rem calc(120px + env(safe-area-inset-bottom)); }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.page-head h1 { margin: 0; }

/* Per-calendar pale tints (assigned by creation order in Go; calColorCount of
   them, and it must not exceed what is defined here — past the last one the
   palette wraps and two calendars look alike). Applied to .et-card / .bk-card /
   .pl-bar; the inner reads --tint / --tint-edge. Listed so that neighbours in
   creation order are far apart in hue, which is when they get compared. */
.cal-c0 { --tint: #eef2ff; --tint-edge: #c7d2fe; } /* indigo */
.cal-c1 { --tint: #ecfdf5; --tint-edge: #a7f3d0; } /* emerald */
.cal-c2 { --tint: #fffbeb; --tint-edge: #fde68a; } /* amber */
.cal-c3 { --tint: #fff1f2; --tint-edge: #fecdd3; } /* rose */
.cal-c4 { --tint: #ecfeff; --tint-edge: #a5f3fc; } /* cyan */
.cal-c5 { --tint: #faf5ff; --tint-edge: #e9d5ff; } /* purple */
.cal-c6 { --tint: #f7fee7; --tint-edge: #d9f99d; } /* lime */
.cal-c7 { --tint: #fff7ed; --tint-edge: #fed7aa; } /* orange */
.cal-c8 { --tint: #f0f9ff; --tint-edge: #bae6fd; } /* sky */
.cal-c9 { --tint: #fdf4ff; --tint-edge: #f5d0fe; } /* fuchsia */
.cal-c10 { --tint: #f0fdfa; --tint-edge: #99f6e4; } /* teal */
.cal-c11 { --tint: #f8fafc; --tint-edge: #cbd5e1; } /* slate */
@media (prefers-color-scheme: dark) {
  .cal-c0 { --tint: #191f33; --tint-edge: #34407a; }
  .cal-c1 { --tint: #12241b; --tint-edge: #2c5540; }
  .cal-c2 { --tint: #272012; --tint-edge: #574a20; }
  .cal-c3 { --tint: #2a1620; --tint-edge: #5a2839; }
  .cal-c4 { --tint: #0f2429; --tint-edge: #215760; }
  .cal-c5 { --tint: #201933; --tint-edge: #433168; }
  .cal-c6 { --tint: #1c2410; --tint-edge: #46591f; }
  .cal-c7 { --tint: #2a1d11; --tint-edge: #5f3d1c; }
  .cal-c8 { --tint: #0f1e2e; --tint-edge: #1f4569; }
  .cal-c9 { --tint: #291130; --tint-edge: #5a2465; }
  .cal-c10 { --tint: #0e2422; --tint-edge: #1e5450; }
  .cal-c11 { --tint: #1a1f28; --tint-edge: #384250; }
}

/* Admin event-type cards */
.et-cards { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.75rem; }
/* Card is the swipe stage: reveals sit behind, .et-card-inner slides. */
.et-card { position: relative; overflow: hidden; border-radius: var(--radius-md); touch-action: pan-y; }
.et-card::before, .et-card::after {
  position: absolute; inset: 0; display: flex; align-items: center;
  color: #fff; font-weight: 700; font-size: 0.95rem; border-radius: inherit; opacity: 0;
}
.et-card::before { content: "🗑  Supprimer"; justify-content: flex-start; padding-left: 22px; background: var(--danger); }
.et-card::after { content: "Ouvrir un créneau  ➕"; justify-content: flex-end; padding-right: 22px; background: var(--accent); }
.et-card.swiping-right::before { opacity: var(--swipe-progress, 0); }
.et-card.swiping-left::after { opacity: var(--swipe-progress, 0); }
.et-card-inner {
  position: relative; z-index: 1;
  background: var(--tint, var(--card)); border: 1px solid var(--tint-edge, var(--line)); border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm); padding: 1rem 1.05rem;
  transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.15s ease, border-color 0.15s ease;
  will-change: transform;
}
.et-card:hover .et-card-inner { box-shadow: var(--shadow-md); border-color: var(--line-strong); }
.et-card.swiping .et-card-inner { transition: none; user-select: none; }
.et-card.swipe-go .et-card-inner { transition: transform 0.24s ease; }
.et-card-top { display: flex; align-items: center; gap: 0.55rem; flex-wrap: wrap; }
.et-card-name { font-weight: 700; font-size: 1.05rem; letter-spacing: -0.01em; color: var(--ink); }
.et-card-name:hover { text-decoration: none; }
/* Stretched link: the whole card opens the editor; the action row sits above it. */
.et-card-name::after { content: ""; position: absolute; inset: 0; z-index: 1; border-radius: var(--radius-md); }
.et-card-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; margin-top: 0.55rem; }
/* Shortcut bar: the actions span the card's full width, each taking an equal
   share — no rule above them, the row of wide buttons is its own footer. */
.et-card-actions { position: relative; z-index: 2; display: flex; align-items: center; gap: 0.5rem; margin-top: 0.85rem; }
/* Both the direct children and the button nested in the duplicate form grow:
   that form is itself a flex item, so its button needs its own flex-grow. */
.et-card-actions > *, .et-card-actions .icon-btn { flex: 1 1 0; }
.et-card-actions .icon-btn { width: auto; }
.et-card-actions form { margin: 0; display: flex; }
.et-delete { display: none; }
.copy-btn { border: 0; background: var(--bg-elev); color: var(--muted); }
.copy-btn.copied { color: var(--success); }

/* Openings (one-off exceptional slots) list */
.opening-list { list-style: none; margin: 0.25rem 0 0; padding: 0; display: flex; flex-direction: column; }
.opening-item { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; padding: 0.55rem 0.1rem; border-bottom: 1px solid var(--line); }
.opening-item:last-child { border-bottom: 0; }
.opening-when { flex: 1 1 auto; font-weight: 600; }
.opening-item .icon-btn { width: 36px; height: 36px; }
.opening-item form { margin: 0; }
/* A season bound: day + month side by side (a season recurs, so it has no year
   and a native date input — which always demands one — cannot be used). */
.md-pick { display: flex; gap: 0.4rem; }
.md-pick .md-day { flex: 0 0 5.5rem; }
.md-pick .md-month { flex: 1 1 auto; min-width: 0; }
/* Tiles: the small tap-to-edit card used by the tariff seasons and the Telegram
   conversations — tap opens its page, swipe right deletes. Same stage as
   .et-card, with the delete reveal only. */
.tiles { list-style: none; margin: 0.4rem 0 1.1rem; padding: 0; display: flex; flex-direction: column; gap: 0.6rem; }
.tile { position: relative; overflow: hidden; border-radius: var(--radius-md); touch-action: pan-y; }
.tile::before {
  content: "🗑  Supprimer"; position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: flex-start; padding-left: 22px;
  color: #fff; font-weight: 700; font-size: 0.95rem; border-radius: inherit;
  background: var(--danger); opacity: 0;
}
.tile.swiping-right::before { opacity: var(--swipe-progress, 0); }
.tile-inner {
  position: relative; z-index: 1;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm); padding: 0.85rem 1rem;
  transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.15s ease, border-color 0.15s ease;
  will-change: transform;
}
.tile:hover .tile-inner { box-shadow: var(--shadow-md); border-color: var(--line-strong); }
.tile.swiping .tile-inner { transition: none; user-select: none; }
.tile-top { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.tile-name { font-weight: 700; font-size: 1.02rem; letter-spacing: -0.01em; color: var(--ink); }
.tile-name:hover { text-decoration: none; }
/* Stretched link: the whole card opens the season's page. */
.tile-name::after { content: ""; position: absolute; inset: 0; z-index: 1; border-radius: var(--radius-md); }
.tile-sub { margin: 0.3rem 0 0; color: var(--muted); font-size: 0.88rem; }
/* A Google review link is long and unbreakable: let it wrap inside the card
   rather than pushing the tile wider than the screen. */
.tile-url { font-size: 0.8rem; overflow-wrap: anywhere; }
.tile-delete { display: none; }
/* Delete link under a form that edits an existing row. */
.form-danger { margin-top: 1.2rem; text-align: center; }

/* Icon buttons */
.icon-btn {
  display: grid; place-items: center; width: 40px; height: 40px;
  border: 1px solid var(--line); border-radius: var(--pill);
  background: var(--card); color: var(--muted); cursor: pointer; text-decoration: none;
  transition: color 0.12s ease, background 0.12s ease, border-color 0.12s ease, transform 0.1s ease;
}
.icon-btn:hover { color: var(--ink); text-decoration: none; }
.icon-btn:active { transform: scale(0.92); }
.icon-btn svg { width: 20px; height: 20px; }
.icon-danger:hover { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, var(--line)); }

/* Floating action button (admin home) */
.fab {
  position: fixed; z-index: 30;
  right: max(18px, env(safe-area-inset-right));
  bottom: calc(22px + env(safe-area-inset-bottom));
  display: inline-flex; align-items: center; gap: 0.5rem;
  height: 56px; padding: 0 1.3rem 0 1.1rem;
  border: 0; border-radius: var(--pill);
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: var(--accent-ink); font: inherit; font-weight: 700; font-size: 1rem;
  box-shadow: var(--shadow-md), 0 8px 20px color-mix(in srgb, var(--accent) 40%, transparent);
  cursor: pointer;
  transition: transform 0.12s ease, filter 0.12s ease;
}
.fab:hover { text-decoration: none; transform: translateY(-2px); }
.fab:active { transform: scale(0.96); }
.fab-plus { font-size: 1.5rem; font-weight: 300; line-height: 1; }

/* ================================================================= *
 *  ADMIN — event-type form                                          *
 * ================================================================= */
.et-form { padding-bottom: 0.5rem; }

.mode-picker { display: grid; grid-template-columns: 1fr 1fr; gap: 0.7rem; }
.mode-opt {
  display: flex; align-items: flex-start; gap: 0.6rem;
  padding: 0.9rem 0.95rem; border: 1.5px solid var(--line-strong);
  border-radius: var(--radius-sm); cursor: pointer; background: var(--bg-elev);
  transition: border-color 0.12s ease, background 0.12s ease, box-shadow 0.12s ease;
}
.mode-opt input { margin-top: 0.15rem; accent-color: var(--accent); flex: none; }
.mode-opt:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 1px var(--accent); }
.mode-opt strong { font-weight: 700; }

.night-days { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.night-day {
  display: inline-flex; align-items: center; gap: 0.45rem;
  padding: 0.55rem 0.9rem; border: 1.5px solid var(--line-strong);
  border-radius: var(--pill); cursor: pointer; font-size: 0.92rem; font-weight: 600;
  background: var(--bg-elev); user-select: none;
  transition: border-color 0.12s ease, background 0.12s ease, color 0.12s ease;
}
.night-day input { accent-color: var(--accent); }
.night-day:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-chip-ink); }

/* Duration button picker (appointment) */
.seg-group { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.seg-opt { position: relative; }
.seg-opt input { position: absolute; opacity: 0; pointer-events: none; }
.seg-opt span {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 66px; min-height: 46px; padding: 0 1.05rem;
  border: 1.5px solid var(--line-strong); border-radius: var(--radius-sm);
  background: var(--bg-elev); color: var(--ink); font-weight: 700;
  cursor: pointer; white-space: nowrap;
  transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease, transform 0.1s ease;
}
.seg-opt span:active { transform: scale(0.96); }
.seg-opt input:checked + span {
  background: var(--accent); color: var(--accent-ink); border-color: var(--accent);
  box-shadow: 0 4px 12px color-mix(in srgb, var(--accent) 30%, transparent);
}
.seg-opt input:focus-visible + span { box-shadow: 0 0 0 3px var(--accent-soft); }

/* availability paint grid — touch-friendly */
/* Weekly availability painter — soft, modern look: no grey gridlines. Each day
   is a rounded "track"; painted hours read as a continuous rounded bar (only the
   ends of a run are rounded, via .run-top/.run-bottom set by availability.js). */
.avail-grid { overflow-x: auto; -webkit-overflow-scrolling: touch; padding: 4px 2px 6px; }
.avail-grid-inner {
  display: grid; grid-template-columns: auto repeat(7, minmax(2.4rem, 1fr));
  column-gap: 6px; row-gap: 0;
  background: transparent; user-select: none; min-width: 480px;
}
.ag-corner { background: transparent; }
.ag-day-head { text-align: center; font-size: 0.76rem; font-weight: 700; padding: 0 0 0.5rem; color: var(--muted); background: transparent; }
.ag-time { font-size: 0.66rem; color: var(--muted); padding: 0 0.55rem; text-align: right; line-height: 1.5rem; font-variant-numeric: tabular-nums; background: transparent; }
.ag-time.ag-hour { color: var(--ink); font-weight: 600; }

.ag-cell {
  height: 1.5rem; cursor: pointer; touch-action: none;
  background: var(--bg-elev);
  transition: background-color 0.14s ease, box-shadow 0.14s ease;
}
/* the day column reads as one soft rounded track */
.ag-cell.col-top { border-top-left-radius: 9px; border-top-right-radius: 9px; }
.ag-cell.col-bottom { border-bottom-left-radius: 9px; border-bottom-right-radius: 9px; }
.ag-cell:hover { background: color-mix(in srgb, var(--accent) 18%, var(--bg-elev)); }
/* faint hour tick inside the track (no hard grey line) */
.ag-cell.ag-hour:not(.on) { box-shadow: inset 0 1px 0 color-mix(in srgb, var(--line-strong) 40%, transparent); }

/* painted hours: a continuous accent bar, rounded only at the run's ends */
.ag-cell.on {
  background: linear-gradient(180deg, var(--accent-2), var(--accent));
  box-shadow: none;
  animation: ag-pop 0.16s cubic-bezier(0.22, 1, 0.36, 1);
}
.ag-cell.on:hover { background: linear-gradient(180deg, var(--accent-2), var(--accent-2)); }
.ag-cell.on.run-top { border-top-left-radius: 9px; border-top-right-radius: 9px; }
.ag-cell.on.run-bottom { border-bottom-left-radius: 9px; border-bottom-right-radius: 9px; box-shadow: 0 3px 10px color-mix(in srgb, var(--accent) 28%, transparent); }
@keyframes ag-pop { from { transform: scale(0.68); opacity: 0.45; } to { transform: scale(1); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .ag-cell.on { animation: none; } }

/* The paint hint is desktop-only; mobile gets the range-editor hint. */
.hint-mobile { display: none; }
@media (max-width: 640px) {
  .hint-desktop { display: none; }
  .hint-mobile { display: block; }
}

/* Mobile availability: pick a day, then add explicit time ranges (De → À). */
.day-pick { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.day-pick-btn {
  position: relative; min-width: 46px; min-height: 42px; padding: 0 12px;
  border: 1.5px solid var(--line-strong); border-radius: var(--pill);
  background: var(--bg-elev); color: var(--ink); font: inherit; font-weight: 700; font-size: 0.9rem;
  cursor: pointer; transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease, transform 0.1s ease;
}
.day-pick-btn:active { transform: scale(0.95); }
.day-pick-btn.active { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.day-pick-dot { position: absolute; top: 7px; right: 9px; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.day-pick-btn.active .day-pick-dot { background: var(--accent-ink); }
.day-ranges-title { font-weight: 700; color: var(--ink); margin: 0 2px 10px; text-transform: capitalize; }
.range-list { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.range-item {
  display: flex; align-items: center; justify-content: space-between; gap: 6px;
  padding: 0.15rem 0.4rem 0.15rem 0.4rem; border-radius: var(--radius-sm);
  background: var(--accent-soft); color: var(--accent-chip-ink);
  font-weight: 700; font-variant-numeric: tabular-nums;
}
.range-label {
  flex: 1 1 auto; text-align: left; cursor: pointer;
  border: 0; background: transparent; color: inherit;
  font: inherit; font-weight: 700; font-variant-numeric: tabular-nums;
  padding: 0.45rem 0.5rem; border-radius: var(--radius-sm);
}
.range-label:hover { background: color-mix(in srgb, var(--accent) 14%, transparent); }
.range-del {
  flex: none; width: 34px; height: 34px; border: 0; border-radius: 50%;
  background: transparent; color: var(--muted); font-size: 1rem; cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
}
.range-del:hover { color: var(--danger); background: var(--danger-soft); }
.range-empty { color: var(--muted); padding: 0.3rem 2px 0.8rem; font-size: 0.9rem; }
.range-add { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.range-add .input { flex: 1 1 6rem; min-width: 0; }
.range-arrow { color: var(--muted); font-weight: 700; }
.range-add-btn { flex: none; }
.range-err { color: var(--danger); font-size: 0.85rem; font-weight: 600; margin: 8px 2px 0; }

details.advanced { border-top: 0; }
details.advanced > summary {
  cursor: pointer; font-weight: 700; color: var(--ink); list-style: none;
  display: flex; align-items: center; gap: 0.5rem; padding: 0.2rem 0;
}
details.advanced > summary::-webkit-details-marker { display: none; }
details.advanced > summary::before { content: "▸"; color: var(--muted); transition: transform 0.12s ease; }
details.advanced[open] > summary::before { transform: rotate(90deg); }
details.advanced .form { margin-top: 1rem; }

/* Sticky save bar — always in the thumb zone */
.form-save {
  position: sticky; bottom: 0; z-index: 10;
  display: flex; gap: 0.7rem;
  margin: 0.5rem -1rem 0;
  padding: 0.8rem 1rem calc(0.8rem + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--line);
}
.form-save .btn-primary { flex: 1; }

/* ================================================================= *
 *  ADMIN — bookings list (cards, not a table)                       *
 * ================================================================= */
.bk-group-title { font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); margin: 1.4rem 0 0.7rem; }
.bk-group-title:first-of-type { margin-top: 0.5rem; }
.bk-hint { color: var(--muted); font-size: 0.85rem; margin: 0 2px 12px; }
.bk-cards { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.7rem; }
.bk-card { position: relative; border-radius: var(--radius-md); }
.bk-card-inner { background: var(--tint, var(--card)); border: 1px solid var(--tint-edge, var(--line)); border-radius: var(--radius-md); box-shadow: var(--shadow-sm); padding: 0.95rem 1rem; }
.bk-card.is-cancelled { opacity: 0.62; }
/* Swipeable upcoming bookings: reveals behind, inner slides (admin.js). */
.bk-card.swipeable { overflow: hidden; touch-action: pan-y; }
.bk-card.swipeable::before, .bk-card.swipeable::after {
  position: absolute; inset: 0; display: flex; align-items: center;
  color: #fff; font-weight: 700; font-size: 0.95rem; border-radius: inherit; opacity: 0;
}
.bk-card.swipeable::before { content: "✕  Annuler"; justify-content: flex-start; padding-left: 22px; background: var(--danger); }
.bk-card.swipeable::after { content: "Reprogrammer  🕐"; justify-content: flex-end; padding-right: 22px; background: var(--accent); }
.bk-card.swiping-right::before { opacity: var(--swipe-progress, 0); }
.bk-card.swiping-left::after { opacity: var(--swipe-progress, 0); }
/* Cancelled cards: swipe right to delete, left to take the cancellation back
   (the guest is re-booked and re-confirmed). Reuses .swipeable. */
.bk-card.bk-del::before { content: "🗑  Supprimer"; }
.bk-card.bk-del::after { content: "Réactiver  ↩"; }
.bk-card.swipeable .bk-card-inner { position: relative; z-index: 1; transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1); will-change: transform; }
.bk-card.swiping .bk-card-inner { transition: none; user-select: none; }
.bk-card-top { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; }
/* Right-hand chip group: wraps rather than squeezing the date when a card
   carries a breakfast, a price and a status at once. */
.bk-chips { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 0.4rem; }
.bk-when { font-weight: 700; text-transform: capitalize; }
.bk-card.is-cancelled .bk-when { text-decoration: line-through; }
/* The whole card opens the booking's page (admin.js); the date is the same
   target for a keyboard, and reads as the card's own text, not as a link. */
.bk-card[data-href] { cursor: pointer; }
a.bk-when { color: inherit; }
a.bk-when:hover { color: inherit; text-decoration: underline; }
.bk-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 0.7rem; margin-top: 0.5rem; color: var(--muted); font-size: 0.9rem; }
.bk-who { font-weight: 600; color: var(--ink); }
/* Duplicate shortcut: pinned to the card's right edge, and small enough that
   the guest's name stays the line's subject. Sits above the swipe layer so a
   tap reaches the link. */
.bk-dup { position: relative; z-index: 2; margin-left: auto; width: 34px; height: 34px; }
.bk-dup svg { width: 17px; height: 17px; }
.bk-who.muted { font-weight: 500; color: var(--muted); }
.bk-contact a { color: var(--muted); }
/* External (Airbnb) nights: read-only, no swipe actions — a faint coral edge. */
.bk-card.bk-external { border-left: 3px solid #ff5a5f; cursor: default; }

/* ================================================================= *
 *  ADMIN — planning (month view)                                    *
 * ================================================================= */
/* One week is two aligned 7-column grids: the day numbers, then the bars drawn
   over them. Each bar is placed by class (.pl-c<col> .pl-s<span> .pl-l<lane>)
   rather than by an inline style, so the admin needs no style-src of its own. */
.pl-head { display: grid; grid-template-columns: 34px 1fr 34px; align-items: center; }
.pl-title { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 0.5rem; }
.pl-today { cursor: pointer; }
.pl-dows { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.pl-weeks { display: flex; flex-direction: column; gap: 6px; }
.pl-week { display: flex; flex-direction: column; gap: 2px; }
.pl-days, .pl-items { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.pl-items { grid-auto-rows: 18px; gap: 2px 4px; }
.pl-day {
  display: grid; place-items: center; min-height: 34px;
  border-radius: var(--radius-sm); border: 1.5px solid transparent;
  font-size: 0.92rem; font-weight: 650; color: var(--ink);
  background: var(--card);
}
.pl-day:hover { text-decoration: none; border-color: var(--accent); color: var(--accent-chip-ink); }
.pl-day.pad { visibility: hidden; }
/* A day holding nothing stays a plain number; a day holding something is worth
   a tap, and says so. */
.pl-day.busy { font-weight: 800; }
.pl-day.today { box-shadow: inset 0 0 0 1.5px var(--accent); }
.pl-day.sel, .pl-day.sel:hover { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }

/* A bar spans the days it covers: grid-column start + span, on its own lane. */
.pl-c1 { grid-column-start: 1; } .pl-c2 { grid-column-start: 2; }
.pl-c3 { grid-column-start: 3; } .pl-c4 { grid-column-start: 4; }
.pl-c5 { grid-column-start: 5; } .pl-c6 { grid-column-start: 6; }
.pl-c7 { grid-column-start: 7; }
.pl-s1 { grid-column-end: span 1; } .pl-s2 { grid-column-end: span 2; }
.pl-s3 { grid-column-end: span 3; } .pl-s4 { grid-column-end: span 4; }
.pl-s5 { grid-column-end: span 5; } .pl-s6 { grid-column-end: span 6; }
.pl-s7 { grid-column-end: span 7; }
/* Lanes: as many as a week can stack. Beyond the last one an item would fall
   back to auto-placement, so this list is what "nothing is ever hidden" rests on. */
.pl-l1 { grid-row: 1; } .pl-l2 { grid-row: 2; } .pl-l3 { grid-row: 3; }
.pl-l4 { grid-row: 4; } .pl-l5 { grid-row: 5; } .pl-l6 { grid-row: 6; }
.pl-l7 { grid-row: 7; } .pl-l8 { grid-row: 8; } .pl-l9 { grid-row: 9; }
.pl-l10 { grid-row: 10; } .pl-l11 { grid-row: 11; } .pl-l12 { grid-row: 12; }
.pl-bar {
  display: flex; align-items: center; overflow: hidden;
  min-width: 0; padding: 0 0.35rem; border-radius: var(--radius-sm);
  background: var(--tint, var(--accent-soft)); border: 1px solid var(--tint-edge, var(--line-strong));
  font-size: 0.7rem; font-weight: 650; line-height: 1;
  color: var(--ink);
}
.pl-bar:hover { text-decoration: none; border-color: var(--accent); }
.pl-bar > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pl-short { display: none; } /* the phone's label — see the media query below */
/* A stay reads as one continuous band: a rounded end is where it really starts
   or ends, a flat one means it carries on into the week above or below. Its edge
   is coral — Airbnb's own red, for nights whatever their origin. */
.pl-stay {
  border-radius: var(--pill);
  border-color: var(--pl-stay-edge); border-left-width: 3px;
  background: var(--pl-stay-fill);
}
.pl-cont-l { border-top-left-radius: 3px; border-bottom-left-radius: 3px; border-left-width: 1px; border-left-style: dashed; }
.pl-cont-r { border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-right-style: dashed; }
/* An appointment keeps its calendar's tint, under the accent edge: left blue. */
.pl-appt { border-left: 3px solid var(--accent); }
/* Imported from Airbnb: same coral edge as any stay, coral fill for where it
   comes from, and no page of its own to open. */
.pl-ext { background: var(--pl-ext-fill); cursor: default; }

/* Under ~520px a column is some 45px wide. A bar with no text at all was pretty
   and useless, so the bars keep a label — the short one: no calendar name (its
   colour says it) and the hour as it is said, "9h Martin". A single day still
   clips it; a stay, spanning several, reads whole. */
@media (max-width: 520px) {
  .pl-items { grid-auto-rows: 15px; }
  .pl-bar { padding: 0 0.15rem; font-size: 0.62rem; letter-spacing: -0.01em; }
  .pl-label { display: none; }
  .pl-short { display: block; }
}

.pl-hint { margin-top: 0.9rem; }
.pl-legend { margin-top: 0.2rem; }
.pl-sw { background: var(--tint, var(--bg-elev)); border: 1.5px solid var(--tint-edge, var(--line-strong)); }
.pl-sw-stay { border-radius: var(--pill); background: var(--pl-stay-fill); border-color: var(--pl-stay-edge); border-left-width: 3px; }
.pl-sw-ext { border-radius: var(--pill); background: var(--pl-ext-fill); border-color: var(--pl-stay-edge); border-left-width: 3px; }
.pl-sw-appt { border-left: 3px solid var(--accent); }
/* The opened day, under the grid it belongs to. */
.pl-panel { margin-top: 1.4rem; }
.pl-day-title { font-size: 1.05rem; margin: 0 0 0.7rem; text-transform: capitalize; }
.pl-none { margin: 0.2rem 0 0; }

/* ================================================================= *
 *  ADMIN — one booking's own page                                   *
 * ================================================================= */
/* The contact and the answers are an edit form (see BookingDetailView), so they
   are plain .field rows. What a field cannot carry is the tap the value used to
   offer — calling the guest, writing to them — hence these shortcuts under it. */
.field-links { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.field-links .chip { text-decoration: none; }
/* Saving sits between the form and the actions below it: spaced out from both,
   and thumb-sized rather than a dot in the corner. */
.bk-save { margin: 1rem 0 0.2rem; }
.bk-save .btn { flex: 1 1 auto; justify-content: center; }
.bk-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; margin: 1.2rem 0 0.4rem; }
.bk-actions .btn { flex: 1 1 auto; justify-content: center; }

/* Breakfasts of a stay (/admin/breakfast): the same cards as the bookings list,
   plus the ordered items. */
.bx-lines { list-style: none; margin: 0.6rem 0 0; padding: 0; display: flex; flex-direction: column; gap: 0.3rem; }
.bx-lines li { display: flex; align-items: baseline; gap: 0.45rem; }
.bx-emoji { flex: none; }
.bx-note {
  margin: 0.6rem 0 0; padding: 0.5rem 0.7rem; border-radius: var(--radius-sm);
  background: var(--bg-elev); color: var(--muted); font-size: 0.9rem;
}
.bx-foot { margin: 1.3rem 0 0; font-size: 0.9rem; }
/* "Copy this link": a chip that acts (the "Préparer la venue" page, for one). */
.bk-copy { cursor: pointer; font: inherit; font-size: 0.78rem; font-weight: 650; padding: 0.32rem 0.6rem; }
.bk-copy.copied { background: var(--success-soft); color: var(--success-ink); }
/* "Préparer la venue" on an Airbnb card: the one action it can carry. */
.bk-prep { font-size: 0.78rem; font-weight: 650; padding: 0.32rem 0.6rem; }
.bk-prep:hover { background: var(--bg-elev); color: var(--ink); text-decoration: none; }
.bk-prep:active { transform: scale(0.97); }
.bk-cal-tag { margin-top: 0.5rem; }
.resched-slot { display: contents; } /* the inner .slot button is the grid item */

/* ================================================================= *
 *  Focus visibility, in-flight, reduced motion                      *
 * ================================================================= */
.btn:focus-visible, .slot:focus-visible, .cal-nav:focus-visible,
.cal-day.avail:focus-visible, .icon-btn:focus-visible, .fab:focus-visible,
.cal-card:focus-visible, .copy-btn:focus-visible,
.pl-day:focus-visible, a.pl-bar:focus-visible {
  outline: none; box-shadow: 0 0 0 2px var(--card), 0 0 0 4px var(--accent);
}
.htmx-request { opacity: 0.55; pointer-events: none; }

/* Styled confirmation modal (delete / cancel) */
.modal { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 20px; visibility: hidden; pointer-events: none; }
.modal.open { visibility: visible; pointer-events: auto; }
.modal-overlay { position: absolute; inset: 0; background: rgba(15, 18, 28, 0.5); opacity: 0; transition: opacity 0.18s ease; }
.modal.open .modal-overlay { opacity: 1; }
.modal-card {
  position: relative; width: 100%; max-width: 360px;
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow-lg);
  padding: 22px 20px 18px; transform: scale(0.94); opacity: 0;
  transition: transform 0.18s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.18s ease;
}
.modal.open .modal-card { transform: scale(1); opacity: 1; }
.modal-msg { margin: 0 0 20px; font-size: 1.05rem; font-weight: 600; line-height: 1.4; color: var(--ink); }
.modal-actions { display: flex; gap: 10px; }
.modal-actions .btn { flex: 1; }

/* --- Admin login page ------------------------------------------------- */
.login-body { margin: 0; }
.login {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
  /* soft accent wash behind the card */
  background: radial-gradient(120% 80% at 50% -10%, color-mix(in srgb, var(--accent) 22%, var(--bg)), var(--bg) 60%);
}
.login-card {
  width: 100%;
  max-width: 360px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 30px 26px 26px;
  text-align: center;
}
.login-logo {
  width: 60px;
  height: 60px;
  margin: 0 auto 14px;
  display: grid;
  place-items: center;
  border-radius: var(--pill);
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: var(--accent-ink);
  box-shadow: 0 8px 20px color-mix(in srgb, var(--accent) 40%, transparent);
}
.login-title { margin: 0 0 4px; font-size: 1.5rem; font-weight: 800; letter-spacing: -0.02em; color: var(--ink); }
.login-sub { margin: 0 0 20px; color: var(--muted); font-size: 0.95rem; }
.login .alert { text-align: center; }
.login-form { text-align: left; display: grid; gap: 0.9rem; }
.login-form .btn { margin-top: 0.2rem; }

/* The two doors. gate first, because it is the one to use; the local password
   below it, behind a rule that says what it is — a fallback, not an alternative. */
.login-gate { margin-bottom: 4px; }
.login-or {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 18px 0 14px;
  color: var(--muted);
  font-size: 0.82rem;
}
.login-or::before,
.login-or::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
