/* The detail page follows the guest, then lays out the evidence and terms. */
.details-page {
  --detail-heading: clamp(1.85rem, 1.49rem + 1.5vw, 2.6rem);
  --detail-body: clamp(1rem, .975rem + .16vw, 1.125rem);
  --detail-section-space: clamp(48px, 6.1vw, 94px);
}

.details-page .details-header {
  border-bottom: 1px solid var(--rule);
}

.details-page .button--primary {
  box-shadow: none;
}

.details-page main,
.details-page .section {
  background: var(--paper);
}

.details-page .section {
  padding-block: var(--detail-section-space);
}

.details-page main > .section > .section__inner {
  position: relative;
}

.details-page main > .section + .section > .section__inner::before {
  position: absolute;
  inset: calc(-1 * var(--detail-section-space)) var(--gutter) auto;
  border-top: 1px solid var(--rule);
  content: '';
}

.details-page .section h2 {
  font-size: var(--detail-heading);
  line-height: 1.12;
  text-wrap: balance;
}

.details-page .section p {
  font-size: var(--detail-body);
  line-height: 1.5;
}

/* The ordered list uses a single rule with one junction for each station. */
.details-page .how {
  padding-top: clamp(30px, 5vw, 78px);
}

.details-page .how h1 {
  max-width: 25ch;
  font-size: clamp(2.15rem, 1.4rem + 3.3vw, 4.5rem);
  line-height: 1.04;
  text-wrap: pretty;
}

.details-page .how h1 span,
.details-page .guarantee h2 span {
  white-space: nowrap;
}

.details-page .how__steps {
  --station-gap: clamp(20px, 2.6vw, 40px);
  --station-line: #a78c70;
  position: relative;
  grid-template-columns: minmax(0, 1fr);
  gap: 34px;
  margin-top: clamp(28px, 4vw, 58px);
  padding-left: 23px;
}

.details-page .how__steps::before {
  position: absolute;
  inset: 5px auto auto 4px;
  bottom: 0;
  border-left: 1px solid var(--station-line);
  content: '';
}

.details-page .step {
  position: relative;
}

.details-page .step::before {
  position: absolute;
  z-index: 1;
  top: 1px;
  left: -23px;
  width: 9px;
  height: 9px;
  border: 1px solid var(--ink-soft);
  border-radius: 50%;
  background: var(--paper);
  content: '';
}

.details-page .step:last-child::after {
  position: absolute;
  inset: 6px auto 0 -23px;
  width: 9px;
  background: var(--paper);
  content: '';
}

.details-page .step__stage,
.details-page .step:nth-child(odd) .step__stage,
.details-page .step:has(+ .step .step__stage) .step__stage {
  justify-content: flex-start;
  align-items: center;
  height: auto;
  margin: 0;
  padding: 0;
  border: 0;
}

.details-page .step__offer {
  width: min(210px, 100%);
  margin: 0;
  border-radius: 0;
  box-shadow: none;
  rotate: none;
}

.details-page .step__film {
  position: relative;
  width: min(176px, 100%);
}

.details-page .step__film video {
  display: block;
  width: 100%;
  height: auto;
  background: var(--ink);
}

.details-page .step__film .video-playback {
  position: absolute;
  inset: 8px 8px auto auto;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgb(255 250 241 / .9);
  color: var(--ink);
}

.details-page .step__film .video-playback[hidden],
.details-page .video-playback:not([data-playing]) .video-playback__pause,
.details-page .video-playback[data-playing] .video-playback__play {
  display: none;
}

.details-page .video-playback svg {
  width: 18px;
  height: 18px;
}

.details-page .video-playback__play {
  fill: currentColor;
  margin-inline-start: 1px;
}

.details-page .video-playback__pause {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
}

.details-page .step__film .video-playback:focus-visible {
  outline-color: var(--ink);
  outline-offset: -5px;
  box-shadow: none !important;
}

.details-page :is(.step__pass, .step__scan) {
  display: block;
  height: auto;
  color: var(--ink);
}

.details-page .step__pass {
  width: min(106px, 100%);
}

.details-page .step__scan {
  width: min(290px, 100%);
}

