/* Busy Book Builder v2.
 *
 * One component tree serves every viewport. Mobile is the base layer; the
 * tablet and desktop layers only widen it. Written breakpoint rules win over
 * the concept mockups wherever the two disagree.
 *
 * Breakpoints: mobile 320-767, tablet 768-1023, desktop 1024+, content 1440.
 */

:root {
  --bbb-navy: #0c3048;
  --bbb-navy-soft: #173b52;
  --bbb-teal: #0b7475;
  --bbb-teal-dark: #075b60;
  --bbb-teal-light: #d8ebe9;
  --bbb-final: #8f2f43;
  --bbb-final-dark: #7a2438;
  --bbb-cream: #fbf4e8;
  --bbb-surface: #fffaf2;
  --bbb-surface-2: #fdf6ec;
  --bbb-border: #e4d5c4;
  --bbb-border-soft: #f0e5d6;
  --bbb-muted: #53616c;
  --bbb-focus: #0b65c2;
  --bbb-danger: #96331f;
  --bbb-shadow-card: 0 12px 28px rgba(54, 38, 20, 0.08);
  --bbb-shadow-stage: 0 18px 48px rgba(54, 38, 20, 0.12);
  --bbb-shadow-tile: 0 8px 18px rgba(54, 38, 20, 0.14);
  --bbb-radius-card: 24px;
  --bbb-radius-control: 16px;
  --bbb-radius-tile: 10px;
  --bbb-motion-micro: 160ms;
  --bbb-motion-short: 240ms;
  --bbb-motion-step: 400ms;
  --bbb-motion-book: 480ms;
  --bbb-motion-success: 720ms;
  --bbb-ease-forward: cubic-bezier(0.22, 0.61, 0.36, 1);
  --bbb-ease-standard: cubic-bezier(0.4, 0, 0.2, 1);
  --bbb-gutter: 16px;
  --bbb-content: 1440px;
  --bbb-tray-height: 0px;
  --bbb-target: 48px;
  color-scheme: light;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body.bbb-body {
  margin: 0;
  min-height: 100svh;
  background:
    radial-gradient(circle at 12% 4%, rgba(255, 255, 255, 0.7), transparent 26%),
    linear-gradient(180deg, #fdfaf5 0%, #f5ecdd 100%);
  background-attachment: fixed;
  color: var(--bbb-navy);
  font: 400 16px/1.55 "Avenir Next", "Segoe UI", system-ui, -apple-system, sans-serif;
  padding-bottom: calc(var(--bbb-tray-height) + env(safe-area-inset-bottom, 0px));
}

h1,
h2,
h3,
p,
ul,
ol,
dl,
dd,
figure {
  margin: 0;
}

ul,
ol {
  list-style: none;
  padding: 0;
}

img {
  max-width: 100%;
}

fieldset {
  border: 0;
  margin: 0;
  padding: 0;
  min-width: 0;
}

button {
  font: inherit;
  color: inherit;
}

:focus-visible {
  outline: 3px solid var(--bbb-focus);
  outline-offset: 3px;
  border-radius: 6px;
}

.bbb-visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.bbb-skip {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 60;
  padding: 12px 18px;
  background: var(--bbb-teal);
  color: #fff;
  border-radius: 12px;
  font-weight: 700;
  text-decoration: none;
  transition: top var(--bbb-motion-micro) var(--bbb-ease-standard);
}

.bbb-skip:focus {
  top: 12px;
}

.bbb-live {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.bbb-icon {
  width: 1.25em;
  height: 1.25em;
  flex: none;
}

/* ---------------------------------------------------------------- header */

.bbb-header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px var(--bbb-gutter);
  padding-top: calc(10px + env(safe-area-inset-top, 0px));
  background: rgba(255, 250, 242, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--bbb-border);
}

.bbb-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  color: var(--bbb-navy);
  text-decoration: none;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 14px;
}

.bbb-brand .bbb-icon {
  width: 26px;
  height: 26px;
  color: var(--bbb-teal-dark);
}

.bbb-header__tools {
  display: none;
  gap: 8px;
}

.bbb-tool {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--bbb-border);
  border-radius: 999px;
  background: var(--bbb-surface);
  color: var(--bbb-navy);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition:
    background var(--bbb-motion-micro) var(--bbb-ease-standard),
    border-color var(--bbb-motion-micro) var(--bbb-ease-standard);
}

.bbb-tool:hover {
  background: #fff;
  border-color: #d6c3ac;
}

.bbb-tool--icon {
  width: 44px;
  padding: 0;
  justify-content: center;
}

.bbb-menu-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--bbb-border);
  border-radius: 999px;
  background: var(--bbb-surface);
  cursor: pointer;
}

.bbb-menu-button .bbb-icon {
  width: 22px;
  height: 22px;
}

/* -------------------------------------------------------------- progress */

.bbb-progress {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 10px var(--bbb-gutter) 2px;
}

/* The step head already carries a visible "Step N of 6" pill, so the running
 * label stays available to assistive technology without repeating on screen
 * until there is room for it. */
.bbb-progress__label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  font-size: 14px;
  font-weight: 700;
  color: var(--bbb-muted);
  letter-spacing: 0.02em;
}

.bbb-progress__dots {
  display: flex;
  align-items: center;
  gap: 10px;
}

.bbb-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #d9cbbc;
  transition:
    background var(--bbb-motion-short) var(--bbb-ease-standard),
    width var(--bbb-motion-short) var(--bbb-ease-standard);
}

.bbb-dot[data-state="done"] {
  background: var(--bbb-teal);
}

.bbb-dot[data-state="current"] {
  width: 26px;
  background: var(--bbb-teal);
}

/* ------------------------------------------------------------------ main */

.bbb-main {
  width: min(var(--bbb-content), 100%);
  margin: 0 auto;
  padding: 8px var(--bbb-gutter) 32px;
}

.bbb-step {
  display: block;
}

html[data-enhanced] .bbb-step {
  display: none;
}

html[data-enhanced] .bbb-step[data-current] {
  display: block;
}

/* The step transition animates the step's children rather than the step
 * itself: a transform on the section would make it the containing block for
 * the fixed action tray inside it. */
html[data-enhanced] .bbb-step[data-current] > *:not(.bbb-tray) {
  animation: bbb-step-in var(--bbb-motion-step) var(--bbb-ease-forward) both;
}

html[data-enhanced][data-direction="back"] .bbb-step[data-current] > *:not(.bbb-tray) {
  animation-name: bbb-step-back;
}

