/* Layout: picker + form on the left, sticky A3 proof on the right; stacks picker → proof → form on phones */
:root {
  --bg: #f6f1ec; --surface: #fffdfa; --line: #e4d9d0; --ink: #2a1c1f; --muted: #7d6a6c;
  --accent: #7a2e3d; --accent-ink: #fff7f3; --accent-soft: #f3e2e1; --ok: #2f7a4f; --warn: #b4651d; --err: #b3263a;
  --ui: "Manrope", "Segoe UI", system-ui, sans-serif;
  --display: "Old Standard TT", "Times New Roman", serif;
  --radius: 10px;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 var(--ui); }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); }

.wrap { max-width: 1240px; margin: 0 auto; padding-block: 20px 60px;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }

.top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-bottom: 14px; border-bottom: 1px solid var(--line); margin-bottom: 22px; }
.brand { font: 700 13px var(--ui); letter-spacing: .14em; text-transform: uppercase; color: var(--accent); }
.top h1 { font: 700 clamp(26px, 4vw, 40px)/1.1 var(--display); margin: 6px 0 0; text-wrap: balance; }
.top p { margin: 6px 0 0; color: var(--muted); max-width: 60ch; }

.editor { display: grid; gap: 22px 32px; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr);
  grid-template-areas: "picker preview" "form preview"; align-items: start; }
.area-picker { grid-area: picker; min-width: 0; }
.area-preview { grid-area: preview; position: sticky; top: calc(16px + env(safe-area-inset-top, 0px)); min-width: 0; }
.area-form { grid-area: form; min-width: 0; }
@media (max-width: 880px) {
  .editor { grid-template-columns: minmax(0, 1fr); grid-template-areas: "picker" "preview" "form"; }
  .area-preview { position: static; }
}

.step { display: flex; align-items: center; gap: 10px; font: 700 17px/1.2 var(--ui); margin: 26px 0 12px; }
.area-picker .step { margin-top: 0; }
.step b { width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-size: 13px; flex: none; }