.details-page .step__scan-line {
  stroke: var(--awning-deep);
}

.details-page .step__figure figcaption {
  min-height: 0;
  margin-top: 12px;
  color: var(--ink);
  font-size: var(--detail-body);
  text-wrap: pretty;
}

.details-page .section .how__followup {
  max-width: none;
  margin-top: 24px;
  padding-left: 23px;
}

.details-page .step__stage#proof {
  scroll-margin-block-start: 16px;
}

.details-page .step__stage#proof:focus {
  box-shadow: none !important;
}

.details-page .step__stage .proof__slip {
  grid-area: auto;
  width: min(100%, 290px);
  margin: 0;
  filter: none;
}

.details-page .proof__slip .slip {
  padding: 14px 15px calc(14px + var(--tooth));
}

.details-page .slip .slip__restaurant {
  margin: 0;
  padding-bottom: 8px;
  border-bottom: 1px dashed var(--rule-firm);
  font-size: .875rem;
  font-weight: 600;
}

.details-page .proof__slip dl {
  gap: 8px;
  padding-top: 10px;
}

.details-page .proof__slip dt {
  font-size: .875rem;
}

.details-page .proof__slip dt::after {
  min-width: 6px;
}

.details-page .proof__slip dd {
  font-size: 1.45rem;
}

.details-page .proof__slip .slip__total {
  margin-top: 2px;
  padding-top: 10px;
}

.details-page .proof__slip .slip__total dd {
  font-size: 2rem;
}

.details-page .slip .slip__date {
  margin-top: 9px;
  font-size: .8125rem;
}

/* The case pairs a short account with the seven recorded Clover months. */
.details-page .proof__inner,
.details-page .guarantee__inner,
.details-page .math__inner,
.details-page .questions__inner {
  display: block;
}

.details-page .section .proof__story,
.details-page .guarantee__promise p {
  margin-top: 12px;
  font-size: var(--detail-body);
}

.details-page .proof__growth {
  --bar-gap: clamp(6px, 1.2vw, 16px);
  --bar-inset: 5%;
  margin: 30px 0 0;
}

.details-page .proof__growth figcaption {
  max-width: none;
  margin: 0 0 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--rule);
  color: var(--ink-soft);
}

.details-page .growth__ends {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 8px;
  margin-bottom: 16px;
  padding: 0;
}

.details-page .growth__ends p {
  grid-row: span 2;
  grid-template-rows: subgrid;
  margin: 0;
  font-size: var(--type-caption);
  line-height: 1.35;
}

.details-page .growth__ends p > span:first-child {
  align-self: end;
}

.details-page .growth__ends strong {
  font-size: clamp(1.75rem, 1.43rem + 1.3vw, 2.5rem);
}

.details-page .growth {
  --chart: clamp(112px, 14vw, 172px);
  margin-bottom: 26px;
}

.details-page .growth li::before,
.details-page .growth__amount,
.details-page .growth__value {
  border-radius: 0;
  transition: none;
}

.details-page .growth__value {
  pointer-events: none;
}

/* The four terms form a ruled agreement. */
.details-page .guarantee__promise {
  margin: 0;
}

.details-page .guarantee h2 {
  max-width: 29ch;
}

.details-page .terms {
  margin: 24px 0 0;
}

.details-page .terms__row {
  padding-block: 19px;
}

.details-page .terms__row h3 {
  font-size: 1.25rem;
  text-align: start;
}

.details-page .terms__row p,
.details-page .terms__requirements {
  max-width: none;
  margin: 0;
  font-size: var(--detail-body);
  line-height: 1.48;
}

.details-page .terms__requirements li {
  padding: 0;
  font: inherit;
}

.details-page .terms__requirements li + li {
  margin-top: 5px;
}

.details-page .terms__requirements li::before {
  content: none;
}

/* The inputs and readout are two parts of the same tool. */
.details-page .section .math__panel {
  display: grid;
  gap: 22px;
  margin-top: 20px;
  padding-block: 18px;
  border-block: 2px solid var(--ink);
}

.details-page .math__panel .calculator {
  grid-area: auto;
  align-self: start;
  gap: 13px;
  max-width: none;
  margin: 0;
}

