/* header */
.studio-header { position: sticky; top: 0; z-index: 30; background: color-mix(in srgb, var(--cream) 94%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.studio-bar { display: flex; align-items: center; gap: 18px; min-height: 68px; }
.back-home { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; text-decoration: none; font-size: 20px; }
.back-home:hover { background: var(--cream-2); }
.progress { display: flex; gap: 4px; list-style: none; margin: 0 auto; padding: 0; }
.progress button { border: 0; background: none; padding: 8px 10px; border-radius: 6px; font: 500 13px/1 var(--sans); color: var(--muted); cursor: pointer; border-bottom: 2.5px solid transparent; border-radius: 0; }
.progress button span { font: 500 11px var(--mono); margin-right: 4px; }
.progress button[aria-current="step"] { color: var(--ink); font-weight: 700; border-bottom-color: var(--ink); }
.progress button.is-done { color: var(--ink); }
.progress button:disabled { cursor: default; opacity: .55; }
@media (max-width: 1000px) {
  .help-link { display: none; }
  .progress button { padding: 8px 6px; font-size: 0; }
  .progress button span { font-size: 12px; margin: 0; }
  .progress button[aria-current="step"] { font-size: 13px; }
  .progress button[aria-current="step"] span { margin-right: 4px; }
}
@media (max-width: 520px) { .brand-text { display: none; } .studio-bar { gap: 8px; } }

/* layout */
.studio { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: clamp(24px, 4vw, 48px); align-items: start; padding-top: clamp(24px, 4vw, 48px); padding-bottom: 96px; }
.studio-main > section { display: grid; gap: 18px; align-content: start; }
.studio-title { font-size: clamp(40px, 5vw, 68px); }
.hint { margin-top: -4px; }
.lineup { position: sticky; top: 92px; }
.lineup-card { background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 22px; display: grid; gap: 14px; box-shadow: var(--shadow-soft); }
.lineup-title { font-size: 32px; line-height: 1; }
.lineup-meta { display: flex; justify-content: space-between; border-bottom: 1px solid var(--line); padding-bottom: 10px; }
.lineup-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; max-height: 300px; overflow: auto; }
.lineup-list li { display: grid; grid-template-columns: 40px 1fr auto; gap: 10px; align-items: center; font-size: 14px; font-weight: 600; }
.lineup-list img { width: 40px; aspect-ratio: 4/5; object-fit: cover; border-radius: 3px; }
.lineup-list .free { display: block; font: 500 10.5px var(--mono); color: var(--muted); font-weight: 500; }
.lineup-list button { border: 0; background: none; width: 30px; height: 30px; border-radius: 50%; cursor: pointer; font-size: 18px; color: var(--muted); }
.lineup-list button:hover { background: var(--cream-2); color: var(--ink); }
.lineup-empty { font-family: var(--serif); font-style: italic; font-size: 18px; color: var(--muted); line-height: 1.3; }
.totals { margin: 0; display: grid; gap: 6px; font-size: 14px; }
.totals div { display: flex; justify-content: space-between; gap: 12px; }
.totals dt { color: var(--muted); } .totals dd { margin: 0; font-weight: 600; }
.totals .grand { border-top: 1px solid var(--line); padding-top: 10px; margin-top: 4px; font-size: 17px; }
.totals .grand dt { color: var(--ink); font-weight: 700; }
.back-step { justify-self: center; }
.linklike { border: 0; background: none; padding: 4px 0; cursor: pointer; text-decoration: underline; }
.lineup-foot { text-align: center; }
.mobile-bar { display: none; }
@media (max-width: 900px) {
  .studio { grid-template-columns: minmax(0, 1fr); padding-bottom: 120px; }
  .lineup { position: static; }
  .lineup #next-step { display: none; }
  .mobile-bar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; align-items: center; justify-content: space-between; gap: 12px; padding: 12px var(--gutter) calc(12px + env(safe-area-inset-bottom)); background: var(--paper); border-top: 1.5px solid var(--ink); }
  .mobile-bar div { display: grid; line-height: 1.25; }
  .mobile-bar .btn { flex: none; max-width: 62%; }
}

