/* Build Your AI. Page styles on top of gen.css (round nine, October 17, 2026).
   Desktop: the question on the left with a sparkle progress row on top, the plan filling in on the right.
   Below 1100 px: one column. The plan becomes a bar at the foot of the screen that opens.
   Orange is a fill only: a picked answer's sparkle, a finished step, and the main button. */

/* ---------- opening ---------- */
.byo-head { max-width: var(--max); margin: 0 auto; padding: 56px var(--gutter-r) 36px var(--gutter); display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 40px; align-items: end; }
.byo-head-copy { display: grid; gap: 16px; max-width: 720px; min-width: 0; }
.byo-head h1 { font-size: clamp(38px, 4.4vw, 58px); }
.byo-head .lead { max-width: 46ch; }
.byo-head-mark { position: relative; height: 210px; }
.byo-head-mark .field { position: absolute; inset: 0; width: 100%; height: 100%; }

.byo-nojs { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter-r) 88px var(--gutter); display: grid; gap: 14px; }
.byo-nojs h2 { font-size: 28px; }
.byo-nojs p { max-width: 60ch; color: var(--muted); }
html:not(.js) .byo { display: none; }

.byo { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter-r) 104px var(--gutter); }
.byo-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(340px, 410px); gap: 0 40px; }
.byo-grid:not(.is-ready) { visibility: hidden; }
.byo-main { min-width: 0; padding-bottom: 8px; }

/* ---------- small buttons ---------- */
.btn-text { background: none; border: 0; padding: 0; min-height: 44px; display: inline-flex; align-items: center; font: 600 16px var(--sans); color: var(--ink); text-decoration: underline; text-underline-offset: 5px; text-decoration-thickness: 1.5px; cursor: pointer; }
.btn-text:hover { text-decoration-color: var(--orange); }
.btn { border: 0; cursor: pointer; font-family: var(--sans); }
.btn-line { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--ink); }
.btn-line:hover { background: var(--ink); color: var(--paper); }
.btn:disabled { opacity: .55; cursor: progress; }