.picker { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.pick { position: relative; display: flex; flex-direction: column; gap: 8px; padding: 10px; border: 1.5px solid var(--line); border-radius: var(--radius); background: var(--surface); cursor: pointer; }
.pick input { position: absolute; opacity: 0; pointer-events: none; }
.pick:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.pick:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.pick-name { font-weight: 600; font-size: 13.5px; line-height: 1.25; }
.swatch { display: grid; grid-template-columns: 1fr 1fr; aspect-ratio: 1.414; border-radius: 4px; overflow: hidden; max-width: 100%; }
.swatch i { display: block; }
.pick-husband .swatch i { background: #fff radial-gradient(ellipse at 35% 55%, #555 0 26%, transparent 27%); }
.pick-husband .swatch i:first-child { background: #fff linear-gradient(#444,#444) 50% 60% / 80% 55% no-repeat; }
.pick-news .swatch i { background: #e7e3dc repeating-linear-gradient(#e7e3dc 0 5px, #b9b3a8 5px 6px); }
.pick-news .swatch i:first-child { background: #e7e3dc radial-gradient(circle at 40% 35%, #8d877d 0 22%, transparent 23%); }
.pick-polaroid .swatch i { background: #f3c6dc radial-gradient(circle at 50% 55%, #fff 0 28%, transparent 29%); }
.pick-polaroid .swatch i:first-child { background: #f3c6dc radial-gradient(circle at 35% 35%, #fff 0 18%, transparent 19%), radial-gradient(circle at 65% 70%, #fff 0 18%, transparent 19%); }
.pick-letter .swatch i:first-child { background: #efe9df linear-gradient(#141210, #141210) 30% 50% / 28% 80% no-repeat; }
.pick-letter .swatch i { background: #fbfaf6 repeating-linear-gradient(#fbfaf6 0 4px, #9a948a 4px 5px) 50% 75% / 78% 45% no-repeat; }
.pick-zodiac .swatch i:first-child { background: #f3cfcc radial-gradient(circle at 50% 45%, #c9666b 0 16%, transparent 17%); }
.pick-zodiac .swatch i { background: #fbfaf7 linear-gradient(#1f1d1c, #1f1d1c) 50% 18% / 70% 2px no-repeat; }

.preview-card { background: #d8cfc7; border-radius: var(--radius); padding: 14px; }
.stage { position: relative; width: 100%; overflow: hidden; box-shadow: 0 10px 30px rgba(60, 30, 30, .22); }
.stage .sheet { transform-origin: 0 0; position: absolute; left: 0; top: 0; }
.hint { margin: 10px 2px 0; font-size: 12.5px; color: #5b4b4c; }

.photos { display: grid; gap: 10px; }
.slot { display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 12px; align-items: start; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; }
.slot.busy { opacity: .55; pointer-events: none; }
.thumb { width: 84px; height: 84px; border-radius: 7px; border: 1.5px dashed #c9b6b2; display: grid; place-items: end center; cursor: pointer; background: var(--accent-soft) center / cover no-repeat; overflow: hidden; }
.thumb span { font-size: 12px; font-weight: 700; color: var(--accent); padding: 3px 8px; margin-bottom: 6px; background: var(--surface); border-radius: 99px; }
.slot:not(.filled) .thumb { place-items: center; }
.slot.filled .thumb { border-style: solid; border-color: transparent; }
.slot-body { display: grid; gap: 8px; min-width: 0; }
.slot-label { margin: 0; font-weight: 600; font-size: 14px; }
.zoom { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.zoom input { flex: 1; min-width: 100px; accent-color: var(--accent); }

.fields { display: grid; gap: 14px; }
.row2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 520px) { .row2 { grid-template-columns: minmax(0, 1fr); } .picker { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; } .pick { padding: 7px; } .pick-name { font-size: 12px; } }
.field { display: grid; gap: 6px; min-width: 0; }
.field > label { font-weight: 600; font-size: 14px; }
.field em { color: var(--err); font-style: normal; }
input:not([type=radio]):not([type=range]):not([type=file]), select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
textarea { resize: vertical; line-height: 1.45; }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.help, .count { margin: 0; font-size: 12.5px; color: var(--muted); }
.count { text-align: right; font-variant-numeric: tabular-nums; }
.wishes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.qa-list { display: grid; gap: 10px; }
.qa-item { display: grid; gap: 6px; padding: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.qa-item .q { font-weight: 600; border-color: transparent !important; background: var(--bg) !important; }
.qa-item .link { justify-self: end; }
.adv { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; }
.adv summary { cursor: pointer; font-weight: 600; }
.adv .row2 { margin-top: 10px; }

.link { background: none; border: 0; padding: 2px 0; color: var(--accent); font-weight: 600; font-size: 13px; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.ghost-btn { justify-self: start; background: transparent; border: 1.5px dashed #c9b6b2; border-radius: 8px; padding: 8px 14px; font-weight: 600; color: var(--accent); cursor: pointer; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 20px; border-radius: 8px; border: 0; background: var(--accent); color: var(--accent-ink); font-weight: 700; cursor: pointer; }
.btn:disabled { opacity: .5; cursor: wait; }
.btn.secondary { background: var(--surface); color: var(--ink); border: 1px solid var(--line); }
.btn.danger { background: transparent; color: var(--err); border: 1px solid #e6c2c6; }

.submit-bar { margin-top: 26px; display: grid; gap: 10px; }
.submit-bar .btn { width: 100%; padding: 15px; font-size: 16px; }
.submit-bar p { margin: 0; font-size: 13px; color: var(--muted); }

.done { max-width: 520px; margin: 40px auto; text-align: center; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 32px 22px; }
.done h2 { font: 700 30px/1.15 var(--display); margin: 0 0 8px; }
.done .code { display: inline-block; margin: 14px 0; padding: 10px 18px; font: 700 26px/1 var(--display); letter-spacing: .12em; border: 1.5px solid var(--accent); border-radius: 8px; color: var(--accent); }
.done p { color: var(--muted); margin: 6px 0; }

.toast { position: fixed; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); max-width: calc(100% - 32px);
  padding: 12px 18px; border-radius: 8px; background: var(--ink); color: #fff; font-weight: 600; z-index: 50; box-shadow: 0 8px 24px rgba(0,0,0,.2); }
.toast.err { background: var(--err); }

/* ── Админ ── */
.admin { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 24px; align-items: start; }
@media (max-width: 1000px) { .admin { grid-template-columns: minmax(0, 1fr); } }
.side { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; display: grid; gap: 10px; }
.side .btn { width: 100%; }
.filters { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line); background: var(--bg); padding: 4px 10px; border-radius: 99px; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.chip[aria-pressed=true] { background: var(--ink); color: #fff; border-color: var(--ink); }
.olist { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; max-height: 70vh; overflow: auto; }
.olist button { width: 100%; text-align: left; display: grid; gap: 2px; padding: 9px 10px; border-radius: 8px; border: 1px solid transparent; background: transparent; cursor: pointer; }
.olist button:hover { background: var(--bg); }
.olist button[aria-current=true] { background: var(--accent-soft); border-color: #e4c4c5; }
.olist .r1 { display: flex; justify-content: space-between; gap: 8px; font-weight: 700; font-size: 14px; }
.olist .r2 { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.pill { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 99px; white-space: nowrap; }
.pill.new { background: #fbe3c8; color: var(--warn); }
.pill.printed { background: #dfe8f6; color: #2d548f; }
.pill.done { background: #dcefe3; color: var(--ok); }
.empty { padding: 18px 8px; text-align: center; color: var(--muted); font-size: 13.5px; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 18px; padding: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.toolbar .meta { flex: 1; min-width: 180px; }
.toolbar .meta b { font: 700 18px var(--display); letter-spacing: .06em; }
.toolbar .meta span { display: block; font-size: 12.5px; color: var(--muted); }
.toolbar select { width: auto; }
.login { max-width: 380px; margin: 60px auto; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 24px; display: grid; gap: 12px; }
.login h2 { margin: 0; font: 700 24px var(--display); }
.err-text { color: var(--err); font-size: 13px; margin: 0; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

.textbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 10px; padding: 8px 10px; background: var(--surface); border-radius: 8px; border: 1px solid var(--line); }
.tb-name { font-weight: 700; font-size: 13.5px; margin-right: auto; }
.tb-btn { min-width: 40px; padding: 6px 10px; border-radius: 6px; border: 1px solid var(--line); background: var(--bg); font-weight: 700; cursor: pointer; }
.tb-val { min-width: 44px; text-align: center; font-variant-numeric: tabular-nums; font-size: 13px; color: var(--muted); }
.pick-booth .swatch i:first-child { background: #e6e0d6 linear-gradient(#111, #111) 30% 45% / 50% 55% no-repeat; }
.pick-booth .swatch i { background: #f7f4ee repeating-linear-gradient(#f7f4ee 0 4px, #8b857c 4px 5px) 50% 80% / 78% 50% no-repeat; }
.textbar[hidden], [hidden] { display: none !important; }

.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 7px; overflow: hidden; }
.seg button { border: 0; background: var(--bg); padding: 6px 10px; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.seg button[aria-pressed=true] { background: var(--accent); color: var(--accent-ink); }
.pick-scrap .swatch i:first-child { background: #e7dcc8 linear-gradient(160deg, #c9a37e, #b88f69) 40% 35% / 60% 45% no-repeat; }
.pick-scrap .swatch i { background: #fbfaf7 linear-gradient(#e7e1d8, #e7e1d8) 50% 55% / 75% 45% no-repeat; }
.pick-film .swatch i { background: #f3f1ee radial-gradient(circle, #e0363f 0 1px, transparent 1.5px) 0 0 / 9px 9px; }
.pick-film .swatch i:first-child { background: #f3f1ee linear-gradient(#121110, #121110) 50% 50% / 45% 90% no-repeat; }
.tb-colors { display: inline-flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.sw { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--line); background: var(--c); padding: 0; cursor: pointer; }
.sw[aria-pressed=true] { box-shadow: 0 0 0 2px var(--accent); }
.sw-pick { position: relative; overflow: hidden; background: conic-gradient(#e0363f, #f2c94c, #3f7a2a, #2f5d8a, #7a2e3d, #e0363f); }
.sw-pick input { position: absolute; inset: -6px; opacity: 0; cursor: pointer; }
.pick-sport .swatch i:first-child { background: #fbfbfa radial-gradient(circle at 50% 85%, #e06a1f 0 9%, transparent 10%), linear-gradient(#e0b04a, #b8862b) 50% 35% / 80% 55% no-repeat; }
.pick-sport .swatch i { background: #fbfbfa repeating-linear-gradient(#fbfbfa 0 4px, #8a8a8a 4px 5px) 25% 70% / 42% 60% no-repeat, linear-gradient(#fff, #fff) 85% 50% / 30% 70% no-repeat; }
.pick-missed .swatch i:first-child { background: #f1f0ec linear-gradient(#0f0e0d, #0f0e0d) 45% 50% / 48% 80% no-repeat; }
.pick-missed .swatch i { background: #f1f0ec repeating-linear-gradient(#f1f0ec 0 4px, #8a8a8a 4px 5px) 50% 60% / 60% 45% no-repeat; }
.pick-party .swatch i { background: #a61b11 linear-gradient(#f3efe6, #f3efe6) 50% 70% / 70% 50% no-repeat; outline: 2px dashed #fff; outline-offset: -5px; }

/* ── Цэцэг, төлбөр ── */
.flowers { display: grid; gap: 12px; }
.seg.wide { display: flex; width: 100%; }
.seg.wide button { flex: 1; padding: 10px; font-size: 14px; }
.pk-list, .fl-list { display: grid; gap: 8px; }
.pk { display: grid; grid-template-columns: auto 1fr auto; grid-template-areas: "r n p" "r d p"; gap: 2px 10px; align-items: center; padding: 11px 12px; background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--radius); cursor: pointer; }
.pk input { grid-area: r; accent-color: var(--accent); width: 18px; height: 18px; }
.pk-name { grid-area: n; font-weight: 700; } .pk-desc { grid-area: d; font-size: 12.5px; color: var(--muted); } .pk-price { grid-area: p; font-weight: 700; font-variant-numeric: tabular-nums; }
.pk.on, .fl.on, .dl-opt.on { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.fl { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center; padding: 9px 12px; background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--radius); }
.fl-name { font-weight: 600; } .fl-price { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.qty { display: inline-flex; align-items: center; gap: 8px; }
.qty button { width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--line); background: var(--bg); font-size: 18px; font-weight: 700; cursor: pointer; line-height: 1; }
.qty b { min-width: 22px; text-align: center; font-variant-numeric: tabular-nums; }
.dl { display: grid; grid-template-columns: 1fr; gap: 8px; }
.dl-opt { display: flex; align-items: center; gap: 8px; padding: 11px 12px; background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--radius); cursor: pointer; font-size: 14px; }
.dl-opt input { accent-color: var(--accent); flex: none; } .dl-opt span { flex: 1; min-width: 0; line-height: 1.35; } .dl-opt b { flex: none; white-space: nowrap; font-size: 13.5px; text-align: right; font-variant-numeric: tabular-nums; }
.sum { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; }
.sum-row { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; font-size: 14px; font-variant-numeric: tabular-nums; }
.sum-row.total { border-top: 1px solid var(--line); margin-top: 4px; padding-top: 8px; font-weight: 800; font-size: 16px; }
.pay { max-width: 460px; margin: 30px auto; text-align: center; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 26px 20px; display: grid; gap: 10px; justify-items: center; }
.pay h2 { font: 700 26px/1.15 var(--display); margin: 0; }
.pay-amt { font: 800 28px var(--ui); margin: 0; color: var(--accent); font-variant-numeric: tabular-nums; }
.pay-qr { width: 240px; max-width: 100%; aspect-ratio: 1; border: 1px solid var(--line); border-radius: 10px; }
.pay-hint, .pay-status { margin: 0; color: var(--muted); font-size: 14px; }
.banks { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; width: 100%; }
.bank { display: grid; justify-items: center; gap: 4px; padding: 8px 4px; border: 1px solid var(--line); border-radius: 10px; text-decoration: none; color: var(--ink); font-size: 11.5px; line-height: 1.2; }
.bank img { width: 40px; height: 40px; border-radius: 10px; }
.spin { display: inline-block; width: 12px; height: 12px; margin-right: 6px; border: 2px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: sp 1s linear infinite; vertical-align: -1px; }
@keyframes sp { to { transform: rotate(360deg); } }
.pill.paid { background: #dcefe3; color: var(--ok); } .pill.unpaid { background: #f6dcdc; color: var(--err); }
.cat { display: grid; gap: 14px; }
.cat-row { display: grid; grid-template-columns: 56px 1.3fr 1.6fr .9fr auto auto; gap: 6px; align-items: center; }
.cat-row.fl-row { grid-template-columns: 56px 1.6fr 1fr auto auto; }
@media (max-width: 640px) { .cat-row, .cat-row.fl-row { grid-template-columns: 1fr 1fr; } }
.cat-row label { display: flex; align-items: center; gap: 4px; font-size: 12.5px; color: var(--muted); }
.cat h3 { margin: 6px 0 0; font-size: 15px; }
.cat-img { width: 56px; height: 56px; border-radius: 8px; border: 1.5px dashed #c9b6b2; display: grid; place-items: center; overflow: hidden; cursor: pointer; background: var(--accent-soft); font-size: 10.5px; font-weight: 700; color: var(--accent); text-align: center; }
.cat-img img { width: 100%; height: 100%; object-fit: cover; }
.cat-row.busy { opacity: .5; pointer-events: none; }
.pk { grid-template-columns: auto auto 1fr auto; grid-template-areas: "r i n p" "r i d p"; }
.pk-img { grid-area: i; width: 84px; height: 84px; border-radius: 8px; object-fit: cover; }
.fl.has-img { grid-template-columns: 68px 1fr auto auto; }
.fl-img { width: 68px; height: 68px; border-radius: 8px; object-fit: cover; }
.paym { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.bk { width: 100%; display: grid; gap: 2px; text-align: left; background: var(--bg); border-radius: 10px; padding: 8px 12px; }
.bk-row { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.bk-row:last-child { border-bottom: 0; }
.bk-row span { color: var(--muted); } .bk-row b { font-variant-numeric: tabular-nums; word-break: break-all; }
.pill.bank { background: #fbe3c8; color: var(--warn); }
.pick-badge { position: absolute; top: 6px; right: 6px; background: var(--accent); color: var(--accent-ink); font-size: 10.5px; font-weight: 800; padding: 2px 7px; border-radius: 99px; }
.pick-spring .swatch i { background: #fff; box-shadow: inset 0 0 0 3px #fff, inset 0 0 0 5px #c8102e; }
.pick-spring .swatch i:first-child { background: #fff radial-gradient(circle at 50% 50%, #c8102e 0 14%, transparent 15%); }
.pick-tulip .swatch i { background: #f6e9ec url("bg/tulip.jpg") center / cover; }

/* Хүргэлтийн газрын зураг */
.dl-box:empty { display: none; }
.dl-box { display: grid; gap: 10px; margin-top: 10px; }
.dl-map { height: 280px; border-radius: 12px; border: 1px solid var(--line); overflow: hidden; background: #e8e4dc; z-index: 0; }
.dl-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 8px; }
.dl-q { font-size: 14px; color: var(--muted); } .dl-q b { color: var(--ink, #222); }
.pin span { display: block; width: 22px; height: 22px; margin: 0 auto; background: var(--accent); border: 3px solid #fff; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); box-shadow: 0 2px 6px rgba(0,0,0,.35); }
.sum:empty { display: none; }
.dl-opt small { display: block; font-size: 12.5px; color: var(--muted); font-weight: 400; margin-top: 2px; }
.dl-note { background: #fdf3e3; border: 1px solid #f0d9b0; border-radius: 10px; padding: 10px 12px; font-size: 14px; line-height: 1.45; }
.sum-row.cod { color: var(--muted); font-size: 13.5px; border-top: 1px dashed var(--line); padding-top: 8px; }

/* Утсан дээрх сонины жижиг хуулбар */
.peek { position: fixed; right: 10px; top: calc(10px + env(safe-area-inset-top)); z-index: 40; width: 156px; padding: 6px 6px 7px; border: 0; border-radius: 12px;
  background: #fff; box-shadow: 0 8px 26px rgba(40, 20, 20, .32); display: grid; gap: 5px; cursor: pointer; font: inherit; }
.peek[hidden] { display: none; }
.peek-stage { position: relative; display: block; width: 100%; overflow: hidden; border-radius: 4px; pointer-events: none; background: #eee; }
.peek-stage .sheet { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
.peek-lbl { font-size: 11.5px; font-weight: 700; color: var(--accent); text-align: center; }
.peek.pulse { animation: peekPulse .5s ease; }
@keyframes peekPulse { 0% { transform: scale(1); } 40% { transform: scale(1.06); box-shadow: 0 10px 30px rgba(122, 46, 61, .45); } 100% { transform: scale(1); } }
@media (min-width: 881px) { .peek { display: none !important; } }

/* ── Алхам алхмаар захиалга ── */
.wiz { grid-area: wiz; display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; counter-reset: w; }
.wiz button { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 999px; background: var(--surface); font: 600 14px/1.2 var(--ui); color: var(--muted); cursor: pointer; min-width: 0; }
.wiz button span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wiz button b { width: 22px; height: 22px; flex: none; border-radius: 50%; display: grid; place-items: center; font-size: 12px; background: var(--line); color: var(--ink); }
.wiz button.on { border-color: var(--accent); color: var(--ink); box-shadow: 0 0 0 3px var(--accent-soft); }
.wiz button.on b, .wiz button.past b { background: var(--accent); color: var(--accent-ink); }
.wiz button.past b { font-size: 0; } .wiz button.past b::after { content: "✓"; font-size: 12px; }
.editor.wizard { grid-template-areas: "wiz wiz" "picker preview" "form preview"; }
.editor.wizard[data-page="2"], .editor.wizard[data-page="3"] { grid-template-areas: "wiz preview" "form preview"; }
.editor.wizard:not([data-page="1"]) .area-picker { display: none; }
.editor.wizard .pg { display: none; }
.editor.wizard[data-page="1"] .pg[data-pg="1"], .editor.wizard[data-page="2"] .pg[data-pg="2"], .editor.wizard[data-page="3"] .pg[data-pg="3"] { display: block; }
.editor.wizard .pg > .step:first-child { margin-top: 0; }
.editor.wizard .pg[data-pg="1"] > .step:first-child { margin-top: 26px; }
.pg-nav { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 22px; }
.pg-nav .btn { padding: 14px 18px; font-size: 15px; }
.pg-nav .btn:only-child, .pg-nav span + .btn { margin-left: auto; }
.pg-foot .submit-bar { margin-top: 18px; }
.editor.wizard .sum { margin-top: 18px; }
@media (max-width: 880px) {
  .editor.wizard { grid-template-areas: "wiz" "picker" "preview" "form"; }
  .editor.wizard[data-page="2"], .editor.wizard[data-page="3"] { grid-template-areas: "wiz" "form"; }
  .editor.wizard:not([data-page="1"]) .area-preview { display: none; }
  .pg-nav { position: sticky; bottom: 0; z-index: 30; background: linear-gradient(to top, var(--bg) 70%, transparent); padding: 14px 0 calc(10px + env(safe-area-inset-bottom, 0px)); margin-top: 10px; }
  .pg-nav .btn { flex: 1; } .pg-nav span { display: none; }
  .pg[data-pg="3"] .pg-nav { position: static; background: none; padding: 0; }
}
@media (max-width: 420px) { .wiz button { padding: 9px 8px; font-size: 13px; gap: 6px; } }

#sms.nudge { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); animation: nudge 1s ease-in-out 3; }
@keyframes nudge { 50% { transform: translateY(-2px); } }

.toolbar .chk { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; color: var(--muted); white-space: nowrap; cursor: pointer; }

.lat-hint { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 6px; padding: 8px 10px; border-radius: 8px; background: #fdf3e3; border: 1px solid #f0d9b0; font-size: 13px; line-height: 1.4; }
.lat-hint span { flex: 1 1 200px; }
.lat-btn { flex: none; border: 0; border-radius: 999px; padding: 7px 14px; background: var(--accent); color: var(--accent-ink); font-weight: 700; font-size: 13px; cursor: pointer; }
.lat-btn:disabled { opacity: .6; cursor: wait; }

/* Админы хэрэгслийн мөр: доош гүйлгэсэн ч дээр наалттай харагдана */
#admin .toolbar:not(.pay-bar) { position: sticky; top: 0; z-index: 50; box-shadow: 0 6px 16px rgba(42, 28, 31, .08); }
#save.dirty { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
#admin .area-preview { top: calc(var(--tbh, 0px) + 12px); }

/* ── Админ: утас / суулгасан апп ── */
.tb-actions { display: contents; }
.toolbar .back { display: none; }
#login .remember { display: flex; align-items: center; gap: 10px; margin: 6px 0 14px; font-size: 14px; color: var(--muted); cursor: pointer; }
#login .remember input[type=checkbox] { width: 18px; height: 18px; margin: 0; flex: none; accent-color: var(--accent); }
.filters .reload { margin-left: auto; }
@media (max-width: 1000px) {
  .admin[data-view="list"] > section { display: none; }
  .admin[data-view="order"] > .side { display: none; }
  #admin .toolbar:not(.pay-bar) { gap: 8px; padding: 10px; margin-bottom: 12px; }
  #admin .toolbar .back { display: inline-flex; order: 0; padding: 8px 14px; font-size: 18px; }
  #admin .toolbar:not(.pay-bar) .meta { order: 1; flex: 1 1 calc(100% - 200px); min-width: 0; }
  #admin .toolbar .meta b { font-size: 16px; }
  #admin .toolbar .meta span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  #admin .pay-bar .meta { flex: 1 1 100%; }
  #admin .pay-bar .btn { flex: 1 1 100%; }
  #admin .toolbar #save { order: 2; padding: 9px 14px; }
  #admin .tb-actions { order: 3; flex: 1 1 100%; display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 -10px; padding: 0 10px 2px; }
  #admin .tb-actions::-webkit-scrollbar { display: none; }
  #admin .tb-actions select { width: auto; max-width: 140px; }
  #admin .tb-actions > * { flex: none; padding: 8px 12px; font-size: 13.5px; min-height: 40px; white-space: nowrap; }
  .olist button { padding-block: 14px; }
  .side { position: static; }
}
@media (display-mode: standalone) {
  header.top { padding-top: env(safe-area-inset-top, 0px); }
  header.top h1 { font-size: 22px; }
  .wrap { padding-bottom: calc(40px + env(safe-area-inset-bottom, 0px)); }
}
