/* ==========================================================================
   Invitation builder (/yarat). Uses the site tokens from site.css:
   pearl page, paper panels, night ink, pomegranate for progress, saffron for the final action.
   ========================================================================== */
.b-page { padding: clamp(28px, 4vw, 56px) 0 96px; }
.b-wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.b-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 24px; margin-bottom: 20px; }
.b-help { display: none; margin: 0; font-size: 14px; color: var(--ink-2, #5c5872); }
.b-help a { display: inline-flex; align-items: center; gap: 6px; margin-left: 4px; color: #0f7a40; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.b-help .icon { width: 18px; height: 18px; flex: none; }
@media (max-width: 959px) { .b-help { display: block; flex-basis: 100%; } }
.b-title { margin: 0; font: 300 clamp(34px, 4.4vw, 56px)/1.05 var(--f-display); letter-spacing: -.02em; }
.b-status { margin: 0; font-size: 15px; color: var(--ink-2); min-height: 1.4em; }

/* Step bar: numbered, scrolls sideways on phones */
.b-steps { margin: 0 calc(-1 * var(--gutter)) 24px; padding: 0 var(--gutter); overflow-x: auto; scrollbar-width: none; }
.b-steps::-webkit-scrollbar { display: none; }
.b-steps ol { display: flex; gap: 6px; margin: 0; padding: 0; list-style: none; min-width: max-content; }
.b-steps button {
  display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px 0 6px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--paper); color: var(--ink-2); font: 500 14px/1 var(--f-body); cursor: pointer; white-space: nowrap;
}
.b-step-n { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--pearl); color: var(--ink); font-weight: 600; }
.b-steps button.is-done .b-step-n { background: color-mix(in srgb, var(--nar) 14%, var(--paper)); color: var(--nar); }
.b-steps button[aria-current] { border-color: var(--nar); color: var(--ink); }
.b-steps button[aria-current] .b-step-n { background: var(--nar); color: #fff; }
.b-restored { margin: -12px 0 20px; font-size: 15px; line-height: 1.5; color: var(--ink-2); }
.b-restored p { margin: 0; }
/* a 44px tap area that does not open up the line when the note wraps on a phone */
.b-restored-btn { padding: 12px 4px; margin: -12px 0; line-height: inherit; border: 0; background: none; color: var(--ink); font: inherit; font-weight: 500; text-decoration: underline; text-underline-offset: 4px; cursor: pointer; }
.b-restored-btn:hover { color: var(--nar); }
.b-steps .b-stepper { display: none; }
/* (2026-11-19) wide screens: a touch more compact, so all nine fit from ~1240px; narrower, the row still scrolls and
   fades out on the side that has more steps (is-more-l / is-more-r, builder.js), so "9 Hesa…" no longer just stops */
@media (min-width: 760px) {
  .b-steps ol { gap: 4px; }
  .b-steps button { gap: 7px; padding-right: 12px; font-size: 13.5px; }
  .b-step-n { width: 28px; height: 28px; }
  .b-steps.is-more-r { mask-image: linear-gradient(to right, #000 calc(100% - 72px), transparent); }
  .b-steps.is-more-l { mask-image: linear-gradient(to left, #000 calc(100% - 72px), transparent); }
  .b-steps.is-more-l.is-more-r { mask-image: linear-gradient(to right, transparent, #000 72px, #000 calc(100% - 72px), transparent); }
}
@media (max-width: 759px) {
  .b-steps { margin-bottom: 18px; overflow: visible; }
  .b-steps .b-stepper {
    display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 10px 12px; width: 100%; min-height: 48px; padding: 0;
    border: 0; border-radius: 0; background: none; color: var(--ink); font: 500 15px/1.3 var(--f-body); text-align: left; white-space: normal; cursor: pointer;
  }
  .b-stepper-t b { font-weight: 600; }
  .b-stepper-i { width: 10px; height: 10px; border-right: 2px solid var(--ink-2); border-bottom: 2px solid var(--ink-2); rotate: 45deg; translate: 0 -3px; transition: rotate .2s var(--ease); }
  .b-stepper[aria-expanded="true"] .b-stepper-i { rotate: 225deg; translate: 0 2px; }
  .b-stepper-bar { grid-column: 1 / -1; height: 4px; border-radius: 99px; background: var(--line); overflow: hidden; }
  .b-stepper-bar i { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--nar); transition: width .35s var(--ease); }
  .b-steps ol { display: none; flex-wrap: wrap; min-width: 0; margin-top: 12px; }
  .b-steps.is-open ol { display: flex; }
}

/* Form on the left, the phone on the right */
.b-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 380px); gap: clamp(24px, 4vw, 56px); align-items: start; }
.b-form { display: grid; gap: 20px; padding: clamp(22px, 3vw, 36px); background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-lg); }
.b-step { display: grid; gap: 18px; min-width: 0; }
.b-h { margin: 0; font: 400 clamp(26px, 2.4vw, 32px)/1.15 var(--f-display); outline: none; }
.b-hint { margin: -8px 0 0; font-size: 14px; color: var(--ink-2); }
.b-note { margin: 0; padding: 14px 16px; border-radius: var(--r-md); background: var(--pearl); font-size: 15px; }
.b-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 519px) { .b-row { grid-template-columns: 1fr; } }

.b-field { display: grid; gap: 7px; min-width: 0; margin: 0; padding: 0; border: 0; }
.b-field > label, .b-field > legend { font-size: 15px; font-weight: 500; padding: 0; }
.b-field input:not([type="radio"]):not([type="checkbox"]):not([type="range"]), .b-field select, .b-field textarea, .b-prog input {
  width: 100%; min-height: 50px; padding: 11px 14px; border-radius: var(--r-md); border: 1.5px solid var(--line);
  background: var(--paper); color: var(--ink); font: 400 16px/1.4 var(--f-body);
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.b-field textarea { resize: vertical; min-height: 84px; }
.b-field select { appearance: none; padding-right: 40px; background: var(--paper) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231c1a3a' stroke-width='1.8'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center / 18px; }
.b-field :is(input, select, textarea):focus, .b-prog input:focus { outline: none; border-color: var(--night); box-shadow: 0 0 0 3px rgba(216,153,42,.35); }
#b-n1, #b-n2 { font: 400 22px/1.2 var(--f-display); }
.b-form .v-err { margin: -10px 0 0; }
.b-field input[aria-invalid="true"] { border-color: var(--nar); }

/* Step 1: one row per category that scrolls sideways; a chip (or "Hamısı →") shows one category as a grid */
.b-form { --fp: clamp(22px, 3vw, 36px); }
.b-chips { display: flex; flex-wrap: wrap; gap: 8px; }
/* phones: the step 1 chips are one line that scrolls sideways */
@media (max-width: 759px) {
  .b-step[data-step="1"] .b-chips {
    flex-wrap: nowrap; margin: 0 calc(-1 * var(--fp)); padding: 2px var(--fp); overflow-x: auto; scrollbar-width: none;
  }
  .b-step[data-step="1"] .b-chips::-webkit-scrollbar { display: none; }
  .b-step[data-step="1"] .b-chips .v-chip { flex: none; }
}
.b-groups { display: grid; gap: 26px; min-width: 0; margin: 0; padding: 0; border: 0; }
.b-group { min-width: 0; }
.b-group-head { display: flex; align-items: center; gap: 8px 12px; margin-bottom: 6px; }
.b-group-t { flex: 1; margin: 0; font: 400 22px/1.2 var(--f-display); }
.b-group-n { margin-left: 4px; font: 500 14px/1 var(--f-body); color: var(--ink-2); vertical-align: 2px; }
.b-group-all { min-height: 44px; padding: 0 2px; border: 0; background: none; color: var(--ink); font: 500 15px/1 var(--f-body); text-decoration: underline; text-underline-offset: 4px; white-space: nowrap; cursor: pointer; }
.b-group-all:hover { color: var(--nar); }
.b-group-arrows { display: none; gap: 6px; }
.b-group-arrow { width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 50%; background: var(--paper); color: var(--ink); font: 400 22px/1 var(--f-body); cursor: pointer; }
.b-group-arrow:hover:not(:disabled) { border-color: var(--ink); }
.b-group-arrow:disabled { opacity: .35; cursor: default; }
@media (hover: hover) and (pointer: fine) { .b-groups:not(.is-one) .b-group-arrows { display: inline-flex; } }
.b-tpls {
  position: relative; display: grid; grid-auto-flow: column; grid-auto-columns: clamp(112px, 36%, 160px); gap: 14px;
  margin: 0 calc(-1 * var(--fp)); padding: 6px var(--fp) 10px; overflow-x: auto; overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory; scroll-padding-inline: var(--fp); scrollbar-width: none;
}
.b-tpls::-webkit-scrollbar { display: none; }
.b-tpl { display: grid; align-content: start; gap: 8px; cursor: pointer; scroll-snap-align: start; }
.b-groups.is-one .b-group:not(.is-shown) { display: none; }
.b-groups.is-one .b-group-all { display: none; }
.b-groups.is-one .b-tpls { grid-auto-flow: row; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); margin: 0; padding: 6px 0 0; overflow: visible; }
.b-tpl-cover { position: relative; display: block; border-radius: var(--r-sm); outline: 3px solid transparent; outline-offset: 3px; transition: outline-color .2s var(--ease), translate .2s var(--ease); }
.b-tpl-cover .cv { width: 100%; border-radius: inherit; }
.b-tpl:hover .b-tpl-cover { translate: 0 -2px; }
.b-tpl input:checked + .b-tpl-cover { outline-color: var(--nar); }
.b-tpl input:focus-visible + .b-tpl-cover { outline-color: var(--saffron); }
/* the chosen design: a tick in the corner and its name in pomegranate */
.b-tpl-check {
  position: absolute; top: 8px; right: 8px; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%;
  background: var(--nar); box-shadow: 0 0 0 2px var(--paper), 0 4px 10px rgba(28,26,58,.35); opacity: 0; scale: .5; transition: opacity .2s var(--ease), scale .25s var(--ease);
}
.b-tpl-check svg { width: 18px; height: 18px; fill: none; stroke: #fff; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.b-tpl input:checked + .b-tpl-cover .b-tpl-check { opacity: 1; scale: 1; }
.b-tpl-name { font-size: 15px; font-weight: 500; text-align: center; }
.b-tpl:has(input:checked) .b-tpl-name { color: var(--nar); font-weight: 600; }

/* Step 2: the chosen design, with a way back to step 1 */
.b-chosen { margin: -6px 0 0; font-size: 15px; color: var(--ink-2); }
.b-chosen b { color: var(--ink); font-weight: 600; }
.b-chosen-btn { min-height: 44px; margin: -12px 0; padding: 0 4px; border: 0; background: none; color: var(--ink); font: inherit; font-weight: 500; text-decoration: underline; text-underline-offset: 4px; cursor: pointer; }
.b-chosen-btn:hover { color: var(--nar); }
.b-swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.b-swatch { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px 0 8px; border: 1.5px solid var(--line); border-radius: 999px; cursor: pointer; font-size: 15px; }
.b-swatch-dot { width: 26px; height: 26px; border-radius: 50%; background: var(--sw); box-shadow: inset 0 0 0 1px rgba(0,0,0,.15); }
.b-swatch:has(input:checked) { border-color: var(--night); }
.b-swatch:has(input:focus-visible) { box-shadow: 0 0 0 3px rgba(216,153,42,.45); }

/* Checkboxes and radios as rows */
.b-checks { display: flex; flex-wrap: wrap; gap: 10px; }
.b-check { display: inline-flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 16px; border: 1.5px solid var(--line); border-radius: var(--r-md); cursor: pointer; }
.b-check input { width: 20px; height: 20px; accent-color: var(--nar); margin: 0; }
.b-check:has(input:checked) { border-color: var(--night); }

/* Tabs (language) */
.b-tabs { display: flex; flex-wrap: wrap; gap: 4px; }
.b-tabs:empty { display: none; }
.b-tabs [role="tab"] { min-height: 40px; padding: 0 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--paper); color: var(--ink-2); font: 500 14px/1 var(--f-body); cursor: pointer; }
.b-tabs [aria-selected="true"] { background: var(--night); border-color: var(--night); color: var(--pearl); }

/* Step 3: photo */
.b-photo { display: grid; grid-template-columns: 180px 1fr; gap: 20px; align-items: start; }
.b-photo-frame { position: relative; aspect-ratio: 4 / 5; border-radius: 999px 999px var(--r-sm) var(--r-sm); overflow: hidden; background: var(--pearl); border: 1px solid var(--line); }
.b-photo-frame canvas { width: 100%; height: 100%; display: block; filter: grayscale(1); touch-action: none; }
.b-photo-frame.is-color canvas { filter: none; }
.b-photo-frame.can-drag { cursor: grab; }
.b-photo-frame.can-drag:active { cursor: grabbing; }
.b-photo-empty { position: absolute; inset: 0; display: grid; place-items: center; font-size: 14px; color: var(--ink-2); }
.b-photo-ctl { display: grid; gap: 14px; justify-items: start; }
.b-file { cursor: pointer; }
.b-file:has(input:focus-visible) { box-shadow: 0 0 0 3px rgba(216,153,42,.45); }
.b-photo-ctl input[type="range"] { width: 100%; accent-color: var(--nar); }
@media (max-width: 519px) { .b-photo { grid-template-columns: 140px 1fr; } }

/* Step 4 date (day, month, year) and the 24-hour time pickers (step 4 and step 6): plain selects */
.b-date { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
.b-time { display: flex; align-items: center; gap: 4px; min-width: 0; }
.b-time > span { font-weight: 600; color: var(--ink-2); }
.b-field .b-time select, .b-prog .b-time select, .b-field .b-date select { width: auto; min-width: 0; flex: 0 0 auto; min-height: 50px; padding: 11px 26px 11px 12px; border-radius: var(--r-md); border: 1.5px solid var(--line); color: var(--ink); font: 400 16px/1.4 var(--f-body); font-variant-numeric: tabular-nums; appearance: none; background: var(--paper) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231c1a3a' stroke-width='1.8'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 7px center / 14px; transition: border-color .2s var(--ease), box-shadow .2s var(--ease); }
.b-prog .b-time select:focus, .b-field .b-date select:focus { outline: none; border-color: var(--night); box-shadow: 0 0 0 3px rgba(216,153,42,.35); }

/* Step 6: programme rows */
.b-prog { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.b-prog-row { display: grid; grid-template-columns: 148px 1fr auto; gap: 8px; align-items: start; }
.b-prog-texts { display: grid; gap: 6px; }
.b-prog-ctl { display: flex; gap: 2px; }
.b-prog-ctl button { width: 40px; height: 50px; border: 0; border-radius: var(--r-sm); background: transparent; color: var(--ink-2); font-size: 18px; cursor: pointer; }
.b-prog-ctl button:hover:not(:disabled) { background: var(--pearl); color: var(--ink); }
.b-prog-ctl button:disabled { opacity: .3; cursor: default; }
@media (max-width: 519px) {
  .b-prog-row { grid-template-columns: 1fr auto; }
  .b-prog-row > .b-time { grid-column: 1; justify-self: start; }
  .b-prog-texts { grid-column: 1 / -1; grid-row: 2; }
  .b-prog-ctl { grid-column: 2; grid-row: 1; }
}

/* Step 8: plans */
.b-plans { display: grid; gap: 10px; margin: 0; padding: 0; border: 0; }
.b-plan { display: grid; gap: 4px; padding: 16px 18px; border: 1.5px solid var(--line); border-radius: var(--r-md); cursor: pointer; }
.b-plan:has(input:checked) { border-color: var(--night); box-shadow: inset 0 0 0 1px var(--night); }
.b-plan:has(input:focus-visible) { box-shadow: 0 0 0 3px rgba(216,153,42,.45); }
.b-plan-top { display: flex; justify-content: space-between; gap: 12px; }
.b-plan-name { font: 400 22px/1.2 var(--f-display); }
.b-plan.is-locked { cursor: default; border-color: var(--night); box-shadow: inset 0 0 0 1px var(--night); }
.b-plan-lock { margin-top: 0; }
.b-plan-price { font-weight: 600; font-size: 18px; }
.b-plan-for { font-size: 15px; color: var(--ink-2); }

/* Step 9: password with show/hide */
.b-pass { position: relative; }
.b-pass input { padding-right: 92px !important; }
.b-pass-toggle { position: absolute; right: 6px; top: 50%; translate: 0 -50%; min-height: 40px; padding: 0 12px; border: 0; border-radius: var(--r-sm); background: transparent; color: var(--ink); font: 500 14px/1 var(--f-body); cursor: pointer; }
.b-pass-toggle:hover { background: var(--pearl); }

/* Back / next */
/* The bar at the bottom: sticks to the bottom of the screen while the form scrolls (all widths).
   Step 1 adds the chosen design, its event (and package) and its colours. */
.b-nav {
  position: sticky; bottom: 0; z-index: 20; display: grid; gap: 10px;
  margin: 0 calc(-1 * var(--fp)) calc(-1 * var(--fp)); padding: 12px var(--fp) max(12px, env(safe-area-inset-bottom));
  background: var(--paper); border-top: 1px solid var(--line); border-radius: 0 0 var(--r-lg) var(--r-lg);
  box-shadow: 0 -14px 28px -22px rgba(28,26,58,.45);
}
.b-nav-btns { display: flex; justify-content: space-between; gap: 10px; }
.b-nav-btns .v-btn { min-height: 50px; }
.b-nav #b-back[hidden] ~ .v-btn:not([hidden]) { margin-left: auto; }
.b-nav #b-back[hidden] ~ .b-nav-pv { margin-left: 0; margin-right: auto; }
.b-nav-pv { display: none; }
.b-pick { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; }
/* (2026-11-19) wide screens, step 1: the chosen design and the buttons share one row (the bar was 153px tall and hid the
   design cards under it on a laptop); where the form is too narrow for both, the buttons drop under it as before */
@media (min-width: 960px) {
  .b-nav:has(> .b-pick:not([hidden])) { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 20px; }
  .b-nav:has(> .b-pick:not([hidden])) > .b-pick { flex: 1 1 300px; min-width: 0; }
  .b-nav:has(> .b-pick:not([hidden])) > .b-nav-btns { flex: 0 0 auto; margin-left: auto; }
  .b-nav:has(> .b-pick:not([hidden])) > :not(.b-pick, .b-nav-btns) { flex-basis: 100%; }
}
.b-pick[hidden] { display: none; }
.b-pick-thumb { position: relative; width: 38px; aspect-ratio: 9 / 16; border-radius: 5px; overflow: hidden; background: var(--pearl); box-shadow: 0 0 0 1px var(--line); }
.b-pick-thumb .cv { position: absolute; top: 0; left: 0; width: 100%; }
.b-pick-thumb .b-tpl-check { display: none; }
.b-pick-text { display: grid; gap: 2px; min-width: 0; }
.b-pick-name { overflow: hidden; font: 400 19px/1.2 var(--f-display); white-space: nowrap; text-overflow: ellipsis; }
.b-pick-name::before { content: "✓ "; color: var(--nar); font: 600 16px/1 var(--f-body); }
.b-pick-meta { font-size: 13px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.b-pick .b-swatches { flex-wrap: nowrap; gap: 6px; }
.b-pick .b-swatches:has(> :only-child) { display: none; }
.b-pick .b-swatch { justify-content: center; width: 44px; min-height: 44px; padding: 0; border: 0; border-radius: 50%; }
.b-pick .b-swatch-dot { width: 30px; height: 30px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.15), 0 0 0 2px var(--paper), 0 0 0 3.5px transparent; transition: box-shadow .2s var(--ease); }
.b-pick .b-swatch:has(input:checked) .b-swatch-dot { box-shadow: inset 0 0 0 1px rgba(0,0,0,.15), 0 0 0 2px var(--paper), 0 0 0 4px var(--night); }
.b-pick .b-swatch-l { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.b-pick.is-new { animation: b-pick-in .5s var(--ease); }
@keyframes b-pick-in { 0% { scale: .97; background: color-mix(in srgb, var(--nar) 10%, var(--paper)); } 100% { scale: 1; background: transparent; } }
.b-pick { border-radius: var(--r-md); }
@media (max-width: 759px) {
  .b-nav { gap: 8px; padding-top: 10px; padding-bottom: max(10px, env(safe-area-inset-bottom)); }
  .b-nav-btns .v-btn { min-height: 48px; }
  .b-pick { gap: 10px; }
  .b-pick-thumb { width: 30px; }
  .b-pick-name { font-size: 18px; }
  .b-pick .b-swatches { gap: 2px; }
}
/* Phones: a long button label takes a second line instead of running out of the button (2026-11-17: step 9
   "Hesab yarat və dəvətnaməni saxla" is 307px in az, 388px in ru against ~304px; step 3 "Şəkil seçin" beside the frame) */
@media (max-width: 759px) {
  .b-form .v-btn { max-width: 100%; white-space: normal; text-align: center; line-height: 1.2; padding-block: 6px; }
}
@media (prefers-reduced-motion: reduce) { .b-pick.is-new { animation: none; } .b-tpl-check, .b-stepper-bar i { transition: none; } }
.b-nav .v-btn[disabled] { opacity: .6; cursor: progress; }
.b-warn { margin: 0; padding: 12px 14px; border-radius: var(--r-md); background: color-mix(in srgb, var(--nar) 9%, var(--paper)); color: var(--nar-deep); font-size: 15px; }

/* The phone preview: a 390×844 page scaled to fit the column */
.b-preview { position: sticky; top: 92px; display: grid; gap: 12px; }
.b-preview-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.b-preview-title { font-size: 14px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); }
.b-preview-close { display: none; }
.b-tabs--small [role="tab"] { min-height: 34px; padding: 0 10px; font-size: 13px; }
.b-phone {
  --scale: .9; position: relative; width: 100%; aspect-ratio: 390 / 844; overflow: hidden;
  border-radius: 38px; border: 10px solid var(--night); background: var(--night); box-shadow: 0 30px 60px -30px rgba(28,26,58,.55);
}
.b-phone iframe { position: absolute; top: 0; left: 0; width: 390px; height: 844px; border: 0; transform: scale(var(--scale)); transform-origin: 0 0; background: #fff; }

@media (max-width: 959px) {
  .b-grid { grid-template-columns: 1fr; }
  .b-preview {
    position: fixed; inset: 0; z-index: 60; top: 0; padding: 12px 16px 16px; background: rgba(28,26,58,.96);
    grid-template-rows: auto 1fr; justify-items: center; visibility: hidden; opacity: 0; transition: opacity .2s var(--ease), visibility 0s .2s;
  }
  .b-preview.is-open { visibility: visible; opacity: 1; transition: opacity .2s var(--ease); }
  .b-preview-bar { width: 100%; max-width: 420px; }
  .b-preview-title { color: rgba(245,240,243,.7); }
  .b-preview-close { display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 50%; background: rgba(245,240,243,.12); color: var(--pearl); font-size: 26px; cursor: pointer; }
  .b-phone { height: 100%; width: auto; max-width: 100%; border-width: 6px; border-radius: 30px; }
  .b-nav-pv { display: inline-flex; }
  .b-nav-btns .v-btn { padding-inline: 18px; }
  .b-nav-btns #b-next, .b-nav-btns #b-finish, .b-nav-btns #b-done { flex: 1; justify-content: center; }
  .b-nav-btns { flex-wrap: wrap; } /* editing shows Növbəti and Hazırdır both: 4 buttons were wider than a phone (2026-11-17) */
  .b-lock, .b-lock body { overflow: hidden; }
}

/* Visually hidden, still read by screen readers */
.b-page .sr { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
#b-texts, #b-dress { display: grid; gap: 18px; }

/* music: a row per track, ▶ to listen first */
.b-tracks { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 8px; }
.b-track { display: flex; align-items: stretch; gap: 6px; }
.b-track .b-check { flex: 1; min-width: 0; }
.b-track .b-check span { display: grid; gap: 2px; line-height: 1.25; padding-block: 8px; }
.b-track .b-check small { font-size: 13px; opacity: .65; }
.b-play {
  flex: none; width: 48px; border-radius: var(--r-md); border: 1.5px solid var(--line); background: transparent;
  display: grid; place-items: center; cursor: pointer; color: var(--night);
}
.b-play svg { width: 20px; height: 20px; fill: currentColor; }
.b-play .i-pause, .b-play[aria-pressed="true"] .i-play { display: none; }
.b-play[aria-pressed="true"] .i-pause { display: inline; }
.b-play[aria-pressed="true"] { background: var(--night); border-color: var(--night); color: #fff; }
.b-play:focus-visible { outline: 2.5px solid var(--nar); outline-offset: 2px; }

/* music: the couple's own song (inc/ownmusic.php, 2026-11-16) */
.b-own { display: grid; gap: 12px; padding: 16px; border: 1.5px dashed var(--line); border-radius: var(--r-md); }
.b-own-h { margin: 0; font-weight: 600; color: var(--night); }
.b-own-body { display: grid; gap: 12px; }
.b-own-body .b-track { max-width: 420px; }
.b-own-start { display: grid; gap: 6px; max-width: 420px; }
.b-own-start label { font-size: 15px; font-weight: 500; }
.b-own-start input[type="range"] { width: 100%; accent-color: var(--nar); }
.b-own-start .b-hint, .b-own .b-hint { margin: 0; }
.b-own-agree { align-items: flex-start; padding-block: 12px; min-height: 0; line-height: 1.4; font-size: 14px; }
.b-own-agree input { flex: none; margin-top: 1px; }
.b-own-up { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.b-own-status { font-size: 14px; color: var(--ink-2); }
.b-own-status:empty { display: none; }
.b-file.is-off { opacity: .45; cursor: not-allowed; }
.b-own .v-err { margin: 0; }

/* Step 4: the optional second event */
.b-ev2-on { justify-self: start; margin-top: 6px; }
.b-ev2-on small { display: block; font-size: 13px; opacity: .7; }
.b-ev2-on span { display: grid; gap: 2px; padding-block: 8px; line-height: 1.25; }
.b-ev2 { display: grid; gap: 14px; margin: 0; padding: 18px; border: 1.5px dashed var(--line); border-radius: var(--r-md); }
.b-ev2[hidden] { display: none; }
.b-ev2-h { padding: 0 6px; font-weight: 600; }

/* Step 8: "we add your guests" (inc/guestservice.php) */
.b-service { display: flex; align-items: flex-start; width: 100%; margin-top: 16px; padding: 14px 16px; min-height: 0; line-height: 1.4; }
.b-service input { flex: none; margin-top: 2px; }
.b-service span { display: grid; gap: 4px; font-size: 14px; color: var(--ink-2); }
.b-service b { font-size: 15px; color: var(--night); }
.b-note:empty { display: none; } /* the partner and price notes before they have anything to say */

/* Step 4: the venue pin (Leaflet map, 2026-11-06) */
.b-geo { gap: 10px; }
.b-geo-label { font-size: 15px; font-weight: 500; }
.b-geo-search { display: flex; gap: 8px; }
.b-geo-search input { flex: 1 1 auto; min-width: 0; }
.b-geo-results { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; }
.b-geo-results button { width: 100%; min-height: 44px; padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--paper); color: var(--ink); font: inherit; font-size: 14px; text-align: left; cursor: pointer; }
.b-geo-results button:hover, .b-geo-results button:focus-visible { border-color: var(--ink); }
.b-geo-map { height: 260px; border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; z-index: 0; background: var(--pearl); }
.b-geo-state { margin: 0; }
.b-geo-touch { display: none; margin: 0; }
@media (pointer: coarse) { .b-geo-touch { display: block; } } /* phones: one finger scrolls the page, two move the map (builder.js) */
.b-geo-clear { justify-self: start; min-height: 44px; padding: 0; border: 0; background: none; color: var(--ink); font: inherit; font-size: 14px; text-decoration: underline; text-underline-offset: 4px; cursor: pointer; }
.b-geo-pin { width: 28px; height: 40px; }
.b-geo-pin::before { content: ""; position: absolute; left: 2px; top: 0; width: 24px; height: 24px; border-radius: 50% 50% 50% 0; background: var(--nar); border: 2px solid var(--paper); box-shadow: 0 2px 6px rgba(28,26,58,.35); transform: rotate(-45deg); transform-origin: 50% 50%; top: 4px; }
.b-geo-pin::after { content: ""; position: absolute; left: 11px; top: 13px; width: 6px; height: 6px; border-radius: 50%; background: var(--paper); }
/* Premium designs (FLAGSHIPS): a small mark by the name; designs a paid package cannot take are left out */
/* the Premium tag sits on its own line under every Premium name (beside a short name and under a long one before) */
.b-tpl-tag { display: block; width: fit-content; margin: 4px auto 0; padding: 2px 8px; border-radius: 99px; background: var(--night); color: var(--saffron); font-size: 12px; font-weight: 600; }
.b-tpl.is-out { display: none !important; }
/* A refused edit, in the bottom bar (builder.js saveErr) */
.b-save-err { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; }
.b-save-err[hidden] { display: none; }
.b-save-go { min-height: 44px; padding: 0 2px; border: 0; background: none; color: inherit; font: 600 15px/1.2 var(--f-body); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.b-save-go[hidden] { display: none; }

/* Step 7: the opening picker (C.openings). Phone-shaped tiles; the chosen one plays its clip. */
/* Step 2: the names font, a tile each with the couple's names in it (builder.js renderFonts) */
.b-fonts { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.b-font { display: grid; gap: 5px; cursor: pointer; text-align: center; min-width: 0; }
.b-font-s {
  display: flex; align-items: center; justify-content: center; min-height: 76px; padding: 8px; overflow: hidden;
  border: 1.5px solid var(--line); border-radius: var(--r-md); background: #fffdf9;
  font-size: calc(25px * var(--k, 1) * var(--fit, 1)); line-height: 1.25; color: var(--ink); overflow-wrap: anywhere; text-wrap: balance;
  transition: border-color .2s, box-shadow .2s;
}
.b-font-l { font-size: 13px; line-height: 1.25; color: var(--ink-2); }
.b-font:has(input:checked) .b-font-s { border-color: var(--night); box-shadow: 0 0 0 2px var(--night); }
.b-font:has(input:checked) .b-font-l { font-weight: 600; color: var(--ink); }
.b-font:has(input:focus-visible) .b-font-s { box-shadow: 0 0 0 3px rgba(216,153,42,.55); }
.b-font.is-off { opacity: .4; cursor: not-allowed; }
@media (max-width: 599px) { .b-fonts { grid-template-columns: repeat(2, minmax(0, 1fr)); } .b-font-s { font-size: calc(22px * var(--k, 1) * var(--fit, 1)); } }

.b-ops { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; max-width: 520px; }
.b-op { display: grid; gap: 6px; cursor: pointer; text-align: center; font-size: 14px; line-height: 1.25; }
.b-op-pic {
  position: relative; display: block; aspect-ratio: 9 / 16; overflow: hidden; border-radius: var(--r-md);
  border: 1.5px solid var(--line); background: #efe9df; transition: border-color .2s, box-shadow .2s;
}
.b-op-pic video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.b-op:has(input:checked) .b-op-pic { border-color: var(--night); box-shadow: 0 0 0 2px var(--night); }
.b-op:has(input:checked) .b-op-name { font-weight: 600; }
.b-op:has(input:focus-visible) .b-op-pic { box-shadow: 0 0 0 3px rgba(216,153,42,.55); }
/* the drawn envelope, in miniature: paper, the top flap's V and the wax seal */
.b-op-env { position: absolute; inset: 0; background: #f4ece0; }
.b-op-env::before {
  content: ''; position: absolute; inset: 0 0 auto; height: 58%;
  background: #ebdfcd; clip-path: polygon(0 0, 100% 0, 50% 100%); filter: drop-shadow(0 2px 2px rgba(80,50,30,.18));
}
.b-op-env b { position: absolute; left: 50%; top: 58%; width: 30%; aspect-ratio: 1; translate: -50% -50%; border-radius: 50%; background: radial-gradient(circle at 38% 32%, #c4454a, #8e1f24 60%, #6b151a); box-shadow: 0 2px 4px rgba(60,20,20,.3); }
@media (max-width: 420px) { .b-ops { gap: 7px; } .b-op { font-size: 12.5px; } }

/* Step 6: parts of the invitation the couple can switch off (2026-11-17); count and wish sit under the RSVP switch */
.b-show { margin-top: 28px; }
.b-show .b-check { justify-self: stretch; align-items: center; }
.b-show .b-check span { display: grid; gap: 2px; padding-block: 8px; line-height: 1.25; }
.b-show .b-check small { font-size: 13px; opacity: .7; }
.b-show .b-show-sub { margin-left: 28px; }
.b-show .b-show-sub.is-off { opacity: .45; cursor: not-allowed; }
@media (max-width: 480px) { .b-show .b-show-sub { margin-left: 16px; } }

/* Step 3 (2026-11-17): colour or black and white, zoom and both directions, the note on designs with a sample photo */
.b-photo-adj { display: grid; gap: 10px; width: 100%; max-width: 320px; }
.b-photo-adj label { display: grid; gap: 4px; font-size: 14px; font-weight: 500; }
.b-photo-adj input[type="range"] { width: 100%; accent-color: var(--nar); }
.b-photo-tone { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; border: 0; }
.b-photo-tone legend { font-size: 14px; font-weight: 500; padding: 0; margin-bottom: 6px; }
.b-photo-tone .b-check { min-height: 40px; padding: 0 14px; }
.b-photo-note { margin: 0 0 14px; padding: 10px 14px; border-left: 3px solid var(--saffron, #d8992a); background: var(--pearl); border-radius: var(--r-sm); font-size: 14px; line-height: 1.45; }
.b-photo-again { font-size: 13px; color: var(--ink-2); margin: 0; }

/* Step 3: the gallery inside the invitation (2026-11-17): thumbnails with ← → × , then the add button */
.b-gal { margin-top: 28px; }
.b-gal-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; margin: 0; padding: 0; list-style: none; }
.b-gal-list:empty { display: none; }
.b-gal-item { display: grid; gap: 6px; }
.b-gal-item img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--pearl); }
.b-gal-item img.is-bw { filter: grayscale(1); }
.b-gal-ctl { display: flex; justify-content: space-between; gap: 4px; }
.b-gal-ctl button { flex: 1; min-height: 36px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--paper); color: var(--ink); font: 500 16px/1 var(--f-body); cursor: pointer; }
.b-gal-ctl button:disabled { opacity: .35; cursor: default; }
.b-gal-ctl button:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(216,153,42,.45); }
.b-gal-bar { display: flex; align-items: center; gap: 12px; margin-top: 4px; }
.b-gal-n { font-size: 14px; color: var(--ink-2); }

/* Step 7: dress code for everyone, for men and for women (2026-11-17) */
.b-dress { gap: 8px; }
.b-dress-l { font-size: 14px; font-weight: 500; color: var(--ink-2); }
.b-dress-mw { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.b-dress-mw > div { display: grid; gap: 6px; min-width: 0; }
.b-dress textarea { min-height: 64px; }
@media (max-width: 520px) { .b-dress-mw { grid-template-columns: 1fr; } }

/* Step 6 "Good to know" cards and step 7 dress colours / pictures (2026-11-17) */
.b-faq-f, .b-dress-x { margin-top: 28px; }
.b-dress-x { display: grid; gap: 24px; }
.b-faq { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.b-faq:empty { display: none; }
.b-faq-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: start; padding: 12px; border: 1px solid var(--line); border-radius: var(--r-md); }
.b-faq-texts { display: grid; gap: 8px; min-width: 0; }
.b-faq-texts textarea { min-height: 64px; }
.b-colors { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.b-colors:empty { display: none; }
.b-color { display: grid; grid-template-columns: 52px 1fr 40px; gap: 10px; align-items: center; }
.b-color input[type="color"] { width: 52px; height: 52px; padding: 3px; border: 1.5px solid var(--line); border-radius: 50%; background: var(--paper); cursor: pointer; }
.b-color input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
.b-color input[type="color"]::-webkit-color-swatch { border: 0; border-radius: 50%; }
.b-color input[type="color"]::-moz-color-swatch { border: 0; border-radius: 50%; }
.b-color-names { display: grid; gap: 6px; min-width: 0; }
.b-color-del { width: 40px; height: 40px; border: 0; border-radius: var(--r-sm); background: transparent; color: var(--ink-2); font-size: 20px; cursor: pointer; }
.b-color-del:hover { background: var(--pearl); color: var(--ink); }
.b-dpics { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.b-dpic { display: grid; gap: 8px; justify-items: start; min-width: 0; }
.b-dpic-l { font-size: 14px; font-weight: 500; color: var(--ink-2); }
.b-dpic-frame { width: 100%; max-width: 160px; aspect-ratio: 3 / 4; display: grid; place-items: center; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--pearl); overflow: hidden; font-size: 13px; color: var(--ink-2); }
.b-dpic-frame img { width: 100%; height: 100%; object-fit: cover; }

/* A link-looking button (v-link on a <button>: "Şəkilsiz davam et", the dress picture's "Sil"): no browser button chrome */
.b-page button.v-link { appearance: none; -webkit-appearance: none; padding: 0; border: 0; background: none; color: var(--ink); font: 500 15px/1.4 var(--f-body);
  text-decoration: underline; text-decoration-color: var(--saffron); text-decoration-thickness: 2px; text-underline-offset: 5px; cursor: pointer; }
.b-page button.v-link:hover { text-decoration-color: currentColor; }
.b-page button.v-link:focus-visible { outline: 2px solid var(--night); outline-offset: 3px; border-radius: 2px; }
/* the step 6 switches are labels straight inside a .b-field, whose "label { padding: 0 }" took their inner space */
.b-show > .b-check { padding: 0 16px; }

/* Steps 5 to 7 are optional: a shortcut to the packages with what is already there (2026-11-23, builder.js data-skip) */
.b-skip { display: flex; flex-wrap: wrap; align-items: center; gap: 0 8px; margin: 0; font-size: 14px; color: var(--ink-2); }
.b-skip-btn { min-height: 40px; padding: 0; border: 0; background: none; cursor: pointer; color: var(--nar); font: 600 14px/40px var(--f-body); text-decoration: underline; text-decoration-color: color-mix(in srgb, currentColor 45%, transparent); text-underline-offset: 4px; }
.b-skip-btn:focus-visible { outline: 2px solid var(--saffron); outline-offset: 2px; border-radius: 4px; }

/* Step 5: «Hazır mətnlər» (2026-11-24), ready texts as chips above the salutation; «Geri qaytar» under them */
.b-pre-f { padding: 14px 16px 12px; border: 1px solid var(--line); border-radius: 16px; background: color-mix(in srgb, var(--night) 3%, var(--paper)); }
.b-pre-l { margin: 0; font-size: 15px; font-weight: 500; }
.b-pre-f .b-hint { margin: 2px 0 10px; }
.b-pre { display: flex; flex-wrap: wrap; gap: 8px; }
.b-pre .v-chip { min-height: 40px; padding: 0 16px; font-size: 14.5px; background: var(--paper); }
.b-pre .v-chip[aria-pressed="true"] { background: var(--night); color: var(--pearl); border-color: var(--night); }
.b-pre-undo { margin: 8px 0 0; font-size: 14px; color: var(--ink-2); }
.b-pre-undo:empty { display: none; }
.b-pre-back { padding: 2px 0; border: 0; background: none; color: var(--ink); font: inherit; font-weight: 600; text-decoration: underline; text-decoration-color: var(--saffron); text-underline-offset: 3px; cursor: pointer; }
@media (max-width: 420px) { .b-pre-f { padding: 12px 12px 10px; } .b-pre .v-chip { padding: 0 13px; font-size: 14px; } }