/* filters + look picker */
.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.pick-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.pick { position: relative; display: grid; gap: 4px; text-align: left; border: 0; padding: 0; background: none; cursor: pointer; }
.pick .img { position: relative; border-radius: 8px; overflow: hidden; outline: 2.5px solid transparent; outline-offset: 3px; transition: outline-color .15s; }
.pick img { width: 100%; aspect-ratio: 4/5; object-fit: cover; transition: transform .45s var(--ease); }
.pick:hover img { transform: scale(1.03); }
.pick .badge { position: absolute; left: 10px; top: 10px; }
.pick .toggle { position: absolute; right: 10px; top: 10px; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--paper); border: 1.5px solid var(--ink); font: 700 18px/1 var(--sans); transition: background .15s, transform .15s var(--ease); }
.pick[aria-pressed="true"] .img { outline-color: var(--ink); }
.pick[aria-pressed="true"] .toggle { background: var(--lime); transform: rotate(0); }
.pick .order { position: absolute; left: 10px; bottom: 10px; background: var(--ink); color: var(--cream); font: 500 11px var(--mono); padding: 4px 7px; border-radius: 4px; }
.pick strong { margin-top: 8px; font-size: 15.5px; }
.pick .line { font-size: 14px; color: var(--muted); }
@media (max-width: 1100px) { .pick-grid { grid-template-columns: repeat(2, 1fr); gap: 14px; } }

