/* mobile — Phone mode (html.mobile, set in index.html's <head>): one tool, steps 1 → 2 → 4, view on top, settings below.
   Also the PC side of the phone hand-off (receive dialog). Loaded last: base, panels, view, steps, mobile. */
html:not(.mobile) .monly{display:none!important}
html.mobile .donly{display:none!important}
html:not(.phone):not(.mobile) #uiSwitch{display:none}

/* ---------- PC: receive a tool from the phone ---------- */
.recvRow{display:flex;gap:8px;margin-top:12px}
.recvRow input{flex:1;min-width:0;font:500 20px/1 var(--mono);letter-spacing:.12em;text-transform:uppercase;text-align:center;padding:9px 10px;border-radius:10px;border:1px solid var(--line2);background:var(--field);color:var(--text);outline:none}
.recvRow input:focus{border-color:var(--accent);background:var(--panel)}
#recvSt:empty,#recvSt:has(#recvStT:empty){display:none}
.recvTool{display:flex;gap:12px;align-items:center;margin-top:12px;padding:10px;border-radius:12px;background:var(--app);border:1px solid var(--line)}
.recvTool img{width:72px;height:54px;object-fit:cover;border-radius:8px;border:1px solid var(--line);background:var(--field);flex:none}
.recvTool b{display:block;font-weight:600;font-size:13.5px} .recvTool span{font-size:12px;color:var(--muted)}
.recvBtns{display:flex;gap:8px;margin-top:10px} .recvBtns .btn{flex:1;justify-content:center}

#addSec .links{flex-wrap:wrap;gap:6px 14px} #addSec .links a{white-space:nowrap}

