.aq-phone-dock { display: none; }
/* AquaRoyal phone layout. Keep desktop rendering and room gestures unchanged. */
@media (hover: none) and (pointer: coarse) and (max-device-width: 950px) and (max-width: 950px) {
    html { -webkit-text-size-adjust: 100%; }
    html .octane-app-root.octane-app-root {
        --aq-phone-top: max(6px, env(safe-area-inset-top, 0px));
        --aq-phone-bottom: max(6px, env(safe-area-inset-bottom, 0px));
        --aq-phone-left: max(6px, env(safe-area-inset-left, 0px));
        --aq-phone-right: max(6px, env(safe-area-inset-right, 0px));
    }
    html .octane-app-root.octane-app-root .draggable-window {
        position: absolute !important;
        top: var(--aq-phone-top) !important;
        left: var(--aq-phone-left) !important;
        right: var(--aq-phone-right) !important;
        transform: none !important;
        width: auto !important;
        min-width: 0 !important;
        max-width: none !important;
        max-height: calc(var(--aq-ui-height, 100dvh) - var(--aq-phone-top) - var(--aq-phone-bottom) - 110px) !important;
    }
    html .octane-app-root.octane-app-root .draggable-window > * {
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        min-height: 0 !important;
        max-height: calc(var(--aq-ui-height, 100dvh) - var(--aq-phone-top) - var(--aq-phone-bottom) - 110px) !important;
        resize: none !important;
    }
    html .octane-app-root.octane-app-root .octane-card-content-shell {
        min-height: 0 !important;
        overflow: auto !important;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
    }
    html .octane-app-root.octane-app-root :is(input, textarea, select) {
        font-size: 16px !important;
        min-height: 40px;
    }
    html .octane-app-root.octane-app-root :is(input[type="checkbox"], input[type="radio"], input[type="range"]) { min-height: 24px; }
    html .octane-app-root.octane-app-root button { touch-action: manipulation; }
    html .octane-app-root.octane-app-root .octane-card-content-shell button { min-height: 40px; }
    html .octane-app-root.octane-app-root :is(.octane-inventory-tabs-shell, .octane-catalog-tabs-shell) {
        overflow-x: auto !important;
        flex-shrink: 0;
        -webkit-overflow-scrolling: touch;
    }
    html .octane-app-root.octane-app-root .octane-catalog-stage {
        display: flex !important;
        flex-direction: column !important;
        height: auto !important;
        gap: 8px;
    }
    html .octane-app-root.octane-app-root .octane-catalog-sidebar { flex: 0 0 auto !important; max-height: 160px; overflow: auto; }
    html .octane-app-root.octane-app-root .octane-catalog-layout-shell { width: 100% !important; min-width: 0 !important; flex: 0 0 auto !important; }
    html .octane-app-root.octane-app-root .octane-catalog-content-shell { overflow: auto !important; }
    html .octane-app-root.octane-app-root .octane-catalog-grid { grid-template-columns: repeat(auto-fill, minmax(48px, 1fr)) !important; }
    html .octane-app-root.octane-app-root .octane-toolbar-mobile-hobba {
        bottom: var(--aq-phone-bottom) !important;
        width: calc(100% - var(--aq-phone-left) - var(--aq-phone-right)) !important;
        min-height: 48px;
    }
    html .octane-app-root.octane-app-root .tb-bar-scroll { -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; gap: 12px !important; }
    html .octane-app-root.octane-app-root .tb-bar-scroll > * { flex-shrink: 0; min-width: 40px; min-height: 40px; display: grid; place-items: center; }
    html .octane-app-root.octane-app-root .tb-frame {
        bottom: calc(62px + var(--aq-phone-bottom)) !important;
        top: auto !important;
        width: calc(100% - var(--aq-phone-left) - var(--aq-phone-right)) !important;
        max-width: none !important;
        height: 42px !important;
    }
    html .octane-app-root.octane-app-root .swf-chat-input-field { font-size: 16px !important; min-width: 0; }
    html .octane-app-root.octane-app-root .swf-chat-input-sizer { min-width: 0; }
}