@keyframes bbb-step-in {
  from {
    opacity: 0;
    transform: translate3d(18px, 0, 0);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes bbb-step-back {
  from {
    opacity: 0;
    transform: translate3d(-18px, 0, 0);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.bbb-noscript {
  display: none;
}

html:not([data-enhanced]) .bbb-noscript {
  display: block;
  width: min(var(--bbb-content), 100%);
  margin: 0 auto 28px;
  padding: 16px var(--bbb-gutter);
  color: var(--bbb-muted);
  font-size: 15px;
}

html:not([data-enhanced]) .bbb-step + .bbb-step {
  margin-top: 40px;
  padding-top: 32px;
  border-top: 1px solid var(--bbb-border);
}

html:not([data-enhanced]) .bbb-nav,
html:not([data-enhanced]) .bbb-change-book,
html:not([data-enhanced]) .bbb-restart,
html:not([data-enhanced]) [data-bbb="help-choose"],
html:not([data-enhanced]) [data-bbb="edit-choices"],
html:not([data-enhanced]) .bbb-header__tools,
html:not([data-enhanced]) .bbb-menu-button,
html:not([data-enhanced]) .bbb-preview__arrow,
html:not([data-enhanced]) .bbb-thumbs,
html:not([data-enhanced]) .bbb-step[data-step="6"] {
  display: none;
}

html:not([data-enhanced]) .bbb-nav--final {
  display: flex;
}

html:not([data-enhanced]) .bbb-nav--final [data-bbb="back-5"] {
  display: none;
}

.bbb-step__head {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: start;
  margin-bottom: 12px;
}

.bbb-step__number {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background: var(--bbb-navy);
  color: #fff;
  font-size: 20px;
  font-weight: 800;
}

.bbb-step[data-step="5"] .bbb-step__number {
  background: var(--bbb-final);
}

.bbb-eyebrow {
  display: inline-block;
  margin-bottom: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--bbb-teal-light);
  color: var(--bbb-teal-dark);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.bbb-step__title {
  font-family: Georgia, "Iowan Old Style", serif;
  font-size: clamp(26px, 6.2vw, 40px);
  line-height: 1.06;
  letter-spacing: -0.02em;
}

.bbb-step__title:focus-visible {
  outline: 3px solid var(--bbb-focus);
  outline-offset: 4px;
}

.bbb-step__subtitle {
  margin-top: 6px;
  color: var(--bbb-muted);
  font-size: 15px;
  max-width: 62ch;
}

.bbb-hints {
  display: grid;
  gap: 4px;
  margin-bottom: 12px;
  color: var(--bbb-muted);
  font-size: 14px;
}

.bbb-hints li {
  display: flex;
  align-items: center;
  gap: 8px;
}

.bbb-hints .bbb-icon {
  color: var(--bbb-teal-dark);
}

.bbb-legend {
  font-size: 17px;
  font-weight: 800;
  margin-bottom: 12px;
  padding: 0;
}

.bbb-legend:focus-visible {
  outline: 3px solid var(--bbb-focus);
  outline-offset: 3px;
}

/* --------------------------------------------------------------- buttons */

.bbb-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: var(--bbb-target);
  padding: 12px 22px;
  border: 1px solid transparent;
  border-radius: var(--bbb-radius-control);
  font-size: 16px;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  transition:
    transform var(--bbb-motion-micro) var(--bbb-ease-standard),
    background var(--bbb-motion-micro) var(--bbb-ease-standard),
    box-shadow var(--bbb-motion-micro) var(--bbb-ease-standard);
}

/* Narrow screens keep the short label on screen while the accessible name
 * stays complete for assistive technology. */
.bbb-btn__more {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.bbb-btn--primary {
  background: linear-gradient(180deg, #0d7f80, #096a6d);
  color: #fff;
  box-shadow: 0 10px 20px rgba(11, 116, 117, 0.22);
}

.bbb-btn--primary:hover:not(:disabled) {
  background: linear-gradient(180deg, #0f8b8c, #0a7376);
}

/* The final action keeps its label on one line at phone widths; the leading
 * glyph is decorative and returns when there is room. */
.bbb-btn--final > .bbb-icon:first-child {
  display: none;
}

.bbb-btn--final {
  background: linear-gradient(180deg, #9e3a4d, #84283b);
  color: #fff;
  box-shadow: 0 12px 24px rgba(143, 47, 67, 0.24);
  position: relative;
  overflow: hidden;
}

.bbb-btn--secondary {
  background: var(--bbb-surface);
  border-color: var(--bbb-border);
  color: var(--bbb-teal-dark);
}

.bbb-btn--ghost {
  background: transparent;
  border-color: var(--bbb-border);
  color: var(--bbb-final);
}

.bbb-btn:active:not(:disabled) {
  transform: scale(0.98);
}

.bbb-btn:disabled,
.bbb-btn[aria-disabled="true"] {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
}

.bbb-btn[data-busy="true"] {
  cursor: progress;
}

.bbb-link-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 4px;
  border: 0;
  background: none;
  color: var(--bbb-teal-dark);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 4px;
  cursor: pointer;
}

.bbb-link-button:disabled {
  color: var(--bbb-muted);
  text-decoration: none;
  cursor: not-allowed;
}

.bbb-native {
  position: absolute;
  width: 44px;
  height: 44px;
  opacity: 0;
  margin: 0;
  cursor: pointer;
}

.bbb-native:disabled {
  cursor: not-allowed;
}

/* --------------------------------------------------------- step 1: shelf */

.bbb-shelf-field {
  position: relative;
}

/* On phones the shelf is the page: the header stays sticky, the action tray
 * stays fixed, and the document itself scrolls through the twenty covers. From
 * the tablet layer up the shelf becomes its own scroll region with a visible
 * scrollbar, as the desktop layout requires. */
.bbb-shelf {
  position: relative;
  padding: 12px 4px 4px;
  border: 1px solid var(--bbb-border);
  border-radius: var(--bbb-radius-card);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0.2)),
    var(--bbb-surface-2);
  box-shadow: inset 0 2px 10px rgba(54, 38, 20, 0.06);
}

.bbb-shelf:focus-visible {
  outline: 3px solid var(--bbb-focus);
  outline-offset: 2px;
}

.bbb-shelf__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 26px 12px;
}

.bbb-tile {
  position: relative;
}

.bbb-tile__label {
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 14px;
  cursor: pointer;
}

.bbb-tile[data-enabled="false"] .bbb-tile__label {
  cursor: not-allowed;
}

.bbb-tile__frame {
  position: relative;
  display: block;
  border-radius: var(--bbb-radius-tile);
  transition:
    transform var(--bbb-motion-micro) var(--bbb-ease-forward),
    box-shadow var(--bbb-motion-micro) var(--bbb-ease-forward);
}

/* Each tile draws its own segment of the shelf board. Covers share one aspect
 * ratio inside equal columns, so the segments meet as one continuous board. */
.bbb-tile__frame::after {
  content: "";
  position: absolute;
  left: -7px;
  right: -7px;
  bottom: -10px;
  height: 9px;
  border-radius: 3px;
  background: linear-gradient(180deg, #e8d2b2, #cdab83);
  box-shadow: 0 3px 6px rgba(54, 38, 20, 0.16);
}

.bbb-tile__cover {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 49 / 73;
  border-radius: var(--bbb-radius-tile);
  box-shadow: var(--bbb-shadow-tile);
  background: var(--bbb-border-soft);
}

.bbb-tile[data-enabled="false"] .bbb-tile__cover {
  filter: saturate(0.5) opacity(0.86);
}

.bbb-tile[data-enabled="false"] .bbb-tile__title,
.bbb-tile[data-enabled="false"] .bbb-tile__facts {
  color: var(--bbb-muted);
}

.bbb-tile__badge {
  position: absolute;
  top: -10px;
  right: -8px;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: var(--bbb-teal);
  color: #fff;
  border: 3px solid var(--bbb-surface);
  opacity: 0;
  transform: scale(0.6);
  transition:
    opacity var(--bbb-motion-micro) var(--bbb-ease-forward),
    transform var(--bbb-motion-micro) var(--bbb-ease-forward);
}

.bbb-tile__badge .bbb-icon {
  width: 18px;
  height: 18px;
}

.bbb-tile__price {
  position: absolute;
  left: 8px;
  bottom: 8px;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(12, 48, 72, 0.92);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.bbb-tile__price[data-free="true"] {
  background: var(--bbb-teal);
}

.bbb-nav__note {
  flex-basis: 100%;
  margin-top: 6px;
  color: var(--bbb-muted);
  font-size: 13px;
  text-align: right;
}

.bbb-nav__note:empty {
  display: none;
}

.bbb-tile__meta {
  display: grid;
  gap: 2px;
  min-height: 42px;
  text-align: center;
}

.bbb-tile__title {
  font-size: 14px;
  font-weight: 800;
  line-height: 1.25;
}

.bbb-tile__facts {
  font-size: 12px;
  color: var(--bbb-muted);
}

.bbb-tile__reason {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  line-height: 1.35;
  color: var(--bbb-danger);
}

@media (hover: hover) {
  .bbb-tile[data-enabled="true"] .bbb-tile__label:hover .bbb-tile__frame {
    transform: translate3d(0, -8px, 0);
    box-shadow: 0 18px 30px rgba(54, 38, 20, 0.22);
  }
}

.bbb-native:focus-visible + .bbb-tile__frame,
.bbb-native:focus-visible + .bbb-tile__frame + .bbb-tile__meta {
  outline: 3px solid var(--bbb-focus);
  outline-offset: 3px;
  border-radius: 12px;
}

.bbb-native:checked + .bbb-tile__frame {
  transform: translate3d(0, -6px, 0);
}

.bbb-native:checked + .bbb-tile__frame .bbb-tile__cover {
  outline: 3px solid var(--bbb-teal);
  outline-offset: 3px;
  box-shadow: 0 18px 30px rgba(11, 116, 117, 0.28);
}

.bbb-native:checked + .bbb-tile__frame .bbb-tile__badge {
  opacity: 1;
  transform: scale(1);
}

.bbb-tile[data-selecting="true"] .bbb-tile__frame {
  animation: bbb-pop var(--bbb-motion-short) var(--bbb-ease-forward);
}

@keyframes bbb-pop {
  0% {
    transform: scale(0.98) translate3d(0, -6px, 0);
  }
  55% {
    transform: scale(1.04) translate3d(0, -8px, 0);
  }
  100% {
    transform: scale(1) translate3d(0, -6px, 0);
  }
}

.bbb-shelf__cue {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 10px;
  color: var(--bbb-muted);
  font-size: 14px;
  font-weight: 600;
  transition: opacity var(--bbb-motion-short) var(--bbb-ease-standard);
}

.bbb-shelf__cue[hidden] {
  display: none;
}

.bbb-shelf__cue .bbb-icon {
  animation: bbb-nudge 1.8s var(--bbb-ease-standard) infinite;
}

@keyframes bbb-nudge {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(3px);
  }
}

.bbb-shelf__availability {
  margin-top: 10px;
  color: var(--bbb-muted);
  font-size: 13px;
}

.bbb-tray {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 25;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 8px 12px;
  padding: 10px var(--bbb-gutter);
  padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  background: rgba(255, 250, 242, 0.97);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--bbb-border);
  box-shadow: 0 -8px 24px rgba(54, 38, 20, 0.08);
}

html:not([data-enhanced]) .bbb-tray {
  position: static;
  margin: 12px 0 0;
  box-shadow: none;
  background: transparent;
  border-top: 0;
  padding-left: 0;
  padding-right: 0;
}

.bbb-tray > [data-bbb="help-choose"] {
  grid-column: 1 / -1;
  justify-self: start;
  min-height: 36px;
  padding-top: 0;
  padding-bottom: 0;
  font-size: 15px;
}

.bbb-tray__summary {
  min-height: 44px;
  display: flex;
  align-items: center;
}

.bbb-tray__empty {
  color: var(--bbb-muted);
  font-size: 14px;
}

.bbb-tray__chosen {
  display: flex;
  align-items: center;
  gap: 12px;
}

.bbb-tray__chosen[hidden] {
  display: none;
}

.bbb-tray__cover {
  width: 40px;
  height: auto;
  aspect-ratio: 49 / 73;
  border-radius: 5px;
  box-shadow: var(--bbb-shadow-card);
}

.bbb-tray__text {
  display: grid;
  min-width: 0;
}

.bbb-tray__eyebrow {
  display: none;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--bbb-muted);
}

.bbb-tray__title {
  font-size: 15px;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bbb-tray__facts {
  font-size: 12px;
  color: var(--bbb-muted);
}

.bbb-nav {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-top: 20px;
}

.bbb-nav .bbb-btn--primary,
.bbb-nav .bbb-btn--final {
  flex: 1;
}

.bbb-nav--tray {
  margin-top: 0;
}

.bbb-nav--tray .bbb-btn--primary {
  padding: 12px 16px;
  font-size: 15px;
}

.bbb-nav__link {
  order: 3;
  flex-basis: 100%;
  justify-content: center;
}

html[data-enhanced] .bbb-nav--sticky {
  position: sticky;
  bottom: 0;
  z-index: 20;
  flex-wrap: wrap;
  margin-left: calc(var(--bbb-gutter) * -1);
  margin-right: calc(var(--bbb-gutter) * -1);
  padding: 12px var(--bbb-gutter);
  padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  background: rgba(255, 250, 242, 0.97);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--bbb-border);
}

.bbb-footer {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--bbb-border);
}

.bbb-footer__title {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--bbb-muted);
  margin-bottom: 10px;
}

