/* chatterbox_csi_request_walkthrough_ver8.css
   The customer-service walkthrough. Loaded after chatterbox_csi_ver8.css and built on
   its tokens and its thread and figure classes; this sheet sets no colour of its own.

   Every rule is scoped under .rq8-stage, so the component can sit on any family page.
   Base styles are the finished state of each scene: the family sheet turns transitions
   off when motion is reduced, and the page must read in full without any script.
   Solid cards only inside the stage, and nothing here loops. */

.rq8-stage {
  max-width: 1000px;
  margin: 2.6rem auto 0;
}

.rq8-stage .rq8-scenes {
  list-style: none;
  margin: 2rem 0 0;
  padding: 0;
  display: grid;
  gap: 1.6rem;
}

.rq8-stage .rq8-scene {
  background: var(--card);
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-soft);
  padding: clamp(20px, 3.4vw, 40px);
}

/* ---- caption ---- */
.rq8-stage .rq8-caption h3 {
  display: flex;
  align-items: baseline;
  gap: 0.6em;
  font-size: clamp(1.35rem, 2.3vw, 1.7rem);
  line-height: 1.2;
  color: var(--ink);
}

.rq8-stage .rq8-step {
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--teal-deep);
  font-variant-numeric: tabular-nums;
}

.rq8-stage .rq8-caption p {
  margin-top: 0.4rem;
  max-width: 56ch;
  font-size: 1.02rem;
  line-height: 1.5;
  color: var(--ink-soft);
}

/* ---- board: where it starts on the left, what it becomes on the right ---- */
.rq8-stage .rq8-board {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1.2fr);
  align-items: center;
  gap: clamp(14px, 2.4vw, 30px);
  margin-top: clamp(1.4rem, 3vw, 2.2rem);
}

/* The record keeps the wider column when it comes first. */
.rq8-stage .rq8-board.is-record-first {
  grid-template-columns: minmax(0, 1.2fr) auto minmax(0, 1fr);
}

.rq8-stage .rq8-link {
  width: clamp(36px, 5vw, 64px);
}

.rq8-stage .rq8-link svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

/* The arrowheads take the colour of the line they finish. */
.rq8-stage .rq8-head {
  fill: var(--ocean-mid);
}

.rq8-stage .rq8-head.is-hand {
  fill: var(--coral-deep);
}

/* ---- cards ---- */
.rq8-stage .rq8-card {
  display: grid;
  gap: 4px;
  justify-items: start;
  background: var(--sand);
  border: 1px solid var(--hairline-neutral);
  border-radius: var(--r-md);
  padding: clamp(16px, 2.2vw, 24px);
}

.rq8-stage .rq8-mark {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  margin-bottom: 8px;
  border-radius: var(--r-md);
  background: var(--teal-tint);
  color: var(--teal-deep);
  font-size: 24px;
}

.rq8-stage .rq8-kicker {
  display: block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.rq8-stage .rq8-card strong {
  font-size: 16px;
  line-height: 1.35;
  color: var(--ink);
}

.rq8-stage .rq8-card > span:not(.rq8-mark):not(.rq8-kicker) {
  font-size: 14.5px;
  line-height: 1.45;
  color: var(--ink-soft);
}

.rq8-stage .rq8-card .rq8-number {
  font-size: clamp(1.5rem, 2.6vw, 1.9rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
}

.rq8-stage .rq8-foot {
  margin-top: 0.9rem;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--ink-soft);
}

/* The one place a person steps in. */
.rq8-stage .rq8-card.is-person {
  border-color: var(--coral-glow);
}

.rq8-stage .rq8-card.is-person .rq8-mark {
  background: var(--coral-tint);
  color: var(--coral-deep);
}

/* ---- the exchange and the record ---- */
.rq8-stage .rq8-talk {
  display: grid;
  gap: 14px;
}

.rq8-stage .thread-msg {
  max-width: 92%;
}

.rq8-stage .rq8-record {
  margin-top: 0;
  background: var(--card);
}

.rq8-stage .rq8-status-value {
  display: flex;
  align-items: baseline;
  gap: 7px;
  font-weight: 700;
}

.rq8-stage .rq8-status-value i {
  flex: none;
  transform: translateY(3px);
  font-size: 17px;
  color: var(--ink-soft);
}

.rq8-stage .rq8-status-value.is-done i {
  color: var(--teal-deep);
}

/* ---- stepping through: only once the script has started ----
   The script adds .rq8-ready, the controls and the hidden attribute on the scenes
   that are not selected. Without it none of this applies and the list shows whole. */
.rq8-stage.rq8-ready .rq8-scenes {
  margin-top: 1.1rem;
}

.rq8-stage .rq8-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 2rem;
}

/* Solid, like the cards: no glass inside the stage. */
.rq8-stage .rq8-step-button {
  min-height: 44px;
  flex: none;
  background: var(--card);
  border-color: var(--hairline);
  color: var(--ink);
}

