/* Phone presentation only; the original desktop layout is untouched. */
body.phone-mode { height:100dvh; width:100%; }
#phoneModeToggle { width:auto; margin:0; color:#111827; background:#e5e7eb; }
#glCanvas { touch-action:none; }
.settings-toggle,.settings-close,.settings-backdrop { display:none; }
.settings-toggle { position:absolute; top:10px; right:10px; z-index:40; width:48px; height:48px; margin:0; padding:0; border:1px solid rgba(203,213,225,.6); border-radius:9px; background:rgba(3,7,18,.8); color:white; font:30px/1 system-ui,sans-serif; }
.phone-mode .layout { grid-template-columns:minmax(0,1fr); grid-template-rows:minmax(0,1fr); gap:0; padding:6px; }
.phone-mode .topbar { gap:6px; padding:8px 10px; flex-wrap:nowrap; align-items:center; }
.phone-mode .topbar > div:first-child { width:auto; flex:1; }
.phone-mode h1 { font-size:15px; }
.phone-mode .copyright-line,.phone-mode .shortcut-line,.phone-mode .top-actions > a { display:none; }
.phone-mode .top-actions { width:auto; flex-wrap:nowrap; }
.phone-mode #phoneModeToggle { font-size:11px; padding:6px; width:48px; min-height:44px; }
.phone-mode .file-button { min-height:44px; display:flex; align-items:center; padding:8px 12px; font-size:14px; }
.phone-mode .settings-toggle { display:block; }
.phone-mode .controls { position:fixed; z-index:55; top:0; bottom:0; right:0; width:min(360px,100%); padding:12px 12px max(12px,env(safe-area-inset-bottom)); background:#f3f4f6; transform:translateX(105%); visibility:hidden; pointer-events:none; box-shadow:-8px 0 32px rgba(0,0,0,.28); overscroll-behavior:contain; }
.phone-mode.settings-open .controls { transform:translateX(0); visibility:visible; pointer-events:auto; }
.phone-mode .settings-close { display:block; flex-shrink:0; min-height:44px; margin:0; }
.phone-mode.settings-open .settings-backdrop { display:block; position:fixed; z-index:50; inset:0; width:100%; height:100%; margin:0; padding:0; border-radius:0; background:rgba(0,0,0,.35); }
.phone-mode .controls button,.phone-mode .controls input:not([type=checkbox]),.phone-mode .controls select { min-height:44px; font-size:16px; }
.phone-mode .controls label { font-size:14px; }
.phone-mode .checkbox-label { min-height:44px; }
.phone-mode input[type=checkbox] { width:22px; height:22px; }
.phone-mode .view-zoom-controls button { min-width:40px; min-height:40px; }
.phone-mode .button-row { gap:6px; }
.phone-mode .controls section { flex-shrink:0; }

.phone-only { display:none; }
.phone-mode .phone-only { display:block; }
.phone-mode .phone-only.button-row { display:grid; }
.phone-mode .controls section { flex-shrink:0; }