.bbb-footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
}

.bbb-footer__links a,
.bbb-footer__note a {
  color: var(--bbb-teal-dark);
  font-size: 14px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.bbb-footer__links a {
  display: inline-block;
  min-height: 32px;
  line-height: 32px;
}

.bbb-footer__note {
  margin-top: 12px;
  color: var(--bbb-muted);
  font-size: 14px;
}

/* ------------------------------------------------------- site colophon */

.bbb-colophon {
  width: min(var(--bbb-content), 100%);
  margin: 0 auto;
  padding: 20px var(--bbb-gutter) 32px;
  border-top: 1px solid var(--bbb-border);
}

.bbb-colophon__line {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 12px;
}

.bbb-colophon__brand {
  font-size: 15px;
  font-weight: 800;
  color: var(--bbb-navy);
}

.bbb-colophon__parent {
  display: inline-block;
  min-height: 32px;
  line-height: 32px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--bbb-teal-dark);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ----------------------------------------------------------- step 2: age */

.bbb-split {
  display: grid;
  gap: 20px;
}

.bbb-stage {
  display: grid;
  justify-items: center;
  gap: 10px;
}

.bbb-stage__cover {
  width: min(58vw, 240px);
  height: auto;
  aspect-ratio: 49 / 73;
  border-radius: 12px;
  box-shadow: var(--bbb-shadow-stage);
  transition:
    width var(--bbb-motion-short) var(--bbb-ease-standard),
    transform var(--bbb-motion-book) var(--bbb-ease-forward);
}

/* Short phones: once the buyer scrolls toward the age grid the cover keeps
 * the book visible without owning the screen. */
.bbb-stage[data-compact="true"] .bbb-stage__cover {
  width: 170px;
}

.bbb-stage__caption {
  color: var(--bbb-muted);
  font-size: 14px;
  text-align: center;
}

.bbb-panel {
  order: 1;
  padding: 20px;
  border: 1px solid var(--bbb-border);
  border-radius: var(--bbb-radius-card);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: var(--bbb-shadow-card);
}

.bbb-age-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.bbb-age[hidden] {
  display: none;
}

.bbb-age__label {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 68px;
  border: 1px solid var(--bbb-border);
  border-radius: var(--bbb-radius-control);
  background: var(--bbb-surface);
  cursor: pointer;
  transition:
    background var(--bbb-motion-micro) var(--bbb-ease-standard),
    border-color var(--bbb-motion-micro) var(--bbb-ease-standard),
    transform var(--bbb-motion-micro) var(--bbb-ease-forward);
}

.bbb-age__value {
  font-size: 30px;
  font-weight: 800;
}

.bbb-age__badge {
  position: absolute;
  top: -9px;
  right: -9px;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: var(--bbb-teal);
  color: #fff;
  border: 3px solid var(--bbb-surface);
  opacity: 0;
  transform: scale(0.6);
  transition:
    opacity var(--bbb-motion-micro) var(--bbb-ease-forward),
    transform var(--bbb-motion-micro) var(--bbb-ease-forward);
}

.bbb-age__badge .bbb-icon {
  width: 15px;
  height: 15px;
}

.bbb-native:checked ~ .bbb-age__value {
  color: #fff;
}

.bbb-age .bbb-native:checked ~ .bbb-age__badge {
  opacity: 1;
  transform: scale(1);
}

.bbb-age:has(.bbb-native:checked) .bbb-age__label {
  background: var(--bbb-teal);
  border-color: var(--bbb-teal-dark);
  animation: bbb-tile-pop 170ms ease-out;
}

.bbb-age:has(.bbb-native:checked) .bbb-age__value {
  color: #fff;
}

.bbb-age:has(.bbb-native:focus-visible) .bbb-age__label {
  outline: 3px solid var(--bbb-focus);
  outline-offset: 3px;
}

@keyframes bbb-tile-pop {
  0% {
    transform: scale(0.96);
  }
  55% {
    transform: scale(1.04);
  }
  100% {
    transform: scale(1);
  }
}

.bbb-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 16px;
  padding: 14px 16px;
  border: 1px solid var(--bbb-border-soft);
  border-radius: var(--bbb-radius-control);
  background: var(--bbb-surface);
  color: var(--bbb-muted);
  font-size: 14px;
}

