/* Slidex phone editor (see mobile.js): app shell, fixed height, no page scroll; tools are bottom sheets. */
html.m-lock,html.m-lock body{position:fixed;inset:0;width:100%;height:100%;overflow:hidden;overscroll-behavior:none;touch-action:manipulation;-webkit-tap-highlight-color:transparent}
.m-load{display:grid;place-items:center;height:100dvh;color:var(--mute)}

.m-app{--sw:min(calc(100vw - 24px),calc(var(--smax) * 16 / 9));--smax:38dvh;--bar:#fff;--ln:#0E0E1312;
  position:fixed;top:0;left:0;width:100%;height:100vh;height:100dvh;display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:auto auto auto minmax(0,1fr) auto;overflow:hidden;background:var(--paper);
  font-size:15px;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none}
.m-app.kb{--smax:26dvh}
.m-app input,.m-app textarea{user-select:text;-webkit-user-select:text;font-size:16px}

/* top bar */
.m-top{display:flex;align-items:center;gap:8px;min-height:calc(52px + env(safe-area-inset-top));padding:env(safe-area-inset-top) max(10px,env(safe-area-inset-right)) 0 max(10px,env(safe-area-inset-left));background:var(--ink);color:var(--paper)}
.m-ib{flex:none;width:44px;height:44px;display:grid;place-items:center;border:0;border-radius:12px;background:transparent;color:inherit;font-size:26px;line-height:1;cursor:pointer;text-decoration:none}
.m-ib:active{background:#ffffff22}
.m-play{background:var(--flame);color:#fff}
.m-title{flex:1;min-width:0;height:40px;border:0;border-radius:10px;background:#ffffff14;color:var(--paper);padding:0 12px;font-weight:600;outline:none}
.m-title:focus{background:#ffffff26}
.m-top .saved{flex:none;font-size:0;gap:0;padding:0;background:none;min-width:0}
.m-top .saved::before{width:10px;height:10px}

/* the slide */
.m-stage{display:grid;place-items:center;height:calc(var(--sw) * 9 / 16 + 20px);padding:10px 12px;background:#E9E5DB;overflow:hidden;touch-action:none}
.m-stage .frame{border-radius:10px;box-shadow:0 14px 40px -12px #0006;overflow:hidden}
@keyframes m-in-r{from{transform:translateX(28px);opacity:.2}}
@keyframes m-in-l{from{transform:translateX(-28px);opacity:.2}}
.m-stage .frame.m-in-r{animation:m-in-r .22s ease-out}.m-stage .frame.m-in-l{animation:m-in-l .22s ease-out}
.m-app.locked .m-stage{touch-action:pan-x}

/* slide strip */
.m-strip{display:flex;align-items:center;gap:8px;padding:6px max(10px,env(safe-area-inset-right)) 6px max(10px,env(safe-area-inset-left));background:#E9E5DB;border-top:1px solid var(--ln)}
.m-app.kb .m-strip{display:none}
.m-count{flex:none;font-size:12px;font-weight:700;color:var(--mute);min-width:34px;text-align:center}.m-count b{color:var(--ink)}
.m-thumbs{position:relative;flex:1;min-width:0;display:flex;gap:8px;overflow-x:auto;overflow-y:hidden;padding:4px 2px;scrollbar-width:none;overscroll-behavior:contain}
.m-thumbs::-webkit-scrollbar{display:none}
.m-thumbs .th{flex:none;width:76px}
.m-add{background:var(--ink);color:var(--paper);border-radius:50%}

/* the zone under the strip: quick actions, or a tool's bottom sheet on top of them */
.m-zone{position:relative;min-height:0;background:#F6F5F1;overflow:hidden}
.m-actions{height:100%;overflow-y:auto;overscroll-behavior:contain;padding:12px max(12px,env(safe-area-inset-right)) 12px max(12px,env(safe-area-inset-left));display:grid;gap:10px;align-content:start}
.m-grid4{display:grid;grid-template-columns:repeat(4,1fr);gap:8px}
.m-grid2{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.m-act{display:grid;justify-items:center;align-content:center;gap:4px;min-height:58px;padding:8px 4px;border:0;border-radius:14px;background:#fff;color:var(--ink);font:600 12px/1.15 Inter,system-ui,sans-serif;box-shadow:0 1px 0 #0E0E130f;cursor:pointer;text-align:center}
.m-act:active{background:#EFECE4}.m-act:disabled{opacity:.35}
.m-act.danger{color:#C21F0A}.m-act.hot{background:var(--volt)}
.m-name{display:flex;align-items:center;gap:10px;padding:0 12px;min-height:46px;border-radius:14px;background:#fff;box-shadow:0 1px 0 #0E0E130f}
.m-name input{flex:1;min-width:0;border:0;outline:none;background:none;height:44px}
.m-closed{text-align:center}.m-closed p{color:var(--mute)}

.m-sheet{position:absolute;inset:0;z-index:5;display:grid;grid-template-rows:auto auto minmax(0,1fr);background:#F6F5F1;border-radius:20px 20px 0 0;box-shadow:0 -10px 30px #0E0E1330;
  transform:translateY(104%);visibility:hidden;transition:transform .26s cubic-bezier(.2,.8,.2,1),visibility 0s .26s}
.m-sheet.on{transform:none;visibility:visible;transition-delay:0s}
.m-grab{display:grid;place-items:center;height:20px;cursor:grab;touch-action:none}
.m-grab i{width:40px;height:4px;border-radius:4px;background:#0E0E1330}
.m-sheet-h{display:flex;align-items:center;justify-content:space-between;padding:0 6px 0 16px}.m-sheet-h b{font-size:15px}
.m-sheet-h .m-ib{color:var(--ink)}
.m-sheet-b{position:relative;overflow-y:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;padding:4px max(12px,env(safe-area-inset-right)) 16px max(12px,env(safe-area-inset-left));display:grid;gap:12px;align-content:start}
.m-sheet-b .pnl{overflow:visible;border:0;padding:0;background:none;max-height:none}
/* which of the property-panel cards each tab shows */
.m-sheet[data-tab=layout] .pnl,.m-sheet[data-tab=font] .pnl{display:none}
.m-sheet[data-tab=text] .pc-lay,.m-sheet[data-tab=text] .pc-col,.m-sheet[data-tab=color] .pc-lay,.m-sheet[data-tab=color] .pc-txt,.m-sheet[data-tab=color] .pc-pic{display:none}
.m-sheet[data-tab=layout] #mExtra,.m-sheet[data-tab=font] #mExtra{display:grid;gap:14px}
.m-empty{text-align:center;padding:24px 0}
.m-sheet .pc{box-shadow:none;padding:12px}
.m-sheet .pc-h{display:none}
.m-sheet .pf textarea{font-size:16px;min-height:44px;resize:none}
/* finger-sized: 44px controls, and 16px text in anything typed into or picked from, so iPhone never zooms the page */
.m-sheet .pf-ai{width:44px;height:44px;right:4px;top:4px;border-radius:10px;font-size:16px}
.m-sheet .pf-ln{width:44px;height:44px;right:52px;top:4px}
.m-sheet .pf-in textarea{padding-right:102px}
.m-sheet select.in{font-size:16px;min-height:44px}
.m-sheet .pt-c{width:44px;height:44px;padding:10px;background-clip:content-box;box-shadow:none;margin:-6px}
.m-sheet .pt-c.on{box-shadow:none;outline:2px solid var(--ink);outline-offset:-7px}
.m-sheet .sw.pal button{min-width:44px;min-height:44px;display:grid;place-items:center;background:none;border:0}
.m-sheet .sw.pal button.on i{box-shadow:0 0 0 3px var(--ink)}
.m-sheet .sw i{width:34px;height:34px}
.m-sheet .col{min-width:44px;min-height:44px}
.m-sheet .btn.s{min-height:40px}

.m-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}
.m-lo{border:0;background:none;padding:0;display:grid;gap:6px;text-align:left;font:600 12px Inter,system-ui,sans-serif;cursor:pointer;color:var(--ink)}
.m-lo .frame{border-radius:8px;outline:3px solid transparent;outline-offset:1px}
.m-lo.on .frame{outline-color:var(--flame)}
.m-lo small{color:var(--flame)}
.seg.m-wrap{flex-wrap:wrap;border-radius:18px}
.seg.m-wrap button,.m-mode button,.m-sheet .seg button{min-height:40px}
.m-mode{width:100%}.m-mode button{flex:1}

/* tab bar */
.m-tabs{display:grid;grid-template-columns:repeat(4,1fr);background:var(--bar);border-top:1px solid var(--ln);padding:0 env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);z-index:6}
.m-app.kb .m-tabs{display:none}
.m-tabs button{display:grid;justify-items:center;align-content:center;gap:3px;min-height:56px;border:0;background:none;color:#0E0E1399;font:600 11px Inter,system-ui,sans-serif;cursor:pointer}
.m-tabs button[aria-selected=true]{color:var(--flame)}
.m-tabs button:disabled{opacity:.35}

/* things that open on top of the editor stay inside the screen */
html.m-lock .modal{padding:0;align-items:flex-end}
html.m-lock .modal>.card{max-width:none;border-radius:20px 20px 0 0;max-height:92dvh;padding:24px 16px calc(24px + env(safe-area-inset-bottom))}
html.m-lock .toast{bottom:calc(90px + env(safe-area-inset-bottom));max-width:92vw;text-align:center}
html.m-lock .aibar{left:8px!important;right:8px;max-width:none;z-index:160}
html.m-lock .modal .tpick{grid-template-columns:1fr 1fr}
@media(prefers-reduced-motion:reduce){.m-sheet{transition:none}.m-stage .frame.m-in-r,.m-stage .frame.m-in-l{animation:none}}

/* moving things on the slide: the picture and the text handle take the finger, not the swipe */
.m-stage [data-img]{touch-action:none}
html.m-lock .mvgrip{touch-action:none;z-index:7;width:40px;height:40px}
.m-sheet textarea.m-hit{border-color:var(--flame);box-shadow:0 0 0 3px #FF4A1C33}
/* picture window on a phone: one column (the desktop rule later in app.css forced two) */
html.m-lock .modal .pk{grid-template-columns:minmax(0,1fr)}
html.m-lock .modal .pk-grid{grid-template-columns:repeat(auto-fill,minmax(72px,1fr));grid-auto-rows:72px}
html.m-lock .pk-slide .pk-target{touch-action:none}

/* presenting: close button and counter (a phone has no Esc key); upright phones turn the slide sideways */
#pres .pres-x{position:fixed;top:calc(12px + env(safe-area-inset-top));right:calc(12px + env(safe-area-inset-right));width:44px;height:44px;border:0;border-radius:50%;background:#ffffff2e;color:#fff;font-size:28px;line-height:1;cursor:pointer;z-index:2}
#pres .pres-n{position:fixed;bottom:calc(14px + env(safe-area-inset-bottom));left:50%;transform:translateX(-50%);color:#ffffffa6;font:600 13px Inter,system-ui,sans-serif;pointer-events:none;z-index:2}
#pres.rot .frame{rotate:90deg;flex:none}
#pres.rot .pres-n{bottom:auto;top:calc(14px + env(safe-area-inset-top))}
/* installed on an iPhone the page may run under the status bar: keep headers clear of it */
.sh{padding-top:env(safe-area-inset-top)}
