.dorm-touch-controls,.dorm-touch-enter,.dorm-orientation-hint,.dorm-touch-sensitivity,.dorm-mode-short,.dorm-touch-mode,.dorm-touch-movement,.dorm-settings-head,.dorm-settings-toggle,.dorm-settings-fullscreen { display:none; }
.dorm-touch-controls[hidden],.dorm-touch-enter[hidden] { display:none!important; }
.dorm-settings-panel,.dorm-settings-card { display:contents; }
.dorm-fullscreen-shell { width:100vw;height:100vh;height:100dvh;max-width:none;max-height:none;margin:0;padding:0;border:0;background:var(--panel);color:var(--text);overflow:hidden; }
.dorm-live.is-fullscreen-fallback { display:flex;flex-direction:column;width:100%;height:100%;min-height:0;border:0;border-radius:0;overflow:hidden; }
.dorm-live.is-fullscreen-fallback .dorm-stage { flex:1;min-height:0;height:auto; }
.dorm-live.is-fullscreen-fallback :is(.viewer-toolbar,.mode-grid,.dorm-controls) { flex-shrink:0; }
.dorm-live.is-fullscreen-fallback .dorm-walk-note { display:none; }

@media(pointer:coarse) {
 .dorm-live { position:relative; }
 .dorm-stage { height:clamp(300px,58svh,560px); }
 .dorm-live :is(.viewer-toolbar,.mode-grid,.dorm-walk-note,.dorm-movement-widget) { display:none; }
 .dorm-settings-toggle { display:grid;place-items:center;position:absolute;right:max(12px,env(safe-area-inset-right));top:max(12px,env(safe-area-inset-top));z-index:3;width:48px;height:48px;padding:12px;border:1px solid #c4dfc17a;border-radius:10px;background:#102315c9;color:#e5f6da;box-shadow:0 2px 8px #0003;touch-action:manipulation; }
 .dorm-settings-toggle svg { width:24px;height:24px;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linejoin:round; }
 .dorm-settings-panel { display:none;position:absolute;inset:0;z-index:5;align-items:center;justify-content:center;padding:max(8px,env(safe-area-inset-top)) max(12px,env(safe-area-inset-right)) max(8px,env(safe-area-inset-bottom)) max(12px,env(safe-area-inset-left));background:#071009a8;touch-action:auto; }
 .dorm-live[data-settings-open=true] .dorm-settings-panel { display:flex; }
 .dorm-settings-card { display:flex;flex-direction:column;width:100%;max-width:420px;max-height:100%;min-height:0;overflow:auto;overscroll-behavior:contain;border:1px solid var(--line);border-radius:12px;background:var(--panel);color:var(--text);box-shadow:0 8px 32px #0005; }
 .dorm-settings-head { display:flex;align-items:center;justify-content:space-between;gap:16px;position:sticky;top:0;z-index:1;padding:8px 12px 8px 16px;flex-shrink:0;background:var(--panel);border-bottom:1px solid var(--line); }
 .dorm-settings-head h2 { font-size:16px;margin:0; }
 .dorm-settings-head button { width:44px;min-height:44px;padding:0;font-size:26px;line-height:1;border:1px solid var(--line);border-radius:8px;background:var(--panel-2,var(--panel));color:var(--text); }
 .dorm-live .dorm-controls { display:flex;flex-direction:column;align-items:stretch;gap:12px;padding:16px;border:0;flex-wrap:nowrap;font-size:13px; }
 .dorm-live :is(.dorm-touch-mode,.dorm-preset-label,.dorm-touch-sensitivity) { display:flex;align-items:center;justify-content:space-between;gap:12px;width:100%; }
 .dorm-live :is(.dorm-touch-mode,.dorm-preset-label) select { width:60%;max-width:230px;min-height:44px;padding:6px 8px;font-size:16px;border:1px solid var(--line);border-radius:6px;color:var(--text);background:var(--panel); }
 .dorm-live .dorm-touch-sensitivity { flex-wrap:wrap;gap:6px; }
 .dorm-touch-sensitivity input { flex:1;min-width:80px;max-width:185px;height:44px;accent-color:var(--accent); }
 .dorm-touch-sensitivity output { min-width:24px;font-variant-numeric:tabular-nums; }
 .dorm-live .dorm-switches { display:grid;grid-template-columns:1fr 1fr;gap:4px 12px;width:100%;order:initial; }
 .dorm-live :is(.dorm-switches label,.dorm-touch-movement) { display:flex;align-items:center;gap:8px;min-height:44px; }
 .dorm-live input[type=checkbox] { width:18px;height:18px;accent-color:var(--accent); }
 .dorm-live .dorm-view-actions { display:flex;gap:8px;width:100%; }
 .dorm-live .dorm-view-actions button { min-width:44px;min-height:44px;padding:6px 10px;font-size:13px; }
 .dorm-view-actions [data-reset] { flex:1; }
 .dorm-settings-fullscreen { display:block;min-height:44px; }
 .dorm-touch-controls { display:block;position:absolute;inset:0;pointer-events:none;z-index:2; }
 .dorm-joystick { position:absolute;left:max(16px,env(safe-area-inset-left));bottom:max(24px,env(safe-area-inset-bottom));width:112px;height:112px;min-height:112px!important;border-radius:50%;padding:0;border:1px solid #c4dfc17a;background:radial-gradient(circle,#29412b99 0 35%,#10231599 36%);box-shadow:0 3px 12px #0004;touch-action:none;user-select:none;-webkit-user-select:none;pointer-events:auto; }
 .dorm-joystick::before,.dorm-joystick::after { content:'';position:absolute;background:#dbead638;left:50%;top:50%;transform:translate(-50%,-50%);pointer-events:none; }
 .dorm-joystick::before { width:1px;height:74%; }.dorm-joystick::after { width:74%;height:1px; }
 .dorm-joystick span { display:block;position:absolute;left:calc(50% - 19px);top:calc(50% - 19px);width:38px;height:38px;border-radius:50%;border:1px solid #ddf2cbb3;background:#a5c794b8;box-shadow:0 2px 7px #0005;pointer-events:none; }
 .dorm-joystick[aria-pressed=true] { border-color:#e5f6cd; }
 .dorm-stick-label { position:absolute;left:max(16px,env(safe-area-inset-left));bottom:max(3px,calc(env(safe-area-inset-bottom) - 20px));width:112px;text-align:center;color:#d5e2cf;font-size:11px;text-shadow:0 1px 4px #000; }
 .dorm-touch-look-label { position:absolute;right:max(24px,env(safe-area-inset-right));bottom:max(134px,calc(env(safe-area-inset-bottom) + 110px));color:#d5e2cf;font-size:11px;text-shadow:0 1px 4px #000; }
 .dorm-touch-elevation { position:absolute;right:max(16px,env(safe-area-inset-right));bottom:max(24px,env(safe-area-inset-bottom));display:flex;flex-direction:column;gap:8px;pointer-events:auto; }
 .dorm-touch-elevation button { width:48px;height:44px;padding:0;border:1px solid #c4dfc17a;border-radius:8px;background:#102315b3;color:#e5f6da;touch-action:none;user-select:none; }
 .dorm-live:not([data-mode="3"]) .dorm-touch-elevation { display:none; }
 .dorm-touch-enter { display:block;position:absolute;left:max(12px,env(safe-area-inset-left));top:max(12px,env(safe-area-inset-top));z-index:2;min-height:48px;background:#182a1ded;color:#e5f6da;border-color:#8fab75; }
 .dorm-look-hint { display:none; }
 .dorm-live[data-immersive=true] { display:flex;flex-direction:column;width:100%;height:100vh;height:100dvh;min-height:0;border-radius:0;padding:0;touch-action:none; }
 .dorm-live[data-immersive=true] .dorm-stage { flex:1;min-height:0;height:auto; }
}
@media(pointer:coarse) and (orientation:portrait) {
 .dorm-live[data-mode="2"] .dorm-orientation-hint,.dorm-live[data-mode="3"] .dorm-orientation-hint { display:block;position:absolute;top:max(16px,env(safe-area-inset-top));left:max(12px,env(safe-area-inset-left));right:72px;margin:0;padding:8px;color:#e2edda;background:#102315a8;border-radius:6px;font-size:11px;text-align:center;pointer-events:none; }
}
@media(pointer:coarse) and (max-height:450px) {
 .dorm-joystick { width:100px;height:100px;min-height:100px!important;bottom:max(18px,env(safe-area-inset-bottom)); }
 .dorm-stick-label { width:100px;bottom:max(1px,calc(env(safe-area-inset-bottom) - 16px)); }
 .dorm-touch-elevation { bottom:max(18px,env(safe-area-inset-bottom));gap:6px; }
 .dorm-touch-look-label { bottom:max(120px,calc(env(safe-area-inset-bottom) + 102px)); }
}