.bbb-note .bbb-icon {
  color: #d7a73d;
  margin-top: 2px;
}

.bbb-note--wide {
  margin-top: 18px;
}

/* ------------------------------------------------------- step 3: preview */

.bbb-change-book {
  margin-bottom: 10px;
  text-align: center;
}

.bbb-preview {
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
  gap: 10px;
}

.bbb-preview__stage {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  touch-action: pan-y;
}

.bbb-preview__stage:focus-visible {
  outline: 3px solid var(--bbb-focus);
  outline-offset: 3px;
}

.bbb-preview__image {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 11 / 7;
  border-radius: 18px;
  box-shadow: var(--bbb-shadow-stage);
  background: var(--bbb-surface);
  transition:
    opacity var(--bbb-motion-short) var(--bbb-ease-standard),
    transform var(--bbb-motion-short) var(--bbb-ease-forward);
}

.bbb-preview__stage[data-turning="forward"] .bbb-preview__image {
  animation: bbb-turn-forward var(--bbb-motion-book) var(--bbb-ease-forward);
}

.bbb-preview__stage[data-turning="back"] .bbb-preview__image {
  animation: bbb-turn-back var(--bbb-motion-book) var(--bbb-ease-forward);
}

@keyframes bbb-turn-forward {
  0% {
    opacity: 0.25;
    transform: perspective(1400px) rotateY(-14deg) translate3d(24px, 0, 0);
  }
  100% {
    opacity: 1;
    transform: none;
  }
}

