/* The demo tour on /demo/. Page-only rules, tokens only, mobile first. Without script the five steps read as a
 * numbered list (.tour-story); with script the tour (.tour-app) replaces it. Movement is transitions only. */

.tour { margin: var(--s-5) 0; }

/* ---------------------------------------------------------------- no script: the story as a list */
.tour-plain { display: grid; gap: var(--s-4); }
.tour-plain__place { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); margin: 0; color: var(--muted); }
.tour-story {
  display: grid;
  gap: var(--s-5);
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: tour-step;
}
.tour-story__step {
  position: relative;
  display: grid;
  gap: var(--s-2);
  padding: var(--s-4) var(--s-4) var(--s-4) calc(var(--s-4) + 2.75rem);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  counter-increment: tour-step;
}
.tour-story__step::before {
  content: counter(tour-step);
  position: absolute;
  top: var(--s-4);
  left: var(--s-4);
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  background: var(--accent);
  border-radius: 50%;
  color: var(--accent-ink);
  font-weight: 600;
}
.tour-story__step h3 { margin: 0; font-size: 1.25rem; font-weight: 600; line-height: var(--lh-tight); }
.tour-story__step p { margin: 0; max-width: 60ch; }
.tour-story__benefit { color: var(--ink-2); font-weight: 600; }
.tour-story__status { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; color: var(--muted); }

/* ---------------------------------------------------------------- the tour: progress rail */
.tour-app { display: grid; gap: var(--s-5); }

.tour-rail {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: var(--s-1);
  margin: 0;
  padding: 0;
  list-style: none;
}
.tour-rail__item { position: relative; display: flex; justify-content: center; }
/* the line that joins the numbers */
.tour-rail__item::before {
  content: "";
  position: absolute;
  top: 1.25rem;
  right: 50%;
  left: -50%;
  height: 2px;
  background: var(--line-strong);
}
.tour-rail__item:first-child::before { display: none; }
.tour-rail__item.is-done::before, .tour-rail__item.is-current::before { background: var(--accent); }

.tour-rail__btn {
  position: relative;
  display: grid;
  justify-items: center;
  gap: var(--s-1);
  min-width: var(--target);
  min-height: var(--target);
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: var(--radius-sm);
  color: var(--ink-2);
  font: inherit;
  cursor: pointer;
}
.tour-rail__btn:disabled { cursor: default; color: var(--muted); }
.tour-rail__btn:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.tour-rail__n {
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  background: var(--surface);
  border: 2px solid var(--line-strong);
  border-radius: 50%;
  color: var(--ink-2);
  font-weight: 600;
  transition: background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.tour-rail__item.is-done .tour-rail__n { background: var(--accent-soft); border-color: var(--accent); color: var(--ink); }
.tour-rail__item.is-current .tour-rail__n { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.tour-rail__btn:disabled .tour-rail__n { background: var(--bg); color: var(--muted); }
.tour-rail__btn:not(:disabled):hover .tour-rail__n { border-color: var(--accent); }
/* On a phone the words are for screen readers only; the card below says which step this is. */
.tour-rail__t {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ---------------------------------------------------------------- the card and the side panel */
.tour-grid { display: grid; gap: var(--s-5); align-items: start; }
.tour-grid > * { min-width: 0; }

.tour-card {
  display: grid;
  gap: var(--s-5);
  padding: var(--s-5) var(--s-4);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.tour-card__meta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-1) var(--s-4); color: var(--muted); }
.tour-card__meta p { margin: 0; max-width: none; }
.tour-count { font-weight: 600; color: var(--ink-2); }
.tour-card__place { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); }

.tour-screen {
  display: grid;
  gap: var(--s-4);
  transition: opacity var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}
.tour-screen.is-pre { opacity: 0.2; transform: translateY(6px); }
.tour-screen h3 { margin: 0; font-size: 1.375rem; font-weight: 600; line-height: var(--lh-tight); }
.tour-screen h3:focus { outline: none; }
.tour-screen h3:focus-visible { outline: 3px solid var(--focus); outline-offset: 4px; border-radius: 4px; }
.tour-benefit { margin: 0; color: var(--ink-2); max-width: 56ch; }
.tour-note { margin: 0; color: var(--muted); font-size: var(--fs-0); max-width: 56ch; }
.tour-sub { margin: var(--s-2) 0 0; font-size: var(--fs-0); font-weight: 600; }

/* the booking in words */
.tour-booking {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-1) var(--s-4);
  padding: var(--s-3) var(--s-4);
  background: var(--bg);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
}
.tour-booking p { margin: 0; max-width: none; }
.tour-booking__who { font-weight: 600; }
.tour-booking__what { color: var(--ink-2); }
.tour-booking__state {
  margin-left: auto;
  padding: 1px 10px;
  background: var(--built-bg);
  border: 1px solid var(--built-line);
  border-radius: 999px;
  color: var(--built-fg);
  font-size: 0.9375rem;
  font-weight: 600;
}
.tour-booking__state.is-done { background: var(--live-bg); border-color: var(--live-line); color: var(--live-fg); }

