/* ===== Codex QR Cloud — Templates (menu, flyer). Everything is scoped under .tpl or tpl- names. ===== */
.tpl { --muted: var(--text-muted); --tpl-ok: #2e7d32; --tpl-warn: #b45309; }
.tpl-wrap { flex: 1; min-width: 0; }
.tpl .badge-new { background: rgba(76,175,80,.14); color: #2e7d32; }
.tpl .badge-pro { background: rgba(0,101,255,.1); color: var(--secondary); }
.tpl .badge-live { background: rgba(76,175,80,.14); color: #2e7d32; }
.topbar .tpl-back { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 600; color: var(--text-muted); white-space: nowrap; margin-right: 4px; }
.topbar .tpl-back:hover { color: var(--primary); text-decoration: none; }
.topbar .tpl-title { display: flex; align-items: center; gap: 8px; min-width: 0; }
.topbar .tpl-title h1 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.tpl .btn-blue { background: var(--secondary); color: #fff; }
.tpl .btn-blue:hover { background: #0057dd; }
.tpl .btn-ghost { background: none; color: var(--secondary); padding: 8px 12px; box-shadow: none; }
.tpl .btn-ghost:hover { background: rgba(0,101,255,.06); transform: none; }
.tpl .btn-flat { background: var(--accent); box-shadow: none; }
.tpl .btn-flat:hover { background: var(--accent-dark); box-shadow: none; transform: none; }
.tpl .btn-block { width: 100%; }
.tpl .linkish { background: none; border: none; padding: 0; color: var(--secondary); font: inherit; font-weight: 600; cursor: pointer; }
.tpl .linkish:hover { text-decoration: underline; }
.tpl .icon-btn { width: 32px; height: 32px; border-radius: 8px; border: 1.5px solid var(--border); background: #fff; color: var(--muted); display: inline-grid; place-items: center; cursor: pointer; flex-shrink: 0; padding: 0; }
.tpl .icon-btn:hover { color: var(--primary); border-color: #cbd5e1; }
.tpl .icon-btn.danger:hover { color: var(--danger); border-color: #fecaca; }
.tpl .icon-btn svg { width: 16px; height: 16px; }
.tpl .form-group:last-child { margin-bottom: 0; }
.tpl .form-group small, .tpl .hint { display: block; margin-top: 6px; font-size: 12px; color: var(--muted); line-height: 1.45; }
.tpl .label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--text); }
.tpl .opt-label { color: var(--muted); font-weight: 500; }
.tpl .card-sub { font-size: 13px; color: var(--muted); margin: -12px 0 16px; }

/* Builder: form left, sticky live preview right */
.tpl .howto { display: flex; align-items: center; gap: 12px; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 16px; margin-bottom: 20px; font-size: 13.5px; color: #334155; }
.tpl .howto svg { width: 22px; height: 22px; color: var(--secondary); flex-shrink: 0; }
.tpl .howto b { color: var(--primary); }
.tpl .builder { display: grid; grid-template-columns: minmax(340px, 460px) minmax(0, 1fr); gap: 24px; align-items: start; }
.tpl .pane-form, .tpl .pane-preview { min-width: 0; }
.tpl .builder > .pane-preview { align-self: stretch; }
.tpl .preview-card { position: sticky; top: calc(var(--topbar-h) + 16px); margin-bottom: 0; }
@media (min-width: 1024px) { .tpl .preview-card { max-height: calc(100vh - var(--topbar-h) - 32px - var(--ad-dock-h)); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; } }
.tpl .preview-card .card-header { margin-bottom: 14px; }
.tpl .preview-meta { font-size: 12.5px; color: var(--muted); }
.tpl .preview-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.tpl .preview-actions .btn-primary { flex: 1 1 180px; }
.tpl .preview-secondary { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.tpl .preview-secondary .btn { flex: 1 1 0; }
.tpl .short-link { text-align: center; font-size: 13px; color: var(--muted); margin-top: 12px; }
.tpl .short-link b { color: var(--accent); }
.tpl .short-link a { font-weight: 600; }
.tpl .pages-wrap { position: relative; flex: none; }
.tpl .pages-scaler { transform-origin: top left; position: absolute; top: 0; left: 0; }
.tpl .pages-scaler .tpl-pg { box-shadow: 0 6px 20px rgba(1,11,83,.18); margin-bottom: 24px; }
.tpl .sheet-close { display: none; }
.tpl .mini-bar { display: none; }
.tpl-host { position: fixed; top: 0; left: -12000px; width: 900px; pointer-events: none; }
.tpl-host.measure { visibility: hidden; }

/* Choice tiles, swatches, toggles */
.tpl .choices { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 10px; }
.tpl .choice { border: 2px solid var(--border); border-radius: 12px; background: #fff; padding: 8px; cursor: pointer; text-align: center; font-size: 12px; font-weight: 600; color: var(--muted); transition: border-color .15s; }
.tpl .choice:hover { border-color: #cbd5e1; }
.tpl .choice.active { border-color: var(--secondary); color: var(--primary); }
.tpl .choice .thumb { height: 60px; border-radius: 6px; margin-bottom: 6px; position: relative; overflow: hidden; }
.tpl .thumb i { position: absolute; display: block; border-radius: 2px; }
.tpl .swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.tpl .swatch { width: 30px; height: 30px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 1.5px var(--border); cursor: pointer; padding: 0; }
.tpl .swatch.active { box-shadow: 0 0 0 2.5px var(--secondary); }
.tpl .upload { display: flex; align-items: center; gap: 12px; border: 2px dashed var(--border); border-radius: 12px; padding: 10px 12px; background: var(--bg); cursor: pointer; font-size: 13px; color: var(--muted); margin: 0; font-weight: 500; }
.tpl .upload:hover { border-color: var(--secondary); }
.tpl .upload img { width: 44px; height: 44px; object-fit: contain; border-radius: 8px; background: #fff; }
.tpl .upload .ph { width: 44px; height: 44px; border-radius: 8px; background: #fff; display: grid; place-items: center; color: #94a3b8; flex-shrink: 0; }
.tpl .toggle { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 500; cursor: pointer; user-select: none; margin: 0; }
.tpl .toggle input { display: none; }
.tpl .toggle .track { width: 40px; height: 22px; border-radius: 22px; background: var(--border); position: relative; transition: background .2s; flex-shrink: 0; }
.tpl .toggle .track::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: left .2s; }
.tpl .toggle input:checked + .track { background: var(--accent); }
.tpl .toggle input:checked + .track::after { left: 21px; }
.tpl .segmented { display: flex; background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 3px; gap: 2px; }
.tpl .segmented button { flex: 1; border: none; background: none; border-radius: 7px; padding: 7px 6px; font-size: 12.5px; font-weight: 600; color: var(--muted); cursor: pointer; white-space: nowrap; }
.tpl .segmented button.active { background: #fff; color: var(--primary); box-shadow: var(--shadow-sm); }
.tpl .more { margin-top: 4px; }
.tpl .more > summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--secondary); list-style: none; display: inline-flex; align-items: center; gap: 6px; }
.tpl .more > summary::-webkit-details-marker { display: none; }
.tpl .more > summary::after { content: '›'; font-size: 16px; transition: transform .2s; }
.tpl .more[open] > summary::after { transform: rotate(90deg); }
.tpl .more-body { padding-top: 14px; }

/* Menu sections editor */
.tpl .sec { border: 1.5px solid var(--border); border-radius: 12px; margin-bottom: 10px; background: #fff; }
.tpl .sec > summary { list-style: none; display: flex; align-items: center; gap: 10px; padding: 12px 14px; cursor: pointer; font-weight: 700; font-size: 14px; }
.tpl .sec > summary::-webkit-details-marker { display: none; }
.tpl .sec > summary .chev { width: 18px; height: 18px; color: var(--muted); transition: transform .2s; flex-shrink: 0; }
.tpl .sec[open] > summary .chev { transform: rotate(90deg); }
.tpl .sec > summary .cnt { font-weight: 500; color: var(--muted); font-size: 12.5px; margin-left: auto; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.tpl .sec > summary .ttl { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tpl .sec-body { padding: 0 14px 12px; }
.tpl .sec-top { display: flex; gap: 6px; align-items: center; margin-bottom: 8px; }
.tpl .sec-top input { font-weight: 600; }
.tpl .sec input[type=text] { width: 100%; padding: 9px 12px; border: 1.5px solid var(--border); border-radius: var(--radius-sm); font-size: 14px; background: #fff; color: var(--text); min-width: 0; }
.tpl .sec input[type=text]:focus { outline: none; border-color: var(--secondary); box-shadow: 0 0 0 3px rgba(0,101,255,.12); }
.tpl .item { border-top: 1px dashed var(--border); padding: 10px 0; }
.tpl .item-row { display: grid; grid-template-columns: minmax(0,1fr) 88px 32px; gap: 6px; align-items: center; }
.tpl .item .desc { margin-top: 6px; font-size: 13px; padding: 8px 12px; }
.tpl .item.check input[data-k=name], .tpl .item.check input[data-k=price] { border-color: #f5c27a; background: #fffaf0; }
.tpl .sec-deal { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 6px; margin-bottom: 4px; }
.tpl .sec-opts { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; margin: 2px 0 8px; font-size: 12px; color: var(--muted); }
.tpl .sec-opts label { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.tpl .sec-add-deal { font-size: 13px; margin: 0 0 8px; }
.tpl .check-tag { display: inline-flex; align-items: center; gap: 5px; margin-top: 6px; font-size: 12px; font-weight: 600; color: var(--tpl-warn); }
.tpl .check-tag::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: #f59e0b; }
.tpl .check-dot { width: 7px; height: 7px; border-radius: 50%; background: #f59e0b; display: inline-block; }
.tpl .menu-tools { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }

/* AI import: the first screen */
.tpl .hero { background: #fff; border: 1.5px solid var(--border); border-radius: var(--radius); padding: 28px; margin-bottom: 20px; display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 28px; align-items: center; }
.tpl .hero h2 { font-size: 24px; line-height: 1.2; font-weight: 800; color: var(--primary); margin: 0 0 8px; }
.tpl .hero p.lead { font-size: 15px; color: #334155; margin: 0 0 18px; line-height: 1.5; }
.tpl .hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.tpl .hero-actions .btn { padding: 13px 20px; }
.tpl .hero-limits { font-size: 12.5px; color: var(--muted); margin: 12px 0 0; }
.tpl .hero-ways { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 10px; margin-top: 16px; }
.tpl .way { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; background: #fff; border: 1.5px solid var(--border); border-radius: 12px; font: inherit; color: var(--text); text-align: start; cursor: pointer; transition: border-color .15s, background .15s; }
.tpl .way:hover { border-color: var(--secondary); background: #F7FAFF; }
.tpl .way-ic { flex-shrink: 0; width: 36px; height: 36px; border-radius: 10px; background: #EEF4FF; color: var(--secondary); display: grid; place-items: center; }
.tpl .way-ic svg { width: 18px; height: 18px; }
.tpl .way-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; font-size: 13px; line-height: 1.35; }
.tpl .way-txt b { font-size: 13.5px; color: var(--primary); }
.tpl .way-txt span { color: var(--secondary); font-weight: 600; }
.tpl .way-go { flex-shrink: 0; width: 16px; height: 16px; color: var(--muted); }
.tpl [dir=rtl] .way-go, .tpl .way-go:dir(rtl) { transform: scaleX(-1); }
.tpl .hero-alt { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--border); font-size: 13.5px; color: var(--muted); display: flex; gap: 6px 14px; flex-wrap: wrap; align-items: center; }
.tpl .hero-art { background: #F1F4F9; border-radius: 14px; padding: 18px; display: flex; align-items: center; justify-content: center; gap: 14px; min-height: 220px; }
.tpl .hero-art svg { width: 100%; max-width: 340px; height: auto; }
.tpl .tray { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
.tpl .tray-pg { position: relative; width: 74px; height: 98px; border-radius: 8px; overflow: hidden; border: 1.5px solid var(--border); background: #F1F4F9; }
.tpl .tray-pg img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tpl .tray-pg .n { position: absolute; left: 5px; bottom: 5px; background: rgba(1,11,83,.8); color: #fff; font-size: 11px; font-weight: 700; border-radius: 6px; padding: 1px 6px; }
.tpl .tray-pg .x { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border-radius: 50%; border: none; background: rgba(1,11,83,.8); color: #fff; font-size: 14px; line-height: 1; cursor: pointer; padding: 0; }
.tpl .tray-add { width: 74px; height: 98px; border-radius: 8px; border: 2px dashed var(--border); background: var(--bg); color: var(--secondary); font-size: 12px; font-weight: 700; cursor: pointer; display: grid; place-items: center; text-align: center; padding: 6px; }
.tpl .tray-add:hover { border-color: var(--secondary); }
.tpl .hero.working .hero-idle, .tpl .hero.failed .hero-idle, .tpl .hero.tray-on .hero-idle, .tpl .hero.voice .hero-idle { display: none; }
.tpl .hero.voice { grid-template-columns: minmax(0, 1fr); }
.tpl .hero.voice .hero-art, .tpl .hero-voice { display: none; }
.tpl .hero.voice:not(.working):not(.failed) .hero-voice { display: block; }
.tpl .hero-voice { position: relative; max-width: 760px; }
.tpl .voice-x { position: absolute; top: -8px; inset-inline-end: -8px; width: 34px; height: 34px; border-radius: 50%; border: none; background: #F1F4F9; color: var(--muted); font-size: 20px; line-height: 1; cursor: pointer; }
.tpl .voice-head { display: flex; align-items: center; gap: 16px; margin-bottom: 10px; padding-inline-end: 36px; }
.tpl .voice-head h2 { margin: 0; }
.tpl .voice-mic { flex-shrink: 0; width: 56px; height: 56px; border-radius: 50%; background: #EEF4FF; color: var(--secondary); display: grid; place-items: center; }
.tpl .voice-mic svg { width: 26px; height: 26px; }
.tpl .hero-voice.on .voice-mic { background: var(--secondary); color: #fff; animation: tpl-mic 1.6s ease-out infinite; }
@keyframes tpl-mic { 0% { box-shadow: 0 0 0 0 rgba(0,101,255,.35); } 100% { box-shadow: 0 0 0 18px rgba(0,101,255,0); } }
.tpl .voice-state { margin: 2px 0 0; font-size: 13.5px; font-weight: 600; color: var(--muted); }
.tpl .hero-voice.on .voice-state { color: var(--secondary); }
.tpl .voice-tip { font-size: 14.5px; color: #334155; line-height: 1.5; margin: 0 0 14px; }
.tpl .voice-msg { background: #FFF7ED; border: 1px solid #FED7AA; color: #9A3412; border-radius: 10px; padding: 10px 14px; font-size: 13.5px; line-height: 1.5; margin: 0 0 12px; }
.tpl #voice-text { width: 100%; min-height: 170px; padding: 14px 16px; border: 1.5px solid var(--border); border-radius: 12px; font-family: inherit; font-size: 17px; line-height: 1.55; color: var(--text); background: #FBFCFE; resize: vertical; }
.tpl #voice-text:focus { outline: none; border-color: var(--secondary); box-shadow: 0 0 0 3px rgba(0,101,255,.12); background: #fff; }
.tpl .voice-live { min-height: 24px; margin: 6px 2px 12px; font-size: 16px; color: var(--muted); font-style: italic; }
.tpl .way.off { cursor: default; opacity: .65; }
.tpl .way.off:hover { border-color: var(--border); background: #fff; }
.tpl .way.off .way-txt span { color: var(--muted); font-weight: 500; }
.tpl .hero-work, .tpl .hero-fail, .tpl .hero-tray { display: none; }
.tpl .hero.working .hero-work, .tpl .hero.failed .hero-fail, .tpl .hero.tray-on:not(.working):not(.failed) .hero-tray { display: block; }
.tpl .work-steps { list-style: none; margin: 14px 0 0; padding: 0; }
.tpl .work-steps li { display: flex; align-items: center; gap: 10px; font-size: 14.5px; color: var(--muted); padding: 5px 0; transition: color .3s; }
.tpl .work-steps li::before { content: ''; width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--border); flex-shrink: 0; transition: background .3s, border-color .3s; }
.tpl .work-steps li.now { color: var(--primary); font-weight: 600; }
.tpl .work-steps li.now::before { border-color: var(--secondary); border-top-color: transparent; animation: tpl-spin .8s linear infinite; }
.tpl .work-steps li.done { color: var(--tpl-ok); }
.tpl .work-steps li.done::before { background: var(--accent); border-color: var(--accent); }
@keyframes tpl-spin { to { transform: rotate(360deg); } }
.tpl .work-bar { height: 6px; border-radius: 6px; background: #E9EDF3; overflow: hidden; margin-top: 16px; }
.tpl .work-bar i { display: block; height: 100%; width: 0; background: var(--secondary); border-radius: 6px; transition: width .6s ease; }
.tpl .work-pages { display: flex; gap: 8px; margin-top: 14px; }
.tpl .work-pages .tray-pg { width: 54px; height: 72px; }
.tpl .work-pages .tray-pg::after { content: ''; position: absolute; left: 0; right: 0; height: 18%; background: rgba(0,101,255,.25); animation: tpl-scan 1.6s ease-in-out infinite alternate; }
@keyframes tpl-scan { from { top: 0; } to { top: 82%; } }
.tpl .fail-msg { font-size: 15px; color: #334155; margin: 6px 0 16px; line-height: 1.5; }
.tpl .summary { display: flex; gap: 12px; align-items: flex-start; background: #F3FAF3; border: 1px solid rgba(76,175,80,.35); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 20px; font-size: 14px; color: #1f3a22; }
.tpl .summary svg { width: 22px; height: 22px; color: var(--tpl-ok); flex-shrink: 0; margin-top: 1px; }
.tpl .summary b { color: var(--primary); }
.tpl .summary .sum-check { display: block; margin-top: 3px; font-size: 13px; color: var(--tpl-warn); }
.tpl .summary .x { margin-left: auto; background: none; border: none; color: var(--muted); font-size: 20px; line-height: 1; cursor: pointer; padding: 0 2px; }

/* Brand style */
.tpl .brand-row { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border); }
.tpl .brand-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.tpl .brand-head b { font-size: 14px; color: var(--primary); }
.tpl .brand-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.tpl .brand-edit { display: none; margin-top: 14px; }
.tpl .brand-edit.on { display: block; }
.tpl .brand-colors { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 10px; margin-bottom: 12px; }
.tpl .brand-colors label { display: flex; flex-direction: column; gap: 6px; font-size: 12px; font-weight: 600; color: var(--muted); margin: 0; }
.tpl .brand-colors input[type=color] { width: 100%; height: 38px; border: 1.5px solid var(--border); border-radius: 10px; padding: 3px; background: #fff; cursor: pointer; }
.tpl .brand-fonts { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; }
.tpl .brand-fonts select { width: 100%; padding: 9px 10px; border: 1.5px solid var(--border); border-radius: 10px; font-size: 13.5px; background: #fff; }
.tpl .brand-note { font-size: 12px; color: var(--muted); margin-top: 8px; }

/* Edit mode */
.tpl .edit-only { display: none; }
.tpl[data-mode=edit] .edit-only { display: block; }
.tpl[data-mode=edit] .create-only { display: none !important; }
.tpl .live-row { display: flex; gap: 14px; align-items: center; }
.tpl .live-qr { width: 60px; height: 60px; padding: 6px; border: 1.5px solid var(--border); border-radius: 10px; flex-shrink: 0; }
.tpl .live-row b { display: block; font-size: 15px; color: var(--primary); }
.tpl .live-row span { display: block; font-size: 12.5px; color: var(--muted); }
.tpl .ver { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--border); }
.tpl .ver:first-child { border-top: none; padding-top: 0; }
.tpl .ver-info { flex: 1; min-width: 0; }
.tpl .ver-info b { display: block; font-size: 13.5px; color: var(--primary); }
.tpl .ver-info span { font-size: 12px; color: var(--muted); }

/* Zoomable preview: header tools, stage, full screen */
.tpl .pv-head { flex-wrap: wrap; justify-content: flex-start; gap: 8px 12px; }
.tpl .pv-head .preview-meta { white-space: nowrap; }
.tpl .pv-tools { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.tpl .pv-head .sheet-close { margin-left: auto; }
.tpl .pv-seg { display: inline-flex; align-items: center; gap: 2px; padding: 2px; background: #F1F4F9; border-radius: 10px; }
.tpl .pv-seg button, .tpl .pv-ic { height: 28px; min-width: 28px; padding: 0 6px; border: none; border-radius: 8px; background: none; color: #475569; font: 600 12.5px/1 'Inter', system-ui, sans-serif; font-variant-numeric: tabular-nums; display: inline-grid; place-items: center; cursor: pointer; transition: background .15s, color .15s; }
.tpl .pv-seg button:hover:not(:disabled), .tpl .pv-ic:hover { color: var(--primary); background: #fff; }
.tpl .pv-seg button[aria-pressed=true] { background: #fff; color: var(--primary); box-shadow: 0 1px 2px rgba(1,11,83,.12); }
.tpl .pv-seg button:disabled { opacity: .35; cursor: default; }
.tpl .pv-seg button:focus-visible, .tpl .pv-ic:focus-visible { outline: 2px solid var(--secondary); outline-offset: 1px; }
.tpl .pv-seg svg, .tpl .pv-ic svg { width: 16px; height: 16px; }
.tpl .pv-pct { min-width: 46px !important; }
.tpl .pv-fit { padding: 0 9px !important; }
.tpl .pv-ic { width: 32px; height: 32px; border-radius: 10px; background: #F1F4F9; }
.tpl .pv-stage { position: relative; height: min(640px, calc(100vh - 320px)); overflow: auto; background: #EEF1F6; border-radius: 14px; outline: none; overscroll-behavior: contain; scrollbar-width: thin; touch-action: pan-x pan-y; }
.tpl .pv-stage:focus-visible { box-shadow: inset 0 0 0 2px rgba(0,101,255,.5); }
.tpl .pv-stage.pannable { cursor: grab; }
.tpl .pv-stage.grabbing { cursor: grabbing; user-select: none; }
.tpl .pv-canvas { display: grid; place-items: center; min-width: 100%; min-height: 100%; width: max-content; height: max-content; padding: 18px; }
.pv-full { position: fixed; inset: 0; z-index: 320; display: none; flex-direction: column; background: #EEF1F6; }
.pv-full.open { display: flex; }
.pv-full .pv-full-bar { flex: none; height: 60px; display: flex; align-items: center; gap: 14px; padding: 0 16px 0 24px; background: #fff; border-bottom: 1px solid var(--border); }
.pv-full .pv-full-bar b { font-size: 15px; font-weight: 700; color: var(--primary); white-space: nowrap; }
.pv-full .pv-full-hint { flex: 1; min-width: 0; font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pv-full .pv-tools { margin: 0; }
.pv-full [data-z=full] { display: none; }
.pv-full .pv-full-x { width: 36px; height: 36px; border-radius: 50%; border: none; background: #F1F4F9; color: var(--primary); display: grid; place-items: center; cursor: pointer; }
.pv-full .pv-full-x:hover { background: #E4E9F1; }
.pv-full .pv-full-x svg { width: 18px; height: 18px; }
.pv-full .pv-stage { height: calc(100vh - 60px); border-radius: 0; background: none; }
.pv-full .pv-canvas { padding: 32px; }
body.tpl-full-open { overflow: hidden; }
body.tpl-full-open #cqr-chat-widget { display: none; }

/* Phone frame: sized from --k, so the guest page is laid out at every zoom (crisp text), never scaled as a bitmap */
.tpl .phone { --k: .5; --sw: 390; --sh: 844; --b: 10; --r: 47; --sb: 50; --hb: 22; position: relative; box-sizing: content-box; width: calc(var(--sw) * var(--k) * 1px); height: calc(var(--sh) * var(--k) * 1px); padding: calc(var(--b) * var(--k) * 1px); border-radius: calc((var(--r) + var(--b)) * var(--k) * 1px); background: #0E0F12; box-shadow: 0 0 0 max(1px, calc(2px * var(--k))) #383B43, 0 2px 6px rgba(1,11,83,.1), 0 22px 40px -22px rgba(1,11,83,.5); }
.tpl .phone[data-size=l] { --sw: 430; --sh: 932; --b: 11; --r: 55; }
.tpl .ph-btn { position: absolute; width: calc(3.5px * var(--k)); background: #2A2D33; }
.tpl .ph-btn.l { left: calc(-3px * var(--k)); border-radius: calc(2px * var(--k)) 0 0 calc(2px * var(--k)); }
.tpl .ph-btn.r { right: calc(-3px * var(--k)); border-radius: 0 calc(2px * var(--k)) calc(2px * var(--k)) 0; }
.tpl .ph-act { top: 13%; height: 3.6%; }
.tpl .ph-vu { top: 19.5%; height: 6.6%; }
.tpl .ph-vd { top: 27.4%; height: 6.6%; }
.tpl .ph-pw { top: 22.6%; height: 10.4%; }
.tpl .ph-glass { position: relative; width: 100%; height: 100%; overflow: hidden; isolation: isolate; border-radius: calc(var(--r) * var(--k) * 1px); background: #fff; }
.tpl .ph-status { position: absolute; top: 0; left: 0; z-index: 3; width: calc(var(--sw) * 1px); height: calc(var(--sb) * 1px); zoom: var(--k); display: grid; grid-template-columns: 1fr 134px 1fr; align-items: center; padding-top: 6px; font: 600 16px/1 'Inter', system-ui, sans-serif; letter-spacing: -.2px; pointer-events: none; }
.tpl .ph-time { justify-self: center; padding-left: 10px; font-variant-numeric: tabular-nums; }
.tpl .ph-icons { grid-column: 3; justify-self: center; display: flex; align-items: center; gap: 6px; padding-right: 6px; }
.tpl .ph-icons svg { display: block; fill: currentColor; }
.tpl .ph-island { position: absolute; top: 11px; left: 50%; width: 122px; height: 35px; margin-left: -61px; border-radius: 18px; background: #000; }
.tpl .ph-view { position: absolute; left: 0; right: 0; top: calc(var(--sb) * var(--k) * 1px); bottom: calc(var(--hb) * var(--k) * 1px); }
.tpl .phone-screen { position: absolute; inset: 0; overflow-y: auto; overflow-x: hidden; scrollbar-width: none; overscroll-behavior: contain; }
.tpl .phone-screen::-webkit-scrollbar { display: none; }
.tpl .pv-stage.zoomed .phone-screen { overscroll-behavior: auto; }
.tpl .phone-screen > .pm { zoom: var(--k); }
.tpl .ph-view > .pm-ov { position: absolute; zoom: var(--k); }
.tpl .ph-home { position: absolute; left: 50%; bottom: calc(8px * var(--k)); z-index: 3; width: calc(134px * var(--k)); height: max(2px, calc(5px * var(--k))); margin-left: calc(-67px * var(--k)); border-radius: 9px; background: currentColor; opacity: .85; pointer-events: none; }
.tpl .phone.bare { padding: 0; border-radius: 16px; background: none; box-shadow: 0 0 0 1px var(--border); }
.tpl .phone.bare .ph-btn, .tpl .phone.bare .ph-status, .tpl .phone.bare .ph-home { display: none; }
.tpl .phone.bare .ph-glass { border-radius: 16px; }
.tpl .phone.bare .ph-view { top: 0; bottom: 0; }
.tpl .pv-stage.bare { background: none; border-radius: 0; overflow: hidden; }
.tpl .pv-stage.bare .pv-canvas { padding: 0; }

/* Modals */
.tpl-modal { position: fixed; inset: 0; background: rgba(1,11,83,.45); display: none; align-items: center; justify-content: center; padding: 16px; z-index: 300; }
.tpl-modal.open { display: flex; }
.tpl-modal .tpl-modal-box { background: #fff; border-radius: 18px; width: 100%; max-width: 560px; max-height: calc(100vh - 32px); overflow: auto; padding: 26px; box-shadow: 0 20px 40px rgba(1,11,83,.25); }
.tpl-modal h2 { font-size: 20px; font-weight: 800; margin: 0 0 4px; color: var(--primary); }
.tpl-modal .modal-x { float: right; background: none; border: none; font-size: 26px; line-height: 1; color: var(--text-muted); cursor: pointer; padding: 0; }
.tpl-modal textarea { width: 100%; padding: 11px 14px; border: 1.5px solid var(--border); border-radius: var(--radius-sm); font-size: 14px; font-family: inherit; resize: vertical; }
.tpl-modal .paste-help { font-size: 12.5px; color: var(--text-muted); margin: 6px 0 10px; }
.tpl .tpl-opt { display: flex; gap: 10px; align-items: flex-start; border: 1.5px solid var(--border); border-radius: 12px; padding: 12px 14px; cursor: pointer; margin: 0 0 8px; background: #fff; font-weight: 400; }
.tpl .tpl-opt input { margin-top: 3px; accent-color: var(--secondary); flex-shrink: 0; width: auto; }
.tpl .tpl-opt b { display: block; font-size: 14px; color: var(--primary); }
.tpl .tpl-opt span { display: block; font-size: 12.5px; color: var(--text-muted); line-height: 1.45; }
.tpl .tpl-opt.active { border-color: var(--secondary); background: #F5F9FF; }
.tpl .pro-callout { display: flex; gap: 14px; align-items: flex-start; background: #EEF5FF; border: 1px solid #CFE0FF; border-radius: var(--radius); padding: 16px 18px; margin-bottom: 0; }
.tpl .pro-callout .pc-icon { width: 38px; height: 38px; border-radius: 10px; background: var(--secondary); color: #fff; display: grid; place-items: center; flex-shrink: 0; }
.tpl .pro-callout .pc-icon svg { width: 20px; height: 20px; }
.tpl .pro-callout h3 { font-size: 14.5px; color: var(--primary); margin: 0 0 2px; }
.tpl .pro-callout p { font-size: 13px; color: #334155; margin: 0; }
.tpl .free-note { margin-top: 12px; background: #fff7ed; border: 1px solid #fed7aa; color: #7c2d12; padding: 10px 14px; border-radius: 10px; font-size: 13px; }
.tpl .warn-note { margin: 10px 0 0; background: #fffbeb; border: 1px solid #fde68a; color: #78350f; padding: 9px 12px; border-radius: 10px; font-size: 12.5px; }
.tpl .done-grid { display: grid; grid-template-columns: 132px minmax(0,1fr); gap: 18px; align-items: center; margin: 16px 0; }
.tpl .done-qr { width: 132px; height: 132px; padding: 9px; border: 1.5px solid var(--border); border-radius: 14px; }
.tpl .kv { font-size: 13.5px; margin-bottom: 5px; color: var(--text-muted); word-break: break-word; }
.tpl .kv b { color: var(--primary); font-weight: 600; }
.tpl .done-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
body.tpl-sheet-open { overflow: hidden; }

/* Tablet and phone: compact sticky preview bar + full-screen preview sheet */
@media (max-width: 1023px) {
  .tpl .builder { grid-template-columns: minmax(0, 1fr); }
  .tpl .mini-bar { display: flex; align-items: center; gap: 12px; position: sticky; top: calc(var(--topbar-h) + 8px); z-index: 60; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 8px 10px 8px 8px; margin-bottom: 16px; box-shadow: var(--shadow-md); }
  .tpl .mini-thumb { width: 60px; height: 85px; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; position: relative; padding: 0; background: #fff; cursor: pointer; flex-shrink: 0; transition: box-shadow .25s; }
  .tpl .mini-thumb.pulse { box-shadow: 0 0 0 3px rgba(0,101,255,.35); }
  .tpl .mini-scaler { transform-origin: top left; position: absolute; top: 0; left: 0; pointer-events: none; }
  .tpl .mini-info { flex: 1; min-width: 0; }
  .tpl .mini-info b { display: block; font-size: 13.5px; color: var(--primary); }
  .tpl .mini-info span { display: block; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .tpl .pane-preview { position: fixed; inset: 0; z-index: 250; background: rgba(1,11,83,.55); padding: 12px; overflow-y: auto; display: none; }
  .tpl .pane-preview.open { display: block; }
  .tpl .preview-card { position: static; max-width: 640px; margin: 0 auto; }
  .tpl .pv-tools { display: none; }
  .tpl .sheet-close { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; border: none; background: var(--bg); font-size: 22px; line-height: 1; color: var(--primary); cursor: pointer; padding: 0; }
  .tpl .hero { grid-template-columns: minmax(0, 1fr); }
  .tpl .hero-art { display: none; }
}
@media (max-width: 768px) {
  .topbar .tpl-back .bl-text, .topbar .tpl-title .badge { display: none; }
}
@media (max-width: 520px) {
  .tpl .choices { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .tpl .item-row { grid-template-columns: minmax(0,1fr) 76px 32px; }
  .tpl .done-grid { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .tpl .pane-preview { padding: 0; background: #fff; }
  .tpl .pane-preview .preview-card { border-radius: 0; box-shadow: none; min-height: 100%; padding: 14px 14px 18px; }
  .tpl .howto { font-size: 12.5px; padding: 10px 12px; }
  .tpl .hero { padding: 20px 18px; }
  .tpl .hero h2 { font-size: 21px; }
  .tpl .hero-actions .btn { flex: 1 1 100%; }
  .tpl .brand-colors { grid-template-columns: repeat(3, minmax(0,1fr)); gap: 6px; }
  .tpl .brand-fonts { grid-template-columns: 1fr; }
  .tpl-modal .tpl-modal-box { padding: 20px; }
}

/* Owner print view (A4 / Letter at 96 dpi) and QR cards */
.tpl-pg { position: relative; overflow: hidden; background: #fff; display: flex; flex-direction: column; }
.tpl-pg * { box-sizing: border-box; }
.tpl-pg[dir=rtl] * { font-style: normal !important; }
.mp { --acc: #9A3B2E; --ink: #2B2118; --soft: #6E6253; --paper: #FBF6EC; --line: #E4D9C5; background: var(--paper); color: var(--ink); padding: 62px 64px 40px; font-family: 'Inter', 'Cairo', 'Heebo', sans-serif; line-height: 1.35; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.mp-head { margin-bottom: 22px; }
.mp-logo { display: block; height: 74px; width: auto; max-width: 220px; object-fit: contain; }
.mp-name { line-height: 1.12; word-break: break-word; }
.mp-tag { margin-top: 8px; color: var(--soft); }
.mp-body { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); grid-template-rows: minmax(0,1fr); column-gap: 46px; }
.mp-col { min-height: 0; overflow: hidden; }
.mp-sec { margin: 0 0 12px; }
.mp .blk { padding-bottom: 10px; }
.mp .blk.gap { padding-top: 12px; }
.mp-item-top { display: flex; align-items: baseline; gap: 8px; }
.mp-item-name { font-weight: 600; }
.mp-dots { flex: 1; border-bottom: 1.5px dotted var(--line); transform: translateY(-4px); min-width: 16px; }
.mp-price { font-weight: 700; white-space: nowrap; }
.mp-deal { margin: -4px 0 12px; font-size: 14px; color: var(--soft); }
.mp-deal b { color: var(--acc); font-size: 16px; margin-inline-end: 10px; }
.mp.st-trattoria .mp-deal { text-align: center; }
.mp-desc { color: var(--soft); margin-top: 2px; }
.mp-foot { display: flex; align-items: center; gap: 20px; padding-top: 18px; margin-top: 8px; border-top: 1px solid var(--line); }
.mp-note { flex: 1; font-size: 12px; color: var(--soft); line-height: 1.5; }
.mp-qrbox { display: flex; align-items: center; gap: 12px; }
.mp-qrtext { text-align: end; font-size: 11.5px; line-height: 1.35; color: var(--soft); max-width: 150px; }
.mp-qrtext b { display: block; color: var(--ink); font-size: 12.5px; }
.mp-qrtile { width: 92px; height: 92px; padding: 7px; background: #fff; border-radius: 10px; border: 1px solid var(--line); flex-shrink: 0; }
.mp-qr { width: 100%; height: 100%; }
.mp-pageno { text-align: center; font-size: 11px; color: var(--soft); padding-top: 12px; letter-spacing: .1em; }
.mp-cont { font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: var(--soft); margin-bottom: 20px; }
.mp.st-trattoria .mp-head { text-align: center; }
.mp.st-trattoria .mp-logo { margin: 0 auto 12px; }
.mp.st-trattoria .mp-name { font-family: 'Playfair Display', 'Noto Naskh Arabic', 'Heebo', serif; font-weight: 700; font-size: 46px; }
.mp.st-trattoria .mp-tag { font-family: 'Lora', 'Noto Naskh Arabic', 'Heebo', serif; font-style: italic; font-size: 15px; }
.mp.st-trattoria .mp-orn { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 16px; }
.mp.st-trattoria .mp-orn span { width: 70px; height: 1px; background: var(--acc); }
.mp.st-trattoria .mp-orn i { width: 7px; height: 7px; background: var(--acc); transform: rotate(45deg); }
.mp.st-trattoria .mp-sec { font-family: 'Playfair Display', 'Noto Naskh Arabic', 'Heebo', serif; font-size: 20px; font-weight: 600; color: var(--acc); text-align: center; display: flex; align-items: center; gap: 12px; }
.mp.st-trattoria .mp-sec::before, .mp.st-trattoria .mp-sec::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.mp.st-trattoria .mp-item { text-align: center; }
.mp.st-trattoria .mp-item-top { justify-content: center; }
.mp.st-trattoria .mp-dots { display: none; }
.mp.st-trattoria .mp-item-name { font-family: 'Playfair Display', 'Noto Naskh Arabic', 'Heebo', serif; font-size: 16.5px; }
.mp.st-trattoria .mp-price { font-family: 'Lora', 'Noto Naskh Arabic', 'Heebo', serif; font-size: 15px; color: var(--acc); font-weight: 500; }
.mp.st-trattoria .mp-price::before { content: '·'; margin-inline-end: 8px; color: var(--soft); }
.mp.st-trattoria .mp-desc { font-family: 'Lora', 'Noto Naskh Arabic', 'Heebo', serif; font-style: italic; font-size: 13px; line-height: 1.4; }
.mp.st-trattoria .mp-note { font-family: 'Lora', 'Noto Naskh Arabic', 'Heebo', serif; font-style: italic; }
.mp.st-modern { --paper: #ffffff; --ink: #111827; --soft: #6B7280; --line: #D1D5DB; padding-top: 0; }
.mp.st-modern .mp-bar { height: 12px; background: var(--acc); margin: 0 -64px 50px; }
.mp.st-modern .mp-head { display: flex; align-items: center; gap: 22px; }
.mp.st-modern .mp-logo { height: 70px; max-width: 120px; }
.mp.st-modern .mp-name { font-weight: 900; font-size: 48px; letter-spacing: -1.5px; }
.mp.st-modern .mp-tag { font-size: 15px; font-weight: 500; margin-top: 4px; }
.mp.st-modern .mp-sec { font-size: 13px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; color: var(--acc); padding-bottom: 8px; border-bottom: 2px solid var(--acc); }
.mp.st-modern .mp-item-name, .mp.st-modern .mp-price { font-size: 15px; }
.mp.st-modern .mp-desc { font-size: 12.5px; line-height: 1.45; }
.mp.st-modern[dir=rtl] .mp-sec { font-size: 16px; }
.mp.st-bistro { --paper: #16181D; --ink: #F2ECE0; --soft: #B5AD9F; --line: #3A3C42; }
.mp.st-bistro .mp-head { text-align: center; }
.mp.st-bistro .mp-logo { margin: 0 auto 14px; }
.mp.st-bistro .mp-name { font-family: 'DM Serif Display', 'Noto Naskh Arabic', 'Heebo', serif; font-weight: 400; font-size: 54px; letter-spacing: .5px; }
.mp.st-bistro .mp-tag { font-size: 12.5px; letter-spacing: .28em; text-transform: uppercase; color: var(--acc); margin-top: 10px; }
.mp.st-bistro .mp-frame { position: absolute; inset: 22px; border: 1px solid var(--acc); opacity: .55; pointer-events: none; }
.mp.st-bistro .mp-sec { font-family: 'DM Serif Display', 'Noto Naskh Arabic', 'Heebo', serif; font-size: 25px; font-weight: 400; color: var(--acc); padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.mp.st-bistro .mp-item-name { font-size: 13.5px; letter-spacing: .1em; text-transform: uppercase; }
.mp.st-bistro .mp-price { font-size: 14px; color: var(--acc); }
.mp.st-bistro .mp-dots { border-bottom-color: #4A4C52; }
.mp.st-bistro .mp-desc { font-size: 12.5px; line-height: 1.45; }
.mp.st-bistro .mp-qrtile { border-color: transparent; }
.mp.st-bistro[dir=rtl] .mp-item-name, .mp.st-bistro[dir=rtl] .mp-tag { font-size: 15px; }
.mp.st-fresh { --paper: #ffffff; --ink: #1F2A24; --soft: #66736B; --line: #E3E8E4; font-family: 'Poppins', 'Cairo', 'Heebo', sans-serif; }
.mp.st-fresh .mp-head { display: flex; align-items: center; gap: 20px; padding: 26px 28px; border-radius: 22px; background: var(--acc); color: #fff; margin-bottom: 30px; }
.mp.st-fresh .mp-head .mp-tag { color: rgba(255,255,255,.85); }
.mp.st-fresh .mp-logo { height: 64px; max-width: 110px; background: #fff; border-radius: 14px; padding: 6px; }
.mp.st-fresh .mp-name { font-weight: 700; font-size: 40px; }
.mp.st-fresh .mp-tag { font-size: 14.5px; margin-top: 2px; }
.mp.st-fresh .mp-sec { display: inline-block; font-size: 14px; font-weight: 600; color: var(--acc); background: color-mix(in srgb, var(--acc) 10%, #fff); border-radius: 30px; padding: 5px 16px; }
.mp.st-fresh .mp-item-name, .mp.st-fresh .mp-price { font-size: 15px; font-weight: 600; }
.mp.st-fresh .mp-price { color: var(--acc); }
.mp.st-fresh .mp-dots { display: none; }
.mp.st-fresh .mp-item-top { justify-content: space-between; }
.mp.st-fresh .mp-desc { font-size: 12.5px; line-height: 1.45; }
.tent, .cards { background: var(--paper); color: var(--ink); font-family: 'Inter', 'Cairo', 'Heebo', sans-serif; line-height: 1.3; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.tpl-pg .cut-line { position: absolute; pointer-events: none; }
.tpl-pg .cut-line.h { left: 0; right: 0; border-top: 1.5px dashed #9CA3AF; }
.tpl-pg .cut-line.v { top: 0; bottom: 0; left: 50%; border-left: 1.5px dashed #9CA3AF; }
.tpl-pg .cut-line span { position: absolute; right: 18px; top: -9px; background: var(--paper); padding: 0 6px; font: 600 10px 'Inter', sans-serif; color: #9CA3AF; letter-spacing: .14em; text-transform: uppercase; }
.tpl-pg .card-qr { width: 100%; height: 100%; }
.tent-half { position: absolute; left: 0; width: 100%; display: flex; align-items: center; gap: 40px; padding: 0 70px; }
.tent-half.top { top: 0; transform: rotate(180deg); }
.tent-txt { flex: 1; min-width: 0; }
.tent-logo { height: 56px; width: auto; max-width: 160px; object-fit: contain; display: block; margin-bottom: 14px; }
.tent-name { font-size: 22px; color: var(--soft); margin-bottom: 8px; }
.tent-cta { font-size: 50px; line-height: 1.1; }
.tent-cta em, .qc-cta em { font-style: normal; color: var(--acc); }
.tent-sub { margin-top: 16px; font-size: 15px; color: var(--soft); line-height: 1.5; }
.tent-qrcol { display: flex; flex-direction: column; align-items: center; }
.tent-qrtile { width: 250px; height: 250px; padding: 16px; background: #fff; border-radius: 22px; border: 2px solid var(--line); flex-shrink: 0; }
.tent-link { margin-top: 10px; font: 600 14px 'Inter', sans-serif; color: var(--soft); letter-spacing: .04em; }
.qc-grid { position: absolute; inset: 0; display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }
.qc { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 30px 34px; }
.qc-logo { height: 42px; width: auto; max-width: 140px; object-fit: contain; margin-bottom: 10px; }
.qc-name { font-size: 17px; color: var(--soft); margin-bottom: 6px; }
.qc-cta { font-size: 27px; line-height: 1.15; margin-bottom: 18px; }
.qc-qrtile { width: 190px; height: 190px; padding: 12px; background: #fff; border-radius: 18px; border: 2px solid var(--line); }
.qc-link { margin-top: 8px; font: 600 12px 'Inter', sans-serif; color: var(--soft); letter-spacing: .04em; }

/* Flyer pages */
.tpl-pg.fl { --th: #010B53; --hi: #FFD25A; color: #fff; font-family: 'Inter', 'Cairo', 'Heebo', sans-serif; line-height: 1.3; }
.tpl-pg[dir=rtl] * { letter-spacing: 0 !important; }
.fl .fl-made { font: 500 9px/1.2 'Inter', sans-serif; opacity: .65; margin-top: 4px; letter-spacing: .02em; }
.fl.lay-min .fl-made { color: #6B7280; opacity: 1; }
.fl .fl-img { background-color: #DCE3EA; background-size: cover; background-position: center; }
.fl .fl-sub { font-weight: 700; font-size: 19px; letter-spacing: .02em; color: var(--hi); }
.fl .fl-head { font-weight: 900; line-height: 1.02; letter-spacing: -1.5px; word-break: break-word; }
.fl .fl-body { font-size: 18px; line-height: 1.5; opacity: .9; white-space: pre-line; }
.fl .fl-foot { font-size: 14px; opacity: .75; font-weight: 500; }
.fl .fl-bottom { margin-top: auto; display: flex; align-items: flex-end; gap: 28px; }
.fl .fl-bottom > :first-child { flex: 1; min-width: 0; }
.fl .fl-qrwrap { text-align: center; flex-shrink: 0; }
.fl .fl-cta { font-weight: 800; font-size: 19px; margin-bottom: 10px; }
.fl .fl-qrtile { width: 190px; height: 190px; padding: 14px; background: #fff; border-radius: 18px; }
.fl .fl-qr { width: 100%; height: 100%; }
.fl .fl-link { font-size: 12px; font-weight: 600; opacity: .7; margin-top: 6px; letter-spacing: .04em; }
.fl.lay-poster .fl-img { height: 47%; flex-shrink: 0; }
.fl.lay-poster .fl-panel { flex: 1; min-height: 0; background: var(--th); padding: 44px 56px 46px; display: flex; flex-direction: column; }
.fl.lay-poster .fl-head { font-size: 64px; margin: 12px 0 16px; }
.fl.lay-poster.noimg .fl-panel { padding-top: 90px; }
.fl.lay-bold { background: var(--th); padding: 56px 56px 48px; }
.fl.lay-bold .fl-head { font-family: 'Bebas Neue', 'Inter', 'Cairo', 'Heebo', sans-serif; font-weight: 400; font-size: 118px; letter-spacing: 0; line-height: .92; text-transform: uppercase; margin: 10px 0 0; }
.fl.lay-bold .fl-img { flex: 1; min-height: 0; border-radius: 26px; margin: 30px 0; }
.fl.lay-bold.noimg .fl-head { margin-bottom: 30px; }
.fl.lay-bold .fl-body { margin-bottom: 10px; }
.fl.lay-split { flex-direction: row; }
.fl.lay-split .fl-left { width: 54%; background: var(--th); padding: 64px 44px 48px; display: flex; flex-direction: column; }
.fl.lay-split .fl-img { flex: 1; background-position: 53% center; }
.fl.lay-split.noimg .fl-left { width: 100%; padding: 80px 64px 56px; }
.fl.lay-split .fl-head { font-size: 62px; margin: 16px 0 22px; }
.fl.lay-split .fl-body { font-size: 19px; }
.fl.lay-split .fl-qrtile { width: 220px; height: 220px; }
.fl.lay-split .fl-bottom { flex-direction: column; align-items: flex-start; gap: 18px; }
.fl.lay-split .fl-qrwrap { text-align: start; }
.fl.lay-min { background: #fff; color: #111827; padding: 0 64px 52px; text-align: center; }
.fl.lay-min .fl-bar { height: 16px; background: var(--th); margin: 0 -64px 66px; }
.fl.lay-min .fl-sub { color: var(--th); }
.fl.lay-min .fl-head { color: var(--th); font-size: 62px; margin: 14px 0 18px; }
.fl.lay-min .fl-body { color: #374151; opacity: 1; max-width: 560px; margin: 0 auto; }
.fl.lay-min .fl-center { margin: auto 0; padding: 30px 0; }
.fl.lay-min .fl-cta { font-size: 30px; color: var(--th); margin-bottom: 16px; }
.fl.lay-min .fl-qrtile { width: 330px; height: 330px; padding: 22px; border: 3px solid var(--th); border-radius: 26px; margin: 0 auto; }
.fl.lay-min .fl-link { color: #6B7280; opacity: 1; font-size: 15px; margin-top: 10px; }
.fl.lay-min .fl-foot { color: #6B7280; opacity: 1; }
.tpl .dest-opt { display: flex; gap: 10px; align-items: flex-start; border: 1.5px solid var(--border); border-radius: 12px; padding: 12px 14px; cursor: pointer; margin: 0 0 8px; font-weight: 400; }
.tpl .dest-opt input { margin-top: 3px; accent-color: var(--secondary); width: auto; }
.tpl .dest-opt b { display: block; font-size: 14px; color: var(--primary); }
.tpl .dest-opt span { font-size: 12.5px; color: var(--muted); }
.tpl .dest-opt.active { border-color: var(--secondary); background: #F5F9FF; }

/* Print menu: only the generated pages reach the printer */
#print-root { position: fixed; top: 0; left: -12000px; }
@media print {
  body.tpl-printing > *:not(#print-root) { display: none !important; }
  body.tpl-printing { background: #fff !important; }
  body.tpl-printing #print-root { position: static; left: auto; }
  body.tpl-printing #print-root .tpl-pg { break-after: page; box-shadow: none; }
  body.tpl-printing #print-root .tpl-pg:last-child { break-after: auto; }
}
