/* Buyer request: the brief builder in the page's one sea block. */

.bb {
  min-height: 100svh;
  padding: calc(var(--header-h) + clamp(28px, 5vh, 64px)) 0 clamp(56px, 8vh, 96px);
  background:
    radial-gradient(120% 80% at 85% 0%, rgb(58 168 236 / .10) 0%, rgb(58 168 236 / 0) 60%),
    var(--paper);
}
.bb-wrap {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 440px);
  gap: clamp(28px, 4vh, 44px) clamp(40px, 6vw, 96px); align-items: start;
}
.bb-main { min-width: 0; }
.bb-head { display: grid; gap: 12px; margin-bottom: clamp(28px, 4.5vh, 48px); }
.bb-head h1 { font-size: clamp(2.3rem, 1.5rem + 2.1vw, 3.3rem); line-height: 1.02; color: #fff; }
.bb-head .lede { max-width: 60ch; color: var(--ink-2); }
.bb .crumbs a { color: var(--ink-2); }

/* ---------- questions ---------- */

.bb-form { min-width: 0; scroll-margin-top: calc(var(--header-h) + 16px); }
.bb-progress { display: grid; gap: 12px; margin-bottom: clamp(22px, 3.5vh, 36px); }
.bb-progress p { display: flex; justify-content: space-between; gap: 16px; font-size: 0.875rem; color: var(--ink-2); font-weight: 600; }
.bb-mini { display: none; font-weight: 500; color: var(--muted); font-variant-numeric: tabular-nums; }
.bb-bar { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 6px; }
.bb-bar i { height: 2px; background: var(--line-strong); transition: background-color .4s ease; }
.bb-bar i.is-on { background: var(--sky); }

.bb-stage { min-height: 300px; }
/* the step sliding in must not widen the page */
.bb { overflow-x: clip; }
.bb-stage { overflow-x: clip; overflow-clip-margin: 8px; }
.bb-loading { padding: 24px 0; }
.bb-q { font-size: clamp(1.9rem, 1.2rem + 2vw, 2.8rem); line-height: 1.06; max-width: 22ch; color: #fff; }
.bb-q:focus { outline: none; }
.bb-q:focus-visible { outline: 2px solid var(--sky); outline-offset: 6px; }
.bb-hint { margin-top: 12px; color: var(--muted); max-width: 52ch; }

.bb-opts { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 190px), 1fr)); gap: 10px; margin-top: clamp(22px, 3.5vh, 34px); }
.bb-opts.is-sizes { grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); }
.bb-opt {
  position: relative; display: grid; align-content: center; gap: 4px; min-height: 88px; padding: 14px 40px 14px 18px;
  border: 1px solid var(--line-strong); border-radius: var(--radius); background: rgb(255 255 255 / .025);
  text-align: left; cursor: pointer; color: var(--ink);
  transition: border-color .2s ease, background-color .2s ease, box-shadow .2s ease;
}
.bb-opts.is-sizes .bb-opt { padding: 12px 14px; min-height: 84px; }
.bb-opt-l { font-family: var(--serif); font-size: clamp(1.3rem, 1.1rem + 0.5vw, 1.6rem); line-height: 1.1; }
.bb-opts.is-sizes .bb-opt-l { font-size: clamp(1.6rem, 1.3rem + 0.8vw, 2rem); }
.bb-opts.is-sizes .bb-opt.is-any .bb-opt-l { font-size: 1.15rem; }
.bb-opt-n { font-size: 0.8125rem; color: var(--muted); }
.bb-opt:hover { border-color: var(--ink-2); background: rgb(255 255 255 / .05); }
.bb-opt.is-zero .bb-opt-l { color: var(--muted); }
/* the marker: round for one answer, square where several are allowed */
.bb-opt::after {
  content: ""; position: absolute; top: 14px; right: 14px; width: 12px; height: 12px;
  border: 1.5px solid var(--line-strong); border-radius: 50%; transition: background-color .2s ease, border-color .2s ease;
}
.bb-opt.is-multi::after { border-radius: 2px; }
.bb-opts.is-sizes .bb-opt::after { top: 10px; right: 10px; width: 10px; height: 10px; }
.bb-opt[aria-pressed="true"] { border-color: var(--sky); background: rgb(58 168 236 / .14); box-shadow: inset 0 0 0 1px var(--sky); }
.bb-opt[aria-pressed="true"]::after { background: var(--sky); border-color: var(--sky); }
.bb-opt[aria-pressed="true"] .bb-opt-n { color: var(--ink-2); }
.bb-opt:focus-visible { outline: 2px solid var(--sky); outline-offset: 2px; }

.bb-nav { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-top: clamp(22px, 3.5vh, 34px); }
.bb-nav .btn-ghost { color: var(--ink); }

@media (prefers-reduced-motion: no-preference) {
  .bb-step.is-entering { animation: bbIn .5s cubic-bezier(.16, 1, .3, 1) both; }
  .bb-step.is-entering.from-back { animation-name: bbInBack; }
}
@keyframes bbIn { from { opacity: 0; transform: translateX(28px); } }
@keyframes bbInBack { from { opacity: 0; transform: translateX(-28px); } }