@keyframes bbb-turn-back {
  0% {
    opacity: 0.25;
    transform: perspective(1400px) rotateY(14deg) translate3d(-24px, 0, 0);
  }
  100% {
    opacity: 1;
    transform: none;
  }
}

.bbb-preview__skeleton {
  position: absolute;
  inset: 0;
  border-radius: 18px;
  background: linear-gradient(100deg, #f3eadd 20%, #fbf5ec 40%, #f3eadd 60%);
  background-size: 220% 100%;
  animation: bbb-shimmer 1.4s linear infinite;
}

.bbb-preview__skeleton[hidden] {
  display: none;
}

@keyframes bbb-shimmer {
  from {
    background-position: 120% 0;
  }
  to {
    background-position: -120% 0;
  }
}

.bbb-preview__arrow {
  position: absolute;
  top: 50%;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  transform: translateY(-50%);
  border: 1px solid var(--bbb-border);
  border-radius: 999px;
  background: rgba(255, 250, 242, 0.94);
  box-shadow: var(--bbb-shadow-card);
  cursor: pointer;
}

.bbb-preview__arrow--prev {
  left: 4px;
}

.bbb-preview__arrow--next {
  right: 4px;
}

.bbb-preview__arrow:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.bbb-thumbs {
  display: flex;
  gap: 10px;
  margin-top: 14px;
  padding-bottom: 6px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  overscroll-behavior-x: contain;
}

.bbb-thumbs__item {
  flex: 0 0 auto;
  scroll-snap-align: center;
}

.bbb-thumb {
  position: relative;
  display: block;
  width: 108px;
  padding: 4px;
  border: 2px solid transparent;
  border-radius: 12px;
  background: var(--bbb-surface);
  box-shadow: var(--bbb-shadow-card);
  cursor: pointer;
  transition:
    transform var(--bbb-motion-micro) var(--bbb-ease-forward),
    border-color var(--bbb-motion-micro) var(--bbb-ease-standard);
}

.bbb-thumb__image {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 11 / 7;
  border-radius: 8px;
  background: var(--bbb-border-soft);
}

.bbb-thumb__index {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  font-weight: 700;
  color: var(--bbb-muted);
  text-align: center;
}

.bbb-thumb[aria-pressed="true"] {
  border-color: var(--bbb-teal);
  transform: scale(1.04);
}

.bbb-thumb[aria-pressed="true"] .bbb-thumb__index {
  color: var(--bbb-teal-dark);
}

.bbb-preview__counter {
  margin-top: 6px;
  text-align: center;
  font-size: 14px;
  font-weight: 700;
  color: var(--bbb-muted);
}

/* --------------------------------------------------------- step 4: print */

/* The summary rail is a desktop affordance. On phones the decision comes
 * first and the summary follows it, so the print choice is never pushed below
 * the fold by a recap of choices already made. */
.bbb-rail {
  order: 2;
  padding: 18px;
  border: 1px solid var(--bbb-border);
  border-radius: var(--bbb-radius-card);
  background: rgba(255, 255, 255, 0.7);
  box-shadow: var(--bbb-shadow-card);
}

.bbb-rail__title {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--bbb-muted);
  margin-bottom: 12px;
}

.bbb-rail__cover {
  display: block;
  width: 132px;
  height: auto;
  aspect-ratio: 49 / 73;
  margin-bottom: 14px;
  border-radius: 8px;
  box-shadow: var(--bbb-shadow-card);
}

.bbb-summary {
  display: grid;
  gap: 2px;
}

.bbb-summary__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--bbb-border-soft);
}

.bbb-summary__row:last-child {
  border-bottom: 0;
}

.bbb-summary__term {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--bbb-muted);
  font-size: 14px;
}

.bbb-summary__term .bbb-icon {
  color: var(--bbb-teal-dark);
}

.bbb-summary__value {
  font-size: 15px;
  font-weight: 700;
  text-align: right;
}

.bbb-tip {
  display: flex;
  gap: 10px;
  margin-top: 16px;
  padding: 14px;
  border-radius: var(--bbb-radius-control);
  background: var(--bbb-surface);
  border: 1px solid var(--bbb-border-soft);
  font-size: 13px;
  color: var(--bbb-muted);
}

.bbb-tip .bbb-icon {
  color: #d7a73d;
}

.bbb-print-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.bbb-print__label {
  position: relative;
  display: grid;
  gap: 12px;
  height: 100%;
  padding: 14px;
  border: 2px solid var(--bbb-border);
  border-radius: var(--bbb-radius-card);
  background: var(--bbb-surface);
  cursor: pointer;
  transition:
    border-color var(--bbb-motion-short) var(--bbb-ease-standard),
    box-shadow var(--bbb-motion-short) var(--bbb-ease-standard);
}

.bbb-print:has(.bbb-native:checked) .bbb-print__label {
  border-color: var(--bbb-teal);
  box-shadow: 0 12px 26px rgba(11, 116, 117, 0.16);
}

.bbb-print:has(.bbb-native:focus-visible) .bbb-print__label {
  outline: 3px solid var(--bbb-focus);
  outline-offset: 3px;
}

.bbb-print__frame {
  position: relative;
  display: block;
}

.bbb-print__sample {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 11 / 7;
  border-radius: 12px;
  background: var(--bbb-border-soft);
  transition: opacity var(--bbb-motion-short) var(--bbb-ease-standard);
}

.bbb-print__badge {
  position: absolute;
  top: -12px;
  right: -12px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 3px solid var(--bbb-surface);
  background: #e9ded0;
  color: transparent;
  transition:
    background var(--bbb-motion-micro) var(--bbb-ease-standard),
    color var(--bbb-motion-micro) var(--bbb-ease-standard);
}

.bbb-print__badge .bbb-icon {
  width: 19px;
  height: 19px;
}

.bbb-print:has(.bbb-native:checked) .bbb-print__badge {
  background: var(--bbb-teal);
  color: #fff;
}

.bbb-print__body {
  display: grid;
  gap: 4px;
}

.bbb-print__icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background: var(--bbb-teal-light);
  color: var(--bbb-teal-dark);
  margin-bottom: 4px;
}

.bbb-print__title {
  font-size: 20px;
  font-weight: 800;
}

.bbb-print__text {
  color: var(--bbb-muted);
  font-size: 15px;
}

.bbb-print__note {
  justify-self: start;
  margin-top: 6px;
  padding: 6px 12px;
  border: 1px solid var(--bbb-border);
  border-radius: 999px;
  background: #fff;
  font-size: 13px;
  font-weight: 700;
  color: var(--bbb-teal-dark);
}