/* ---------- phone layout ---------- */
html.mobile body{font-size:14px;background:var(--app);overscroll-behavior:none;-webkit-tap-highlight-color:transparent}
html.mobile .app{position:fixed;inset:0;height:100dvh;border-radius:0;border:none;box-shadow:none;grid-template-rows:auto minmax(0,1fr)}
html.mobile .top{display:flex;align-items:center;gap:8px;padding:8px 12px;padding-top:max(8px,env(safe-area-inset-top));padding-left:max(12px,env(safe-area-inset-left));padding-right:max(12px,env(safe-area-inset-right))}
html.mobile .crumb{flex:1;min-width:0;gap:8px}
html.mobile .crumb .sep,html.mobile .crumb .path,html.mobile .steps,html.mobile #installBtn,html.mobile #themeBtn,html.mobile #resetBtn,html.mobile #dl{display:none}
html.mobile .logo{font-size:18px}
html.mobile .top{overflow:hidden}
html.mobile .crumb .pill{flex:0 1 auto;min-width:0}
html.mobile #statusText{overflow:hidden;text-overflow:ellipsis}
html.mobile .actions{flex:none}
html.mobile #langBtn .i{display:none}
html.mobile .actions,html.mobile .ttog{gap:6px;margin:0}
html.mobile .ttog .btn{padding:7px 9px;font-size:13px}
html.mobile #uiSwitch .i{display:none}
html.mobile .body{display:flex;flex-direction:column;gap:0;padding:0;min-height:0}
html.mobile #leftPanel{display:none}
html.mobile .vp{flex:1 1 auto;min-height:50dvh;border-radius:0;border:none;border-bottom:1px solid var(--line)}
html.mobile .insp{flex:0 1 auto;max-height:46dvh;border-radius:0;border:none;-webkit-overflow-scrolling:touch}
html.mobile .insp .stepnav{padding:10px 12px;padding-bottom:max(10px,env(safe-area-inset-bottom))}
html.mobile .insp .stepnav .btn{padding:11px 14px;font-size:15px}
html.mobile .insp .head{display:none!important}
html.mobile body[data-step="4"] #stepNext{display:none}
html.mobile .insp [data-step="1 2"],html.mobile body[data-step="1"] .insp .sec{display:none}
html.mobile body:not(.hasCur) #mKindSec,html.mobile body[data-step="2"]:not(.hasCur) #resSec{display:none}
html.mobile body[data-step="1"] .vp{min-height:0}
html.mobile .sec{padding:14px 16px}
html.mobile .sec h3{font-size:11.5px}
html.mobile .hint{font-size:13px}
/* touch-sized controls (16 px text keeps iOS from zooming into a field) */
html.mobile input,html.mobile select{font-size:16px}
html.mobile .f{height:40px} html.mobile .f input{font-size:16px}
html.mobile select{padding:9px 10px}
html.mobile .btn{padding:9px 14px} html.mobile .btn.sm{padding:8px 12px;font-size:13.5px}
html.mobile .seg button{padding:9px 10px;font-size:13.5px}
html.mobile .eqlab{font-size:11.5px}
html.mobile input[type=range]{height:6px}
html.mobile input[type=range]::-webkit-slider-thumb{width:26px;height:26px}
html.mobile .ctl{margin:14px 0}
html.mobile .kv{padding:6px 0}
html.mobile details summary{min-height:32px}
/* centre view */
html.mobile #cPhoto,html.mobile #cProf{touch-action:none}
html.mobile #topChips,html.mobile #caption,html.mobile #toolHintWrap{display:none!important}
html.mobile .float.tlv{top:10px;left:10px}
html.mobile body:not(.hasPhoto) #viewWrap{display:none}
html.mobile #viewSeg button{padding:7px 10px;font-size:13px}
html.mobile body:not([data-type="grid"]) #viewSeg [data-v="prof"]{display:none}
html.mobile #photoTools{bottom:12px}
html.mobile #photoTools [data-tool="draw"],html.mobile #photoTools [data-tool="rect"],html.mobile #photoTools [data-tool="ellipse"],
html.mobile #olBtn,html.mobile #snapBtn,html.mobile #zoomIn,html.mobile #zoomOut,html.mobile #zoomPct,html.mobile #photoTools .tsep:nth-of-type(1){display:none}
html.mobile .toolbar{padding:5px;border-radius:14px}
html.mobile .toolbar button{width:44px;height:42px;border-radius:10px}
html.mobile .toolbar svg.i{width:19px;height:19px}
html.mobile #toast{top:58px;font-size:14px}
html.mobile .card3:hover{transform:none}
/* step 1: what to make */
html.mobile #start{padding:18px 16px;align-items:flex-start}
html.mobile #start h2{font-size:20px}
html.mobile #start .lead{font-size:13.5px;margin-bottom:14px}
html.mobile .cards{grid-template-columns:1fr;gap:12px}
html.mobile .card3[data-type="tray"]{display:none}
html.mobile .card3{display:grid;grid-template-columns:42% 1fr;grid-template-rows:auto 1fr;column-gap:12px;row-gap:4px;padding:10px;border-radius:16px}
html.mobile .card3 .ill{grid-row:1/3;aspect-ratio:4/3;height:100%;border-radius:10px}
html.mobile .card3 b{font-size:15px;align-self:end} html.mobile .card3 span{font-size:12.5px;line-height:1.5}
/* step 2: no photo yet */
html.mobile #empty{padding:20px 16px;place-items:start center}
.mEmpty{width:100%;max-width:460px;text-align:left;display:flex;flex-direction:column;gap:10px}
.mEmpty .mt{font-size:18px;font-weight:600;color:var(--text)}
.mEmpty .ms{font-size:13.5px;color:var(--muted);line-height:1.5;margin-bottom:4px}
.mEmpty .addb{padding:14px 16px;border-radius:16px;gap:3px}
.mEmpty .addb svg{width:24px;height:24px}
.mEmpty .addb b{font-size:15px} .mEmpty .addb span{font-size:12.5px}
.mEmpty #mCamBtn{border-color:var(--accent);background:var(--accent-soft)}
.mEmpty .links{margin-top:4px;font-size:13.5px;gap:18px}
.mEmpty .links svg{width:16px;height:16px}
/* step 4: save / share / send */
.mbtns{display:grid;grid-template-columns:1fr;gap:8px}
.mbtns:has(#mShare:not(.hide)){grid-template-columns:1fr 1fr}
.mbtns .btn{justify-content:center}
.mSend{width:100%;margin-top:8px;display:flex;align-items:center;gap:12px;text-align:left;white-space:normal;padding:12px 14px!important}
.mSend svg{width:22px;height:22px;color:var(--accent)}
.mSend b{display:block;font-weight:600;font-size:14.5px} .mSend small{display:block;font-weight:400;color:var(--muted);font-size:12.5px;line-height:1.4}
.mSendBox{margin-top:10px}
.mSendBox .st{padding:9px 11px;border-radius:10px;background:var(--field);color:var(--muted);font-size:13.5px}
.mSendBox .st.ok{background:var(--ok-soft);color:var(--ok)} .mSendBox .st.err{background:var(--bad-soft);color:var(--bad)}
.mSendBox .bar{height:5px;border-radius:3px;background:var(--line);overflow:hidden;margin-top:8px} .mSendBox .bar i{display:block;height:100%;width:0;background:var(--accent);transition:width .2s}
.mSendBox .code{margin-top:10px;padding:14px 10px;border-radius:14px;background:var(--panel);border:1px solid var(--line2);font:600 32px/1 var(--mono);letter-spacing:.14em;text-align:center;color:var(--text);user-select:all;-webkit-user-select:all}