.details-page .calculator__numbers {
  gap: 0 10px;
}

.details-page .calculator__numbers .entry {
  display: grid;
  grid-row: span 3;
  grid-template-rows: subgrid;
  justify-content: stretch;
}

.details-page .calculator__numbers .entry > label {
  align-self: end;
}

.details-page .choices__row--seven {
  grid-template-columns: repeat(7, minmax(44px, 1fr));
  gap: 2px;
}

.details-page :is(.calculator .entry > label, .choices legend) {
  margin-bottom: 5px;
  font-size: .875rem;
}

.details-page .calculator .entry__field input,
.details-page .calculator .entry__field,
.details-page .choices label > span {
  min-height: 44px;
  border-radius: 0;
  font-size: 1.125rem;
}

.details-page .calculator .entry__field input {
  padding-block: 8px;
}

.details-page .calculator .entry__field input:focus-visible {
  outline: none;
  box-shadow: none !important;
}

.details-page .calculator .entry__field:has(input:focus-visible) {
  outline: 2px solid var(--sky);
  outline-offset: 2px;
}

.details-page .calculator .entry__field:has(input[aria-invalid='true']:focus-visible) {
  outline-color: var(--error);
}

.details-page .choices label > span {
  transition: none;
}

.details-page .calculator .entry__field--dollars::before {
  font-size: 1.125rem;
}

.details-page .math__readout {
  display: grid;
  align-content: start;
  gap: 16px;
  padding-top: 18px;
  border-top: 1px dashed var(--rule-firm);
}

.details-page .math__readout .result {
  grid-area: auto;
  order: 0;
  max-width: none;
  margin: 0;
}

.details-page .math__readout .result__target {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 5px 14px;
}

.details-page .result__target span {
  color: var(--ink-soft);
  font-size: 1rem;
}

.details-page .result__target strong {
  margin: 0;
  font-size: clamp(1.85rem, 1.4rem + 1.6vw, 2.7rem);
}

.details-page .math__readout .result__tables,
.details-page .math__readout .result__verdict {
  margin: 5px 0 0;
  font: 400 var(--detail-body)/1.4 var(--sans);
  text-wrap: pretty;
}

.details-page .math__readout .result__verdict {
  font-weight: 600;
}

.details-page .math__readout .night {
  grid-area: auto;
  width: min(100%, 31rem);
  margin: 0;
}

.details-page .night__rows {
  gap: 4px;
}

.details-page .night :is(.night__chair, .night__guest) {
  transition: none;
}

.details-page .night__row {
  border-width: 1px;
}

.details-page .night figcaption {
  margin-top: 8px;
  color: var(--ink-soft);
  font-size: .875rem;
}

.details-page .room__kit {
  position: absolute;
  overflow: hidden;
}

.details-page .math[data-state='incomplete'] :is(.math__arithmetic, .math__readout) {
  display: none;
}

.details-page .section .math__arithmetic {
  margin-top: 0;
}

.details-page .math__arithmetic .math__slip {
  width: 100%;
  max-width: none;
  margin: 0 0 12px;
  filter: none;
}

.details-page .math__slip li {
  padding-block: 9px;
  font-size: var(--detail-body);
}

.details-page .math__slip li::before {
  top: 9px;
}

.details-page .math__slip .result__note {
  font-size: .875rem;
}

/* Booking follows the last answer within the same reading column. */
.details-page .section .questions__list {
  margin-top: 20px;
}

.details-page .question summary {
  min-height: 48px;
  padding-block: 14px;
  font: 600 var(--detail-body)/1.35 var(--sans);
  text-wrap: pretty;
}

.details-page .question summary::after {
  top: calc(14px + .675em - 10px);
}

.details-page .question summary::after,
.details-page .question::details-content {
  transition: none;
}

.details-page .question p {
  padding-bottom: 16px;
}

.details-page .questions__list > .button {
  margin-top: 20px;
}

.details-page .site-footer__links a {
  min-width: 44px;
}

