/* natser html builder - app styles. MOBILE FIRST: the base rules are the phone layout.
   The computer layout is added with html.desk (set by JS for wide screens with a mouse). */
:root{
  --ui:#4f46e5;--ui-d:#4338ca;--ui-soft:#eef2ff;--tx:#111827;--tx2:#4b5563;--tx3:#6b7280;--ln:#e5e7eb;--bg:#f4f5f8;--card:#fff;--bad:#dc2626;--ok:#16a34a;
  --r:12px;--tb:56px;--bn:64px;--safe-b:env(safe-area-inset-bottom,0px);
  font-family:system-ui,-apple-system,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;
}
*{box-sizing:border-box}
html,body{margin:0;height:100%;background:var(--bg);color:var(--tx);-webkit-text-size-adjust:100%}
body{overflow:hidden;font-size:16px;line-height:1.45}
button,input,select,textarea{font:inherit;color:inherit}
button{cursor:pointer}
[hidden]{display:none!important}
.desk-only{display:none}
html.desk .desk-only{display:inline}
html.desk .phone-only{display:none!important}

/* ---------- buttons + inputs (all at least 44px tall on phones) ---------- */
.btn{display:inline-flex;align-items:center;justify-content:center;gap:6px;min-height:44px;padding:0 16px;border-radius:999px;border:1px solid var(--ln);background:#fff;font-weight:600;white-space:nowrap;text-decoration:none;color:var(--tx)}
.btn:active{transform:scale(.97)}
.btn.primary{background:var(--ui);border-color:var(--ui);color:#fff}
.btn.danger{color:var(--bad)}
.btn.sm{min-height:38px;padding:0 12px;font-size:.9rem}
.btn.block{width:100%}
.btn:disabled{opacity:.45;cursor:default}
.ib{display:inline-grid;place-items:center;width:44px;height:44px;border-radius:12px;border:0;background:transparent;font-size:1.25rem;color:var(--tx)}
.ib:disabled{opacity:.35}
.ico{display:inline-block;vertical-align:-.15em;flex:none}
.ib.hb{width:auto;min-width:44px;padding:0 8px;background:var(--bg);gap:6px;display:inline-flex;align-items:center;font-size:1.3rem}
.ib.hb .hb-l{display:none;font-size:.95rem;font-weight:700}
.tb-page .ico{color:var(--tx3)}
.ftb .grip .ico{font-size:1.2rem}.selbox .h .ico{font-size:1rem}
.btn .ico{margin-right:2px}
.ib:active{background:var(--ui-soft)}
.inp{width:100%;min-height:44px;padding:10px 12px;border:1.5px solid #d1d5db;border-radius:10px;background:#fff;font-size:16px}
textarea.inp{min-height:88px;resize:vertical}
.inp:focus{outline:3px solid color-mix(in srgb,var(--ui) 25%,transparent);border-color:var(--ui)}
.hint{color:var(--tx3);font-size:.9rem;margin:6px 0}
.pb h4{margin:18px 0 8px;font-size:.78rem;letter-spacing:.06em;text-transform:uppercase;color:var(--tx3)}
.pb h4:first-child{margin-top:4px}

/* ---------- toast + modal ---------- */
.toast{position:fixed;left:50%;bottom:calc(var(--bn) + 70px + var(--safe-b));transform:translate(-50%,20px);opacity:0;pointer-events:none;background:#111827;color:#fff;padding:12px 16px;border-radius:14px;display:flex;gap:12px;align-items:center;max-width:calc(100vw - 32px);z-index:90;transition:.2s;font-weight:500}
.toast.show{opacity:1;transform:translate(-50%,0);pointer-events:auto}
.toast.bad{background:var(--bad)}
.toast button,.toast a{background:none;border:0;color:#a5b4fc;font-weight:700;padding:0;text-decoration:none}
.modal{position:fixed;inset:0;background:rgba(17,24,39,.5);z-index:80;display:flex;align-items:flex-end;justify-content:center}
.modal-card{background:#fff;width:100%;max-height:92vh;overflow:auto;border-radius:20px 20px 0 0;padding:20px 16px calc(20px + var(--safe-b));box-shadow:0 -10px 40px rgba(0,0,0,.2)}
.modal-card h3{margin:0 0 12px;font-size:1.2rem}
.mhead{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:8px}
.mhead h3{margin:0}
.mhead>span{display:flex;gap:6px;flex-wrap:wrap;justify-content:flex-end}
.mfoot{display:flex;gap:10px;justify-content:flex-end;margin-top:16px;flex-wrap:wrap}
html.desk .modal{align-items:center}
html.desk .modal-card{width:min(640px,92vw);border-radius:20px;padding:24px}

/* ---------- HOME ---------- */
.home{height:100%;overflow:auto;padding:0 16px calc(32px + var(--safe-b))}
.home-in{max-width:980px;margin:0 auto}
.home-top{display:flex;align-items:center;gap:12px;padding:18px 0 8px}
.logo{width:44px;height:44px;border-radius:12px;background:var(--ui);color:#fff;display:grid;place-items:center;font-weight:800;font-size:1.3rem}
.home-top h1{margin:0;font-size:1.35rem}
.home-top p{margin:0;color:var(--tx3);font-size:.88rem}
.cards{display:grid;grid-template-columns:1fr;gap:12px;margin:16px 0 8px}
.hcard{display:flex;gap:14px;align-items:center;text-align:left;background:#fff;border:1px solid var(--ln);border-radius:18px;padding:16px;min-height:88px;width:100%}
.hcard:active{transform:scale(.99)}
.hcard .hi{font-size:1.9rem;width:52px;height:52px;border-radius:14px;background:var(--ui-soft);display:grid;place-items:center;flex:none}
.hcard b{display:block;font-size:1.05rem}
.hcard span{color:var(--tx2);font-size:.92rem}
.hcard.main{background:var(--ui);border-color:var(--ui);color:#fff}
.hcard.main span{color:#e0e7ff}.hcard.main .hi{background:rgba(255,255,255,.18)}
.sec-h{display:flex;align-items:center;justify-content:space-between;margin:22px 0 10px}
.sec-h h2{margin:0;font-size:.8rem;letter-spacing:.08em;text-transform:uppercase;color:var(--tx3)}
.recent{display:grid;grid-template-columns:1fr;gap:10px}
.rc{background:#fff;border:1px solid var(--ln);border-radius:16px;padding:14px;display:flex;flex-direction:column;gap:10px}
.rc-top{display:flex;gap:12px;align-items:center;border:0;background:none;padding:0;text-align:left;width:100%}
.rc-sw{width:48px;height:48px;border-radius:12px;flex:none;display:grid;place-items:center;color:#fff;font-weight:800;font-size:1.2rem}
.rc-top b{display:block;font-size:1.02rem}
.rc-top small{color:var(--tx3)}
.rc-act{display:flex;gap:8px;flex-wrap:wrap}
.empty{background:#fff;border:1.5px dashed #cbd5e1;border-radius:16px;padding:22px;text-align:center;color:var(--tx3)}
.storage{margin-top:18px;color:var(--tx3);font-size:.88rem;display:flex;gap:10px;align-items:center;flex-wrap:wrap}
.dropping .home::after{content:'Drop the file to open it';position:fixed;inset:12px;border:3px dashed var(--ui);border-radius:20px;background:rgba(238,242,255,.85);display:grid;place-items:center;font-weight:700;font-size:1.3rem;color:var(--ui)}
.tpl-grid{display:grid;grid-template-columns:1fr;gap:10px}
.tpl{display:flex;gap:12px;align-items:center;text-align:left;border:1px solid var(--ln);border-radius:14px;background:#fff;padding:12px;min-height:64px;width:100%}
.tpl .hi{font-size:1.5rem;width:44px;height:44px;border-radius:12px;background:var(--ui-soft);display:grid;place-items:center;flex:none}
.tpl b{display:block}.tpl span{font-size:.88rem;color:var(--tx2)}
html.desk .cards{grid-template-columns:repeat(4,1fr)}
html.desk .hcard{flex-direction:column;align-items:flex-start;min-height:170px}
html.desk .recent{grid-template-columns:repeat(3,1fr)}
html.desk .tpl-grid{grid-template-columns:1fr 1fr}

/* ---------- EDITOR shell (phone) ---------- */
.ed{position:fixed;inset:0;display:flex;flex-direction:column;background:var(--bg)}
.tb{height:var(--tb);flex:none;display:flex;align-items:center;gap:2px;padding:0 6px;background:#fff;border-bottom:1px solid var(--ln);padding-top:env(safe-area-inset-top,0px);box-sizing:content-box}
.tb-page{display:flex;align-items:center;gap:4px;min-height:44px;max-width:38vw;padding:0 10px;border:0;background:var(--bg);border-radius:12px;font-weight:700;overflow:hidden}
.tb-page span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.tb-page.locked{cursor:default;opacity:1}.tb-page.locked .pb-car{display:none}
.tb-sp{flex:1}
.tb-status{font-size:.8rem;color:var(--tx3);white-space:nowrap;display:none}
.tb .btn{min-height:40px;padding:0 12px}
.ed-body{flex:1;min-height:0;display:flex;position:relative}
.lp,.rp{display:none}
.stage{flex:1;min-width:0;overflow:auto;position:relative;-webkit-overflow-scrolling:touch;padding-bottom:calc(var(--bn) + 80px + var(--safe-b))}
.frame{margin:0 auto;background:#fff;min-height:100%;transition:max-width .25s}
.frame>.sb-site{min-height:100%}
.bnav{position:fixed;left:0;right:0;bottom:0;height:calc(var(--bn) + var(--safe-b));padding-bottom:var(--safe-b);background:#fff;border-top:1px solid var(--ln);display:flex;z-index:40}
.bnav button{flex:1;border:0;background:none;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;font-size:.72rem;font-weight:600;color:var(--tx2)}
.bnav button i{font-style:normal;font-size:1.35rem;line-height:1}
.bnav button.on{color:var(--ui)}

/* floating toolbar: on phones it is a bar fixed above the bottom navigation */
.ftb{position:fixed;left:8px;right:8px;bottom:calc(var(--bn) + 8px + var(--safe-b));z-index:45;background:#111827;color:#fff;border-radius:16px;display:flex;align-items:center;gap:2px;padding:4px;overflow-x:auto;scrollbar-width:none;box-shadow:0 8px 30px rgba(0,0,0,.25)}
.ftb::-webkit-scrollbar{display:none}
.ftb button,.ftb .grip{flex:none;min-width:44px;height:44px;border:0;background:none;color:#fff;border-radius:10px;font-size:1.05rem;display:grid;place-items:center;padding:0 8px}
.ftb button:active,.ftb button.on{background:rgba(255,255,255,.16)}
.ftb .grip{cursor:grab;touch-action:none;font-size:1.3rem}
.ftb .lbl{flex:none;font-size:.85rem;font-weight:700;padding:0 8px;white-space:nowrap;opacity:.9}
.ftb .sep{flex:none;width:1px;height:26px;background:rgba(255,255,255,.2);margin:0 2px}
.ftb .dng{color:#fca5a5}
.ftb .txt{font-size:.85rem;font-weight:700}

/* bottom sheet */
.sheet{position:fixed;left:0;right:0;bottom:0;z-index:60;background:#fff;border-radius:20px 20px 0 0;box-shadow:0 -12px 40px rgba(0,0,0,.18);max-height:min(68vh,640px);display:flex;flex-direction:column;padding-bottom:var(--safe-b);animation:up .18s ease-out}
.sheet.tall{max-height:88vh}
@keyframes up{from{transform:translateY(40px)}}
.sh-grab{width:40px;height:5px;border-radius:9px;background:#d1d5db;margin:8px auto 0;flex:none}
.sh-head{display:flex;align-items:center;justify-content:space-between;padding:2px 8px 2px 16px;flex:none}
.sh-head b{font-size:1.05rem}
.sheet .pb{overflow:auto;padding:4px 16px 20px;flex:1;-webkit-overflow-scrolling:touch}
.sheet-dim{position:fixed;inset:0;z-index:55;background:rgba(17,24,39,.15)}

/* ---------- panel contents ---------- */
.pal{display:grid;grid-template-columns:repeat(3,1fr);gap:8px}
.pit{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;min-height:76px;border:1px solid var(--ln);border-radius:14px;background:#fff;font-size:.82rem;font-weight:600;text-align:center;padding:6px;user-select:none;-webkit-user-select:none}
.pit span{font-size:1.5rem;line-height:1}
.pit:active{background:var(--ui-soft);border-color:var(--ui)}
.pal.one{grid-template-columns:1fr 1fr}
.pit.wide{flex-direction:row;justify-content:flex-start;min-height:52px;padding:8px 10px;text-align:left;gap:8px}
.pit.wide span{font-size:1.2rem}
.fl{display:flex;flex-direction:column;gap:6px;margin:12px 0;font-weight:600;font-size:.92rem}
.fl.row{flex-direction:row;align-items:center;justify-content:space-between}
.fll{font-weight:600}
.chk{display:flex;gap:10px;align-items:center;min-height:44px;font-weight:600;font-size:.92rem}
.chk input{width:22px;height:22px;accent-color:var(--ui)}
.seg{display:flex;background:var(--bg);border-radius:12px;padding:3px;gap:3px}
.seg.wrap{flex-wrap:wrap}
.seg button{flex:1;min-height:40px;border:0;border-radius:9px;background:none;font-weight:600;font-size:.9rem;padding:0 8px}
.seg button.on{background:#fff;box-shadow:0 1px 3px rgba(0,0,0,.15);color:var(--ui)}
.rg{display:flex;align-items:center;gap:10px}
.rg input{flex:1;accent-color:var(--ui);height:32px}
.rg output{min-width:56px;text-align:right;font-variant-numeric:tabular-nums;color:var(--tx2)}
.sw{display:flex;flex-wrap:wrap;gap:8px;align-items:center}
.sw button{width:40px;height:40px;border-radius:50%;border:2px solid #fff;box-shadow:0 0 0 1px var(--ln)}
.sw button.on{box-shadow:0 0 0 3px var(--ui)}
.sw button.none{background:repeating-linear-gradient(45deg,#fff,#fff 4px,#eee 4px,#eee 8px);color:var(--tx3);font-size:.8rem}
.sw input[type=color]{width:44px;height:40px;border:0;background:none;padding:0}
input[type=color]{min-width:44px;min-height:40px;border:1px solid var(--ln);border-radius:10px;background:#fff;padding:2px}
.imgf{display:flex;gap:12px;align-items:center}
.thumb{width:76px;height:76px;border-radius:12px;background:#eef0f4 center/cover no-repeat;display:grid;place-items:center;font-size:1.6rem;flex:none;border:1px solid var(--ln)}
.imgb{display:flex;flex-direction:column;gap:6px}
.gal{display:grid;grid-template-columns:repeat(4,1fr);gap:6px}
.gi{aspect-ratio:1;border-radius:10px;background:#eef0f4 center/cover;position:relative}
.gi button{position:absolute;top:3px;right:3px;width:26px;height:26px;border-radius:50%;border:0;background:rgba(0,0,0,.6);color:#fff;font-size:.75rem}
.gadd{aspect-ratio:1;border-radius:10px;border:2px dashed #cbd5e1;background:#fff;font-size:1.5rem;color:var(--tx3)}
.emo{display:grid;grid-template-columns:repeat(6,1fr);gap:6px}
.emo button{min-height:44px;border:1px solid var(--ln);border-radius:10px;background:#fff;font-size:1.3rem}
.emo button.on{border-color:var(--ui);background:var(--ui-soft)}
.lay{display:grid;grid-template-columns:repeat(4,1fr);gap:8px}
.lay button{height:44px;border:1.5px solid var(--ln);border-radius:10px;background:#fff;display:flex;gap:3px;padding:7px}
.lay button i{background:#cbd5e1;border-radius:3px}
.lay button.on{border-color:var(--ui)}.lay button.on i{background:var(--ui)}
.themes{display:grid;grid-template-columns:repeat(3,1fr);gap:8px}
.themes button{border:1px solid var(--ln);border-radius:12px;background:#fff;padding:8px;display:flex;flex-wrap:wrap;gap:3px;justify-content:center;min-height:60px}
.themes i{width:18px;height:18px;border-radius:50%}
.themes small{width:100%;text-align:center;font-weight:600;font-size:.78rem}
.tips{background:var(--ui-soft);border-radius:14px;padding:14px;color:#3730a3;font-size:.9rem;margin-top:16px}
.tips ul{margin:6px 0 0;padding-left:18px}
.nums{display:grid;grid-template-columns:repeat(3,1fr);gap:8px}
.nums label{display:flex;flex-direction:column;gap:4px;font-size:.8rem;font-weight:600;color:var(--tx2)}
.boxed{border:1px solid var(--ln);border-radius:14px;padding:4px 12px 10px;margin:12px 0}
.slug{display:flex;align-items:center;gap:6px}
.slug span{color:var(--tx3);font-size:.9rem;white-space:nowrap}

/* layers + pages lists */
.lyr{list-style:none;margin:0;padding:0}
.lyr li{margin:0}
.lyr .it{display:flex;align-items:center;gap:6px;min-height:44px;padding:0 6px;border-radius:10px;width:100%;border:0;background:none;text-align:left;font-size:.92rem}
.lyr .it.on{background:var(--ui-soft);color:var(--ui);font-weight:700}
.lyr .sec>.it{font-weight:700}
.lyr .col{padding-left:14px;color:var(--tx3);font-size:.78rem;font-weight:700;text-transform:uppercase;letter-spacing:.05em;padding-top:4px}
.lyr .blk>.it{padding-left:calc(24px + var(--d,0) * 18px)}
.lyr .it .tw{display:inline-grid;place-items:center;width:28px;height:28px;margin:0 2px 0 -6px;border-radius:6px;color:var(--tx2)}
.lyr .it .ck{flex:none;width:22px;height:22px;border-radius:6px;border:2px solid #c7d2fe;display:grid;place-items:center;font-size:.8rem;color:#fff;background:#fff}
.lyr .it.picked .ck{background:var(--ui);border-color:var(--ui)}
.lyr .it.picked{background:var(--ui-soft)}
.lyr .it .mv span.out{font-size:.8rem}
.lyr .emp{padding:4px 0 6px calc(46px + var(--d,0) * 18px);color:var(--tx3);font-size:.82rem}
.lyrbar{position:sticky;top:-1px;z-index:2;display:flex;gap:8px;align-items:center;flex-wrap:wrap;background:var(--card);padding:6px 0 10px}
.lyrbar .n{flex:1;font-weight:700;font-size:.9rem;min-width:110px}
.lyr .it .nm{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.lyr .it .mv{display:flex}
.lyr .it .mv span{width:34px;height:34px;display:grid;place-items:center;border-radius:8px;color:var(--tx2)}
.lyr .it .mv span:active{background:#fff}
.pg{display:flex;flex-direction:column;gap:8px}
.pgi{border:1px solid var(--ln);border-radius:14px;background:#fff;padding:10px}
.pgi.on{border-color:var(--ui);box-shadow:0 0 0 2px var(--ui-soft)}
.pgi-top{display:flex;align-items:center;gap:8px;width:100%;border:0;background:none;padding:0;text-align:left;min-height:40px}
.pgi-top b{flex:1}
.pgi-top small{color:var(--tx3)}
.pgi-act{display:flex;gap:4px;flex-wrap:wrap;margin-top:6px}
.pgi-act button{min-height:36px;padding:0 10px;border-radius:9px;border:1px solid var(--ln);background:#fff;font-size:.85rem;font-weight:600}
.badge{font-size:.7rem;font-weight:700;padding:2px 8px;border-radius:999px;background:var(--ui-soft);color:var(--ui)}

/* media library */
.mup{display:flex;gap:10px;align-items:center;flex-wrap:wrap;border:2px dashed #cbd5e1;border-radius:14px;padding:12px;margin-bottom:12px}
.mup.over{border-color:var(--ui);background:var(--ui-soft)}
.mup.busy{opacity:.6;pointer-events:none}
.mgrid{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;max-height:46vh;overflow:auto}
.mi{aspect-ratio:1;border-radius:12px;background:#eef0f4 center/cover;position:relative;border:3px solid transparent;cursor:pointer}
.mi.on{border-color:var(--ui)}
.mi .del{position:absolute;top:4px;right:4px;width:32px;height:32px;border-radius:50%;border:0;background:rgba(0,0,0,.6);color:#fff}
.murl{display:flex;gap:8px;margin-top:12px}
html.desk .mgrid{grid-template-columns:repeat(5,1fr)}

/* export dialog */
.xopt{display:flex;gap:12px;align-items:center;width:100%;text-align:left;border:1px solid var(--ln);border-radius:14px;background:#fff;padding:12px;min-height:64px;margin-bottom:8px}
.xopt .hi{font-size:1.4rem;width:44px;height:44px;border-radius:12px;background:var(--ui-soft);display:grid;place-items:center;flex:none}
.xopt b{display:block}.xopt span{font-size:.86rem;color:var(--tx2)}
.xopt.xform{align-items:flex-start}.xopt.xform>span:last-child{display:flex;flex-direction:column;gap:6px;flex:1;min-width:0}.xopt .fl{margin:4px 0 0}.xopt .xbtns{display:flex;gap:8px;flex-wrap:wrap}
.xh{margin:14px 0 6px}
.warn{background:#fffbeb;border:1px solid #fde68a;color:#92400e;border-radius:12px;padding:10px 12px;font-size:.9rem;margin-bottom:10px}

/* preview overlay */
.pv{position:fixed;inset:0;z-index:70;background:#1f2937;display:flex;flex-direction:column}
.pv-bar{display:flex;align-items:center;gap:6px;padding:6px 8px;padding-top:calc(6px + env(safe-area-inset-top,0px));background:#111827;color:#fff;flex-wrap:wrap}
.pv-bar .ib{color:#fff}
.pv-bar select{min-height:40px;border-radius:10px;border:0;padding:0 8px;max-width:50vw;background:#fff;color:#111827}
.pv-bar .seg{background:#374151}.pv-bar .seg button{color:#d1d5db}.pv-bar .seg button.on{background:#fff;color:var(--tx)}
.pv-wrap{flex:1;overflow:auto;display:flex;justify-content:center}
.pv iframe{border:0;background:#fff;width:100%;height:100%;transition:max-width .25s}
.pv[data-dev=phone] iframe{max-width:390px}.pv[data-dev=tablet] iframe{max-width:820px}

/* ---------- editing marks on the canvas ---------- */
#canvas [data-bid]:not(.sb-free){position:relative}
#canvas [data-bid]{outline:2px solid transparent;outline-offset:3px;border-radius:4px;transition:outline-color .1s}
#canvas [data-sid]{outline:2px solid transparent;outline-offset:-2px}
html.desk #canvas [data-bid]:hover{outline-color:#c7d2fe}
html.desk #canvas [data-sid]:hover{outline-color:#e0e7ff}
#canvas .ed-sel[data-bid]{outline-color:var(--ui)!important}
#canvas .ed-sel[data-sid]{outline:3px solid var(--ui)!important}
#canvas .ed-target{background:color-mix(in srgb,var(--ui) 5%,transparent);border-radius:8px}
#canvas [contenteditable]{cursor:text;outline:none}
#canvas [contenteditable]:focus{box-shadow:0 0 0 2px #a5b4fc;border-radius:4px}
#canvas .ed-empty{border:2px dashed #c7d2fe;border-radius:12px;padding:22px 12px;text-align:center;color:#6366f1;font:600 14px system-ui;background:rgba(238,242,255,.6)}
#canvas .ed-shield{position:absolute;inset:0}
#canvas [data-gin]{outline:1px dashed rgba(99,102,241,.45);outline-offset:2px}
#canvas .ed-sel>[data-gin]{outline-color:var(--ui)}
#canvas [data-gin].ed-target{outline:2px dashed var(--ui)}
#canvas [data-gin]>.ed-empty{flex:1 1 100%;min-width:160px}
#canvas .ed-dropcol{outline:3px dashed var(--ui);outline-offset:4px;border-radius:8px}
#canvas a{cursor:default}
#canvas .sb-hdr{position:relative}
.ed-emptypage{padding:60px 20px;text-align:center;color:var(--tx3);font-weight:600}
.dropline.v{height:auto;width:4px!important}
.dropline{position:absolute;height:4px;border-radius:4px;background:var(--ui);z-index:30;pointer-events:none;box-shadow:0 0 0 3px rgba(79,70,229,.2)}
.ghost{position:fixed;z-index:100;pointer-events:none;background:var(--ui);color:#fff;padding:10px 14px;border-radius:12px;font-weight:700;box-shadow:0 10px 30px rgba(0,0,0,.3);transform:translate(-50%,-120%);white-space:nowrap}
body.dragging,body.dragging *{cursor:grabbing!important;user-select:none!important;-webkit-user-select:none!important}

/* selection box with handles (resize + free move) */
.selbox{position:absolute;z-index:25;pointer-events:none}
.selbox .h{position:absolute;pointer-events:auto;touch-action:none;width:32px;height:32px;border-radius:50%;background:var(--ui);color:#fff;display:grid;place-items:center;font-size:.9rem;box-shadow:0 2px 8px rgba(0,0,0,.3);border:2px solid #fff}
.selbox .h-move{left:-16px;top:-16px;cursor:move}
.selbox .h-size{right:-16px;bottom:-16px;cursor:nwse-resize}
.selbox .h-w{right:-16px;top:calc(50% - 16px);cursor:ew-resize}
.selbox .dim{position:absolute;left:0;top:-30px;background:#111827;color:#fff;font:600 12px system-ui;padding:3px 8px;border-radius:6px;white-space:nowrap;pointer-events:none}

/* ---------- COMPUTER layout ---------- */
html.desk .tb{gap:6px;padding:0 12px}
html.desk .tb-status{display:inline}
html.desk .tb-page{max-width:260px}
html.desk .ib.hb{background:var(--bg);padding:0 12px}
html.desk .ib.hb .hb-l{display:inline}
html.desk .bnav,html.desk .sheet,html.desk .sheet-dim{display:none!important}
html.desk .lp{display:flex;flex-direction:column;width:300px;flex:none;background:#fff;border-right:1px solid var(--ln)}
html.desk .rp{display:flex;flex-direction:column;width:320px;flex:none;background:#fff;border-left:1px solid var(--ln)}
html.desk .lp .pb,html.desk .rp .pb{overflow:auto;padding:8px 16px 24px;flex:1}
html.desk .tabs{display:flex;border-bottom:1px solid var(--ln);flex:none}
html.desk .tabs button{flex:1;border:0;background:none;padding:10px 2px;font-size:.78rem;font-weight:600;color:var(--tx2);border-bottom:3px solid transparent;display:flex;flex-direction:column;align-items:center;gap:2px}
html.desk .tabs button i{font-style:normal;font-size:1.15rem}
html.desk .tabs button.on{color:var(--ui);border-bottom-color:var(--ui)}
html.desk .stage{padding:24px;background:#e8eaf0}
html.desk .frame{box-shadow:0 10px 40px rgba(0,0,0,.12);border-radius:10px;overflow:hidden;max-width:100%}
html.desk .frame[data-dev=tablet]{max-width:820px}
html.desk .frame[data-dev=phone]{max-width:390px}
html.desk .ftb{position:fixed;left:0;right:auto;bottom:auto;top:0;border-radius:12px;overflow:visible;padding:3px;max-width:calc(100vw - 660px)}
html.desk .ftb button,html.desk .ftb .grip{min-width:36px;height:36px}
html.desk .pal{grid-template-columns:1fr 1fr}
html.desk .toast{bottom:24px}

/* list editor (FAQ, hours, menu items, numbers) */
.its{display:flex;flex-direction:column;gap:8px}
.iti{display:flex;gap:6px;border:1px solid var(--ln);border-radius:12px;padding:8px;background:#fafafa}
.itb{flex:1;display:flex;flex-direction:column;gap:6px;min-width:0}
.itb label{display:flex;flex-direction:column;gap:3px;font-size:.78rem;font-weight:600;color:var(--tx2)}
.itc{display:flex;flex-direction:column;gap:4px}
.itc button{width:40px;height:40px;border-radius:10px;border:1px solid var(--ln);background:#fff}
.itc button:disabled{opacity:.35}
/* app-to-app screens */
.host-screen{min-height:100%;display:grid;place-items:center;padding:24px 16px}
.host-card{background:#fff;border:1px solid var(--ln);border-radius:20px;padding:28px 22px;max-width:440px;width:100%;text-align:center;box-shadow:0 10px 40px rgba(0,0,0,.06)}
.host-card h2{margin:0 0 8px;font-size:1.3rem}
.host-card .btns{display:flex;gap:10px;justify-content:center;flex-wrap:wrap;margin-top:18px}
.host-spin{width:40px;height:40px;border-radius:50%;border:4px solid var(--ui-soft);border-top-color:var(--ui);margin:0 auto 14px;animation:spin .9s linear infinite}
@keyframes spin{to{transform:rotate(360deg)}}

/* ---------- template library (phone first) ---------- */
.lib{position:fixed;inset:0;z-index:70;background:var(--bg);overflow-y:auto;-webkit-overflow-scrolling:touch;padding:0 16px calc(24px + var(--safe-b))}
.lib-load{padding:80px 20px;text-align:center;color:var(--tx3);font-weight:600}
.lib-top{position:sticky;top:0;z-index:3;background:var(--bg);display:flex;gap:12px;align-items:flex-start;padding:14px 0 8px;max-width:1240px;margin:0 auto}
.lib-top h1{margin:0;font-size:1.3rem}.lib-top p{margin:2px 0 0;color:var(--tx2);font-size:.9rem}
.chips{display:flex;gap:8px;overflow-x:auto;padding:6px 0 12px;scrollbar-width:none;max-width:1240px;margin:0 auto}
.chips::-webkit-scrollbar{display:none}
.chip{flex:none;min-height:40px;padding:0 14px;border-radius:999px;border:1px solid var(--ln);background:#fff;font-weight:600;font-size:.9rem;color:var(--tx);white-space:nowrap}
.chip.on{background:var(--ui);border-color:var(--ui);color:#fff}
.chip i{font-style:normal;opacity:.7;font-size:.8rem;margin-left:2px}
.tgrid{display:grid;grid-template-columns:1fr;gap:16px;max-width:1240px;margin:0 auto}
.tcard{background:#fff;border:1px solid var(--ln);border-radius:16px;overflow:hidden;display:flex;flex-direction:column}
.tthumb{position:relative;display:block;width:100%;aspect-ratio:16/11;border:0;padding:0;background:#e5e7eb;overflow:hidden;cursor:zoom-in}
.tthumb img{width:100%;height:100%;object-fit:cover;object-position:top center;display:block}
.tthumb .tpages{position:absolute;right:10px;bottom:10px;background:rgba(17,24,39,.8);color:#fff;font-size:.75rem;font-weight:700;padding:4px 10px;border-radius:999px}
.tcard.blank .tthumb{display:grid;place-items:center;background:repeating-linear-gradient(45deg,#f3f4f6 0 12px,#eef2ff 12px 24px);cursor:pointer}
.tthumb .bl{font-size:2.6rem;color:var(--ui)}
.tbody{padding:12px 14px 14px;display:flex;flex-direction:column;gap:4px;flex:1}
.tbody small{color:var(--tx3);font-weight:600;font-size:.78rem}
.tbody b{font-size:1.02rem}.tbody p{margin:0;color:var(--tx2);font-size:.88rem;flex:1}
.tact{display:flex;gap:8px;flex-wrap:wrap;margin-top:8px}.tact .btn{flex:1;min-width:120px}
.tpv{position:fixed;inset:0;z-index:80;background:#111827;display:flex;flex-direction:column}
.tpv-bar{display:flex;align-items:center;gap:8px;padding:8px 10px;padding-top:calc(8px + env(safe-area-inset-top,0px));background:#111827;color:#fff;flex-wrap:wrap}
.tpv-bar b{flex:1;min-width:120px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.tpv-bar .ib{color:#fff}
.tpv-bar .seg{background:rgba(255,255,255,.12)}.tpv-bar .seg button{color:#fff}.tpv-bar .seg button.on{background:#fff;color:#111827}
.tpv-pages{display:flex;gap:6px;overflow-x:auto;padding:0 10px 8px;scrollbar-width:none}
.tpv-pages .chip{min-height:34px;background:rgba(255,255,255,.1);border-color:transparent;color:#fff}.tpv-pages .chip.on{background:#fff;color:#111827}
.tpv-scroll{flex:1;overflow-y:auto;-webkit-overflow-scrolling:touch;padding:0 0 30px;text-align:center}
.tpv-img{display:block;margin:0 auto;width:100%;height:auto;background:#fff}
.tpv-img.phone{max-width:430px}.tpv-img.desk{max-width:860px}
@media (min-width:640px){.tgrid{grid-template-columns:repeat(2,1fr)}.lib{padding:0 24px 32px}}
@media (min-width:1000px){.tgrid{grid-template-columns:repeat(3,1fr)}}
@media (min-width:1400px){.tgrid{grid-template-columns:repeat(4,1fr)}.lib-top,.chips,.tgrid{max-width:1500px}}
.lib .ib.hb .hb-l{display:inline}
.lib-top .ib.hb{flex:none}