/* form bits */
.field { display: grid; gap: 6px; font-weight: 600; font-size: 14.5px; }
.field-label { font-weight: 600; font-size: 14.5px; padding: 0; margin-bottom: 8px; }
.field input, .field select, .field textarea { width: 100%; min-height: 48px; padding: 11px 14px; border: 1.5px solid var(--ink); border-radius: var(--radius); background: var(--paper); font-weight: 400; font-size: 16px; }
.field textarea { resize: vertical; min-height: 84px; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 3px solid var(--lime-2); outline-offset: 0; }
[aria-invalid="true"] { border-color: var(--rose) !important; background: #fff6f6 !important; }
.field-error { color: #a3273f; font-size: 14px; font-weight: 600; min-height: 0; }
.field-error:empty { display: none; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.check { display: flex; gap: 12px; align-items: flex-start; font-size: 15px; cursor: pointer; }
.check input { width: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--ink); flex: none; }
@media (max-width: 560px) { .row-2 { grid-template-columns: 1fr; } }

/* uploads */
.uploads { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; max-width: 600px; }
.upload { display: grid; gap: 10px; align-content: start; }
.drop { position: relative; display: grid; place-items: center; aspect-ratio: 4/5; border: 2px dashed var(--ink); border-radius: 10px; background: var(--paper); cursor: pointer; overflow: hidden; transition: background .15s; }
.drop:hover, .drop.is-over { background: #fff; }
.drop:focus-within { outline: 3px solid var(--ink); outline-offset: 3px; }
.drop img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.drop-empty { display: grid; justify-items: center; gap: 4px; text-align: center; padding: 12px; }
.drop .plus { width: 48px; height: 48px; border-radius: 50%; background: var(--lime); border: 1.5px solid var(--ink); display: grid; place-items: center; font-size: 26px; margin-bottom: 6px; }
.drop.has-photo { border-style: solid; }
.tips { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.tips li { background: var(--sage); border-radius: 10px; padding: 12px 14px; font-size: 14px; }
.tips strong { display: block; }
@media (max-width: 640px) { .uploads { gap: 12px; } .tips { grid-template-columns: 1fr; } }

/* previews */
.preview-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.preview-card { margin: 0; }
.preview-card:nth-child(3n+1) { transform: rotate(-1deg); } .preview-card:nth-child(3n+3) { transform: rotate(1deg); }
.preview-card .watermarked img { filter: saturate(.95); }
.preview-card.is-locked .watermarked img { filter: blur(6px) saturate(.7); transform: scale(1.06); }
.preview-card .meta { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 6px 8px; padding: 8px 2px 12px; }
.preview-card .meta strong { font-family: var(--serif); font-style: italic; font-weight: 400; font-size: 19px; line-height: 1.1; }
.made-from { position: absolute; right: 18px; top: 18px; display: flex; }
.made-from img { width: 34px; height: 34px; aspect-ratio: auto; border-radius: 50%; border: 2px solid var(--paper); object-fit: cover; margin-left: -8px; box-shadow: 0 2px 6px rgba(0,0,0,.2); }
.lock-note { position: absolute; inset: 10px 10px auto; top: 40%; text-align: center; font: 600 13px var(--sans); color: #fff; text-shadow: 0 1px 6px rgba(0,0,0,.5); }
@media (max-width: 1100px) { .preview-grid { grid-template-columns: repeat(2, 1fr); gap: 16px; } }

/* keepsakes */
.included { display: flex; align-items: center; gap: 14px; padding: 14px 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); }
.included strong { font-size: 16px; }
.nudge { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 16px; border: 1.5px dashed var(--ink); border-radius: 12px; background: #fbffd4; font-size: 15px; }
.keepsake-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.ks-card { display: grid; grid-template-rows: auto 1fr; border: 1.5px solid var(--line); border-radius: 14px; background: var(--paper); overflow: hidden; transition: border-color .15s, box-shadow .15s; }
.ks-card .mockup { border-radius: 0; }
.ks-card.is-on { border-color: var(--ink); box-shadow: var(--shadow-hard); }
.ks-body { display: grid; gap: 6px; align-content: start; padding: 14px 16px 16px; }
.ks-body .badge { justify-self: start; }
.ks-name { font: 700 17px/1.2 var(--sans); }
.ks-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 4px; }
.ks-price { font: 400 26px/1 var(--display); }
.ks-picker { margin-top: 8px; }
.ks-picker .cover-pick img { width: 40px; }

/* preview states */
.preview-card.is-queued .watermarked img, .preview-card.is-working .watermarked img { filter: blur(5px) saturate(.6); transform: scale(1.05); }
.lock-note { display: grid; justify-items: center; gap: 8px; }

/* book designer */
.designer { display: grid; gap: 18px; background: var(--blush); border-radius: 18px; padding: clamp(18px, 3vw, 32px); border: 1px solid var(--line); }
.designer-head { display: grid; gap: 4px; }
.designer-controls { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 20px; align-items: start; }
.designer-controls .field--wide { grid-column: 1 / -1; }
.swatches > div { display: flex; gap: 10px; flex-wrap: wrap; }
.swatch { position: relative; }
.swatch input { position: absolute; opacity: 0; }
.swatch span { display: block; width: 40px; height: 40px; border-radius: 50%; border: 1.5px solid var(--ink); cursor: pointer; box-shadow: inset 0 0 0 3px var(--paper); }
.swatch input:checked + span { outline: 2.5px solid var(--ink); outline-offset: 3px; }
.swatch input:focus-visible + span { outline: 3px solid var(--rose); outline-offset: 3px; }
.cover-picks { display: flex; gap: 8px; flex-wrap: wrap; }
.cover-pick input { position: absolute; opacity: 0; }
.cover-pick img { width: 52px; aspect-ratio: 4/5; object-fit: cover; border-radius: 4px; cursor: pointer; border: 2px solid transparent; }
.cover-pick input:checked + img { border-color: var(--ink); box-shadow: 2px 2px 0 var(--ink); }
.cover-pick input:focus-visible + img { outline: 3px solid var(--rose); outline-offset: 2px; }
@media (max-width: 640px) { .designer-controls { grid-template-columns: 1fr; } }

/* review */
.review { display: grid; gap: 14px; background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 20px; }
.review-row { display: flex; justify-content: space-between; gap: 16px; font-size: 15px; flex-wrap: wrap; }
.review-row span:first-child { color: var(--muted); }
.review-thumbs { display: flex; gap: 6px; flex-wrap: wrap; }
.review-thumbs img { width: 46px; aspect-ratio: 4/5; object-fit: cover; border-radius: 3px; }
.lock-note .spinner { border-color: rgba(255,255,255,.45); border-top-color: #fff; }
.ks-price-wrap { display: grid; gap: 3px; }
@media (max-width: 560px) {
  .keepsake-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .ks-body { padding: 10px 10px 12px; }
  .ks-name { font-size: 15px; }
  .ks-foot { flex-direction: column; align-items: stretch; }
  .ks-picker .cover-pick img { width: 32px; }
}
.uploads.is-single { grid-template-columns: minmax(0, 300px); }

/* portrait packs */
.packs { display: grid; gap: 10px; }
.pack-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.pack { position: relative; cursor: pointer; }
.pack input { position: absolute; opacity: 0; }
.pack-body { display: grid; gap: 4px; align-content: start; height: 100%; padding: 14px 16px; border: 1.5px solid var(--line); border-radius: 14px; background: var(--paper); transition: border-color .15s, box-shadow .15s, background .15s; }
.pack-body .badge { justify-self: start; margin-bottom: 4px; }
.badge--ghost { background: transparent; border-color: var(--line); color: var(--muted); }
.pack-name { font: 700 16px/1.2 var(--sans); }
.pack-price { font: 400 32px/1 var(--display); }
.pack input:checked + .pack-body { border-color: var(--ink); background: #fffbe0; box-shadow: var(--shadow-hard); }
.pack input:focus-visible + .pack-body { outline: 3px solid var(--ink); outline-offset: 3px; }
.pack.is-disabled { cursor: not-allowed; }
.pack.is-disabled .pack-body { opacity: .45; }
@media (max-width: 560px) {
  .pack-options { gap: 8px; }
  .pack-body { padding: 10px; }
  .pack-name { font-size: 14px; }
  .pack-price { font-size: 26px; }
}

/* book under the previews */
.book-section { display: grid; gap: 18px; margin-top: 12px; padding: clamp(18px, 3vw, 32px); border-radius: 18px; background: var(--blush); border: 1px solid var(--line); }
.book-section-head { display: flex; justify-content: space-between; align-items: end; gap: 16px; flex-wrap: wrap; }
.book-section-head .h3 { margin: 6px 0 4px; }
@media (max-width: 560px) { .book-section, .designer { padding: 14px 10px; } }
/* very small phones: packs become rows, price on the right */
@media (max-width: 400px) {
  .pack-options { grid-template-columns: minmax(0, 1fr); }
  .pack-body { grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: 12px; }
  .pack-body .badge { grid-column: 1 / -1; }
  .pack-name, .pack-body .muted { grid-column: 1; }
  .pack-price { grid-column: 2; grid-row: 2 / span 2; }
}
/* phones held sideways: let the top bar scroll away so content gets the height */
@media (max-height: 500px) and (orientation: landscape) { .studio-header { position: static; } }
/* headings receive focus for screen readers when a step opens; they are not controls, so no ring */
.studio-title:focus { outline: none; }

/* previews: email box, step-by-step loader, keep button */
.email-capture { padding: 16px 18px; border: 1.5px solid var(--ink); border-radius: 14px; background: #fbffd4; display: grid; gap: 10px; }
.email-capture p { font-size: 15px; }
.ec-row { display: flex; gap: 10px; flex-wrap: wrap; margin: 10px 0 8px; }
.ec-row input { flex: 1 1 220px; min-height: 44px; padding: 10px 14px; border: 1.5px solid var(--ink); border-radius: var(--radius); background: var(--paper); font-size: 16px; }
.ec-done { font-weight: 600; }
.work { position: absolute; inset: 10px 10px auto; top: 34%; display: grid; justify-items: center; gap: 8px; padding: 0 12px; text-align: center; color: #fff; text-shadow: 0 1px 6px rgba(0,0,0,.5); }
.work .spinner { border-color: rgba(255,255,255,.45); border-top-color: #fff; }
.work-step { font: 600 14px/1.3 var(--sans); }
.work-bar { width: 70%; height: 4px; border-radius: 4px; background: rgba(255,255,255,.35); overflow: hidden; }
.work-bar i { display: block; height: 100%; width: 0; background: var(--lime); transition: width 1s linear; }
.work-time { font: 500 11px var(--mono); opacity: .9; }
.keep-btn { width: calc(100% - 4px); margin: 0 2px 12px; }