.bbb-print[data-unsupported="true"] .bbb-print__label {
  opacity: 0.55;
  cursor: not-allowed;
}

.bbb-extras {
  margin-top: 22px;
}

.bbb-check {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--bbb-border);
  border-radius: var(--bbb-radius-control);
  background: var(--bbb-surface);
  cursor: pointer;
}

.bbb-check--plain {
  margin-top: 12px;
}

.bbb-check:has(.bbb-native:focus-visible) {
  outline: 3px solid var(--bbb-focus);
  outline-offset: 3px;
}

.bbb-check__box {
  display: grid;
  place-items: center;
  flex: none;
  width: 28px;
  height: 28px;
  border: 2px solid var(--bbb-border);
  border-radius: 8px;
  background: #fff;
  color: transparent;
  transition:
    background var(--bbb-motion-micro) var(--bbb-ease-standard),
    color var(--bbb-motion-micro) var(--bbb-ease-standard),
    border-color var(--bbb-motion-micro) var(--bbb-ease-standard);
}

.bbb-check__box .bbb-icon {
  width: 18px;
  height: 18px;
}

.bbb-check:has(.bbb-native:checked) .bbb-check__box {
  background: var(--bbb-teal);
  border-color: var(--bbb-teal-dark);
  color: #fff;
}

.bbb-check:has(.bbb-native:disabled) {
  opacity: 0.55;
  cursor: not-allowed;
}

.bbb-check__body {
  display: grid;
  gap: 2px;
}

.bbb-check__title {
  font-weight: 800;
}

.bbb-check__text {
  color: var(--bbb-muted);
  font-size: 14px;
}

.bbb-check__unavailable {
  margin-top: 8px;
  color: var(--bbb-muted);
  font-size: 13px;
}

/* -------------------------------------------------------- step 5: review */

.bbb-review {
  display: grid;
  gap: 18px;
}

.bbb-review__figure {
  margin: 0;
}

.bbb-review__image {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 11 / 7;
  border-radius: 18px;
  box-shadow: var(--bbb-shadow-stage);
  background: var(--bbb-surface);
  animation: bbb-settle 320ms ease-out both;
}

@keyframes bbb-settle {
  from {
    opacity: 0;
    transform: translate3d(0, 16px, 0);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.bbb-review__caption {
  margin-top: 8px;
  text-align: center;
  font-size: 13px;
  color: var(--bbb-muted);
}

.bbb-review__panel {
  display: grid;
  gap: 16px;
  padding: 20px;
  border: 1px solid var(--bbb-border);
  border-radius: var(--bbb-radius-card);
  background: rgba(255, 255, 255, 0.74);
  box-shadow: var(--bbb-shadow-card);
}

.bbb-review__title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: Georgia, serif;
  font-size: 22px;
  margin-bottom: 6px;
}

.bbb-review__title .bbb-icon {
  color: #d7a73d;
}

.bbb-summary--review .bbb-summary__row {
  animation: bbb-row-in 320ms ease-out both;
}

.bbb-summary--review .bbb-summary__row:nth-child(2) {
  animation-delay: 45ms;
}

.bbb-summary--review .bbb-summary__row:nth-child(3) {
  animation-delay: 90ms;
}

.bbb-summary--review .bbb-summary__row:nth-child(4) {
  animation-delay: 135ms;
}

.bbb-summary--review .bbb-summary__row:nth-child(5) {
  animation-delay: 180ms;
}

@keyframes bbb-row-in {
  from {
    opacity: 0;
    transform: translate3d(0, 8px, 0);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.bbb-review__aside {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 18px;
  border-radius: var(--bbb-radius-control);
  background: var(--bbb-surface);
  border: 1px solid var(--bbb-border-soft);
  text-align: center;
}

.bbb-review__star {
  color: #e0aa3f;
}

.bbb-review__star .bbb-icon {
  width: 34px;
  height: 34px;
}

.bbb-review__asideTitle {
  font-size: 18px;
  font-weight: 800;
}

.bbb-review__asideText {
  color: var(--bbb-muted);
  font-size: 14px;
}

.bbb-generation {
  display: none;
  gap: 10px;
  padding: 16px;
  border-radius: var(--bbb-radius-control);
  border: 1px solid var(--bbb-border);
  background: var(--bbb-surface);
}

.bbb-generation[data-state="submitting"],
.bbb-generation[data-state="pending"],
.bbb-generation[data-state="failed"] {
  display: grid;
}

.bbb-generation__status {
  font-weight: 700;
}

.bbb-generation__bar {
  height: 8px;
  border-radius: 999px;
  background: #ece0d0;
  overflow: hidden;
}

.bbb-generation[data-state="failed"] .bbb-generation__bar {
  display: none;
}

.bbb-generation__fill {
  display: block;
  width: 32%;
  height: 100%;
  border-radius: 999px;
  background: var(--bbb-teal);
  animation: bbb-indeterminate 1.6s var(--bbb-ease-standard) infinite;
}

@keyframes bbb-indeterminate {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(320%);
  }
}

.bbb-generation__error[hidden] {
  display: none;
}

.bbb-generation__errorTitle {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--bbb-danger);
  font-size: 17px;
}

.bbb-generation__errorText {
  margin: 6px 0 12px;
  color: var(--bbb-muted);
  font-size: 15px;
}

.bbb-btn--final::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    100deg,
    transparent 30%,
    rgba(255, 255, 255, 0.32) 46%,
    transparent 62%
  );
  transform: translateX(-120%);
}

.bbb-btn--final[data-shine="true"]::after {
  animation: bbb-shine 620ms var(--bbb-ease-standard);
}

@keyframes bbb-shine {
  to {
    transform: translateX(120%);
  }
}

/* --------------------------------------------------------- step 6: ready */

.bbb-ready {
  display: grid;
  gap: 20px;
  justify-items: center;
}

.bbb-ready__image {
  /* Keep the finished cover visible without pushing the download action off
   * the first screen on a phone. */
  width: min(46vw, 190px);
  height: auto;
  aspect-ratio: 49 / 73;
  border-radius: 12px;
  box-shadow: var(--bbb-shadow-stage);
  animation: bbb-float 3.5s ease-in-out infinite;
}

@keyframes bbb-float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-3px);
  }
}

