/* Public booking flow: /book/<slug>, the single-link /u/<handle> page and the
   confirmation card. Fonts are served locally (SIL Open Font License). */
/* Fonts are declared once in ui-system.css, which every page loads. */

/* Tokens sit on body so the shared ui-system.css :root values cannot win. */
html body {
  --bone: #f3efe5;
  --paper: #fbf9f4;
  --ink: #151513;
  --quiet: #6f6a60;
  --rule: #e2dccf;
  --red: #ed4d35;
  --red-ink: #b8351e;
  --red-fill: #c7361f; /* white text on this is 5.3:1; --red alone is 3.7:1 */
  --red-wash: #fbe4de;
  --slate: #4a4741;
  --display: "Newsreader", Georgia, serif;
  --mono: "DM Mono", ui-monospace, monospace;
  margin: 0;
  color: var(--ink);
  font-family: var(--display);
  background-color: var(--bone);
  background-image: radial-gradient(
    64% 46% at 50% 38%,
    rgba(237, 77, 53, 0.07),
    rgba(243, 239, 229, 0) 72%
  );
  background-repeat: no-repeat;
  -webkit-font-smoothing: antialiased;
}
html body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}
a { color: inherit; }
:is(a, button, summary):focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
.bp-stage {
  position: relative;
  z-index: 1;
  width: min(1060px, calc(100% - 40px));
  margin: clamp(32px, 8vh, 88px) auto 0;
}
.bp-stage--narrow { width: min(560px, calc(100% - 40px)); }

