/* Kreator (#start), studio-onboarding.js: one question per screen in a full-window focus mode.
   Colours, radii and fonts come from the shared custom properties in studio.css; wizard-only values are --ob-*. */
:root {
  --ob-width: 720px;
  --ob-wide: 900px;
  --ob-gutter: clamp(16px, 4vw, 40px);
  --ob-move: 24px;
  --ob-time: .25s;
  --ob-title: clamp(24px, 3.4vw, 34px);
  --ob-answer: clamp(20px, 2.6vw, 28px);
  --ob-shadow: 0 1px 2px rgba(24, 38, 56, .06);
}

.onboarding-banner a { font-weight: 600; }

/* Focus mode: the wizard covers the studio; the side menu and the Agent panel are inert (studio-onboarding.js). */
body.onboarding-open { overflow: hidden; }
body.onboarding-open #view-onboarding { position: fixed; inset: 0; z-index: 60; overflow-y: auto; overscroll-behavior: contain; background: var(--paper); }
#onboarding-body { min-height: 100%; }
.ob-loading { margin: 0; padding: 48px var(--ob-gutter) 12px; }
#onboarding-body > .button-secondary, #onboarding-body > .button-text { margin: 0 0 0 var(--ob-gutter); }

.ob-shell { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.ob-progress { position: fixed; top: 0; left: 0; right: 0; z-index: 3; height: 3px; background: var(--line); }
.ob-progress span { display: block; width: 0; height: 100%; background: var(--navy); transition: width var(--ob-time) ease-out; }
.ob-top { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 8px 16px; padding: 12px var(--ob-gutter) 8px; background: var(--paper); }
.ob-brand { margin: 0 auto 0 0; color: var(--ink); font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ob-agent { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 13px; color: var(--muted); }
.ob-agent.is-running::before, .ob-status::before { content: ""; flex: 0 0 8px; width: 8px; height: 8px; border-radius: 50%; background: var(--navy); animation: ob-pulse 1.4s ease-in-out infinite; }
.ob-leave { flex-shrink: 0; font-size: 14px; }

.ob-stage { flex: 1; display: grid; align-items: center; justify-items: center; padding: 24px var(--ob-gutter) 32px; }
.ob-stage > .ob-q { grid-area: 1 / 1; width: min(var(--ob-width), 100%); min-width: 0; }
.ob-stage > .ob-q-wide { width: min(var(--ob-wide), 100%); }
.ob-kicker { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; color: var(--navy); font-size: 14px; font-weight: 600; }
.ob-number { font-variant-numeric: tabular-nums; }
.ob-title { color: var(--ink); font-size: var(--ob-title); font-weight: 600; line-height: 1.25; letter-spacing: -.03em; outline: none; overflow-wrap: anywhere; }
.ob-help { max-width: 62ch; margin: 12px 0 0; color: var(--muted); font-size: clamp(15px, 1.6vw, 18px); line-height: 1.55; }
.ob-note { max-width: 62ch; margin: 12px 0 0; padding: 8px 12px; border-radius: var(--radius); background: var(--amber-soft); color: var(--amber); font-size: 14px; }
.ob-control { margin-top: 28px; }
.ob-error { max-width: 62ch; margin: 14px 0 0; padding: 10px 12px; border-radius: var(--radius); background: var(--red-soft); color: var(--red); font-size: 14px; }

/* The one big answer field. */
.ob-input { display: block; width: 100%; min-height: 0; padding: 8px 0; border: 0; border-bottom: 2px solid var(--line-strong); border-radius: 0;
  background: transparent; color: var(--ink); font: inherit; font-size: var(--ob-answer); line-height: 1.4; }
.ob-input:focus { border-bottom-color: var(--navy); outline: none; }
.ob-input:focus-visible { outline: none; box-shadow: 0 2px 0 var(--navy); }
textarea.ob-input { resize: vertical; }
.ob-input::placeholder { color: var(--line-strong); }

.ob-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin-top: 28px; }
.ob-ok { min-height: 48px; padding: 10px 22px; font-size: 15px; }
.ob-shell.is-busy .ob-ok { cursor: progress; }
.ob-hint { margin: 0; color: var(--muted); font-size: 13px; }
.ob-hint-below { margin-top: 12px; }
.ob-hint kbd { padding: 1px 6px; border: 1px solid var(--line-strong); border-radius: 4px; background: var(--white); color: var(--ink); font: inherit; font-size: 12px; font-weight: 600; }
@media (hover: none) and (pointer: coarse) { .ob-hint { display: none; } }

/* Choices: letter, label, tick. */
.ob-options { display: flex; flex-direction: column; gap: 8px; max-width: 580px; }
.ob-option { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 52px; padding: 10px 14px; border: 1px solid var(--line-strong);
  border-radius: var(--radius); background: var(--white); color: var(--ink); font-size: 16px; font-weight: 500; text-align: left; box-shadow: var(--ob-shadow); }
.ob-option:hover:not(:disabled) { border-color: var(--navy); background: var(--soft); }
.ob-option.is-on { border-color: var(--navy); background: var(--soft); box-shadow: inset 0 0 0 1px var(--navy); }
.ob-key { display: grid; place-items: center; flex: 0 0 26px; height: 26px; border: 1px solid var(--line-strong); border-radius: 4px;
  background: var(--white); color: var(--navy); font-size: 12px; font-weight: 700; }
.ob-option.is-on .ob-key { border-color: var(--navy); background: var(--navy); color: var(--white); }
.ob-option-copy { display: flex; flex: 1; flex-direction: column; gap: 2px; min-width: 0; }
.ob-option-copy strong { font-weight: 600; }
.ob-option-copy span { color: var(--muted); font-size: 13px; font-weight: 400; line-height: 1.45; }
.ob-tick { visibility: hidden; color: var(--navy); font-weight: 700; }
.ob-option.is-on .ob-tick { visibility: visible; }

/* Choices with a picture (logo and icon from the website). */
.ob-options-pictures { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); max-width: none; }
.ob-options-pictures .ob-option { position: relative; flex-direction: column; align-items: stretch; justify-content: flex-start; padding: 46px 12px 12px; }
.ob-options-pictures .ob-key { position: absolute; top: 10px; left: 12px; }
.ob-options-pictures .ob-tick { position: absolute; top: 12px; right: 14px; }
.ob-picture { display: grid; place-items: center; height: 120px; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); }
.ob-picture img { display: block; max-width: 100%; max-height: 100%; object-fit: contain; }
.ob-picture-icon img { width: 64px; height: 64px; }
.ob-status { display: flex; align-items: center; gap: 10px; margin: 0; color: var(--navy); font-size: 15px; }
.ob-quiet { margin: 0; color: var(--muted); font-size: 14px; }