.rq8-stage .rq8-step-button[aria-disabled="true"] {
  opacity: 0.45;
  cursor: default;
}

/* An unavailable step does not lift like a live button. */
.rq8-stage .rq8-step-button[aria-disabled="true"]:hover,
.rq8-stage .rq8-step-button[aria-disabled="true"]:active {
  transform: none;
}

.rq8-stage .rq8-choices {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.rq8-stage .rq8-choice {
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  background: var(--card);
  color: var(--ink-soft);
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 240ms var(--ease-out), color 240ms var(--ease-out), border-color 240ms var(--ease-out);
}

.rq8-stage .rq8-choice:hover {
  color: var(--ink);
  border-color: var(--teal-deep);
}

.rq8-stage .rq8-choice[aria-current="step"] {
  background: var(--teal-deep);
  border-color: var(--teal-deep);
  color: var(--white);
}

/* The status line is read out on each change. It is shown on a phone, where it
   stands in for the row of scene choices. */
.rq8-stage .rq8-status {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* The brief move as a scene is selected. The finished state is the base style above;
   .is-entering is where each part starts from, and is removed at once. The parts come
   in one after another: the card, the arrow, then what ends the board. The exchange
   comes in turn by turn while its frame stays still, so a turn never moves inside a
   frame that is moving too. */
.rq8-stage.rq8-ready .rq8-board > :not(.rq8-talk),
.rq8-stage.rq8-ready .rq8-talk > * {
  transition: opacity 360ms var(--ease-out), transform 360ms var(--ease-out);
}

.rq8-stage.rq8-ready .rq8-board > :nth-child(2) {
  transition-delay: 120ms;
}

.rq8-stage.rq8-ready .rq8-board > :nth-child(3),
.rq8-stage.rq8-ready .rq8-talk > :first-child {
  transition-delay: 240ms;
}

.rq8-stage.rq8-ready .rq8-talk > :nth-child(2) {
  transition-delay: 360ms;
}

.rq8-stage.rq8-ready .is-entering .rq8-board > :not(.rq8-talk),
.rq8-stage.rq8-ready .is-entering .rq8-talk > * {
  opacity: 0;
  transform: translateY(10px);
  transition: none;
}

@media (max-width: 879px) {
  /* The arrow is turned on its side here, so it fades in place and does not move. */
  .rq8-stage.rq8-ready .rq8-board > .rq8-link {
    transition: opacity 360ms var(--ease-out) 120ms;
  }

  .rq8-stage.rq8-ready .is-entering .rq8-board > .rq8-link {
    transform: rotate(90deg);
  }

  .rq8-stage .rq8-board,
  .rq8-stage .rq8-board.is-record-first {
    grid-template-columns: minmax(0, 1fr);
  }

  .rq8-stage .rq8-link {
    justify-self: center;
    width: 44px;
    transform: rotate(90deg);
  }
}

/* Small labels are set at 12px to 13.5px above. On a phone nothing in a scene
   goes below 14px. 560px is the family's phone query, and decision D3 keeps
   the stage free of a fixed height below it. */
@media (max-width: 560px) {
  .rq8-stage .thread-who,
  .rq8-stage .thread-record dt,
  .rq8-stage .rq8-kicker,
  .rq8-stage .rq8-step {
    font-size: 14px;
    letter-spacing: 0.04em;
  }

  .rq8-stage .rq8-foot {
    font-size: 14px;
  }

  .rq8-stage .thread-record dd {
    font-size: 15px;
  }

  /* The record title wraps to two lines here, so its icon sits with the first. */
  .rq8-stage .thread-record .thread-who {
    align-items: flex-start;
  }

  .rq8-stage .thread-record .thread-who i {
    margin-top: 3px;
  }

  .rq8-stage .rq8-choices {
    display: none;
  }

  /* The controls sit above the scenes, so here the stage takes the height of the
     scene on show; a fixed height would only leave blank space under the shorter
     scenes. */
  .rq8-stage.rq8-ready .rq8-scenes {
    min-height: 0 !important;
  }

  .rq8-stage .rq8-status {
    position: static;
    width: auto;
    height: auto;
    margin: 0;
    overflow: visible;
    clip-path: none;
    white-space: normal;
    flex: 1;
    text-align: center;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.35;
    color: var(--ink-soft);
  }

  /* The heading is already the first thing in the scene below, so only the count
     is shown. Both parts are still read out. */
  .rq8-stage .rq8-status-title {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
}

/* On paper the whole story shows, finished, whatever scene was selected. */
@media print {
  .rq8-stage .rq8-scene {
    box-shadow: none;
    break-inside: avoid;
  }

  .rq8-stage .rq8-controls {
    display: none;
  }

  .rq8-stage.rq8-ready .rq8-scene[hidden] {
    display: list-item;
  }

  .rq8-stage.rq8-ready .rq8-scenes {
    min-height: 0 !important;
  }

  .rq8-stage.rq8-ready .is-entering * {
    opacity: 1;
    transform: none;
  }
}
