/*
 * Oracle App Builder — mobile workspace
 *
 * This file is intentionally inert unless the document body has the
 * `mobile-app-builder` class. The host page owns view state by applying one of:
 *
 *   builder-view-build | builder-view-preview | builder-view-code | builder-view-files
 *
 * The fixed navigation is expected to use `.mobile-builder-nav` and
 * `.mobile-builder-tab` elements. This stylesheet does not alter desktop Studio.
 */

.mobile-builder-nav,
.mobile-builder-title,
.mobile-github-btn,
.mobile-builder-menu-btn,
.mobile-builder-actions-overlay,
.mobile-builder-notice {
    display: none;
}

/* Honest entry notice while App Builder is still in public beta. */
.builder-beta-overlay[hidden] {
    display: none !important;
}

.builder-beta-overlay {
    position: fixed;
    z-index: 2147483646;
    inset: 0;
    display: grid;
    place-items: center;
    padding: max(24px, env(safe-area-inset-top, 0px)) max(18px, env(safe-area-inset-right, 0px)) max(24px, env(safe-area-inset-bottom, 0px)) max(18px, env(safe-area-inset-left, 0px));
    background: rgba(0, 0, 0, 0.78);
    backdrop-filter: blur(18px) saturate(120%);
    -webkit-backdrop-filter: blur(18px) saturate(120%);
}

.builder-beta-dialog {
    width: min(100%, 460px);
    padding: 28px;
    color: #f5f5f7;
    background: #151517;
    border: 1px solid #343437;
    border-radius: 24px;
    box-shadow: 0 32px 100px rgba(0, 0, 0, 0.72);
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", Inter, system-ui, sans-serif;
}

.builder-beta-badge {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 10px;
    color: #0b0b0c;
    background: #f5f5f7;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 760;
    letter-spacing: 0.08em;
}

.builder-beta-dialog h2 {
    margin: 18px 0 10px;
    color: #f5f5f7;
    font-size: clamp(25px, 5vw, 32px);
    font-weight: 720;
    line-height: 1.12;
    letter-spacing: -0.035em;
}

.builder-beta-dialog p {
    margin: 0;
    color: #b0b0b5;
    font-size: 16px;
    line-height: 1.55;
}