@media (max-width: 599px) {
  .details-page .step__figure {
    display: flex;
    flex-direction: column-reverse;
    gap: 12px;
  }

  .details-page .step__figure figcaption {
    margin-top: 0;
  }

  .details-page .proof {
    --detail-section-space: 70px;
  }

  .details-page .growth {
    grid-auto-rows: 44px;
    gap: 4px;
    margin-bottom: 0;
  }

  .details-page .growth__amount {
    display: none;
  }

  .details-page .night__rows:has(.night__row:nth-child(5)) {
    max-width: 250px;
  }
}

@media (max-width: 479px) {
  .details-page .guarantee h2 {
    max-width: 20ch;
  }

  /* The terms are a table to scan, so the rows stay tight on a phone. */
  .details-page .terms__row {
    display: grid;
    grid-template-columns: minmax(84px, 1fr) minmax(0, 2fr);
    gap: 15px;
    padding-block: 20px;
  }

  .details-page .terms__row h3 {
    font-size: 1.0625rem;
  }

  .details-page .terms__requirements li + li {
    margin-top: 8px;
  }
}

@media (max-width: 359px) {
  .details-page .choices__row--seven {
    grid-template-columns: repeat(4, minmax(44px, 1fr));
  }
}

@media (min-width: 480px) {
  .details-page .terms__row {
    display: grid;
    grid-template-columns: minmax(7.5rem, 1fr) minmax(0, 3fr);
    gap: var(--column-gap);
  }
}

@media (min-width: 680px) {
  .details-page .questions__inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
    gap: var(--column-gap);
  }

  .details-page .questions__inner > * {
    grid-column: auto;
  }

  .details-page .section .questions__list {
    margin-top: 0;
  }
}

@media (min-width: 760px) {
  .details-page .math__panel {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    column-gap: var(--column-gap);
  }

  .details-page .math__readout {
    padding-top: 0;
    padding-left: var(--column-gap);
    border-top: 0;
    border-left: 1px dashed var(--rule-firm);
  }
}

@media (min-width: 880px) {
  .details-page .how__steps {
    --station-stage: clamp(220px, 21vw, 294px);
    grid-template-columns: minmax(0, 1fr) minmax(0, .84fr) minmax(0, .59fr) minmax(0, 1fr) minmax(0, 1.21fr);
    gap: var(--station-gap);
    padding: 22px 0 0;
  }

  .details-page .how__steps::before {
    inset: 4px auto auto 4px;
    /* The rule ends at the start of the receipt column. */
    width: calc(100% - (100% - 4 * var(--station-gap)) * 1.21 / 4.64);
    height: 1px;
    border: 0;
    border-top: 1px solid var(--station-line);
  }

  .details-page .step::before {
    top: -22px;
    left: 0;
  }

  .details-page .step:last-child::after {
    content: none;
  }

  .details-page .step__stage,
  .details-page .step:nth-child(odd) .step__stage,
  .details-page .step:has(+ .step .step__stage) .step__stage {
    height: var(--station-stage);
  }

  .details-page .step__stage#proof {
    scroll-margin-block-start: 40px;
  }

  .details-page .section .how__followup {
    padding-left: 0;
  }

  .details-page .step__offer {
    width: min(100%, calc(var(--station-stage) * 640 / 828));
  }

  .details-page .step__film {
    width: calc(var(--station-stage) * 9 / 16);
  }

  .details-page .step__pass {
    margin-inline: auto;
  }

  .details-page .step__figure figcaption {
    max-width: 28ch;
    margin-top: 15px;
  }

  .details-page .proof__inner {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
    align-items: center;
    gap: clamp(36px, 5.4vw, 92px);
  }

  .details-page .proof__growth {
    grid-column: auto;
    margin: 0;
  }

  .details-page .guarantee__inner {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
    align-items: start;
    gap: clamp(36px, 5.4vw, 92px);
  }

  .details-page .guarantee__promise,
  .details-page .terms {
    grid-area: auto;
    margin: 0;
  }

  .details-page .terms {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: var(--column-gap);
  }

  .details-page .terms__row {
    display: block;
  }

  .details-page .terms__row h3 {
    margin-bottom: 8px;
  }

  .details-page .calculator,
  .details-page .math__readout {
    padding-inline: clamp(20px, 3vw, 48px);
  }

  .details-page .math__panel {
    column-gap: 0;
  }
}
