/* Editor + start page · same language as the homepage: white, sindoor red accents, soft shadows, rounded pills */
:root { --paper: #fffdfb; --blush: #fdf1ee; --red: #c8102e; --red-deep: #8a0b1f; --ink: #1c1214; --muted: #6a5b57; --hair: #eee3df;
  --shadow: 0 1px 2px rgba(60,20,25,.05), 0 10px 28px rgba(60,20,25,.08); --lift: 0 2px 4px rgba(60,20,25,.06), 0 20px 44px rgba(60,20,25,.12);
  --maroon: #8a0b1f; }
* { box-sizing: border-box; min-width: 0; }
html, body { margin: 0; }
body { background: var(--paper); color: var(--ink); font: 16px/1.55 "Mukta", system-ui, sans-serif; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { font-family: "Cormorant Garamond", Georgia, serif; font-weight: 600; line-height: 1.08; margin: 0; }
.script { font-family: "Pinyon Script", cursive; font-weight: 400; color: var(--red); }
a { color: var(--red); }
:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; }
[hidden] { display: none !important; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 8px 22px; border: 0; border-radius: 999px;
  background: var(--red); color: #fff; font-weight: 600; text-decoration: none; cursor: pointer; transition: transform .15s, box-shadow .2s, background .2s; white-space: nowrap; }
.btn:hover { background: var(--red-deep); transform: translateY(-1px); box-shadow: 0 8px 20px rgba(200,16,46,.22); }
.btn.ghost { background: #fff; color: var(--ink); box-shadow: inset 0 0 0 1px #e3d3cf; }
.btn.ghost:hover { color: var(--red); box-shadow: inset 0 0 0 1px var(--red); }
.btn.small { min-height: 36px; padding: 4px 14px; font-size: .9rem; }
.btn.big { min-height: 54px; font-size: 1.05rem; }
.btn.wa { background: #1fa855; } .btn.wa:hover { background: #178a45; box-shadow: none; }
.btn:disabled { opacity: .55; cursor: wait; transform: none; }

/* ---------- top bar ---------- */
.top { position: sticky; top: 0; z-index: 30; height: 62px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 18px;
  background: rgba(255,253,251,.95); backdrop-filter: blur(8px); border-bottom: 1px solid var(--hair); }
.top-l { display: flex; align-items: center; gap: 16px; }
.back { text-decoration: none; color: var(--muted); font-size: .92rem; white-space: nowrap; } .back:hover { color: var(--red); }
.brand { text-decoration: none; color: var(--ink); font-family: "Cormorant Garamond", serif; font-weight: 600; font-size: 1.35rem; white-space: nowrap; }
.brand .script { font-size: 1.3em; }
.top-actions { display: flex; align-items: center; gap: 10px; }
.status { font-size: .8rem; font-weight: 700; letter-spacing: .04em; padding: 3px 12px; border-radius: 999px; background: #fff1d6; color: #8a5a00; white-space: nowrap; }
.status.live { background: #e2f0e8; color: #17663a; }
.saved { font-size: .85rem; color: var(--muted); white-space: nowrap; }
body.editing #my-link { display: none; }

/* ---------- start page ---------- */
.start { max-width: 1120px; margin: 0 auto; padding: 36px 20px 70px; }
.start-head { text-align: center; max-width: 720px; margin: 0 auto 34px; }
.kick { font-size: .76rem; letter-spacing: .2em; text-transform: uppercase; font-weight: 700; color: var(--red); margin: 0 0 10px; }
.start-head h1 { font-size: clamp(2.4rem, 5vw, 3.6rem); }
.start-head h1 .script { font-size: 1.15em; }
.sub { color: var(--muted); font-size: 1.05rem; margin: 12px auto 18px; max-width: 34em; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.chips span { background: var(--blush); color: var(--red-deep); border-radius: 999px; padding: 4px 14px; font-size: .88rem; font-weight: 500; }
.start-step { margin: 0 0 34px; }
.start-step h2 { font-size: 1.7rem; display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.start-step h2 .n { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--red); color: #fff; font: 700 1rem "Mukta", sans-serif; }
.themes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.tcard { position: relative; text-align: left; background: #fff; border: 0; border-radius: 20px; overflow: hidden; padding: 0; cursor: pointer; box-shadow: var(--shadow); transition: transform .25s, box-shadow .25s; }
.tcard:hover { transform: translateY(-4px); box-shadow: var(--lift); }
.tcard.on { box-shadow: 0 0 0 3px var(--red), var(--lift); }
.tcard .shot { position: relative; aspect-ratio: 4 / 5; overflow: hidden; background: #000; }
.tcard .shot iframe { position: absolute; top: 0; left: 0; width: 360px; height: 450px; border: 0; transform-origin: 0 0; pointer-events: none; }
.tcard .tick { position: absolute; top: 12px; right: 12px; width: 32px; height: 32px; border-radius: 50%; background: var(--red); color: #fff; display: none; place-items: center; font-weight: 700; z-index: 2; box-shadow: 0 0 0 3px #fff; }
.tcard.on .tick { display: grid; }
.tcard .info { padding: 14px 16px 16px; display: flex; justify-content: space-between; align-items: flex-end; gap: 10px; }
.tcard b { display: block; font-family: "Cormorant Garamond", serif; font-size: 1.45rem; font-weight: 600; line-height: 1.1; }
.tcard small { color: var(--muted); font-size: .86rem; }
.tcard a { font-size: .86rem; white-space: nowrap; }
.start-form { max-width: none; background: #fff; border-radius: 22px; padding: 26px; box-shadow: var(--shadow); }
.start-form .btn.big { width: 100%; margin-top: 6px; }
.err { color: var(--red); background: #fdeeec; border-radius: 10px; padding: 10px 14px; margin: 12px 0 0; }
.fine { color: var(--muted); font-size: .86rem; margin: 10px 0 0; text-align: center; }
.next { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.next div { background: var(--blush); border-radius: 18px; padding: 18px 18px 20px; }
.next b { display: block; font-family: "Cormorant Garamond", serif; font-size: 1.35rem; }
.next span { color: var(--muted); font-size: .92rem; }

/* ---------- form controls ---------- */
label { display: block; font-size: .86rem; font-weight: 500; color: #4a3d39; margin: 0 0 12px; }
input:not([type=checkbox]):not([type=color]):not([type=file]), select, textarea { display: block; width: 100%; margin-top: 5px; min-height: 44px; padding: 9px 12px; font-size: 16px;
  border: 1px solid #e3d3cf; border-radius: 12px; background: #fff; transition: border-color .15s, box-shadow .15s; }
textarea { min-height: 90px; resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { outline: 0; border-color: var(--red); box-shadow: 0 0 0 3px rgba(200,16,46,.12); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: .92rem; cursor: pointer; }
.check input { width: 18px; height: 18px; margin-top: 3px; accent-color: var(--red); flex: none; }
.hint, .help { color: var(--muted); font-size: .85rem; margin: 0 0 12px; }

/* ---------- editor layout ---------- */
.editor { display: grid; grid-template-columns: minmax(360px, 460px) minmax(0, 1fr); height: calc(100vh - 62px); height: calc(100dvh - 62px); }
.panel { display: flex; flex-direction: column; border-right: 1px solid var(--hair); background: #fff; min-height: 0; }
.ptabs { display: grid; grid-template-columns: repeat(3, 1fr); padding: 10px 14px 0; gap: 4px; border-bottom: 1px solid var(--hair); }
.ptabs button { border: 0; background: none; padding: 10px 6px 12px; font-weight: 600; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; }
.ptabs button.on { color: var(--red); border-bottom-color: var(--red); }
.pbody { overflow-y: auto; padding: 16px 16px 90px; flex: 1; scroll-behavior: smooth; }
.langbar { background: var(--blush); border-radius: 14px; padding: 10px 12px 8px; margin-bottom: 12px; }
.langbar label { display: flex; align-items: center; gap: 10px; margin: 0; font-weight: 600; }
.langbar select { margin: 0; width: auto; flex: 1; min-height: 38px; padding: 4px 10px; }
.langbar small { display: block; color: var(--muted); margin-top: 6px; font-size: .78rem; }

/* section rows */
.srow { background: #fff; border: 1px solid var(--hair); border-radius: 14px; margin-bottom: 8px; transition: box-shadow .2s, border-color .2s, opacity .2s; }
.srow.open { border-color: #e9c9cf; box-shadow: var(--shadow); }
.srow.off .shead b { color: #a3958f; text-decoration: line-through; text-decoration-color: #d9c9c4; }
.srow.dragging { opacity: .4; }
.srow.drop-before { box-shadow: 0 -3px 0 var(--red); }
.srow.drop-after { box-shadow: 0 3px 0 var(--red); }
.shead { display: flex; align-items: center; gap: 6px; padding: 6px 6px 6px 4px; min-height: 52px; }
.grip { width: 28px; height: 40px; display: grid; place-items: center; color: #b9a8a3; cursor: grab; flex: none; letter-spacing: -2px; font-size: 1rem; user-select: none; }
.grip.none { cursor: default; opacity: 0; }
.stitle { flex: 1; display: flex; flex-direction: column; text-align: left; border: 0; background: none; padding: 6px 4px; cursor: pointer; }
.stitle b { font-weight: 600; font-size: .98rem; }
.stitle small { color: var(--muted); font-size: .8rem; }
.always { font-size: .72rem; color: var(--muted); background: #f5efed; border-radius: 999px; padding: 1px 8px; margin-left: 6px; font-weight: 500; }
.ibtn { width: 38px; height: 38px; display: grid; place-items: center; border: 0; background: none; border-radius: 10px; cursor: pointer; color: #8f817c; flex: none; }
.ibtn:hover { background: #f8efed; color: var(--red); }
.ibtn svg { width: 19px; height: 19px; }
.chev { transition: transform .25s; }
.srow.open .chev { transform: rotate(180deg); }
.sbody { padding: 4px 14px 14px; border-top: 1px dashed var(--hair); }
.sbody .moves { display: flex; gap: 8px; justify-content: flex-end; margin: 4px 0 10px; }
.note { color: var(--muted); background: #faf6f4; border-radius: 10px; padding: 10px 12px; font-size: .86rem; margin: 10px 0; }
.lock { color: #8a5a00; background: #fff7e6; border-radius: 10px; padding: 10px 12px; font-size: .86rem; margin: 0 0 12px; }
.item { background: #fbf8f6; border-radius: 12px; padding: 12px 12px 2px; margin: 10px 0; border-left: 3px solid var(--red); }
.item:nth-child(3n+2) { border-left-color: #e0a100; } .item:nth-child(3n) { border-left-color: #2f8f5b; }
.item-head { display: flex; justify-content: space-between; align-items: center; font-weight: 600; font-size: .9rem; margin-bottom: 8px; }
.item-tools { display: flex; gap: 2px; }
.item-tools button { width: 32px; height: 32px; border: 0; background: #fff; border-radius: 8px; cursor: pointer; color: var(--muted); }
.item-tools button:hover { color: var(--red); }
.add { margin: 4px 0 6px; }
.colors { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.colors input[type=color] { width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; overflow: hidden; cursor: pointer; background: none; }
.round { width: 40px; height: 40px; border-radius: 50%; border: 1px dashed #d9c9c4; background: #fff; cursor: pointer; font-size: 1.1rem; }
.photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; }
.photos figure { position: relative; margin: 0; aspect-ratio: 1; border-radius: 10px; overflow: hidden; }
.photos img { width: 100%; height: 100%; object-fit: cover; }
.photos button { position: absolute; top: 4px; right: 4px; width: 28px; height: 28px; border-radius: 50%; border: 0; background: rgba(0,0,0,.6); color: #fff; cursor: pointer; }
.file { display: inline-flex; align-items: center; gap: 10px; }
.file input { position: absolute; width: 1px; height: 1px; opacity: 0; }

/* design + settings tabs */
.group { background: #fff; border: 1px solid var(--hair); border-radius: 16px; padding: 16px; margin-bottom: 14px; }
.group h3 { font-family: "Mukta", sans-serif; font-size: 1rem; font-weight: 700; margin: 0 0 4px; }
.group > .hint { margin-bottom: 14px; }
.tpl-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.tpl { border: 0; background: none; padding: 0; cursor: pointer; text-align: center; font-size: .85rem; font-weight: 600; }
.tpl .sw { aspect-ratio: 3 / 4; border-radius: 12px; margin-bottom: 6px; background-size: cover; background-position: center; box-shadow: var(--shadow); transition: box-shadow .2s; }
.tpl.on .sw { box-shadow: 0 0 0 3px var(--red), var(--shadow); }
.sw.royal { background-image: url(/themes/royal/hero.jpg); }
.sw.classic { background: #6b3a1e; box-shadow: inset 0 0 0 6px #c9971c, var(--shadow); }
.sw.mono { background: #0b0b0b; box-shadow: inset 0 0 0 1px #555, var(--shadow); }
.tpl.on .sw.classic { box-shadow: inset 0 0 0 6px #c9971c, 0 0 0 3px var(--red); }
.tpl.on .sw.mono { box-shadow: inset 0 0 0 1px #555, 0 0 0 3px var(--red); }
.langs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; }
.track { display: flex; align-items: center; gap: 12px; background: var(--blush); border-radius: 12px; padding: 10px 12px; margin-bottom: 10px; }
.track .ic { width: 38px; height: 38px; border-radius: 50%; background: var(--red); color: #fff; display: grid; place-items: center; flex: none; }
.track b { display: block; font-size: .92rem; word-break: break-all; }
.track audio { width: 100%; height: 36px; margin-top: 6px; }
.wa-card { background: #e8f5e2; border-radius: 12px; padding: 10px; margin-top: 6px; }
.wa-card .inner { background: #fff; border-radius: 8px; overflow: hidden; display: flex; }
.wa-card .img { width: 84px; flex: none; background: url(/themes/royal/hero.jpg) center / cover; }
.wa-card .txt { padding: 8px 10px; font-size: .82rem; line-height: 1.35; }
.wa-card .txt b { display: block; font-size: .88rem; }
.wa-card .txt span { color: #667; }
.links-mini code { display: block; background: #faf6f4; border-radius: 8px; padding: 8px 10px; font-size: .8rem; word-break: break-all; margin: 4px 0 8px; }

/* preview stage */
.stage { position: relative; display: flex; flex-direction: column; align-items: center; background: var(--blush); min-height: 0; overflow: hidden; }
.stage-bar { display: flex; gap: 10px; align-items: center; justify-content: center; flex-wrap: wrap; padding: 14px; }
.seg { display: inline-flex; background: #fff; border-radius: 999px; padding: 3px; box-shadow: inset 0 0 0 1px #ead9d5; }
.seg button { border: 0; background: none; border-radius: 999px; padding: 6px 16px; cursor: pointer; font-weight: 600; font-size: .88rem; color: var(--muted); min-height: 36px; }
.seg button.on { background: var(--ink); color: #fff; }
.device { flex: 1; min-height: 0; width: 100%; display: flex; justify-content: center; padding: 0 20px 20px; }
.device iframe { border: 0; background: #fff; display: block; }
.device.phone iframe { width: min(390px, 100%); height: 100%; max-height: 820px; border-radius: 38px; box-shadow: 0 0 0 10px #161112, 0 30px 60px rgba(60,20,25,.25); margin-top: 10px; }
.device.wide iframe { width: 100%; height: 100%; border-radius: 16px; box-shadow: var(--lift); }
.mtabs { display: none; }

/* dialog + toast */
.dialog-wrap { position: fixed; inset: 0; z-index: 60; background: rgba(28,18,20,.45); display: grid; place-items: center; padding: 16px; }
.dialog { background: #fff; border-radius: 22px; padding: 26px; max-width: 560px; width: 100%; box-shadow: var(--lift); max-height: 90vh; overflow: auto; }
.dialog h2 { font-size: 2rem; }
.muted { color: var(--muted); }
.link-row { margin: 14px 0; }
.link-row span { display: block; font-size: .85rem; font-weight: 600; margin-bottom: 4px; }
.link-row code { display: block; background: #faf6f4; border-radius: 10px; padding: 10px 12px; font-size: .85rem; word-break: break-all; margin-bottom: 6px; }
.dlg-acts { display: flex; gap: 10px; flex-wrap: wrap; margin: 18px 0 0; }
.toast { position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 999px; z-index: 70; font-size: .92rem; box-shadow: var(--lift); max-width: 90vw; text-align: center; }

/* ---------- narrow screens ---------- */
@media (max-width: 900px) {
  .themes, .next { grid-template-columns: 1fr; }
  .themes { max-width: 380px; margin: 0 auto; }
  .saved { display: none; }
  .editor { grid-template-columns: 1fr; height: auto; min-height: calc(100dvh - 62px); }
  .panel { border-right: 0; }
  .pbody { overflow: visible; padding-bottom: 100px; }
  .ptabs { position: sticky; top: 62px; z-index: 5; background: #fff; }
  .stage { display: none; position: fixed; inset: 62px 0 64px; z-index: 20; }
  .editor.show-preview .stage { display: flex; }
  .editor.show-preview .panel { display: none; }
  .stage-bar #device { display: none; }
  .device.phone iframe { border-radius: 24px; box-shadow: 0 0 0 6px #161112, var(--lift); max-height: none; }
  .mtabs { display: grid; grid-template-columns: 1fr 1fr; position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; background: #fff; border-top: 1px solid var(--hair); padding: 8px 12px calc(8px + env(safe-area-inset-bottom)); gap: 8px; }
  .mtabs button { border: 0; border-radius: 999px; min-height: 46px; font-weight: 700; background: #f5efed; color: var(--muted); }
  .mtabs button.on { background: var(--red); color: #fff; }
}
@media (max-width: 560px) {
  .top { padding: 0 12px; }
  .brand { font-size: 1.15rem; }
  .back { display: none; }
  .top-actions { gap: 6px; }
  .top-actions .btn { padding: 6px 14px; min-height: 38px; font-size: .9rem; }
  #share-btn { display: none; }
  .row2 { grid-template-columns: 1fr; gap: 0; }
  .start-form { padding: 20px 16px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* step 2: form beside what's included */
.step2 { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 20px; align-items: stretch; }
.incl { background: var(--blush); border-radius: 22px; padding: 24px 24px 20px; }
.incl ul { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 9px; }
.incl li { position: relative; padding-left: 28px; font-size: .94rem; color: #4a3d39; }
.incl li::before { content: "✓"; position: absolute; left: 0; top: 1px; width: 19px; height: 19px; border-radius: 50%; background: #fff; color: var(--red); font-size: .72rem; font-weight: 700; display: grid; place-items: center; }
.incl li b { color: var(--ink); font-weight: 600; }
.incl .price { margin: 0; padding-top: 12px; border-top: 1px dashed #e6cfc9; color: var(--muted); }
.incl .price b { font-family: "Cormorant Garamond", serif; font-size: 1.8rem; color: var(--red); margin-right: 4px; }
@media (max-width: 900px) { .step2 { grid-template-columns: 1fr; } }

/* account chip + sign-in */
.account { display: flex; align-items: center; }
.uchip { position: relative; }
.ubtn { display: flex; align-items: center; gap: 8px; border: 0; background: #fff; border-radius: 999px; padding: 4px 12px 4px 4px; min-height: 40px; cursor: pointer; box-shadow: inset 0 0 0 1px #ead9d5; font-weight: 600; font-size: .9rem; }
.ubtn img, .ubtn .ini { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; }
.ubtn .ini { display: grid; place-items: center; background: var(--red); color: #fff; }
.umenu { position: absolute; right: 0; top: calc(100% + 8px); background: #fff; border-radius: 14px; box-shadow: var(--lift); padding: 8px; min-width: 220px; z-index: 50; }
.umenu p { margin: 4px 10px 8px; font-size: .82rem; color: var(--muted); word-break: break-all; }
.umenu a, .umenu button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 10px; border-radius: 10px; color: var(--ink); text-decoration: none; cursor: pointer; font-size: .92rem; }
.umenu a:hover, .umenu button:hover { background: var(--blush); }
.signin-card h3 { font-family: "Cormorant Garamond", serif; font-size: 1.8rem; margin-bottom: 6px; }
.g-btn { min-height: 46px; margin: 16px 0 6px; }
.who { display: flex; align-items: center; gap: 8px; margin: 0 0 14px; font-size: .9rem; color: var(--muted); background: #f7f2f0; border-radius: 999px; padding: 6px 14px; width: fit-content; }
body.editing .account { display: none; }
@media (max-width: 560px) { .ubtn span { display: none; } .ubtn { padding: 4px; } }
.bar { height: 6px; border-radius: 999px; background: #f1e4e1; overflow: hidden; margin-top: 10px; }
.bar i { display: block; height: 100%; width: 0; background: var(--red); transition: width .2s; }

/* add-ons, link, QR card */
.upsell { background: #fff; border: 1px dashed #e5bfc6; border-radius: 14px; padding: 14px; display: grid; gap: 6px; margin: 6px 0 12px; }
.upsell b { font-size: 1rem; } .upsell span { color: var(--muted); font-size: .88rem; } .upsell .btn { justify-self: start; margin-top: 4px; }
.biglink { display: block; background: var(--blush); color: var(--red-deep); font-weight: 600; border-radius: 12px; padding: 12px 14px; word-break: break-all; font-size: .95rem; margin: 6px 0 8px; }
.slugrow { display: flex; align-items: stretch; border: 1px solid #e3d3cf; border-radius: 12px; overflow: hidden; background: #fff; }
.slugrow span { display: flex; align-items: center; padding: 0 4px 0 12px; color: var(--muted); font-size: .9rem; background: #faf6f4; white-space: nowrap; }
.slugrow input { border: 0 !important; margin: 0 !important; border-radius: 0 !important; box-shadow: none !important; }
.qr-card { width: 100%; height: auto; border-radius: 12px; box-shadow: var(--shadow); display: block; margin-bottom: 12px; }
.acts-row { display: flex; gap: 8px; flex-wrap: wrap; }