/* Lists: calls to action, rules, facts, products. */
.ob-stack { display: flex; flex-direction: column; align-items: stretch; gap: 14px; }
.ob-stack > button { align-self: flex-start; }
.ob-rows { display: flex; flex-direction: column; gap: 8px; }
.ob-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.ob-fact { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: start; padding: 12px; border: 1px solid var(--line);
  border-radius: var(--radius); background: var(--white); }
.ob-fact p { margin: 0 0 2px; color: var(--ink); }
.ob-fact a { overflow-wrap: anywhere; }
.ob-product { display: grid; grid-template-columns: auto minmax(0, 1fr) minmax(0, 2fr); gap: 8px; align-items: center; }
.ob-fact.is-off, .ob-product.is-off { opacity: .55; }
.ob-fact input[type="checkbox"], .ob-product input[type="checkbox"], .ob-check input { width: 20px; min-height: 20px; height: 20px; margin: 2px 0 0; flex: none; }
.ob-check { display: flex; align-items: center; gap: 6px; margin: 0; font-size: 14px; white-space: nowrap; }

/* The look: files and colours. */
.ob-thumbs { display: flex; flex-wrap: wrap; gap: 12px; }
.ob-thumbs:empty { display: none; }
.ob-thumb { display: flex; flex-direction: column; align-items: center; gap: 4px; margin: 0; }
.ob-thumb .ob-picture { width: 120px; height: 120px; }
.ob-remove { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.ob-colors { display: grid; gap: 12px; max-width: 460px; }
.ob-color { display: grid; grid-template-columns: 48px minmax(0, 1fr) 120px; gap: 12px; align-items: center; }
.ob-color label { margin: 0; font-size: 15px; font-weight: 500; }
.ob-color input[type="color"] { width: 48px; height: 40px; min-height: 40px; padding: 2px; border-radius: var(--radius); }

/* The review before finishing. */
.ob-review { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.ob-review-group { padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); box-shadow: var(--ob-shadow); }
.ob-review-group h3 { margin: 0 0 6px; font-size: 15px; }
.ob-review dl { margin: 0; }
.ob-review-row { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: 8px; padding: 6px 0; border-top: 1px solid var(--line); font-size: 14px; }
.ob-review-row:first-child { border-top: 0; }
.ob-review dt { color: var(--muted); }
.ob-review dd { display: flex; align-items: flex-start; gap: 6px; min-width: 0; margin: 0; color: var(--ink); overflow-wrap: anywhere; }
.ob-review dd > span:first-child { flex: 1; min-width: 0; }
.ob-review dd.is-empty > span { color: var(--muted); font-style: italic; }
.ob-review dd .button-text { flex: none; min-height: 28px; margin: -3px 0 -3px auto; padding: 2px 6px; }
.ob-review dd .ob-swatch:last-of-type { margin-right: auto; }
.ob-swatch { display: inline-block; width: 20px; height: 20px; border: 1px solid var(--line-strong); border-radius: 50%; }

.ob-foot { position: sticky; bottom: 0; z-index: 2; display: flex; align-items: center; gap: 12px; padding: 10px var(--ob-gutter) max(10px, env(safe-area-inset-bottom)); background: var(--paper); }
.ob-position { margin: 0; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.ob-saved { margin: 0 auto 0 0; color: var(--green); font-size: 13px; }
.ob-nav { display: flex; gap: 4px; }
.ob-nav .button-square { flex: 0 0 40px; width: 40px; min-height: 40px; font-size: 18px; }
.ob-sr { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* Moving between questions: about 250 ms, off for people who ask for less motion. */
.ob-out-up, .ob-out-down { pointer-events: none; }
.ob-in-up { animation: ob-in-up var(--ob-time) ease-out both; }
.ob-in-down { animation: ob-in-down var(--ob-time) ease-out both; }
.ob-out-up { animation: ob-out-up var(--ob-time) ease-in both; }
.ob-out-down { animation: ob-out-down var(--ob-time) ease-in both; }
@keyframes ob-in-up { from { opacity: 0; transform: translateY(var(--ob-move)); } }
@keyframes ob-in-down { from { opacity: 0; transform: translateY(calc(-1 * var(--ob-move))); } }
@keyframes ob-out-up { to { opacity: 0; transform: translateY(calc(-1 * var(--ob-move))); } }
@keyframes ob-out-down { to { opacity: 0; transform: translateY(var(--ob-move)); } }
@keyframes ob-pulse { 50% { opacity: .3; } }
@media (prefers-reduced-motion: reduce) {
  .ob-in-up, .ob-in-down, .ob-out-up, .ob-out-down, .ob-agent.is-running::before, .ob-status::before { animation: none; }
  .ob-progress span { transition: none; }
}

@media (max-width: 760px) {
  .ob-stage { align-items: start; padding: 16px 16px 24px; }
  .ob-top { padding: 10px 16px 6px; }
  .ob-agent { display: none; }
  .ob-control { margin-top: 20px; }
  .ob-actions { margin-top: 20px; }
  .ob-foot { position: static; padding: 8px 16px max(12px, env(safe-area-inset-bottom)); }
  .ob-product { grid-template-columns: auto minmax(0, 1fr); }
  .ob-product > input:last-child { grid-column: 2; }
  .ob-fact { grid-template-columns: auto minmax(0, 1fr); }
  .ob-fact > .ob-check { grid-column: 2; }
  .ob-review { grid-template-columns: minmax(0, 1fr); }
  .ob-options-pictures { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ob-picture { height: 96px; }
  .ob-color { grid-template-columns: 44px minmax(0, 1fr) 104px; }
}
