:root {
    --ink: #171918;
    --muted: #69706d;
    --paper: #f6f3eb;
    --panel: #ffffff;
    --line: #ded7c8;
    --dark: #181b1a;
    --dark-2: #262b28;
    --gold: #d9b86f;
    --teal: #238176;
    --aqua: #8ccfc2;
    --coral: #c96f55;
    --steel: #b8c4c8;
    --shadow: 0 22px 70px rgba(15, 17, 16, 0.18);
}

/* Designer3D refactor layer */
.kitchen-editor-page {
    min-height: calc(100vh - 80px);
    padding: 10px clamp(8px, 1.2vw, 16px) 16px;
    background: #eef1ef;
}

.editor-service-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

    .editor-service-nav a {
        border: 1px solid rgba(31, 41, 55, 0.18);
        border-radius: 8px;
        color: #1f2937;
        font-weight: 700;
        padding: 8px 12px;
        text-decoration: none;
        background: rgba(255, 255, 255, 0.72);
    }

        .editor-service-nav a.active,
        .editor-service-nav a:hover,
        .editor-service-nav a:focus {
            background: #1f2937;
            color: #fff;
        }

.editor-workspace {
    grid-template-columns: minmax(190px, 250px) minmax(660px, 1fr) minmax(230px, 300px);
    gap: 10px;
    min-height: 560px;
}

    .editor-workspace .room-panel,
    .editor-workspace .room-stage {
        border: 1px solid rgba(31, 41, 55, 0.14);
        border-radius: 8px;
        box-shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
    }

    .editor-workspace .room-stage {
        background: #17201d;
        overflow: hidden;
    }

    .editor-workspace .designer-canvas {
        block-size: auto;
        cursor: grab;
        min-block-size: 0;
        touch-action: none;
    }

        .editor-workspace .designer-canvas:active {
            cursor: grabbing;
        }

.panel-note {
    border-block-start: 1px solid rgba(31, 41, 55, 0.12);
    color: #64748b;
    font-size: 0.86rem;
    line-height: 1.7;
    margin-block-start: 14px;
    padding-block-start: 12px;
}

.compact-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.room-dimensions-panel {
    border-block-end: 1px solid rgba(31, 41, 55, 0.12);
    margin-block-end: 16px;
    padding-block-end: 16px;
}

.property-tab-groups {
    display: grid;
    gap: 9px;
    margin-block-end: 14px;
}

.property-tab-group {
    display: grid;
    gap: 5px;
}

.property-tab-group-title {
    color: #6b7280;
    font-size: 0.72rem;
    font-weight: 900;
}

.properties-tabs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
    gap: 5px;
    margin: 0;
}

    .properties-tabs button {
        min-height: 34px;
        padding: 5px 7px;
        border: 1px solid rgba(31, 41, 55, 0.14);
        border-radius: 7px;
        background: #fff;
        color: #334155;
        font-size: 0.76rem;
        font-weight: 850;
        line-height: 1.2;
    }

        .properties-tabs button:hover {
            border-color: rgba(37, 99, 235, 0.42);
            background: #f8fafc;
        }

        .properties-tabs button.active {
            background: #1f2937;
            border-color: #1f2937;
            color: #fff;
            box-shadow: inset 0 -2px 0 #8ccfc2;
        }

.property-panel {
    border: 1px solid rgba(31, 41, 55, 0.1);
    border-radius: 8px;
    background: #fff;
    margin-block-end: 16px;
    padding: 12px;
}

    .property-panel[hidden] {
        display: none;
    }

.control-grid select,
.control-grid input[type="color"] {
    border: 1px solid rgba(31, 41, 55, 0.16);
    border-radius: 8px;
    min-height: 42px;
    padding: 8px 10px;
    width: 100%;
}

.control-grid input[type="color"] {
    padding: 4px;
}

.wide-action-button {
    background: #111827;
    border: 1px solid rgba(17, 24, 39, 0.18);
    border-radius: 8px;
    color: #fff;
    cursor: pointer;
    font-weight: 800;
    margin-block-start: 10px;
    min-height: 42px;
    width: 100%;
}

    .wide-action-button:hover {
        background: #1f2937;
    }

.checkbox-line {
    align-items: center;
    display: flex;
    gap: 8px;
}

    .checkbox-line input {
        inline-size: 18px;
    }

.selection-toolbar strong {
    color: #166534;
    font-size: 0.86rem;
    margin-inline-end: auto;
}

    .selection-toolbar strong.invalid {
        color: #b91c1c;
    }

.object-row {
    align-items: start;
    background: #fff;
    border: 1px solid rgba(31, 41, 55, 0.12);
    border-radius: 8px;
    color: #1f2937;
    display: grid;
    gap: 2px;
    margin-block-end: 8px;
    padding: 10px;
    text-align: start;
    width: 100%;
}

    .object-row.selected {
        border-color: #2563eb;
        box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.12);
    }

    .object-row small {
        color: #64748b;
    }

.ai-result {
    background: #f8fafc;
    border: 1px solid rgba(31, 41, 55, 0.12);
    border-radius: 8px;
    color: #334155;
    line-height: 1.7;
    margin-block-start: 12px;
    padding: 12px;
}

.service-page {
    background: #eef1ef;
    min-height: calc(100vh - 170px);
    padding: clamp(36px, 7vw, 86px) 16px;
}

.service-shell {
    margin: 0 auto;
    max-width: 1120px;
}

    .service-shell h1 {
        color: #111827;
        font-size: clamp(2rem, 5vw, 4.2rem);
        font-weight: 900;
        line-height: 1.05;
        margin-block: 8px 16px;
    }

.service-lead {
    color: #475569;
    font-size: 1.1rem;
    line-height: 1.9;
    max-width: 720px;
}

.service-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-block: 24px 30px;
}

.service-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

    .service-grid article {
        background: #fff;
        border: 1px solid rgba(31, 41, 55, 0.12);
        border-radius: 8px;
        padding: 18px;
    }

    .service-grid h2 {
        color: #111827;
        font-size: 1.05rem;
        font-weight: 900;
    }

    .service-grid p {
        color: #64748b;
        line-height: 1.8;
        margin: 0;
    }

@media (max-width: 1180px) {
    .editor-workspace {
        grid-template-columns: 240px minmax(380px, 1fr);
    }

        .editor-workspace .properties-panel {
            grid-column: 1 / -1;
        }
}

@media (max-width: 820px) {
    .editor-workspace,
    .service-grid {
        grid-template-columns: 1fr;
    }

        .editor-workspace .designer-canvas {
            min-block-size: 520px;
        }

    .properties-tabs {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .compact-grid {
        grid-template-columns: 1fr;
    }
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100%;
    color: var(--ink);
    background: var(--paper);
    font-family: "Segoe UI", Tahoma, Arial, sans-serif;
    line-height: 1.65;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input {
    font: inherit;
}

button {
    cursor: pointer;
}

.page-shell {
    width: min(1180px, calc(100% - 32px));
    margin-right: auto;
    margin-left: auto;
}

.site-header {
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    z-index: 100;
    background: rgba(18, 20, 19, 0.88);
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 14px 35px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(16px);
}

    .site-header .navbar {
        min-height: 66px;
        padding: 10px 0;
    }

.brand-mark {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #ffffff;
    font-weight: 900;
}

.brand-icon {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    color: #fff2cc;
    background: rgba(217, 184, 111, 0.18);
    border: 1px solid rgba(217, 184, 111, 0.72);
    border-radius: 8px;
}

.site-header .nav-link {
    color: rgba(255, 255, 255, 0.76);
    font-weight: 750;
}

    .site-header .nav-link:hover,
    .site-header .nav-link:focus {
        color: #ffffff;
    }

.nav-cta,
.primary-action,
.secondary-action,
.ai-render-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 10px 18px;
    border-radius: 8px;
    font-weight: 900;
}

.nav-cta,
.primary-action {
    color: #171918;
    background: var(--gold);
}

.secondary-action {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.28);
}

.hero-section {
    position: relative;
    min-height: 92vh;
    overflow: hidden;
    color: #ffffff;
    background: #141716;
}

.hero-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.hero-scrim {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(20, 23, 22, 0.16), rgba(20, 23, 22, 0.78) 52%, rgba(20, 23, 22, 0.96)), linear-gradient(180deg, rgba(20, 23, 22, 0.12), rgba(20, 23, 22, 0.74));
}

.hero-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 92vh;
    padding-top: 96px;
    padding-bottom: 54px;
}

.eyebrow {
    margin: 0 0 10px;
    color: var(--gold);
    font-weight: 900;
    letter-spacing: 0;
    text-transform: uppercase;
}

.hero-content h1 {
    max-width: 850px;
    margin: 0;
    font-size: 4rem;
    line-height: 1.08;
    font-weight: 950;
}

.hero-copy {
    max-width: 690px;
    margin: 22px 0 0;
    color: rgba(255, 255, 255, 0.78);
    font-size: 1.22rem;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 30px;
}

.hero-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(120px, 1fr));
    gap: 12px;
    width: min(680px, 100%);
    margin: 42px 0 0;
}

    .hero-metrics div {
        padding: 18px;
        background: rgba(255, 255, 255, 0.09);
        border: 1px solid rgba(255, 255, 255, 0.18);
        border-radius: 8px;
    }

    .hero-metrics dt {
        font-size: 1.85rem;
        font-weight: 950;
        line-height: 1;
    }

    .hero-metrics dd {
        margin: 8px 0 0;
        color: rgba(255, 255, 255, 0.72);
    }

.services-section,
.workflow-section,
.accessories-section {
    padding: 86px 0;
}

.section-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 22px;
    margin-bottom: 28px;
}

    .section-heading h2,
    .panel-title h2 {
        margin: 0;
        font-size: 2rem;
        line-height: 1.2;
        font-weight: 950;
    }

.service-grid,
.workflow-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

    .service-card,
    .workflow-grid article,
    .accessory-showcase article {
        min-height: 206px;
        padding: 22px;
        background: var(--panel);
        border: 1px solid var(--line);
        border-radius: 8px;
        box-shadow: 0 10px 24px rgba(32, 35, 33, 0.06);
    }

.service-card {
    position: relative;
    overflow: hidden;
}

    .service-card:before {
        content: "";
        position: absolute;
        top: 0;
        right: 0;
        left: 0;
        height: 4px;
        background: var(--accent);
    }

.service-dot {
    display: block;
    width: 38px;
    height: 38px;
    background: var(--accent);
    border-radius: 8px;
    opacity: 0.78;
}

.service-card h3,
.workflow-grid h3,
.accessory-showcase h3 {
    margin: 18px 0 8px;
    font-size: 1.1rem;
    font-weight: 900;
}

.service-card p,
.workflow-grid p {
    margin: 0;
    color: var(--muted);
}

.service-rate,
.accessory-showcase p {
    display: inline-flex;
    margin-top: 16px;
    color: var(--teal);
    font-weight: 900;
}

.workflow-section {
    background: #ece8dc;
}

.workflow-grid article span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    color: #ffffff;
    background: var(--dark);
    border-radius: 8px;
    font-weight: 950;
}

.accessories-section {
    background: #e8f1ed;
}

.accessory-showcase {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 14px;
}

    .accessory-showcase article {
        min-height: 142px;
        padding: 16px;
    }

    .accessory-showcase small {
        color: var(--coral);
        font-weight: 950;
    }

.site-footer {
    padding: 28px 0;
    color: rgba(255, 255, 255, 0.72);
    background: #171918;
}

.footer-grid {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

    .footer-grid strong,
    .footer-grid span {
        display: block;
    }

    .footer-grid strong {
        color: #ffffff;
    }

.designer-page {
    min-height: 100vh;
    padding: 88px 18px 18px;
    color: #ffffff;
    background: radial-gradient(circle at 24% 12%, rgba(140, 207, 194, 0.14), transparent 26%), linear-gradient(180deg, #252b28, #171918 74%);
}

.designer-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    max-width: none;
    margin: 0 auto 8px;
}

    .designer-topbar h1 {
        margin: 0;
        font-size: 1.34rem;
        font-weight: 950;
    }

.designer-topbar-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
}

.ai-render-button {
    gap: 10px;
    min-height: 42px;
    padding: 8px 12px;
    color: #171918;
    background: linear-gradient(135deg, #ffe08f, #d9b86f 48%, #8ccfc2);
    border: 0;
    box-shadow: 0 16px 38px rgba(217, 184, 111, 0.24);
}

    .ai-render-button span {
        display: grid;
        place-items: center;
        width: 32px;
        height: 32px;
        color: #ffffff;
        background: #171918;
        border-radius: 8px;
        font-size: 0.82rem;
    }

    .ai-render-button.wide {
        width: 100%;
        margin-top: 16px;
    }

    .ai-render-button:disabled {
        opacity: 0.68;
        cursor: wait;
    }

.room-workspace {
    display: grid;
    grid-template-columns: minmax(190px, 250px) minmax(660px, 1fr) minmax(230px, 300px);
    gap: 10px;
    max-width: none;
    height: calc(100vh - 112px);
    min-height: 560px;
    margin: 0 auto;
}

.room-panel {
    min-height: 0;
    padding: 10px;
    color: var(--ink);
    background: rgba(250, 248, 241, 0.98);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.library-panel,
.properties-panel {
    display: flex;
    flex-direction: column;
}

.properties-panel {
    overflow: auto;
}

.panel-title {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 10px;
}

    .panel-title h2 {
        font-size: 1.32rem;
    }

.panel-collapse-button {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    flex: 0 0 auto;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
    color: var(--ink);
    font-size: 1.3rem;
    font-weight: 900;
}

.room-workspace.library-collapsed {
    grid-template-columns: 44px minmax(720px, 1fr) minmax(230px, 300px);
}

.room-workspace.properties-collapsed {
    grid-template-columns: minmax(190px, 250px) minmax(720px, 1fr) 44px;
}

.room-workspace.library-collapsed.properties-collapsed {
    grid-template-columns: 44px minmax(820px, 1fr) 44px;
}

.room-workspace.library-collapsed .library-panel > :not(.panel-title),
.room-workspace.properties-collapsed .properties-panel > :not(.panel-title) {
    display: none;
}

.room-workspace.library-collapsed .library-panel,
.room-workspace.properties-collapsed .properties-panel {
    padding-inline: 6px;
}

    .room-workspace.library-collapsed .library-panel .panel-title > div,
    .room-workspace.properties-collapsed .properties-panel .panel-title > div {
        display: none;
    }

.segmented-control {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 14px;
}

.segment {
    min-height: 42px;
    color: var(--ink);
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 8px;
    font-weight: 850;
}

    .segment.active,
    .segment:hover {
        color: #105a52;
        background: #e4f2ee;
        border-color: var(--teal);
    }

.object-library {
    display: grid;
    gap: 8px;
    overflow: auto;
    padding-left: 4px;
}

.library-section {
    display: grid;
    gap: 8px;
}

    .library-section summary {
        cursor: pointer;
        color: var(--gold);
        font-size: 0.84rem;
        font-weight: 950;
        list-style-position: inside;
    }

.library-section-body {
    display: grid;
    gap: 8px;
}

.object-library button {
    display: grid;
    gap: 3px;
    width: 100%;
    min-height: 58px;
    padding: 9px 10px;
    text-align: start;
    color: var(--ink);
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 8px;
}

    .object-library button:hover {
        background: #eaf3ef;
        border-color: var(--teal);
    }

    .object-library button[draggable="true"] {
        cursor: grab;
    }

        .object-library button[draggable="true"]:active {
            cursor: grabbing;
        }

.object-library strong {
    font-size: 0.95rem;
}

.object-library span {
    color: var(--muted);
    font-size: 0.82rem;
}

.object-library small {
    color: #54645f;
    font-size: 0.74rem;
    font-weight: 800;
}

.room-stage {
    position: relative;
    min-height: 0;
    height: 100%;
    overflow: hidden;
    background: linear-gradient(135deg, #17201d, #202a25 58%, #101412);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 8px;
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.32);
}

    .room-stage.drag-over {
        border-color: rgba(140, 207, 194, 0.92);
        box-shadow: 0 30px 90px rgba(0, 0, 0, 0.32), inset 0 0 0 2px rgba(140, 207, 194, 0.62);
    }

.designer-canvas {
    position: absolute;
    inset: 0;
    z-index: 1;
    width: 100%;
    height: 100%;
    background: transparent;
    cursor: grab;
    touch-action: none;
}

.designer-webgl-overlay {
    position: absolute;
    inset: 0;
    z-index: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.designer-canvas:active {
    cursor: grabbing;
}

.stage-toolbar {
    position: absolute;
    top: 8px;
    right: 10px;
    left: 10px;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 6px 8px;
    color: #ffffff;
    background: rgba(18, 20, 19, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 8px;
    backdrop-filter: blur(14px);
}

    .stage-toolbar span,
    .quote-compact span,
    .control-grid span,
    .range-control span,
    .mini-heading,
    .quote-line em {
        display: block;
        color: var(--muted);
        font-size: 0.84rem;
        font-weight: 800;
    }

    .stage-toolbar span {
        color: rgba(255, 255, 255, 0.68);
    }

    .stage-toolbar strong {
        display: block;
        font-size: 0.92rem;
    }

.selection-toolbar {
    position: absolute;
    right: 16px;
    bottom: 10px;
    left: 16px;
    z-index: 4;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 7px 10px;
    color: #ffffff;
    background: rgba(18, 20, 19, 0.74);
    border: 1px solid rgba(140, 207, 194, 0.34);
    border-radius: 8px;
    backdrop-filter: blur(14px);
}

    .selection-toolbar span {
        min-width: 0;
        overflow: hidden;
        color: rgba(255, 255, 255, 0.86);
        font-weight: 900;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .selection-toolbar button {
        min-height: 32px;
        padding: 5px 10px;
        color: #102522;
        background: #8ccfc2;
        border: 0;
        border-radius: 8px;
        font-weight: 900;
    }

        .selection-toolbar button:last-child {
            color: #ffffff;
            background: #c96f55;
        }

        .selection-toolbar button:disabled {
            opacity: 0.46;
            cursor: not-allowed;
        }

.room-stage:not(.has-selection) .selection-toolbar {
    left: auto;
    width: min(360px, calc(100% - 32px));
}

    .room-stage:not(.has-selection) .selection-toolbar button {
        display: none;
    }

.room-stage.inside-camera-view .selection-toolbar {
    right: 16px;
    left: 16px;
    top: auto;
    bottom: 10px;
    width: auto;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    background: rgba(18, 20, 19, 0.74);
}

    .room-stage.inside-camera-view .selection-toolbar span,
    .room-stage.inside-camera-view .selection-toolbar strong {
        flex-basis: 100%;
        font-size: 0.76rem;
    }

    .room-stage.inside-camera-view .selection-toolbar button {
        display: inline-flex;
    }

.designer-hidden-control {
    display: none !important;
}

body.designer-shell .properties-panel .designer-hidden-control {
    display: none !important;
}

.material-choice-field {
    position: relative;
}

.material-select-preview {
    display: block;
    width: 100%;
    height: 34px;
    margin-top: 6px;
    border: 1px solid rgba(31, 41, 55, 0.16);
    border-radius: 8px;
    background-position: center;
    background-size: cover;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
}

.room-hint {
    position: absolute;
    right: 16px;
    bottom: 16px;
    left: 16px;
    z-index: 2;
    padding: 12px 14px;
    color: rgba(255, 255, 255, 0.78);
    background: rgba(18, 20, 19, 0.68);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 8px;
    backdrop-filter: blur(14px);
}

.control-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

    .control-grid label,
    .range-control {
        display: grid;
        gap: 6px;
    }

    .control-grid input {
        width: 100%;
        min-height: 42px;
        padding: 8px 10px;
        color: var(--ink);
        background: #ffffff;
        border: 1px solid var(--line);
        border-radius: 8px;
    }

.range-control {
    grid-template-columns: 1fr auto;
    align-items: center;
    margin: 16px 0;
}

    .range-control input {
        grid-column: 1 / -1;
        accent-color: var(--teal);
    }

.swatch-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 8px 0 18px;
}

.swatch {
    width: 36px;
    height: 36px;
    background: var(--swatch);
    border: 2px solid transparent;
    border-radius: 8px;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.16);
}

    .swatch.active {
        border-color: var(--teal);
        outline: 2px solid rgba(35, 129, 118, 0.16);
    }

.accessory-list,
.object-list {
    display: grid;
    gap: 8px;
    max-height: 180px;
    overflow: auto;
    padding-left: 4px;
}

.accessory-option,
.object-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 9px;
    min-height: 44px;
    padding: 9px 10px;
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 8px;
}

    .accessory-option input {
        width: 18px;
        height: 18px;
        accent-color: var(--teal);
    }

    .accessory-option span,
    .object-row strong {
        font-weight: 850;
    }

    .accessory-option small {
        color: var(--teal);
        font-weight: 900;
    }

.object-stack {
    margin-top: 16px;
}

.object-row {
    grid-template-columns: minmax(0, 1fr) auto;
}

    .object-row.selected {
        background: #e8f3ef;
        border-color: var(--teal);
        box-shadow: inset 0 0 0 1px rgba(35, 129, 118, 0.18);
    }

    .object-row span {
        display: block;
        color: var(--muted);
        font-size: 0.78rem;
    }

.object-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 4px;
    max-width: 136px;
}

    .object-row button,
    .object-actions button {
        min-height: 34px;
        padding: 6px 10px;
        color: #8b321d;
        background: #fff0eb;
        border: 1px solid #e6b7a8;
        border-radius: 8px;
        font-weight: 850;
    }

        .object-actions button:not([data-delete]) {
            min-width: 30px;
            padding: 4px 8px;
            color: #105a52;
            background: #e7f3ef;
            border-color: #bcd8cf;
        }

.object-list-empty {
    padding: 12px;
    color: var(--muted);
    border: 1px dashed var(--line);
    border-radius: 8px;
}

.ai-result {
    margin-top: 10px;
    padding: 11px 12px;
    color: #40534e;
    background: #e8f2ee;
    border: 1px solid #c8dfd6;
    border-radius: 8px;
    font-size: 0.88rem;
}

.quote-compact {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 16px;
}

    .quote-compact div {
        padding: 12px;
        color: #ffffff;
        background: var(--dark);
        border-radius: 8px;
    }

    .quote-compact strong {
        display: block;
        margin-top: 2px;
        font-size: 1.05rem;
    }

    .quote-compact span {
        color: rgba(255, 255, 255, 0.68);
    }

.quote-lines {
    display: grid;
    gap: 8px;
}

.compact-lines {
    max-height: 180px;
    margin-top: 12px;
    overflow: auto;
}

.quote-line {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
}

    .quote-line strong {
        display: block;
    }

    .quote-line em {
        font-style: normal;
    }

.quote-notes {
    display: grid;
    gap: 8px;
    padding: 0;
    margin: 10px 0 0;
    list-style: none;
}

    .quote-notes li {
        padding: 9px 10px;
        color: #4f5753;
        background: #f1eee4;
        border-radius: 8px;
        font-size: 0.86rem;
    }

@media (max-width: 1160px) {
    .service-grid,
    .workflow-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .room-workspace {
        grid-template-columns: 290px minmax(0, 1fr);
    }

    .properties-panel {
        grid-column: 1 / -1;
    }

    .accessory-showcase {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .page-shell {
        width: min(100% - 22px, 1180px);
    }

    .hero-content h1 {
        font-size: 2.35rem;
    }

    .hero-copy {
        font-size: 1rem;
    }

    .hero-metrics,
    .service-grid,
    .workflow-grid,
    .room-workspace,
    .accessory-showcase {
        grid-template-columns: 1fr;
    }

    .room-workspace {
        height: auto;
        min-height: auto;
    }

    .section-heading,
    .footer-grid,
    .designer-topbar,
    .designer-topbar-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .services-section,
    .workflow-section,
    .accessories-section {
        padding: 58px 0;
    }

    .designer-page {
        padding-right: 10px;
        padding-left: 10px;
    }

    .room-stage {
        min-height: 560px;
    }

    .stage-toolbar {
        display: grid;
        align-items: start;
    }

    .selection-toolbar {
        flex-wrap: wrap;
        bottom: 16px;
    }

        .selection-toolbar span {
            flex-basis: 100%;
        }
}

/* Designer docked workspace: side panels resize the canvas instead of covering it. */
body.designer-shell {
    background: #171918;
}

    body.designer-shell .site-footer {
        display: none;
    }

    body.designer-shell .kitchen-editor-page {
        display: flex;
        flex-direction: column;
        min-height: 100dvh;
        height: 100dvh;
        padding: 0;
    }

    body.designer-shell .room-workspace,
    body.designer-shell .editor-workspace {
        --library-width: clamp(235px, 18vw, 290px);
        --properties-width: clamp(270px, 21vw, 335px);
        --collapsed-panel-width: 44px;
        display: grid;
        grid-template-columns: var(--library-width) minmax(0, 1fr) var(--properties-width);
        gap: 8px;
        flex: 1 1 auto;
        min-height: 0;
        height: auto;
        margin: 0;
        padding: 8px;
        transition: grid-template-columns 180ms ease;
    }

    body.designer-shell .room-stage {
        grid-column: 2;
        min-width: 0;
        width: 100%;
        height: 100%;
        min-height: 0;
    }

    body.designer-shell .room-panel {
        position: relative;
        inset: auto;
        z-index: 1;
        width: auto;
        min-width: 0;
        height: 100%;
        overflow: auto;
    }

    body.designer-shell .library-panel {
        grid-column: 1;
        grid-row: 1;
    }

    body.designer-shell .properties-panel {
        grid-column: 3;
        grid-row: 1;
    }

    body.designer-shell .room-workspace.library-collapsed {
        grid-template-columns: var(--collapsed-panel-width) minmax(0, 1fr) var(--properties-width);
    }

    body.designer-shell .room-workspace.properties-collapsed {
        grid-template-columns: var(--library-width) minmax(0, 1fr) var(--collapsed-panel-width);
    }

    body.designer-shell .room-workspace.library-collapsed.properties-collapsed {
        grid-template-columns: var(--collapsed-panel-width) minmax(0, 1fr) var(--collapsed-panel-width);
    }

    body.designer-shell .room-workspace.library-collapsed .library-panel,
    body.designer-shell .room-workspace.properties-collapsed .properties-panel {
        padding: 6px;
        overflow: hidden;
    }

        body.designer-shell .room-workspace.library-collapsed .library-panel > :not(.panel-title),
        body.designer-shell .room-workspace.properties-collapsed .properties-panel > :not(.panel-title) {
            display: none;
        }

        body.designer-shell .room-workspace.library-collapsed .library-panel .panel-title > div,
        body.designer-shell .room-workspace.properties-collapsed .properties-panel .panel-title > div {
            display: none;
        }

    body.designer-shell .panel-title {
        position: sticky;
        top: 0;
        z-index: 2;
        align-items: center;
        min-height: 38px;
        margin-bottom: 10px;
        padding-bottom: 6px;
        background: rgba(250, 248, 241, 0.97);
    }

    body.designer-shell .panel-collapse-button {
        width: 30px;
        height: 30px;
        min-width: 30px;
        min-height: 30px;
        padding: 0;
        border: 1px solid rgba(31, 41, 55, 0.16);
        border-radius: 7px;
        background: #fff;
        color: #1f2937;
        font-size: 1.15rem;
        line-height: 1;
        cursor: pointer;
        box-shadow: none;
    }

        body.designer-shell .panel-collapse-button:hover,
        body.designer-shell .panel-collapse-button:focus-visible {
            background: #e4f2ee;
            border-color: #8ccfc2;
            color: #105a52;
        }

    body.designer-shell .room-workspace.library-collapsed .library-panel .panel-title,
    body.designer-shell .room-workspace.properties-collapsed .properties-panel .panel-title {
        justify-content: center;
        margin: 0;
        padding: 0;
        background: transparent;
    }

@media (max-width: 980px) {
    body.designer-shell .room-workspace,
    body.designer-shell .editor-workspace {
        --library-width: min(280px, 32vw);
        --properties-width: min(320px, 36vw);
    }
}

@media (max-width: 760px) {
    body.designer-shell .kitchen-editor-page {
        min-height: 100dvh;
        height: auto;
    }

    body.designer-shell .room-workspace,
    body.designer-shell .editor-workspace,
    body.designer-shell .room-workspace.library-collapsed,
    body.designer-shell .room-workspace.properties-collapsed,
    body.designer-shell .room-workspace.library-collapsed.properties-collapsed {
        grid-template-columns: 1fr;
        grid-template-rows: auto minmax(560px, 1fr) auto;
        height: auto;
    }

    body.designer-shell .library-panel,
    body.designer-shell .properties-panel,
    body.designer-shell .room-stage {
        grid-column: 1;
        width: 100%;
    }

    body.designer-shell .library-panel {
        grid-row: 1;
    }

    body.designer-shell .room-stage {
        grid-row: 2;
    }

    body.designer-shell .properties-panel {
        grid-row: 3;
    }

    body.designer-shell .room-workspace.library-collapsed .library-panel,
    body.designer-shell .room-workspace.properties-collapsed .properties-panel {
        min-height: 44px;
    }
}



/* ===== Designer side rails + organized visual material pickers ===== */
body.designer-shell .editor-workspace {
    --collapsed-panel-width: 36px;
}

body.designer-shell .room-panel {
    position: relative;
    overflow: auto;
}

body.designer-shell .panel-title {
    padding-inline: 8px;
}

body.designer-shell .panel-edge-toggle {
    position: absolute;
    top: 50%;
    z-index: 12;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    width: 112px;
    height: 38px;
    padding: 0 12px;
    border: 1px solid rgba(31, 41, 55, 0.18);
    border-radius: 11px;
    background: rgba(250, 248, 241, 0.98);
    color: #1f2937;
    font: inherit;
    font-weight: 800;
    white-space: nowrap;
    cursor: pointer;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.14);
    transform: translateY(-50%);
}

    body.designer-shell .panel-edge-toggle:hover,
    body.designer-shell .panel-edge-toggle:focus-visible {
        border-color: #8ccfc2;
        background: #e9f7f3;
        color: #0f5e55;
        outline: none;
    }

body.designer-shell .panel-edge-toggle-arrow {
    font-size: 1.25rem;
    line-height: 1;
}

body.designer-shell .library-edge-toggle {
    left: 6px;
}

body.designer-shell .properties-edge-toggle {
    right: 6px;
}

body.designer-shell .room-workspace.library-collapsed .library-panel,
body.designer-shell .room-workspace.properties-collapsed .properties-panel {
    overflow: visible;
    padding: 0;
    background: transparent;
    border-color: transparent;
    box-shadow: none;
}

    body.designer-shell .room-workspace.library-collapsed .library-panel .panel-title,
    body.designer-shell .room-workspace.properties-collapsed .properties-panel .panel-title {
        display: none;
    }

body.designer-shell .room-workspace.library-collapsed .library-edge-toggle {
    left: 0;
}

body.designer-shell .room-workspace.properties-collapsed .properties-edge-toggle {
    right: 0;
}

body.designer-shell .room-workspace:not(.library-collapsed) .library-edge-toggle {
    left: 8px;
}

body.designer-shell .room-workspace:not(.properties-collapsed) .properties-edge-toggle {
    right: 8px;
}

body.designer-shell .room-workspace.library-collapsed .library-panel > :not(.panel-edge-toggle),
body.designer-shell .room-workspace.properties-collapsed .properties-panel > :not(.panel-edge-toggle) {
    display: none !important;
}

.material-select-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.material-image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(82px, 1fr));
    gap: 10px;
    width: 100%;
    max-height: 330px;
    padding: 4px;
    overflow-y: auto;
    overflow-x: hidden;
}

    .material-image-grid.compact-material-grid {
        grid-template-columns: repeat(auto-fill, minmax(76px, 1fr));
        max-height: 265px;
    }

.material-image-choice {
    display: grid;
    grid-template-rows: 62px auto;
    gap: 6px;
    min-width: 0;
    padding: 6px;
    border: 1px solid rgba(31, 41, 55, 0.14);
    border-radius: 10px;
    background: #fff;
    color: #2f3a3a;
    cursor: pointer;
    box-shadow: none;
}

    .material-image-choice:hover {
        border-color: #9ccfc5;
        background: #f6fbf9;
    }

    .material-image-choice.active {
        border-color: #176b60;
        box-shadow: 0 0 0 2px rgba(23, 107, 96, 0.16);
        background: #eef8f5;
    }

.material-choice-swatch {
    display: block;
    width: 100%;
    height: 62px;
    border-radius: 7px;
    background-position: center;
    background-size: cover;
    background-repeat: repeat;
    box-shadow: inset 0 0 0 1px rgba(31, 41, 55, 0.12);
}

.material-choice-label {
    display: block;
    min-width: 0;
    overflow: hidden;
    color: #3d4747;
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1.25;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 760px) {
    body.designer-shell .panel-edge-toggle {
        position: relative;
        top: auto;
        right: auto;
        left: auto;
        width: 100%;
        transform: none;
        margin: 4px 0;
    }

    body.designer-shell .room-workspace.library-collapsed .library-panel,
    body.designer-shell .room-workspace.properties-collapsed .properties-panel {
        min-height: 46px;
    }
}


/* Fix older collapsed-panel rules: the middle edge tab always remains visible. */
body.designer-shell .room-workspace.library-collapsed .library-panel > .panel-edge-toggle,
body.designer-shell .room-workspace.properties-collapsed .properties-panel > .panel-edge-toggle {
    display: inline-flex !important;
}

.control-grid > .material-picker-field {
    grid-column: 1 / -1;
    min-width: 0;
}

    .control-grid > .material-picker-field > .material-image-grid {
        margin-top: 2px;
    }

/* ===== v3: viewport lock + artistic middle edge tabs ===== */
html:has(body.designer-shell),
body.designer-shell {
    width: 100%;
    height: 100%;
    max-width: 100%;
    overflow: hidden !important;
}

    body.designer-shell,
    body.designer-shell * {
        box-sizing: border-box;
    }

        body.designer-shell .kitchen-editor-page {
            width: 100%;
            max-width: 100vw;
            height: 100dvh;
            min-height: 0;
            overflow: hidden;
        }

        body.designer-shell .room-workspace,
        body.designer-shell .editor-workspace {
            --collapsed-panel-width: 0px;
            width: 100%;
            max-width: 100%;
            min-width: 0;
            height: 100%;
            min-height: 0;
            overflow: hidden;
        }

        body.designer-shell .room-stage {
            position: relative;
            min-width: 0;
            min-height: 0;
            overflow: hidden;
        }

        /* Scroll only inside the actual opened side panels, never on the whole page. */
        body.designer-shell .room-panel {
            min-width: 0;
            min-height: 0;
            overflow-x: hidden;
            overflow-y: auto;
            scrollbar-width: thin;
            overscroll-behavior: contain;
        }

        body.designer-shell .room-workspace.library-collapsed .library-panel,
        body.designer-shell .room-workspace.properties-collapsed .properties-panel {
            width: 0;
            min-width: 0;
            padding: 0;
            border: 0;
            overflow: visible;
        }

        /* Edge control: arrow as the visual hero, word beneath it. */
        body.designer-shell .panel-edge-toggle {
            top: 50%;
            width: 58px;
            height: 104px;
            padding: 9px 6px 8px;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            gap: 7px;
            border: 1px solid rgba(255, 255, 255, 0.78);
            border-radius: 18px;
            background: linear-gradient(180deg, rgba(255,255,255,.98), rgba(246,242,230,.96));
            color: #243330;
            box-shadow: 0 12px 30px rgba(0,0,0,.18), inset 0 1px 0 rgba(255,255,255,.9);
            transform: translateY(-50%);
            backdrop-filter: blur(8px);
        }

            body.designer-shell .panel-edge-toggle::before {
                content: "";
                position: absolute;
                inset: 6px;
                border-radius: 13px;
                border: 1px solid rgba(23,107,96,.08);
                pointer-events: none;
            }

        body.designer-shell .panel-edge-toggle-arrow {
            position: relative;
            z-index: 1;
            display: grid;
            place-items: center;
            width: 34px;
            height: 34px;
            border-radius: 50%;
            background: #18312d;
            color: #fff;
            font-size: 1.72rem;
            font-weight: 900;
            line-height: 1;
            box-shadow: 0 5px 12px rgba(24,49,45,.22);
        }

        body.designer-shell .panel-edge-toggle-label {
            position: relative;
            z-index: 1;
            display: block;
            max-width: 48px;
            font-size: .74rem;
            font-weight: 900;
            line-height: 1.05;
            text-align: center;
            white-space: normal;
        }

        body.designer-shell .panel-edge-toggle:hover,
        body.designer-shell .panel-edge-toggle:focus-visible {
            transform: translateY(-50%) scale(1.045);
            background: linear-gradient(180deg, #ffffff, #eaf7f3);
            border-color: rgba(23,107,96,.45);
            color: #0f5e55;
        }

            body.designer-shell .panel-edge-toggle:hover .panel-edge-toggle-arrow,
            body.designer-shell .panel-edge-toggle:focus-visible .panel-edge-toggle-arrow {
                background: #176b60;
            }

        /* The tabs sit exactly on the border between panel and workspace. */
        body.designer-shell .library-edge-toggle {
            left: -29px;
            right: auto;
        }

        body.designer-shell .properties-edge-toggle {
            right: -29px;
            left: auto;
        }

        body.designer-shell .room-workspace.library-collapsed .library-edge-toggle {
            left: -29px;
        }

        body.designer-shell .room-workspace.properties-collapsed .properties-edge-toggle {
            right: -29px;
        }

        body.designer-shell .room-workspace:not(.library-collapsed) .library-edge-toggle {
            left: -29px;
        }

        body.designer-shell .room-workspace:not(.properties-collapsed) .properties-edge-toggle {
            right: -29px;
        }

        /* Keep the edge tabs visible while every other collapsed-panel child stays hidden. */
        body.designer-shell .room-workspace.library-collapsed .library-panel > .panel-edge-toggle,
        body.designer-shell .room-workspace.properties-collapsed .properties-panel > .panel-edge-toggle {
            display: flex !important;
        }

@media (max-width: 760px) {
    html:has(body.designer-shell),
    body.designer-shell {
        overflow: auto !important;
        height: auto;
    }

        body.designer-shell .kitchen-editor-page {
            height: auto;
            min-height: 100dvh;
            overflow: visible;
        }

        body.designer-shell .panel-edge-toggle {
            position: relative;
            top: auto;
            right: auto;
            left: auto;
            width: 100%;
            height: 46px;
            flex-direction: row;
            transform: none;
            border-radius: 12px;
        }

            body.designer-shell .panel-edge-toggle:hover,
            body.designer-shell .panel-edge-toggle:focus-visible {
                transform: none;
            }
}

/* v4: full edge controls + olive designer identity */
body.designer-shell {
    --designer-olive: #62633b;
    --designer-olive-dark: #4d4f2f;
    --designer-olive-soft: #f1f1e5;
    --designer-olive-ring: rgba(98, 99, 59, .24);
}

    /* Component tabs: remove the old blue/teal interaction language. */
    body.designer-shell .properties-tabs button {
        transition: background-color .16s ease, border-color .16s ease, color .16s ease, box-shadow .16s ease, transform .16s ease;
    }

        body.designer-shell .properties-tabs button:hover,
        body.designer-shell .properties-tabs button:focus-visible {
            border-color: var(--designer-olive) !important;
            background: var(--designer-olive-soft) !important;
            color: var(--designer-olive-dark) !important;
            outline: none !important;
            box-shadow: 0 0 0 2px var(--designer-olive-ring) !important;
        }

        body.designer-shell .properties-tabs button.active,
        body.designer-shell .properties-tabs button[aria-selected="true"] {
            background: var(--designer-olive-dark) !important;
            border-color: var(--designer-olive-dark) !important;
            color: #fff !important;
            box-shadow: inset 0 -2px 0 #d9b86f !important;
        }

            body.designer-shell .properties-tabs button.active:hover,
            body.designer-shell .properties-tabs button.active:focus-visible {
                background: var(--designer-olive) !important;
                border-color: var(--designer-olive) !important;
                color: #fff !important;
            }

    /* ===== FINAL DESIGNER FIXES ===== */

    /* Keep the olive identity for the side-tab interactions. */
    body.designer-shell .panel-edge-toggle:hover,
    body.designer-shell .panel-edge-toggle:focus-visible {
        background: linear-gradient(180deg, #fff, var(--designer-olive-soft)) !important;
        border-color: var(--designer-olive) !important;
        color: var(--designer-olive-dark) !important;
        outline: none !important;
    }

        body.designer-shell .panel-edge-toggle:hover .panel-edge-toggle-arrow,
        body.designer-shell .panel-edge-toggle:focus-visible .panel-edge-toggle-arrow {
            background: var(--designer-olive) !important;
        }

    /* ===== SIDE PANELS: stable collapsed rails ===== */

    /*
  Do not collapse the side columns to 0px.
  A real 64px rail keeps both edge buttons visible and prevents the
  "Components" button from disappearing outside the viewport.
*/
    body.designer-shell .room-workspace,
    body.designer-shell .editor-workspace {
        --collapsed-panel-width: 64px !important;
    }

    body.designer-shell .room-panel {
        position: relative !important;
        min-width: 0 !important;
        min-height: 0 !important;
    }

    body.designer-shell .room-workspace:not(.library-collapsed) .library-panel,
    body.designer-shell .room-workspace:not(.properties-collapsed) .properties-panel {
        overflow-x: hidden !important;
        overflow-y: auto !important;
        overscroll-behavior-y: contain;
        scrollbar-width: thin;
        scrollbar-gutter: stable;
    }

    /* Open components panel must scroll with the mouse wheel. */
    body.designer-shell .properties-panel {
        height: 100% !important;
        max-height: 100% !important;
        min-height: 0 !important;
        touch-action: pan-y;
    }

        body.designer-shell .properties-panel .panel-title {
            position: sticky;
            top: 0;
            z-index: 20;
            background: rgba(250, 248, 241, 0.98);
        }

    /* Collapsed panels become clean rails instead of zero-width invisible panels. */
    body.designer-shell .room-workspace.library-collapsed .library-panel,
    body.designer-shell .room-workspace.properties-collapsed .properties-panel {
        position: relative !important;
        width: 64px !important;
        min-width: 64px !important;
        padding: 0 !important;
        overflow: visible !important;
        border-color: transparent !important;
        background: transparent !important;
        box-shadow: none !important;
    }

        body.designer-shell .room-workspace.library-collapsed .library-panel > :not(.panel-edge-toggle),
        body.designer-shell .room-workspace.properties-collapsed .properties-panel > :not(.panel-edge-toggle) {
            display: none !important;
        }

        body.designer-shell .room-workspace.library-collapsed .library-panel > .panel-edge-toggle,
        body.designer-shell .room-workspace.properties-collapsed .properties-panel > .panel-edge-toggle {
            display: flex !important;
            visibility: visible !important;
            pointer-events: auto !important;
            z-index: 100 !important;
        }

    /* Edge buttons live INSIDE the 64px rail, so neither can leave the viewport. */
    body.designer-shell .panel-edge-toggle {
        top: 50% !important;
        width: 58px !important;
        height: 104px !important;
        padding: 9px 6px 8px !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 7px !important;
        transform: translateY(-50%) !important;
        z-index: 100 !important;
    }

    body.designer-shell .library-edge-toggle,
    body.designer-shell .room-workspace.library-collapsed .library-edge-toggle,
    body.designer-shell .room-workspace:not(.library-collapsed) .library-edge-toggle {
        left: 3px !important;
        right: auto !important;
    }

    body.designer-shell .properties-edge-toggle,
    body.designer-shell .room-workspace.properties-collapsed .properties-edge-toggle,
    body.designer-shell .room-workspace:not(.properties-collapsed) .properties-edge-toggle {
        right: 3px !important;
        left: auto !important;
    }

    /* ===== AI TOP TOOLBAR ===== */

    body.designer-shell .room-toolbar {
        display: grid !important;
        grid-template-columns: auto minmax(340px, 1fr) auto !important;
        align-items: center !important;
        gap: 14px !important;
    }

    body.designer-shell .stage-ai-zone,
    body.designer-shell .stage-ai-tools {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 10px !important;
        min-width: 0 !important;
    }

    body.designer-shell .stage-ai-button {
        display: inline-flex !important;
        width: auto !important;
        min-width: 150px !important;
        min-height: 40px !important;
        margin: 0 !important;
        flex: 0 0 auto !important;
    }

    /* Small generated-image button beside the AI button. */
    body.designer-shell .ai-preview-button {
        width: 82px !important;
        height: 50px !important;
        padding: 0 !important;
        flex: 0 0 82px !important;
        overflow: hidden !important;
        border: 1px solid rgba(217, 184, 111, .72) !important;
        border-radius: 9px !important;
        background: #171918 !important;
        cursor: pointer !important;
        box-shadow: 0 5px 16px rgba(0, 0, 0, .28) !important;
    }

        body.designer-shell .ai-preview-button[hidden] {
            display: none !important;
        }

    body.designer-shell .ai-render-preview {
        display: block !important;
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
        border: 0 !important;
        border-radius: inherit !important;
        cursor: pointer !important;
    }

    body.designer-shell .stage-ai-result,
    body.designer-shell .stage-ai-status {
        max-width: 150px !important;
        overflow: hidden !important;
        color: #d9b86f !important;
        font-size: 12px !important;
        font-weight: 800 !important;
        white-space: nowrap !important;
        text-overflow: ellipsis !important;
    }

    /* ===== AI FULL IMAGE MODAL ===== */

    body.designer-shell .ai-image-modal {
        position: fixed !important;
        inset: 0 !important;
        z-index: 99999 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        padding: 28px !important;
        background: rgba(0, 0, 0, .88) !important;
        backdrop-filter: blur(6px);
    }

        body.designer-shell .ai-image-modal[hidden] {
            display: none !important;
        }

        body.designer-shell .ai-image-modal img {
            display: block !important;
            max-width: 94vw !important;
            max-height: 90vh !important;
            object-fit: contain !important;
            border-radius: 12px !important;
            box-shadow: 0 25px 80px rgba(0, 0, 0, .58) !important;
        }

    body.designer-shell .ai-image-modal-close {
        position: fixed !important;
        top: 20px !important;
        right: 22px !important;
        z-index: 100000 !important;
        width: 46px !important;
        height: 46px !important;
        padding: 0 !important;
        border: 0 !important;
        border-radius: 50% !important;
        background: #fff !important;
        color: #111 !important;
        font-size: 30px !important;
        line-height: 1 !important;
        cursor: pointer !important;
    }

/* ===== MOBILE ===== */
@media (max-width: 760px) {
    body.designer-shell .room-toolbar {
        grid-template-columns: 1fr !important;
    }

    body.designer-shell .stage-ai-zone,
    body.designer-shell .stage-ai-tools {
        justify-content: flex-start !important;
        flex-wrap: wrap !important;
    }

    body.designer-shell .panel-edge-toggle {
        position: relative !important;
        top: auto !important;
        right: auto !important;
        left: auto !important;
        width: 100% !important;
        height: 46px !important;
        flex-direction: row !important;
        transform: none !important;
        margin: 4px 0 !important;
    }

    body.designer-shell .room-workspace.library-collapsed .library-panel,
    body.designer-shell .room-workspace.properties-collapsed .properties-panel {
        width: 100% !important;
        min-width: 100% !important;
        min-height: 46px !important;
    }
}

/* ===== AI FOUR VIEW RESULTS ===== */

body.designer-shell .ai-render-previews {
    display: grid;
    grid-template-columns: repeat(4, 68px);
    align-items: center;
    gap: 6px;
}

    body.designer-shell
    .ai-render-previews[hidden] {
        display: none !important;
    }

body.designer-shell
.ai-view-preview {
    position: relative;
    width: 68px;
    height: 50px;
    padding: 0;
    overflow: hidden;
    border: 1px solid rgba(217, 184, 111, .72);
    border-radius: 8px;
    background: #171918;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .25);
}

    body.designer-shell
    .ai-view-preview:hover {
        border-color: #d9b86f;
        transform: translateY(-2px);
    }

    body.designer-shell
    .ai-view-preview img {
        display: block;
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    body.designer-shell
    .ai-view-preview span {
        position: absolute;
        right: 3px;
        bottom: 3px;
        padding: 1px 5px;
        border-radius: 5px;
        color: #fff;
        background: rgba(0, 0, 0, .72);
        font-size: 9px;
        font-weight: 800;
    }

@media (max-width: 900px) {
    body.designer-shell
    .ai-render-previews {
        grid-template-columns: repeat(2, 68px);
    }
}
/* =========================================================
   Aluminum Al-Salwadi brand identity
   Olive + metallic gold + warm ivory
   ========================================================= */
:root {
    --ink: #26301f;
    --muted: #6f7568;
    --paper: #f4f0e7;
    --panel: #fffdf8;
    --line: #d8d1bf;
    --dark: #28321f;
    --dark-2: #36422a;
    --olive-950: #20291a;
    --olive-900: #2f3a25;
    --olive-800: #3e4b31;
    --olive-700: #53613f;
    --olive-500: #74805b;
    --gold: #d4af52;
    --gold-dark: #a67c24;
    --gold-soft: #ead694;
    --ivory: #f5f1e8;
    --cream: #ebe4d4;
    --teal: #53613f;
    --aqua: #b8c09f;
    --coral: #9f5f45;
    --steel: #c7c2b4;
    --shadow: 0 22px 70px rgba(32, 41, 26, .18);
}

body {
    background: var(--paper);
    color: var(--ink);
    font-family: "Tajawal", "Segoe UI", Tahoma, Arial, sans-serif;
}

.salwadi-header,
.site-header {
    background: rgba(32, 41, 26, .94);
    border-bottom: 1px solid rgba(212, 175, 82, .34);
    box-shadow: 0 14px 40px rgba(18, 25, 14, .24);
}

.salwadi-header .navbar {
    min-height: 78px;
}

.salwadi-brand {
    min-width: 245px;
    gap: 12px;
}

.brand-logo {
    width: 58px;
    height: 52px;
    object-fit: contain;
    filter: drop-shadow(0 8px 12px rgba(0,0,0,.22));
}

.brand-copy {
    display: grid;
    gap: 1px;
    line-height: 1.2;
}

.brand-copy strong {
    color: #fffdf7;
    font-size: 1.02rem;
    font-weight: 950;
}

.brand-copy small {
    color: var(--gold-soft);
    font-size: .7rem;
    font-weight: 750;
}

.site-header .nav-link {
    color: rgba(255,255,255,.76);
    padding-inline: 12px !important;
    position: relative;
}

.site-header .nav-link::after {
    content: "";
    position: absolute;
    right: 12px;
    bottom: 3px;
    width: 0;
    height: 2px;
    background: var(--gold);
    transition: width .2s ease;
}

.site-header .nav-link:hover::after,
.site-header .nav-link:focus::after {
    width: calc(100% - 24px);
}

.nav-cta,
.primary-action {
    color: #222a1b;
    background: linear-gradient(135deg, #ecd277, #d4af52 58%, #bc9132);
    border: 1px solid rgba(255, 231, 150, .68);
    box-shadow: 0 10px 30px rgba(166, 124, 36, .2);
}

.nav-cta:hover,
.primary-action:hover {
    color: #171d12;
    transform: translateY(-1px);
    box-shadow: 0 14px 34px rgba(166, 124, 36, .28);
}

.secondary-action {
    color: #fff;
    border-color: rgba(234,214,148,.42);
    background: rgba(255,255,255,.07);
}

.salwadi-hero,
.hero-section {
    background: linear-gradient(135deg, var(--olive-950), var(--olive-900));
}

.hero-scrim {
    background:
        radial-gradient(circle at 22% 40%, rgba(212,175,82,.12), transparent 30%),
        linear-gradient(90deg, rgba(27,35,21,.18), rgba(32,41,26,.75) 48%, rgba(28,36,22,.97));
}

.salwadi-hero-content {
    padding-top: 118px;
}

.hero-brand-lockup {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 18px;
}

.hero-brand-lockup img {
    width: 104px;
    height: 86px;
    object-fit: contain;
    filter: drop-shadow(0 15px 24px rgba(0,0,0,.3));
}

.hero-brand-lockup .eyebrow {
    margin-bottom: 2px;
    font-size: 1.15rem;
}

.hero-brand-lockup span {
    color: rgba(255,255,255,.72);
    font-weight: 750;
}

.eyebrow {
    color: var(--gold);
}

.hero-content h1 {
    max-width: 900px;
    font-size: clamp(2.55rem, 5.4vw, 4.7rem);
    letter-spacing: -.025em;
}

.hero-copy {
    color: rgba(255,255,255,.79);
}

.brand-pillars div,
.hero-metrics div {
    background: rgba(255,255,255,.065);
    border-color: rgba(234,214,148,.22);
    box-shadow: inset 0 1px rgba(255,255,255,.05);
}

.brand-pillars dt {
    color: var(--gold);
}

.services-section,
.accessories-section {
    background: var(--paper);
}

.workflow-section {
    background:
        linear-gradient(180deg, rgba(212,175,82,.08), transparent 38%),
        #e9e3d5;
}

.section-note {
    margin: 0;
    color: var(--olive-700);
    font-weight: 900;
    padding: 8px 14px;
    border: 1px solid rgba(83,97,63,.18);
    border-radius: 999px;
    background: rgba(255,255,255,.58);
}

.service-card,
.workflow-grid article,
.accessory-showcase article {
    border-color: rgba(62,75,49,.14);
    background: rgba(255,253,248,.96);
    box-shadow: 0 14px 34px rgba(38,48,31,.07);
}

.service-card::before {
    background: linear-gradient(90deg, var(--gold), var(--olive-700));
}

.service-dot {
    background: linear-gradient(145deg, var(--olive-800), var(--gold));
    border-radius: 12px;
}

.service-rate,
.accessory-showcase p {
    color: var(--olive-700);
}

.workflow-grid article span {
    color: var(--gold-soft);
    background: var(--olive-900);
    border: 1px solid rgba(212,175,82,.4);
}

.brand-signature-section {
    padding: 24px 0 88px;
    background: var(--paper);
}

.brand-signature-card {
    display: grid;
    grid-template-columns: 150px 1fr auto;
    align-items: center;
    gap: 28px;
    padding: 26px 30px;
    color: #fff;
    background:
        radial-gradient(circle at 10% 20%, rgba(212,175,82,.18), transparent 28%),
        linear-gradient(135deg, var(--olive-950), var(--olive-800));
    border: 1px solid rgba(212,175,82,.34);
    border-radius: 20px;
    box-shadow: var(--shadow);
}

.brand-signature-card img {
    width: 140px;
    height: 108px;
    object-fit: contain;
}

.brand-signature-card h2 {
    margin: 0 0 5px;
    color: #fff;
    font-size: clamp(1.8rem, 3vw, 2.8rem);
    font-weight: 950;
}

.brand-signature-card p:not(.eyebrow) {
    margin: 0;
    color: rgba(255,255,255,.72);
}

.service-page {
    background:
        radial-gradient(circle at 85% 8%, rgba(212,175,82,.10), transparent 24%),
        linear-gradient(180deg, #f7f3e9, #ece6d8);
}

.service-shell h1 {
    color: var(--olive-950);
}

.service-lead {
    color: #66705d;
}

.service-grid article {
    background: #fffdf8;
    border-color: rgba(62,75,49,.14);
    box-shadow: 0 14px 36px rgba(38,48,31,.07);
}

.service-grid h2 {
    color: var(--olive-900);
}

.service-grid p {
    color: #70776a;
}

.salwadi-footer,
.site-footer {
    background: var(--olive-950);
    border-top: 1px solid rgba(212,175,82,.28);
}

.footer-brand-lockup {
    display: flex;
    align-items: center;
    gap: 12px;
}

.footer-brand-lockup img {
    width: 64px;
    height: 50px;
    object-fit: contain;
}

.footer-brand-lockup strong {
    color: #fff !important;
    font-size: 1rem;
}

.footer-brand-lockup span,
.footer-tagline {
    color: var(--gold-soft) !important;
}

/* Designer identity: visual only, no 3D/AI behavior changes. */
body.designer-shell .designer-page,
body.designer-shell .kitchen-editor-page {
    background:
        radial-gradient(circle at 14% 8%, rgba(212,175,82,.13), transparent 25%),
        linear-gradient(180deg, #344029, #222b1c 74%) !important;
}

body.designer-shell .editor-workspace .room-stage,
body.designer-shell .room-stage {
    background: linear-gradient(135deg, #20291d, #2d3827 58%, #171d14) !important;
    border-color: rgba(212,175,82,.22) !important;
}

body.designer-shell .room-panel {
    background: rgba(250,247,238,.985) !important;
    border-color: rgba(212,175,82,.22) !important;
}

body.designer-shell .room-toolbar,
body.designer-shell .stage-toolbar {
    background: rgba(30,39,24,.86) !important;
    border-color: rgba(212,175,82,.32) !important;
}

body.designer-shell .room-toolbar {
    grid-template-columns: auto auto minmax(260px, 1fr) auto !important;
}

.designer-brand-chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-width: 0;
    color: #fff;
    font-weight: 900;
    white-space: nowrap;
}

.designer-brand-chip img {
    width: 42px;
    height: 34px;
    object-fit: contain;
}

.designer-brand-chip span {
    color: var(--gold-soft) !important;
    font-size: .78rem !important;
}

body.designer-shell .ai-render-button {
    color: #222a1b !important;
    background: linear-gradient(135deg, #edd77d, #d4af52 52%, #78845f) !important;
    border: 1px solid rgba(255,231,150,.58) !important;
}

body.designer-shell .properties-tabs button.active {
    background: var(--olive-900) !important;
    border-color: var(--olive-900) !important;
    box-shadow: inset 0 -2px 0 var(--gold) !important;
}

body.designer-shell .properties-tabs button:hover,
body.designer-shell .properties-tabs button:focus {
    border-color: rgba(83,97,63,.45) !important;
    background: #f4f0e7 !important;
}

body.designer-shell .wide-action-button {
    background: var(--olive-900) !important;
    border-color: var(--olive-800) !important;
}

body.designer-shell .selection-toolbar {
    background: rgba(30,39,24,.84) !important;
    border-color: rgba(212,175,82,.30) !important;
}

body.designer-shell .selection-toolbar button {
    color: #232b1d !important;
    background: var(--gold-soft) !important;
}

body.designer-shell .selection-toolbar button:last-child {
    color: #fff !important;
    background: #8d4f39 !important;
}

body.designer-shell .panel-edge-toggle {
    border-color: rgba(212,175,82,.35) !important;
}

@media (max-width: 900px) {
    .salwadi-brand {
        min-width: 0;
    }

    .brand-logo {
        width: 50px;
        height: 46px;
    }

    .brand-copy strong {
        font-size: .92rem;
    }

    .brand-copy small {
        font-size: .62rem;
    }

    .salwadi-hero-content {
        padding-top: 102px;
    }

    .hero-brand-lockup img {
        width: 82px;
        height: 68px;
    }

    .hero-content h1 {
        font-size: clamp(2.25rem, 10vw, 3.4rem);
    }

    .brand-signature-card {
        grid-template-columns: 1fr;
        text-align: center;
        justify-items: center;
    }

    .brand-signature-card img {
        width: 120px;
        height: 96px;
    }

    body.designer-shell .room-toolbar {
        grid-template-columns: 1fr !important;
    }

    .designer-brand-chip {
        justify-content: center;
        width: 100%;
    }
}

@media (max-width: 600px) {
    .brand-copy small {
        display: none;
    }

    .salwadi-header .navbar {
        min-height: 68px;
    }

    .hero-brand-lockup {
        align-items: flex-start;
    }

    .hero-brand-lockup img {
        width: 74px;
        height: 62px;
    }

    .hero-metrics {
        grid-template-columns: 1fr;
    }

    .footer-grid {
        align-items: flex-start;
        flex-direction: column;
    }
}

/* Phase 3 — accounts and cloud projects */
.salwadi-account-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.account-nav-link,
.account-nav-button {
    color: rgba(255, 255, 255, .88) !important;
    font-weight: 700;
    font-size: .9rem;
}

.account-nav-button {
    appearance: none;
    border: 0;
    background: transparent;
    padding: .5rem .55rem;
}

.account-nav-button:hover,
.account-nav-link:hover {
    color: var(--gold) !important;
}

.account-shell {
    background: #eef1ec;
}

.account-page {
    min-height: calc(100vh - 180px);
    display: grid;
    place-items: center;
    padding: clamp(28px, 6vw, 72px) 18px;
}

.account-card,
.profile-card {
    width: min(100%, 520px);
    border: 1px solid rgba(47, 58, 37, .14);
    border-radius: 24px;
    background: #fff;
    box-shadow: 0 24px 70px rgba(25, 32, 23, .12);
    padding: clamp(24px, 4vw, 40px);
}

.compact-account-card {
    width: min(100%, 480px);
}

.account-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 18px;
}

.account-brand img {
    width: 68px;
    height: 58px;
    object-fit: contain;
}

.account-brand p,
.account-brand h1,
.account-card h1 {
    margin: 0;
}

.account-brand p {
    color: #68705f;
    font-weight: 800;
    font-size: .82rem;
}

.account-brand h1,
.account-card h1,
.profile-card h1,
.projects-page h1 {
    color: #273020;
    font-weight: 900;
}

.account-intro {
    color: #69706d;
    line-height: 1.8;
    margin: 0 0 24px;
}

.account-form {
    display: grid;
    gap: 16px;
}

.account-form label {
    display: grid;
    gap: 7px;
    font-weight: 800;
    color: #343b30;
}

.account-form input[type="text"],
.account-form input[type="email"],
.account-form input[type="password"] {
    width: 100%;
    border: 1px solid #d7dccf;
    border-radius: 12px;
    padding: 12px 14px;
    background: #fbfcf9;
    outline: none;
}

.account-form input:focus {
    border-color: #697b4f;
    box-shadow: 0 0 0 3px rgba(105, 123, 79, .13);
}

.account-form .field-validation-error,
.validation-summary,
.validation-summary-errors {
    color: #a53d33;
    font-size: .86rem;
}

.validation-summary-valid {
    display: none;
}

.account-check {
    grid-template-columns: auto 1fr !important;
    align-items: center;
    justify-content: start;
    width: fit-content;
}

.account-primary-button,
.secondary-link-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    min-height: 46px;
    padding: 10px 18px;
    text-decoration: none;
    font-weight: 900;
}

.account-primary-button {
    border: 1px solid #35442a;
    background: #35442a;
    color: #fff;
}

.account-primary-button:hover {
    background: #25301e;
    color: #fff;
}

.secondary-link-button {
    border: 1px solid #cfd5c7;
    color: #35442a;
    background: #fff;
}

.account-button-link {
    width: fit-content;
}

.account-switch,
.account-links {
    margin: 20px 0 0;
    text-align: center;
    color: #6a7167;
}

.account-links {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.account-switch a,
.account-links a {
    color: #3f5333;
    font-weight: 800;
}

.account-message {
    border-radius: 12px;
    padding: 11px 14px;
    margin-bottom: 18px;
}

.account-message.success {
    color: #31512e;
    background: #edf7e9;
    border: 1px solid #cce1c4;
}

.account-profile-page,
.projects-page {
    padding-top: 44px;
    padding-bottom: 64px;
}

.profile-card {
    width: min(100%, 760px);
    margin-inline: auto;
}

.profile-details {
    display: grid;
    gap: 8px;
    margin: 28px 0;
}

.profile-details > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    border-bottom: 1px solid #edf0e9;
    padding: 10px 0;
}

.profile-details dt {
    color: #6b7267;
}

.profile-details dd {
    margin: 0;
    font-weight: 800;
    color: #2f372b;
}

.profile-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.projects-header {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 20px;
    margin-bottom: 28px;
}

.projects-header p {
    color: #69706d;
    margin-bottom: 0;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 18px;
}

.project-card {
    overflow: hidden;
    border: 1px solid #dfe4d9;
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 12px 34px rgba(27, 35, 24, .08);
}

.project-preview {
    display: block;
    aspect-ratio: 16 / 9;
    background: #e9ede5;
    overflow: hidden;
}

.project-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.project-preview-placeholder {
    width: 100%;
    height: 100%;
    display: grid;
    place-items: center;
    color: #798470;
    font-size: 2rem;
    font-weight: 900;
}

.project-card-body {
    padding: 18px;
}

.project-card-heading {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 12px;
}

.project-card-heading h2 {
    margin: 0;
    font-size: 1.1rem;
    color: #2c3428;
}

.project-card-heading span {
    border-radius: 999px;
    background: #eef2e9;
    color: #526044;
    padding: 4px 9px;
    font-size: .72rem;
    font-weight: 800;
}

.project-card-body > p {
    margin: 8px 0 16px;
    color: #71786d;
    font-size: .85rem;
}

.project-card-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.project-card-actions a,
.project-card-actions button,
.project-rename-form button {
    border: 1px solid #d4dacd;
    border-radius: 9px;
    background: #fff;
    color: #36422e;
    padding: 7px 10px;
    text-decoration: none;
    font-size: .82rem;
    font-weight: 800;
}

.project-card-actions form {
    margin: 0;
}

.project-card-actions button.danger {
    color: #9f3f36;
}

.project-share-panel {
    display: grid;
    gap: 9px;
    margin-top: 14px;
    padding: 12px;
    border: 1px solid #e1d7a8;
    border-radius: 10px;
    background: #fbfaf3;
}

.project-share-panel p {
    margin: 0;
    color: #66705f;
    font-size: .82rem;
    line-height: 1.7;
}

.project-share-panel form {
    margin: 0;
}

.project-share-panel button,
.project-share-panel a {
    border: 1px solid #d4bf68;
    border-radius: 8px;
    background: #fff;
    color: #36422e;
    padding: 7px 10px;
    text-decoration: none;
    font-size: .82rem;
    font-weight: 900;
}

.project-share-panel form button {
    width: fit-content;
}

.project-share-heading,
.project-share-link-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.project-share-heading {
    justify-content: space-between;
}

.project-share-heading strong {
    color: #303a2a;
}

.project-share-heading span {
    border-radius: 999px;
    background: #e9f5e3;
    color: #356227;
    padding: 3px 8px;
    font-size: .75rem;
    font-weight: 900;
}

.project-share-link-row input {
    flex: 1 1 180px;
    min-width: 0;
    border: 1px solid #d9dccd;
    border-radius: 8px;
    background: #fff;
    color: #4d5549;
    padding: 7px 9px;
    direction: ltr;
    text-align: left;
    font-size: .78rem;
}

.project-rename-form {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
    margin-top: 14px;
}

.project-rename-form input {
    min-width: 0;
    border: 1px solid #d7dccf;
    border-radius: 9px;
    padding: 7px 10px;
}

.projects-empty {
    border: 1px dashed #bdc6b3;
    border-radius: 20px;
    background: #f8faf6;
    padding: 44px 24px;
    text-align: center;
}

.projects-empty h2 {
    color: #303a2a;
}

.projects-empty p {
    color: #6d7568;
}

.designer-projects-link {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, .28);
    padding: 5px 9px;
    color: inherit;
    text-decoration: none;
    font-size: .75rem;
    font-weight: 800;
}

.cloud-save-status {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    border-radius: 999px;
    padding: 4px 9px;
    background: rgba(255, 255, 255, .12);
    font-size: .7rem;
    white-space: nowrap;
}

.cloud-save-status[data-state="saved"] {
    background: rgba(80, 140, 74, .2);
}

.cloud-save-status[data-state="error"] {
    background: rgba(174, 74, 59, .2);
}

@media (max-width: 900px) {
    .salwadi-account-nav {
        align-items: stretch;
        flex-direction: column;
        padding-top: 10px;
    }

    .projects-header {
        align-items: stretch;
        flex-direction: column;
    }
}

/* ===== Phase 3 UX polish: authenticated header, project save dialog, AI gallery ===== */
.salwadi-header .page-shell {
    width: min(1500px, calc(100% - 28px));
}

.salwadi-header .navbar-collapse {
    align-items: center;
    gap: 10px;
}

.salwadi-nav,
.salwadi-account-nav {
    flex-wrap: nowrap;
    white-space: nowrap;
}

.salwadi-nav {
    gap: 2px;
}

.salwadi-header .nav-link {
    padding-inline: 9px !important;
}

.salwadi-account-nav {
    margin-inline-start: auto;
    gap: 4px;
}

.salwadi-account-nav form {
    margin: 0;
}

.salwadi-account-nav .nav-cta {
    min-height: 40px;
    padding: 8px 13px;
    font-size: .86rem;
}

.projects-page,
.account-profile-page,
.project-images-page {
    padding-top: 124px !important;
}

.projects-page {
    min-height: calc(100vh - 120px);
}

.projects-header h1,
.project-images-header h1 {
    margin: 0 0 8px;
}

.project-card-actions .project-images-link {
    border-color: rgba(212, 175, 82, .6);
    background: #fff8e5;
    color: #5e4b1c;
}

.project-save-modal {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: grid;
    place-items: center;
    padding: 18px;
    background: rgba(15, 19, 13, .68);
    backdrop-filter: blur(8px);
}

.project-save-modal[hidden] {
    display: none !important;
}

.project-save-dialog {
    width: min(100%, 520px);
    max-height: min(760px, calc(100vh - 36px));
    overflow: auto;
    border: 1px solid rgba(212, 175, 82, .34);
    border-radius: 22px;
    background: #fbfaf5;
    box-shadow: 0 30px 90px rgba(0, 0, 0, .34);
    padding: 20px;
    color: #283122;
}

.project-save-dialog-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.project-save-dialog-heading span {
    color: #8b6d25;
    font-size: .78rem;
    font-weight: 900;
}

.project-save-dialog-heading h2 {
    margin: 3px 0 0;
    font-size: 1.35rem;
    font-weight: 950;
}

.project-save-close {
    width: 36px;
    height: 36px;
    border: 1px solid #d9deD2;
    border-radius: 50%;
    background: #fff;
    color: #4a5541;
    font-size: 1.25rem;
    line-height: 1;
}

.project-save-field {
    display: grid;
    gap: 7px;
    margin-bottom: 14px;
    font-weight: 850;
}

.project-save-field small {
    color: #7d8478;
    font-weight: 600;
}

.project-save-field input[type="text"],
.project-save-field input[type="file"] {
    width: 100%;
    min-height: 46px;
    border: 1px solid #d7dccf;
    border-radius: 12px;
    background: #fff;
    padding: 9px 12px;
    color: #2d3529;
}

.project-save-preview-wrap {
    display: grid;
    place-items: center;
    min-height: 130px;
    margin: 6px 0 18px;
    border: 1px dashed #c7cfbf;
    border-radius: 16px;
    background: #f1f4ed;
    overflow: hidden;
}

.project-save-preview-wrap p {
    margin: 0;
    padding: 18px;
    color: #6f7868;
    text-align: center;
    line-height: 1.7;
    font-size: .88rem;
}

.project-save-image-preview {
    width: 100%;
    max-height: 260px;
    object-fit: cover;
}

.project-save-dialog-actions {
    display: grid;
    grid-template-columns: 1fr 1.4fr;
    gap: 10px;
}

.project-save-dialog-actions button {
    min-height: 46px;
    border-radius: 12px;
    font-weight: 900;
}

.project-save-secondary {
    border: 1px solid #d7dccf;
    background: #fff;
    color: #526044;
}

.project-save-primary {
    border: 1px solid #334128;
    background: #334128;
    color: #fff;
}

.project-images-page {
    min-height: calc(100vh - 120px);
    padding-bottom: 70px;
}

.project-images-header {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 26px;
}

.project-images-header p {
    margin-bottom: 0;
    color: #69706d;
}

.project-images-header-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.project-images-header-actions a {
    border: 1px solid #d3d9cd;
    border-radius: 10px;
    background: #fff;
    color: #334128;
    padding: 8px 12px;
    font-weight: 850;
}

.project-ai-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 18px;
}

.project-ai-image-card {
    overflow: hidden;
    border: 1px solid #dfe4d9;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 12px 34px rgba(27, 35, 24, .08);
}

.project-ai-image-card a {
    display: block;
    aspect-ratio: 16 / 10;
    background: #e8ece4;
}

.project-ai-image-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.project-ai-image-card > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 14px;
}

.project-ai-image-card strong {
    color: #303a2a;
}

.project-ai-image-card span {
    color: #7a8175;
    font-size: .78rem;
}

@media (max-width: 1250px) and (min-width: 901px) {
    .salwadi-brand {
        min-width: 190px;
    }

    .brand-logo {
        width: 48px;
        height: 44px;
    }

    .brand-copy strong {
        font-size: .92rem;
    }

    .brand-copy small {
        display: none;
    }

    .salwadi-header .nav-link,
    .account-nav-link,
    .account-nav-button {
        font-size: .82rem;
    }

    .salwadi-header .nav-link {
        padding-inline: 6px !important;
    }

    .salwadi-account-nav .nav-cta {
        padding-inline: 10px;
        font-size: .78rem;
    }
}

@media (max-width: 900px) {
    .salwadi-account-nav,
    .salwadi-nav {
        white-space: normal;
    }

    .projects-page,
    .account-profile-page,
    .project-images-page {
        padding-top: 96px !important;
    }

    .project-images-header {
        align-items: stretch;
        flex-direction: column;
    }

    .project-save-dialog {
        padding: 16px;
        border-radius: 18px;
    }
}

/* ===== Phase 3 draft/project identity + upcoming services ===== */
.upcoming-nav-link {
    display: inline-flex !important;
    align-items: center;
    gap: 6px;
}

.upcoming-nav-link small,
.coming-soon-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 3px 8px;
    border: 1px solid rgba(215, 181, 109, .45);
    border-radius: 999px;
    background: rgba(215, 181, 109, .12);
    color: #d7b56d;
    font-size: .68rem;
    font-weight: 900;
    line-height: 1;
    white-space: nowrap;
}

.service-grid-current {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.service-card-upcoming {
    opacity: .92;
}

.service-card-upcoming .coming-soon-badge {
    margin-top: 14px;
    color: #695522;
    background: #fff8df;
}

.service-upcoming-link {
    display: inline-flex;
    margin-top: 16px;
    color: var(--teal);
    font-weight: 900;
    text-decoration: none;
}

.coming-soon-page {
    min-height: calc(100vh - 180px);
    display: grid;
    place-items: center;
}

.coming-soon-shell {
    max-width: 760px;
    text-align: center;
}

.coming-soon-shell .coming-soon-badge {
    margin-bottom: 14px;
    color: #695522;
    background: #fff8df;
}

.coming-soon-shell .primary-action {
    margin-top: 22px;
}

@media (max-width: 900px) {
    .service-grid-current {
        grid-template-columns: 1fr;
    }

    .upcoming-nav-link {
        justify-content: flex-start;
    }
}

/* ===== PHASE 4 AI QUEUE / CREDITS ===== */
body.designer-shell .stage-ai-zone {
    flex-wrap: wrap !important;
}

body.designer-shell .ai-render-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    flex-wrap: wrap;
}

body.designer-shell .ai-side-picker {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-height: 40px;
    padding: 0 8px;
    border: 1px solid rgba(217, 184, 111, .45);
    border-radius: 9px;
    background: rgba(17, 20, 18, .84);
    color: #d9b86f;
    font-size: 11px;
    font-weight: 800;
}

body.designer-shell .ai-side-picker select {
    min-width: 70px;
    border: 0;
    outline: 0;
    background: #222722;
    color: #fff;
    border-radius: 6px;
    padding: 5px 6px;
}

body.designer-shell .ai-render-all-button {
    min-width: 105px !important;
}

body.designer-shell .ai-credit-badge {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 5px 9px;
    border-radius: 999px;
    background: rgba(217, 184, 111, .13);
    color: #e2c786;
    border: 1px solid rgba(217, 184, 111, .3);
    font-size: 10px;
    font-weight: 850;
    white-space: nowrap;
}

body.designer-shell .ai-queue-progress {
    width: min(330px, 100%);
    display: grid;
    gap: 3px;
}

body.designer-shell .ai-queue-progress[hidden] {
    display: none !important;
}

body.designer-shell .ai-queue-progress-track {
    height: 5px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(255, 255, 255, .12);
}

body.designer-shell .ai-queue-progress-track span {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: #d9b86f;
    transition: width .25s ease;
}

body.designer-shell .ai-queue-progress strong {
    color: #dfe5dc;
    font-size: 10px;
    font-weight: 750;
}

body.designer-shell .ai-image-modal-actions {
    position: fixed;
    bottom: 22px;
    left: 50%;
    z-index: 100000;
    display: flex;
    gap: 8px;
    transform: translateX(-50%);
}

body.designer-shell .ai-image-modal-actions button {
    min-width: 90px;
    border: 1px solid rgba(217, 184, 111, .75);
    border-radius: 10px;
    background: rgba(22, 25, 22, .94);
    color: #f1ddb0;
    padding: 9px 13px;
    font-weight: 850;
    cursor: pointer;
}

/* Project AI history actions */
.project-ai-image-open {
    display: block;
    width: 100%;
    padding: 0;
    border: 0;
    aspect-ratio: 16 / 10;
    background: #e8ece4;
    cursor: zoom-in;
}

.project-ai-image-meta {
    display: grid !important;
    gap: 10px !important;
}

.project-ai-image-meta > div:first-child {
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.project-ai-image-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.project-ai-image-actions button,
.project-ai-image-actions a {
    border: 1px solid #d4dbce;
    border-radius: 9px;
    background: #f9faf7;
    color: #394531;
    padding: 6px 9px;
    font-size: .78rem;
    font-weight: 800;
    cursor: pointer;
}

#projectAiGalleryModal.ai-image-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 28px;
    background: rgba(0, 0, 0, .88);
    backdrop-filter: blur(6px);
}

#projectAiGalleryModal.ai-image-modal[hidden] {
    display: none !important;
}

#projectAiGalleryModal.ai-image-modal img {
    display: block;
    max-width: 94vw;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 12px;
}

#projectAiGalleryModal .ai-image-modal-close {
    position: fixed;
    top: 20px;
    right: 22px;
    z-index: 100000;
    width: 46px;
    height: 46px;
    border: 0;
    border-radius: 50%;
    background: #fff;
    color: #111;
    font-size: 30px;
    cursor: pointer;
}

@media (max-width: 760px) {
    body.designer-shell .ai-render-controls {
        justify-content: flex-start;
    }

    body.designer-shell .stage-ai-button,
    body.designer-shell .ai-render-all-button {
        min-width: 120px !important;
    }
}
.project-ai-image-actions a {
    display: inline-flex !important;
    align-items: center;
    aspect-ratio: auto !important;
    background: #f9faf7 !important;
}


/* ===== Phase 4 toolbar compact/action fix ===== */
body.designer-shell .stage-actions {
    gap: 5px !important;
}

body.designer-shell .stage-actions > button,
body.designer-shell .designer-projects-icon,
body.designer-shell .stage-ai-button,
body.designer-shell .ai-side-picker {
    height: 38px !important;
    min-height: 38px !important;
    box-sizing: border-box !important;
}

body.designer-shell .designer-projects-icon {
    width: 38px !important;
    min-width: 38px !important;
    padding: 0 !important;
    justify-content: center !important;
    border-radius: 8px !important;
}

body.designer-shell .designer-projects-icon svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

body.designer-shell .ai-render-controls {
    gap: 6px !important;
    flex-wrap: nowrap !important;
}

body.designer-shell .ai-single-split {
    display: inline-flex;
    align-items: stretch;
    height: 38px;
    flex: 0 0 auto;
}

body.designer-shell .ai-single-create-button {
    min-width: 116px !important;
    padding: 0 10px !important;
    gap: 6px !important;
    border-radius: 0 9px 9px 0 !important;
}

body.designer-shell .ai-side-picker {
    position: relative;
    width: 34px !important;
    min-width: 34px !important;
    padding: 0 !important;
    margin: 0 !important;
    justify-content: center !important;
    border-radius: 9px 0 0 9px !important;
    border-right: 1px solid rgba(34, 42, 27, .28) !important;
    border-top: 1px solid rgba(255, 231, 150, .58) !important;
    border-right: 1px solid rgba(255, 231, 150, .58) !important;
    border-bottom: 1px solid rgba(255, 231, 150, .58) !important;
    background: linear-gradient(135deg, #edd77d, #d4af52 52%, #78845f) !important;
    color: #222a1b !important;
    overflow: hidden;
}

body.designer-shell .ai-side-picker select {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    min-width: 0 !important;
    padding: 0 !important;
    opacity: 0 !important;
    cursor: pointer !important;
}

body.designer-shell .ai-side-arrow {
    font-size: 18px !important;
    line-height: 1 !important;
    color: #222a1b !important;
    transform: translateY(-1px);
    pointer-events: none;
}

body.designer-shell .ai-render-all-button {
    min-width: 108px !important;
    padding: 0 10px !important;
    gap: 6px !important;
}

body.designer-shell .ai-toolbar-mark {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 24px !important;
    height: 24px !important;
    padding: 0 !important;
    border-radius: 7px !important;
    background: #252a24 !important;
    color: #f7df91 !important;
    font-size: 9px !important;
    font-weight: 900 !important;
    line-height: 1 !important;
}

body.designer-shell .ai-credit-badge {
    min-height: 30px !important;
    padding: 4px 8px !important;
    font-size: 10px !important;
}

@media (max-width: 760px) {
    body.designer-shell .ai-render-controls {
        flex-wrap: wrap !important;
    }

    body.designer-shell .stage-ai-button,
    body.designer-shell .ai-render-all-button {
        min-width: 0 !important;
    }
}

body.designer-shell .ai-credit-badge[hidden] {
    display: none !important;
}

/* ===== Phase 4 critical toolbar regression fix ===== */
body.designer-shell #saveCloudProjectButton.designer-save-icon-button {
    width: 38px !important;
    min-width: 38px !important;
    max-width: 38px !important;
    height: 38px !important;
    min-height: 38px !important;
    padding: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 8px !important;
    flex: 0 0 38px !important;
    overflow: hidden !important;
}

body.designer-shell #saveCloudProjectButton.designer-save-icon-button .designer-save-icon {
    display: block !important;
    width: 18px !important;
    height: 18px !important;
    min-width: 18px !important;
    max-width: 18px !important;
    min-height: 18px !important;
    max-height: 18px !important;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
    pointer-events: none;
}

body.designer-shell .ai-single-create-button,
body.designer-shell .ai-render-all-button {
    white-space: nowrap !important;
    line-height: 1 !important;
    font-size: 12px !important;
}

body.designer-shell .ai-single-create-button {
    min-width: 108px !important;
    padding-inline: 8px !important;
}

body.designer-shell .ai-render-all-button {
    min-width: 100px !important;
    padding-inline: 8px !important;
}

/* ===== Phase 4 toolbar clean layout fix ===== */
/* Use the exact PNG save icon supplied by the user, but physically resized to 18x18. */
body.designer-shell #saveCloudProjectButton.designer-save-icon-button .designer-save-icon {
    display: block !important;
    width: 18px !important;
    height: 18px !important;
    min-width: 18px !important;
    max-width: 18px !important;
    min-height: 18px !important;
    max-height: 18px !important;
    object-fit: contain !important;
    filter: brightness(0) invert(1);
    pointer-events: none !important;
}

/* The global .ai-render-button span rule styles every span as a 32x32 dark square.
   Reset only the text labels so the two toolbar buttons stay compact and readable. */
body.designer-shell .ai-render-button .ai-button-label {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    padding: 0 !important;
    margin: 0 !important;
    color: #222a1b !important;
    background: transparent !important;
    border-radius: 0 !important;
    font-size: 12px !important;
    font-weight: 900 !important;
    line-height: 1 !important;
    white-space: nowrap !important;
}

body.designer-shell .ai-render-controls {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-wrap: nowrap !important;
    gap: 6px !important;
    direction: rtl;
}

body.designer-shell .ai-single-split {
    display: inline-flex !important;
    align-items: stretch !important;
    flex: 0 0 auto !important;
    height: 38px !important;
    gap: 0 !important;
    border-radius: 9px !important;
    overflow: hidden !important;
}

body.designer-shell .ai-single-create-button {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: auto !important;
    min-width: 112px !important;
    max-width: none !important;
    height: 38px !important;
    padding: 0 9px !important;
    gap: 6px !important;
    margin: 0 !important;
    border-radius: 0 9px 9px 0 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
}

body.designer-shell .ai-side-picker {
    position: relative !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 32px !important;
    min-width: 32px !important;
    max-width: 32px !important;
    height: 38px !important;
    min-height: 38px !important;
    padding: 0 !important;
    margin: 0 !important;
    border-radius: 9px 0 0 9px !important;
    border: 1px solid rgba(255,231,150,.58) !important;
    border-right-color: rgba(34,42,27,.24) !important;
    background: linear-gradient(135deg, #edd77d, #d4af52 52%, #78845f) !important;
    color: #222a1b !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
    cursor: pointer !important;
}

body.designer-shell .ai-side-arrow {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: auto !important;
    height: auto !important;
    padding: 0 !important;
    margin: 0 !important;
    color: #222a1b !important;
    background: transparent !important;
    border-radius: 0 !important;
    font-size: 16px !important;
    font-weight: 900 !important;
    line-height: 1 !important;
    transform: translateY(-1px) !important;
    pointer-events: none !important;
}

body.designer-shell .ai-render-all-button {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: auto !important;
    min-width: 96px !important;
    max-width: none !important;
    height: 38px !important;
    padding: 0 9px !important;
    gap: 6px !important;
    margin: 0 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
}

body.designer-shell .ai-render-button .ai-toolbar-mark {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex: 0 0 22px !important;
    width: 22px !important;
    min-width: 22px !important;
    max-width: 22px !important;
    height: 22px !important;
    min-height: 22px !important;
    max-height: 22px !important;
    padding: 0 !important;
    margin: 0 !important;
    border-radius: 6px !important;
    background: #252a24 !important;
    color: #f7df91 !important;
    font-size: 8px !important;
    font-weight: 900 !important;
    line-height: 1 !important;
}

@media (max-width: 760px) {
    body.designer-shell .ai-render-controls {
        flex-wrap: wrap !important;
    }
}


/* ===== Phase 4 realistic conversion label ===== */
body.designer-shell .ai-convert-label {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    height: 38px !important;
    padding: 0 4px !important;
    margin: 0 !important;
    color: #f2e7bd !important;
    background: transparent !important;
    font-size: 12px !important;
    font-weight: 900 !important;
    line-height: 1 !important;
    white-space: nowrap !important;
    flex: 0 0 auto !important;
}

body.designer-shell .ai-single-create-button {
    min-width: 92px !important;
}

body.designer-shell .ai-render-all-button {
    min-width: 90px !important;
}

@media (max-width: 760px) {
    body.designer-shell .ai-convert-label {
        height: 34px !important;
        font-size: 11px !important;
    }
}


/* ===== Phase 4 toolbar label + unified stage notifications + tooltips ===== */
/* Keep the old DOM label hidden if an older Designer.cshtml is still cached/copied. */
body.designer-shell .ai-convert-label {
    display: none !important;
}

/* Generate the label from CSS so it always occupies the blank space immediately
   to the right of the two AI controls, independent of Razor/browser cache. */
body.designer-shell .ai-render-controls::before {
    content: "تحويل لواقعي:";
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    height: 38px !important;
    min-height: 38px !important;
    padding: 0 3px !important;
    margin: 0 !important;
    color: #f2e7bd !important;
    background: transparent !important;
    font-size: 12px !important;
    font-weight: 900 !important;
    line-height: 1 !important;
    white-space: nowrap !important;
    flex: 0 0 auto !important;
}

body.designer-shell .ai-render-controls {
    direction: rtl !important;
}

/* Queue/result text no longer takes space in the top toolbar. AI progress, loading,
   completion and errors are surfaced through the same floating stage message used
   by 3D asset loading and project saving. */
body.designer-shell .stage-ai-zone > .ai-queue-progress,
body.designer-shell .stage-ai-zone > .stage-ai-result {
    display: none !important;
}

/* Compact hover hints for icon/emoji-only toolbar actions. */
body.designer-shell [data-toolbar-tooltip] {
    position: relative !important;
    overflow: visible !important;
}

body.designer-shell [data-toolbar-tooltip]::after {
    content: attr(data-toolbar-tooltip);
    position: absolute;
    top: calc(100% + 7px);
    left: 50%;
    z-index: 120;
    transform: translate(-50%, -3px);
    padding: 5px 8px;
    border: 1px solid rgba(215,181,109,.55);
    border-radius: 7px;
    background: rgba(28,38,32,.97);
    color: #fff8df;
    box-shadow: 0 8px 20px rgba(0,0,0,.22);
    font-size: 10px;
    font-weight: 800;
    line-height: 1;
    white-space: nowrap;
    direction: rtl;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 120ms ease, transform 120ms ease, visibility 120ms ease;
}

body.designer-shell [data-toolbar-tooltip]:hover::after,
body.designer-shell [data-toolbar-tooltip]:focus-visible::after {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, 0);
}

@media (max-width: 760px) {
    body.designer-shell .ai-render-controls::before {
        height: 34px !important;
        min-height: 34px !important;
        font-size: 11px !important;
    }
}

/* ===== Phase 4 save hover + centered AI side arrow fix ===== */
/* The save button previously clipped the custom hover tooltip because the
   compact-icon rule used overflow:hidden. Keep the button compact but allow
   the tooltip to render outside it. */
body.designer-shell #saveCloudProjectButton.designer-save-icon-button[data-toolbar-tooltip] {
    overflow: visible !important;
    position: relative !important;
}

/* The supplied PNG is black. It is inverted to white on the dark idle button,
   then returned to black on the light hover/focus state so it behaves visually
   like the undo/redo glyphs. */
body.designer-shell #saveCloudProjectButton.designer-save-icon-button .designer-save-icon {
    filter: brightness(0) invert(1) !important;
    transition: filter 120ms ease !important;
}

body.designer-shell #saveCloudProjectButton.designer-save-icon-button:hover .designer-save-icon,
body.designer-shell #saveCloudProjectButton.designer-save-icon-button:focus-visible .designer-save-icon {
    filter: brightness(0) !important;
}

body.designer-shell #saveCloudProjectButton.designer-save-icon-button:hover,
body.designer-shell #saveCloudProjectButton.designer-save-icon-button:focus-visible {
    z-index: 130 !important;
}

/* Do not rely on the vertical metrics of the Unicode down-arrow glyph.
   Draw a tiny CSS chevron and pin it mathematically to the exact center. */
body.designer-shell .ai-side-picker {
    position: relative !important;
}

body.designer-shell .ai-side-arrow {
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    width: 8px !important;
    height: 8px !important;
    margin: 0 !important;
    padding: 0 !important;
    font-size: 0 !important;
    line-height: 0 !important;
    background: transparent !important;
    transform: translate(-50%, -62%) rotate(45deg) !important;
    border-right: 2px solid #222a1b !important;
    border-bottom: 2px solid #222a1b !important;
    pointer-events: none !important;
    box-sizing: border-box !important;
    z-index: 1 !important;
}

body.designer-shell .ai-side-picker select {
    z-index: 2 !important;
}

/* ===== Phase 6 workshop quotes ===== */
.workshop-page {
    padding-block: 46px 72px;
}

.workshop-header,
.workshop-header-actions {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 16px;
}

.workshop-header {
    margin-bottom: 24px;
}

.workshop-header h1,
.workshop-panel h2,
.quote-document h2,
.quote-document h3 {
    color: #232b1d;
    font-weight: 900;
}

.workshop-header h1 {
    margin: 0 0 8px;
}

.workshop-header p {
    margin: 0;
    color: #697064;
}

.account-secondary-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 10px 18px;
    border: 1px solid #cfd5c7;
    border-radius: 12px;
    background: #fff;
    color: #35442a;
    font-weight: 900;
    text-decoration: none;
}

.account-secondary-button:hover {
    color: #25301e;
    background: #f4f7f0;
}

.workshop-message,
.workshop-locked,
.workshop-panel,
.quote-document {
    border: 1px solid #d9ded2;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 10px 30px rgba(29, 38, 24, .06);
}

.workshop-message {
    margin-bottom: 20px;
    padding: 12px 16px;
    background: #fff9df;
    color: #403816;
    font-weight: 800;
}

.workshop-locked {
    display: grid;
    gap: 12px;
    padding: 26px;
}

.workshop-locked h2,
.workshop-locked p {
    margin: 0;
}

.workshop-locked p,
.workshop-empty-note {
    color: #697064;
}

.workshop-locked a {
    width: fit-content;
    border-radius: 8px;
    background: #35442a;
    color: #fff;
    padding: 10px 14px;
    font-weight: 900;
}

.workshop-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}

.workshop-stats div {
    border: 1px solid #d9ded2;
    border-radius: 8px;
    background: #fbfcf8;
    padding: 16px;
}

.workshop-stats span,
.quote-document-grid span,
.quote-measurements span,
.quote-total-grid span,
.quote-label {
    display: block;
    color: #697064;
    font-size: .82rem;
    font-weight: 800;
}

.workshop-stats strong {
    display: block;
    margin-top: 4px;
    color: #25301e;
    font-size: 1.55rem;
    line-height: 1.1;
}

.workshop-grid {
    display: grid;
    grid-template-columns: minmax(280px, .85fr) minmax(320px, 1.15fr);
    gap: 16px;
    margin-bottom: 16px;
}

.workshop-panel {
    padding: 18px;
    margin-bottom: 16px;
}

.workshop-panel header {
    margin-bottom: 14px;
}

.workshop-panel h2,
.quote-document h3 {
    margin: 0;
    font-size: 1.15rem;
}

.workshop-form,
.workshop-quote-form,
.workshop-form-grid {
    display: grid;
    gap: 12px;
}

.workshop-form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.workshop-form label,
.workshop-form-grid label,
.workshop-full-label {
    display: grid;
    gap: 6px;
    color: #343b30;
    font-weight: 800;
}

.workshop-form input,
.workshop-form textarea,
.workshop-form-grid input,
.workshop-form-grid select,
.workshop-full-label textarea,
.workshop-row-form select,
.workshop-status-form select {
    width: 100%;
    min-width: 0;
    border: 1px solid #d7dccf;
    border-radius: 8px;
    background: #fbfcf9;
    padding: 9px 11px;
    color: #1f271c;
}

.workshop-form textarea,
.workshop-full-label textarea {
    min-height: 88px;
    resize: vertical;
}

.workshop-form button,
.workshop-row-form button,
.workshop-status-form button,
.workshop-submit-bar button {
    border: 1px solid #35442a;
    border-radius: 8px;
    background: #35442a;
    color: #fff;
    padding: 9px 13px;
    font-weight: 900;
}

.workshop-form.compact {
    margin-top: 12px;
}

.workshop-customer-list {
    display: grid;
    gap: 10px;
}

.workshop-customer-item {
    border: 1px solid #e3e7dd;
    border-radius: 8px;
    padding: 12px;
}

.workshop-customer-item summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    cursor: pointer;
}

.workshop-customer-item summary span {
    color: #697064;
}

.workshop-inline-actions {
    display: flex;
    justify-content: end;
}

.workshop-danger {
    margin-top: 8px;
    border-color: #a4493f !important;
    background: #fff4f1 !important;
    color: #9f3f36 !important;
}

.workshop-table-wrap {
    overflow-x: auto;
}

.workshop-table {
    width: 100%;
    border-collapse: collapse;
}

.workshop-table th,
.workshop-table td {
    border-bottom: 1px solid #edf0ea;
    padding: 11px 8px;
    vertical-align: middle;
}

.workshop-table th {
    color: #697064;
    font-size: .82rem;
}

.workshop-table small {
    display: block;
    color: #7a8375;
}

.workshop-row-form,
.workshop-status-form {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.workshop-row-form select {
    flex: 1 1 160px;
}

.workshop-row-form a,
.workshop-table a {
    border: 1px solid #d4dacd;
    border-radius: 8px;
    background: #fff;
    color: #36422e;
    padding: 8px 10px;
    font-size: .82rem;
    font-weight: 900;
}

.workshop-status {
    display: inline-flex;
    border-radius: 999px;
    background: #eef2e9;
    color: #526044;
    padding: 4px 9px;
    font-size: .76rem;
    font-weight: 900;
}

.workshop-check-row label,
.workshop-accessory-grid label {
    display: flex;
    align-items: center;
    gap: 8px;
}

.workshop-check-row {
    margin-top: 12px;
}

.workshop-accessory-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 10px;
}

.workshop-accessory-grid label {
    align-items: start;
    border: 1px solid #e3e7dd;
    border-radius: 8px;
    background: #fbfcf8;
    padding: 10px;
}

.workshop-accessory-grid small {
    margin-inline-start: auto;
    color: #697064;
}

.workshop-submit-bar {
    display: flex;
    justify-content: end;
}

.workshop-live-preview {
    border-color: rgba(212, 175, 82, .36);
    background: linear-gradient(180deg, #fffdf7, #fbfcf8);
}

.workshop-live-preview header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.workshop-live-preview header p {
    margin: 4px 0 0;
    color: #697064;
}

#quotePreviewStatus {
    display: inline-flex;
    min-height: 30px;
    align-items: center;
    border: 1px solid rgba(212, 175, 82, .36);
    border-radius: 999px;
    padding: 4px 10px;
    color: #6c571d;
    background: #fff8df;
    font-size: .78rem;
    font-weight: 900;
    white-space: nowrap;
}

.quote-preview-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.quote-preview-grid div,
.quote-preview-line {
    border: 1px solid #e4e8dd;
    border-radius: 8px;
    background: #fff;
    padding: 11px 12px;
}

.quote-preview-grid span {
    display: block;
    color: #697064;
    font-size: .78rem;
    font-weight: 850;
}

.quote-preview-grid strong {
    display: block;
    margin-top: 4px;
    color: #273020;
    font-weight: 950;
}

.quote-preview-total {
    background: #25301e !important;
}

.quote-preview-total span,
.quote-preview-total strong {
    color: #fff !important;
}

.quote-preview-total strong {
    font-size: 1.25rem;
}

.quote-preview-lines {
    display: grid;
    gap: 8px;
    margin-top: 12px;
}

.quote-preview-line {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
}

.quote-preview-line strong,
.quote-preview-line small {
    display: block;
}

.quote-preview-line small {
    color: #697064;
}

.quote-preview-line span {
    color: #273020;
    font-weight: 950;
    white-space: nowrap;
}

.quote-document {
    padding: clamp(18px, 3vw, 34px);
}

.quote-document-header,
.quote-document-grid,
.quote-measurements,
.quote-total-grid {
    display: grid;
    gap: 12px;
}

.quote-document-header {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    border-bottom: 2px solid #e6eadf;
    padding-bottom: 18px;
    margin-bottom: 18px;
}

.quote-document-header h2 {
    margin: 2px 0;
    font-size: clamp(1.6rem, 4vw, 2.6rem);
}

.quote-brand-stack {
    display: grid;
    gap: 8px;
    justify-items: end;
}

.quote-brand-box {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 48px;
    border: 1px solid #e3e7dd;
    border-radius: 8px;
    padding: 8px 10px;
}

.quote-brand-box img {
    max-width: 110px;
    max-height: 42px;
    object-fit: contain;
}

.quote-brand-box.platform {
    color: #697064;
}

.quote-document-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-bottom: 18px;
}

.quote-document-grid section,
.quote-measurements div,
.quote-total-grid div {
    border: 1px solid #e3e7dd;
    border-radius: 8px;
    background: #fbfcf8;
    padding: 12px;
}

.quote-document-grid strong,
.quote-measurements strong,
.quote-total-grid strong {
    display: block;
    color: #273020;
    font-weight: 900;
}

.quote-document-grid p {
    margin: 3px 0 0;
    color: #697064;
}

.quote-measurements {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    margin-bottom: 22px;
}

.quote-lines-section,
.quote-ai-section,
.quote-notes-section {
    margin-top: 22px;
}

.quote-lines-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

.quote-lines-table th,
.quote-lines-table td {
    border-bottom: 1px solid #e8ece2;
    padding: 10px 8px;
}

.quote-lines-table th {
    color: #697064;
    font-size: .82rem;
}

.quote-lines-table td:last-child,
.quote-lines-table th:last-child {
    text-align: left;
    white-space: nowrap;
}

.quote-total-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-top: 20px;
}

.quote-grand-total {
    background: #25301e !important;
    color: #fff;
}

.quote-grand-total span,
.quote-grand-total strong {
    color: #fff;
}

.quote-grand-total strong {
    font-size: 1.35rem;
}

.quote-ai-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-top: 10px;
}

.quote-ai-grid figure {
    margin: 0;
    border: 1px solid #e3e7dd;
    border-radius: 8px;
    overflow: hidden;
    background: #fbfcf8;
}

.quote-ai-grid img {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
}

.quote-ai-grid figcaption {
    padding: 8px 10px;
    color: #697064;
    font-weight: 800;
}

.quote-notes-section p {
    margin: 8px 0 0;
    color: #4f584c;
}

.quote-terms-section {
    margin-top: 24px;
    page-break-inside: avoid;
}

.quote-custom-terms {
    margin-bottom: 14px;
    border: 1px solid #ded7c3;
    border-radius: 10px;
    background: #fffdf6;
    color: #3c4738;
    padding: 13px 15px;
    white-space: pre-line;
}

.quote-workshop-contact {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 18px;
    margin-top: 14px;
    color: #4f5c49;
    font-weight: 700;
}

.quote-terms-grid,
.quote-signature-grid {
    display: grid;
    gap: 10px;
    margin-top: 10px;
}

.quote-terms-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.quote-terms-grid div,
.quote-signature-grid div {
    border: 1px solid #e3e7dd;
    border-radius: 8px;
    background: #fbfcf8;
    padding: 12px;
}

.quote-terms-grid strong,
.quote-signature-grid strong {
    display: block;
    color: #273020;
    font-weight: 900;
}

.quote-terms-grid p {
    margin: 6px 0 0;
    color: #56604f;
}

.quote-signature-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 14px;
}

.quote-signature-grid div {
    min-height: 92px;
    display: grid;
    align-content: space-between;
}

.quote-signature-grid span {
    color: #697064;
    font-size: .82rem;
    font-weight: 850;
}

.quote-signature-grid strong {
    border-top: 1px solid #d9ded2;
    padding-top: 9px;
}

.project-card-actions .project-quote-link {
    border-color: rgba(35, 129, 118, .32);
    color: #145f57;
    background: #eef8f6;
}

.quote-print-body {
    background: #fff;
}

.quote-print-body .site-footer {
    display: none;
}

@media (max-width: 940px) {
    .workshop-header,
    .workshop-header-actions {
        align-items: flex-start;
        flex-direction: column;
    }

    .workshop-grid,
    .workshop-stats,
    .workshop-form-grid,
    .quote-preview-grid,
    .quote-document-header,
    .quote-document-grid,
    .quote-terms-grid,
    .quote-signature-grid,
    .quote-total-grid {
        grid-template-columns: 1fr;
    }

    .workshop-live-preview header,
    .quote-preview-line {
        align-items: flex-start;
        grid-template-columns: 1fr;
    }

    .quote-brand-stack {
        justify-items: stretch;
    }

    .quote-measurements {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .quote-ai-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media print {
    @page {
        size: A4;
        margin: 12mm;
    }

    body {
        background: #fff !important;
    }

    .site-header,
    .site-footer,
    .no-print {
        display: none !important;
    }

    .page-shell {
        width: 100% !important;
    }

    .workshop-page {
        padding: 0 !important;
    }

    .quote-document {
        border: 0;
        box-shadow: none;
        padding: 0;
    }

    .quote-document-grid,
    .quote-total-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .quote-measurements,
    .quote-ai-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

/* ===== Phase 5 billing ===== */
.billing-page{padding-block:48px 72px}.billing-hero,.billing-section-heading{display:flex;justify-content:space-between;gap:24px;align-items:center;margin-bottom:28px}.billing-hero h1,.billing-section-heading h1,.billing-section-heading h2{margin:4px 0 8px;color:#202719;font-weight:900}.billing-hero p,.billing-section-heading p{margin:0;color:#66705e}.billing-eyebrow{font-size:13px;font-weight:900;color:#9d812e}.billing-balance-card{min-width:180px;border:1px solid #d7c782;border-radius:18px;padding:18px 22px;background:#202719;color:#fff;text-align:center;box-shadow:0 16px 38px rgba(32,39,25,.14)}.billing-balance-card span,.billing-balance-card small{display:block;color:#d9ddcf}.billing-balance-card strong{display:block;font-size:42px;line-height:1;margin:7px 0;color:#f0d36a}.billing-message,.billing-dev-note{border:1px solid #d7c782;background:#fff9df;color:#403816;border-radius:14px;padding:12px 16px;margin-bottom:22px;font-weight:800}.billing-dev-note{margin-top:28px;font-size:13px}.billing-plan-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:16px;margin-bottom:48px}.billing-plan-card,.billing-bundle-card,.billing-admin-card,.billing-history{position:relative;border:1px solid #d9ded2;border-radius:20px;background:#fff;padding:24px;box-shadow:0 10px 30px rgba(29,38,24,.06)}.billing-plan-card.is-featured{border-color:#c5a83e;box-shadow:0 18px 46px rgba(157,129,46,.18)}.billing-plan-card.is-current{outline:2px solid #34442c}.billing-plan-badge,.billing-current-badge{display:inline-flex;border-radius:999px;padding:5px 9px;font-size:11px;font-weight:900;margin-bottom:12px}.billing-plan-badge{background:#f0d36a;color:#2a2716}.billing-current-badge{background:#e7efe1;color:#2f4a28}.billing-plan-card h2{font-size:24px;font-weight:900}.billing-plan-card p,.billing-bundle-card p{min-height:48px;color:#6c7468}.billing-price{display:flex;align-items:end;gap:8px;margin:20px 0}.billing-price strong{font-size:38px;line-height:1;color:#222b1c}.billing-price span{color:#697064}.billing-plan-card ul{list-style:none;padding:0;margin:0 0 22px}.billing-plan-card li{padding:8px 0;border-bottom:1px solid #eef0eb}.billing-action{display:inline-flex;width:100%;justify-content:center;align-items:center;border:0;border-radius:12px;padding:11px 16px;background:#2d3927;color:#fff;text-decoration:none;font-weight:900}.billing-action:hover{background:#e6ca64;color:#24271b}.billing-action.is-disabled{opacity:.55}.billing-action-small{margin-top:12px}.billing-bundle-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px;margin-bottom:44px}.billing-bundle-card>strong{font-size:22px}.billing-history{margin-top:24px}.billing-history-row{display:grid;grid-template-columns:1fr auto auto;gap:14px;align-items:center;padding:12px 0;border-bottom:1px solid #edf0ea}.credit-positive{color:#2f7b45}.credit-negative{color:#a4493f}.billing-admin-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px;margin-bottom:36px}.billing-admin-card{display:grid;gap:12px}.billing-admin-card label{display:grid;gap:6px;font-weight:800}.billing-admin-card input,.billing-admin-card textarea{width:100%;border:1px solid #d9ded2;border-radius:10px;padding:9px 11px}.billing-admin-card textarea{min-height:84px;resize:vertical}.billing-admin-card .billing-check{display:flex;align-items:center;gap:8px}.billing-admin-card .billing-check input{width:auto}@media(max-width:1050px){.billing-plan-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}@media(max-width:720px){.billing-hero,.billing-section-heading{align-items:flex-start;flex-direction:column}.billing-plan-grid,.billing-bundle-grid,.billing-admin-grid{grid-template-columns:1fr}.billing-history-row{grid-template-columns:1fr auto}.billing-history-row small{grid-column:1/-1}.billing-balance-card{width:100%}}

/* Phase 5 company subscriptions + branded customer outputs */
.billing-plan-type {
    display: inline-flex;
    width: fit-content;
    align-items: center;
    min-height: 28px;
    padding: 4px 10px;
    border: 1px solid rgba(214, 188, 104, 0.35);
    border-radius: 999px;
    color: #d6bc68;
    background: rgba(214, 188, 104, 0.08);
    font-size: 0.78rem;
    font-weight: 800;
}

.billing-plan-type.company {
    color: #f4dc8f;
    background: rgba(214, 188, 104, 0.14);
}

.billing-company-heading {
    margin-top: 42px;
}

.billing-plan-card.company-plan {
    border-color: rgba(214, 188, 104, 0.34);
}

.billing-feature-muted {
    opacity: 0.58;
}

.company-branding-panel {
    margin-top: 42px;
    padding: 24px;
    border: 1px solid rgba(214, 188, 104, 0.24);
    border-radius: 20px;
    background: rgba(20, 30, 22, 0.72);
}

.company-profile-form,
.company-brand-mode-form {
    display: grid;
    gap: 14px;
    margin-top: 16px;
}

.company-profile-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.company-profile-wide {
  grid-column: 1 / -1;
}

.company-profile-form label,
.company-brand-mode-form label {
    display: grid;
    gap: 7px;
}

.company-profile-form input[type="text"],
.company-profile-form input[type="tel"],
.company-profile-form input[type="email"],
.company-profile-form input[type="number"],
.company-profile-form textarea,
.company-profile-form input[type="file"],
.billing-admin-card select {
    width: 100%;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.06);
    color: inherit;
    padding: 10px 12px;
}

.company-profile-form textarea {
  resize: vertical;
  min-height: 96px;
}

@media (max-width: 720px) {
  .company-profile-grid {
    grid-template-columns: 1fr;
  }

  .company-profile-wide {
    grid-column: auto;
  }
}

.company-logo-preview {
    display: flex;
    align-items: center;
    min-height: 80px;
    padding: 12px;
    border: 1px dashed rgba(214, 188, 104, 0.3);
    border-radius: 12px;
}

.company-logo-preview img {
    max-width: 180px;
    max-height: 72px;
    object-fit: contain;
}

.company-brand-mode-form {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.09);
}

.company-brand-mode-form label {
    grid-template-columns: auto 1fr;
    align-items: center;
    justify-content: start;
}

.billing-company-lock {
    margin-top: 20px;
    padding: 14px 16px;
    border-radius: 12px;
    background: rgba(214, 188, 104, 0.08);
    color: #eadca7;
}

.billing-admin-entitlements {
    display: grid;
    gap: 8px;
    padding: 12px;
    border: 1px solid rgba(214, 188, 104, 0.18);
    border-radius: 12px;
}

.project-presentation-link {
    white-space: nowrap;
}

.customer-presentation-shell {
    margin: 0;
    padding: 0;
    overflow: hidden;
    background: #080b08;
}

.customer-presentation-page {
    position: fixed;
    inset: 0;
    background: #080b08;
}

.customer-presentation-frame {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
}

.customer-presentation-branding {
    position: fixed;
    z-index: 20;
    left: 24px;
    right: 24px;
    bottom: 22px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    pointer-events: none;
}

.presentation-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 52px;
    max-width: min(360px, 42vw);
    padding: 8px 12px;
    border: 1px solid rgba(214, 188, 104, 0.42);
    border-radius: 13px;
    background: rgba(10, 15, 11, 0.78);
    color: #fff;
    backdrop-filter: blur(8px);
}

.presentation-brand img {
    display: block;
    max-width: 125px;
    max-height: 46px;
    object-fit: contain;
}

.presentation-brand span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 800;
}

.platform-brand {
    margin-inline-start: auto;
}

@media (max-width: 720px) {
    .customer-presentation-branding {
        left: 12px;
        right: 12px;
        bottom: 12px;
    }

    .presentation-brand {
        max-width: 46vw;
        padding: 7px 9px;
    }

    .presentation-brand img {
        max-width: 90px;
        max-height: 38px;
    }
}

.public-project-shell {
    background: #f6f4eb;
}

.public-project-page {
    min-height: 100vh;
    color: #25301f;
    background:
        linear-gradient(180deg, rgba(25, 35, 24, .96), rgba(25, 35, 24, .92) 360px, #f6f4eb 360px);
}

.public-project-hero,
.public-project-content {
    width: min(1180px, calc(100% - 32px));
    margin-inline: auto;
}

.public-project-hero {
    display: grid;
    gap: 28px;
    padding: 34px 0 42px;
}

.public-project-brand-stack {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.public-project-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 52px;
    max-width: min(420px, 100%);
    border: 1px solid rgba(214, 188, 104, .4);
    border-radius: 8px;
    background: rgba(255, 255, 255, .07);
    color: #fff8dd;
    padding: 8px 12px;
}

.public-project-brand img {
    max-width: 130px;
    max-height: 46px;
    object-fit: contain;
}

.public-project-brand strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.public-project-title {
    max-width: 860px;
}

.public-project-title h1 {
    margin: 6px 0 10px;
    color: #fff;
    font-size: clamp(2.4rem, 6vw, 5.8rem);
    line-height: 1.05;
}

.public-project-title span {
    display: inline-flex;
    border: 1px solid rgba(214, 188, 104, .36);
    border-radius: 999px;
    color: #f2dda1;
    padding: 5px 11px;
    font-weight: 900;
}

.public-project-content {
    display: grid;
    gap: 18px;
    padding-bottom: 56px;
}

.public-project-message,
.public-project-section,
.public-project-summary,
.public-project-preview {
    border: 1px solid #ded8c7;
    border-radius: 8px;
    background: #fffef8;
    box-shadow: 0 18px 40px rgba(34, 42, 27, .08);
}

.public-project-message {
    padding: 12px 14px;
    color: #31512e;
    background: #edf7e9;
    font-weight: 900;
}

.public-project-design-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(280px, .45fr);
    gap: 18px;
}

.public-project-preview {
    overflow: hidden;
    min-height: 360px;
}

.public-project-preview img {
    width: 100%;
    height: 100%;
    min-height: 360px;
    object-fit: cover;
}

.public-project-preview-placeholder {
    display: grid;
    place-items: center;
    gap: 6px;
    min-height: 360px;
    color: #68725f;
    background: #e8eadf;
    text-align: center;
}

.public-project-preview-placeholder strong {
    font-size: 4rem;
    line-height: 1;
}

.public-project-summary {
    display: grid;
    align-content: start;
    gap: 10px;
    padding: 16px;
}

.public-project-summary > div,
.public-project-quote-meta > div,
.public-project-measurements > div {
    display: grid;
    gap: 4px;
    border: 1px solid #e7e1cf;
    border-radius: 8px;
    background: #faf8ef;
    padding: 11px 12px;
}

.public-project-summary span,
.public-project-quote-meta span,
.public-project-measurements span {
    color: #747b6d;
    font-size: .8rem;
}

.public-project-summary strong,
.public-project-quote-meta strong,
.public-project-measurements strong {
    color: #27321f;
    font-weight: 900;
}

.public-project-approved {
    border-color: #cce2bf !important;
    background: #eef8e9 !important;
}

.public-project-section {
    padding: 18px;
}

.public-project-section > header {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.public-project-section h2 {
    margin: 0;
    color: #25301f;
}

.public-project-section header span {
    color: #717866;
    font-weight: 800;
}

.public-project-image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 12px;
}

.public-project-image-grid figure {
    margin: 0;
    overflow: hidden;
    border: 1px solid #e4dfcf;
    border-radius: 8px;
    background: #f8f6ed;
}

.public-project-image-grid img {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
}

.public-project-image-grid figcaption {
    padding: 8px 10px;
    color: #536049;
    font-weight: 900;
}

.public-project-quote-meta,
.public-project-measurements {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}

.public-project-quote-lines {
    width: 100%;
    border-collapse: collapse;
    overflow: hidden;
    border-radius: 8px;
}

.public-project-quote-lines th,
.public-project-quote-lines td {
    border-bottom: 1px solid #e7e1cf;
    padding: 10px;
    text-align: right;
}

.public-project-quote-lines th {
    color: #fff8df;
    background: #2f3a25;
}

.public-project-quote-lines td {
    background: #fffdf5;
    color: #394330;
}

.public-project-total {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-top: 14px;
    border-radius: 8px;
    background: #2f3a25;
    color: #fff8df;
    padding: 14px 16px;
}

.public-project-total strong {
    color: #f2d36b;
    font-size: 1.4rem;
}

.public-project-approval-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 16px;
}

.public-project-approval-form label {
    display: grid;
    gap: 6px;
    color: #374332;
    font-weight: 700;
}

.public-project-approval-form input[type="text"],
.public-project-approval-form input[type="tel"] {
    width: 100%;
    border: 1px solid #d9d4c3;
    border-radius: 8px;
    background: #fff;
    color: #25301f;
    padding: 10px 12px;
}

.public-project-approval-check,
.public-project-approval-form button {
    grid-column: 1 / -1;
}

.public-project-approval-check {
    grid-template-columns: auto 1fr !important;
    align-items: start;
}

.public-project-approval-form button {
    width: 100%;
    border: 0;
    border-radius: 8px;
    background: #d8b854;
    color: #24301f;
    padding: 13px 18px;
    font-weight: 900;
}

.public-project-approval-done {
    margin-top: 16px;
    border: 1px solid #cce2bf;
    border-radius: 8px;
    background: #eef8e9;
    color: #31512e;
    padding: 12px;
    font-weight: 900;
    text-align: center;
}

.public-project-empty-quote p,
.public-project-workshop-card span,
.public-project-workshop-card small {
    color: #68725f;
}

.public-project-workshop-card {
    display: grid;
    gap: 5px;
    border: 1px solid #e7e1cf;
    border-radius: 8px;
    background: #faf8ef;
    padding: 14px;
}

.public-project-workshop-card strong {
    color: #25301f;
}

.public-project-workshop-card a {
    width: fit-content;
    color: #365f33;
    font-weight: 800;
}

.public-project-workshop-card small {
    direction: ltr;
    text-align: left;
    overflow-wrap: anywhere;
}

@media (max-width: 860px) {
    .public-project-approval-form {
        grid-template-columns: 1fr;
    }

    .public-project-approval-check,
    .public-project-approval-form button {
        grid-column: auto;
    }

    .public-project-design-grid {
        grid-template-columns: 1fr;
    }

    .public-project-title h1 {
        font-size: clamp(2rem, 13vw, 4rem);
    }

    .public-project-preview,
    .public-project-preview img,
    .public-project-preview-placeholder {
        min-height: 260px;
    }
}

/* ===== Header collision fix ===== */
:root {
    --salwadi-header-offset: 112px;
}

.salwadi-header,
.site-header {
    overflow-x: clip;
}

.salwadi-header .page-shell {
    width: min(1680px, calc(100% - 28px));
    max-width: calc(100% - 28px);
}

.salwadi-header .container-fluid {
    gap: clamp(8px, 1vw, 14px);
}

.salwadi-brand {
    flex: 0 1 235px;
    max-width: 235px;
    min-width: 170px;
}

.salwadi-header .navbar-collapse {
    min-width: 0;
    justify-content: space-between;
}

.salwadi-nav,
.salwadi-account-nav {
    min-width: 0;
}

.salwadi-nav {
    flex: 1 1 auto;
    justify-content: center;
}

.salwadi-account-nav {
    flex: 0 1 auto;
    margin-inline-start: 0;
}

.salwadi-header .nav-link,
.account-nav-link,
.account-nav-button {
    font-size: clamp(.74rem, .78vw, .9rem);
    line-height: 1.25;
}

.salwadi-header .nav-link {
    padding-inline: clamp(5px, .48vw, 9px) !important;
}

.account-nav-button {
    padding-inline: clamp(5px, .48vw, 9px);
}

.account-profile-link {
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.upcoming-nav-link {
    gap: 4px;
}

.upcoming-nav-link small {
    padding: 2px 6px;
    font-size: .58rem;
}

.salwadi-account-nav .nav-cta {
    min-height: 38px;
    padding: 7px 10px;
    font-size: clamp(.72rem, .76vw, .84rem);
    white-space: nowrap;
}

.billing-page,
.workshop-page,
.account-page,
.projects-page,
.account-profile-page,
.project-images-page {
    padding-top: calc(var(--salwadi-header-offset) + 28px) !important;
}

.account-page {
    padding-bottom: 72px !important;
}

@media (max-width: 1500px) and (min-width: 1200px) {
    .salwadi-brand {
        max-width: 190px;
        min-width: 150px;
    }

    .brand-logo {
        width: 50px;
        height: 46px;
    }

    .brand-copy strong {
        font-size: .92rem;
    }

    .brand-copy small {
        display: none;
    }

    .salwadi-nav {
        gap: 0;
    }

    .salwadi-account-nav {
        gap: 2px;
    }

    .account-profile-link {
        max-width: 132px;
    }
}

@media (max-width: 1280px) and (min-width: 1200px) {
    .brand-copy {
        display: none;
    }

    .salwadi-brand {
        max-width: 64px;
        min-width: 56px;
    }

    .brand-logo {
        width: 48px;
        height: 44px;
    }

    .salwadi-header .nav-link,
    .account-nav-link,
    .account-nav-button {
        font-size: .72rem;
    }

    .salwadi-account-nav .nav-cta {
        max-width: 148px;
        line-height: 1.2;
        text-align: center;
        white-space: normal;
    }
}

@media (max-width: 1199.98px) {
    :root {
        --salwadi-header-offset: 96px;
    }

    .salwadi-header .page-shell {
        width: min(100% - 24px, 1180px);
        max-width: calc(100% - 24px);
    }

    .salwadi-brand {
        max-width: none;
        min-width: 0;
    }

    .brand-copy {
        display: grid;
    }

    .salwadi-header .navbar-collapse {
        margin-top: 10px;
        padding: 10px;
        border-top: 1px solid rgba(212, 175, 82, .22);
        border-radius: 0 0 12px 12px;
        background: rgba(32, 41, 26, .98);
    }

    .salwadi-nav,
    .salwadi-account-nav {
        align-items: stretch;
        flex-direction: column;
        white-space: normal;
    }

    .salwadi-account-nav {
        margin-inline-start: 0;
        padding-top: 8px;
    }

    .salwadi-header .nav-link,
    .account-nav-button,
    .salwadi-account-nav .nav-cta {
        justify-content: center;
        width: 100%;
        text-align: center;
    }

    .account-profile-link {
        max-width: none;
    }
}

/* ===== Header nav regrouping ===== */
.salwadi-header .navbar-collapse {
    justify-content: flex-start;
}

.salwadi-nav {
    flex: 0 0 auto;
    justify-content: flex-start;
    margin-inline-start: 0;
    margin-inline-end: 0;
}

.salwadi-account-nav {
    flex: 0 0 auto;
    margin-inline-start: auto;
    margin-inline-end: 0;
}

.account-menu {
    position: relative;
}

.account-menu-toggle {
    display: inline-flex !important;
    align-items: center;
    gap: 7px;
    min-width: 104px;
    min-height: 38px;
    border: 1px solid rgba(212, 175, 82, .36) !important;
    border-radius: 999px;
    background: rgba(255, 255, 255, .045) !important;
    color: rgba(255, 255, 255, .88) !important;
    padding: 7px 12px !important;
    font-weight: 900;
    white-space: nowrap;
}

.account-menu-toggle::after {
    margin-inline-start: .18rem;
    margin-inline-end: 0;
}

.account-menu-toggle:hover,
.account-menu-toggle:focus,
.account-menu.show .account-menu-toggle {
    border-color: rgba(212, 175, 82, .62) !important;
    background: rgba(212, 175, 82, .13) !important;
    color: var(--gold-soft) !important;
}

.account-dropdown-menu {
    min-width: 218px;
    margin-top: 10px !important;
    padding: 8px;
    border: 1px solid rgba(212, 175, 82, .38);
    border-radius: 12px;
    background: rgba(32, 41, 26, .98);
    box-shadow: 0 18px 44px rgba(8, 12, 6, .34);
    text-align: start;
}

.account-dropdown-item,
.account-dropdown-button {
    display: flex;
    align-items: center;
    gap: 9px;
    min-height: 38px;
    border-radius: 8px;
    color: rgba(255, 255, 255, .88);
    background: transparent;
    font-weight: 850;
}

.account-dropdown-item:hover,
.account-dropdown-item:focus,
.account-dropdown-button:hover,
.account-dropdown-button:focus {
    color: var(--gold-soft);
    background: rgba(212, 175, 82, .12);
}

.account-menu-emoji {
    flex: 0 0 auto;
    width: 1.25em;
    color: currentColor;
    text-align: center;
    font-family: "Segoe UI Symbol", "Segoe UI", Tahoma, Arial, sans-serif;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 0 currentColor;
}

.account-dropdown-menu form {
    margin: 0;
}

.account-dropdown-menu .dropdown-divider {
    border-color: rgba(212, 175, 82, .18);
    margin: 6px 4px;
}

.account-dropdown-menu .account-profile-link {
    display: inline-block;
    max-width: 148px;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: bottom;
    white-space: nowrap;
}

@media (max-width: 1500px) and (min-width: 1200px) {
    .salwadi-nav {
        margin-inline-start: 0;
    }
}

@media (max-width: 1280px) and (min-width: 1200px) {
    .salwadi-nav {
        margin-inline-start: 10px;
    }

    .account-menu-toggle {
        padding-inline: 10px !important;
    }
}

@media (max-width: 1199.98px) {
    .salwadi-nav,
    .salwadi-account-nav {
        margin-inline: 0;
    }

    .account-menu-toggle {
        justify-content: center;
        width: 100%;
        border-radius: 8px;
    }

    .account-dropdown-menu {
        position: static !important;
        width: 100%;
        margin-top: 6px !important;
        transform: none !important;
    }
}

/* ===== Single header menu ===== */
.salwadi-menu {
    position: relative;
    flex: 0 0 auto;
    margin-inline-start: auto;
    margin-inline-end: 0;
}

.salwadi-main-nav {
    display: flex;
    flex: 0 0 auto;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    margin-inline-start: 0;
    margin-inline-end: 0;
}

.salwadi-menu-toggle {
    display: inline-flex !important;
    align-items: center;
    gap: 10px;
    min-height: 42px;
    border: 1px solid rgba(212, 175, 82, .52) !important;
    border-radius: 999px;
    background: rgba(255, 255, 255, .045) !important;
    color: rgba(255, 255, 255, .9) !important;
    padding: 8px 15px !important;
    font-weight: 950;
    line-height: 1;
    white-space: nowrap;
}

.salwadi-menu-toggle::after {
    display: none;
}

.salwadi-menu-toggle:hover,
.salwadi-menu-toggle:focus,
.salwadi-menu.show .salwadi-menu-toggle {
    border-color: rgba(212, 175, 82, .76) !important;
    background: rgba(212, 175, 82, .14) !important;
    color: var(--gold-soft) !important;
}

.menu-lines {
    display: inline-grid;
    gap: 4px;
    width: 22px;
    color: currentColor;
}

.menu-lines span {
    display: block;
    width: 22px;
    height: 2px;
    border-radius: 999px;
    background: currentColor;
}

.salwadi-menu-dropdown {
    min-width: 290px;
    margin-top: 12px !important;
    padding: 9px;
    border: 1px solid rgba(212, 175, 82, .42);
    border-radius: 13px;
    background: rgba(32, 41, 26, .985);
    box-shadow: 0 20px 48px rgba(8, 12, 6, .36);
    text-align: start;
}

.salwadi-menu-item,
.salwadi-menu-button {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 40px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: rgba(255, 255, 255, .9);
    font-weight: 900;
    line-height: 1.25;
}

.salwadi-menu-item:hover,
.salwadi-menu-item:focus,
.salwadi-menu-button:hover,
.salwadi-menu-button:focus {
    color: var(--gold-soft);
    background: rgba(212, 175, 82, .12);
}

.salwadi-menu-item small {
    margin-inline-start: auto;
    border: 1px solid rgba(212, 175, 82, .38);
    border-radius: 999px;
    padding: 2px 7px;
    color: currentColor;
    font-size: .62rem;
    font-weight: 850;
}

.salwadi-menu-dropdown form {
    margin: 0;
}

.salwadi-menu-dropdown .dropdown-divider {
    border-color: rgba(212, 175, 82, .18);
    margin: 7px 5px;
}

.salwadi-menu-dropdown .account-profile-link {
    display: inline-block;
    max-width: 190px;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: bottom;
    white-space: nowrap;
}

@media (max-width: 575.98px) {
    .salwadi-main-nav {
        display: none;
    }

    .salwadi-menu-toggle {
        padding-inline: 12px !important;
    }

    .salwadi-menu-dropdown {
        min-width: min(290px, calc(100vw - 28px));
    }
}

/* =========================================================
   Phase 6B v2.2 — persistent account tools + customer directory
   ========================================================= */
.salwadi-user-tools {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-inline-start: auto;
    min-width: 0;
}

.header-quick-stack {
    display: grid;
    grid-template-columns: 1fr;
    gap: 4px;
    flex: 0 0 auto;
}

.header-quick-stack a {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-width: 90px;
    min-height: 29px;
    padding: 4px 9px;
    border: 1px solid rgba(217,184,111,.42);
    border-radius: 8px;
    background: rgba(255,255,255,.055);
    color: rgba(255,255,255,.92);
    font-size: .74rem;
    line-height: 1;
    text-decoration: none;
}

.header-quick-stack a:hover,
.header-quick-stack a:focus {
    border-color: rgba(217,184,111,.78);
    background: rgba(217,184,111,.14);
    color: #fff2cc;
}

.header-account-card,
.header-login-card {
    display: grid;
    grid-template-columns: 42px minmax(80px, 1fr) auto;
    align-items: center;
    gap: 9px;
    min-height: 48px;
    padding: 5px 8px;
    border: 1px solid rgba(217,184,111,.34);
    border-radius: 12px;
    background: rgba(255,255,255,.055);
    color: #fff;
    text-decoration: none;
    min-width: 225px;
    max-width: 315px;
}

.header-login-card {
    grid-template-columns: 42px minmax(100px,1fr);
    min-width: 190px;
}

.header-account-card:hover,
.header-account-card:focus,
.header-login-card:hover,
.header-login-card:focus {
    border-color: rgba(217,184,111,.72);
    background: rgba(217,184,111,.11);
    color: #fff;
}

.header-account-avatar {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    overflow: hidden;
    border: 1px solid rgba(217,184,111,.7);
    border-radius: 50%;
    background: linear-gradient(145deg,#45533c,#1d281f);
    color: #fff1c9;
    font-size: .9rem;
    font-weight: 950;
    box-shadow: inset 0 0 0 2px rgba(255,255,255,.06);
}

.header-account-copy,
.header-login-card > span:last-child {
    display: grid;
    min-width: 0;
    line-height: 1.2;
}

.header-account-copy strong,
.header-login-card strong {
    overflow: hidden;
    font-size: .78rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.header-account-copy small,
.header-login-card small {
    margin-top: 3px;
    color: rgba(255,255,255,.62);
    font-size: .63rem;
}

.header-credit-pill {
    display: grid;
    grid-template-columns: auto auto;
    align-items: center;
    gap: 3px 5px;
    min-width: 60px;
    padding: 4px 7px;
    border-radius: 9px;
    background: rgba(217,184,111,.15);
    color: #f6d785;
    text-align: center;
}

.header-credit-pill strong {
    font-size: .82rem;
}

.header-credit-pill small {
    grid-column: 1 / -1;
    color: rgba(255,255,255,.58);
    font-size: .52rem;
    line-height: 1;
}

/* Customer directory */
.customer-directory-page {
    padding-top: calc(var(--salwadi-header-offset) + 30px) !important;
    padding-bottom: 80px;
    color: #213127;
}

.customer-directory-hero {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 22px;
}

.customer-directory-hero h1 {
    margin: 2px 0 6px;
    color: #17261d;
    font-size: clamp(2rem,4vw,3.2rem);
    font-weight: 950;
}

.customer-directory-hero p {
    max-width: 780px;
    margin: 0;
    color: #627067;
}

.customer-hero-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 9px 14px;
    border: 1px solid #263a2d;
    border-radius: 10px;
    background: #263a2d;
    color: #fff;
    font-weight: 900;
}

.customer-message,
.customer-empty {
    margin-bottom: 18px;
    padding: 15px 18px;
    border: 1px solid #d7bf7b;
    border-radius: 14px;
    background: #fff8df;
}

.customer-empty {
    text-align: center;
}

.customer-empty.compact {
    margin: 0;
    border-color: #ded7c8;
    background: #fbfaf6;
}

.customer-summary-grid {
    display: grid;
    grid-template-columns: repeat(4,minmax(0,1fr));
    gap: 12px;
    margin-bottom: 18px;
}

.customer-summary-grid article {
    display: grid;
    gap: 5px;
    padding: 15px 17px;
    border: 1px solid #ded7c8;
    border-radius: 14px;
    background: #fffdf8;
    box-shadow: 0 9px 26px rgba(34,48,39,.05);
}

.customer-summary-grid span {
    color: #778078;
    font-size: .82rem;
    font-weight: 750;
}

.customer-summary-grid strong {
    color: #21372a;
    font-size: 1.22rem;
}

.customer-summary-grid .is-money {
    border-color: #d9c17b;
    background: #fffbec;
}

.customer-directory-grid {
    display: grid;
    grid-template-columns: minmax(280px,.78fr) minmax(520px,1.5fr);
    gap: 16px;
    align-items: start;
}

.customer-create-card,
.customer-list-card {
    padding: 20px;
    border: 1px solid #ded7c8;
    border-radius: 16px;
    background: #fffdf8;
    box-shadow: 0 12px 32px rgba(34,48,39,.06);
}

.customer-create-card > header,
.customer-list-card > header {
    margin-bottom: 14px;
}

.customer-create-card h2,
.customer-list-card h2 {
    margin: 2px 0 0;
    color: #203328;
    font-weight: 950;
}

.customer-section-kicker {
    color: #9b7422;
    font-size: .76rem;
    font-weight: 900;
}

.customer-form-grid {
    display: grid;
    grid-template-columns: repeat(2,minmax(0,1fr));
    gap: 10px;
}

.customer-form-grid.compact {
    padding-top: 14px;
    border-top: 1px solid #ebe7dc;
}

.customer-form-grid label {
    display: grid;
    gap: 5px;
}

.customer-form-grid label > span {
    color: #6a756d;
    font-size: .78rem;
    font-weight: 800;
}

.customer-form-grid input,
.customer-form-grid textarea {
    width: 100%;
    min-height: 40px;
    padding: 9px 10px;
    border: 1px solid #d8d9d3;
    border-radius: 9px;
    background: #fff;
    color: #1d2c22;
    outline: none;
}

.customer-form-grid input:focus,
.customer-form-grid textarea:focus {
    border-color: #b99a47;
    box-shadow: 0 0 0 3px rgba(185,154,71,.12);
}

.customer-form-grid .span-all {
    grid-column: 1 / -1;
}

.customer-money-field input {
    border-color: #d7c07d;
    background: #fffdf2;
}

.customer-save-button {
    grid-column: 1 / -1;
    min-height: 42px;
    border: 0;
    border-radius: 10px;
    background: #263a2d;
    color: #fff;
    font-weight: 900;
}

.customer-card-list {
    display: grid;
    gap: 10px;
}

.customer-card {
    overflow: hidden;
    border: 1px solid #e0ddd3;
    border-radius: 13px;
    background: #fff;
}

.customer-card > summary {
    display: grid;
    grid-template-columns: 44px minmax(130px,1.4fr) repeat(2,minmax(70px,.55fr)) minmax(120px,.8fr);
    align-items: center;
    gap: 10px;
    padding: 12px;
    cursor: pointer;
    list-style: none;
}

.customer-card > summary::-webkit-details-marker { display:none; }

.customer-card[open] > summary {
    background: #f6f7f3;
}

.customer-avatar {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #304636;
    color: #fff3d0;
    font-weight: 950;
}

.customer-card-title {
    display: grid;
    min-width: 0;
}

.customer-card-title strong {
    overflow: hidden;
    color: #203328;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.customer-card-title small,
.customer-card-metric small,
.customer-card-balance small {
    color: #7b837e;
    font-size: .72rem;
}

.customer-card-metric,
.customer-card-balance {
    display: grid;
    gap: 2px;
}

.customer-card-balance.has-balance strong { color:#9a4d20; }

.customer-history-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    padding: 10px 12px;
    border-top: 1px solid #ebe7dc;
    border-bottom: 1px solid #ebe7dc;
    background: #fffaf0;
}

.customer-history-strip span {
    padding: 4px 8px;
    border-radius: 999px;
    background: #fff;
    color: #657168;
    font-size: .75rem;
}

.customer-card .customer-form-grid,
.customer-delete-form {
    margin: 12px;
}

.customer-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.customer-card-actions .customer-save-button {
    grid-column: auto;
    padding-inline: 16px;
}

.customer-card-actions a {
    display: inline-flex;
    align-items: center;
    min-height: 42px;
    padding: 8px 13px;
    border: 1px solid #b99a47;
    border-radius: 10px;
    color: #425044;
    font-weight: 850;
}

.customer-delete-form button {
    border: 0;
    background: transparent;
    color: #a74135;
    font-size: .78rem;
}

@media (max-width: 1250px) {
    .salwadi-main-nav { display:none; }
    .header-account-card { min-width: 205px; }
}

@media (max-width: 920px) {
    .customer-summary-grid { grid-template-columns:1fr 1fr; }
    .customer-directory-grid { grid-template-columns:1fr; }
    .header-account-copy { display:none; }
    .header-account-card { min-width:auto; grid-template-columns:42px auto; }
}

@media (max-width: 700px) {
    .salwadi-header .page-shell { gap:6px; }
    .salwadi-brand { flex:0 0 auto; min-width:48px; max-width:54px; }
    .salwadi-brand .brand-copy { display:none; }
    .brand-logo { width:44px; height:40px; }
    .header-quick-stack { grid-template-columns:1fr 1fr; position:absolute; top:69px; inset-inline:12px; }
    .header-quick-stack a { min-width:0; background:#253223; box-shadow:0 8px 20px rgba(0,0,0,.15); }
    .header-account-card { padding:4px; }
    .header-credit-pill small { display:none; }
    .salwadi-menu-toggle > span:last-child { display:none; }
    .salwadi-menu-toggle { min-width:46px; padding-inline:11px !important; }
    .customer-directory-page { padding-top:calc(var(--salwadi-header-offset) + 64px) !important; }
    .customer-directory-hero { align-items:stretch; flex-direction:column; }
    .customer-summary-grid { grid-template-columns:1fr 1fr; }
    .customer-card > summary { grid-template-columns:40px 1fr auto; }
    .customer-card-metric { display:none; }
    .customer-card-balance { grid-column:auto; }
}

@media (max-width: 520px) {
    .header-account-avatar { width:36px; height:36px; }
    .header-account-card { grid-template-columns:36px auto; }
    .header-credit-pill { min-width:48px; padding-inline:5px; }
    .customer-summary-grid,
    .customer-form-grid { grid-template-columns:1fr; }
    .customer-form-grid .span-all,
    .customer-save-button { grid-column:1; }
    .customer-card > summary { grid-template-columns:38px 1fr; }
    .customer-card-balance { grid-column:2; }
}

/* Phase 7 — customer sharing hardening */
.project-share-validity {
    display: grid;
    gap: .25rem;
    margin: .55rem 0;
    padding: .65rem .75rem;
    border: 1px solid rgba(197, 161, 73, .28);
    border-radius: 12px;
    background: rgba(255, 255, 255, .035);
}
.project-share-validity span { font-weight: 800; }
.project-share-validity small { opacity: .72; line-height: 1.6; }
.project-share-validity.expired,
.project-share-heading span.expired {
    border-color: rgba(205, 78, 78, .42);
    color: #ffb6b6;
}
.public-project-link-notice {
    padding: .8rem 1rem;
    border: 1px solid rgba(197, 161, 73, .34);
    border-radius: 14px;
    background: rgba(197, 161, 73, .08);
    line-height: 1.7;
}
.public-project-print-button {
    border: 1px solid rgba(197, 161, 73, .6);
    border-radius: 10px;
    padding: .65rem .9rem;
    background: #c5a149;
    color: #162015;
    font: inherit;
    font-weight: 900;
    cursor: pointer;
}
.public-share-expired-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 2rem;
    background: radial-gradient(circle at top, #2a3927 0%, #10170f 62%);
}
.public-share-expired-card {
    width: min(620px, 100%);
    padding: 2rem;
    border: 1px solid rgba(197, 161, 73, .34);
    border-radius: 24px;
    background: rgba(20, 30, 19, .94);
    color: #f8f3e6;
    text-align: center;
    box-shadow: 0 28px 70px rgba(0,0,0,.34);
}
.public-share-expired-card img { width: 110px; height: auto; margin-bottom: 1rem; }
.public-share-expired-card h1 { margin: .25rem 0 .8rem; }
.public-share-expired-card p { line-height: 1.8; }
.public-share-expired-card small { display: block; opacity: .75; margin-top: .5rem; }
.public-share-expired-note { margin-top: 1.2rem; padding: 1rem; border-radius: 14px; background: rgba(197,161,73,.09); }
.approval-receipt-page { padding-block: 2rem 4rem; }
.approval-receipt-header { display:flex; justify-content:space-between; gap:1rem; align-items:flex-start; margin-bottom:1.25rem; }
.approval-receipt-card {
    display:grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .8rem;
    padding: 1.2rem;
    border: 1px solid rgba(197,161,73,.25);
    border-radius: 18px;
    background: rgba(255,255,255,.03);
}
.approval-receipt-card > div { display:grid; gap:.3rem; padding:.9rem; border-radius:12px; background:rgba(0,0,0,.12); }
.approval-receipt-card span { opacity:.7; font-size:.88rem; }
.approval-receipt-wide { grid-column: 1 / -1; }
.approval-receipt-wide code { direction:ltr; unicode-bidi:plaintext; white-space:pre-wrap; overflow-wrap:anywhere; }
.approval-receipt-warning { margin-top:1rem; padding:1rem; border-radius:12px; background:rgba(197,161,73,.08); line-height:1.7; }
@media (max-width: 760px) {
    .approval-receipt-header { flex-direction:column; }
    .approval-receipt-card { grid-template-columns: 1fr; }
    .approval-receipt-wide { grid-column:auto; }
}
@media print {
    .public-project-print-button,
    .public-project-link-notice,
    .public-project-approval-form,
    .public-project-image-grid,
    .public-project-preview,
    .public-project-message { display:none !important; }
    .public-project-page,
    .public-project-shell { background:#fff !important; color:#111 !important; }
    .public-project-section,
    .public-project-summary,
    .public-project-workshop-card { box-shadow:none !important; border-color:#ccc !important; }
}

/* Phase 7 v2 - permanent design sharing + public read-only viewer */
.public-project-viewer-section { overflow: hidden; }
.public-project-viewer {
    position: relative;
    width: 100%;
    min-height: 520px;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border: 1px solid rgba(185, 154, 71, .42);
    border-radius: 20px;
    background: #171d16;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.03);
}
.public-project-viewer #publicProjectCanvas {
    position: absolute;
    inset: 0;
    z-index: 2;
    width: 100%;
    height: 100%;
    background: transparent;
    cursor: grab;
    touch-action: none;
}
.public-project-viewer #publicProjectCanvas.dragging { cursor: grabbing; }
.public-project-viewer .designer-webgl-overlay { z-index: 1; }
.public-project-viewer-status {
    position: absolute;
    z-index: 4;
    right: 16px;
    bottom: 16px;
    padding: 9px 13px;
    border-radius: 999px;
    color: #f9f2d5;
    background: rgba(21, 29, 20, .82);
    border: 1px solid rgba(185,154,71,.35);
    font-size: .82rem;
    pointer-events: none;
}
.public-project-viewer-status.ready { opacity: .82; }
.public-project-viewer-status.error { color: #ffe2dc; border-color: rgba(197,94,74,.55); }
.public-project-viewer-fallback { margin-top: 12px; }
.public-project-viewer-fallback summary { cursor: pointer; font-weight: 800; color: #566047; }
.public-project-viewer-fallback img { display: block; width: min(100%, 900px); margin-top: 12px; border-radius: 16px; }
.public-project-realistic-cta p { margin: 0 0 18px; color: #62685d; line-height: 1.9; }
.public-project-auth-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.public-project-primary-action,
.public-project-secondary-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 10px 18px;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 900;
}
.public-project-primary-action { background: #2f442f; color: #fff8df; border: 1px solid #b99a47; }
.public-project-secondary-action { background: #fff; color: #2f442f; border: 1px solid rgba(47,68,47,.25); }
.public-project-quote-external-note {
    display: grid;
    gap: 6px;
    margin-top: 18px;
    padding: 15px 18px;
    border-radius: 14px;
    background: #f5f1e7;
    color: #586051;
}
.public-project-quote-external-note strong { color: #273a2a; }
.project-share-plan-lock {
    display: grid;
    gap: 6px;
    padding: 14px;
    border: 1px solid rgba(185,154,71,.35);
    border-radius: 14px;
    background: rgba(185,154,71,.08);
}
.project-share-plan-lock strong { color: #e2cc82; }
.project-share-plan-lock p { margin: 0; }
.project-share-plan-lock a { width: fit-content; }
.quote-pdf-note {
    margin: 14px 0 0;
    padding: 12px 14px;
    border-radius: 12px;
    background: rgba(185,154,71,.1);
    color: #59604f;
    font-size: .9rem;
}
@media (max-width: 760px) {
    .public-project-viewer { min-height: 360px; aspect-ratio: 4 / 3; }
    .public-project-viewer-status { right: 10px; left: 10px; bottom: 10px; text-align: center; border-radius: 12px; }
}

/* ===== Phase 9B mobile designer UX foundation ===== */
.mobile-library-drag-ghost {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 2147483000;
    width: 168px;
    max-width: 46vw;
    padding: 9px 11px;
    pointer-events: none;
    color: #26311f;
    background: rgba(255, 252, 242, .96);
    border: 1px solid rgba(212, 175, 82, .72);
    border-radius: 12px;
    box-shadow: 0 16px 42px rgba(0, 0, 0, .34);
    opacity: .94;
}
.mobile-library-drag-ghost strong,
.mobile-library-drag-ghost span,
.mobile-library-drag-ghost small { display: block; }
.mobile-library-drag-ghost strong { font-size: .9rem; }
.mobile-library-drag-ghost span,
.mobile-library-drag-ghost small { margin-top: 2px; font-size: .72rem; color: #66705e; }

@media (max-width: 760px) {
    html:has(body.designer-shell),
    body.designer-shell,
    body.designer-shell .kitchen-editor-page {
        width: 100% !important;
        height: 100dvh !important;
        min-height: 100dvh !important;
        overflow: hidden !important;
    }

    body.designer-shell .room-workspace,
    body.designer-shell .editor-workspace,
    body.designer-shell .room-workspace.library-collapsed,
    body.designer-shell .room-workspace.properties-collapsed,
    body.designer-shell .room-workspace.library-collapsed.properties-collapsed {
        position: relative !important;
        display: block !important;
        width: 100% !important;
        height: 100% !important;
        min-height: 0 !important;
        padding: 0 !important;
        overflow: hidden !important;
    }

    body.designer-shell .room-stage,
    body.designer-shell .editor-workspace .room-stage {
        position: absolute !important;
        inset: 0 !important;
        z-index: 1 !important;
        width: 100% !important;
        height: 100% !important;
        min-height: 0 !important;
        border-radius: 0 !important;
    }

    body.designer-shell .designer-canvas {
        inset: 0 !important;
        width: 100% !important;
        height: 100% !important;
        touch-action: none !important;
    }

    /* Compact floating toolbar instead of a stack that crushes the canvas. */
    body.designer-shell .room-toolbar,
    body.designer-shell .stage-toolbar {
        top: 7px !important;
        right: 7px !important;
        left: 7px !important;
        display: grid !important;
        grid-template-columns: auto minmax(0, 1fr) auto !important;
        grid-template-areas:
            "brand actions dimensions"
            "ai ai ai" !important;
        align-items: center !important;
        gap: 5px 6px !important;
        padding: 5px 6px !important;
        border-radius: 12px !important;
        background: rgba(25, 34, 21, .88) !important;
        box-shadow: 0 8px 24px rgba(0, 0, 0, .22) !important;
        backdrop-filter: blur(12px) !important;
    }

    body.designer-shell .designer-brand-chip {
        grid-area: brand !important;
        width: 34px !important;
        min-width: 34px !important;
        height: 34px !important;
        padding: 0 !important;
        justify-content: center !important;
    }
    body.designer-shell .designer-brand-chip img { width: 32px !important; height: 28px !important; }
    body.designer-shell .designer-brand-chip span { display: none !important; }

    body.designer-shell .stage-actions {
        grid-area: actions !important;
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        gap: 4px !important;
        min-width: 0 !important;
        overflow-x: auto !important;
        scrollbar-width: none !important;
    }
    body.designer-shell .stage-actions::-webkit-scrollbar { display: none !important; }
    body.designer-shell .stage-actions > button,
    body.designer-shell .stage-actions > a {
        flex: 0 0 auto !important;
        width: 34px !important;
        min-width: 34px !important;
        height: 34px !important;
        min-height: 34px !important;
        padding: 0 !important;
        display: inline-grid !important;
        place-items: center !important;
        border-radius: 9px !important;
        font-size: .76rem !important;
    }
    body.designer-shell #resetRoomButton { font-size: 0 !important; }
    body.designer-shell #resetRoomButton::after { content: "↺"; font-size: 1.05rem; font-weight: 900; }
    body.designer-shell .designer-projects-link:not(.designer-projects-icon) {
        width: auto !important;
        padding-inline: 8px !important;
        white-space: nowrap !important;
    }

    body.designer-shell .room-dimensions-display {
        grid-area: dimensions !important;
        min-width: 70px !important;
        max-width: 88px !important;
        text-align: center !important;
        line-height: 1.05 !important;
    }
    body.designer-shell .room-dimensions-display span { font-size: .58rem !important; }
    body.designer-shell .room-dimensions-display strong { font-size: .66rem !important; white-space: nowrap !important; }

    body.designer-shell .stage-ai-zone {
        grid-area: ai !important;
        display: block !important;
        min-width: 0 !important;
        overflow: hidden !important;
    }
    body.designer-shell .ai-render-controls {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 5px !important;
        width: 100% !important;
        min-width: 0 !important;
        overflow-x: auto !important;
        scrollbar-width: none !important;
    }
    body.designer-shell .ai-render-controls::-webkit-scrollbar { display: none !important; }
    body.designer-shell .stage-ai-button,
    body.designer-shell .ai-render-button {
        min-width: 88px !important;
        min-height: 34px !important;
        height: 34px !important;
        padding: 4px 8px !important;
        font-size: .68rem !important;
    }
    body.designer-shell .ai-single-split { flex: 0 0 auto !important; }
    body.designer-shell .ai-side-picker { min-height: 34px !important; }
    body.designer-shell .ai-credit-badge {
        flex: 0 0 auto !important;
        min-height: 32px !important;
        padding: 5px 7px !important;
        font-size: .62rem !important;
        white-space: nowrap !important;
    }
    body.designer-shell .ai-queue-progress { margin-top: 4px !important; }
    body.designer-shell .ai-render-previews { margin-top: 4px !important; overflow-x: auto !important; }

    /* Mobile panels are overlays over the same 3D page, never grid rows. */
    body.designer-shell .library-panel,
    body.designer-shell .properties-panel {
        position: absolute !important;
        right: 8px !important;
        left: 8px !important;
        z-index: 70 !important;
        width: auto !important;
        min-width: 0 !important;
        height: auto !important;
        margin: 0 !important;
        padding: 8px !important;
        overflow-x: hidden !important;
        overflow-y: auto !important;
        overscroll-behavior: contain !important;
        border: 1px solid rgba(212, 175, 82, .34) !important;
        border-radius: 16px !important;
        background: rgba(250, 247, 238, .985) !important;
        box-shadow: 0 20px 55px rgba(0, 0, 0, .36) !important;
        backdrop-filter: blur(12px) !important;
        transition: transform 160ms ease, opacity 160ms ease !important;
    }
    body.designer-shell .library-panel {
        top: 104px !important;
        bottom: auto !important;
        max-height: min(52dvh, 470px) !important;
    }
    body.designer-shell .properties-panel {
        top: auto !important;
        bottom: 60px !important;
        max-height: min(58dvh, 520px) !important;
    }
    body.designer-shell .library-panel .panel-title,
    body.designer-shell .properties-panel .panel-title { display: none !important; }

    body.designer-shell .room-workspace:not(.library-collapsed) .library-edge-toggle,
    body.designer-shell .room-workspace:not(.properties-collapsed) .properties-edge-toggle {
        position: sticky !important;
        top: 0 !important;
        right: auto !important;
        left: auto !important;
        z-index: 90 !important;
        width: 100% !important;
        height: 40px !important;
        min-height: 40px !important;
        margin: 0 0 8px !important;
        transform: none !important;
        flex-direction: row !important;
        border-radius: 11px !important;
        background: #fffdf7 !important;
    }

    body.designer-shell .room-workspace.library-collapsed .library-panel,
    body.designer-shell .room-workspace.properties-collapsed .properties-panel {
        width: 154px !important;
        min-width: 154px !important;
        height: 42px !important;
        min-height: 42px !important;
        max-height: 42px !important;
        padding: 0 !important;
        overflow: visible !important;
        border: 0 !important;
        background: transparent !important;
        box-shadow: none !important;
        pointer-events: none !important;
    }
    body.designer-shell .room-workspace.library-collapsed .library-panel {
        top: 104px !important;
        right: auto !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
    }
    body.designer-shell .room-workspace.properties-collapsed .properties-panel {
        top: auto !important;
        right: auto !important;
        bottom: 8px !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
    }
    body.designer-shell .room-workspace.library-collapsed .library-panel > :not(.panel-edge-toggle),
    body.designer-shell .room-workspace.properties-collapsed .properties-panel > :not(.panel-edge-toggle) {
        display: none !important;
    }
    body.designer-shell .room-workspace.library-collapsed .library-edge-toggle,
    body.designer-shell .room-workspace.properties-collapsed .properties-edge-toggle {
        position: absolute !important;
        inset: 0 !important;
        z-index: 100 !important;
        display: flex !important;
        width: 154px !important;
        height: 42px !important;
        min-height: 42px !important;
        padding: 5px 12px !important;
        margin: 0 !important;
        transform: none !important;
        flex-direction: row !important;
        gap: 8px !important;
        pointer-events: auto !important;
        border-radius: 999px !important;
        background: rgba(255, 253, 247, .97) !important;
        box-shadow: 0 8px 25px rgba(0, 0, 0, .24) !important;
    }
    body.designer-shell .panel-edge-toggle-arrow {
        width: 26px !important;
        height: 26px !important;
        border-radius: 50% !important;
        flex: 0 0 26px !important;
    }
    body.designer-shell .panel-edge-toggle-label {
        font-size: .76rem !important;
        writing-mode: horizontal-tb !important;
    }

    body.designer-shell .object-library {
        max-height: calc(min(52dvh, 470px) - 56px) !important;
        padding: 0 2px 8px !important;
        touch-action: pan-y !important;
    }
    body.designer-shell .library-section-body {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 7px !important;
    }
    body.designer-shell .object-library button {
        min-height: 76px !important;
        padding: 8px !important;
        touch-action: pan-y !important;
        user-select: none !important;
        -webkit-user-select: none !important;
    }

    body.designer-shell .properties-panel .control-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 8px !important;
    }
    body.designer-shell .properties-tabs {
        display: flex !important;
        gap: 5px !important;
        overflow-x: auto !important;
        scrollbar-width: none !important;
    }
    body.designer-shell .properties-tabs::-webkit-scrollbar { display: none !important; }
    body.designer-shell .properties-tabs button {
        flex: 0 0 auto !important;
        min-height: 38px !important;
        padding: 6px 9px !important;
        white-space: nowrap !important;
    }

    body.designer-shell .selection-toolbar {
        right: 7px !important;
        bottom: 54px !important;
        left: 7px !important;
        width: auto !important;
        max-width: none !important;
        min-height: 42px !important;
        padding: 5px 6px !important;
        flex-wrap: nowrap !important;
        justify-content: flex-start !important;
        gap: 4px !important;
        overflow-x: auto !important;
        scrollbar-width: none !important;
        border-radius: 11px !important;
    }
    body.designer-shell .selection-toolbar::-webkit-scrollbar { display: none !important; }
    body.designer-shell .selection-toolbar span { display: none !important; }
    body.designer-shell .selection-toolbar strong {
        flex: 0 0 auto !important;
        max-width: 108px !important;
        font-size: .65rem !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }
    body.designer-shell .selection-toolbar button {
        flex: 0 0 auto !important;
        min-height: 32px !important;
        height: 32px !important;
        padding: 4px 8px !important;
        font-size: .64rem !important;
        white-space: nowrap !important;
    }
    body.designer-shell .room-stage:not(.has-selection) .selection-toolbar {
        width: auto !important;
        left: 7px !important;
    }

    body.designer-shell .room-stage.mobile-drop-target::after {
        content: "اترك العنصر هنا";
        position: absolute;
        inset: 112px 18px 112px;
        z-index: 45;
        display: grid;
        place-items: center;
        color: #fff7d8;
        background: rgba(52, 68, 41, .16);
        border: 2px dashed rgba(212, 175, 82, .82);
        border-radius: 18px;
        pointer-events: none;
        font-weight: 900;
        backdrop-filter: blur(1px);
    }
}

@media (max-width: 760px) {
    body.designer-shell .mobile-library-hint {
        position: sticky;
        top: 0;
        z-index: 3;
        margin: 0 0 7px;
        padding: 7px 9px;
        color: #5f674f;
        background: #f7f0dc;
        border: 1px solid rgba(212,175,82,.28);
        border-radius: 9px;
        font-size: .68rem;
        font-weight: 800;
        line-height: 1.5;
    }
}

/* ===== Phase 9B v1.2 mobile layout polish =====
   Keeps the 3D canvas as the primary surface. The library remains a top overlay,
   components become a compact bottom sheet, and both toolbars get deterministic
   mobile layouts instead of squeezing desktop controls into a narrow viewport. */
@media (max-width: 760px) {
    body.designer-shell .room-toolbar,
    body.designer-shell .stage-toolbar {
        top: 6px !important;
        right: 8px !important;
        left: 8px !important;
        grid-template-columns: minmax(0, 1fr) 82px !important;
        grid-template-areas:
            "actions dimensions"
            "ai ai" !important;
        gap: 5px !important;
        min-height: 0 !important;
        max-height: 88px !important;
        padding: 5px !important;
        overflow: visible !important;
        border-radius: 12px !important;
    }

    /* The native Android shell already identifies the product; hiding the brand
       chip here gives functional controls enough room on 360-430dp phones. */
    body.designer-shell .designer-brand-chip {
        display: none !important;
    }

    body.designer-shell .stage-actions {
        grid-area: actions !important;
        justify-content: flex-start !important;
        gap: 5px !important;
        padding-inline: 1px !important;
        overflow-x: auto !important;
        overscroll-behavior-inline: contain !important;
    }
    body.designer-shell .stage-actions > button,
    body.designer-shell .stage-actions > a {
        width: 32px !important;
        min-width: 32px !important;
        height: 32px !important;
        min-height: 32px !important;
        border-radius: 8px !important;
    }

    body.designer-shell .room-dimensions-display {
        grid-area: dimensions !important;
        width: 82px !important;
        min-width: 82px !important;
        max-width: 82px !important;
        padding: 3px 5px !important;
    }
    body.designer-shell .room-dimensions-display span {
        font-size: .56rem !important;
    }
    body.designer-shell .room-dimensions-display strong {
        font-size: .62rem !important;
        letter-spacing: -.01em !important;
    }

    body.designer-shell .stage-ai-zone {
        grid-area: ai !important;
        min-height: 34px !important;
        overflow: visible !important;
    }
    body.designer-shell .ai-render-controls {
        justify-content: flex-start !important;
        gap: 4px !important;
        overflow-x: auto !important;
        scroll-snap-type: x proximity !important;
    }
    body.designer-shell .ai-single-split,
    body.designer-shell .ai-render-all-button,
    body.designer-shell .ai-credit-badge {
        scroll-snap-align: start !important;
    }
    body.designer-shell .stage-ai-button,
    body.designer-shell .ai-render-button {
        min-width: 78px !important;
        height: 32px !important;
        min-height: 32px !important;
        padding: 3px 7px !important;
        font-size: .64rem !important;
    }
    body.designer-shell .ai-side-picker {
        min-height: 32px !important;
        height: 32px !important;
    }
    body.designer-shell .ai-credit-badge {
        min-height: 30px !important;
        padding: 4px 7px !important;
        font-size: .59rem !important;
    }

    /* Keep the library behavior the user liked, but place it safely below the
       compact top toolbar. */
    body.designer-shell .library-panel {
        top: 100px !important;
        max-height: min(50dvh, 440px) !important;
    }
    body.designer-shell .room-workspace.library-collapsed .library-panel {
        position: fixed !important;
        top: 100px !important;
        right: auto !important;
        bottom: auto !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        z-index: 86 !important;
    }

    /* Components are a real bottom sheet, not a near-full-screen page. */
    body.designer-shell .properties-panel {
        top: auto !important;
        right: 8px !important;
        bottom: 92px !important;
        left: 8px !important;
        display: block !important;
        width: auto !important;
        height: 44dvh !important;
        min-height: 260px !important;
        max-height: 44dvh !important;
        padding: 7px 8px 10px !important;
        overflow-y: auto !important;
        overscroll-behavior-y: contain !important;
        scrollbar-gutter: stable !important;
    }

    body.designer-shell .room-workspace.properties-collapsed .properties-panel {
        position: fixed !important;
        top: auto !important;
        right: auto !important;
        bottom: 92px !important;
        left: 50% !important;
        width: 156px !important;
        min-width: 156px !important;
        height: 42px !important;
        min-height: 42px !important;
        max-height: 42px !important;
        transform: translateX(-50%) !important;
        z-index: 86 !important;
    }

    body.designer-shell .room-workspace.library-collapsed .library-edge-toggle,
    body.designer-shell .room-workspace.properties-collapsed .properties-edge-toggle {
        width: 156px !important;
        min-width: 156px !important;
        height: 42px !important;
        min-height: 42px !important;
        justify-content: center !important;
        overflow: hidden !important;
        color: #26311f !important;
    }
    body.designer-shell .panel-edge-toggle-label {
        display: inline-block !important;
        max-width: 104px !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
    }

    /* Room dimensions stay compact at the top of the components sheet. */
    body.designer-shell .properties-panel .room-dimensions-panel {
        margin-bottom: 6px !important;
        padding: 6px !important;
    }
    body.designer-shell .properties-panel .room-dimensions-panel .control-grid,
    body.designer-shell .properties-panel .control-grid.compact-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
        gap: 5px !important;
    }
    body.designer-shell .properties-panel .room-dimensions-panel input {
        min-height: 36px !important;
        padding: 5px 7px !important;
    }

    /* Turn the tall component category stack into a single horizontal strip. */
    body.designer-shell .properties-panel .property-tab-groups {
        display: flex !important;
        flex-wrap: nowrap !important;
        gap: 5px !important;
        margin: 0 0 7px !important;
        padding: 1px 0 5px !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        scrollbar-width: none !important;
        scroll-snap-type: x proximity !important;
    }
    body.designer-shell .properties-panel .property-tab-groups::-webkit-scrollbar {
        display: none !important;
    }
    body.designer-shell .properties-panel .property-tab-group {
        flex: 0 0 auto !important;
        display: block !important;
        min-width: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        border: 0 !important;
        background: transparent !important;
        scroll-snap-align: start !important;
    }
    body.designer-shell .properties-panel .property-tab-group-title {
        display: none !important;
    }
    body.designer-shell .properties-panel .properties-tabs {
        gap: 4px !important;
        overflow: visible !important;
    }
    body.designer-shell .properties-panel .properties-tabs button {
        min-height: 34px !important;
        padding: 5px 8px !important;
        font-size: .66rem !important;
        border-radius: 8px !important;
    }

    /* Bottom selection toolbar: one clear label row + four equal actions. */
    body.designer-shell .selection-toolbar,
    body.designer-shell .room-stage.inside-camera-view .selection-toolbar {
        right: 8px !important;
        bottom: 8px !important;
        left: 8px !important;
        display: grid !important;
        grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
        align-items: center !important;
        gap: 4px !important;
        width: auto !important;
        min-height: 0 !important;
        max-height: 78px !important;
        padding: 5px !important;
        overflow: hidden !important;
        border-radius: 12px !important;
    }
    body.designer-shell .selection-toolbar span,
    body.designer-shell .room-stage.inside-camera-view .selection-toolbar span {
        display: block !important;
        grid-column: 1 / -1 !important;
        min-width: 0 !important;
        margin: 0 !important;
        padding: 0 4px 2px !important;
        color: #7fc96b !important;
        font-size: .62rem !important;
        line-height: 1.2 !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        text-align: start !important;
    }
    body.designer-shell .selection-toolbar strong,
    body.designer-shell .room-stage.inside-camera-view .selection-toolbar strong {
        display: none !important;
    }
    body.designer-shell .selection-toolbar button,
    body.designer-shell .room-stage.inside-camera-view .selection-toolbar button {
        width: 100% !important;
        min-width: 0 !important;
        height: 31px !important;
        min-height: 31px !important;
        padding: 3px 4px !important;
        font-size: .59rem !important;
        line-height: 1.1 !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
    }
    body.designer-shell .room-stage:not(.has-selection) .selection-toolbar {
        grid-template-columns: 1fr !important;
        min-height: 36px !important;
        max-height: 36px !important;
    }
    body.designer-shell .room-stage:not(.has-selection) .selection-toolbar button {
        display: none !important;
    }
    body.designer-shell .room-stage:not(.has-selection) .selection-toolbar span {
        grid-column: 1 !important;
        padding: 0 6px !important;
        text-align: center !important;
    }

    /* Do not let drop feedback or overlay handles sit under either toolbar. */
    body.designer-shell .room-stage.mobile-drop-target::after {
        inset: 102px 16px 94px !important;
    }
}


/* ===== Phase 9B v1.3 — unified phone panels + rotation-safe landscape =====
   Based on the Pixel 7 emulator recording. Important design rule:
   - Library and Components use the SAME overlay-card behaviour.
   - Rotating a phone must never reactivate the desktop three-column workspace.
   - The 3D stage always owns the full viewport; controls float over it. */
@media (max-width: 760px) {
    /* Portrait toolbar: deterministic two rows, no accidental overflow. */
    body.designer-shell .room-toolbar,
    body.designer-shell .stage-toolbar {
        top: 6px !important;
        right: 8px !important;
        left: 8px !important;
        display: grid !important;
        grid-template-columns: 84px minmax(0, 1fr) !important;
        grid-template-areas:
            "dimensions actions"
            "ai ai" !important;
        align-items: center !important;
        gap: 4px 6px !important;
        min-height: 0 !important;
        height: auto !important;
        max-height: 82px !important;
        padding: 5px 6px !important;
        overflow: hidden !important;
        border-radius: 12px !important;
    }

    body.designer-shell .stage-actions {
        grid-area: actions !important;
        display: flex !important;
        justify-content: flex-end !important;
        align-items: center !important;
        gap: 4px !important;
        min-width: 0 !important;
        overflow: hidden !important;
    }
    body.designer-shell .stage-actions > button,
    body.designer-shell .stage-actions > a {
        flex: 0 0 30px !important;
        width: 30px !important;
        min-width: 30px !important;
        height: 30px !important;
        min-height: 30px !important;
        padding: 0 !important;
    }
    body.designer-shell .designer-projects-link:not(.designer-projects-icon) {
        flex: 0 1 auto !important;
        width: auto !important;
        min-width: 58px !important;
        padding-inline: 7px !important;
        font-size: .62rem !important;
    }

    body.designer-shell .room-dimensions-display {
        grid-area: dimensions !important;
        width: 84px !important;
        min-width: 84px !important;
        max-width: 84px !important;
        padding: 3px 5px !important;
        overflow: hidden !important;
    }

    body.designer-shell .stage-ai-zone {
        grid-area: ai !important;
        min-width: 0 !important;
        min-height: 30px !important;
        overflow: hidden !important;
    }
    body.designer-shell .ai-render-controls {
        display: flex !important;
        width: 100% !important;
        min-width: 0 !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 4px !important;
        overflow: hidden !important;
    }
    body.designer-shell .ai-single-split { flex: 1 1 116px !important; min-width: 108px !important; }
    body.designer-shell .ai-render-all-button { flex: 0 0 78px !important; min-width: 78px !important; }
    body.designer-shell .ai-credit-badge {
        flex: 0 1 82px !important;
        min-width: 62px !important;
        max-width: 82px !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
    }

    /* Components now deliberately copy the library panel mechanics. The only
       difference is where the closed trigger lives (bottom vs top). */
    body.designer-shell .library-panel,
    body.designer-shell .properties-panel {
        right: 8px !important;
        left: 8px !important;
        width: auto !important;
        min-width: 0 !important;
        height: auto !important;
        min-height: 0 !important;
        max-height: min(50dvh, 440px) !important;
        padding: 8px !important;
        overflow-x: hidden !important;
        overflow-y: auto !important;
        overscroll-behavior: contain !important;
        border-radius: 16px !important;
    }
    body.designer-shell .library-panel {
        top: 94px !important;
        bottom: auto !important;
    }
    body.designer-shell .properties-panel {
        top: auto !important;
        bottom: 58px !important;
    }

    body.designer-shell .room-workspace:not(.library-collapsed) .library-edge-toggle,
    body.designer-shell .room-workspace:not(.properties-collapsed) .properties-edge-toggle {
        position: sticky !important;
        top: 0 !important;
        z-index: 100 !important;
        width: 100% !important;
        height: 40px !important;
        min-height: 40px !important;
        margin: 0 0 8px !important;
        padding: 5px 10px !important;
        border-radius: 11px !important;
        flex-direction: row !important;
        transform: none !important;
    }

    body.designer-shell .properties-panel .room-dimensions-panel {
        margin: 0 0 7px !important;
        padding: 7px !important;
    }
    body.designer-shell .properties-panel .property-tab-groups {
        position: sticky !important;
        top: 48px !important;
        z-index: 4 !important;
        margin: 0 0 7px !important;
        padding: 4px 0 6px !important;
        background: rgba(250, 247, 238, .985) !important;
    }
    body.designer-shell .properties-panel .property-panel {
        padding-bottom: 4px !important;
    }

    /* Closed panel handles remain reachable but never eat the 3D canvas. */
    body.designer-shell .room-workspace.library-collapsed .library-panel {
        top: 94px !important;
        bottom: auto !important;
    }
    body.designer-shell .room-workspace.properties-collapsed .properties-panel {
        top: auto !important;
        bottom: 8px !important;
    }

    /* Selection controls have their own space and cannot collide with labels. */
    body.designer-shell .selection-toolbar,
    body.designer-shell .room-stage.inside-camera-view .selection-toolbar {
        right: 8px !important;
        bottom: 56px !important;
        left: 8px !important;
        display: grid !important;
        grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
        gap: 4px !important;
        max-height: 74px !important;
        padding: 5px !important;
        overflow: hidden !important;
    }
    body.designer-shell .selection-toolbar span,
    body.designer-shell .room-stage.inside-camera-view .selection-toolbar span {
        grid-column: 1 / -1 !important;
        display: block !important;
        min-width: 0 !important;
        padding: 0 4px 2px !important;
        font-size: .61rem !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }
    body.designer-shell .selection-toolbar button,
    body.designer-shell .room-stage.inside-camera-view .selection-toolbar button {
        width: 100% !important;
        min-width: 0 !important;
        height: 30px !important;
        min-height: 30px !important;
        padding: 3px !important;
        font-size: .58rem !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }
    body.designer-shell .room-stage:not(.has-selection) .selection-toolbar {
        bottom: 56px !important;
        grid-template-columns: 1fr !important;
        max-height: 34px !important;
    }
}

/* Landscape phone mode. Pixel-class phones are wider than the portrait breakpoint,
   so width-only media queries used to restore the desktop 3-column designer after
   rotation. This block keeps the same touch shell in landscape. */
@media (orientation: landscape) and (max-height: 600px) {
    html:has(body.designer-shell),
    body.designer-shell,
    body.designer-shell .kitchen-editor-page {
        width: 100% !important;
        height: 100dvh !important;
        min-height: 100dvh !important;
        margin: 0 !important;
        overflow: hidden !important;
    }

    body.designer-shell .room-workspace,
    body.designer-shell .editor-workspace,
    body.designer-shell .room-workspace.library-collapsed,
    body.designer-shell .room-workspace.properties-collapsed,
    body.designer-shell .room-workspace.library-collapsed.properties-collapsed {
        position: relative !important;
        display: block !important;
        grid-template-columns: none !important;
        width: 100% !important;
        height: 100% !important;
        min-height: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow: hidden !important;
    }

    body.designer-shell .room-stage,
    body.designer-shell .editor-workspace .room-stage {
        position: absolute !important;
        inset: 0 !important;
        z-index: 1 !important;
        width: 100% !important;
        height: 100% !important;
        min-height: 0 !important;
        margin: 0 !important;
        border-radius: 0 !important;
    }
    body.designer-shell .designer-canvas,
    body.designer-shell .designer-webgl-overlay {
        inset: 0 !important;
        width: 100% !important;
        height: 100% !important;
    }

    body.designer-shell .designer-brand-chip { display: none !important; }

    /* One compact row in landscape: dimensions | edit actions | AI. */
    body.designer-shell .room-toolbar,
    body.designer-shell .stage-toolbar {
        position: absolute !important;
        top: 5px !important;
        right: 7px !important;
        left: 7px !important;
        display: grid !important;
        grid-template-columns: 104px minmax(150px, .8fr) minmax(270px, 1.4fr) !important;
        grid-template-areas: "dimensions actions ai" !important;
        align-items: center !important;
        gap: 5px !important;
        width: auto !important;
        height: 44px !important;
        min-height: 44px !important;
        max-height: 44px !important;
        padding: 4px 6px !important;
        overflow: hidden !important;
        border-radius: 11px !important;
    }

    body.designer-shell .room-dimensions-display {
        grid-area: dimensions !important;
        width: 104px !important;
        min-width: 104px !important;
        max-width: 104px !important;
        height: 34px !important;
        padding: 3px 5px !important;
        overflow: hidden !important;
    }
    body.designer-shell .room-dimensions-display span { font-size: .53rem !important; }
    body.designer-shell .room-dimensions-display strong { font-size: .60rem !important; white-space: nowrap !important; }

    body.designer-shell .stage-actions {
        grid-area: actions !important;
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        gap: 3px !important;
        min-width: 0 !important;
        overflow: hidden !important;
    }
    body.designer-shell .stage-actions > button,
    body.designer-shell .stage-actions > a {
        flex: 0 0 28px !important;
        width: 28px !important;
        min-width: 28px !important;
        height: 28px !important;
        min-height: 28px !important;
        padding: 0 !important;
        border-radius: 7px !important;
    }
    body.designer-shell .designer-projects-link:not(.designer-projects-icon) {
        flex: 0 1 70px !important;
        width: auto !important;
        min-width: 54px !important;
        padding-inline: 5px !important;
        font-size: .56rem !important;
    }

    body.designer-shell .stage-ai-zone {
        grid-area: ai !important;
        display: block !important;
        min-width: 0 !important;
        height: 34px !important;
        min-height: 34px !important;
        overflow: hidden !important;
    }
    body.designer-shell .ai-render-controls {
        display: flex !important;
        align-items: center !important;
        justify-content: flex-start !important;
        gap: 3px !important;
        width: 100% !important;
        height: 32px !important;
        min-width: 0 !important;
        overflow: hidden !important;
    }
    body.designer-shell .ai-single-split { flex: 1 1 104px !important; min-width: 96px !important; }
    body.designer-shell .stage-ai-button,
    body.designer-shell .ai-render-button {
        min-width: 68px !important;
        height: 28px !important;
        min-height: 28px !important;
        padding: 2px 6px !important;
        font-size: .56rem !important;
    }
    body.designer-shell .ai-side-picker { height: 28px !important; min-height: 28px !important; }
    body.designer-shell .ai-render-all-button { flex: 0 0 70px !important; min-width: 70px !important; }
    body.designer-shell .ai-credit-badge {
        flex: 0 0 74px !important;
        min-width: 74px !important;
        max-width: 74px !important;
        min-height: 28px !important;
        padding: 3px 5px !important;
        font-size: .52rem !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
    }
    body.designer-shell .ai-queue-progress,
    body.designer-shell .ai-render-previews,
    body.designer-shell .stage-ai-result {
        position: absolute !important;
        top: 48px !important;
        right: 0 !important;
        left: 0 !important;
        max-height: 42px !important;
        overflow: hidden !important;
    }

    /* Library and Components are symmetric side overlays in landscape. */
    body.designer-shell .library-panel,
    body.designer-shell .properties-panel {
        position: absolute !important;
        top: 55px !important;
        bottom: 50px !important;
        z-index: 80 !important;
        width: min(360px, 44vw) !important;
        min-width: 280px !important;
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;
        margin: 0 !important;
        padding: 7px !important;
        overflow-x: hidden !important;
        overflow-y: auto !important;
        overscroll-behavior: contain !important;
        border-radius: 14px !important;
        background: rgba(250, 247, 238, .985) !important;
        box-shadow: 0 16px 44px rgba(0, 0, 0, .34) !important;
    }
    body.designer-shell .library-panel {
        right: 8px !important;
        left: auto !important;
    }
    body.designer-shell .properties-panel {
        right: auto !important;
        left: 8px !important;
    }
    body.designer-shell .library-panel .panel-title,
    body.designer-shell .properties-panel .panel-title { display: none !important; }

    body.designer-shell .room-workspace:not(.library-collapsed) .library-edge-toggle,
    body.designer-shell .room-workspace:not(.properties-collapsed) .properties-edge-toggle {
        position: sticky !important;
        top: 0 !important;
        z-index: 100 !important;
        width: 100% !important;
        height: 36px !important;
        min-height: 36px !important;
        margin: 0 0 6px !important;
        padding: 4px 8px !important;
        transform: none !important;
        flex-direction: row !important;
        border-radius: 10px !important;
    }

    body.designer-shell .room-workspace.library-collapsed .library-panel,
    body.designer-shell .room-workspace.properties-collapsed .properties-panel {
        top: 50% !important;
        bottom: auto !important;
        width: 52px !important;
        min-width: 52px !important;
        height: 108px !important;
        min-height: 108px !important;
        max-height: 108px !important;
        padding: 0 !important;
        overflow: visible !important;
        border: 0 !important;
        background: transparent !important;
        box-shadow: none !important;
        transform: translateY(-50%) !important;
        pointer-events: none !important;
    }
    body.designer-shell .room-workspace.library-collapsed .library-panel {
        right: 8px !important;
        left: auto !important;
    }
    body.designer-shell .room-workspace.properties-collapsed .properties-panel {
        right: auto !important;
        left: 8px !important;
    }
    body.designer-shell .room-workspace.library-collapsed .library-panel > :not(.panel-edge-toggle),
    body.designer-shell .room-workspace.properties-collapsed .properties-panel > :not(.panel-edge-toggle) {
        display: none !important;
    }
    body.designer-shell .room-workspace.library-collapsed .library-edge-toggle,
    body.designer-shell .room-workspace.properties-collapsed .properties-edge-toggle {
        position: absolute !important;
        inset: 0 !important;
        z-index: 100 !important;
        display: flex !important;
        width: 52px !important;
        min-width: 52px !important;
        height: 108px !important;
        min-height: 108px !important;
        margin: 0 !important;
        padding: 8px 4px !important;
        transform: none !important;
        flex-direction: column !important;
        justify-content: center !important;
        gap: 6px !important;
        pointer-events: auto !important;
        border-radius: 999px !important;
        background: rgba(255, 253, 247, .97) !important;
        box-shadow: 0 8px 24px rgba(0, 0, 0, .24) !important;
    }
    body.designer-shell .room-workspace.library-collapsed .panel-edge-toggle-label,
    body.designer-shell .room-workspace.properties-collapsed .panel-edge-toggle-label {
        display: block !important;
        max-width: 44px !important;
        font-size: .58rem !important;
        line-height: 1.1 !important;
        white-space: normal !important;
        text-align: center !important;
    }

    body.designer-shell .object-library {
        max-height: none !important;
        padding-bottom: 5px !important;
    }
    body.designer-shell .library-section-body {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 6px !important;
    }
    body.designer-shell .object-library button {
        min-height: 66px !important;
        padding: 6px 7px !important;
    }

    body.designer-shell .properties-panel .room-dimensions-panel {
        margin-bottom: 5px !important;
        padding: 5px !important;
    }
    body.designer-shell .properties-panel .room-dimensions-panel .control-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
        gap: 4px !important;
    }
    body.designer-shell .properties-panel .property-tab-groups {
        position: sticky !important;
        top: 42px !important;
        z-index: 4 !important;
        display: flex !important;
        flex-wrap: nowrap !important;
        gap: 4px !important;
        margin: 0 0 5px !important;
        padding: 3px 0 5px !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        background: rgba(250, 247, 238, .985) !important;
        scrollbar-width: none !important;
    }
    body.designer-shell .properties-panel .property-tab-groups::-webkit-scrollbar { display: none !important; }
    body.designer-shell .properties-panel .property-tab-group {
        flex: 0 0 auto !important;
        display: block !important;
        margin: 0 !important;
        padding: 0 !important;
        border: 0 !important;
        background: transparent !important;
    }
    body.designer-shell .properties-panel .property-tab-group-title { display: none !important; }
    body.designer-shell .properties-panel .properties-tabs { gap: 3px !important; overflow: visible !important; }
    body.designer-shell .properties-panel .properties-tabs button {
        min-height: 30px !important;
        padding: 4px 7px !important;
        font-size: .58rem !important;
        white-space: nowrap !important;
    }
    body.designer-shell .properties-panel .control-grid,
    body.designer-shell .properties-panel .control-grid.compact-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 5px !important;
    }

    /* Bottom selection bar stays one compact row in landscape. */
    body.designer-shell .selection-toolbar,
    body.designer-shell .room-stage.inside-camera-view .selection-toolbar {
        right: 64px !important;
        bottom: 5px !important;
        left: 64px !important;
        display: flex !important;
        align-items: center !important;
        gap: 4px !important;
        width: auto !important;
        min-height: 38px !important;
        height: 38px !important;
        max-height: 38px !important;
        padding: 4px 5px !important;
        overflow: hidden !important;
        border-radius: 10px !important;
    }
    body.designer-shell .selection-toolbar span,
    body.designer-shell .room-stage.inside-camera-view .selection-toolbar span {
        display: block !important;
        flex: 1 1 auto !important;
        min-width: 0 !important;
        padding-inline: 4px !important;
        font-size: .56rem !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }
    body.designer-shell .selection-toolbar strong,
    body.designer-shell .room-stage.inside-camera-view .selection-toolbar strong { display: none !important; }
    body.designer-shell .selection-toolbar button,
    body.designer-shell .room-stage.inside-camera-view .selection-toolbar button {
        flex: 0 0 58px !important;
        width: 58px !important;
        min-width: 58px !important;
        height: 29px !important;
        min-height: 29px !important;
        padding: 3px 4px !important;
        font-size: .54rem !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }
    body.designer-shell .room-stage:not(.has-selection) .selection-toolbar {
        right: 64px !important;
        left: 64px !important;
        width: auto !important;
        height: 34px !important;
        min-height: 34px !important;
        max-height: 34px !important;
    }
    body.designer-shell .room-stage:not(.has-selection) .selection-toolbar button { display: none !important; }

    body.designer-shell .room-stage.mobile-drop-target::after {
        inset: 54px 62px 48px !important;
    }
}

/* ===== Phase 9B v1.4 — deterministic phone panels + toolbar reset =====
   The Android designer now receives explicit portrait/landscape body classes from JS.
   This block intentionally overrides the older width-only mobile rules so rotation can
   never move the phone back into desktop layout. Library and Components share one
   overlay-card system; only their anchor/direction changes. */

/* Common phone shell: the 3D stage always owns the viewport. */
body.designer-shell.designer-mobile-ui,
body.designer-shell.designer-mobile-ui .kitchen-editor-page {
    width: 100% !important;
    height: 100dvh !important;
    min-height: 100dvh !important;
    margin: 0 !important;
    overflow: hidden !important;
}
body.designer-shell.designer-mobile-ui .room-workspace,
body.designer-shell.designer-mobile-ui .editor-workspace,
body.designer-shell.designer-mobile-ui .room-workspace.library-collapsed,
body.designer-shell.designer-mobile-ui .room-workspace.properties-collapsed,
body.designer-shell.designer-mobile-ui .room-workspace.library-collapsed.properties-collapsed {
    position: relative !important;
    display: block !important;
    grid-template-columns: none !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
}
body.designer-shell.designer-mobile-ui .room-stage,
body.designer-shell.designer-mobile-ui .editor-workspace .room-stage {
    position: absolute !important;
    inset: 0 !important;
    z-index: 1 !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    margin: 0 !important;
    border-radius: 0 !important;
    overflow: hidden !important;
}
body.designer-shell.designer-mobile-ui .designer-canvas,
body.designer-shell.designer-mobile-ui .designer-webgl-overlay {
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
}
body.designer-shell.designer-mobile-ui .designer-brand-chip {
    display: none !important;
}
body.designer-shell.designer-mobile-ui .ai-render-controls::before {
    display: none !important;
    content: none !important;
}
body.designer-shell.designer-mobile-ui [data-toolbar-tooltip]::after {
    display: none !important;
}

/* Shared open-panel card. Library and Components intentionally have identical shell. */
body.designer-shell.designer-mobile-ui .library-panel,
body.designer-shell.designer-mobile-ui .properties-panel {
    position: absolute !important;
    z-index: 80 !important;
    display: flex !important;
    flex-direction: column !important;
    width: auto !important;
    min-width: 0 !important;
    height: auto !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 8px !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    overscroll-behavior: contain !important;
    border: 1px solid rgba(212, 175, 82, .36) !important;
    border-radius: 16px !important;
    background: rgba(250, 247, 238, .985) !important;
    box-shadow: 0 18px 50px rgba(0, 0, 0, .36) !important;
    backdrop-filter: blur(12px) !important;
    transition: transform 170ms ease, opacity 170ms ease !important;
}
body.designer-shell.designer-mobile-ui .library-panel .panel-title,
body.designer-shell.designer-mobile-ui .properties-panel .panel-title {
    display: none !important;
}
body.designer-shell.designer-mobile-ui .room-workspace:not(.library-collapsed) .library-edge-toggle,
body.designer-shell.designer-mobile-ui .room-workspace:not(.properties-collapsed) .properties-edge-toggle {
    z-index: 100 !important;
    display: flex !important;
    width: 100% !important;
    min-width: 0 !important;
    height: 40px !important;
    min-height: 40px !important;
    padding: 5px 10px !important;
    transform: none !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    pointer-events: auto !important;
    border-radius: 11px !important;
    background: #fffdf7 !important;
    box-shadow: 0 3px 10px rgba(38, 49, 31, .08) !important;
}
body.designer-shell.designer-mobile-ui .panel-edge-toggle-label {
    display: inline-block !important;
    color: #27331f !important;
    font-size: .72rem !important;
    line-height: 1 !important;
    white-space: nowrap !important;
}
body.designer-shell.designer-mobile-ui .panel-edge-toggle-arrow {
    flex: 0 0 auto !important;
}

/* PORTRAIT: Library lives at the top. Components lives at the bottom and closes
   from the bottom too; the word "المكونات" never disappears. */
body.designer-shell.designer-mobile-ui.designer-mobile-portrait .room-toolbar,
body.designer-shell.designer-mobile-ui.designer-mobile-portrait .stage-toolbar {
    position: absolute !important;
    top: 6px !important;
    right: 8px !important;
    left: 8px !important;
    z-index: 65 !important;
    display: grid !important;
    grid-template-columns: 82px minmax(0, 1fr) !important;
    grid-template-areas:
        "dimensions actions"
        "ai ai" !important;
    align-items: center !important;
    gap: 4px 6px !important;
    width: auto !important;
    height: 76px !important;
    min-height: 76px !important;
    max-height: 76px !important;
    padding: 5px 6px !important;
    overflow: hidden !important;
    border-radius: 12px !important;
    background: rgba(25, 34, 21, .92) !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .22) !important;
    backdrop-filter: blur(12px) !important;
}
body.designer-shell.designer-mobile-ui.designer-mobile-portrait .room-dimensions-display {
    grid-area: dimensions !important;
    width: 82px !important;
    min-width: 82px !important;
    max-width: 82px !important;
    height: 30px !important;
    min-height: 30px !important;
    padding: 2px 4px !important;
    overflow: hidden !important;
    text-align: center !important;
    line-height: 1.02 !important;
}
body.designer-shell.designer-mobile-ui.designer-mobile-portrait .room-dimensions-display span {
    font-size: .52rem !important;
}
body.designer-shell.designer-mobile-ui.designer-mobile-portrait .room-dimensions-display strong {
    display: block !important;
    font-size: .59rem !important;
    white-space: nowrap !important;
}
body.designer-shell.designer-mobile-ui.designer-mobile-portrait .stage-actions {
    grid-area: actions !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 4px !important;
    min-width: 0 !important;
    height: 30px !important;
    overflow: hidden !important;
}
body.designer-shell.designer-mobile-ui.designer-mobile-portrait .stage-actions > button,
body.designer-shell.designer-mobile-ui.designer-mobile-portrait .stage-actions > a {
    flex: 0 0 28px !important;
    display: inline-grid !important;
    place-items: center !important;
    width: 28px !important;
    min-width: 28px !important;
    height: 28px !important;
    min-height: 28px !important;
    padding: 0 !important;
    overflow: hidden !important;
    border-radius: 8px !important;
    font-size: .68rem !important;
    line-height: 1 !important;
}
body.designer-shell.designer-mobile-ui.designer-mobile-portrait #resetRoomButton {
    font-size: 0 !important;
}
body.designer-shell.designer-mobile-ui.designer-mobile-portrait #resetRoomButton::after {
    content: "↺" !important;
    font-size: 1rem !important;
    font-weight: 900 !important;
}
body.designer-shell.designer-mobile-ui.designer-mobile-portrait .designer-projects-link:not(.designer-projects-icon) {
    flex: 0 1 auto !important;
    width: auto !important;
    min-width: 52px !important;
    padding-inline: 6px !important;
    font-size: .58rem !important;
    white-space: nowrap !important;
}
body.designer-shell.designer-mobile-ui.designer-mobile-portrait .stage-ai-zone {
    grid-area: ai !important;
    display: block !important;
    min-width: 0 !important;
    height: 32px !important;
    min-height: 32px !important;
    overflow: hidden !important;
}
body.designer-shell.designer-mobile-ui.designer-mobile-portrait .ai-render-controls {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 4px !important;
    width: 100% !important;
    height: 32px !important;
    min-width: 0 !important;
    overflow: hidden !important;
}
body.designer-shell.designer-mobile-ui.designer-mobile-portrait .ai-single-split {
    flex: 1 1 118px !important;
    min-width: 108px !important;
    max-width: 150px !important;
    height: 30px !important;
}
body.designer-shell.designer-mobile-ui.designer-mobile-portrait .stage-ai-button,
body.designer-shell.designer-mobile-ui.designer-mobile-portrait .ai-render-button {
    height: 30px !important;
    min-height: 30px !important;
    padding: 2px 6px !important;
    font-size: .58rem !important;
}
body.designer-shell.designer-mobile-ui.designer-mobile-portrait .ai-side-picker {
    height: 30px !important;
    min-height: 30px !important;
}
body.designer-shell.designer-mobile-ui.designer-mobile-portrait .ai-render-all-button {
    flex: 0 0 72px !important;
    min-width: 72px !important;
    max-width: 72px !important;
}
body.designer-shell.designer-mobile-ui.designer-mobile-portrait .ai-credit-badge {
    flex: 0 1 76px !important;
    min-width: 54px !important;
    max-width: 76px !important;
    min-height: 28px !important;
    padding: 3px 5px !important;
    overflow: hidden !important;
    font-size: .52rem !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
}

body.designer-shell.designer-mobile-ui.designer-mobile-portrait .library-panel,
body.designer-shell.designer-mobile-ui.designer-mobile-portrait .properties-panel {
    right: 8px !important;
    left: 8px !important;
    max-height: min(48dvh, 440px) !important;
}
body.designer-shell.designer-mobile-ui.designer-mobile-portrait .library-panel {
    top: 88px !important;
    bottom: auto !important;
}
body.designer-shell.designer-mobile-ui.designer-mobile-portrait .properties-panel {
    top: auto !important;
    bottom: 8px !important;
}
/* Library open/close handle stays at the top, exactly like a top drawer. */
body.designer-shell.designer-mobile-ui.designer-mobile-portrait .room-workspace:not(.library-collapsed) .library-edge-toggle {
    position: sticky !important;
    top: 0 !important;
    bottom: auto !important;
    order: -100 !important;
    margin: 0 0 8px !important;
}
/* Components mirrors Library, but from the bottom: its close handle stays below the content. */
body.designer-shell.designer-mobile-ui.designer-mobile-portrait .room-workspace:not(.properties-collapsed) .properties-edge-toggle {
    position: sticky !important;
    top: auto !important;
    bottom: 0 !important;
    order: 1000 !important;
    margin: 8px 0 0 !important;
}
body.designer-shell.designer-mobile-ui.designer-mobile-portrait .room-workspace.library-collapsed .library-panel,
body.designer-shell.designer-mobile-ui.designer-mobile-portrait .room-workspace.properties-collapsed .properties-panel {
    z-index: 90 !important;
    width: 158px !important;
    min-width: 158px !important;
    height: 42px !important;
    min-height: 42px !important;
    max-height: 42px !important;
    padding: 0 !important;
    overflow: visible !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    pointer-events: none !important;
}
body.designer-shell.designer-mobile-ui.designer-mobile-portrait .room-workspace.library-collapsed .library-panel {
    top: 88px !important;
    right: auto !important;
    bottom: auto !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
}
body.designer-shell.designer-mobile-ui.designer-mobile-portrait .room-workspace.properties-collapsed .properties-panel {
    top: auto !important;
    right: auto !important;
    bottom: 8px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
}
body.designer-shell.designer-mobile-ui.designer-mobile-portrait .room-workspace.library-collapsed .library-panel > :not(.panel-edge-toggle),
body.designer-shell.designer-mobile-ui.designer-mobile-portrait .room-workspace.properties-collapsed .properties-panel > :not(.panel-edge-toggle) {
    display: none !important;
}
body.designer-shell.designer-mobile-ui.designer-mobile-portrait .room-workspace.library-collapsed .library-edge-toggle,
body.designer-shell.designer-mobile-ui.designer-mobile-portrait .room-workspace.properties-collapsed .properties-edge-toggle {
    position: absolute !important;
    inset: 0 !important;
    z-index: 100 !important;
    display: flex !important;
    width: 158px !important;
    min-width: 158px !important;
    height: 42px !important;
    min-height: 42px !important;
    margin: 0 !important;
    padding: 5px 12px !important;
    transform: none !important;
    flex-direction: row !important;
    justify-content: center !important;
    gap: 8px !important;
    pointer-events: auto !important;
    border-radius: 999px !important;
    background: rgba(255, 253, 247, .98) !important;
    box-shadow: 0 8px 22px rgba(0, 0, 0, .22) !important;
}
body.designer-shell.designer-mobile-ui.designer-mobile-portrait .room-workspace.library-collapsed .panel-edge-toggle-label,
body.designer-shell.designer-mobile-ui.designer-mobile-portrait .room-workspace.properties-collapsed .panel-edge-toggle-label {
    display: inline-block !important;
    max-width: none !important;
    font-size: .68rem !important;
    white-space: nowrap !important;
}

/* Components content remains compact while the shell now mirrors Library. */
body.designer-shell.designer-mobile-ui.designer-mobile-portrait .properties-panel .room-dimensions-panel {
    margin: 0 0 7px !important;
    padding: 7px !important;
}
body.designer-shell.designer-mobile-ui.designer-mobile-portrait .properties-panel .room-dimensions-panel .control-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 5px !important;
}
body.designer-shell.designer-mobile-ui.designer-mobile-portrait .properties-panel .property-tab-groups {
    position: sticky !important;
    top: 0 !important;
    z-index: 5 !important;
    display: flex !important;
    flex-wrap: nowrap !important;
    gap: 4px !important;
    margin: 0 0 7px !important;
    padding: 4px 0 6px !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    background: rgba(250, 247, 238, .985) !important;
    scrollbar-width: none !important;
}
body.designer-shell.designer-mobile-ui.designer-mobile-portrait .properties-panel .property-tab-groups::-webkit-scrollbar {
    display: none !important;
}
body.designer-shell.designer-mobile-ui.designer-mobile-portrait .properties-panel .property-tab-group {
    flex: 0 0 auto !important;
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
}
body.designer-shell.designer-mobile-ui.designer-mobile-portrait .properties-panel .property-tab-group-title {
    display: none !important;
}
body.designer-shell.designer-mobile-ui.designer-mobile-portrait .properties-panel .properties-tabs {
    gap: 3px !important;
    overflow: visible !important;
}
body.designer-shell.designer-mobile-ui.designer-mobile-portrait .properties-panel .properties-tabs button {
    min-height: 30px !important;
    padding: 4px 7px !important;
    font-size: .58rem !important;
    white-space: nowrap !important;
}
body.designer-shell.designer-mobile-ui.designer-mobile-portrait .properties-panel .control-grid,
body.designer-shell.designer-mobile-ui.designer-mobile-portrait .properties-panel .control-grid.compact-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 5px !important;
}

/* Portrait bottom action bar has a dedicated lane above the Components handle. */
body.designer-shell.designer-mobile-ui.designer-mobile-portrait .selection-toolbar,
body.designer-shell.designer-mobile-ui.designer-mobile-portrait .room-stage.inside-camera-view .selection-toolbar {
    right: 8px !important;
    bottom: 56px !important;
    left: 8px !important;
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 4px !important;
    width: auto !important;
    min-height: 0 !important;
    height: auto !important;
    max-height: 70px !important;
    padding: 5px !important;
    overflow: hidden !important;
}
body.designer-shell.designer-mobile-ui.designer-mobile-portrait .selection-toolbar span,
body.designer-shell.designer-mobile-ui.designer-mobile-portrait .room-stage.inside-camera-view .selection-toolbar span {
    grid-column: 1 / -1 !important;
    display: block !important;
    min-width: 0 !important;
    padding: 0 4px 2px !important;
    font-size: .60rem !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}
body.designer-shell.designer-mobile-ui.designer-mobile-portrait .selection-toolbar strong,
body.designer-shell.designer-mobile-ui.designer-mobile-portrait .room-stage.inside-camera-view .selection-toolbar strong {
    display: none !important;
}
body.designer-shell.designer-mobile-ui.designer-mobile-portrait .selection-toolbar button,
body.designer-shell.designer-mobile-ui.designer-mobile-portrait .room-stage.inside-camera-view .selection-toolbar button {
    width: 100% !important;
    min-width: 0 !important;
    height: 29px !important;
    min-height: 29px !important;
    padding: 3px !important;
    font-size: .56rem !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}
body.designer-shell.designer-mobile-ui.designer-mobile-portrait .room-stage:not(.has-selection) .selection-toolbar {
    grid-template-columns: 1fr !important;
    max-height: 34px !important;
}
body.designer-shell.designer-mobile-ui.designer-mobile-portrait .room-stage:not(.has-selection) .selection-toolbar button {
    display: none !important;
}

/* LANDSCAPE: Components is always the left drawer; Library is always the right drawer.
   Both use the same card dimensions and opening mechanics. */
body.designer-shell.designer-mobile-ui.designer-mobile-landscape .room-toolbar,
body.designer-shell.designer-mobile-ui.designer-mobile-landscape .stage-toolbar {
    position: absolute !important;
    top: 5px !important;
    right: 58px !important;
    left: 58px !important;
    z-index: 65 !important;
    display: grid !important;
    grid-template-columns: 96px 152px minmax(0, 1fr) !important;
    grid-template-areas: "dimensions actions ai" !important;
    align-items: center !important;
    gap: 5px !important;
    width: auto !important;
    height: 42px !important;
    min-height: 42px !important;
    max-height: 42px !important;
    padding: 4px 6px !important;
    overflow: hidden !important;
    border-radius: 11px !important;
    background: rgba(25, 34, 21, .92) !important;
    box-shadow: 0 8px 22px rgba(0, 0, 0, .22) !important;
    backdrop-filter: blur(12px) !important;
}
body.designer-shell.designer-mobile-ui.designer-mobile-landscape .room-dimensions-display {
    grid-area: dimensions !important;
    width: 96px !important;
    min-width: 96px !important;
    max-width: 96px !important;
    height: 32px !important;
    padding: 2px 4px !important;
    overflow: hidden !important;
    line-height: 1.02 !important;
    text-align: center !important;
}
body.designer-shell.designer-mobile-ui.designer-mobile-landscape .room-dimensions-display span {
    font-size: .50rem !important;
}
body.designer-shell.designer-mobile-ui.designer-mobile-landscape .room-dimensions-display strong {
    display: block !important;
    font-size: .57rem !important;
    white-space: nowrap !important;
}
body.designer-shell.designer-mobile-ui.designer-mobile-landscape .stage-actions {
    grid-area: actions !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 3px !important;
    width: 152px !important;
    min-width: 152px !important;
    height: 30px !important;
    overflow: hidden !important;
}
body.designer-shell.designer-mobile-ui.designer-mobile-landscape .stage-actions > button,
body.designer-shell.designer-mobile-ui.designer-mobile-landscape .stage-actions > a {
    flex: 0 0 27px !important;
    display: inline-grid !important;
    place-items: center !important;
    width: 27px !important;
    min-width: 27px !important;
    height: 27px !important;
    min-height: 27px !important;
    padding: 0 !important;
    overflow: hidden !important;
    border-radius: 7px !important;
    font-size: .64rem !important;
    line-height: 1 !important;
}
body.designer-shell.designer-mobile-ui.designer-mobile-landscape #resetRoomButton {
    font-size: 0 !important;
}
body.designer-shell.designer-mobile-ui.designer-mobile-landscape #resetRoomButton::after {
    content: "↺" !important;
    font-size: .95rem !important;
    font-weight: 900 !important;
}
body.designer-shell.designer-mobile-ui.designer-mobile-landscape .designer-projects-link:not(.designer-projects-icon) {
    flex: 0 1 auto !important;
    width: auto !important;
    min-width: 50px !important;
    padding-inline: 5px !important;
    font-size: .54rem !important;
    white-space: nowrap !important;
}
body.designer-shell.designer-mobile-ui.designer-mobile-landscape .stage-ai-zone {
    grid-area: ai !important;
    display: block !important;
    min-width: 0 !important;
    height: 30px !important;
    min-height: 30px !important;
    overflow: hidden !important;
}
body.designer-shell.designer-mobile-ui.designer-mobile-landscape .ai-render-controls {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 3px !important;
    width: 100% !important;
    height: 30px !important;
    min-width: 0 !important;
    overflow: hidden !important;
}
body.designer-shell.designer-mobile-ui.designer-mobile-landscape .ai-single-split {
    flex: 1 1 112px !important;
    min-width: 100px !important;
    max-width: 150px !important;
    height: 28px !important;
}
body.designer-shell.designer-mobile-ui.designer-mobile-landscape .stage-ai-button,
body.designer-shell.designer-mobile-ui.designer-mobile-landscape .ai-render-button {
    height: 28px !important;
    min-height: 28px !important;
    padding: 2px 5px !important;
    font-size: .54rem !important;
}
body.designer-shell.designer-mobile-ui.designer-mobile-landscape .ai-side-picker {
    height: 28px !important;
    min-height: 28px !important;
}
body.designer-shell.designer-mobile-ui.designer-mobile-landscape .ai-render-all-button {
    flex: 0 0 68px !important;
    min-width: 68px !important;
    max-width: 68px !important;
}
body.designer-shell.designer-mobile-ui.designer-mobile-landscape .ai-credit-badge {
    flex: 0 0 70px !important;
    min-width: 70px !important;
    max-width: 70px !important;
    min-height: 27px !important;
    padding: 2px 4px !important;
    overflow: hidden !important;
    font-size: .49rem !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
}

body.designer-shell.designer-mobile-ui.designer-mobile-landscape .library-panel,
body.designer-shell.designer-mobile-ui.designer-mobile-landscape .properties-panel {
    top: 52px !important;
    bottom: 48px !important;
    width: min(330px, 40vw) !important;
    min-width: 260px !important;
    max-width: 330px !important;
    max-height: none !important;
    padding: 7px !important;
    border-radius: 14px !important;
}
body.designer-shell.designer-mobile-ui.designer-mobile-landscape .library-panel {
    right: 8px !important;
    left: auto !important;
}
body.designer-shell.designer-mobile-ui.designer-mobile-landscape .properties-panel {
    right: auto !important;
    left: 8px !important;
}
body.designer-shell.designer-mobile-ui.designer-mobile-landscape .room-workspace:not(.library-collapsed) .library-edge-toggle,
body.designer-shell.designer-mobile-ui.designer-mobile-landscape .room-workspace:not(.properties-collapsed) .properties-edge-toggle {
    position: sticky !important;
    top: 0 !important;
    bottom: auto !important;
    order: -100 !important;
    height: 36px !important;
    min-height: 36px !important;
    margin: 0 0 6px !important;
    padding: 4px 8px !important;
    border-radius: 10px !important;
}
body.designer-shell.designer-mobile-ui.designer-mobile-landscape .room-workspace.library-collapsed .library-panel,
body.designer-shell.designer-mobile-ui.designer-mobile-landscape .room-workspace.properties-collapsed .properties-panel {
    top: 50% !important;
    bottom: auto !important;
    z-index: 90 !important;
    width: 52px !important;
    min-width: 52px !important;
    max-width: 52px !important;
    height: 112px !important;
    min-height: 112px !important;
    max-height: 112px !important;
    padding: 0 !important;
    overflow: visible !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    transform: translateY(-50%) !important;
    pointer-events: none !important;
}
body.designer-shell.designer-mobile-ui.designer-mobile-landscape .room-workspace.library-collapsed .library-panel {
    right: 8px !important;
    left: auto !important;
}
body.designer-shell.designer-mobile-ui.designer-mobile-landscape .room-workspace.properties-collapsed .properties-panel {
    right: auto !important;
    left: 8px !important;
}
body.designer-shell.designer-mobile-ui.designer-mobile-landscape .room-workspace.library-collapsed .library-panel > :not(.panel-edge-toggle),
body.designer-shell.designer-mobile-ui.designer-mobile-landscape .room-workspace.properties-collapsed .properties-panel > :not(.panel-edge-toggle) {
    display: none !important;
}
body.designer-shell.designer-mobile-ui.designer-mobile-landscape .room-workspace.library-collapsed .library-edge-toggle,
body.designer-shell.designer-mobile-ui.designer-mobile-landscape .room-workspace.properties-collapsed .properties-edge-toggle {
    position: absolute !important;
    inset: 0 !important;
    z-index: 100 !important;
    display: flex !important;
    width: 52px !important;
    min-width: 52px !important;
    height: 112px !important;
    min-height: 112px !important;
    margin: 0 !important;
    padding: 8px 4px !important;
    transform: none !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 7px !important;
    pointer-events: auto !important;
    border-radius: 999px !important;
    background: rgba(255, 253, 247, .98) !important;
    box-shadow: 0 8px 22px rgba(0, 0, 0, .22) !important;
}
body.designer-shell.designer-mobile-ui.designer-mobile-landscape .room-workspace.library-collapsed .panel-edge-toggle-label,
body.designer-shell.designer-mobile-ui.designer-mobile-landscape .room-workspace.properties-collapsed .panel-edge-toggle-label {
    display: block !important;
    max-width: 44px !important;
    font-size: .58rem !important;
    line-height: 1.08 !important;
    white-space: normal !important;
    text-align: center !important;
}

body.designer-shell.designer-mobile-ui.designer-mobile-landscape .properties-panel .room-dimensions-panel {
    margin-bottom: 5px !important;
    padding: 5px !important;
}
body.designer-shell.designer-mobile-ui.designer-mobile-landscape .properties-panel .room-dimensions-panel .control-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 4px !important;
}
body.designer-shell.designer-mobile-ui.designer-mobile-landscape .properties-panel .property-tab-groups {
    position: sticky !important;
    top: 42px !important;
    z-index: 5 !important;
    display: flex !important;
    flex-wrap: nowrap !important;
    gap: 4px !important;
    margin: 0 0 5px !important;
    padding: 3px 0 5px !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    background: rgba(250, 247, 238, .985) !important;
    scrollbar-width: none !important;
}
body.designer-shell.designer-mobile-ui.designer-mobile-landscape .properties-panel .property-tab-groups::-webkit-scrollbar {
    display: none !important;
}
body.designer-shell.designer-mobile-ui.designer-mobile-landscape .properties-panel .property-tab-group {
    flex: 0 0 auto !important;
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
}
body.designer-shell.designer-mobile-ui.designer-mobile-landscape .properties-panel .property-tab-group-title {
    display: none !important;
}
body.designer-shell.designer-mobile-ui.designer-mobile-landscape .properties-panel .properties-tabs {
    gap: 3px !important;
    overflow: visible !important;
}
body.designer-shell.designer-mobile-ui.designer-mobile-landscape .properties-panel .properties-tabs button {
    min-height: 28px !important;
    padding: 3px 6px !important;
    font-size: .55rem !important;
    white-space: nowrap !important;
}
body.designer-shell.designer-mobile-ui.designer-mobile-landscape .properties-panel .control-grid,
body.designer-shell.designer-mobile-ui.designer-mobile-landscape .properties-panel .control-grid.compact-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 5px !important;
}

body.designer-shell.designer-mobile-ui.designer-mobile-landscape .selection-toolbar,
body.designer-shell.designer-mobile-ui.designer-mobile-landscape .room-stage.inside-camera-view .selection-toolbar {
    right: 64px !important;
    bottom: 5px !important;
    left: 64px !important;
    display: flex !important;
    align-items: center !important;
    gap: 4px !important;
    width: auto !important;
    min-height: 36px !important;
    height: 36px !important;
    max-height: 36px !important;
    padding: 4px 5px !important;
    overflow: hidden !important;
    border-radius: 10px !important;
}
body.designer-shell.designer-mobile-ui.designer-mobile-landscape .selection-toolbar span,
body.designer-shell.designer-mobile-ui.designer-mobile-landscape .room-stage.inside-camera-view .selection-toolbar span {
    display: block !important;
    flex: 1 1 auto !important;
    min-width: 0 !important;
    padding-inline: 4px !important;
    font-size: .55rem !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}
body.designer-shell.designer-mobile-ui.designer-mobile-landscape .selection-toolbar strong,
body.designer-shell.designer-mobile-ui.designer-mobile-landscape .room-stage.inside-camera-view .selection-toolbar strong {
    display: none !important;
}
body.designer-shell.designer-mobile-ui.designer-mobile-landscape .selection-toolbar button,
body.designer-shell.designer-mobile-ui.designer-mobile-landscape .room-stage.inside-camera-view .selection-toolbar button {
    flex: 0 0 56px !important;
    width: 56px !important;
    min-width: 56px !important;
    height: 28px !important;
    min-height: 28px !important;
    padding: 3px 4px !important;
    font-size: .52rem !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}
body.designer-shell.designer-mobile-ui.designer-mobile-landscape .room-stage:not(.has-selection) .selection-toolbar button {
    display: none !important;
}

body.designer-shell.designer-mobile-ui.designer-mobile-portrait .room-stage.mobile-drop-target::after {
    inset: 86px 14px 54px !important;
}
body.designer-shell.designer-mobile-ui.designer-mobile-landscape .room-stage.mobile-drop-target::after {
    inset: 48px 58px 42px !important;
}

/* =========================================================
   PHASE 9B v1.5 — deterministic phone drawers + toolbar + desktop dock fix
   Final override layer. Keep this at the END of app.css so old experiments
   cannot win the cascade.
   ========================================================= */

/* The arrow is drawn with CSS instead of a text glyph so it is always
   optically centered inside the circle on Android/WebView. */
body.designer-shell.designer-mobile-ui .panel-edge-toggle-arrow {
    position: relative !important;
    display: inline-grid !important;
    place-items: center !important;
    flex: 0 0 24px !important;
    width: 24px !important;
    min-width: 24px !important;
    height: 24px !important;
    min-height: 24px !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    border-radius: 50% !important;
    background: #173b34 !important;
    color: transparent !important;
    font-size: 0 !important;
    line-height: 0 !important;
    transform: none !important;
}
body.designer-shell.designer-mobile-ui .panel-edge-toggle-arrow::before {
    content: "" !important;
    display: block !important;
    width: 7px !important;
    height: 7px !important;
    border-right: 2px solid #fffdf7 !important;
    border-bottom: 2px solid #fffdf7 !important;
    transform-origin: 50% 50% !important;
}
/* Portrait directions: Library opens downward; Components opens upward. */
body.designer-shell.designer-mobile-ui.designer-mobile-portrait .room-workspace.library-collapsed .library-edge-toggle .panel-edge-toggle-arrow::before {
    transform: translateY(-2px) rotate(45deg) !important;
}
body.designer-shell.designer-mobile-ui.designer-mobile-portrait .room-workspace:not(.library-collapsed) .library-edge-toggle .panel-edge-toggle-arrow::before {
    transform: translateY(2px) rotate(225deg) !important;
}
body.designer-shell.designer-mobile-ui.designer-mobile-portrait .room-workspace.properties-collapsed .properties-edge-toggle .panel-edge-toggle-arrow::before {
    transform: translateY(2px) rotate(225deg) !important;
}
body.designer-shell.designer-mobile-ui.designer-mobile-portrait .room-workspace:not(.properties-collapsed) .properties-edge-toggle .panel-edge-toggle-arrow::before {
    transform: translateY(-2px) rotate(45deg) !important;
}
/* Landscape directions: Components is LEFT; Library is RIGHT. */
body.designer-shell.designer-mobile-ui.designer-mobile-landscape .room-workspace.library-collapsed .library-edge-toggle .panel-edge-toggle-arrow::before {
    transform: translateX(2px) rotate(135deg) !important;
}
body.designer-shell.designer-mobile-ui.designer-mobile-landscape .room-workspace:not(.library-collapsed) .library-edge-toggle .panel-edge-toggle-arrow::before {
    transform: translateX(-2px) rotate(315deg) !important;
}
body.designer-shell.designer-mobile-ui.designer-mobile-landscape .room-workspace.properties-collapsed .properties-edge-toggle .panel-edge-toggle-arrow::before {
    transform: translateX(-2px) rotate(315deg) !important;
}
body.designer-shell.designer-mobile-ui.designer-mobile-landscape .room-workspace:not(.properties-collapsed) .properties-edge-toggle .panel-edge-toggle-arrow::before {
    transform: translateX(2px) rotate(135deg) !important;
}

/* ---------- PORTRAIT: exact top/bottom drawers ---------- */
body.designer-shell.designer-mobile-ui.designer-mobile-portrait .room-toolbar,
body.designer-shell.designer-mobile-ui.designer-mobile-portrait .stage-toolbar {
    position: fixed !important;
    top: 8px !important;
    right: 10px !important;
    left: 10px !important;
    z-index: 120 !important;
    display: grid !important;
    grid-template-columns: 96px minmax(0, 1fr) !important;
    grid-template-rows: 32px 34px !important;
    grid-template-areas:
        "dimensions actions"
        "ai ai" !important;
    align-items: center !important;
    gap: 4px 8px !important;
    width: auto !important;
    height: 80px !important;
    min-height: 80px !important;
    max-height: 80px !important;
    padding: 5px 7px !important;
    margin: 0 !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
    border-radius: 12px !important;
    direction: rtl !important;
}
body.designer-shell.designer-mobile-ui.designer-mobile-portrait .room-dimensions-display {
    grid-area: dimensions !important;
    width: 96px !important;
    min-width: 96px !important;
    max-width: 96px !important;
    height: 31px !important;
    min-height: 31px !important;
    max-height: 31px !important;
    margin: 0 !important;
    padding: 2px 4px !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
}
body.designer-shell.designer-mobile-ui.designer-mobile-portrait .room-dimensions-display span {
    font-size: .50rem !important;
    line-height: 1 !important;
}
body.designer-shell.designer-mobile-ui.designer-mobile-portrait .room-dimensions-display strong {
    margin-top: 2px !important;
    font-size: .58rem !important;
    line-height: 1 !important;
    white-space: nowrap !important;
}
body.designer-shell.designer-mobile-ui.designer-mobile-portrait .stage-actions {
    grid-area: actions !important;
    display: grid !important;
    grid-auto-flow: column !important;
    grid-auto-columns: 29px !important;
    align-items: center !important;
    justify-content: end !important;
    gap: 4px !important;
    width: 100% !important;
    min-width: 0 !important;
    height: 31px !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    direction: ltr !important;
}
body.designer-shell.designer-mobile-ui.designer-mobile-portrait .stage-actions > button,
body.designer-shell.designer-mobile-ui.designer-mobile-portrait .stage-actions > a,
body.designer-shell.designer-mobile-ui.designer-mobile-portrait .designer-projects-icon,
body.designer-shell.designer-mobile-ui.designer-mobile-portrait #resetRoomButton {
    display: inline-grid !important;
    place-items: center !important;
    width: 29px !important;
    min-width: 29px !important;
    max-width: 29px !important;
    height: 29px !important;
    min-height: 29px !important;
    max-height: 29px !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
    border-radius: 8px !important;
    line-height: 1 !important;
}
body.designer-shell.designer-mobile-ui.designer-mobile-portrait .stage-ai-zone {
    grid-area: ai !important;
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    height: 34px !important;
    min-height: 34px !important;
    max-height: 34px !important;
    margin: 0 !important;
    overflow: hidden !important;
}
body.designer-shell.designer-mobile-ui.designer-mobile-portrait .ai-render-controls {
    display: grid !important;
    grid-template-columns: minmax(118px, 1fr) 76px 74px !important;
    align-items: center !important;
    gap: 5px !important;
    width: 100% !important;
    min-width: 0 !important;
    height: 32px !important;
    margin: 0 !important;
    overflow: hidden !important;
    direction: rtl !important;
}
body.designer-shell.designer-mobile-ui.designer-mobile-portrait .ai-single-split {
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    height: 30px !important;
}
body.designer-shell.designer-mobile-ui.designer-mobile-portrait .ai-single-create-button {
    width: calc(100% - 32px) !important;
    min-width: 0 !important;
    max-width: none !important;
    height: 30px !important;
    padding: 0 5px !important;
    font-size: .58rem !important;
}
body.designer-shell.designer-mobile-ui.designer-mobile-portrait .ai-side-picker {
    width: 32px !important;
    min-width: 32px !important;
    max-width: 32px !important;
    height: 30px !important;
    min-height: 30px !important;
    max-height: 30px !important;
}
body.designer-shell.designer-mobile-ui.designer-mobile-portrait .ai-render-all-button {
    width: 76px !important;
    min-width: 76px !important;
    max-width: 76px !important;
    height: 30px !important;
    min-height: 30px !important;
    max-height: 30px !important;
    padding: 0 5px !important;
    font-size: .55rem !important;
}
body.designer-shell.designer-mobile-ui.designer-mobile-portrait .ai-credit-badge {
    width: 74px !important;
    min-width: 74px !important;
    max-width: 74px !important;
    min-height: 28px !important;
    padding: 3px 4px !important;
    overflow: hidden !important;
    font-size: .49rem !important;
    white-space: nowrap !important;
    text-overflow: ellipsis !important;
}

/* Closed drawer handles are fixed to the visual center — never inherited from
   desktop side-rail geometry. */
body.designer-shell.designer-mobile-ui.designer-mobile-portrait .room-workspace.library-collapsed .library-panel {
    position: fixed !important;
    top: 96px !important;
    right: auto !important;
    bottom: auto !important;
    left: 50% !important;
    z-index: 130 !important;
    width: 164px !important;
    min-width: 164px !important;
    max-width: 164px !important;
    height: 42px !important;
    min-height: 42px !important;
    max-height: 42px !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    overflow: visible !important;
    transform: translateX(-50%) !important;
    pointer-events: none !important;
}
body.designer-shell.designer-mobile-ui.designer-mobile-portrait .room-workspace.properties-collapsed .properties-panel {
    position: fixed !important;
    top: auto !important;
    right: auto !important;
    bottom: 9px !important;
    left: 50% !important;
    z-index: 130 !important;
    width: 164px !important;
    min-width: 164px !important;
    max-width: 164px !important;
    height: 42px !important;
    min-height: 42px !important;
    max-height: 42px !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    overflow: visible !important;
    transform: translateX(-50%) !important;
    pointer-events: none !important;
}
body.designer-shell.designer-mobile-ui.designer-mobile-portrait .room-workspace.library-collapsed .library-edge-toggle,
body.designer-shell.designer-mobile-ui.designer-mobile-portrait .room-workspace.properties-collapsed .properties-edge-toggle {
    position: absolute !important;
    inset: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    width: 164px !important;
    min-width: 164px !important;
    max-width: 164px !important;
    height: 42px !important;
    min-height: 42px !important;
    max-height: 42px !important;
    margin: 0 !important;
    padding: 5px 12px !important;
    transform: none !important;
    pointer-events: auto !important;
    box-sizing: border-box !important;
    border-radius: 999px !important;
}

/* OPEN Library = top centered card. OPEN Components = bottom centered card.
   Both share the exact same width/surface; only the anchor is mirrored. */
body.designer-shell.designer-mobile-ui.designer-mobile-portrait .room-workspace:not(.library-collapsed) .library-panel,
body.designer-shell.designer-mobile-ui.designer-mobile-portrait .room-workspace:not(.properties-collapsed) .properties-panel {
    position: fixed !important;
    right: auto !important;
    left: 50% !important;
    z-index: 125 !important;
    display: flex !important;
    flex-direction: column !important;
    width: calc(100vw - 24px) !important;
    min-width: 0 !important;
    max-width: 420px !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: min(52dvh, 470px) !important;
    margin: 0 !important;
    padding: 10px !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    box-sizing: border-box !important;
    transform: translateX(-50%) !important;
}
body.designer-shell.designer-mobile-ui.designer-mobile-portrait .room-workspace:not(.library-collapsed) .library-panel {
    top: 96px !important;
    bottom: auto !important;
    padding-top: 54px !important;
}
body.designer-shell.designer-mobile-ui.designer-mobile-portrait .room-workspace:not(.properties-collapsed) .properties-panel {
    top: auto !important;
    bottom: 9px !important;
    padding-bottom: 54px !important;
}
body.designer-shell.designer-mobile-ui.designer-mobile-portrait .room-workspace:not(.library-collapsed) .library-edge-toggle {
    position: absolute !important;
    top: 8px !important;
    right: 8px !important;
    bottom: auto !important;
    left: 8px !important;
    order: 0 !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    height: 38px !important;
    min-height: 38px !important;
    margin: 0 !important;
    padding: 5px 10px !important;
    transform: none !important;
}
body.designer-shell.designer-mobile-ui.designer-mobile-portrait .room-workspace:not(.properties-collapsed) .properties-edge-toggle {
    position: absolute !important;
    top: auto !important;
    right: 8px !important;
    bottom: 8px !important;
    left: 8px !important;
    order: 0 !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    height: 38px !important;
    min-height: 38px !important;
    margin: 0 !important;
    padding: 5px 10px !important;
    transform: none !important;
}
/* Hide the action strip while a drawer is open; it remains exactly where it was
   when the drawer closes instead of fighting for the same bottom pixels. */
body.designer-shell.designer-mobile-ui.designer-mobile-portrait .room-workspace:not(.library-collapsed) .selection-toolbar,
body.designer-shell.designer-mobile-ui.designer-mobile-portrait .room-workspace:not(.properties-collapsed) .selection-toolbar {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

/* ---------- LANDSCAPE: Components fixed LEFT, Library fixed RIGHT ---------- */
body.designer-shell.designer-mobile-ui.designer-mobile-landscape .room-toolbar,
body.designer-shell.designer-mobile-ui.designer-mobile-landscape .stage-toolbar {
    position: fixed !important;
    top: 7px !important;
    right: 64px !important;
    left: 64px !important;
    z-index: 120 !important;
    display: grid !important;
    grid-template-columns: 116px 150px minmax(260px, 1fr) !important;
    grid-template-areas: "dimensions actions ai" !important;
    align-items: center !important;
    gap: 6px !important;
    width: auto !important;
    height: 44px !important;
    min-height: 44px !important;
    max-height: 44px !important;
    margin: 0 !important;
    padding: 5px 7px !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
    direction: rtl !important;
}
body.designer-shell.designer-mobile-ui.designer-mobile-landscape .room-dimensions-display {
    grid-area: dimensions !important;
    width: 116px !important;
    min-width: 116px !important;
    max-width: 116px !important;
    height: 32px !important;
    min-height: 32px !important;
    padding: 2px 5px !important;
    overflow: hidden !important;
}
body.designer-shell.designer-mobile-ui.designer-mobile-landscape .stage-actions {
    grid-area: actions !important;
    display: grid !important;
    grid-auto-flow: column !important;
    grid-auto-columns: 27px !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 3px !important;
    width: 150px !important;
    min-width: 150px !important;
    max-width: 150px !important;
    height: 32px !important;
    overflow: hidden !important;
    direction: ltr !important;
}
body.designer-shell.designer-mobile-ui.designer-mobile-landscape .stage-actions > button,
body.designer-shell.designer-mobile-ui.designer-mobile-landscape .stage-actions > a,
body.designer-shell.designer-mobile-ui.designer-mobile-landscape #resetRoomButton,
body.designer-shell.designer-mobile-ui.designer-mobile-landscape .designer-projects-icon {
    display: inline-grid !important;
    place-items: center !important;
    width: 27px !important;
    min-width: 27px !important;
    max-width: 27px !important;
    height: 27px !important;
    min-height: 27px !important;
    max-height: 27px !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
    line-height: 1 !important;
}
body.designer-shell.designer-mobile-ui.designer-mobile-landscape .stage-ai-zone {
    grid-area: ai !important;
    width: 100% !important;
    min-width: 0 !important;
    height: 32px !important;
    overflow: hidden !important;
}
body.designer-shell.designer-mobile-ui.designer-mobile-landscape .ai-render-controls {
    display: grid !important;
    grid-template-columns: minmax(120px, 1fr) 78px 76px !important;
    align-items: center !important;
    gap: 4px !important;
    width: 100% !important;
    min-width: 0 !important;
    height: 30px !important;
    overflow: hidden !important;
}
body.designer-shell.designer-mobile-ui.designer-mobile-landscape .ai-single-split {
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    height: 28px !important;
}
body.designer-shell.designer-mobile-ui.designer-mobile-landscape .ai-single-create-button {
    width: calc(100% - 30px) !important;
    min-width: 0 !important;
    max-width: none !important;
    height: 28px !important;
    padding: 0 4px !important;
}
body.designer-shell.designer-mobile-ui.designer-mobile-landscape .ai-side-picker {
    width: 30px !important;
    min-width: 30px !important;
    max-width: 30px !important;
    height: 28px !important;
    min-height: 28px !important;
}
body.designer-shell.designer-mobile-ui.designer-mobile-landscape .ai-render-all-button {
    width: 78px !important;
    min-width: 78px !important;
    max-width: 78px !important;
    height: 28px !important;
    min-height: 28px !important;
    padding: 0 4px !important;
    font-size: .52rem !important;
}
body.designer-shell.designer-mobile-ui.designer-mobile-landscape .ai-credit-badge {
    width: 76px !important;
    min-width: 76px !important;
    max-width: 76px !important;
    min-height: 27px !important;
    padding: 2px 4px !important;
    overflow: hidden !important;
    font-size: .48rem !important;
    white-space: nowrap !important;
    text-overflow: ellipsis !important;
}

body.designer-shell.designer-mobile-ui.designer-mobile-landscape .room-workspace:not(.library-collapsed) .library-panel,
body.designer-shell.designer-mobile-ui.designer-mobile-landscape .room-workspace:not(.properties-collapsed) .properties-panel {
    position: fixed !important;
    top: 58px !important;
    bottom: 48px !important;
    z-index: 125 !important;
    width: min(330px, 39vw) !important;
    min-width: 250px !important;
    max-width: 330px !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    margin: 0 !important;
    padding: 10px !important;
    overflow: auto !important;
    transform: none !important;
    box-sizing: border-box !important;
}
body.designer-shell.designer-mobile-ui.designer-mobile-landscape .room-workspace:not(.library-collapsed) .library-panel {
    right: 8px !important;
    left: auto !important;
    padding-top: 52px !important;
}
body.designer-shell.designer-mobile-ui.designer-mobile-landscape .room-workspace:not(.properties-collapsed) .properties-panel {
    right: auto !important;
    left: 8px !important;
    padding-top: 52px !important;
}
body.designer-shell.designer-mobile-ui.designer-mobile-landscape .room-workspace:not(.library-collapsed) .library-edge-toggle,
body.designer-shell.designer-mobile-ui.designer-mobile-landscape .room-workspace:not(.properties-collapsed) .properties-edge-toggle {
    position: absolute !important;
    top: 8px !important;
    right: 8px !important;
    bottom: auto !important;
    left: 8px !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    height: 36px !important;
    min-height: 36px !important;
    margin: 0 !important;
    padding: 4px 9px !important;
    transform: none !important;
}
/* Closed side handles: fixed physical sides, regardless of RTL/grid state. */
body.designer-shell.designer-mobile-ui.designer-mobile-landscape .room-workspace.library-collapsed .library-panel {
    position: fixed !important;
    top: 50% !important;
    right: 8px !important;
    bottom: auto !important;
    left: auto !important;
    z-index: 130 !important;
    width: 54px !important;
    min-width: 54px !important;
    max-width: 54px !important;
    height: 116px !important;
    min-height: 116px !important;
    max-height: 116px !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    overflow: visible !important;
    transform: translateY(-50%) !important;
    pointer-events: none !important;
}
body.designer-shell.designer-mobile-ui.designer-mobile-landscape .room-workspace.properties-collapsed .properties-panel {
    position: fixed !important;
    top: 50% !important;
    right: auto !important;
    bottom: auto !important;
    left: 8px !important;
    z-index: 130 !important;
    width: 54px !important;
    min-width: 54px !important;
    max-width: 54px !important;
    height: 116px !important;
    min-height: 116px !important;
    max-height: 116px !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    overflow: visible !important;
    transform: translateY(-50%) !important;
    pointer-events: none !important;
}
body.designer-shell.designer-mobile-ui.designer-mobile-landscape .room-workspace.library-collapsed .library-edge-toggle,
body.designer-shell.designer-mobile-ui.designer-mobile-landscape .room-workspace.properties-collapsed .properties-edge-toggle {
    position: absolute !important;
    inset: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    width: 54px !important;
    min-width: 54px !important;
    max-width: 54px !important;
    height: 116px !important;
    min-height: 116px !important;
    max-height: 116px !important;
    margin: 0 !important;
    padding: 8px 4px !important;
    transform: none !important;
    pointer-events: auto !important;
    box-sizing: border-box !important;
    border-radius: 999px !important;
}

/* ---------- DESKTOP: both docked panels open ----------
   The stage ResizeObserver adds designer-desktop-stage-narrow when side panels
   squeeze the canvas. Toolbar becomes one compact row and canvas starts below it. */
body.designer-shell:not(.designer-mobile-ui).designer-desktop-stage-narrow .room-toolbar,
body.designer-shell:not(.designer-mobile-ui).designer-desktop-stage-narrow .stage-toolbar {
    position: absolute !important;
    top: 8px !important;
    right: 10px !important;
    left: 10px !important;
    z-index: 20 !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 7px !important;
    width: auto !important;
    height: 52px !important;
    min-height: 52px !important;
    max-height: 52px !important;
    padding: 6px 8px !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
}
body.designer-shell:not(.designer-mobile-ui).designer-desktop-stage-narrow .designer-brand-chip {
    display: none !important;
}
body.designer-shell:not(.designer-mobile-ui).designer-desktop-stage-narrow .stage-actions {
    flex: 0 0 auto !important;
    display: flex !important;
    align-items: center !important;
    gap: 4px !important;
    min-width: 0 !important;
    overflow: hidden !important;
}
body.designer-shell:not(.designer-mobile-ui).designer-desktop-stage-narrow .stage-actions > button,
body.designer-shell:not(.designer-mobile-ui).designer-desktop-stage-narrow .stage-actions > a {
    flex: 0 0 34px !important;
    width: 34px !important;
    min-width: 34px !important;
    max-width: 34px !important;
    height: 34px !important;
    min-height: 34px !important;
    max-height: 34px !important;
    padding: 0 !important;
    overflow: hidden !important;
}
body.designer-shell:not(.designer-mobile-ui).designer-desktop-stage-narrow #resetRoomButton {
    font-size: 0 !important;
}
body.designer-shell:not(.designer-mobile-ui).designer-desktop-stage-narrow #resetRoomButton::after {
    content: "↺" !important;
    font-size: 1rem !important;
    font-weight: 900 !important;
}
body.designer-shell:not(.designer-mobile-ui).designer-desktop-stage-narrow .stage-ai-zone {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    max-width: none !important;
    overflow: hidden !important;
}
body.designer-shell:not(.designer-mobile-ui).designer-desktop-stage-narrow .ai-render-controls {
    display: flex !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 5px !important;
    min-width: 0 !important;
    overflow: hidden !important;
}
body.designer-shell:not(.designer-mobile-ui).designer-desktop-stage-narrow .ai-single-create-button {
    min-width: 90px !important;
    padding-inline: 6px !important;
}
body.designer-shell:not(.designer-mobile-ui).designer-desktop-stage-narrow .ai-render-all-button {
    min-width: 84px !important;
    padding-inline: 6px !important;
}
body.designer-shell:not(.designer-mobile-ui).designer-desktop-stage-narrow .ai-credit-badge {
    flex: 0 1 94px !important;
    min-width: 70px !important;
    max-width: 94px !important;
    overflow: hidden !important;
    white-space: nowrap !important;
    text-overflow: ellipsis !important;
}
body.designer-shell:not(.designer-mobile-ui).designer-desktop-stage-narrow .room-dimensions-display {
    flex: 0 0 130px !important;
    width: 130px !important;
    min-width: 130px !important;
    max-width: 130px !important;
    overflow: hidden !important;
}
/* Reserve physical canvas space below the compact toolbar instead of drawing
   the kitchen underneath it when both desktop side panels are open. */
body.designer-shell:not(.designer-mobile-ui).designer-desktop-stage-narrow .designer-canvas,
body.designer-shell:not(.designer-mobile-ui).designer-desktop-stage-narrow .designer-webgl-overlay {
    top: 60px !important;
    right: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: calc(100% - 60px) !important;
}

/* =========================================================
   END PHASE 9B v1.5
   ========================================================= */

/* =========================================================
   PHASE 9B v1.6 — small stability pass
   - perfectly centered drawer arrows
   - restore the previously-good landscape toolbar geometry
   - keep every portrait action (Reset/Undo/Redo/Save/Projects) visible
   ========================================================= */

/* Symmetric triangle icon centered by geometry, not by font glyph metrics. */
body.designer-shell.designer-mobile-ui .panel-edge-toggle-arrow::before {
    content: "" !important;
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    display: block !important;
    width: 0 !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-left: 5px solid transparent !important;
    border-right: 5px solid transparent !important;
    border-top: 7px solid #fffdf7 !important;
    transform-origin: 50% 50% !important;
}
/* Portrait: Library opens down / Components opens up. */
body.designer-shell.designer-mobile-ui.designer-mobile-portrait .room-workspace.library-collapsed .library-edge-toggle .panel-edge-toggle-arrow::before {
    transform: translate(-50%, -50%) rotate(0deg) !important;
}
body.designer-shell.designer-mobile-ui.designer-mobile-portrait .room-workspace:not(.library-collapsed) .library-edge-toggle .panel-edge-toggle-arrow::before {
    transform: translate(-50%, -50%) rotate(180deg) !important;
}
body.designer-shell.designer-mobile-ui.designer-mobile-portrait .room-workspace.properties-collapsed .properties-edge-toggle .panel-edge-toggle-arrow::before {
    transform: translate(-50%, -50%) rotate(180deg) !important;
}
body.designer-shell.designer-mobile-ui.designer-mobile-portrait .room-workspace:not(.properties-collapsed) .properties-edge-toggle .panel-edge-toggle-arrow::before {
    transform: translate(-50%, -50%) rotate(0deg) !important;
}
/* Landscape: Components LEFT opens right / Library RIGHT opens left. */
body.designer-shell.designer-mobile-ui.designer-mobile-landscape .room-workspace.library-collapsed .library-edge-toggle .panel-edge-toggle-arrow::before {
    transform: translate(-50%, -50%) rotate(90deg) !important;
}
body.designer-shell.designer-mobile-ui.designer-mobile-landscape .room-workspace:not(.library-collapsed) .library-edge-toggle .panel-edge-toggle-arrow::before {
    transform: translate(-50%, -50%) rotate(-90deg) !important;
}
body.designer-shell.designer-mobile-ui.designer-mobile-landscape .room-workspace.properties-collapsed .properties-edge-toggle .panel-edge-toggle-arrow::before {
    transform: translate(-50%, -50%) rotate(-90deg) !important;
}
body.designer-shell.designer-mobile-ui.designer-mobile-landscape .room-workspace:not(.properties-collapsed) .properties-edge-toggle .panel-edge-toggle-arrow::before {
    transform: translate(-50%, -50%) rotate(90deg) !important;
}

/* Portrait: do not let the action strip clip Reset/Undo/Redo/Save/Projects. */
body.designer-shell.designer-mobile-ui.designer-mobile-portrait .stage-actions {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 4px !important;
    width: 100% !important;
    min-width: 0 !important;
    height: 31px !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
    direction: ltr !important;
}
body.designer-shell.designer-mobile-ui.designer-mobile-portrait .stage-actions > button,
body.designer-shell.designer-mobile-ui.designer-mobile-portrait .stage-actions > a,
body.designer-shell.designer-mobile-ui.designer-mobile-portrait .designer-projects-icon {
    flex: 0 0 28px !important;
    display: inline-grid !important;
    place-items: center !important;
    width: 28px !important;
    min-width: 28px !important;
    max-width: 28px !important;
    height: 28px !important;
    min-height: 28px !important;
    max-height: 28px !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
    border-radius: 8px !important;
    font-size: .68rem !important;
    line-height: 1 !important;
}
body.designer-shell.designer-mobile-ui.designer-mobile-portrait #resetRoomButton {
    font-size: 0 !important;
}
body.designer-shell.designer-mobile-ui.designer-mobile-portrait #resetRoomButton::after {
    content: "↺" !important;
    display: block !important;
    font-size: 1rem !important;
    font-weight: 900 !important;
    line-height: 1 !important;
}
body.designer-shell.designer-mobile-ui.designer-mobile-portrait .designer-projects-link:not(.designer-projects-icon) {
    flex: 0 1 auto !important;
    width: auto !important;
    min-width: 52px !important;
    max-width: none !important;
    padding-inline: 6px !important;
    font-size: .58rem !important;
    white-space: nowrap !important;
}

/* LANDSCAPE: restore the compact v1.4 toolbar that was already working well. */
body.designer-shell.designer-mobile-ui.designer-mobile-landscape .room-toolbar,
body.designer-shell.designer-mobile-ui.designer-mobile-landscape .stage-toolbar {
    position: absolute !important;
    top: 5px !important;
    right: 58px !important;
    left: 58px !important;
    z-index: 65 !important;
    display: grid !important;
    grid-template-columns: 96px 152px minmax(0, 1fr) !important;
    grid-template-areas: "dimensions actions ai" !important;
    align-items: center !important;
    gap: 5px !important;
    width: auto !important;
    height: 42px !important;
    min-height: 42px !important;
    max-height: 42px !important;
    padding: 4px 6px !important;
    margin: 0 !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
    border-radius: 11px !important;
    background: rgba(25, 34, 21, .92) !important;
    box-shadow: 0 8px 22px rgba(0, 0, 0, .22) !important;
    backdrop-filter: blur(12px) !important;
    direction: rtl !important;
}
body.designer-shell.designer-mobile-ui.designer-mobile-landscape .room-dimensions-display {
    grid-area: dimensions !important;
    width: 96px !important;
    min-width: 96px !important;
    max-width: 96px !important;
    height: 32px !important;
    min-height: 32px !important;
    max-height: 32px !important;
    margin: 0 !important;
    padding: 2px 4px !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
    line-height: 1.02 !important;
    text-align: center !important;
}
body.designer-shell.designer-mobile-ui.designer-mobile-landscape .room-dimensions-display span {
    font-size: .50rem !important;
}
body.designer-shell.designer-mobile-ui.designer-mobile-landscape .room-dimensions-display strong {
    display: block !important;
    font-size: .57rem !important;
    white-space: nowrap !important;
}
body.designer-shell.designer-mobile-ui.designer-mobile-landscape .stage-actions {
    grid-area: actions !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 3px !important;
    width: 152px !important;
    min-width: 152px !important;
    max-width: 152px !important;
    height: 30px !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
    direction: ltr !important;
}
body.designer-shell.designer-mobile-ui.designer-mobile-landscape .stage-actions > button,
body.designer-shell.designer-mobile-ui.designer-mobile-landscape .stage-actions > a,
body.designer-shell.designer-mobile-ui.designer-mobile-landscape .designer-projects-icon {
    flex: 0 0 27px !important;
    display: inline-grid !important;
    place-items: center !important;
    width: 27px !important;
    min-width: 27px !important;
    max-width: 27px !important;
    height: 27px !important;
    min-height: 27px !important;
    max-height: 27px !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
    border-radius: 7px !important;
    font-size: .64rem !important;
    line-height: 1 !important;
}
body.designer-shell.designer-mobile-ui.designer-mobile-landscape #resetRoomButton {
    font-size: 0 !important;
}
body.designer-shell.designer-mobile-ui.designer-mobile-landscape #resetRoomButton::after {
    content: "↺" !important;
    display: block !important;
    font-size: .95rem !important;
    font-weight: 900 !important;
    line-height: 1 !important;
}
body.designer-shell.designer-mobile-ui.designer-mobile-landscape .designer-projects-link:not(.designer-projects-icon) {
    flex: 0 1 auto !important;
    width: auto !important;
    min-width: 50px !important;
    max-width: none !important;
    padding-inline: 5px !important;
    font-size: .54rem !important;
    white-space: nowrap !important;
}
body.designer-shell.designer-mobile-ui.designer-mobile-landscape .stage-ai-zone {
    grid-area: ai !important;
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    height: 30px !important;
    min-height: 30px !important;
    max-height: 30px !important;
    margin: 0 !important;
    overflow: hidden !important;
}
body.designer-shell.designer-mobile-ui.designer-mobile-landscape .ai-render-controls {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 3px !important;
    width: 100% !important;
    min-width: 0 !important;
    height: 30px !important;
    margin: 0 !important;
    overflow: hidden !important;
    direction: rtl !important;
}
body.designer-shell.designer-mobile-ui.designer-mobile-landscape .ai-single-split {
    flex: 1 1 112px !important;
    min-width: 100px !important;
    max-width: 150px !important;
    height: 28px !important;
}
body.designer-shell.designer-mobile-ui.designer-mobile-landscape .stage-ai-button,
body.designer-shell.designer-mobile-ui.designer-mobile-landscape .ai-render-button {
    height: 28px !important;
    min-height: 28px !important;
    padding: 2px 5px !important;
    font-size: .54rem !important;
}
body.designer-shell.designer-mobile-ui.designer-mobile-landscape .ai-side-picker {
    height: 28px !important;
    min-height: 28px !important;
}
body.designer-shell.designer-mobile-ui.designer-mobile-landscape .ai-render-all-button {
    flex: 0 0 68px !important;
    width: 68px !important;
    min-width: 68px !important;
    max-width: 68px !important;
}
body.designer-shell.designer-mobile-ui.designer-mobile-landscape .ai-credit-badge {
    flex: 0 0 70px !important;
    width: 70px !important;
    min-width: 70px !important;
    max-width: 70px !important;
    min-height: 27px !important;
    padding: 2px 4px !important;
    overflow: hidden !important;
    font-size: .49rem !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
}


/* ============================================================
   12-IMAGE SAFE UI PATCH V32
   No movement / camera / item-addition rules are changed here.
   ============================================================ */

/* Selected tabs keep their label visible. */
body.designer-shell .properties-tabs button.active,
body.designer-shell .properties-tabs button[aria-selected="true"] {
    background: #263820 !important;
    border-color: #263820 !important;
    color: #fffdf7 !important;
    -webkit-text-fill-color: #fffdf7 !important;
    opacity: 1 !important;
}

/* Components title and category strip scroll with their own panel.
   Edge toggle is intentionally NOT overridden: it keeps the exact original
   Library-mirrored mechanics from Patch 31. */
body.designer-shell .properties-panel .panel-title {
    position: static !important;
    top: auto !important;
}
body.designer-shell .properties-panel .property-tab-groups {
    position: static !important;
    top: auto !important;
}

/* Measurements + structure are visually one section. */
body.designer-shell .property-panel[data-property-panel="measurements"]:not([hidden]) {
    margin-bottom: 0 !important;
    border-bottom-left-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
    border-bottom-color: transparent !important;
}
body.designer-shell .property-panel[data-property-panel="body"].merged-body-panel:not([hidden]) {
    margin-top: 0 !important;
    border-top-left-radius: 0 !important;
    border-top-right-radius: 0 !important;
    border-top-color: rgba(31, 41, 55, 0.08) !important;
}

body.designer-shell .property-panel.designer-empty-panel {
    display: none !important;
}


/* PATCH 32C — keep the Components edge button on the panel rail while the
   ENTIRE Components content (title, room dimensions, tabs and settings) scrolls.
   The previous 32B height:100% scroller could grow with its content under the
   existing flex/grid rules, leaving no actual overflow region. */
@media (min-width: 761px) {
    body.designer-shell .room-workspace:not(.properties-collapsed) .properties-panel {
        /* The panel is the fixed rail shell, exactly like Library. */
        overflow: hidden !important;
    }

    body.designer-shell .room-workspace:not(.properties-collapsed) .properties-panel > .properties-panel-scroll {
        box-sizing: border-box;
        flex: 1 1 0;
        width: 100%;
        min-width: 0;
        min-height: 0;
        max-height: 100%;
        overflow-x: hidden;
        overflow-y: auto;
        overscroll-behavior-y: contain;
        scrollbar-width: thin;
        scrollbar-gutter: stable;
        touch-action: pan-y;
    }
}

/* On phone/tablet layouts the existing panel itself owns scrolling.  Keep the
   wrapper transparent to those established rules. */
@media (max-width: 760px) {
    body.designer-shell .properties-panel > .properties-panel-scroll {
        display: block;
        width: 100%;
        min-width: 0;
        min-height: 0;
        overflow: visible;
    }
}

/* =========================================================
   PATCH 32BF — UI CSS ONLY
   1) Stable desktop toolbar when Library + Components are open together.
   2) Material swatch gap clicks cannot activate the hidden native <select>.
   No JS / renderer / placement / camera changes.
   ========================================================= */

/* The material choices are driven by the visible swatch buttons.  Keeping the
   backing select fully out of layout/focus prevents a click on label whitespace
   (between two swatches) from opening/focusing the clipped native select. */
body.designer-shell .material-picker-field > .material-select-hidden {
    display: none !important;
}

@media (min-width: 761px) {
    /* When both docked panels are open the stage gets narrow.  Give the toolbar
       two deliberate rows instead of squeezing all controls into one line. */
    body.designer-shell:not(.designer-mobile-ui).designer-desktop-stage-narrow
    .room-workspace:not(.library-collapsed):not(.properties-collapsed)
    .room-toolbar,
    body.designer-shell:not(.designer-mobile-ui).designer-desktop-stage-narrow
    .room-workspace:not(.library-collapsed):not(.properties-collapsed)
    .stage-toolbar {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) auto !important;
        grid-template-rows: 36px 42px !important;
        align-items: center !important;
        gap: 6px 10px !important;
        height: 92px !important;
        min-height: 92px !important;
        max-height: 92px !important;
        padding: 6px 8px !important;
        overflow: hidden !important;
    }

    body.designer-shell:not(.designer-mobile-ui).designer-desktop-stage-narrow
    .room-workspace:not(.library-collapsed):not(.properties-collapsed)
    .designer-brand-chip {
        display: none !important;
    }

    body.designer-shell:not(.designer-mobile-ui).designer-desktop-stage-narrow
    .room-workspace:not(.library-collapsed):not(.properties-collapsed)
    .room-dimensions-display {
        grid-column: 1 !important;
        grid-row: 1 !important;
        justify-self: start !important;
        width: auto !important;
        min-width: 0 !important;
        max-width: 190px !important;
        overflow: hidden !important;
    }

    body.designer-shell:not(.designer-mobile-ui).designer-desktop-stage-narrow
    .room-workspace:not(.library-collapsed):not(.properties-collapsed)
    .stage-actions {
        grid-column: 2 !important;
        grid-row: 1 !important;
        justify-self: end !important;
        overflow: visible !important;
    }

    body.designer-shell:not(.designer-mobile-ui).designer-desktop-stage-narrow
    .room-workspace:not(.library-collapsed):not(.properties-collapsed)
    .stage-ai-zone {
        grid-column: 1 / -1 !important;
        grid-row: 2 !important;
        width: 100% !important;
        min-width: 0 !important;
        max-width: none !important;
        justify-content: center !important;
        overflow: hidden !important;
    }

    body.designer-shell:not(.designer-mobile-ui).designer-desktop-stage-narrow
    .room-workspace:not(.library-collapsed):not(.properties-collapsed)
    .ai-render-controls {
        flex-wrap: nowrap !important;
        justify-content: center !important;
        overflow: visible !important;
    }

    /* Keep the kitchen canvas physically below the taller two-row toolbar. */
    body.designer-shell:not(.designer-mobile-ui).designer-desktop-stage-narrow
    .room-workspace:not(.library-collapsed):not(.properties-collapsed)
    .designer-canvas,
    body.designer-shell:not(.designer-mobile-ui).designer-desktop-stage-narrow
    .room-workspace:not(.library-collapsed):not(.properties-collapsed)
    .designer-webgl-overlay {
        top: 100px !important;
        height: calc(100% - 100px) !important;
    }
}

/* ===== Patch 32BI: compact collapsible material pickers ===== */
body.designer-shell .material-image-grid.collapsible-material-picker {
    display: block;
    max-height: none;
    overflow: visible;
    padding: 0;
}

body.designer-shell .material-picker-toggle {
    width: 100%;
    display: grid;
    grid-template-columns: 58px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    min-height: 58px;
    padding: 7px 10px;
    border: 1px solid rgba(31, 41, 55, 0.16);
    border-radius: 11px;
    background: #fff;
    color: #2f3a3a;
    cursor: pointer;
    text-align: start;
}

body.designer-shell .material-picker-toggle:hover,
body.designer-shell .material-picker-toggle[aria-expanded="true"] {
    border-color: #176b60;
    box-shadow: 0 0 0 2px rgba(23, 107, 96, 0.12);
}

body.designer-shell .material-picker-toggle-swatch {
    width: 58px;
    height: 42px;
    border-radius: 8px;
    background-position: center;
    background-size: cover;
    background-repeat: repeat;
    border: 1px solid rgba(31, 41, 55, 0.12);
}

body.designer-shell .material-picker-toggle-label {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 800;
}

body.designer-shell .material-picker-toggle-chevron {
    font-size: 20px;
    line-height: 1;
    transition: transform 0.15s ease;
}

body.designer-shell .material-picker-toggle[aria-expanded="true"] .material-picker-toggle-chevron {
    transform: rotate(180deg);
}

body.designer-shell .material-picker-options {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(82px, 1fr));
    gap: 10px;
    width: 100%;
    max-height: 300px;
    margin-top: 8px;
    padding: 4px;
    overflow-y: auto;
    overflow-x: hidden;
}

body.designer-shell .compact-material-grid .material-picker-options {
    grid-template-columns: repeat(auto-fill, minmax(76px, 1fr));
    max-height: 255px;
}

body.designer-shell .material-picker-options[hidden] {
    display: none !important;
}

/* ============================================================
   PATCH 32BZ — production mobile compactness + visual library
   UI only: no placement, collision, camera, pointer or render math changes.
   ============================================================ */

/* Library cards now carry a deterministic visual thumbnail derived from the
   current catalog product type. Desktop keeps the image beside the text. */
body.designer-shell .object-library button {
    display: grid !important;
    grid-template-columns: 64px minmax(0, 1fr) !important;
    align-items: center !important;
    gap: 9px !important;
    text-align: start !important;
}

body.designer-shell .library-product-thumb {
    display: grid;
    place-items: center;
    width: 64px;
    height: 54px;
    overflow: hidden;
    border: 1px solid rgba(75, 52, 42, .16);
    border-radius: 10px;
    background: linear-gradient(145deg, #fffdf8, #f1eadf);
}

body.designer-shell .library-product-thumb svg {
    display: block;
    width: 58px;
    height: 48px;
}

body.designer-shell .library-product-copy {
    display: block;
    min-width: 0;
}

body.designer-shell .library-product-copy > strong,
body.designer-shell .library-product-copy > span,
body.designer-shell .library-product-copy > small {
    display: block;
    min-width: 0;
}

body.designer-shell .library-product-copy > strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Phone portrait: both drawers use the same top-fixed handle mechanics.
   Components no longer leaves its title/close control at the bottom while the
   settings content scrolls underneath it. */
body.designer-shell.designer-mobile-ui.designer-mobile-portrait
.room-workspace:not(.properties-collapsed) .properties-panel {
    padding-top: 52px !important;
    padding-bottom: 8px !important;
}

body.designer-shell.designer-mobile-ui.designer-mobile-portrait
.room-workspace:not(.properties-collapsed) .properties-edge-toggle {
    position: absolute !important;
    top: 8px !important;
    right: 8px !important;
    bottom: auto !important;
    left: 8px !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    height: 38px !important;
    min-height: 38px !important;
    margin: 0 !important;
    padding: 5px 10px !important;
    transform: none !important;
    z-index: 5 !important;
}

/* The wrapper is the scroll surface on mobile too. This mirrors the desktop
   Components rail and prevents the fixed edge handle from scrolling away. */
body.designer-shell.designer-mobile-ui .room-workspace:not(.properties-collapsed)
.properties-panel {
    overflow: hidden !important;
}

body.designer-shell.designer-mobile-ui .room-workspace:not(.properties-collapsed)
.properties-panel > .properties-panel-scroll {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    min-height: 0 !important;
    max-height: 100% !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    overscroll-behavior-y: contain !important;
    touch-action: pan-y !important;
    scrollbar-width: thin;
}

/* Phone library: deliberately shallow and three products per row so the 3D
   stage remains the dominant surface. */
body.designer-shell.designer-mobile-ui.designer-mobile-portrait
.room-workspace:not(.library-collapsed) .library-panel {
    max-height: min(34dvh, 300px) !important;
}

body.designer-shell.designer-mobile-ui.designer-mobile-portrait .mobile-library-hint,
body.designer-shell.designer-mobile-ui.designer-mobile-portrait .panel-note {
    display: none !important;
}

body.designer-shell.designer-mobile-ui.designer-mobile-portrait .library-section {
    margin: 0 0 5px !important;
}

body.designer-shell.designer-mobile-ui.designer-mobile-portrait .library-section > summary {
    min-height: 26px !important;
    padding: 4px 7px !important;
    font-size: .68rem !important;
    line-height: 1.1 !important;
}

body.designer-shell.designer-mobile-ui.designer-mobile-portrait .library-section-body {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 5px !important;
    padding: 5px 0 1px !important;
}

body.designer-shell.designer-mobile-ui.designer-mobile-portrait .object-library button {
    display: grid !important;
    grid-template-columns: 1fr !important;
    grid-template-rows: 42px auto !important;
    gap: 2px !important;
    min-width: 0 !important;
    min-height: 76px !important;
    padding: 4px !important;
    border-radius: 9px !important;
    text-align: center !important;
    overflow: hidden !important;
}

body.designer-shell.designer-mobile-ui.designer-mobile-portrait .library-product-thumb {
    width: 100% !important;
    height: 42px !important;
    border: 0 !important;
    border-radius: 7px !important;
    background: #fbf7ef !important;
}

body.designer-shell.designer-mobile-ui.designer-mobile-portrait .library-product-thumb svg {
    width: 52px !important;
    height: 40px !important;
}

body.designer-shell.designer-mobile-ui.designer-mobile-portrait .library-product-copy > strong {
    font-size: .61rem !important;
    line-height: 1.15 !important;
    white-space: normal !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden !important;
}

body.designer-shell.designer-mobile-ui.designer-mobile-portrait .library-product-copy > span,
body.designer-shell.designer-mobile-ui.designer-mobile-portrait .library-product-copy > small {
    display: none !important;
}

/* Components: compact room controls and category chips. The content remains
   scrollable, but the first screen shows considerably more usable settings. */
body.designer-shell.designer-mobile-ui.designer-mobile-portrait .properties-panel .room-dimensions-panel {
    margin: 0 0 6px !important;
    padding: 6px !important;
    border-radius: 9px !important;
}

body.designer-shell.designer-mobile-ui.designer-mobile-portrait .properties-panel .room-dimensions-panel .mini-heading {
    margin-bottom: 4px !important;
    font-size: .68rem !important;
}

body.designer-shell.designer-mobile-ui.designer-mobile-portrait .properties-panel .room-dimensions-panel .control-grid,
body.designer-shell.designer-mobile-ui.designer-mobile-portrait .properties-panel .control-grid.compact-grid {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 5px !important;
}

body.designer-shell.designer-mobile-ui.designer-mobile-portrait .properties-panel label {
    min-width: 0 !important;
    gap: 2px !important;
    font-size: .61rem !important;
}

body.designer-shell.designer-mobile-ui.designer-mobile-portrait .properties-panel input,
body.designer-shell.designer-mobile-ui.designer-mobile-portrait .properties-panel select,
body.designer-shell.designer-mobile-ui.designer-mobile-portrait .properties-panel button:not(.panel-edge-toggle):not(.material-picker-toggle) {
    min-height: 30px !important;
}

body.designer-shell.designer-mobile-ui.designer-mobile-portrait .properties-panel .property-tab-groups {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 5px !important;
    margin: 0 0 6px !important;
    padding: 0 !important;
    overflow: visible !important;
}

body.designer-shell.designer-mobile-ui.designer-mobile-portrait .properties-panel .property-tab-group {
    min-width: 0 !important;
    margin: 0 !important;
    padding: 4px !important;
    border: 1px solid rgba(38, 56, 32, .10) !important;
    border-radius: 9px !important;
    background: rgba(255, 253, 248, .86) !important;
}

body.designer-shell.designer-mobile-ui.designer-mobile-portrait .properties-panel .property-tab-group-title {
    display: block !important;
    margin: 0 0 3px !important;
    font-size: .58rem !important;
    opacity: .72 !important;
}

body.designer-shell.designer-mobile-ui.designer-mobile-portrait .properties-panel .properties-tabs {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 3px !important;
    overflow: visible !important;
}

body.designer-shell.designer-mobile-ui.designer-mobile-portrait .properties-panel .properties-tabs button {
    width: 100% !important;
    min-width: 0 !important;
    min-height: 27px !important;
    padding: 3px 4px !important;
    font-size: .56rem !important;
    line-height: 1.1 !important;
    white-space: normal !important;
}

body.designer-shell.designer-mobile-ui.designer-mobile-portrait .properties-panel .property-panel {
    margin-top: 5px !important;
    padding: 7px !important;
    border-radius: 10px !important;
}

body.designer-shell.designer-mobile-ui.designer-mobile-portrait .material-picker-toggle {
    grid-template-columns: 42px minmax(0, 1fr) auto !important;
    min-height: 44px !important;
    padding: 4px 6px !important;
}

body.designer-shell.designer-mobile-ui.designer-mobile-portrait .material-picker-toggle-swatch {
    width: 42px !important;
    height: 32px !important;
}

/* Landscape keeps two narrow side drawers, but uses denser product cards. */
body.designer-shell.designer-mobile-ui.designer-mobile-landscape .library-section-body {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 5px !important;
}

body.designer-shell.designer-mobile-ui.designer-mobile-landscape .object-library button {
    grid-template-columns: 44px minmax(0, 1fr) !important;
    min-height: 48px !important;
    padding: 4px !important;
    gap: 4px !important;
}

body.designer-shell.designer-mobile-ui.designer-mobile-landscape .library-product-thumb {
    width: 44px !important;
    height: 40px !important;
}

body.designer-shell.designer-mobile-ui.designer-mobile-landscape .library-product-thumb svg {
    width: 42px !important;
    height: 36px !important;
}

body.designer-shell.designer-mobile-ui.designer-mobile-landscape .library-product-copy > span,
body.designer-shell.designer-mobile-ui.designer-mobile-landscape .library-product-copy > small {
    display: none !important;
}

body.designer-shell.designer-mobile-ui.designer-mobile-landscape .library-product-copy > strong {
    font-size: .6rem !important;
    white-space: normal !important;
}

/* Generic mobile overflow guard for the designer chrome only. */
body.designer-shell.designer-mobile-ui .library-panel *,
body.designer-shell.designer-mobile-ui .properties-panel * {
    box-sizing: border-box;
    max-width: 100%;
}

/* ============================================================
   PATCH 32CA — mobile designer compact rail + navigation polish
   Presentation only. No placement/collision/camera/pointer/render logic changes.
   ============================================================ */

/* Always provide a clear way back to the public site on phones. */
body.designer-shell .designer-mobile-home-link {
    display: none;
}

body.designer-shell.designer-mobile-ui .designer-mobile-home-link {
    position: fixed;
    top: max(8px, env(safe-area-inset-top));
    left: 8px;
    z-index: 180;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 34px;
    padding: 3px 8px 3px 5px;
    border: 1px solid rgba(214, 181, 109, .55);
    border-radius: 999px;
    background: rgba(24, 44, 30, .92);
    color: #f7edcf;
    text-decoration: none;
    box-shadow: 0 5px 18px rgba(0,0,0,.18);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

body.designer-shell.designer-mobile-ui .designer-mobile-home-link img {
    width: 27px;
    height: 27px;
    object-fit: contain;
    border-radius: 50%;
}

body.designer-shell.designer-mobile-ui .designer-mobile-home-link span {
    font-size: .68rem;
    font-weight: 800;
    white-space: nowrap;
}

/* Portrait library becomes one shallow horizontal rail. Only one product row
   is visible at a time; horizontal swipe reveals the rest. */
body.designer-shell.designer-mobile-ui.designer-mobile-portrait
.room-workspace:not(.library-collapsed) .library-panel {
    top: 96px !important;
    width: calc(100vw - 24px) !important;
    max-width: 420px !important;
    max-height: 174px !important;
    min-height: 0 !important;
    padding: 50px 8px 7px !important;
    overflow: hidden !important;
}

body.designer-shell.designer-mobile-ui.designer-mobile-portrait
.room-workspace:not(.library-collapsed) .library-edge-toggle {
    top: 7px !important;
    right: 7px !important;
    left: 7px !important;
    height: 35px !important;
    min-height: 35px !important;
    padding: 3px 9px !important;
}

body.designer-shell.designer-mobile-ui.designer-mobile-portrait .object-library {
    display: flex !important;
    align-items: stretch !important;
    gap: 7px !important;
    width: 100% !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    padding: 0 0 3px !important;
    scroll-snap-type: x proximity;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
    touch-action: pan-x;
}

body.designer-shell.designer-mobile-ui.designer-mobile-portrait .object-library::-webkit-scrollbar {
    display: none;
}

body.designer-shell.designer-mobile-ui.designer-mobile-portrait .library-section {
    display: contents !important;
    margin: 0 !important;
}

body.designer-shell.designer-mobile-ui.designer-mobile-portrait .library-section > summary {
    display: none !important;
}

body.designer-shell.designer-mobile-ui.designer-mobile-portrait .library-section-body {
    display: flex !important;
    flex: 0 0 auto !important;
    gap: 6px !important;
    padding: 0 !important;
}

body.designer-shell.designer-mobile-ui.designer-mobile-portrait .object-library button {
    flex: 0 0 88px !important;
    width: 88px !important;
    min-width: 88px !important;
    max-width: 88px !important;
    min-height: 102px !important;
    max-height: 102px !important;
    grid-template-rows: 59px minmax(0, 1fr) !important;
    gap: 3px !important;
    padding: 4px !important;
    border-radius: 10px !important;
    scroll-snap-align: start;
}

body.designer-shell.designer-mobile-ui.designer-mobile-portrait .library-product-thumb {
    height: 59px !important;
    min-height: 59px !important;
}

body.designer-shell.designer-mobile-ui.designer-mobile-portrait .library-product-thumb svg {
    width: 70px !important;
    height: 55px !important;
}

body.designer-shell.designer-mobile-ui.designer-mobile-portrait .library-product-copy > strong {
    font-size: .59rem !important;
    line-height: 1.15 !important;
    -webkit-line-clamp: 2 !important;
}

/* The mobile selection status should not look like a second library caption. */
body.designer-shell.designer-mobile-ui.designer-mobile-portrait .selection-toolbar {
    min-height: 40px !important;
    padding: 4px 8px !important;
    border-radius: 14px !important;
}

body.designer-shell.designer-mobile-ui.designer-mobile-portrait .selection-toolbar:has(#selectedObjectLabel:empty),
body.designer-shell.designer-mobile-ui.designer-mobile-portrait .selection-toolbar:has(#selectedObjectLabel[data-empty="true"]) {
    display: none !important;
}

/* Components uses the same compact drawer language as Library. The drawer is
   shorter by default and its inner content scrolls instead of covering stage. */
body.designer-shell.designer-mobile-ui.designer-mobile-portrait
.room-workspace:not(.properties-collapsed) .properties-panel {
    bottom: 8px !important;
    width: calc(100vw - 24px) !important;
    max-width: 420px !important;
    max-height: min(31dvh, 260px) !important;
    padding: 47px 7px 7px !important;
    overflow: hidden !important;
}

body.designer-shell.designer-mobile-ui.designer-mobile-portrait
.room-workspace:not(.properties-collapsed) .properties-edge-toggle {
    top: 7px !important;
    right: 7px !important;
    bottom: auto !important;
    left: 7px !important;
    height: 34px !important;
    min-height: 34px !important;
    padding: 3px 9px !important;
}

body.designer-shell.designer-mobile-ui.designer-mobile-portrait
.room-workspace:not(.properties-collapsed) .properties-panel > .properties-panel-scroll {
    max-height: 204px !important;
    padding-bottom: 2px !important;
}

body.designer-shell.designer-mobile-ui.designer-mobile-portrait .properties-panel .room-dimensions-panel {
    padding: 4px !important;
    margin-bottom: 4px !important;
}

body.designer-shell.designer-mobile-ui.designer-mobile-portrait .properties-panel .property-tab-groups {
    gap: 3px !important;
    margin-bottom: 4px !important;
}

body.designer-shell.designer-mobile-ui.designer-mobile-portrait .properties-panel .property-tab-group {
    padding: 3px !important;
    border-radius: 8px !important;
}

body.designer-shell.designer-mobile-ui.designer-mobile-portrait .properties-panel .properties-tabs {
    gap: 2px !important;
}

body.designer-shell.designer-mobile-ui.designer-mobile-portrait .properties-panel .properties-tabs button {
    min-height: 24px !important;
    padding: 2px 3px !important;
    font-size: .53rem !important;
}

body.designer-shell.designer-mobile-ui.designer-mobile-portrait .properties-panel .property-panel {
    margin-top: 3px !important;
    padding: 5px !important;
}

/* Color/material controls are deliberately small on phones. */
body.designer-shell.designer-mobile-ui.designer-mobile-portrait .properties-panel input[type="color"] {
    width: 52px !important;
    min-width: 52px !important;
    max-width: 52px !important;
    height: 30px !important;
    min-height: 30px !important;
    padding: 2px !important;
    border-radius: 7px !important;
}

body.designer-shell.designer-mobile-ui.designer-mobile-portrait .material-picker-toggle {
    grid-template-columns: 32px minmax(0, 1fr) 16px !important;
    min-height: 36px !important;
    padding: 3px 5px !important;
}

body.designer-shell.designer-mobile-ui.designer-mobile-portrait .material-picker-toggle-swatch {
    width: 32px !important;
    height: 26px !important;
    border-radius: 6px !important;
}

body.designer-shell.designer-mobile-ui.designer-mobile-portrait .material-picker-toggle-label {
    font-size: .58rem !important;
}

/* Keep labels and controls from producing accidental horizontal overflow. */
body.designer-shell.designer-mobile-ui.designer-mobile-portrait .properties-panel .control-grid,
body.designer-shell.designer-mobile-ui.designer-mobile-portrait .properties-panel .compact-grid {
    min-width: 0 !important;
}

body.designer-shell.designer-mobile-ui.designer-mobile-portrait .properties-panel label,
body.designer-shell.designer-mobile-ui.designer-mobile-portrait .properties-panel input,
body.designer-shell.designer-mobile-ui.designer-mobile-portrait .properties-panel select {
    max-width: 100% !important;
}

/* ===== 32CB: exact Designer3D library thumbnails ==========================
   The image is generated by the same production WebGL/procedural geometry
   pipeline as the actual placed item. The hand-drawn SVG remains only as a
   no-WebGL/loading fallback. */
body.designer-shell .library-product-thumb-exact {
    position: relative;
    overflow: hidden;
    background: #f6f1e8;
    isolation: isolate;
}

body.designer-shell .library-product-thumb-exact .library-product-thumb-fallback,
body.designer-shell .library-product-thumb-exact .library-product-thumb-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

body.designer-shell .library-product-thumb-exact .library-product-thumb-fallback {
    display: grid;
    place-items: center;
    transition: opacity .16s ease;
}

body.designer-shell .library-product-thumb-exact .library-product-thumb-fallback.is-hidden {
    opacity: 0;
    pointer-events: none;
}

body.designer-shell .library-product-thumb-exact .library-product-thumb-image {
    display: block;
    object-fit: contain;
    object-position: center;
    opacity: 0;
    transform: scale(.98);
    transition: opacity .18s ease, transform .18s ease;
    user-select: none;
    -webkit-user-drag: none;
}

body.designer-shell .library-product-thumb-exact .library-product-thumb-image.is-ready {
    opacity: 1;
    transform: scale(1);
}

/* On the one-row mobile rail, give the real model as much card area as possible. */
body.designer-shell.designer-mobile-ui .library-product-thumb-exact .library-product-thumb-image {
    padding: 1px;
}

/* ============================================================
   PATCH 32CC — mobile rail controls + compact material accordion
   Presentation only; no placement/collision/camera/drop math changes.
   ============================================================ */

/* Mobile home affordance: logo only, matching the desktop brand mark. */
body.designer-shell.designer-mobile-ui .designer-mobile-home-link {
    width: 38px !important;
    min-width: 38px !important;
    height: 38px !important;
    padding: 3px !important;
    border-radius: 50% !important;
    justify-content: center !important;
}
body.designer-shell.designer-mobile-ui .designer-mobile-home-link img {
    width: 31px !important;
    height: 31px !important;
    border-radius: 50% !important;
}
body.designer-shell.designer-mobile-ui .designer-mobile-home-link span {
    display: none !important;
}

/* Library is exactly one visual row. The rail itself is swipeable and the
   explicit arrows make discovery/navigation obvious on phones. */
body.designer-shell.designer-mobile-ui.designer-mobile-portrait
.room-workspace:not(.library-collapsed) .library-panel {
    max-height: 146px !important;
    padding: 45px 34px 5px !important;
}

body.designer-shell.designer-mobile-ui.designer-mobile-portrait .object-library {
    height: 92px !important;
    min-height: 92px !important;
    max-height: 92px !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
    touch-action: pan-x !important;
}

body.designer-shell.designer-mobile-ui.designer-mobile-portrait .library-section-body {
    height: 88px !important;
    flex-wrap: nowrap !important;
    align-items: stretch !important;
}

body.designer-shell.designer-mobile-ui.designer-mobile-portrait .object-library button {
    flex: 0 0 78px !important;
    width: 78px !important;
    min-width: 78px !important;
    max-width: 78px !important;
    min-height: 86px !important;
    max-height: 86px !important;
    grid-template-rows: 54px 24px !important;
    padding: 3px !important;
}
body.designer-shell.designer-mobile-ui.designer-mobile-portrait .library-product-thumb {
    height: 54px !important;
    min-height: 54px !important;
}
body.designer-shell.designer-mobile-ui.designer-mobile-portrait .library-product-copy > strong {
    font-size: .55rem !important;
    line-height: 1.08 !important;
    -webkit-line-clamp: 2 !important;
}

body.designer-shell .mobile-library-rail-nav {
    display: none;
}
body.designer-shell.designer-mobile-ui.designer-mobile-portrait .mobile-library-rail-nav {
    position: absolute;
    inset: 45px 4px 5px 4px;
    z-index: 7;
    display: flex;
    align-items: center;
    justify-content: space-between;
    pointer-events: none;
}
body.designer-shell.designer-mobile-ui.designer-mobile-portrait .mobile-library-rail-arrow {
    pointer-events: auto;
    display: grid !important;
    place-items: center;
    width: 27px !important;
    min-width: 27px !important;
    height: 54px !important;
    min-height: 54px !important;
    padding: 0 !important;
    border: 1px solid rgba(45, 61, 47, .18) !important;
    border-radius: 9px !important;
    background: rgba(255, 253, 247, .94) !important;
    color: #264333 !important;
    box-shadow: 0 3px 12px rgba(25, 34, 27, .12) !important;
    font-size: 1.35rem !important;
    line-height: 1 !important;
    touch-action: manipulation !important;
}

/* Compact material/color accordion: one short row = swatch + name + arrow.
   Expanded choices flow inside the main Properties scroll surface; there is no
   nested scrolling area, which removes the dead/jerky touch zones. */
body.designer-shell.designer-mobile-ui.designer-mobile-portrait .collapsible-material-picker {
    width: 100% !important;
    min-width: 0 !important;
    margin: 2px 0 4px !important;
}
body.designer-shell.designer-mobile-ui.designer-mobile-portrait .material-picker-toggle {
    display: grid !important;
    grid-template-columns: 24px minmax(0, 1fr) 14px !important;
    align-items: center !important;
    gap: 5px !important;
    width: 100% !important;
    min-height: 29px !important;
    height: 29px !important;
    padding: 2px 5px !important;
    border-radius: 7px !important;
}
body.designer-shell.designer-mobile-ui.designer-mobile-portrait .material-picker-toggle-swatch {
    width: 22px !important;
    min-width: 22px !important;
    height: 20px !important;
    border-radius: 5px !important;
}
body.designer-shell.designer-mobile-ui.designer-mobile-portrait .material-picker-toggle-label {
    font-size: .56rem !important;
    line-height: 1 !important;
    font-weight: 750 !important;
}
body.designer-shell.designer-mobile-ui.designer-mobile-portrait .material-picker-toggle-chevron {
    display: grid !important;
    place-items: center !important;
    width: 14px !important;
    height: 14px !important;
    font-size: 14px !important;
}
body.designer-shell.designer-mobile-ui.designer-mobile-portrait .material-picker-options,
body.designer-shell.designer-mobile-ui.designer-mobile-portrait .compact-material-grid .material-picker-options {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 4px !important;
    width: 100% !important;
    max-height: none !important;
    margin-top: 4px !important;
    padding: 2px 0 3px !important;
    overflow: visible !important;
    touch-action: pan-y !important;
}
body.designer-shell.designer-mobile-ui.designer-mobile-portrait .material-image-choice {
    min-width: 0 !important;
    min-height: 44px !important;
    height: auto !important;
    padding: 3px !important;
    gap: 2px !important;
    border-radius: 7px !important;
}
body.designer-shell.designer-mobile-ui.designer-mobile-portrait .material-choice-swatch {
    width: 100% !important;
    min-width: 0 !important;
    height: 23px !important;
    min-height: 23px !important;
    border-radius: 5px !important;
}
body.designer-shell.designer-mobile-ui.designer-mobile-portrait .material-choice-label {
    font-size: .48rem !important;
    line-height: 1.05 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
}

/* One vertical scroll owner for Components. Nested controls may expand but do
   not create their own touch scroll zones. */
body.designer-shell.designer-mobile-ui.designer-mobile-portrait
.room-workspace:not(.properties-collapsed) .properties-panel {
    max-height: min(38dvh, 318px) !important;
}
body.designer-shell.designer-mobile-ui.designer-mobile-portrait
.room-workspace:not(.properties-collapsed) .properties-panel > .properties-panel-scroll {
    max-height: min(calc(38dvh - 56px), 258px) !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch !important;
    overscroll-behavior-y: contain !important;
    touch-action: pan-y !important;
    padding-bottom: 16px !important;
    scroll-padding-bottom: 22px !important;
}
body.designer-shell.designer-mobile-ui.designer-mobile-portrait .properties-panel .property-panel,
body.designer-shell.designer-mobile-ui.designer-mobile-portrait .properties-panel .control-grid,
body.designer-shell.designer-mobile-ui.designer-mobile-portrait .properties-panel .compact-grid,
body.designer-shell.designer-mobile-ui.designer-mobile-portrait .properties-panel label {
    overflow: visible !important;
    touch-action: pan-y !important;
}

/* ============================================================
   PATCH 32CD — mobile final polish
   - landscape: balanced left/right rails with reliable internal scrolling
   - material/color expansion: compact two-row horizontal rail
   - brand home button: exact desktop logo asset, uncropped
   Presentation only. No placement/collision/camera/drop/render math changes.
   ============================================================ */

/* Use the real desktop brand mark without circular cropping or a bulky pill. */
body.designer-shell.designer-mobile-ui .designer-mobile-home-link {
    top: max(6px, env(safe-area-inset-top)) !important;
    left: max(6px, env(safe-area-inset-left)) !important;
    width: 46px !important;
    min-width: 46px !important;
    height: 40px !important;
    min-height: 40px !important;
    padding: 1px !important;
    border: 0 !important;
    border-radius: 8px !important;
    background: rgba(21, 38, 27, .78) !important;
    box-shadow: 0 3px 12px rgba(0, 0, 0, .16) !important;
    overflow: visible !important;
}
body.designer-shell.designer-mobile-ui .designer-mobile-home-link img {
    display: block !important;
    width: 44px !important;
    height: 36px !important;
    max-width: none !important;
    object-fit: contain !important;
    object-position: center !important;
    border-radius: 0 !important;
    filter: none !important;
}

/* Expanded materials/colors: never become a tall multi-row wall. Two short
   horizontal rows are visible; the rest is reached by a natural side swipe. */
body.designer-shell.designer-mobile-ui .material-picker-options,
body.designer-shell.designer-mobile-ui .compact-material-grid .material-picker-options {
    display: grid !important;
    grid-auto-flow: column !important;
    grid-template-rows: repeat(2, 42px) !important;
    grid-auto-columns: 48px !important;
    grid-template-columns: none !important;
    justify-content: start !important;
    align-content: start !important;
    gap: 4px !important;
    width: 100% !important;
    max-width: 100% !important;
    max-height: 90px !important;
    margin-top: 4px !important;
    padding: 2px 1px 4px !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    -webkit-overflow-scrolling: touch !important;
    overscroll-behavior-x: contain !important;
    scrollbar-width: none !important;
    touch-action: pan-x !important;
    scroll-snap-type: x proximity !important;
}
body.designer-shell.designer-mobile-ui .material-picker-options::-webkit-scrollbar,
body.designer-shell.designer-mobile-ui .compact-material-grid .material-picker-options::-webkit-scrollbar {
    display: none !important;
}
body.designer-shell.designer-mobile-ui .material-image-choice {
    width: 48px !important;
    min-width: 48px !important;
    max-width: 48px !important;
    height: 42px !important;
    min-height: 42px !important;
    max-height: 42px !important;
    padding: 2px !important;
    gap: 1px !important;
    border-radius: 7px !important;
    scroll-snap-align: start !important;
}
body.designer-shell.designer-mobile-ui .material-choice-swatch {
    width: 100% !important;
    height: 24px !important;
    min-height: 24px !important;
    border-radius: 5px !important;
}
body.designer-shell.designer-mobile-ui .material-choice-label {
    display: block !important;
    width: 100% !important;
    font-size: .43rem !important;
    line-height: 1 !important;
    text-align: center !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
}

/* Portrait keeps the library as exactly one horizontal model row. */
body.designer-shell.designer-mobile-ui.designer-mobile-portrait
.room-workspace:not(.library-collapsed) .library-panel {
    max-height: 142px !important;
    min-height: 0 !important;
    padding-top: 44px !important;
    padding-bottom: 4px !important;
}
body.designer-shell.designer-mobile-ui.designer-mobile-portrait .object-library {
    height: 90px !important;
    min-height: 90px !important;
    max-height: 90px !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    touch-action: pan-x !important;
}
body.designer-shell.designer-mobile-ui.designer-mobile-portrait .library-section-body {
    height: 86px !important;
    min-height: 86px !important;
    max-height: 86px !important;
    flex-wrap: nowrap !important;
}

/* LANDSCAPE: panels stay on physical left/right sides, but no longer eat most
   of the 3D stage. The richer Components panel gets slightly more width than
   Library, and each panel has one dependable internal scroll owner. */
body.designer-shell.designer-mobile-ui.designer-mobile-landscape
.room-workspace:not(.library-collapsed) .library-panel {
    top: 52px !important;
    right: max(6px, env(safe-area-inset-right)) !important;
    bottom: 6px !important;
    left: auto !important;
    width: clamp(190px, 25vw, 240px) !important;
    min-width: 0 !important;
    max-width: 240px !important;
    padding: 46px 6px 6px !important;
    overflow: hidden !important;
}
body.designer-shell.designer-mobile-ui.designer-mobile-landscape
.room-workspace:not(.properties-collapsed) .properties-panel {
    top: 52px !important;
    right: auto !important;
    bottom: 6px !important;
    left: max(6px, env(safe-area-inset-left)) !important;
    width: clamp(220px, 31vw, 292px) !important;
    min-width: 0 !important;
    max-width: 292px !important;
    padding: 46px 6px 6px !important;
    overflow: hidden !important;
}
body.designer-shell.designer-mobile-ui.designer-mobile-landscape
.room-workspace:not(.library-collapsed) .library-edge-toggle,
body.designer-shell.designer-mobile-ui.designer-mobile-landscape
.room-workspace:not(.properties-collapsed) .properties-edge-toggle {
    top: 6px !important;
    right: 6px !important;
    left: 6px !important;
    height: 34px !important;
    min-height: 34px !important;
    padding: 3px 7px !important;
}

/* Library: one continuous vertical scroll surface, with compact two-column cards. */
body.designer-shell.designer-mobile-ui.designer-mobile-landscape .object-library {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    max-height: 100% !important;
    padding: 0 1px 10px !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    overscroll-behavior-y: contain !important;
    touch-action: pan-y !important;
    scrollbar-width: thin !important;
}
body.designer-shell.designer-mobile-ui.designer-mobile-landscape .library-section {
    margin: 0 0 5px !important;
}
body.designer-shell.designer-mobile-ui.designer-mobile-landscape .library-section > summary {
    min-height: 23px !important;
    padding: 2px 3px !important;
    font-size: .56rem !important;
}
body.designer-shell.designer-mobile-ui.designer-mobile-landscape .library-section-body {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 4px !important;
    padding: 3px 0 !important;
}
body.designer-shell.designer-mobile-ui.designer-mobile-landscape .object-library button {
    display: grid !important;
    grid-template-columns: 40px minmax(0, 1fr) !important;
    min-width: 0 !important;
    min-height: 43px !important;
    max-height: 48px !important;
    padding: 3px !important;
    gap: 3px !important;
    border-radius: 7px !important;
}
body.designer-shell.designer-mobile-ui.designer-mobile-landscape .library-product-thumb {
    width: 40px !important;
    min-width: 40px !important;
    height: 36px !important;
    min-height: 36px !important;
}
body.designer-shell.designer-mobile-ui.designer-mobile-landscape .library-product-copy > strong {
    font-size: .49rem !important;
    line-height: 1.08 !important;
    -webkit-line-clamp: 2 !important;
}

/* Components: the shell never scrolls; only the wrapper does. This removes
   dead gesture zones and clipped controls in landscape. */
body.designer-shell.designer-mobile-ui.designer-mobile-landscape
.room-workspace:not(.properties-collapsed) .properties-panel > .properties-panel-scroll {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    max-height: 100% !important;
    padding: 0 1px 14px !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    overscroll-behavior-y: contain !important;
    touch-action: pan-y !important;
    scrollbar-width: thin !important;
    scroll-padding-bottom: 18px !important;
}
body.designer-shell.designer-mobile-ui.designer-mobile-landscape .properties-panel .room-dimensions-panel,
body.designer-shell.designer-mobile-ui.designer-mobile-landscape .properties-panel .property-tab-group,
body.designer-shell.designer-mobile-ui.designer-mobile-landscape .properties-panel .property-panel {
    margin: 0 0 4px !important;
    padding: 4px !important;
    border-radius: 7px !important;
}
body.designer-shell.designer-mobile-ui.designer-mobile-landscape .properties-panel .property-tab-groups {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 3px !important;
    margin: 0 0 4px !important;
}
body.designer-shell.designer-mobile-ui.designer-mobile-landscape .properties-panel .properties-tabs {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 2px !important;
}
body.designer-shell.designer-mobile-ui.designer-mobile-landscape .properties-panel .properties-tabs button {
    min-height: 23px !important;
    padding: 2px 3px !important;
    font-size: .48rem !important;
    line-height: 1.05 !important;
}
body.designer-shell.designer-mobile-ui.designer-mobile-landscape .properties-panel label {
    min-width: 0 !important;
    font-size: .5rem !important;
    line-height: 1.08 !important;
}
body.designer-shell.designer-mobile-ui.designer-mobile-landscape .properties-panel input,
body.designer-shell.designer-mobile-ui.designer-mobile-landscape .properties-panel select,
body.designer-shell.designer-mobile-ui.designer-mobile-landscape .properties-panel button:not(.panel-edge-toggle):not(.material-picker-toggle):not(.material-image-choice) {
    min-height: 26px !important;
    padding: 2px 4px !important;
    font-size: .5rem !important;
}
body.designer-shell.designer-mobile-ui.designer-mobile-landscape .material-picker-toggle {
    grid-template-columns: 22px minmax(0, 1fr) 13px !important;
    min-height: 28px !important;
    height: 28px !important;
    padding: 2px 4px !important;
    gap: 4px !important;
}
body.designer-shell.designer-mobile-ui.designer-mobile-landscape .material-picker-toggle-swatch {
    width: 20px !important;
    min-width: 20px !important;
    height: 19px !important;
}
body.designer-shell.designer-mobile-ui.designer-mobile-landscape .material-picker-toggle-label {
    font-size: .49rem !important;
}

/* Very short landscape phones: shave a little more chrome instead of clipping. */
@media (orientation: landscape) and (max-height: 430px) {
    body.designer-shell.designer-mobile-ui.designer-mobile-landscape
    .room-workspace:not(.library-collapsed) .library-panel,
    body.designer-shell.designer-mobile-ui.designer-mobile-landscape
    .room-workspace:not(.properties-collapsed) .properties-panel {
        top: 48px !important;
        bottom: 4px !important;
        padding-top: 42px !important;
    }
    body.designer-shell.designer-mobile-ui.designer-mobile-landscape
    .room-workspace:not(.library-collapsed) .library-edge-toggle,
    body.designer-shell.designer-mobile-ui.designer-mobile-landscape
    .room-workspace:not(.properties-collapsed) .properties-edge-toggle {
        top: 4px !important;
        height: 31px !important;
        min-height: 31px !important;
    }
}

/* ============================================================
   PATCH 32CF — mobile panel collision + adaptive 3D viewport
   - use the existing desktop brand chip on mobile; no duplicate floating logo
   - material accordions truly collapse (hidden wins over display overrides)
   - expanded materials are one clean horizontal rail
   - one reliable scroll owner in Components
   - canvas viewport moves away from whichever mobile drawer is open
   Presentation only; no placement/collision/camera/drop logic changes.
   ============================================================ */

/* The toolbar already contains the exact desktop home/logo link. The extra
   floating mobile copy caused the clipped logo seen at the top-left. */
body.designer-shell.designer-mobile-ui .designer-mobile-home-link {
    display: none !important;
}
body.designer-shell.designer-mobile-ui .designer-brand-chip {
    overflow: hidden !important;
    border-radius: 8px !important;
}
body.designer-shell.designer-mobile-ui .designer-brand-chip img {
    display: block !important;
    width: 32px !important;
    height: 28px !important;
    max-width: 32px !important;
    object-fit: contain !important;
    object-position: center !important;
}

/* IMPORTANT: earlier mobile display rules used !important and could override
   the HTML hidden attribute. That made closed palettes remain painted and
   overlap controls. Hidden must always mean hidden. */
body.designer-shell.designer-mobile-ui .material-picker-options[hidden],
body.designer-shell.designer-mobile-ui .compact-material-grid .material-picker-options[hidden] {
    display: none !important;
}
body.designer-shell.designer-mobile-ui .collapsible-material-picker {
    position: relative !important;
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    overflow: hidden !important;
    isolation: isolate !important;
}
body.designer-shell.designer-mobile-ui .material-picker-toggle {
    position: relative !important;
    z-index: 2 !important;
    display: grid !important;
    grid-template-columns: 34px minmax(0, 1fr) 24px !important;
    align-items: center !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    min-height: 38px !important;
    height: 38px !important;
    padding: 3px 7px !important;
    gap: 7px !important;
    overflow: hidden !important;
}
body.designer-shell.designer-mobile-ui .material-picker-toggle-swatch {
    width: 30px !important;
    min-width: 30px !important;
    height: 28px !important;
    min-height: 28px !important;
    border-radius: 7px !important;
}
body.designer-shell.designer-mobile-ui .material-picker-toggle-label {
    min-width: 0 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    text-align: right !important;
    font-size: .67rem !important;
}
body.designer-shell.designer-mobile-ui .material-picker-toggle-chevron {
    width: 24px !important;
    height: 24px !important;
    display: grid !important;
    place-items: center !important;
    font-size: .8rem !important;
}

/* One horizontal strip, not a multi-row wall. Swipe sideways for the rest. */
body.designer-shell.designer-mobile-ui .material-picker-options,
body.designer-shell.designer-mobile-ui .compact-material-grid .material-picker-options {
    position: relative !important;
    z-index: 1 !important;
    display: flex !important;
    flex-flow: row nowrap !important;
    align-items: stretch !important;
    justify-content: flex-start !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    height: 52px !important;
    min-height: 52px !important;
    max-height: 52px !important;
    margin: 4px 0 0 !important;
    padding: 2px 1px 4px !important;
    gap: 5px !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    -webkit-overflow-scrolling: touch !important;
    overscroll-behavior-x: contain !important;
    scrollbar-width: none !important;
    touch-action: pan-x pan-y !important;
    scroll-snap-type: x proximity !important;
}
body.designer-shell.designer-mobile-ui .material-picker-options::-webkit-scrollbar,
body.designer-shell.designer-mobile-ui .compact-material-grid .material-picker-options::-webkit-scrollbar {
    display: none !important;
}
body.designer-shell.designer-mobile-ui .material-image-choice {
    flex: 0 0 50px !important;
    width: 50px !important;
    min-width: 50px !important;
    max-width: 50px !important;
    height: 46px !important;
    min-height: 46px !important;
    max-height: 46px !important;
    padding: 2px !important;
    margin: 0 !important;
    border-radius: 7px !important;
    overflow: hidden !important;
    scroll-snap-align: start !important;
}
body.designer-shell.designer-mobile-ui .material-choice-swatch {
    display: block !important;
    width: 100% !important;
    height: 28px !important;
    min-height: 28px !important;
    border-radius: 5px !important;
}
body.designer-shell.designer-mobile-ui .material-choice-label {
    display: block !important;
    width: 100% !important;
    margin-top: 2px !important;
    font-size: .42rem !important;
    line-height: 1 !important;
    text-align: center !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
}

/* The panel shell clips; this inner wrapper owns vertical scrolling. This
   prevents children from creating stacked/overlapping scroll regions. */
body.designer-shell.designer-mobile-ui .properties-panel {
    overflow: hidden !important;
}
body.designer-shell.designer-mobile-ui .properties-panel > .properties-panel-scroll {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    max-height: 100% !important;
    padding: 0 2px 18px !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    overscroll-behavior-y: contain !important;
    touch-action: pan-y pan-x !important;
    scroll-padding-bottom: 24px !important;
}
body.designer-shell.designer-mobile-ui .properties-panel-scroll > *,
body.designer-shell.designer-mobile-ui .properties-panel .property-panel,
body.designer-shell.designer-mobile-ui .properties-panel .control-grid,
body.designer-shell.designer-mobile-ui .properties-panel .compact-grid,
body.designer-shell.designer-mobile-ui .properties-panel label {
    min-width: 0 !important;
    max-width: 100% !important;
}

/* 32CG: keep the renderer viewport untouched on mobile.
   Panels stay as overlays; resizing the canvas itself distorted the 3D scene. */
/* Keep open portrait drawers compact and bounded so the remaining 3D viewport
   is still useful. */
body.designer-shell.designer-mobile-ui.designer-mobile-portrait
.room-workspace:not(.properties-collapsed) .properties-panel {
    max-height: min(46dvh, 410px) !important;
}
body.designer-shell.designer-mobile-ui.designer-mobile-portrait
.room-workspace:not(.library-collapsed) .library-panel {
    max-height: 132px !important;
}

/* Landscape: drawer contents remain inside the physical screen edges. */
body.designer-shell.designer-mobile-ui.designer-mobile-landscape .library-panel,
body.designer-shell.designer-mobile-ui.designer-mobile-landscape .properties-panel {
    box-sizing: border-box !important;
    max-height: calc(100dvh - 58px) !important;
}


/* ============================================================
   PATCH 32CH — final mobile materials + brand stabilization
   - palette stays in normal document flow (no overlay collisions)
   - all finishes visible in a balanced responsive grid
   - exact desktop brand chip is visible and contained on mobile
   - no renderer/camera/placement logic changes
   ============================================================ */
body.designer-shell.designer-mobile-ui .designer-brand-chip {
    display: inline-flex !important;
    position: absolute !important;
    top: 8px !important;
    left: 8px !important;
    z-index: 160 !important;
    width: 46px !important;
    min-width: 46px !important;
    max-width: 46px !important;
    height: 40px !important;
    min-height: 40px !important;
    padding: 2px !important;
    margin: 0 !important;
    align-items: center !important;
    justify-content: center !important;
    overflow: hidden !important;
    border-radius: 9px !important;
    box-sizing: border-box !important;
    background: rgba(25, 34, 21, .78) !important;
    border: 1px solid rgba(215, 181, 109, .35) !important;
}
body.designer-shell.designer-mobile-ui .designer-brand-chip img {
    display: block !important;
    width: 40px !important;
    height: 34px !important;
    max-width: 40px !important;
    max-height: 34px !important;
    object-fit: contain !important;
    object-position: center !important;
    margin: 0 !important;
}
body.designer-shell.designer-mobile-ui .designer-brand-chip span { display: none !important; }

/* Keep the material accordion in the layout flow so scrolling never paints it
   over room/unit tabs or the controls above it. */
body.designer-shell.designer-mobile-ui .collapsible-material-picker,
body.designer-shell.designer-mobile-ui .material-picker-options,
body.designer-shell.designer-mobile-ui .compact-material-grid .material-picker-options {
    position: static !important;
    inset: auto !important;
    transform: none !important;
    z-index: auto !important;
}
body.designer-shell.designer-mobile-ui .material-picker-options[hidden],
body.designer-shell.designer-mobile-ui .compact-material-grid .material-picker-options[hidden] {
    display: none !important;
}
body.designer-shell.designer-mobile-ui .material-picker-options,
body.designer-shell.designer-mobile-ui .compact-material-grid .material-picker-options {
    display: grid !important;
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
    grid-auto-flow: row !important;
    grid-auto-rows: 48px !important;
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    margin: 5px 0 7px !important;
    padding: 4px !important;
    gap: 5px !important;
    overflow: visible !important;
    touch-action: auto !important;
    scroll-snap-type: none !important;
    box-sizing: border-box !important;
    background: rgba(255,255,255,.58) !important;
    border: 1px solid rgba(72,82,61,.12) !important;
    border-radius: 9px !important;
}
body.designer-shell.designer-mobile-ui .material-image-choice {
    display: grid !important;
    grid-template-rows: 28px minmax(0, 1fr) !important;
    align-items: center !important;
    justify-items: stretch !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    height: 48px !important;
    min-height: 48px !important;
    max-height: 48px !important;
    padding: 2px 3px !important;
    margin: 0 !important;
    overflow: hidden !important;
    border-radius: 7px !important;
    box-sizing: border-box !important;
}
body.designer-shell.designer-mobile-ui .material-choice-swatch {
    width: 100% !important;
    height: 27px !important;
    min-height: 27px !important;
    max-height: 27px !important;
    border-radius: 5px !important;
}
body.designer-shell.designer-mobile-ui .material-choice-label {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    margin: 1px 0 0 !important;
    font-size: .42rem !important;
    line-height: 1.05 !important;
    text-align: center !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}
body.designer-shell.designer-mobile-ui .properties-panel > .properties-panel-scroll {
    overflow-y: auto !important;
    overflow-x: hidden !important;
    overscroll-behavior: contain !important;
    scroll-behavior: auto !important;
}

@media (orientation: landscape) and (max-height: 600px) {
    body.designer-shell.designer-mobile-ui .designer-brand-chip {
        top: 6px !important;
        left: 6px !important;
        width: 40px !important;
        min-width: 40px !important;
        height: 34px !important;
        min-height: 34px !important;
    }
    body.designer-shell.designer-mobile-ui .designer-brand-chip img {
        width: 34px !important;
        height: 29px !important;
    }
    body.designer-shell.designer-mobile-ui .material-picker-options,
    body.designer-shell.designer-mobile-ui .compact-material-grid .material-picker-options {
        grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
        grid-auto-rows: 42px !important;
        gap: 4px !important;
    }
    body.designer-shell.designer-mobile-ui .material-image-choice {
        height: 42px !important;
        min-height: 42px !important;
        max-height: 42px !important;
        grid-template-rows: 25px minmax(0, 1fr) !important;
    }
    body.designer-shell.designer-mobile-ui .material-choice-swatch {
        height: 24px !important;
        min-height: 24px !important;
        max-height: 24px !important;
    }
}

/* ============================================================
   PATCH 32CJ — mobile materials + logo final cleanup
   - compact transparent brand mark only
   - material picker occupies a real full-width row in Components
   - expanded finishes use a balanced responsive grid (no overlay/rail)
   - palette stays in normal flow and the Components panel owns scrolling
   Presentation only. No 3D / placement / camera / render logic changes.
   ============================================================ */

/* Mobile brand: logo only, smaller, no pill/background/border. */
body.designer-shell.designer-mobile-ui .designer-brand-chip {
    position: fixed !important;
    top: max(8px, env(safe-area-inset-top)) !important;
    left: max(8px, env(safe-area-inset-left)) !important;
    z-index: 170 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 42px !important;
    min-width: 42px !important;
    max-width: 42px !important;
    height: 34px !important;
    min-height: 34px !important;
    max-height: 34px !important;
    padding: 0 !important;
    margin: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    overflow: visible !important;
}
body.designer-shell.designer-mobile-ui .designer-brand-chip img {
    display: block !important;
    width: 42px !important;
    height: 34px !important;
    max-width: 42px !important;
    max-height: 34px !important;
    object-fit: contain !important;
    object-position: center !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}
body.designer-shell.designer-mobile-ui .designer-brand-chip span {
    display: none !important;
}

/* Every material selector is one proper full-width row. This prevents the
   expanded palette from being trapped inside a half-width grid cell. */
body.designer-shell.designer-mobile-ui .compact-material-grid .collapsible-material-picker,
body.designer-shell.designer-mobile-ui .properties-panel .collapsible-material-picker {
    grid-column: 1 / -1 !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    margin: 2px 0 !important;
    padding: 0 !important;
    overflow: visible !important;
    position: static !important;
    isolation: auto !important;
}

/* Selected finish = compact professional summary bar. */
body.designer-shell.designer-mobile-ui .material-picker-toggle {
    display: grid !important;
    grid-template-columns: 32px minmax(0, 1fr) 22px !important;
    align-items: center !important;
    width: 100% !important;
    height: 36px !important;
    min-height: 36px !important;
    max-height: 36px !important;
    padding: 3px 8px !important;
    gap: 7px !important;
    border-radius: 9px !important;
    overflow: hidden !important;
}
body.designer-shell.designer-mobile-ui .material-picker-toggle-swatch {
    width: 28px !important;
    min-width: 28px !important;
    max-width: 28px !important;
    height: 26px !important;
    min-height: 26px !important;
    max-height: 26px !important;
    border-radius: 6px !important;
}
body.designer-shell.designer-mobile-ui .material-picker-toggle-label {
    min-width: 0 !important;
    font-size: .68rem !important;
    line-height: 1.15 !important;
    text-align: right !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}
body.designer-shell.designer-mobile-ui .material-picker-toggle-chevron {
    width: 22px !important;
    height: 22px !important;
    min-width: 22px !important;
    display: grid !important;
    place-items: center !important;
    font-size: .74rem !important;
}

/* Expanded finishes: responsive balanced grid. All choices are visible after
   opening; no sideways hidden rail, and no narrow vertical column. */
body.designer-shell.designer-mobile-ui .material-picker-options[hidden],
body.designer-shell.designer-mobile-ui .compact-material-grid .material-picker-options[hidden] {
    display: none !important;
}
body.designer-shell.designer-mobile-ui .material-picker-options,
body.designer-shell.designer-mobile-ui .compact-material-grid .material-picker-options {
    position: static !important;
    display: grid !important;
    grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
    grid-auto-flow: row !important;
    grid-auto-rows: 44px !important;
    align-items: stretch !important;
    justify-items: stretch !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    margin: 5px 0 8px !important;
    padding: 5px !important;
    gap: 5px !important;
    overflow: visible !important;
    background: rgba(255, 255, 255, .5) !important;
    border: 1px solid rgba(76, 85, 64, .12) !important;
    border-radius: 10px !important;
    box-sizing: border-box !important;
    touch-action: pan-y !important;
    scroll-snap-type: none !important;
}
body.designer-shell.designer-mobile-ui .material-image-choice {
    display: grid !important;
    grid-template-rows: 27px 11px !important;
    align-items: center !important;
    justify-items: stretch !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    height: 44px !important;
    min-height: 44px !important;
    max-height: 44px !important;
    padding: 2px !important;
    margin: 0 !important;
    gap: 1px !important;
    overflow: hidden !important;
    border-radius: 7px !important;
    box-sizing: border-box !important;
}
body.designer-shell.designer-mobile-ui .material-choice-swatch {
    width: 100% !important;
    min-width: 0 !important;
    height: 27px !important;
    min-height: 27px !important;
    max-height: 27px !important;
    border-radius: 5px !important;
}
body.designer-shell.designer-mobile-ui .material-choice-label {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0 1px !important;
    font-size: .40rem !important;
    line-height: 1 !important;
    text-align: center !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

/* On the narrowest phones use five columns. On landscape/wider phones use
   eight columns so the palette stays short while keeping every finish visible. */
@media (max-width: 380px) and (orientation: portrait) {
    body.designer-shell.designer-mobile-ui .material-picker-options,
    body.designer-shell.designer-mobile-ui .compact-material-grid .material-picker-options {
        grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
    }
}
@media (orientation: landscape), (min-width: 560px) {
    body.designer-shell.designer-mobile-ui .material-picker-options,
    body.designer-shell.designer-mobile-ui .compact-material-grid .material-picker-options {
        grid-template-columns: repeat(8, minmax(0, 1fr)) !important;
        grid-auto-rows: 42px !important;
    }
    body.designer-shell.designer-mobile-ui .material-image-choice {
        height: 42px !important;
        min-height: 42px !important;
        max-height: 42px !important;
        grid-template-rows: 25px 11px !important;
    }
    body.designer-shell.designer-mobile-ui .material-choice-swatch {
        height: 25px !important;
        min-height: 25px !important;
        max-height: 25px !important;
    }
}

/* Components owns scrolling; expanded palettes grow inside that scroll flow. */
body.designer-shell.designer-mobile-ui .properties-panel,
body.designer-shell.designer-mobile-ui .properties-panel > .properties-panel-scroll {
    overflow-x: hidden !important;
}
body.designer-shell.designer-mobile-ui .properties-panel > .properties-panel-scroll {
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    overscroll-behavior-y: contain !important;
    touch-action: pan-y !important;
}


/* ===== Patch 32CK: final mobile library cleanup ===== */
/* Explanatory/status copy must never sit behind the mobile library rail/toggle. */
body.designer-shell.designer-mobile-ui .library-panel > .panel-note,
body.designer-shell.designer-mobile-ui .library-panel > .mobile-library-hint {
    display: none !important;
}

/* Keep the library rail arrows visually intuitive in RTL: physical left points left,
   physical right points right. Glyph assignment is handled in JS; no mirroring here. */
body.designer-shell.designer-mobile-ui .mobile-library-rail-arrow {
    transform: none !important;
    direction: ltr !important;
}

/* ============================================================
   PATCH 32CL — MOBILE-ONLY cleanup (desktop preserved)
   Scope rule: every selector below requires .designer-mobile-ui.
   The only desktop-visible feature from the recent series remains the
   intentionally requested exact library thumbnails beside product names.
   ============================================================ */

/* Closed phone library = toggle only. No helper/note/title/content may leak
   behind the compact button. This is deliberately stronger than older rules. */
body.designer-shell.designer-mobile-ui .room-workspace.library-collapsed .library-panel {
    overflow: hidden !important;
}
body.designer-shell.designer-mobile-ui .room-workspace.library-collapsed .library-panel > :not(.panel-edge-toggle) {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}
body.designer-shell.designer-mobile-ui .mobile-library-hint,
body.designer-shell.designer-mobile-ui .library-panel > .panel-note {
    display: none !important;
    visibility: hidden !important;
}

/* Physical arrow direction on the one-row phone library rail.
   Force LTR ordering only for the two arrow buttons so the LEFT button shows
   a left chevron and the RIGHT button shows a right chevron in an RTL page. */
body.designer-shell.designer-mobile-ui .mobile-library-rail-nav {
    direction: ltr !important;
}
body.designer-shell.designer-mobile-ui .mobile-library-rail-arrow-previous {
    order: 1 !important;
}
body.designer-shell.designer-mobile-ui .mobile-library-rail-arrow-next {
    order: 2 !important;
}

/* Mobile-only: hide the opening PNG material field altogether. JS also hides
   it semantically so it cannot leave empty layout space. Desktop remains as before. */
body.designer-shell.designer-mobile-ui [data-opening-field="material"] {
    display: none !important;
    visibility: hidden !important;
}

/* ============================================================
   PATCH 32CM — MOBILE-ONLY deterministic cleanup
   Desktop remains unchanged. Library exact thumbnails remain shared.
   ============================================================ */

/* Runtime/save/AI/login notices must never sit underneath the top library
   control on phones. Anchor the existing status chip above the bottom control. */
body.designer-shell.designer-mobile-ui #doorAssetLoadingStatus {
    position: fixed !important;
    top: auto !important;
    left: 50% !important;
    right: auto !important;
    bottom: calc(env(safe-area-inset-bottom, 0px) + 92px) !important;
    transform: translateX(-50%) !important;
    z-index: 1400 !important;
    width: max-content !important;
    min-width: min(220px, calc(100vw - 32px)) !important;
    max-width: calc(100vw - 32px) !important;
    margin: 0 !important;
}

/* Physical phone library navigation. Position is explicit, independent of RTL.
   JS uses scrollIntoView on cards, so icon direction and movement are identical. */
body.designer-shell.designer-mobile-ui .mobile-library-rail-nav {
    direction: ltr !important;
}
body.designer-shell.designer-mobile-ui .mobile-library-rail-arrow-left {
    position: absolute !important;
    left: 4px !important;
    right: auto !important;
    order: unset !important;
    direction: ltr !important;
}
body.designer-shell.designer-mobile-ui .mobile-library-rail-arrow-right {
    position: absolute !important;
    right: 4px !important;
    left: auto !important;
    order: unset !important;
    direction: ltr !important;
}

/* Remove duplicate door/window material/PNG pickers from PHONE cabinet settings.
   Dedicated door/window items remain responsible for those finishes. */
body.designer-shell.designer-mobile-ui [data-opening-field="material"],
body.designer-shell.designer-mobile-ui [data-door-field="surface-material"],
body.designer-shell.designer-mobile-ui [data-door-field="frame-material"],
body.designer-shell.designer-mobile-ui [data-door-field="insert-material"] {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
}

/* ============================================================
   PATCH 32CO — MOBILE material cards + true topmost toast
   Mobile-only. Desktop styling remains untouched.
   ============================================================ */

/* Readable finish palette on phones: use fewer, larger cards instead of tiny
   swatches. The parent Components panel owns vertical scrolling, so the grid
   never needs to escape the viewport. */
body.designer-shell.designer-mobile-ui .material-picker-options,
body.designer-shell.designer-mobile-ui .compact-material-grid .material-picker-options {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    grid-auto-rows: 68px !important;
    gap: 7px !important;
    padding: 7px !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow: visible !important;
    box-sizing: border-box !important;
}
body.designer-shell.designer-mobile-ui .material-image-choice {
    height: 68px !important;
    min-height: 68px !important;
    max-height: 68px !important;
    grid-template-rows: 42px minmax(16px, auto) !important;
    padding: 4px !important;
    gap: 3px !important;
    border-radius: 10px !important;
}
body.designer-shell.designer-mobile-ui .material-choice-swatch {
    height: 42px !important;
    min-height: 42px !important;
    max-height: 42px !important;
    border-radius: 8px !important;
}
body.designer-shell.designer-mobile-ui .material-choice-label {
    font-size: .68rem !important;
    line-height: 1.1 !important;
    font-weight: 700 !important;
    padding: 0 2px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

/* Very narrow phones still keep a useful card size instead of shrinking text. */
@media (max-width: 340px) and (orientation: portrait) {
    body.designer-shell.designer-mobile-ui .material-picker-options,
    body.designer-shell.designer-mobile-ui .compact-material-grid .material-picker-options {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    }
}

/* Landscape has more horizontal room: six readable cards per row. */
@media (orientation: landscape) {
    body.designer-shell.designer-mobile-ui .material-picker-options,
    body.designer-shell.designer-mobile-ui .compact-material-grid .material-picker-options {
        grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
        grid-auto-rows: 62px !important;
    }
    body.designer-shell.designer-mobile-ui .material-image-choice {
        height: 62px !important;
        min-height: 62px !important;
        max-height: 62px !important;
        grid-template-rows: 37px minmax(15px, auto) !important;
    }
    body.designer-shell.designer-mobile-ui .material-choice-swatch {
        height: 37px !important;
        min-height: 37px !important;
        max-height: 37px !important;
    }
}

/* The status is a real toast. It is always viewport-fixed and above every
   designer panel. This intentionally overrides the old bottom status rule. */
body.designer-shell.designer-mobile-ui #doorAssetLoadingStatus {
    position: fixed !important;
    top: calc(env(safe-area-inset-top, 0px) + 10px) !important;
    bottom: auto !important;
    left: 50% !important;
    right: auto !important;
    transform: translateX(-50%) !important;
    z-index: 2147483647 !important;
    width: auto !important;
    min-width: min(240px, calc(100vw - 24px)) !important;
    max-width: calc(100vw - 24px) !important;
    margin: 0 !important;
    pointer-events: none !important;
    isolation: isolate !important;
}


/* ============================================================
   PATCH 32CP — MOBILE readable material cards + library-anchored toast
   Mobile-only. Desktop remains untouched.
   ============================================================ */

/* Use large, legible material cards. Three columns in portrait gives every
   card enough width for a real label without escaping the components sheet. */
body.designer-shell.designer-mobile-ui .material-picker-options,
body.designer-shell.designer-mobile-ui .compact-material-grid .material-picker-options {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    grid-auto-rows: 92px !important;
    gap: 9px !important;
    padding: 9px !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    overflow: visible !important;
}
body.designer-shell.designer-mobile-ui .material-image-choice {
    height: 92px !important;
    min-height: 92px !important;
    max-height: 92px !important;
    display: grid !important;
    grid-template-rows: 58px 1fr !important;
    gap: 5px !important;
    padding: 5px !important;
    border-radius: 12px !important;
    min-width: 0 !important;
    overflow: hidden !important;
}
body.designer-shell.designer-mobile-ui .material-choice-swatch {
    width: 100% !important;
    height: 58px !important;
    min-height: 58px !important;
    max-height: 58px !important;
    border-radius: 9px !important;
}
body.designer-shell.designer-mobile-ui .material-choice-label {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    font-size: .84rem !important;
    line-height: 1.15 !important;
    font-weight: 700 !important;
    text-align: center !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    padding: 0 3px !important;
    box-sizing: border-box !important;
}

/* Very narrow phones use two columns rather than making cards unreadable. */
@media (max-width: 340px) and (orientation: portrait) {
    body.designer-shell.designer-mobile-ui .material-picker-options,
    body.designer-shell.designer-mobile-ui .compact-material-grid .material-picker-options {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}

/* Landscape has room for four genuinely readable cards. */
@media (orientation: landscape) {
    body.designer-shell.designer-mobile-ui .material-picker-options,
    body.designer-shell.designer-mobile-ui .compact-material-grid .material-picker-options {
        grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
        grid-auto-rows: 82px !important;
    }
    body.designer-shell.designer-mobile-ui .material-image-choice {
        height: 82px !important;
        min-height: 82px !important;
        max-height: 82px !important;
        grid-template-rows: 50px 1fr !important;
    }
    body.designer-shell.designer-mobile-ui .material-choice-swatch {
        height: 50px !important;
        min-height: 50px !important;
        max-height: 50px !important;
    }
    body.designer-shell.designer-mobile-ui .material-choice-label {
        font-size: .8rem !important;
    }
}

/* Toast position is calculated from the visible Library toggle in JS.
   Keep it above both Library and Components panels, but visually attached
   to the Library control instead of covering the top toolbar. */
body.designer-shell.designer-mobile-ui #doorAssetLoadingStatus {
    position: fixed !important;
    top: var(--mobile-designer-toast-top, 410px) !important;
    bottom: auto !important;
    left: 50% !important;
    right: auto !important;
    transform: translateX(-50%) !important;
    z-index: 2147483647 !important;
    width: min(420px, calc(100vw - 28px)) !important;
    min-width: 0 !important;
    max-width: calc(100vw - 28px) !important;
    box-sizing: border-box !important;
}

/* ============================================================
   PATCH 32CQ — MOBILE material cards use width, not height
   Mobile-only. Desktop remains untouched.
   ============================================================ */

/* Use the available horizontal space: two wide cards per row in portrait.
   Each card is a compact horizontal row (preview + full label), avoiding the
   tall/narrow swatches that pushed labels below the visible panel. */
body.designer-shell.designer-mobile-ui .material-picker-options,
body.designer-shell.designer-mobile-ui .compact-material-grid .material-picker-options {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    grid-auto-rows: 52px !important;
    gap: 7px !important;
    padding: 7px !important;
    align-items: stretch !important;
}

body.designer-shell.designer-mobile-ui .material-image-choice {
    display: grid !important;
    grid-template-columns: 46px minmax(0, 1fr) !important;
    grid-template-rows: 1fr !important;
    align-items: center !important;
    justify-items: stretch !important;
    height: 52px !important;
    min-height: 52px !important;
    max-height: 52px !important;
    padding: 4px 6px !important;
    gap: 7px !important;
    border-radius: 10px !important;
    overflow: hidden !important;
}

body.designer-shell.designer-mobile-ui .material-choice-swatch {
    width: 46px !important;
    min-width: 46px !important;
    max-width: 46px !important;
    height: 42px !important;
    min-height: 42px !important;
    max-height: 42px !important;
    border-radius: 8px !important;
}

body.designer-shell.designer-mobile-ui .material-choice-label {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    font-size: .78rem !important;
    line-height: 1.15 !important;
    font-weight: 700 !important;
    text-align: right !important;
    white-space: normal !important;
    overflow: hidden !important;
    text-overflow: clip !important;
    display: -webkit-box !important;
    -webkit-box-orient: vertical !important;
    -webkit-line-clamp: 2 !important;
}

/* Very narrow phones keep the same two-column layout, but trim the preview a
   little instead of stacking cards vertically. */
@media (max-width: 350px) and (orientation: portrait) {
    body.designer-shell.designer-mobile-ui .material-image-choice {
        grid-template-columns: 40px minmax(0, 1fr) !important;
        gap: 5px !important;
    }
    body.designer-shell.designer-mobile-ui .material-choice-swatch {
        width: 40px !important;
        min-width: 40px !important;
        max-width: 40px !important;
        height: 40px !important;
        min-height: 40px !important;
        max-height: 40px !important;
    }
    body.designer-shell.designer-mobile-ui .material-choice-label {
        font-size: .72rem !important;
    }
}

/* Landscape has enough width for three wide cards while staying short. */
@media (orientation: landscape) {
    body.designer-shell.designer-mobile-ui .material-picker-options,
    body.designer-shell.designer-mobile-ui .compact-material-grid .material-picker-options {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
        grid-auto-rows: 48px !important;
    }
    body.designer-shell.designer-mobile-ui .material-image-choice {
        grid-template-columns: 42px minmax(0, 1fr) !important;
        height: 48px !important;
        min-height: 48px !important;
        max-height: 48px !important;
    }
    body.designer-shell.designer-mobile-ui .material-choice-swatch {
        width: 40px !important;
        min-width: 40px !important;
        max-width: 40px !important;
        height: 38px !important;
        min-height: 38px !important;
        max-height: 38px !important;
    }
    body.designer-shell.designer-mobile-ui .material-choice-label {
        font-size: .74rem !important;
    }
}

/* ============================================================
   PATCH 32CR — MOBILE expanded material tray uses sheet width
   Mobile-only. Desktop remains untouched.
   The collapsed selector stays in its normal field. Once expanded, the
   options tray breaks out of that narrow field and spans the usable width
   of the Components sheet, with compact horizontal cards.
   ============================================================ */

@media (max-width: 900px) {
    body.designer-shell.designer-mobile-ui .collapsible-material-picker[data-expanded="true"] .material-picker-options,
    body.designer-shell.designer-mobile-ui .compact-material-grid.collapsible-material-picker[data-expanded="true"] .material-picker-options {
        /* Break out of the narrow property-field column without becoming a
           floating overlay. The negative logical margins center the tray
           beneath the selector while it remains in normal document flow. */
        width: calc(100vw - 72px) !important;
        max-width: calc(100vw - 72px) !important;
        margin-top: 7px !important;
        margin-inline-start: calc((100% - (100vw - 72px)) / 2) !important;
        margin-inline-end: calc((100% - (100vw - 72px)) / 2) !important;
        padding: 6px !important;
        box-sizing: border-box !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        grid-auto-rows: 50px !important;
        gap: 7px !important;
        align-items: stretch !important;
        overflow: visible !important;
    }

    body.designer-shell.designer-mobile-ui .collapsible-material-picker[data-expanded="true"] .material-image-choice {
        display: grid !important;
        grid-template-columns: 54px minmax(0, 1fr) !important;
        grid-template-rows: 1fr !important;
        align-items: center !important;
        height: 50px !important;
        min-height: 50px !important;
        max-height: 50px !important;
        padding: 4px 7px !important;
        gap: 8px !important;
        overflow: hidden !important;
    }

    body.designer-shell.designer-mobile-ui .collapsible-material-picker[data-expanded="true"] .material-choice-swatch {
        width: 54px !important;
        min-width: 54px !important;
        max-width: 54px !important;
        height: 40px !important;
        min-height: 40px !important;
        max-height: 40px !important;
        border-radius: 8px !important;
    }

    body.designer-shell.designer-mobile-ui .collapsible-material-picker[data-expanded="true"] .material-choice-label {
        display: block !important;
        min-width: 0 !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        font-size: .84rem !important;
        line-height: 1.08 !important;
        font-weight: 750 !important;
        text-align: right !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }
}

/* Small phones still get wide cards; reduce the outer gutter instead of
   squeezing the cards into a narrow centre column. */
@media (max-width: 360px) and (orientation: portrait) {
    body.designer-shell.designer-mobile-ui .collapsible-material-picker[data-expanded="true"] .material-picker-options,
    body.designer-shell.designer-mobile-ui .compact-material-grid.collapsible-material-picker[data-expanded="true"] .material-picker-options {
        width: calc(100vw - 44px) !important;
        max-width: calc(100vw - 44px) !important;
        margin-inline-start: calc((100% - (100vw - 44px)) / 2) !important;
        margin-inline-end: calc((100% - (100vw - 44px)) / 2) !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 6px !important;
    }

    body.designer-shell.designer-mobile-ui .collapsible-material-picker[data-expanded="true"] .material-image-choice {
        grid-template-columns: 46px minmax(0, 1fr) !important;
        gap: 6px !important;
        padding-inline: 5px !important;
    }

    body.designer-shell.designer-mobile-ui .collapsible-material-picker[data-expanded="true"] .material-choice-swatch {
        width: 46px !important;
        min-width: 46px !important;
        max-width: 46px !important;
    }

    body.designer-shell.designer-mobile-ui .collapsible-material-picker[data-expanded="true"] .material-choice-label {
        font-size: .78rem !important;
    }
}

/* Landscape: use the horizontal room, but stay shallow vertically. */
@media (max-width: 1000px) and (orientation: landscape) {
    body.designer-shell.designer-mobile-ui .collapsible-material-picker[data-expanded="true"] .material-picker-options,
    body.designer-shell.designer-mobile-ui .compact-material-grid.collapsible-material-picker[data-expanded="true"] .material-picker-options {
        width: calc(100vw - 104px) !important;
        max-width: calc(100vw - 104px) !important;
        margin-inline-start: calc((100% - (100vw - 104px)) / 2) !important;
        margin-inline-end: calc((100% - (100vw - 104px)) / 2) !important;
        grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
        grid-auto-rows: 46px !important;
        gap: 6px !important;
    }

    body.designer-shell.designer-mobile-ui .collapsible-material-picker[data-expanded="true"] .material-image-choice {
        grid-template-columns: 42px minmax(0, 1fr) !important;
        height: 46px !important;
        min-height: 46px !important;
        max-height: 46px !important;
        gap: 6px !important;
        padding: 3px 6px !important;
    }

    body.designer-shell.designer-mobile-ui .collapsible-material-picker[data-expanded="true"] .material-choice-swatch {
        width: 42px !important;
        min-width: 42px !important;
        max-width: 42px !important;
        height: 36px !important;
        min-height: 36px !important;
        max-height: 36px !important;
    }

    body.designer-shell.designer-mobile-ui .collapsible-material-picker[data-expanded="true"] .material-choice-label {
        font-size: .75rem !important;
    }
}