/* ---------------------------------------------------------------- the calendar grid */
.tour-gridwrap { min-width: 0; }
.tc-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 2px;
  font-size: 0.8125rem;
}
.tc-table th, .tc-table td { padding: 0; text-align: center; font-weight: 400; }
.tc-corner, .tc-room { width: 3.25rem; }
.tc-day { padding: 2px 0; color: var(--muted); font-weight: 600; }
.tc-day.is-today { color: var(--accent); }
.tc-room { padding-right: 4px; text-align: left; color: var(--ink-2); font-weight: 600; white-space: nowrap; }
.tc-empty {
  height: 2.25rem;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 6px;
}
.tc-empty.is-today { background: var(--accent-soft); }
.tc-none {
  height: 2.25rem;
  padding: 0 var(--s-2);
  border: 1px dashed var(--line-strong);
  border-radius: 6px;
  color: var(--muted);
  text-align: left;
  vertical-align: middle;
}
.tc-book {
  height: 2.25rem;
  padding: 0 4px;
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  color: var(--ink-2);
  font-weight: 600;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  transition: opacity var(--t-base) var(--ease), transform var(--t-base) var(--ease);
}
.tc-book.is-pre { opacity: 0.2; transform: scale(0.94); }
.tc-book--waiting { background: var(--built-bg); border: 2px dashed var(--built-line); color: var(--built-fg); }
.tc-book--mine { background: var(--accent-soft); border: 2px solid var(--accent); color: var(--ink); }
.tc-book--in { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

.tour-swap { display: grid; justify-items: start; gap: var(--s-2); }

/* ---------------------------------------------------------------- check-in */
.tour-checkin { display: grid; gap: var(--s-4); }
.tour-check { display: inline-flex; align-items: center; gap: var(--s-3); min-height: var(--target); font-weight: 600; cursor: pointer; }
.tour-check input, .tour-pay__opt input { width: 1.25rem; height: 1.25rem; margin: 0; accent-color: var(--accent); }
.tour-check input:focus-visible, .tour-pay__opt input:focus-visible, .tour-field select:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.tour-field { display: grid; gap: var(--s-1); max-width: 20rem; }
.tour-field label { font-weight: 600; }
.tour-field select {
  min-height: var(--target);
  padding: 8px 12px;
  background: var(--bg);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  color: var(--ink);
  font: inherit;
}

.tour-clean { display: grid; gap: var(--s-1); margin: 0; padding: 0; list-style: none; }
.tc-clean {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--s-1) var(--s-3);
  padding: var(--s-2) var(--s-3);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}
.tc-clean.is-mine { border-color: var(--accent); background: var(--accent-soft); }
.tc-clean__room { font-weight: 600; }
.tc-clean__detail { min-width: 0; color: var(--muted); }
.tc-state {
  padding: 1px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink-2);
  font-size: 0.9375rem;
  font-weight: 600;
  white-space: nowrap;
}
.tc-state--to-clean { background: var(--built-bg); border-color: var(--built-line); color: var(--built-fg); }
.tc-state--in-use { background: var(--accent-soft); border-color: var(--accent); color: var(--ink); }
.tc-state--ready { background: var(--live-bg); border-color: var(--live-line); color: var(--live-fg); }