.bbb-success {
  display: grid;
  justify-items: center;
  gap: 10px;
  width: 100%;
  max-width: 420px;
  padding: 26px 22px;
  border-radius: var(--bbb-radius-card);
  background: #fff;
  border: 1px solid var(--bbb-border-soft);
  box-shadow: var(--bbb-shadow-stage);
  text-align: center;
  animation: bbb-success-in var(--bbb-motion-success) ease-out both;
}

@keyframes bbb-success-in {
  from {
    opacity: 0;
    transform: translate3d(0, 12px, 0);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.bbb-success__check {
  display: grid;
  place-items: center;
  width: 68px;
  height: 68px;
  border-radius: 999px;
  background: var(--bbb-teal);
  color: #fff;
}

.bbb-success__check .bbb-icon {
  width: 38px;
  height: 38px;
}

.bbb-success__title {
  font-family: Georgia, serif;
  font-size: 30px;
}

.bbb-success__text {
  color: var(--bbb-muted);
}

.bbb-success__meta {
  font-size: 13px;
  color: var(--bbb-muted);
}

.bbb-btn--download {
  width: 100%;
  margin-top: 6px;
}

.bbb-success__blocked[hidden] {
  display: none;
}

.bbb-success__blocked {
  font-size: 14px;
  color: var(--bbb-danger);
}

.bbb-success__reason {
  font-size: 13px;
  color: var(--bbb-muted);
}

.bbb-benefits {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 22px;
}

.bbb-benefit {
  display: grid;
  justify-items: center;
  gap: 4px;
  padding: 16px 10px;
  border: 1px solid var(--bbb-border-soft);
  border-radius: var(--bbb-radius-control);
  background: var(--bbb-surface);
  text-align: center;
}

.bbb-benefit__icon {
  color: var(--bbb-navy);
}

.bbb-benefit__icon .bbb-icon {
  width: 28px;
  height: 28px;
}

.bbb-benefit__title {
  font-weight: 800;
  font-size: 14px;
}

.bbb-benefit__text {
  font-size: 12px;
  color: var(--bbb-muted);
}

.bbb-restart {
  margin-top: 26px;
  text-align: center;
}

.bbb-expired[hidden] {
  display: none;
}

.bbb-expired {
  margin-top: 20px;
  padding: 18px;
  border: 1px solid var(--bbb-border);
  border-radius: var(--bbb-radius-control);
  background: var(--bbb-surface);
  text-align: center;
}

.bbb-expired__title {
  font-size: 18px;
  margin-bottom: 6px;
}

/* ------------------------------------------------------------- dialogues */

.bbb-dialog {
  width: min(560px, calc(100vw - 32px));
  max-height: min(86svh, 760px);
  padding: 0;
  border: 1px solid var(--bbb-border);
  border-radius: var(--bbb-radius-card);
  background: var(--bbb-surface);
  color: var(--bbb-navy);
  box-shadow: var(--bbb-shadow-stage);
  overflow: auto;
}

.bbb-dialog::backdrop {
  background: rgba(20, 14, 8, 0.45);
  backdrop-filter: blur(2px);
}

.bbb-dialog[open] {
  animation: bbb-dialog-in var(--bbb-motion-short) var(--bbb-ease-forward);
}

@keyframes bbb-dialog-in {
  from {
    opacity: 0;
    transform: scale(0.97);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.bbb-dialog__form {
  display: grid;
  gap: 14px;
  padding: 20px;
}

.bbb-dialog__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.bbb-dialog__title {
  font-family: Georgia, serif;
  font-size: 24px;
}

.bbb-dialog__close {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--bbb-border);
  border-radius: 999px;
  background: #fff;
  cursor: pointer;
}

.bbb-dialog__text {
  color: var(--bbb-muted);
  font-size: 15px;
}

.bbb-dialog__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.bbb-quiz__field + .bbb-quiz__field {
  margin-top: 4px;
}

.bbb-quiz__ages {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}

.bbb-quiz__age {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 48px;
  border: 1px solid var(--bbb-border);
  border-radius: 12px;
  background: #fff;
  font-weight: 800;
  cursor: pointer;
}

.bbb-quiz__age:has(.bbb-native:checked) {
  background: var(--bbb-teal);
  color: #fff;
  border-color: var(--bbb-teal-dark);
}

.bbb-quiz__age:has(.bbb-native:focus-visible) {
  outline: 3px solid var(--bbb-focus);
  outline-offset: 3px;
}

.bbb-quiz__options {
  display: grid;
  gap: 8px;
}

.bbb-quiz__option {
  position: relative;
  display: block;
  padding: 12px 14px;
  border: 1px solid var(--bbb-border);
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
}

.bbb-quiz__option:has(.bbb-native:checked) {
  border-color: var(--bbb-teal);
  box-shadow: 0 8px 18px rgba(11, 116, 117, 0.14);
}

.bbb-quiz__option:has(.bbb-native:focus-visible) {
  outline: 3px solid var(--bbb-focus);
  outline-offset: 3px;
}

.bbb-quiz__optionBody {
  display: grid;
  gap: 2px;
}

.bbb-quiz__optionTitle {
  font-weight: 800;
}

.bbb-quiz__optionText {
  color: var(--bbb-muted);
  font-size: 14px;
}

.bbb-quiz__result {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 14px;
  border-radius: var(--bbb-radius-control);
  background: var(--bbb-teal-light);
}

.bbb-quiz__result[hidden] {
  display: none;
}

.bbb-quiz__cover {
  width: 66px;
  height: auto;
  aspect-ratio: 49 / 73;
  border-radius: 6px;
  box-shadow: var(--bbb-shadow-card);
}

.bbb-quiz__resultEyebrow {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--bbb-teal-dark);
  font-weight: 800;
}

.bbb-quiz__resultTitle {
  font-size: 19px;
  font-weight: 800;
}

.bbb-quiz__resultText {
  font-size: 14px;
  color: var(--bbb-muted);
}

.bbb-menu {
  display: grid;
  gap: 8px;
}

.bbb-menu__item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: var(--bbb-target);
  padding: 12px 14px;
  border: 1px solid var(--bbb-border);
  border-radius: var(--bbb-radius-control);
  background: #fff;
  text-align: left;
  cursor: pointer;
}

.bbb-menu__item .bbb-icon {
  color: var(--bbb-teal-dark);
}

.bbb-menu__title {
  display: block;
  font-weight: 800;
}

.bbb-menu__text {
  display: block;
  font-size: 13px;
  color: var(--bbb-muted);
}

.bbb-prose p + p {
  margin-top: 10px;
}

.bbb-prose {
  color: var(--bbb-muted);
  font-size: 15px;
}

.bbb-toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  z-index: 40;
  transform: translateX(-50%);
  padding: 12px 18px;
  border-radius: 999px;
  background: var(--bbb-navy);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  box-shadow: var(--bbb-shadow-stage);
  animation: bbb-toast-in var(--bbb-motion-short) var(--bbb-ease-forward);
}