@media (hover: none) and (pointer: coarse) and (max-device-width: 950px) and (max-width: 950px) {
    html .octane-app-root.octane-app-root .aq-phone-dock {
        position: absolute; z-index: 600; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
        bottom: var(--aq-phone-bottom); left: var(--aq-phone-left); right: var(--aq-phone-right);
        min-height: 48px; padding: 3px; gap: 3px; border: 1px solid #41758a; border-radius: 14px;
        background: #102c3d; box-shadow: 0 4px 18px #0006;
    }
    html .octane-app-root.octane-app-root .aq-phone-dock button {
        display: flex; align-items: center; justify-content: center; gap: 4px;
        min-width: 0; min-height: 44px; border: 0; border-radius: 10px;
        color: #e9f8ff; background: transparent; font: 600 12px/1.2 system-ui, sans-serif;
    }
    html .octane-app-root.octane-app-root .aq-phone-dock button span { font-size: 20px; }
    html .octane-app-root.octane-app-root .aq-phone-dock button:is([aria-expanded="true"], [aria-pressed="true"]) { background: #24546a; color: #a5f1ff; }
    html .octane-app-root.octane-app-root .aq-phone-dock button:disabled { opacity: .4; }
    html .octane-app-root.octane-app-root :is(.aq-phone-menu, .aq-phone-tools) {
        display: none !important; position: absolute !important;
        bottom: calc(60px + var(--aq-phone-bottom)) !important; top: auto !important;
        left: var(--aq-phone-left) !important; right: var(--aq-phone-right) !important;
        width: auto !important; margin: 0 !important; transform: none !important;
        border: 1px solid #41758a; border-radius: 12px; padding: 6px !important;
        background: #102c3d !important; max-height: 116px; overflow: auto !important;
    }
    html[data-aq-phone-menu="true"] .octane-app-root.octane-app-root .aq-phone-menu { display: flex !important; flex-direction: column; align-items: stretch; gap: 6px; }
    html[data-aq-phone-tools="true"] .octane-app-root.octane-app-root .aq-phone-tools { display: flex !important; flex-direction: row; gap: 12px; }
    html .octane-app-root.octane-app-root .aq-phone-menu .tb-bar-scroll { width: 100%; flex: 0 0 auto; min-height: 44px; }
    html .octane-app-root.octane-app-root .aq-phone-menu .tb-bar-scroll:empty { display: none; }
    html .octane-app-root.octane-app-root .aq-phone-tools > * { flex-shrink: 0; min-width: 40px; min-height: 40px; }
    html[data-aq-phone-chat="false"] .octane-app-root.octane-app-root .tb-frame { display: none !important; }
    html[data-aq-phone-menu="true"] .octane-app-root.octane-app-root .tb-frame { bottom: calc(184px + var(--aq-phone-bottom)) !important; }
    html[data-aq-phone-tools="true"] .octane-app-root.octane-app-root .tb-frame { bottom: calc(122px + var(--aq-phone-bottom)) !important; }
    html[data-aq-phone-windows="false"] .octane-app-root.octane-app-root #draggable-windows-container { visibility: hidden; pointer-events: none; }
    html[data-aq-phone-windows="false"] .octane-app-root.octane-app-root #draggable-windows-container > * { pointer-events: none; }
}
@media (hover: none) and (pointer: coarse) and (max-device-width: 950px) and (max-width: 600px) {
    html .octane-app-root.octane-app-root .octane-inventory-furni {
        grid-template-columns: minmax(0, 1fr) !important;
        overflow: auto;
    }
    html .octane-app-root.octane-app-root .octane-inventory-content { min-width: 0 !important; overflow: auto !important; }
    html .octane-app-root.octane-app-root .octane-inventory-furni-preview { width: 100%; height: auto !important; min-height: 240px; overflow: visible; }
    html .octane-app-root.octane-app-root .octane-inventory-furni-grid { width: 100% !important; max-height: 230px; overflow-y: auto; }
    html .octane-app-root.octane-app-root .octane-inventory-furni-grid .grid { grid-template-columns: repeat(auto-fill, minmax(46px, 1fr)) !important; }
    html .octane-app-root.octane-app-root .octane-inventory-window { height: min(650px, calc(var(--aq-ui-height, 100dvh) - 140px)) !important; }
}