/* ---------------------------------------------------------------- the bill and the day sheet */
.tour-table { width: 100%; border-collapse: collapse; }
.tour-table th, .tour-table td { padding: var(--s-2) var(--s-1); border-bottom: 1px solid var(--line); text-align: left; font-weight: 400; vertical-align: top; }
.tour-table thead th { color: var(--muted); font-size: 0.9375rem; font-weight: 600; }
.tour-table td.tour-num, .tour-table th.tour-num { text-align: right; white-space: nowrap; }
.tour-table tr { transition: opacity var(--t-base) var(--ease); }
.tour-table tr.is-pending { opacity: 0.15; }
.tour-table tr.is-total th, .tour-table tr.is-total td { border-bottom: 2px solid var(--line-strong); font-weight: 600; }
.tour-table tr.is-paid th, .tour-table tr.is-paid td { color: var(--live-fg); font-weight: 600; }
.tour-table tr.is-mine th, .tour-table tr.is-mine td { background: var(--accent-soft); }
.tour-cap { padding: var(--s-2) var(--s-1) 0; color: var(--muted); font-size: 0.9375rem; font-weight: 600; text-align: left; caption-side: top; }
.tour-sub-label { display: block; color: var(--muted); font-size: 0.9375rem; font-weight: 400; }

.tour-pay { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2) var(--s-5); margin: 0; padding: 0; border: 0; min-width: 0; }
.tour-pay legend { float: left; margin: 0 var(--s-5) 0 0; padding: 0; font-weight: 600; line-height: var(--target); }
.tour-pay__opt { display: inline-flex; align-items: center; gap: var(--s-2); min-height: var(--target); cursor: pointer; }

.tour-diff {
  margin: 0;
  max-width: none;
  padding: var(--s-3) var(--s-4);
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  font-weight: 600;
}
.tour-diff.is-ok { background: var(--live-bg); border-color: var(--live-line); color: var(--live-fg); }

.tour-end {
  display: grid;
  gap: var(--s-3);
  padding: var(--s-5) var(--s-4);
  background: var(--accent-soft);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
}
.tour-end p { margin: 0; max-width: 52ch; }
.tour-end__title { font-size: 1.25rem; font-weight: 600; line-height: var(--lh-tight); }
.tour-end__actions { display: flex; flex-wrap: wrap; gap: var(--s-3); }

/* ---------------------------------------------------------------- the one main button and Back */
.tour-actions { display: flex; flex-wrap: wrap; gap: var(--s-3); align-items: center; }
.tour-actions .btn[data-tour-primary] { flex: 1 1 14rem; }
.tour-problem { margin: 0; color: var(--built-fg); font-weight: 600; }
.tour-problem:empty { display: none; }

/* ---------------------------------------------------------------- what changed elsewhere */
.tour-side {
  display: grid;
  gap: var(--s-3);
  padding: var(--s-4);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.tour-side h3 { margin: 0; font-size: var(--fs-2); font-weight: 600; line-height: var(--lh-tight); }
.tour-changes { display: grid; gap: var(--s-2); margin: 0; padding: 0; list-style: none; }
.tour-change {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-1) var(--s-3);
  padding: var(--s-2) var(--s-3);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--ink-2);
  transition: opacity var(--t-base) var(--ease), transform var(--t-base) var(--ease);
}
.tour-change.is-pre { opacity: 0.2; transform: translateX(8px); }
.tour-change.is-new { border-color: var(--accent); background: var(--accent-soft); color: var(--ink); font-weight: 600; }
.tour-change__text { min-width: 0; overflow-wrap: anywhere; }

@media (min-width: 560px) {
  .tc-table { font-size: var(--fs--1); }
  .tc-corner, .tc-room { width: 4.5rem; }
  .tc-empty, .tc-book, .tc-none { height: 2.5rem; }
  .tour-card { padding: var(--s-5); }
}
@media (min-width: 720px) {
  .tour-rail__t {
    position: static;
    width: auto;
    height: auto;
    margin: 0;
    overflow: visible;
    clip-path: none;
    white-space: normal;
    font-size: 0.9375rem;
    font-weight: 600;
    text-align: center;
    line-height: 1.3;
  }
  .tour-rail__item::before { top: 1.25rem; }
  .tour-rail__btn { padding: 0 var(--s-1); }
}
@media (min-width: 960px) {
  .tour-grid { grid-template-columns: minmax(0, 1fr) 21rem; }
  .tour-side { position: sticky; top: calc(var(--header-h) + var(--s-4)); }
}

/* ---------------------------------------------------------------- the request and the questions, after the tour */
.demo-ask { display: grid; gap: var(--s-7); align-items: start; }
.demo-ask > * { min-width: 0; }
.demo-ask__faq { display: grid; gap: var(--s-4); }
@media (min-width: 1000px) {
  .demo-ask { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--s-6); }
}