/* ---------- step 7: details and recap ---------- */

.bb-details { display: grid; grid-template-columns: minmax(0, 1fr) minmax(200px, 250px); gap: 28px 36px; margin-top: 26px; align-items: start; }
.bb-details .form-grid { gap: 16px 18px; }
.bb-send { display: grid; gap: 12px; justify-items: start; }
.bb-confidential { color: var(--ink-2); }
.bb-after { margin-top: 10px; color: var(--ink-2); }
.bb-after a { color: var(--sky-ink); font-weight: 600; text-underline-offset: 3px; }
.bb-recap-wrap { padding: 18px 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper-raised); }
.bb-recap-wrap h3 { font-size: 1.25rem; color: #fff; margin-bottom: 10px; }
.bb-recap { margin: 0; display: grid; }
.bb-recap div { padding: 9px 0; border-top: 1px solid var(--line); }
.bb-recap dt { font-size: 0.75rem; color: var(--muted); }
.bb-recap dd { margin: 2px 0 0; display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-size: 0.875rem; color: var(--ink); }
.bb-recap .btn-link { font-size: 0.8125rem; flex: none; }

/* ---------- result panel ---------- */

.bb-result {
  position: sticky; top: calc(var(--header-h) + 20px); min-width: 0;
  display: grid; gap: 18px; padding: 24px; border: 1px solid var(--line); border-radius: var(--radius);
  background: rgb(18 38 58 / .72);
}
.bb-count { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.bb-n { font-family: var(--serif); font-size: clamp(3.4rem, 2.6rem + 2.4vw, 4.8rem); line-height: .9; color: #fff; }
.bb-count small { font-size: 1.05rem; color: var(--ink-2); }

.bb-grid { position: relative; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 6px; }
.bb-tile { position: relative; display: block; grid-column: span 3; aspect-ratio: 4 / 3; overflow: hidden; border-radius: 3px; background: var(--line); color: #fff; text-decoration: none; }
.bb-tile.is-lead { grid-column: span 6; grid-row: span 2; aspect-ratio: auto; }
.bb-tile.is-solo { grid-column: span 12; aspect-ratio: 3 / 2; }
.bb-tile.is-half { grid-column: span 6; }
.bb-tile.is-third { grid-column: span 4; }
.bb-tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .7s cubic-bezier(.16, 1, .3, 1); }
.bb-tile:hover img { transform: scale(1.05); }
.bb-tile::after { content: ""; position: absolute; inset: 45% 0 0; background: linear-gradient(0deg, rgb(6 16 25 / .78), rgb(6 16 25 / 0)); pointer-events: none; }
.bb-cap { position: absolute; left: 8px; right: 8px; bottom: 6px; z-index: 1; display: grid; line-height: 1.2; }
.bb-cap b { font-weight: 600; font-size: 0.6875rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bb-cap small { display: none; font-size: 0.75rem; color: rgb(255 255 255 / .82); font-variant-numeric: tabular-nums; }
.bb-tile.is-lead .bb-cap, .bb-tile.is-solo .bb-cap, .bb-tile.is-half .bb-cap, .bb-tile.is-third .bb-cap { left: 12px; bottom: 10px; }
.bb-tile.is-lead .bb-cap b, .bb-tile.is-solo .bb-cap b, .bb-tile.is-half .bb-cap b { font-family: var(--serif); font-weight: 400; font-size: 1.15rem; }
.bb-tile.is-lead .bb-cap small, .bb-tile.is-solo .bb-cap small, .bb-tile.is-half .bb-cap small, .bb-tile.is-third .bb-cap small { display: block; }
.bb-tile:focus-visible { outline: 2px solid var(--sky); outline-offset: 2px; }
.bb-more {
  display: grid; place-items: center; background: transparent; border: 1px solid var(--line-strong);
  font-weight: 600; font-size: 0.9rem; color: var(--ink); font-variant-numeric: tabular-nums;
}
.bb-more::after { display: none; }
.bb-more:hover { border-color: var(--ink-2); }

.bb-none { display: grid; gap: 12px; padding: 4px 0; }
.bb-none-msg { font-family: var(--serif); font-size: 1.4rem; line-height: 1.25; color: #fff; }
.bb-relax { color: var(--ink-2); font-size: 0.95rem; }
.bb-notes { color: var(--muted); }
.bb-show { display: flex; }

/* ---------- smaller screens: the panel moves below the questions ---------- */

@media (max-width: 1000px) {
  .bb-wrap { grid-template-columns: minmax(0, 1fr); }
  .bb-head { margin-bottom: 28px; }
  .bb-result { position: static; }
  .bb-mini { display: inline; }
  .bb-details { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) {
  .bb { min-height: 0; }
  .bb-opts { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .bb-opts.is-sizes { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .bb-opts.is-sizes .bb-opt { padding: 10px; min-height: 72px; }
  .bb-opt { min-height: 62px; }
  .bb-result { padding: 18px; }
  .bb-tile:not(.is-lead, .is-solo, .is-half, .is-third) .bb-cap { display: none; }
}

