/* Tributes Link: tribute builder */
body.builder { background: var(--cream); }
.b-top { position: sticky; top: 0; z-index: 40; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 12px 28px; background: rgba(251,247,241,.92); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.b-brand img { height: 40px; width: auto; }
.b-save { display: flex; align-items: center; gap: 8px; font-size: .85rem; color: var(--muted); }
.b-save .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--sage); }
.b-save.saving .dot { background: var(--gold); animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .3; } }
.b-exit { font-size: .9rem; color: var(--muted); }

.b-shell { display: grid; grid-template-columns: 250px minmax(0, 1fr) 380px; gap: 40px; width: min(1400px, 100%); margin: 0 auto; padding: 40px 28px 80px; align-items: start; }

/* Steps rail */
.b-steps { position: sticky; top: 100px; }
.b-steps ol { list-style: none; margin: 0 0 30px; padding: 0; display: grid; gap: 4px; }
.b-steps li { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 12px; color: var(--muted); font-size: .95rem; cursor: pointer; transition: background .3s, color .3s; }
.b-steps li span { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: .8rem; font-weight: 600; border: 1px solid var(--line); background: var(--white); flex: none; transition: all .3s; }
.b-steps li:hover { background: rgba(255,255,255,.7); }
.b-steps li.on { background: var(--white); color: var(--navy); font-weight: 600; box-shadow: var(--shadow-sm); }
.b-steps li.on span { background: var(--navy); color: #fff; border-color: var(--navy); }
.b-steps li.done span { background: var(--gold); border-color: var(--gold); color: #fff; }
.b-help { background: var(--sand); border-radius: 16px; padding: 20px; font-size: .9rem; color: var(--muted); }
.b-help strong { color: var(--navy); font-family: var(--serif); font-size: 1.2rem; font-weight: 500; }
.b-help p { margin: 6px 0 0; }

/* Main form */
.b-main { background: var(--white); border-radius: var(--radius-lg); padding: 48px 52px; box-shadow: var(--shadow); min-height: 70vh; }
.step { display: none; animation: stepIn .6s var(--ease) both; }
.step.on { display: block; }
@keyframes stepIn { from { opacity: 0; transform: translateY(14px); } }
.b-kicker { font-size: .76rem; letter-spacing: .22em; text-transform: uppercase; color: var(--gold); font-weight: 600; margin: 0 0 10px; }
.step h1 { font-size: clamp(2.2rem, 3.6vw, 3rem); }
.b-lead { color: var(--muted); font-size: 1.05rem; max-width: 58ch; margin-bottom: 32px; }
.sub-h { font-size: 1.5rem; margin: 30px 0 14px; }
.sub-h i, .f i { font-family: var(--sans); font-style: normal; font-weight: 400; color: var(--muted); font-size: .85rem; }

.f { display: block; font-weight: 600; font-size: .92rem; color: var(--navy); margin-bottom: 20px; position: relative; }
.f.short { max-width: 260px; }
.f input, .f textarea { display: block; margin-top: 8px; }
.f input, .f textarea, .ms-row input, .gal-item input { width: 100%; border: 1px solid rgba(31,42,68,.16); background: var(--cream); border-radius: 12px; padding: 13px 15px; font-weight: 400; font-size: 1rem; transition: border-color .3s, box-shadow .3s, background .3s; }
.f input:focus, .f textarea:focus, .ms-row input:focus, .gal-item input:focus { outline: none; border-color: var(--gold); background: #fff; box-shadow: 0 0 0 4px rgba(184,148,90,.15); }
.f textarea { resize: vertical; line-height: 1.6; }
.count { position: absolute; right: 12px; bottom: 10px; font-size: .75rem; color: var(--muted); font-weight: 400; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }

.kind-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 28px; }
.kind input, .theme input { position: absolute; opacity: 0; pointer-events: none; }
.kind span { display: flex; align-items: center; gap: 14px; padding: 20px 22px; border: 1.5px solid var(--line); border-radius: 16px; cursor: pointer; font-family: var(--serif); font-size: 1.45rem; color: var(--navy); transition: all .3s var(--ease); }
.kind svg { width: 30px; height: 30px; fill: none; stroke: var(--gold); stroke-width: 1.5; stroke-linecap: round; }
.kind input:checked + span { border-color: var(--navy); background: var(--cream); box-shadow: 0 0 0 3px rgba(31,42,68,.08); }
.kind input:focus-visible + span { outline: 2px solid var(--gold); outline-offset: 2px; }
.pet-only { display: none; }
body.is-pet .pet-only { display: inline; } body.is-pet .person-only { display: none; }

/* Photos */
.portrait-pick { display: grid; grid-template-columns: 150px 1fr; gap: 26px; align-items: center; margin-bottom: 30px; padding: 22px; border-radius: 18px; background: var(--cream); }
.portrait-pick h3 { font-size: 1.4rem; margin-bottom: 4px; }
.portrait-pick p { color: var(--muted); font-size: .95rem; }
.portrait-drop { width: 150px; aspect-ratio: 4 / 5; border-radius: 999px 999px 18px 18px; border: 1.5px dashed var(--gold-soft); display: grid; place-items: center; overflow: hidden; cursor: pointer; background: #fff; color: var(--gold); font-weight: 600; font-size: .9rem; }
.portrait-drop img { width: 100%; height: 100%; object-fit: cover; }
.dropzone { display: grid; justify-items: center; gap: 6px; text-align: center; padding: 40px 20px; border: 1.5px dashed rgba(31,42,68,.22); border-radius: 18px; cursor: pointer; transition: background .3s, border-color .3s; color: var(--muted); }
.dropzone svg { width: 36px; height: 36px; fill: none; stroke: var(--gold); stroke-width: 1.5; stroke-linecap: round; margin-bottom: 6px; }
.dropzone strong { color: var(--navy); font-family: var(--serif); font-size: 1.4rem; font-weight: 500; }
.dropzone.over { background: var(--sky-soft); border-color: var(--navy); }
.b-tip { font-size: .9rem; color: var(--muted); margin: 14px 0 20px; }
.gal-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px; }
.gal-item { background: var(--cream); border-radius: 14px; overflow: hidden; animation: stepIn .5s var(--ease) both; }
.gal-item .gi-img { position: relative; aspect-ratio: 4 / 3; }
.gal-item img { width: 100%; height: 100%; object-fit: cover; }
.gal-item .gi-tools { position: absolute; top: 8px; right: 8px; display: flex; gap: 6px; }
.gal-item .gi-tools button { width: 30px; height: 30px; border-radius: 50%; border: 0; background: rgba(255,255,255,.92); color: var(--navy); font-size: .95rem; line-height: 1; display: grid; place-items: center; box-shadow: var(--shadow-sm); }
.gal-item input { border-radius: 0; border: 0; border-top: 1px solid var(--line); font-size: .88rem; padding: 10px 12px; }
.gal-count { grid-column: 1 / -1; font-size: .88rem; color: var(--muted); }

/* Song */
.yt-status { font-size: .9rem; margin: -10px 0 18px; min-height: 1.3em; }
.yt-status.ok { color: var(--sage); } .yt-status.bad { color: #b0574f; }
.yt-preview { border-radius: 16px; overflow: hidden; aspect-ratio: 16 / 9; background: #000; max-width: 560px; }
.yt-preview iframe { width: 100%; height: 100%; border: 0; display: block; }

/* Story */
.ms-list { display: grid; gap: 10px; margin-bottom: 8px; }
.ms-row { display: grid; grid-template-columns: 110px 1fr 40px; gap: 10px; }
.ms-row button { border: 0; background: none; color: var(--muted); font-size: 1.4rem; }
.link-btn { border: 0; background: none; color: var(--gold); font-weight: 600; padding: 6px 0; margin-bottom: 24px; }
.opt-block { border: 1px solid var(--line); border-radius: 16px; padding: 4px 20px; margin-bottom: 14px; }
.opt-block summary { cursor: pointer; padding: 14px 0; font-weight: 600; color: var(--navy); list-style: none; }
.opt-block summary::before { content: "+ "; color: var(--gold); }
.opt-block[open] summary::before { content: "− "; }
.opt-block[open] { padding-bottom: 6px; }

/* Themes */
.themes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 10px; }
.theme { display: grid; gap: 4px; padding: 14px; border: 1.5px solid var(--line); border-radius: 16px; cursor: pointer; position: relative; transition: all .3s var(--ease); }
.theme .sw { height: 80px; border-radius: 10px; background: linear-gradient(135deg, var(--a) 0 55%, var(--b) 55% 75%, var(--c) 75%); border: 1px solid var(--line); margin-bottom: 8px; }
.theme strong { font-family: var(--serif); font-size: 1.3rem; font-weight: 500; color: var(--navy); }
.theme small { color: var(--muted); font-size: .82rem; line-height: 1.3; }
.theme:has(input:checked) { border-color: var(--navy); box-shadow: 0 0 0 3px rgba(31,42,68,.08); }
.radios { display: grid; gap: 10px; margin-bottom: 24px; }
.radios label { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; cursor: pointer; font-size: .96rem; color: var(--muted); transition: border-color .3s, background .3s; }
.radios label:has(input:checked) { border-color: var(--navy); background: var(--cream); }
.radios strong { color: var(--navy); }
.radios input { accent-color: var(--navy); margin-top: 4px; }
.toggle { display: flex; align-items: center; gap: 14px; cursor: pointer; font-weight: 600; color: var(--navy); }
.toggle input { position: absolute; opacity: 0; }
.toggle span { width: 46px; height: 26px; border-radius: 999px; background: rgba(31,42,68,.18); position: relative; transition: background .3s; flex: none; }
.toggle span::after { content: ""; position: absolute; left: 3px; top: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .3s var(--ease); box-shadow: var(--shadow-sm); }
.toggle input:checked + span { background: var(--sage); }
.toggle input:checked + span::after { transform: translateX(20px); }

/* Review */
.review-checks { display: grid; gap: 10px; margin-bottom: 22px; }
.rc { display: flex; gap: 12px; align-items: center; font-size: .96rem; }
.rc .ic { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: .8rem; color: #fff; background: var(--sage); flex: none; }
.rc.todo .ic { background: transparent; border: 1.5px solid var(--gold-soft); color: var(--gold); }
.rc.todo { color: var(--muted); }
.rc a { color: var(--gold); font-weight: 600; cursor: pointer; }
.checkout { margin-top: 34px; background: linear-gradient(160deg, #fffdf9, #f6efe4); border-radius: 20px; padding: 30px; border: 1px solid var(--line); }
.region-toggle { display: inline-flex; background: var(--white); border: 1px solid var(--line); border-radius: 999px; padding: 4px; margin-bottom: 18px; }
.region-toggle button { border: 0; background: transparent; padding: 8px 18px; border-radius: 999px; font-weight: 600; font-size: .88rem; color: var(--muted); }
.region-toggle button[aria-selected="true"] { background: var(--navy); color: #fff; }
.co-row, .co-total { display: flex; justify-content: space-between; gap: 20px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.co-row strong { color: var(--navy); }
.co-total { border: 0; font-size: 1.15rem; padding-top: 18px; }
.co-total strong { font-family: var(--serif); font-size: 2rem; color: var(--navy); font-weight: 500; }
.co-btn { width: 100%; margin-top: 14px; white-space: normal; }
.co-note { font-size: .85rem; color: var(--muted); text-align: center; margin: 12px 0 0; }

.b-nav { display: flex; justify-content: space-between; margin-top: 40px; padding-top: 26px; border-top: 1px solid var(--line); }
.b-nav .hidden { visibility: hidden; }

/* Live preview phone */
.b-preview { position: sticky; top: 96px; }
.phone { width: 330px; height: 680px; margin: 0 auto; border-radius: 46px; background: #0e1424; padding: 12px; box-shadow: var(--shadow-lg), inset 0 0 0 2px #2a3350; position: relative; }
.phone-notch { position: absolute; top: 20px; left: 50%; transform: translateX(-50%); width: 92px; height: 26px; border-radius: 20px; background: #0e1424; z-index: 3; }
.phone-screen { height: 100%; border-radius: 36px; overflow-y: auto; overflow-x: hidden; scrollbar-width: none; background: var(--pbg); color: var(--ptext); --pbg: #fbf7f1; --pbg2: #f3ece2; --ptext: #2b2f38; --phead: #1f2a44; --pacc: #b8945a; --pcard: #fff; transition: background .5s; }
.phone-screen::-webkit-scrollbar { display: none; }
.phone[data-theme="sky"] .phone-screen { --pbg: #f5f8fc; --pbg2: #e7eef7; --phead: #22385a; --pacc: #5f87b3; }
.phone[data-theme="evergreen"] .phone-screen { --pbg: #f6f6f0; --pbg2: #e9ece2; --phead: #2f4a36; --pacc: #6b8f71; }
.phone[data-theme="night"] .phone-screen { --pbg: #141c30; --pbg2: #1b2540; --ptext: #e6e9f2; --phead: #fff; --pacc: #d9c39a; --pcard: #212c4a; }
.pv-hero { text-align: center; padding: 64px 22px 26px; background: linear-gradient(180deg, var(--pbg2), var(--pbg)); }
.pv-portrait { width: 120px; aspect-ratio: 4 / 5; margin: 0 auto 16px; border-radius: 999px 999px 14px 14px; background: var(--pbg2) center 22% / cover; border: 4px solid var(--pcard); box-shadow: 0 16px 30px -16px rgba(0,0,0,.5); }
.pv-kicker { font-size: .58rem; letter-spacing: .24em; text-transform: uppercase; color: var(--pacc); font-weight: 600; margin: 0 0 4px; }
.pv-name { font-size: 1.9rem; color: var(--phead); margin: 0; word-wrap: break-word; }
.pv-known { font-family: var(--serif); font-style: italic; color: var(--pacc); margin: 0; font-size: 1.05rem; }
.pv-dates { font-family: var(--serif); font-size: .95rem; opacity: .7; margin: 6px 0 10px; letter-spacing: .06em; }
.pv-epitaph { font-family: var(--serif); font-style: italic; font-size: 1rem; line-height: 1.4; margin: 0; }
.pv-gallery { margin: 0 16px; aspect-ratio: 3 / 2; border-radius: 14px; background: var(--pbg2) center / cover; position: relative; overflow: hidden; transition: background-image .8s; }
.pv-gallery:empty::after { content: "Gallery"; position: absolute; inset: 0; display: grid; place-items: center; font-size: .8rem; color: var(--pacc); opacity: .7; }
.pv-song { display: flex; gap: 12px; align-items: center; margin: 14px 16px; padding: 12px; border-radius: 14px; background: var(--pcard); }
.pv-song small { display: block; font-size: .6rem; letter-spacing: .16em; text-transform: uppercase; color: var(--pacc); }
.pv-song strong { font-size: .85rem; color: var(--phead); }
.pv-disc { width: 36px; height: 36px; border-radius: 50%; background: repeating-radial-gradient(circle, #111 0 1px, #2a2a2a 1px 3px); flex: none; animation: spin 5s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.pv-story { padding: 6px 22px; font-size: .8rem; line-height: 1.6; opacity: .85; }
.pv-story p { margin: 0 0 .8em; }
.pv-candle { margin: 10px 16px 30px; text-align: center; padding: 12px; border-radius: 999px; background: var(--pacc); color: #fff; font-size: .8rem; font-weight: 600; }
.pv-caption { text-align: center; font-size: .8rem; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); margin-top: 16px; }

/* Pay modal reuses tribute sheet look */
.sheet { position: fixed; inset: 0; z-index: 120; background: rgba(10,14,26,.55); display: grid; place-items: center; padding: 20px; backdrop-filter: blur(4px); }
.sheet[hidden] { display: none; }
.sheet-card { position: relative; background: #fff; border-radius: 24px; padding: 40px 36px; width: min(460px, 100%); text-align: center; box-shadow: var(--shadow-lg); animation: stepIn .5s var(--ease) both; }
.sheet-card p { color: var(--muted); }
.sheet-close { position: absolute; top: 14px; right: 16px; border: 0; background: none; font-size: 2rem; color: var(--muted); }
.pay-mark { width: 70px; margin: 0 auto 10px; }

@media (max-width: 1240px) {
  .b-shell { grid-template-columns: 210px minmax(0, 1fr); }
  .b-preview { display: none; }
}
@media (max-width: 860px) {
  .b-shell { grid-template-columns: 1fr; padding: 16px 14px 60px; gap: 16px; }
  .b-steps { position: static; }
  .b-steps ol { display: flex; overflow-x: auto; gap: 6px; margin-bottom: 0; scrollbar-width: none; }
  .b-steps li { white-space: nowrap; padding: 8px 12px; font-size: .85rem; }
  .b-help { display: none; }
  .b-main { padding: 30px 22px; border-radius: 20px; }
  .grid2, .kind-pick { grid-template-columns: 1fr; }
  .themes { grid-template-columns: 1fr 1fr; }
  .portrait-pick { grid-template-columns: 110px 1fr; padding: 16px; gap: 16px; }
  .portrait-drop { width: 110px; }
  .b-save span:last-child { display: none; }
  .b-top { padding: 10px 16px; }
  .b-brand img { height: 36px; }
}