/* ---------- progress: one sparkle per step ---------- */
.byo [hidden] { display: none !important; }
.byo-rail { padding: 20px 0 22px; }
.rail-now, .rail-bar, .rail-reset { display: none; }
.rail-steps { list-style: none; margin: 0; padding: 0; display: flex; justify-content: space-between; gap: 0 16px; }
.rail-steps li { min-width: 0; }
.rail-steps .st { display: flex; align-items: flex-start; gap: 9px; width: 100%; min-height: 44px; padding: 0; border: 0; background: none; font: 400 15px var(--sans); line-height: 1.3; color: var(--muted); text-align: left; }
.rail-steps .nm { min-width: 0; }
.rail-steps .mk { flex: none; display: grid; place-items: center; width: 12px; height: 12px; margin-top: 3px; }
.rail-steps .mk svg { width: 12px; height: 12px; fill: #BDB8AD; }
.rail-steps .is-now .st { color: var(--ink); font-weight: 600; }
.rail-steps .is-now .mk svg { fill: var(--ink); }
.rail-steps .is-done .mk svg { fill: var(--orange); }
.rail-steps .is-done .st { color: var(--ink); cursor: pointer; }
.rail-steps .is-done .st:hover .nm { text-decoration: underline; text-underline-offset: 4px; }
.rail-steps .sub { display: block; margin-top: 3px; font: 400 12.5px var(--mono); color: var(--muted); }
.q-reset { margin-top: 10px; font-size: 15px; }
.byo-grid[data-view="blueprint"] .q-reset { display: none; }

/* ---------- the question ---------- */
.q { background: var(--card); border: 1px solid var(--rule); border-radius: 4px; padding: clamp(22px, 3vw, 40px); }
.q fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.q legend { display: block; width: 100%; padding: 0; }
.q h2, .res-h { font-size: clamp(28px, 3vw, 40px); }
.q h2:focus, .res-h:focus { outline: none; }
.q-help { margin-top: 10px; font-size: 17px; color: var(--muted); max-width: 40em; }
.q-note { margin-top: 16px; padding: 12px 16px; background: #ECEAE4; border-radius: 3px; font-size: 15.5px; line-height: 1.45; max-width: 42em; }
.opts { margin-top: 22px; border-top: 1px solid var(--rule); }
.opts.cols-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 28px; }
.opt { position: relative; display: flex; align-items: center; gap: 14px; min-height: 58px; padding: 12px 10px; border-bottom: 1px solid var(--rule); font-size: 17px; line-height: 1.3; cursor: pointer; transition: background-color .15s ease; }
.opt:hover { background: #F1EFEA; }
.opt input { position: absolute; opacity: 0; width: 22px; height: 22px; margin: 0; left: 10px; top: 50%; transform: translateY(-50%); cursor: pointer; }
.opt .box { flex: none; width: 22px; height: 22px; border: 1.5px solid #8C877C; border-radius: 50%; display: grid; place-items: center; transition: background-color .15s ease, border-color .15s ease; }
.opt input[type="checkbox"] + .box { border-radius: 4px; }
.opt .box svg { width: 12px; height: 12px; fill: var(--orange); opacity: 0; }
.opt input:checked + .box { background: var(--ink); border-color: var(--ink); }
.opt input:checked + .box svg { opacity: 1; }
.opt:has(input:checked) .opt-l { font-weight: 600; }
.opt input:focus-visible + .box { outline: 2px solid var(--ink); outline-offset: 3px; }
.opt.is-off { color: var(--muted); cursor: not-allowed; }
.opt.is-off:hover { background: none; }
.opt.is-off input { cursor: not-allowed; }
.opt.is-off .box { border-color: var(--rule); }
.opt-t { display: block; min-width: 0; }
.opt-l { display: block; }
.opt-h { display: block; margin-top: 2px; font-size: 14.5px; line-height: 1.35; color: var(--muted); }
.q-err { min-height: 24px; margin-top: 12px; font-size: 15px; font-weight: 600; }
.q-err:not(:empty)::before { content: ""; display: inline-block; width: 11px; height: 11px; margin-right: 8px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath fill='%23FF5C1C' d='M6 0Q7 5 12 6Q7 7 6 12Q5 7 0 6Q5 5 6 0Z'/%3E%3C/svg%3E") center / contain no-repeat; }
.q-nav { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-top: 6px; }
.q-nav .btn { min-width: 200px; }

/* ---------- the plan ---------- */
.byo-side { min-width: 0; padding-top: 18px; }
.byo-bp, .byo-next { position: sticky; top: 96px; }
.bp-toggle { display: none; }

.sheet { background: var(--card); border: 1px solid var(--rule); border-radius: 4px; padding: 22px 22px 18px; }
.sheet-logo { display: none; }
.sheet-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding-bottom: 12px; }
.sheet-head h2 { font-size: 21px; line-height: 1.1; }
.sheet .tag { font: 400 12px var(--mono); letter-spacing: 0.02em; color: var(--ink); border: 1px solid var(--ink); padding: 1px 6px; border-radius: 2px; white-space: nowrap; }
.sheet-for { padding: 10px 0; font-size: 14.5px; line-height: 1.4; color: var(--muted); border-bottom: 1px solid var(--rule); }
.sheet-parts { list-style: none; margin: 0; padding: 0; }
.part { padding: 10px 0; border-bottom: 1px solid var(--rule); }
.part-t { display: flex; align-items: baseline; gap: 10px; font-size: 14px; font-weight: 600; line-height: 1.3; color: var(--muted); }
.part-t .n { flex: none; width: 22px; font: 400 12px var(--mono); color: var(--muted); }
.part.is-ready .part-t, .part.is-ready .part-t .n { color: var(--ink); }
.part-b { padding-left: 32px; }
.part-sum { margin-top: 3px; font-size: 15px; line-height: 1.42; }
.part-pend { margin-top: 3px; font-size: 14.5px; color: var(--muted); }
.sheet-foot { padding-top: 12px; font-size: 13.5px; line-height: 1.4; color: var(--muted); }
@keyframes bp-in { from { opacity: .2; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.part.upd .part-sum { animation: bp-in .34s ease both; }
@media (prefers-reduced-motion: reduce) { .part.upd .part-sum { animation: none; } .opt, .opt .box { transition: none; } }

/* the finished plan, full size, in the main column */
.byo-grid[data-view="blueprint"] .byo-bp { display: none; }
#byo-result { padding-top: 4px; }
#byo-result > .q-help { margin-top: 12px; }
#bp-full { margin-top: 28px; }
.res-start { display: none; margin-top: 22px; }
.res-start .btn { min-width: 214px; }
.sheet.is-full { padding: clamp(22px, 2.8vw, 40px); }
.sheet.is-full .sheet-head h2 { font-size: clamp(24px, 2.2vw, 30px); }
.sheet.is-full .sheet-for { padding: 12px 0; font-size: 15.5px; }
.sheet.is-full .part { padding: 24px 0 26px; }
.sheet.is-full .part-t { font-size: 14.5px; }
.sheet.is-full .part-b { padding-left: 0; margin-top: 12px; font-size: 16px; line-height: 1.5; color: var(--muted); }
.sheet-date { white-space: nowrap; }
.part-h { font-size: clamp(19px, 1.6vw, 22px); font-weight: 600; line-height: 1.2; letter-spacing: -0.01em; color: var(--ink); text-wrap: balance; }
.part-h + .part-lead { margin-top: 8px; }
.part-lead { color: var(--ink); }
.part-items { list-style: none; margin: 12px 0 0; padding: 0; border-top: 1px solid var(--rule); }
.part-items li { display: grid; grid-template-columns: minmax(0, 10em) minmax(0, 1fr); gap: 2px 20px; padding: 11px 0; border-bottom: 1px solid var(--rule); }
.part-items li:last-child, .part-steps li:last-child { border-bottom: 0; padding-bottom: 0; }
.part-lead + .part-items, .part-items + .part-note, .part-lead + .part-note, .part-steps + .part-note { margin-top: 12px; }
.part-items b { font-weight: 600; color: var(--ink); }
.part-steps { list-style: none; margin: 0; padding: 0; counter-reset: step; }
.part-steps li { counter-increment: step; display: grid; grid-template-columns: 1.9em minmax(0, 1fr); padding: 9px 0; border-bottom: 1px solid var(--rule); color: var(--ink); }
.part-steps li::before { content: counter(step); font: 400 12px/2 var(--mono); color: var(--muted); }
.part-note { margin-top: 10px; }
.res-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; margin-top: 22px; }
.res-actions .form-status { flex-basis: 100%; min-height: 22px; font-size: 15px; }

/* the last step: start free, or send the plan to SUDO */
.next-block + .next-block { margin-top: 28px; padding-top: 26px; border-top: 1px solid var(--rule); }
.next-block[hidden] + .next-block { margin-top: 0; padding-top: 0; border-top: 0; }
.next-h { font-size: 24px; line-height: 1.1; }
.next-h:focus { outline: none; }
.next-block > p, #lead-intro > p, #lead-sent > p { margin-top: 10px; font-size: 15.5px; line-height: 1.5; color: var(--muted); }
#lead-sent b { color: var(--ink); }
.next-block > .btn, #lead-sent .btn { margin-top: 18px; width: 100%; }
#lead-form { margin-top: 12px; }
.fld { display: grid; gap: 6px; margin-top: 14px; }
.fld label { font-size: 15px; font-weight: 500; }
.input { width: 100%; min-height: 52px; padding: 0 14px; border: 1px solid var(--rule); border-radius: 3px; background: var(--card); font: 400 16px var(--sans); color: var(--ink); }
textarea.input { padding: 12px 14px; min-height: 96px; resize: vertical; line-height: 1.45; }
.input:hover { border-color: #A9A497; }
.input:focus { outline: 2px solid var(--ink); outline-offset: 1px; border-color: var(--ink); }
.input[aria-invalid="true"] { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.err { font-size: 14px; font-weight: 600; }
.err:empty { display: none; }
.opt-note { font-weight: 400; color: var(--muted); }
.check { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 10px; align-items: start; margin-top: 14px; font-size: 15px; line-height: 1.45; cursor: pointer; }
.check input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--ink); cursor: pointer; }
.check .link { min-height: 0; display: inline; text-underline-offset: 3px; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.lead-send { width: 100%; margin-top: 18px; }
.form-status { margin-top: 12px; min-height: 22px; font-size: 15px; }
.form-status.is-error { font-weight: 500; }

/* ---------- one column, below 1100 px ---------- */
@media (max-width: 1099px) {
  /* keep a focused answer clear of the plan bar at the foot of the screen */
  html { scroll-padding-bottom: 76px; }
  .byo-grid { display: block; }
  .byo-main { max-width: 760px; }
  .byo-rail { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 16px; padding: 18px 0 18px; }
  .rail-steps { display: none; }
  .rail-now { display: block; grid-column: 1; font-size: 15px; font-weight: 600; }
  .rail-bar { display: flex; gap: 8px; grid-column: 1; grid-row: 2; }
  .rail-bar i { width: 14px; height: 14px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath fill='%23BDB8AD' d='M6 0Q7 5 12 6Q7 7 6 12Q5 7 0 6Q5 5 6 0Z'/%3E%3C/svg%3E") center / contain no-repeat; }
  .rail-bar i.on { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath fill='%23FF5C1C' d='M6 0Q7 5 12 6Q7 7 6 12Q5 7 0 6Q5 5 6 0Z'/%3E%3C/svg%3E"); }
  .rail-reset { display: inline-flex; grid-column: 2; grid-row: 1 / span 2; font-size: 15px; }
  .q-reset { display: none; }
  .q-nav .btn { min-width: 0; flex: 1; max-width: 280px; }
  .byo-side { padding: 0; }
  .byo-grid[data-view="question"] .byo-side { position: sticky; bottom: 0; z-index: 5; margin-top: 28px; }
  .byo-next { max-width: 760px; padding-top: 12px; }

  /* the plan as a bar at the foot of the screen, open on request */
  .byo-bp { position: static; margin-inline: calc(var(--gutter) * -1); background: var(--paper); }
  .bp-toggle { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; padding: 0 var(--gutter-r) 0 var(--gutter); border: 0; background: none; text-align: left; cursor: pointer; color: var(--ink); font-family: var(--sans); }
  .bp-toggle-t { font-weight: 600; font-size: 16px; }
  .bp-count { margin-left: auto; font: 400 12.5px var(--mono); color: var(--muted); }
  .bp-toggle svg { width: 14px; height: 14px; flex: none; transition: transform .2s ease; }
  .byo-bp.is-open .bp-toggle svg { transform: rotate(180deg); }
  .bp-panel { display: none; max-height: min(62vh, 520px); overflow-y: auto; overscroll-behavior: contain; border-top: 1px solid var(--rule); }
  .byo-bp.is-open .bp-panel { display: block; }
  .bp-panel .sheet { border: 0; border-radius: 0; padding: 14px var(--gutter-r) 18px var(--gutter); background: var(--paper); }
  .bp-panel .sheet-head { display: none; }
  .byo-next { position: static; }
  .res-start:not([hidden]) { display: block; }
}
@media (max-width: 760px) {
  .byo-head { grid-template-columns: minmax(0, 1fr); padding-top: 36px; padding-bottom: 20px; }
  .byo-head-mark { display: none; }
  .byo { padding-bottom: 64px; }
}
@media (max-width: 640px) {
  .opts.cols-2 { grid-template-columns: minmax(0, 1fr); }
  .opt { padding-inline: 6px; }
  .opt input { left: 6px; }
  .q { padding: 22px 18px; }
  .sheet.is-full .part { padding: 20px 0; }
  .part-items li { grid-template-columns: minmax(0, 1fr); }
  .res-actions .btn { flex: 1; }
}

/* ---------- print: the plan alone, as a one or two page document ---------- */
@media print {
  @page { margin: 16mm 15mm; }
  .top, .foot, .skip, .byo-head, .byo-rail, .byo-side, .byo-nojs, #byo-q, .res-h, #byo-result > .q-help, .res-actions, .res-start { display: none !important; }
  body { background: #fff; }
  .byo { padding: 0 !important; max-width: none !important; }
  .byo-grid { display: block; border: 0; visibility: visible !important; }
  #bp-full { margin: 0; }
  .sheet.is-full { border: 0; border-radius: 0; padding: 0; background: #fff; }
  .sheet-logo { display: block; height: 20px; width: auto; margin-bottom: 14px; }
  .sheet.is-full .sheet-head h2 { font-size: 20pt; }
  .sheet.is-full .part { display: grid; grid-template-columns: 9em 1fr; gap: 4px 18px; padding: 10px 0; }
  .sheet.is-full .part-t { font-size: 9.5pt; break-after: avoid; }
  .sheet.is-full .part-b { margin-top: 0; font-size: 9.5pt; line-height: 1.4; }
  .part-h { font-size: 12.5pt; }
  .part-items { margin-top: 6px; }
  .part-items li { grid-template-columns: 8.5em 1fr; gap: 2px 14px; padding: 4px 0; break-inside: avoid; }
  .part-steps li { padding: 5px 0; break-inside: avoid; }
  .sheet-foot { font-size: 9pt; padding-top: 10px; }
}
.form-status .link, .q-help .link { display: inline; min-height: 0; text-underline-offset: 3px; }

/* Suggested starting point, October 18, 2026 */
.sheet-start { padding: 16px 0 18px; border-bottom: 1px solid var(--rule); display: grid; gap: 8px; justify-items: start; }
.sheet-start.is-compact { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; padding: 10px 0; font-size: 14.5px; line-height: 1.4; }
.sheet-start.is-compact b { font-weight: 600; color: var(--ink); }
.start-k { font: 400 12.5px var(--mono); letter-spacing: 0.02em; color: var(--muted); }
.start-name { font-size: clamp(26px, 2.6vw, 34px); font-weight: 600; line-height: 1.1; letter-spacing: -0.01em; color: var(--ink); }
.start-text { color: var(--ink); max-width: 56ch; }
.start-note { color: var(--muted); font-size: 15px; max-width: 56ch; }
.start-links { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 22px; margin-top: 6px; }
@media print {
  .start-links { display: none; }
  .start-name { font-size: 15pt; }
  .start-text, .start-note { font-size: 9.5pt; }
}