.bbb-toast[hidden] {
  display: none;
}

@keyframes bbb-toast-in {
  from {
    opacity: 0;
    transform: translate(-50%, 10px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

.bbb-sparkles {
  position: fixed;
  inset: 0;
  z-index: 45;
  pointer-events: none;
}

.bbb-sparkle {
  position: absolute;
  width: 9px;
  height: 9px;
  border-radius: 2px;
  opacity: 0;
  animation: bbb-sparkle 900ms ease-out forwards;
}

@keyframes bbb-sparkle {
  0% {
    opacity: 0;
    transform: translate3d(0, 0, 0) scale(0.4);
  }
  25% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate3d(var(--bbb-dx, 0), var(--bbb-dy, -80px), 0) scale(1);
  }
}

/* ----------------------------------------------------- tablet and beyond */

@media (min-width: 480px) {
  .bbb-shelf__grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .bbb-print-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .bbb-benefits {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (min-width: 768px) {
  :root {
    --bbb-gutter: 28px;
  }

  .bbb-shelf__grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 34px 18px;
  }

  .bbb-shelf {
    /* The enhancement script measures what is left between the sticky header
     * and the action tray so the bookcase fills it exactly. */
    max-height: var(--bbb-shelf-max, min(62svh, 720px));
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
    padding: 12px 10px 4px;
  }

  .bbb-header__tools {
    display: flex;
  }

  .bbb-progress__label {
    position: static;
    width: auto;
    height: auto;
    clip: auto;
    clip-path: none;
  }

  .bbb-step__subtitle {
    font-size: 16px;
  }

  .bbb-step__number {
    width: 44px;
    height: 44px;
    font-size: 22px;
  }

  .bbb-menu-button {
    display: none;
  }

  .bbb-tray {
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 18px;
  }

  .bbb-tray > [data-bbb="help-choose"] {
    grid-column: auto;
    min-height: 44px;
    font-size: 16px;
  }

  .bbb-tray__eyebrow {
    display: block;
  }

  .bbb-tray__title {
    font-size: 16px;
  }

  .bbb-nav--tray .bbb-btn--primary {
    padding: 12px 22px;
    font-size: 16px;
  }

  .bbb-nav--tray .bbb-btn--primary {
    flex: none;
    min-width: 200px;
  }

  .bbb-split {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
    align-items: start;
    gap: 28px;
  }

  .bbb-split--rail {
    grid-template-columns: minmax(0, 260px) minmax(0, 1fr);
  }

  .bbb-rail {
    order: 0;
  }

  .bbb-panel {
    order: 0;
  }

  .bbb-review {
    gap: 22px;
  }

  .bbb-review__panel {
    grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
    align-items: start;
  }

  .bbb-nav {
    justify-content: flex-end;
  }

  .bbb-nav .bbb-btn--primary,
  .bbb-nav .bbb-btn--final {
    flex: none;
    min-width: 220px;
  }

  .bbb-ready {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: center;
    justify-items: stretch;
  }

  .bbb-ready__cover {
    display: grid;
    justify-items: center;
  }

  .bbb-ready__image {
    width: min(70vw, 300px);
  }

  .bbb-success {
    max-width: none;
  }

  .bbb-preview__arrow--prev {
    left: -8px;
  }

  .bbb-preview__arrow--next {
    right: -8px;
  }

  .bbb-thumbs {
    justify-content: center;
  }
}

@media (min-width: 1024px) {
  :root {
    --bbb-gutter: 40px;
  }

  body.bbb-body {
    font-size: 17px;
  }

  .bbb-shelf__grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .bbb-shelf {
    max-height: min(58svh, 640px);
    padding: 16px 16px 6px;
  }

  .bbb-tray {
    position: sticky;
    left: auto;
    right: auto;
    border-radius: var(--bbb-radius-card) var(--bbb-radius-card) 0 0;
    border: 1px solid var(--bbb-border);
    border-bottom: 0;
    max-width: var(--bbb-content);
    margin: 18px auto 0;
  }

  .bbb-stage__cover,
  .bbb-stage[data-compact="true"] .bbb-stage__cover {
    width: min(30vw, 340px);
  }

  .bbb-panel {
    padding: 28px;
  }

  .bbb-preview__stage {
    width: fit-content;
    max-width: 100%;
    margin: 0 auto;
  }

  .bbb-preview__image {
    width: auto;
    max-width: 100%;
    max-height: min(48svh, 470px);
  }

  .bbb-thumb {
    width: 132px;
  }

  html[data-enhanced] .bbb-nav--sticky {
    position: static;
    margin-left: 0;
    margin-right: 0;
    padding: 0;
    background: none;
    backdrop-filter: none;
    border-top: 0;
  }

  .bbb-nav--three {
    justify-content: space-between;
  }

  .bbb-btn--final > .bbb-icon:first-child {
    display: block;
  }

  .bbb-btn__more {
    position: static;
    width: auto;
    height: auto;
    clip: auto;
    clip-path: none;
  }

  .bbb-nav__link {
    order: 0;
    flex-basis: auto;
  }

  .bbb-review__figure {
    display: grid;
    justify-items: center;
  }

  .bbb-review__image {
    width: auto;
    max-width: 100%;
    max-height: min(32svh, 320px);
  }

  .bbb-step[data-step="5"] .bbb-step__head {
    margin-bottom: 8px;
  }
}

@media (min-width: 1280px) {
  .bbb-shelf__grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

/* --------------------------------------------------------- reduced motion */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

html[data-motion="reduced"] *,
html[data-motion="reduced"] *::before,
html[data-motion="reduced"] *::after {
  animation-duration: 0.01ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 120ms !important;
}

html[data-motion="reduced"] .bbb-sparkles,
html[data-motion="reduced"] .bbb-ready__image {
  animation: none;
}

html[data-motion="reduced"] .bbb-sparkles {
  display: none;
}

@media (forced-colors: active) {
  .bbb-tile__cover,
  .bbb-print__sample,
  .bbb-preview__image {
    forced-color-adjust: none;
  }

  .bbb-native:checked + .bbb-tile__frame .bbb-tile__cover {
    outline: 3px solid Highlight;
  }
}