/* The card: meta | calendar | times (step one), meta | form (step two). */
.booking-card {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr) 230px;
  border: 1px solid var(--rule);
  border-radius: 18px;
  background: var(--paper);
  box-shadow:
    0 1px 0 rgba(21, 21, 19, 0.04),
    0 24px 60px -30px rgba(21, 21, 19, 0.25);
  overflow: hidden;
}
.booking-card.is-details,
.booking-card.is-board { grid-template-columns: 320px minmax(0, 1fr); }
.bp-meta,
.booking-calendar,
.booking-slots,
.bp-details { padding: 36px 32px; min-width: 0; }
.bp-meta { display: flex; flex-direction: column; border-right: 1px solid var(--rule); }
.booking-slots { display: flex; flex-direction: column; padding-inline: 22px; border-left: 1px solid var(--rule); }
.bp-eyebrow {
  margin: 0;
  color: var(--red-ink);
  font: 500 10px/1.4 var(--mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.bp-back {
  width: 40px;
  height: 40px;
  margin-bottom: 20px;
  display: grid;
  place-items: center;
  border: 1px solid var(--rule);
  border-radius: 999px;
  color: var(--ink);
  text-decoration: none;
}
.bp-back:hover { border-color: var(--ink); background: var(--red-wash); }
.bp-icon { width: 16px; height: 16px; }
.bp-host { margin: 16px 0 0; display: flex; align-items: center; gap: 11px; font-size: 15px; line-height: 1.3; }
.bp-host b { font-weight: 500; }
.bp-avatar {
  width: 36px;
  height: 36px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--ink);
  color: var(--bone);
  font: 500 12px/1 var(--mono);
  letter-spacing: 0.04em;
}
.bp-title {
  margin: 20px 0 0;
  font-size: clamp(28px, 3.4vw, 34px);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.05;
  text-wrap: balance;
}
.bp-facts { margin: 24px 0 0; padding: 0; list-style: none; display: grid; gap: 12px; }
.bp-fact { display: flex; align-items: flex-start; gap: 10px; font-size: 15px; line-height: 1.35; }
.bp-fact > span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.bp-fact-icon { width: 16px; height: 16px; flex: none; margin-top: 2px; color: var(--quiet); }
.bp-fact b { font-weight: 400; }
.bp-lengths { margin-top: 26px; }
.bp-lengths-label {
  display: block;
  margin-bottom: 8px;
  color: var(--quiet);
  font: 400 10px/1 var(--mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.bp-segment {
  margin: 0;
  padding: 3px;
  list-style: none;
  display: flex;
  gap: 2px;
  border: 1px solid var(--rule);
  border-radius: 999px;
}
.bp-segment li { flex: 1; }
.bp-segment a {
  min-height: 44px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: var(--quiet);
  font: 400 12px/1 var(--mono);
  letter-spacing: 0.02em;
  text-decoration: none;
  white-space: nowrap;
}
.bp-segment a:hover { background: var(--red-wash); color: var(--ink); }
.bp-segment a[aria-current] { background: var(--ink); color: var(--bone); }
.bp-description { margin: 22px 0 0; color: var(--quiet); font-size: 15px; line-height: 1.55; }
.bp-privacy { margin: auto 0 0; padding-top: 28px; color: var(--quiet); font: 400 11px/1.6 var(--mono); }

/* Chosen time, shown on the details step. */
.bp-picked {
  margin-top: 24px;
  padding: 4px 0 4px 16px;
  border-left: 3px solid var(--red);
  background: linear-gradient(90deg, var(--red-wash), rgba(251, 228, 222, 0) 80%);
}
.bp-picked p { margin: 0; font-size: 16px; line-height: 1.4; }
.bp-picked .bp-picked-time { margin-top: 2px; font-size: 24px; letter-spacing: -0.015em; line-height: 1.2; }
.bp-picked span { display: block; margin-top: 4px; color: var(--quiet); font: 400 11px/1.4 var(--mono); }

/* Calendar. */
.booking-calendar { display: flex; flex-direction: column; }
.bp-board-title { margin: 0 0 24px; font-size: 22px; font-weight: 400; letter-spacing: -0.015em; line-height: 1.2; }
.bp-month { margin-bottom: 14px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.bp-month-name { margin: 0; font: 500 13px/1 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; }
.bp-month-nav { display: flex; gap: 8px; }
.bp-month-btn {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid var(--rule);
  border-radius: 999px;
  color: var(--ink);
  text-decoration: none;
}
.bp-month-btn:hover { border-color: var(--ink); background: var(--red-wash); }
.bp-month-btn.is-off { color: var(--rule); pointer-events: none; }
.bp-weekdays,
.bp-days {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  justify-items: center;
}
.bp-weekdays {
  margin-bottom: 6px;
  color: var(--quiet);
  font: 400 10px/1 var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.bp-days { gap: 4px 0; }
.bp-cell {
  width: 44px;
  height: 44px;
  position: relative;
  display: grid;
  place-items: center;
  font: 400 14px/1 var(--mono);
}
.bp-cell > span { color: var(--quiet); opacity: 0.6; }
.bp-day {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--red-wash);
  color: var(--red-ink);
  font-weight: 600;
  text-decoration: none;
}
.bp-day:hover { background: #f6cfc4; color: #a62d18; }
.bp-cell.is-picked a { background: var(--red-fill); color: #fff; }
.bp-cell.is-today::after {
  content: "";
  position: absolute;
  bottom: 4px;
  left: 50%;
  width: 4px;
  height: 4px;
  margin-left: -2px;
  border-radius: 999px;
  background: var(--red);
  pointer-events: none;
}
.bp-cell.is-today.is-picked::after { background: #fff; }
.booking-timezone { margin-top: auto; padding-top: 20px; display: flex; align-items: center; gap: 10px; }
.bp-tz-icon { width: 16px; height: 16px; flex: none; color: var(--quiet); }
.booking-timezone label { min-width: 0; flex: 1; display: flex; align-items: center; gap: 10px; }
.bp-tz-label {
  color: var(--quiet);
  font: 400 10px/1 var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
}
.booking-timezone input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]) {
  min-width: 0;
  flex: 1;
  height: 44px;
  padding: 0 2px;
  border: 0;
  border-bottom: 1px solid var(--rule);
  border-radius: 0;
  background: transparent;
  font: 400 13px/1 var(--mono);
}
html body button.bp-tz-apply {
  min-height: 44px;
  padding: 0 4px;
  border: 0;
  background: none;
  color: var(--red-ink);
  font: 500 11px/1 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}
html body button.bp-tz-apply:hover { text-decoration: underline; }

/* Times. */
.bp-slot-head { margin-bottom: 18px; }
.bp-slot-head h2 { margin: 0; font-size: 17px; font-weight: 400; line-height: 1.25; }
.bp-slot-head span {
  display: block;
  margin-top: 6px;
  color: var(--quiet);
  font: 400 10px/1 var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.bp-slot-list {
  margin: 0;
  padding: 0 4px 0 0;
  list-style: none;
  display: grid;
  gap: 8px;
  max-height: 430px;
  overflow-y: auto;
  scrollbar-width: thin;
  padding-bottom: 28px;
  mask-image: linear-gradient(to bottom, #000 calc(100% - 36px), transparent);
}
.bp-slot {
  width: 100%;
  min-height: 48px;
  display: grid;
  place-items: center;
  border: 1px solid var(--red);
  border-radius: 10px;
  color: var(--red-ink);
  font: 400 14px/1 var(--mono);
  text-decoration: none;
}
.bp-slot:hover { background: var(--red-wash); }
.bp-slot-row {
  min-height: 48px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  font: 500 14px/1 var(--mono);
}
.bp-slot-time,
.bp-slot-next {
  min-height: 48px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: #fff;
  text-decoration: none;
}
.bp-slot-time { background: var(--slate); }
.bp-slot-next { background: var(--red-fill); }
.bp-slot-next:hover { background: var(--red-ink); }
.bp-empty { margin: 0; color: var(--quiet); font-size: 15px; line-height: 1.5; }

/* Details step. */
.bp-details { display: flex; flex-direction: column; }
.bp-form { width: 100%; max-width: 520px; display: grid; gap: 18px; }
.bp-field { display: grid; gap: 8px; }
.bp-field > span { font: 500 12px/1 var(--mono); letter-spacing: 0.04em; }
.bp-field input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]) {
  height: 48px;
  padding: 0 14px;
  border: 1px solid var(--rule);
  border-radius: 10px;
  background: #fff;
  font: 400 14px/1.2 var(--mono);
}
.bp-field input:focus,
.booking-timezone input:focus {
  border-color: var(--red);
  outline: none;
  box-shadow: 0 0 0 3px rgba(237, 77, 53, 0.25);
}
html body button.bp-submit {
  min-height: 48px;
  margin-top: 6px;
  padding: 0 28px;
  justify-self: start;
  border: 0;
  border-radius: 999px;
  background: var(--red-fill);
  color: #fff;
  font: 500 12px/1 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}
html body button.bp-submit:hover { background: var(--red-ink); }
.bp-error {
  margin: 0 0 20px;
  padding: 13px 16px;
  border-left: 3px solid var(--red);
  border-radius: 4px 10px 10px 4px;
  background: var(--red-wash);
  color: var(--red-ink);
  font: 400 13px/1.5 var(--mono);
}
.bp-details .bp-error { max-width: 440px; }
.booking-slots .bp-error { margin: 0 0 14px; font-size: 12px; }

/* Confirmation card. */
.bp-confirm {
  padding: clamp(32px, 6vw, 48px);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  border: 1px solid var(--rule);
  border-radius: 18px;
  background: var(--paper);
  box-shadow:
    0 1px 0 rgba(21, 21, 19, 0.04),
    0 24px 60px -30px rgba(21, 21, 19, 0.25);
}
.bp-check {
  width: 56px;
  height: 56px;
  margin-bottom: 20px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--red-wash);
  color: var(--red);
}
.bp-confirm h1 { margin: 12px 0 0; font-size: 34px; font-weight: 400; letter-spacing: -0.02em; line-height: 1.05; }
.bp-receipt { width: 100%; margin: 28px 0 0; text-align: left; border-bottom: 1px solid var(--rule); }
.bp-receipt > div {
  padding: 14px 0;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  border-top: 1px solid var(--rule);
}
.bp-receipt dt {
  color: var(--quiet);
  font: 400 10px/1.4 var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.bp-receipt dd { margin: 0; font-size: 15px; text-align: right; overflow-wrap: anywhere; }
.bp-receipt a,
.bp-manage { color: var(--red-ink); text-underline-offset: 3px; }
.bp-manage {
  min-height: 44px;
  margin-top: 20px;
  display: inline-flex;
  align-items: center;
  font: 500 12px/1 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.bp-note { max-width: 400px; margin: 8px 0 0; color: var(--quiet); font: 400 11px/1.6 var(--mono); }

/* Motion: the card rises once, the times follow it. */
@media (prefers-reduced-motion: no-preference) {
  @keyframes bp-rise {
    from { opacity: 0; transform: translateY(8px); }
  }
  .booking-card,
  .bp-confirm { animation: bp-rise 320ms ease-out both; }
  .bp-slot-list > li { animation: bp-rise 320ms ease-out both; }
  .bp-slot-list > li:nth-child(2) { animation-delay: 40ms; }
  .bp-slot-list > li:nth-child(3) { animation-delay: 80ms; }
  .bp-slot-list > li:nth-child(4) { animation-delay: 120ms; }
  .bp-slot-list > li:nth-child(5) { animation-delay: 160ms; }
  .bp-slot-list > li:nth-child(6) { animation-delay: 200ms; }
  .bp-slot-list > li:nth-child(7) { animation-delay: 240ms; }
  .bp-slot-list > li:nth-child(8) { animation-delay: 280ms; }
  .bp-slot-list > li:nth-child(9) { animation-delay: 320ms; }
  .bp-slot-list > li:nth-child(10) { animation-delay: 360ms; }
}

/* Narrow desktop and tablet: meta moves on top, calendar and times pair up. */
@media (max-width: 960px) {
  .booking-card { grid-template-columns: minmax(0, 1fr) 230px; }
  .booking-card.is-details,
  .booking-card.is-board { grid-template-columns: minmax(0, 1fr); }
  .bp-meta { grid-column: 1 / -1; border-right: 0; border-bottom: 1px solid var(--rule); }
  .bp-meta,
  .booking-calendar,
  .booking-slots,
  .bp-details { padding-block: 28px; }
}
@media (max-width: 680px) {
  .booking-card { grid-template-columns: minmax(0, 1fr); }
  .booking-slots { border-top: 1px solid var(--rule); border-left: 0; padding-inline: 28px; }
  .bp-slot-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    max-height: none;
    overflow: visible;
    padding-right: 0;
    padding-bottom: 0;
    mask-image: none;
  }
  .bp-slot-row { grid-column: 1 / -1; }
  .bp-segment { max-width: 320px; }
}
@media (max-width: 560px) {
  .bp-stage,
  .bp-stage--narrow { width: 100%; margin-block: 0; }
  .booking-card,
  .bp-confirm { border-width: 1px 0; border-radius: 0; }
  .bp-meta,
  .booking-calendar,
  .booking-slots,
  .bp-details { padding-inline: 22px; }
  .bp-form { max-width: none; }
  .bp-layouts { padding-inline: 22px; }
  html body button.bp-submit { width: 100%; justify-self: stretch; }
}
@media (max-width: 420px) {
  .bp-slot-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  /* Hidden for sighted users to save width; still the input's accessible name. */
  .bp-tz-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
}
/* Instant date switching keeps every open date's times in the page. */
.bp-day-panel[hidden] { display: none; }
/* Server round trips (month, length, Next) show a progress bar instead of a frozen page. */
.booking-card { position: relative; }
.booking-card.is-loading { cursor: progress; }
.booking-card.is-loading > * { opacity: 0.55; transition: opacity 0.15s; }
.booking-card.is-loading::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  z-index: 2;
  height: 3px;
  border-radius: 18px 18px 0 0;
  background: linear-gradient(90deg, transparent, var(--red-fill), transparent) no-repeat;
  background-size: 40% 100%;
  animation: bp-load 1s linear infinite;
}
@keyframes bp-load { from { background-position: -40% 0; } to { background-position: 140% 0; } }
@media (prefers-reduced-motion: reduce) { .booking-card.is-loading::before { animation: none; background-size: 100% 100%; } }

/* Layout switch: top right, above the card. */
.bp-layouts { margin-bottom: 12px; display: flex; justify-content: flex-end; }
.bp-layout-switch { background: var(--paper); padding: 2px; gap: 1px; border-radius: 9px; }
.bp-layout-switch li { flex: none; }
.bp-layout-switch a { width: 28px; min-width: 28px; height: 28px; min-height: 28px; padding: 0; border-radius: 6px; }
.bp-layout-switch svg { width: 15px; height: 15px; }

/* Week layout: Monday to Sunday strip, times underneath. */
.booking-card.is-board .bp-board { padding-inline: 32px; }
.bp-weekstrip {
  margin: 0 0 24px;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}
.bp-weekstrip .bp-cell { width: auto; height: auto; }
.bp-weekstrip .bp-day,
.bp-wk-off {
  width: 100%;
  min-height: 64px;
  display: grid;
  gap: 4px;
  align-content: center;
  justify-items: center;
  border-radius: 12px;
}
.bp-wk-off { color: var(--quiet); }
.bp-wk-name { font: 400 10px/1 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; }
.bp-weekstrip b { font: 600 16px/1 var(--mono); }
.bp-week-slots .bp-slot-list {
  grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
  max-height: none;
  overflow: visible;
  padding: 0;
  mask-image: none;
}
.bp-week-slots .bp-slot-row { grid-column: 1 / -1; }
.bp-week-slots .bp-error,
.bp-column-board .bp-error { margin: 0 0 14px; font-size: 12px; }

/* Column layout: open days side by side. */
.bp-columns {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
}
.bp-col { min-width: 0; }
.bp-col-head {
  margin: 0 0 12px;
  padding-bottom: 10px;
  display: grid;
  justify-items: center;
  gap: 4px;
  border-bottom: 1px solid var(--rule);
  font-weight: 400;
}
.bp-col-head span { color: var(--quiet); font: 400 10px/1 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; }
.bp-col-head b { font: 600 20px/1 var(--mono); }
.bp-col .bp-slot-list { grid-template-columns: minmax(0, 1fr); max-height: 360px; }
@media (max-width: 680px) {
  .bp-columns { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(128px, 1fr); overflow-x: auto; padding-bottom: 6px; }
  .bp-col .bp-slot-list { max-height: none; }
}
@media (max-width: 560px) {
  .booking-card.is-board .bp-board { padding-inline: 22px; }
  .bp-weekstrip { gap: 3px; }
  .bp-weekstrip .bp-day, .bp-wk-off { min-height: 56px; border-radius: 10px; }
}

.bp-profile-headline { margin: 12px 0 20px; color: var(--quiet); font-size: 15px; line-height: 1.5; }