.builder-beta-continue {
    width: 100%;
    min-height: 52px;
    margin-top: 24px;
    color: #050505;
    background: #f5f5f7;
    border: 0;
    border-radius: 14px;
    font: 680 16px/1 -apple-system, BlinkMacSystemFont, "SF Pro Text", Inter, system-ui, sans-serif;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.builder-beta-continue:active {
    transform: scale(0.985);
    background: #d9d9dd;
}

body.builder-beta-open {
    overflow: hidden;
}

@media (max-width: 1024px), (hover: none) and (pointer: coarse) {
    body.mobile-app-builder {
        --bg-primary: #000;
        --bg-secondary: #0a0a0a;
        --bg-tertiary: #151515;
        --bg-hover: #1c1c1e;
        --bg-active: #f5f5f7;
        --text-primary: #f5f5f7;
        --text-secondary: #a1a1a6;
        --text-muted: #71717a;
        --border-primary: #262629;
        --border-secondary: #3a3a3c;
        --accent-blue: #f5f5f7;
        --accent-green: #f5f5f7;
        --accent-yellow: #a1a1a6;
        --accent-purple: #f5f5f7;
        --success: #f5f5f7;
        --error: #ff453a;
        --warning: #a1a1a6;
        --info: #f5f5f7;
        --mobile-builder-header: calc(56px + env(safe-area-inset-top, 0px));
        --mobile-builder-nav-height: calc(66px + env(safe-area-inset-bottom, 0px));
        --mobile-builder-radius: 18px;
        --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", Inter, system-ui, sans-serif;
        --font-mono: "SF Mono", ui-monospace, Menlo, Monaco, Consolas, monospace;

        width: 100%;
        height: 100%;
        margin: 0;
        overflow: hidden;
        color: var(--text-primary);
        background: #000;
        color-scheme: dark;
        font-family: var(--font-sans);
        font-synthesis: none;
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
        -webkit-text-size-adjust: 100%;
        text-rendering: optimizeLegibility;
        overscroll-behavior: none;
    }

    body.mobile-app-builder *,
    body.mobile-app-builder *::before,
    body.mobile-app-builder *::after {
        box-sizing: border-box;
    }

    body.mobile-app-builder button,
    body.mobile-app-builder input,
    body.mobile-app-builder textarea,
    body.mobile-app-builder select {
        font: inherit;
        -webkit-tap-highlight-color: transparent;
    }

    body.mobile-app-builder button,
    body.mobile-app-builder a,
    body.mobile-app-builder [role="button"] {
        touch-action: manipulation;
    }

    body.mobile-app-builder .app {
        position: relative;
        display: flex;
        width: 100%;
        height: 100vh !important;
        height: 100dvh !important;
        min-height: 0;
        overflow: hidden;
        background: #000;
        isolation: isolate;
    }

    /* Compact native-style title bar. */
    body.mobile-app-builder .topbar {
        position: relative;
        z-index: 40;
        display: grid;
        grid-template-columns: 52px minmax(0, 1fr) auto;
        align-items: center;
        gap: 6px;
        width: 100%;
        min-height: var(--mobile-builder-header) !important;
        height: var(--mobile-builder-header) !important;
        padding: env(safe-area-inset-top, 0px) max(10px, env(safe-area-inset-right, 0px)) 0 max(10px, env(safe-area-inset-left, 0px)) !important;
        color: #f5f5f7;
        background: rgba(0, 0, 0, 0.94);
        border: 0;
        border-bottom: 1px solid #1f1f21;
        box-shadow: none;
        backdrop-filter: saturate(130%) blur(20px);
        -webkit-backdrop-filter: saturate(130%) blur(20px);
    }

    body.mobile-app-builder .topbar-left,
    body.mobile-app-builder .topbar-right {
        display: flex;
        align-items: center;
        min-width: 0;
        gap: 4px;
    }

    body.mobile-app-builder .topbar-left {
        grid-column: 1;
        justify-content: flex-start;
    }

    body.mobile-app-builder .topbar-right {
        grid-column: 3;
        justify-content: flex-end;
        overflow: visible;
    }

    body.mobile-app-builder .topbar-left > :not(a:first-child),
    body.mobile-app-builder .topbar-center,
    body.mobile-app-builder .topbar-right > * {
        display: none !important;
    }

    body.mobile-app-builder .topbar-left > a:first-child {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        width: 44px;
        min-width: 44px;
        height: 44px;
        min-height: 44px;
        padding: 0;
        color: #f5f5f7;
        background: transparent;
        border: 0;
        border-radius: 50%;
        text-decoration: none;
    }

    body.mobile-app-builder .topbar-left .back-label {
        display: none !important;
    }

    body.mobile-app-builder .topbar-left .back-icon {
        display: block;
        font-size: 26px;
        font-weight: 300;
        line-height: 1;
        transform: translateY(-1px);
    }

    body.mobile-app-builder .mobile-builder-title {
        display: block !important;
        min-width: 0;
        overflow: hidden;
        color: #f5f5f7;
        font-size: 16px;
        font-weight: 650;
        line-height: 1.2;
        letter-spacing: -0.015em;
        text-align: center;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    body.mobile-app-builder .topbar-center {
        position: static;
        grid-column: 2;
        display: flex !important;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        min-width: 0;
        transform: none;
        text-align: center;
    }

    body.mobile-app-builder .topbar-center #projectTitle {
        display: block;
        max-width: 100%;
        overflow: hidden;
        color: #77777d;
        font-size: 10px;
        font-weight: 540;
        line-height: 1.2;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    body.mobile-app-builder .mobile-github-btn,
    body.mobile-app-builder .topbar-right > .mobile-github-btn {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        min-width: 44px;
        min-height: 44px;
        height: 44px;
        padding: 0 12px;
        color: #f5f5f7 !important;
        background: #111 !important;
        border: 1px solid #343436 !important;
        border-radius: 13px;
        box-shadow: none !important;
        font-size: 13px;
        font-weight: 650;
        letter-spacing: -0.01em;
        white-space: nowrap;
    }

    body.mobile-app-builder .mobile-github-btn.connected {
        color: #000 !important;
        background: #f5f5f7 !important;
        border-color: #f5f5f7 !important;
    }

    body.mobile-app-builder .mobile-github-btn svg {
        width: 17px;
        height: 17px;
        margin-right: 6px;
        fill: currentColor;
        flex: 0 0 auto;
    }

    body.mobile-app-builder .mobile-builder-menu-btn,
    body.mobile-app-builder .topbar-right > .mobile-builder-menu-btn {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        width: 44px;
        min-width: 44px;
        height: 44px;
        min-height: 44px;
        padding: 0;
        color: #f5f5f7 !important;
        background: #111 !important;
        border: 1px solid #343436 !important;
        border-radius: 13px;
        box-shadow: none !important;
    }

    body.mobile-app-builder .mobile-builder-menu-btn svg {
        width: 20px;
        height: 20px;
        fill: currentColor;
    }

    body.mobile-app-builder .mobile-github-btn:active,
    body.mobile-app-builder .mobile-builder-menu-btn:active,
    body.mobile-app-builder .topbar-left > a:first-child:active,
    body.mobile-app-builder .mobile-builder-tab:active {
        transform: scale(0.96);
    }

    body.mobile-app-builder .mobile-builder-actions-overlay[hidden],
    body.mobile-app-builder .mobile-builder-notice[hidden] {
        display: none !important;
    }

    body.mobile-app-builder .mobile-builder-actions-overlay {
        position: fixed;
        z-index: 2200;
        inset: 0;
        display: flex;
        align-items: flex-end;
        justify-content: center;
        padding: 24px max(10px, env(safe-area-inset-right, 0px)) max(10px, env(safe-area-inset-bottom, 0px)) max(10px, env(safe-area-inset-left, 0px));
        background: rgba(0, 0, 0, 0.68);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
    }

    body.mobile-app-builder .mobile-builder-actions-sheet {
        width: min(100%, 520px);
        max-height: min(78dvh, 680px);
        padding: 8px 14px 16px;
        overflow-y: auto;
        color: #f5f5f7;
        background: #151517;
        border: 1px solid #343437;
        border-radius: 24px;
        box-shadow: 0 24px 80px rgba(0, 0, 0, 0.64);
    }

    body.mobile-app-builder .mobile-builder-actions-handle {
        width: 38px;
        height: 5px;
        margin: 2px auto 12px;
        background: #55555a;
        border-radius: 999px;
    }

    body.mobile-app-builder .mobile-builder-actions-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 14px;
        padding: 0 2px 14px;
    }

    body.mobile-app-builder .mobile-builder-actions-header h2 {
        margin: 0;
        color: #f5f5f7;
        font-size: 22px;
        font-weight: 720;
        line-height: 1.15;
        letter-spacing: -0.03em;
    }

    body.mobile-app-builder .mobile-builder-actions-header p {
        margin: 4px 0 0;
        color: #8e8e93;
        font-size: 13px;
        line-height: 1.35;
    }

    body.mobile-app-builder .mobile-builder-actions-close {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 44px;
        min-width: 44px;
        height: 44px;
        color: #f5f5f7;
        background: #242426;
        border: 1px solid #3c3c3f;
        border-radius: 50%;
        font-size: 27px;
        font-weight: 300;
        line-height: 1;
    }

    body.mobile-app-builder .mobile-builder-actions-grid {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    body.mobile-app-builder .mobile-builder-actions-grid > button {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        justify-content: center;
        min-height: 78px;
        padding: 14px;
        color: #f5f5f7;
        background: #202022;
        border: 1px solid #38383b;
        border-radius: 16px;
        text-align: left;
    }

    body.mobile-app-builder .mobile-builder-actions-grid > button:active {
        background: #2b2b2e;
        transform: scale(0.98);
    }

    body.mobile-app-builder .mobile-builder-actions-grid strong {
        font-size: 15px;
        font-weight: 680;
        line-height: 1.25;
        letter-spacing: -0.015em;
    }

    body.mobile-app-builder .mobile-builder-actions-grid span {
        margin-top: 4px;
        color: #8e8e93;
        font-size: 12px;
        line-height: 1.25;
    }

    body.mobile-app-builder .mobile-builder-notice {
        position: fixed;
        z-index: 2300;
        top: calc(var(--mobile-builder-header) + 10px);
        left: 50%;
        display: block;
        width: max-content;
        max-width: calc(100vw - 28px);
        padding: 11px 15px;
        overflow: hidden;
        color: #f5f5f7;
        background: #1b1b1d;
        border: 1px solid #424246;
        border-radius: 13px;
        box-shadow: 0 16px 44px rgba(0, 0, 0, 0.48);
        opacity: 0;
        transform: translate(-50%, -8px);
        transition: opacity 160ms ease, transform 160ms ease;
        font-size: 14px;
        font-weight: 600;
        line-height: 1.35;
        text-align: center;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    body.mobile-app-builder .mobile-builder-notice.show {
        opacity: 1;
        transform: translate(-50%, 0);
    }

    body.mobile-app-builder .mobile-builder-notice.error {
        color: #ffb4ad;
        border-color: rgba(255, 69, 58, 0.58);
    }

    /* The nav replaces desktop toolbars on handheld screens. */
    body.mobile-app-builder .mobile-builder-nav {
        position: fixed;
        z-index: 1100;
        right: 0;
        bottom: 0;
        left: 0;
        display: grid !important;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        align-items: start;
        gap: 4px;
        height: var(--mobile-builder-nav-height);
        padding: 7px max(9px, env(safe-area-inset-right, 0px)) env(safe-area-inset-bottom, 0px) max(9px, env(safe-area-inset-left, 0px));
        background: rgba(8, 8, 8, 0.96);
        border-top: 1px solid #272729;
        box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.28);
        backdrop-filter: saturate(130%) blur(22px);
        -webkit-backdrop-filter: saturate(130%) blur(22px);
    }

    body.mobile-app-builder .mobile-builder-tab {
        position: relative;
        display: inline-flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2px;
        width: 100%;
        min-width: 44px;
        min-height: 50px;
        padding: 4px 6px;
        color: #7c7c82;
        background: transparent;
        border: 0;
        border-radius: 13px;
        box-shadow: none;
        font-size: 11px;
        font-weight: 590;
        line-height: 1.15;
        letter-spacing: -0.005em;
        transition: color 120ms ease, background-color 120ms ease, transform 80ms ease;
    }

    body.mobile-app-builder .mobile-builder-tab svg {
        width: 21px;
        height: 21px;
        fill: none;
        stroke: currentColor;
        stroke-width: 1.8;
    }

    body.mobile-app-builder.builder-view-build .mobile-builder-tab[data-builder-view="build"],
    body.mobile-app-builder.builder-view-preview .mobile-builder-tab[data-builder-view="preview"],
    body.mobile-app-builder.builder-view-code .mobile-builder-tab[data-builder-view="code"],
    body.mobile-app-builder.builder-view-files .mobile-builder-tab[data-builder-view="files"],
    body.mobile-app-builder.builder-view-build .mobile-builder-tab[data-view="build"],
    body.mobile-app-builder.builder-view-preview .mobile-builder-tab[data-view="preview"],
    body.mobile-app-builder.builder-view-code .mobile-builder-tab[data-view="code"],
    body.mobile-app-builder.builder-view-files .mobile-builder-tab[data-view="files"],
    body.mobile-app-builder .mobile-builder-tab.is-active,
    body.mobile-app-builder .mobile-builder-tab[aria-selected="true"] {
        color: #f5f5f7;
        background: #1a1a1c;
    }

    /* One workspace at a time. The default/fallback is Build. */
    body.mobile-app-builder .main-split,
    body.mobile-app-builder .main-split.has-activity-bar {
        position: relative;
        display: flex !important;
        flex: 1 1 auto;
        flex-direction: column !important;
        width: 100%;
        min-width: 0;
        min-height: 0;
        margin: 0 !important;
        padding: 0 0 var(--mobile-builder-nav-height);
        overflow: hidden;
        background: #000;
    }

    body.mobile-app-builder .file-tree-panel,
    body.mobile-app-builder .left-panel,
    body.mobile-app-builder .right-panel {
        display: none !important;
    }

    body.mobile-app-builder.builder-view-build .left-panel,
    body.mobile-app-builder:not(.builder-view-preview):not(.builder-view-code):not(.builder-view-files) .left-panel {
        display: flex !important;
    }

    body.mobile-app-builder.builder-view-preview .right-panel,
    body.mobile-app-builder.builder-view-code .right-panel {
        display: flex !important;
    }

    body.mobile-app-builder.builder-view-files .file-tree-panel {
        display: flex !important;
    }

    /* Build/chat pane. */
    body.mobile-app-builder .left-panel {
        flex: 1 1 auto !important;
        flex-direction: column;
        width: 100% !important;
        min-width: 0 !important;
        height: 100% !important;
        max-height: none !important;
        overflow: hidden;
        color: #f5f5f7;
        background: #000;
        border: 0 !important;
    }

    body.mobile-app-builder .lp-header {
        display: flex;
        align-items: center;
        min-height: 44px;
        padding: 0 max(16px, env(safe-area-inset-right, 0px)) 0 max(16px, env(safe-area-inset-left, 0px));
        color: #a1a1a6;
        background: #000;
        border: 0;
        border-bottom: 1px solid #1f1f21;
    }

    body.mobile-app-builder .lp-header-left {
        min-width: 0;
        color: #a1a1a6;
        font-size: 12px;
        font-weight: 590;
        letter-spacing: 0.01em;
    }

    body.mobile-app-builder .lp-header-dot,
    body.mobile-app-builder .rp-tab-dot {
        color: #f5f5f7;
    }

    body.mobile-app-builder .studio-model-badge {
        min-height: 24px;
        padding: 3px 9px;
        color: #c7c7cc;
        background: #171719;
        border: 1px solid #303033;
        border-radius: 999px;
        font-size: 10px;
        font-weight: 650;
    }

    body.mobile-app-builder .lp-header-actions {
        display: none !important;
    }

    body.mobile-app-builder .chat-scroll {
        flex: 1 1 auto;
        min-height: 0;
        gap: 20px;
        padding: 18px max(18px, env(safe-area-inset-right, 0px)) 24px max(18px, env(safe-area-inset-left, 0px));
        overflow-x: hidden;
        overflow-y: auto;
        background: #000;
        scrollbar-width: none;
        overscroll-behavior-y: contain;
        -webkit-overflow-scrolling: touch;
    }

    body.mobile-app-builder .chat-scroll::-webkit-scrollbar,
    body.mobile-app-builder .code-file-tabs::-webkit-scrollbar,
    body.mobile-app-builder .file-tree-body::-webkit-scrollbar {
        display: none;
    }

    body.mobile-app-builder .msg {
        width: 100%;
        max-width: 100%;
    }

    body.mobile-app-builder .msg-role {
        margin-bottom: 7px;
        color: #8e8e93 !important;
        font-size: 12px;
        font-weight: 650;
        letter-spacing: 0.015em;
        text-transform: none;
    }

    body.mobile-app-builder .msg-role.user {
        color: #d1d1d6 !important;
    }

    body.mobile-app-builder .msg-body {
        max-width: 100%;
        color: #eeeeef;
        font-size: 16px;
        line-height: 1.55;
        letter-spacing: -0.012em;
    }

    body.mobile-app-builder .msg-time,
    body.mobile-app-builder .msg-model,
    body.mobile-app-builder .msg-meta,
    body.mobile-app-builder .msg-thought {
        color: #6f6f74;
        font-size: 11px;
    }

    body.mobile-app-builder .msg-thinking {
        gap: 10px;
        padding: 8px 0;
    }

    body.mobile-app-builder .msg-thinking-shimmer {
        height: 2px;
        max-width: 220px;
        background: #242426;
    }

    body.mobile-app-builder .msg-thinking-shimmer-bar {
        background: #f5f5f7 !important;
        background-image: none !important;
        opacity: 0.84;
    }

    body.mobile-app-builder .msg-thinking-status {
        color: #a1a1a6;
    }

    body.mobile-app-builder .msg-thinking-dots i {
        background: #f5f5f7;
    }

    body.mobile-app-builder .file-item,
    body.mobile-app-builder .file-list-item {
        min-height: 44px;
        color: #d1d1d6;
        border-color: #242426;
    }

    body.mobile-app-builder .file-item-spinner {
        border-color: #343437;
        border-top-color: #f5f5f7;
    }

    /* Composer stays pinned above the bottom navigation. */
    body.mobile-app-builder .chat-input-area {
        position: sticky;
        z-index: 20;
        right: 0;
        bottom: 0;
        left: 0;
        flex: 0 0 auto;
        padding: 8px max(12px, env(safe-area-inset-right, 0px)) 12px max(12px, env(safe-area-inset-left, 0px));
        background: #000;
        border: 0;
    }

    body.mobile-app-builder .chat-form {
        display: flex;
        align-items: flex-end;
        min-height: 60px;
        padding: 8px 8px 8px 15px;
        overflow: hidden;
        color: #f5f5f7;
        background: #171719;
        border: 1px solid #3a3a3d;
        border-radius: 20px;
        box-shadow: 0 8px 28px rgba(0, 0, 0, 0.26);
    }

    body.mobile-app-builder .chat-form::before {
        display: none !important;
        content: none !important;
        background: none !important;
        animation: none !important;
    }

    body.mobile-app-builder .chat-form:hover,
    body.mobile-app-builder .chat-form:focus-within {
        border-color: #5a5a5e;
        box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08), 0 8px 28px rgba(0, 0, 0, 0.26);
    }

    body.mobile-app-builder .chat-input {
        min-height: 44px;
        max-height: 132px;
        padding: 10px 0 7px;
        color: #f5f5f7;
        background: transparent;
        caret-color: #f5f5f7;
        font-size: 16px !important;
        line-height: 1.4;
        letter-spacing: -0.012em;
    }

    body.mobile-app-builder .chat-input::placeholder {
        color: #77777d;
        opacity: 1;
    }

    body.mobile-app-builder .chat-actions {
        gap: 2px;
        margin-left: 4px;
    }

    body.mobile-app-builder .chat-action-btn,
    body.mobile-app-builder .chat-send {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 44px;
        min-width: 44px;
        height: 44px;
        min-height: 44px;
        margin: 0;
        color: #d1d1d6;
        background: transparent;
        border: 0;
        border-radius: 50%;
        box-shadow: none;
    }

    body.mobile-app-builder .chat-action-btn svg {
        width: 21px;
        height: 21px;
        fill: currentColor;
    }

    body.mobile-app-builder .chat-send {
        color: #000;
        background: #f5f5f7;
    }

    body.mobile-app-builder .chat-send svg,
    body.mobile-app-builder .chat-send:hover svg {
        width: 19px;
        height: 19px;
        fill: #000;
    }

    body.mobile-app-builder .chat-send:disabled {
        color: #67676c;
        background: #2a2a2d;
        opacity: 1;
    }

    body.mobile-app-builder .chat-send:disabled svg {
        fill: #77777c;
    }

    /* Preview and source panes occupy the entire available workspace. */
    body.mobile-app-builder .right-panel {
        flex: 1 1 auto !important;
        flex-direction: column;
        width: 100% !important;
        min-width: 0 !important;
        min-height: 0 !important;
        height: 100% !important;
        overflow: hidden;
        background: #000;
        border: 0;
    }

    body.mobile-app-builder .rp-header,
    body.mobile-app-builder .console-panel,
    body.mobile-app-builder .mobile-console-toggle {
        display: none !important;
    }

    body.mobile-app-builder .rp-body {
        display: flex;
        flex: 1 1 auto;
        width: 100%;
        min-height: 0;
        overflow: hidden;
        background: #000;
    }

    body.mobile-app-builder.builder-view-preview .preview-wrap {
        display: flex !important;
    }

    body.mobile-app-builder.builder-view-preview .code-wrap {
        display: none !important;
    }

    body.mobile-app-builder.builder-view-code .preview-wrap {
        display: none !important;
    }

    body.mobile-app-builder.builder-view-code .code-wrap {
        display: flex !important;
    }

    body.mobile-app-builder .preview-wrap {
        width: 100%;
        height: 100%;
        min-height: 0;
        overflow: hidden;
        background: #080808;
    }

    body.mobile-app-builder .preview-wrap iframe {
        width: 100%;
        height: 100%;
        border: 0;
        background: #fff;
    }

    body.mobile-app-builder .preview-empty {
        justify-content: flex-start;
        width: 100%;
        height: 100%;
        gap: 10px;
        padding: 34px max(18px, env(safe-area-inset-right, 0px)) 24px max(18px, env(safe-area-inset-left, 0px));
        overflow-y: auto;
        color: #8e8e93;
        background: #000;
        text-align: left;
        align-items: stretch;
    }

    body.mobile-app-builder .preview-empty-title {
        color: #f5f5f7;
        font-size: clamp(25px, 7vw, 34px);
        font-weight: 700;
        line-height: 1.08;
        letter-spacing: -0.035em;
    }

    body.mobile-app-builder .preview-empty-sub {
        max-width: 34rem;
        margin-bottom: 12px;
        color: #98989d;
        font-size: 15px;
        line-height: 1.45;
    }

    body.mobile-app-builder .suggestion-grid {
        display: grid;
        grid-template-columns: 1fr;
        width: 100%;
        max-width: none;
        gap: 10px;
        margin: 0;
    }

    body.mobile-app-builder .suggestion-grid .suggestion-card,
    body.mobile-app-builder .suggestion-card {
        width: 100%;
        min-width: 0;
        min-height: 64px;
        padding: 13px 15px;
        color: #f5f5f7;
        background: #121214;
        border: 1px solid #2d2d30;
        border-radius: 16px;
        box-shadow: none;
    }

    body.mobile-app-builder .suggestion-card:hover,
    body.mobile-app-builder .suggestion-card:active {
        color: #fff;
        background: #1a1a1c;
        border-color: #505054;
    }

    body.mobile-app-builder .code-wrap {
        width: 100%;
        height: 100%;
        min-height: 0;
        overflow: hidden;
        background: #000;
    }

    body.mobile-app-builder .code-file-tabs {
        min-height: 46px;
        padding: 0 max(8px, env(safe-area-inset-right, 0px)) 0 max(8px, env(safe-area-inset-left, 0px));
        overflow-x: auto;
        background: #0b0b0c;
        border-bottom: 1px solid #29292c;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
    }

    body.mobile-app-builder .code-file-tab {
        min-width: max-content;
        min-height: 46px;
        padding: 0 14px;
        color: #85858b;
        background: transparent;
        border: 0;
        border-bottom: 2px solid transparent;
        font-family: var(--font-mono);
        font-size: 12px;
    }

    body.mobile-app-builder .code-file-tab.active {
        color: #f5f5f7;
        background: transparent;
        border-bottom-color: #f5f5f7;
    }

    body.mobile-app-builder .code-editor-area {
        flex: 1 1 auto;
        min-height: 0;
        overflow: hidden;
        background: #000;
    }

    body.mobile-app-builder .code-line-nums {
        width: 42px;
        padding: 14px 0;
        color: #55555a;
        background: #050505;
        font-family: var(--font-mono);
        font-size: 12px;
        line-height: 1.65;
    }

    body.mobile-app-builder .code-line-nums div {
        padding-right: 10px;
    }

    body.mobile-app-builder .code-textarea,
    body.mobile-app-builder .code-textarea.readonly-asset {
        min-width: 0;
        padding: 14px;
        color: #eeeeef;
        background: #000;
        caret-color: #fff;
        font-family: var(--font-mono);
        font-size: 13px !important;
        line-height: 1.65;
        -webkit-overflow-scrolling: touch;
    }

    /* Full-height mobile file browser. */
    body.mobile-app-builder .file-tree-panel {
        flex: 1 1 auto !important;
        flex-direction: column;
        width: 100% !important;
        min-width: 0 !important;
        max-width: none !important;
        height: 100% !important;
        min-height: 0;
        overflow: hidden;
        color: #f5f5f7;
        background: #000;
        border: 0;
    }

    body.mobile-app-builder .file-tree-header {
        min-height: 52px;
        padding: 0 max(12px, env(safe-area-inset-right, 0px)) 0 max(17px, env(safe-area-inset-left, 0px));
        color: #f5f5f7;
        background: #000;
        border-bottom: 1px solid #252527;
        font-size: 13px;
        font-weight: 700;
        letter-spacing: 0.06em;
    }

    body.mobile-app-builder .file-tree-actions {
        gap: 2px;
    }

    body.mobile-app-builder .file-tree-action {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 44px;
        min-width: 44px;
        height: 44px;
        min-height: 44px;
        padding: 0;
        color: #d1d1d6;
        background: transparent;
        border: 0;
        border-radius: 12px;
        font-size: 18px;
    }

    body.mobile-app-builder .file-tree-action:active {
        background: #1b1b1d;
    }

    body.mobile-app-builder .file-tree-body {
        flex: 1 1 auto;
        min-height: 0;
        padding: 8px max(10px, env(safe-area-inset-right, 0px)) 18px max(10px, env(safe-area-inset-left, 0px));
        overflow-y: auto;
        background: #000;
        scrollbar-width: none;
        overscroll-behavior-y: contain;
        -webkit-overflow-scrolling: touch;
    }

    body.mobile-app-builder .file-tree-item {
        min-height: 46px;
        gap: 10px;
        padding: 9px 12px;
        color: #d1d1d6;
        background: transparent;
        border-radius: 12px;
        font-family: var(--font-mono);
        font-size: 13px;
    }

    body.mobile-app-builder .file-tree-item.folder {
        color: #f5f5f7;
        font-weight: 600;
    }

    body.mobile-app-builder .file-tree-item:hover {
        background: #121214;
    }

    body.mobile-app-builder .file-tree-item.active {
        color: #000;
        background: #f5f5f7;
    }

    body.mobile-app-builder .file-tree-folder-contents {
        margin-left: 13px;
        border-left: 1px solid #28282b;
    }

    body.mobile-app-builder .focus-pack-panel {
        display: none !important;
    }

    /* Desktop-only operational UI stays out of the handheld workspace. */
    body.mobile-app-builder .activity-bar,
    body.mobile-app-builder .crdt-status,
    body.mobile-app-builder .crdt-ai-indicator,
    body.mobile-app-builder .acceptance-tests-btn,
    body.mobile-app-builder #jobQueueBtn,
    body.mobile-app-builder .job-queue-drawer,
    body.mobile-app-builder .patch-history-drawer,
    body.mobile-app-builder .topbar-status,
    body.mobile-app-builder .autofix-btn {
        display: none !important;
    }

    /* Bottom-sheet treatment for retained dialogs. */
    body.mobile-app-builder .github-modal-overlay,
    body.mobile-app-builder .projects-modal-overlay,
    body.mobile-app-builder .rename-modal-overlay,
    body.mobile-app-builder .diff-overlay {
        z-index: 3000;
        align-items: flex-end;
        justify-content: center;
        padding: 0;
        background: rgba(0, 0, 0, 0.72);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
    }

    body.mobile-app-builder .github-modal,
    body.mobile-app-builder .projects-modal,
    body.mobile-app-builder .diff-modal,
    body.mobile-app-builder .rename-modal {
        width: 100%;
        max-width: none;
        max-height: min(92dvh, 920px);
        margin: 0;
        padding-bottom: env(safe-area-inset-bottom, 0px);
        color: #f5f5f7;
        background: #111113;
        border: 1px solid #343437;
        border-bottom: 0;
        border-radius: 24px 24px 0 0;
        box-shadow: 0 -18px 60px rgba(0, 0, 0, 0.48);
    }

    body.mobile-app-builder .rename-modal {
        padding: 22px max(18px, env(safe-area-inset-right, 0px)) calc(18px + env(safe-area-inset-bottom, 0px)) max(18px, env(safe-area-inset-left, 0px));
    }

    body.mobile-app-builder .github-modal-header,
    body.mobile-app-builder .projects-modal-header,
    body.mobile-app-builder .diff-header {
        min-height: 58px;
        padding: 8px max(16px, env(safe-area-inset-right, 0px)) 8px max(18px, env(safe-area-inset-left, 0px));
        background: #111113;
        border-bottom: 1px solid #2d2d30;
    }

    body.mobile-app-builder .github-modal-close,
    body.mobile-app-builder .projects-modal-close,
    body.mobile-app-builder .diff-close {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 44px;
        min-width: 44px;
        height: 44px;
        min-height: 44px;
        padding: 0;
        color: #f5f5f7;
        background: #222225;
        border: 1px solid #39393c;
        border-radius: 50%;
    }

    body.mobile-app-builder .github-modal-body,
    body.mobile-app-builder .projects-modal-body,
    body.mobile-app-builder .diff-body {
        padding: 16px max(16px, env(safe-area-inset-right, 0px)) 18px max(16px, env(safe-area-inset-left, 0px));
        color: #d1d1d6;
        background: #111113;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
    }

    body.mobile-app-builder .github-config-grid {
        grid-template-columns: 1fr;
    }

    body.mobile-app-builder .github-input,
    body.mobile-app-builder .github-textarea,
    body.mobile-app-builder .rename-modal-input,
    body.mobile-app-builder .console-input {
        min-height: 48px;
        color: #f5f5f7;
        background: #050505;
        border: 1px solid #3a3a3d;
        border-radius: 13px;
        caret-color: #fff;
        font-size: 16px;
    }

    body.mobile-app-builder .github-input:focus,
    body.mobile-app-builder .github-textarea:focus,
    body.mobile-app-builder .rename-modal-input:focus {
        border-color: #77777c;
        box-shadow: 0 0 0 1px #77777c;
        outline: 0;
    }

    body.mobile-app-builder .github-status-card,
    body.mobile-app-builder .github-checkbox-row,
    body.mobile-app-builder .github-file-review,
    body.mobile-app-builder .github-banner,
    body.mobile-app-builder .project-card {
        color: #d1d1d6;
        background: #18181a;
        border: 1px solid #323235;
        border-radius: 15px;
    }

    body.mobile-app-builder .github-file-review-list {
        color: #d1d1d6;
        background: #090909;
        border-radius: 10px;
        padding: 10px;
    }

    body.mobile-app-builder .github-status-pill,
    body.mobile-app-builder .github-status-pill.connected {
        color: #f5f5f7;
        background: #242426;
        border-color: #444448;
    }

    body.mobile-app-builder .github-modal-actions,
    body.mobile-app-builder .rename-modal-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
        padding: 12px max(16px, env(safe-area-inset-right, 0px)) calc(12px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
        background: #111113;
        border-top: 1px solid #2d2d30;
    }

    body.mobile-app-builder .github-btn,
    body.mobile-app-builder .rename-modal-btn {
        min-height: 48px;
        padding: 0 14px;
        border-radius: 14px;
        font-size: 15px;
        font-weight: 680;
    }

    body.mobile-app-builder .github-btn.primary,
    body.mobile-app-builder .rename-modal-btn.confirm {
        color: #000;
        background: #f5f5f7;
        border-color: #f5f5f7;
    }

    body.mobile-app-builder .github-btn.secondary,
    body.mobile-app-builder .rename-modal-btn.cancel {
        color: #f5f5f7;
        background: #252527;
        border-color: #3b3b3e;
    }

    body.mobile-app-builder .github-btn.danger,
    body.mobile-app-builder .github-banner.error,
    body.mobile-app-builder .console-entry.error,
    body.mobile-app-builder .problems-count {
        color: #ff453a;
        border-color: rgba(255, 69, 58, 0.48);
    }

    body.mobile-app-builder .project-card {
        min-height: 68px;
        padding: 12px;
    }

    body.mobile-app-builder .project-card-icon {
        color: #000;
        background: #f5f5f7;
        background-image: none;
        border-radius: 12px;
    }

    body.mobile-app-builder .upload-drag-overlay {
        inset: 8px;
        color: #f5f5f7;
        background: rgba(8, 8, 8, 0.96);
        border: 1px dashed #737378;
        border-radius: 18px;
    }

    /* Consistent native focus treatment without colored accents. */
    body.mobile-app-builder button:focus-visible,
    body.mobile-app-builder a:focus-visible,
    body.mobile-app-builder [role="button"]:focus-visible,
    body.mobile-app-builder select:focus-visible {
        outline: 2px solid #f5f5f7 !important;
        outline-offset: 2px;
    }

    @supports selector(body:has(textarea:focus)) {
        body.mobile-app-builder:has(.chat-input:focus) .mobile-builder-nav {
            transform: translateY(105%);
            opacity: 0;
            pointer-events: none;
        }

        body.mobile-app-builder:has(.chat-input:focus) .main-split {
            padding-bottom: 0;
        }
    }

    @media (orientation: landscape) and (max-height: 540px) {
        body.mobile-app-builder {
            --mobile-builder-header: calc(48px + env(safe-area-inset-top, 0px));
            --mobile-builder-nav-height: calc(56px + env(safe-area-inset-bottom, 0px));
        }

        body.mobile-app-builder .mobile-builder-nav {
            padding-top: 4px;
        }

        body.mobile-app-builder .mobile-builder-tab {
            flex-direction: row;
            min-height: 44px;
            gap: 6px;
        }

        body.mobile-app-builder .mobile-builder-tab svg {
            width: 18px;
            height: 18px;
        }

        body.mobile-app-builder .lp-header {
            display: none;
        }
    }

    @media (max-width: 360px) {
        body.mobile-app-builder .mobile-github-btn {
            width: 44px;
            min-width: 44px;
            padding: 0;
        }

        body.mobile-app-builder .mobile-github-btn svg {
            margin-right: 0;
        }

        body.mobile-app-builder .mobile-github-btn span {
            display: none;
        }
    }

    @media (prefers-reduced-motion: reduce) {
        body.mobile-app-builder *,
        body.mobile-app-builder *::before,
        body.mobile-app-builder *::after {
            scroll-behavior: auto !important;
            animation-duration: 0.01ms !important;
            animation-iteration-count: 1 !important;
            transition-duration: 0.01ms !important;
        }
    }
}
