/* V1.75: NTD perimeter and current wall, shared by desktop and mobile.
   Screen-pixel strokes keep the boundary clear at every navigator size. */
#appShell .l-shape-elevation-plan .ntd-perimeter,
#appShell .l-shape-elevation-plan .l-shape-nav-wall {
    fill: none;
    stroke: #ff0000;
    stroke-width: 8px;
    stroke-linejoin: miter;
    stroke-linecap: butt;
    vector-effect: non-scaling-stroke;
    pointer-events: none;
}

#appShell .l-shape-elevation-plan .l-shape-nav-wall.selected {
    stroke: #a535ff;
    stroke-width: 8px;
}

#appShell .l-shape-elevation-plan .l-shape-nav-label.selected {
    fill: #7221b5;
}

#appShell .l-shape-elevation-plan .l-shape-nav-wall-hit:focus-visible {
    stroke: #a535ff;
    stroke-opacity: .25;
}

/* Desktop only: the approved navy surround, with white sidebar boxes.
   Match the inverse of the existing mobile layout query. Colour only;
   no changes to component sizing, placement, print or mobile backgrounds. */
@media screen and (min-width: 701px) and (orientation: landscape),
       screen and (min-width: 1101px) {
    :root,
    body,
    #appShell,
    #appShell main,
    #appShell .centre-stage,
    #appShell header,
    #appShell #controls,
    #appShell #drawingTools {
        background: #102a43 !important;
    }

    #appShell #controls > .group,
    #appShell #controls .l-shape-floor-return {
        background: #ffffff !important;
    }

    #appShell #controls .l-shape-elevation-plan-heading {
        color: #263746;
    }

    /* V1.76: desktop NTD uses the Choose Shape card layers. */
    #appShell #controls .l-shape-drawing-navigator {
        background: #ffffff;
        border: 1px solid #d4dbe0;
        border-radius: 12px;
        padding: 10px;
    }

    #appShell #controls .l-shape-elevation-plan {
        background: #cdcdcd;
        padding: 14px;
    }

    #appShell #controls .l-shape-floor-return {
        border: 1px solid #d4dbe0;
    }
}

/* Shared desktop floor/wall editor controls; mobile retains its own rules. */
@media screen and (min-width: 701px) and (orientation: landscape),
       screen and (min-width: 1101px) {
    #appShell:is(.desktop-wall-elevation, .desktop-floor-plan) #controls > .tile-group {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 5px;
    }

    #appShell:is(.desktop-wall-elevation, .desktop-floor-plan) #controls > .tile-group > h3 {
        grid-column: 1 / -1;
    }

    #appShell:is(.desktop-wall-elevation, .desktop-floor-plan) #controls > .tile-group > .field {
        margin: 0;
        min-width: 0;
    }

    #appShell:is(.desktop-wall-elevation, .desktop-floor-plan) #controls > .tile-group label {
        font-size: 11px !important;
        line-height: 12px;
        height: 12px;
        white-space: nowrap;
    }

    #appShell:is(.desktop-wall-elevation, .desktop-floor-plan) #controls > .tile-group label::before {
        content: none !important;
        font-size: 9px;
        color: #000000;
    }

    #appShell:is(.desktop-wall-elevation, .desktop-floor-plan) #controls > .tile-group input {
        min-width: 0;
        width: 100%;
    }

    #appShell:is(.desktop-wall-elevation, .desktop-floor-plan) #workspace #surfaceResults {
        display: none !important;
    }

    #appShell:is(.desktop-wall-elevation, .desktop-floor-plan) #workspace .floor-work {
        grid-template-columns: minmax(0, 1fr) 255px !important;
    }

    #appShell:is(.desktop-wall-elevation, .desktop-floor-plan) #workspace .results-rail #rightTools {
        margin: 0 !important;
    }

    #appShell:is(.desktop-wall-elevation, .desktop-floor-plan) #controls .desktop-wall-measurements {
        margin-top: 0;
        padding: 10px;
        background: #ffffff;
        border: 1px solid #d4dbe0;
        border-radius: 12px;
        color: #000000;
        grid-column: 1 / -1;
    }

    #appShell:is(.desktop-wall-elevation, .desktop-floor-plan) #controls .desktop-wall-measurements h3 {
        margin: 0 0 10px !important;
        color: #000000;
        font-size: 13px !important;
        letter-spacing: 0;
        font-weight: 800;
    }

    #appShell:is(.desktop-wall-elevation, .desktop-floor-plan) .desktop-wall-measurements dl {
        display: grid;
        gap: 9px;
        margin: 0;
    }

    #appShell:is(.desktop-wall-elevation, .desktop-floor-plan) .desktop-wall-measurements dl > div {
        display: grid;
        grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
        align-items: start;
        gap: 5px;
    }

    #appShell:is(.desktop-wall-elevation, .desktop-floor-plan) .desktop-wall-measurements dt,
    #appShell:is(.desktop-wall-elevation, .desktop-floor-plan) .desktop-wall-measurements dd {
        margin: 0;
        color: #000000;
        font-size: 12px;
        line-height: 1.3;
        overflow-wrap: anywhere;
    }

    #appShell:is(.desktop-wall-elevation, .desktop-floor-plan) .desktop-wall-measurements dd {
        text-align: left;
        font-weight: 600;
    }

    #appShell:is(.desktop-wall-elevation, .desktop-floor-plan) #drawingTools {
        align-items: stretch !important;
    }

    #appShell:is(.desktop-wall-elevation, .desktop-floor-plan) #drawingTools > .zoom-group,
    #appShell:is(.desktop-wall-elevation, .desktop-floor-plan) #drawingTools > .setout-group,
    #appShell:is(.desktop-wall-elevation, .desktop-floor-plan) #drawingTools > .manual-adjustment-group {
        box-sizing: border-box;
        margin: 0 !important;
    }

    #appShell:is(.desktop-wall-elevation, .desktop-floor-plan) #drawingTools > .zoom-group {
        flex: 0 0 190px;
    }

    #appShell:is(.desktop-wall-elevation, .desktop-floor-plan) #drawingTools > .setout-group {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        column-gap: 12px;
        row-gap: 5px;
        align-content: start;
        flex: 1 1 420px !important;
        min-width: 320px;
        max-width: none;
    }

    #appShell:is(.desktop-wall-elevation, .desktop-floor-plan) #drawingTools > .setout-group > h3 {
        grid-column: 1 / -1;
    }

    #appShell:is(.desktop-wall-elevation, .desktop-floor-plan) #drawingTools > .setout-group > .setout-label,
    #appShell:is(.desktop-wall-elevation, .desktop-floor-plan) #drawingTools > .setout-group > .segmented {
        margin: 0 !important;
    }

    #appShell:is(.desktop-wall-elevation, .desktop-floor-plan) #drawingTools > .setout-group > .setout-label:nth-of-type(1),
    #appShell:is(.desktop-wall-elevation, .desktop-floor-plan) #drawingTools > .setout-group > .segmented:nth-of-type(1) {
        grid-column: 1;
    }

    #appShell:is(.desktop-wall-elevation, .desktop-floor-plan) #drawingTools > .setout-group > .setout-label:nth-of-type(2),
    #appShell:is(.desktop-wall-elevation, .desktop-floor-plan) #drawingTools > .setout-group > .segmented:nth-of-type(2) {
        grid-column: 2;
    }

    #appShell:is(.desktop-wall-elevation, .desktop-floor-plan) #drawingTools > .setout-group > .setout-label {
        grid-row: 2;
    }

    #appShell:is(.desktop-wall-elevation, .desktop-floor-plan) #drawingTools > .setout-group > .segmented {
        grid-row: 3;
        display: flex;
        gap: 3px;
    }

    #appShell:is(.desktop-wall-elevation, .desktop-floor-plan) #drawingTools > .setout-group button {
        flex: 1 1 0;
        min-width: 0;
    }

    #appShell:is(.desktop-wall-elevation, .desktop-floor-plan) #drawingTools .setout-summary {
        display: none !important;
    }

    #appShell:is(.desktop-wall-elevation, .desktop-floor-plan) #drawingTools .wall-pan-row {
        margin-top: 8px;
        flex-wrap: nowrap;
    }

    #appShell:is(.desktop-wall-elevation, .desktop-floor-plan) #drawingTools .wall-pan-row button {
        padding: 5px 7px;
        font-size: 10px;
    }
}


/* V1.78: black wall headers and the existing header-button palette. */
@media screen and (min-width: 701px) and (orientation: landscape),
       screen and (min-width: 1101px) {
    #appShell.desktop-wall-elevation #controls h3,
    #appShell.desktop-wall-elevation #workspace h2,
    #appShell.desktop-wall-elevation #workspace h3,
    #appShell.desktop-wall-elevation #drawingTools h3,
    #appShell.desktop-wall-elevation .l-shape-elevation-plan-heading {
        color: #000000 !important;
    }

    #appShell.desktop-wall-elevation #workspace .title-row h2 {
        text-transform: uppercase;
    }

    #appShell.desktop-wall-elevation #workspace .results-rail #rightTools {
        background: #102a43 !important;
        border-color: #102a43 !important;
    }

    #appShell.desktop-wall-elevation #controls .l-shape-floor-return,
    #appShell.desktop-wall-elevation #drawingTools .setout-group button.active {
        background: #273543 !important;
        color: #dfe8ef !important;
        border-color: #52616d;
    }

    #appShell.desktop-wall-elevation #drawingTools .setout-group button:not(.active) {
        background: #ffffff;
        color: #17202a;
    }
}

/* Shared desktop/mobile navigation instructions. */
#appShell .l-shape-elevation-plan-heading span {
    display: block;
    font-size: 11px;
    line-height: 1.35;
    margin-top: 4px;
    color: #000;
}

#appShell .title-row:has(.floor-plan-view-instruction) {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
}

#appShell .floor-plan-view-instruction {
    margin: 0;
    color: #000;
    font-size: 12px;
}

/* V1.80: approved start-page mockup; workspace presentation stays separate. */
#homeScreen {
    background: #102a43;
    padding-top: 28px;
    padding-bottom: 36px;
}

#homeScreen .home-topbar {
    margin-bottom: 24px;
}

#homeScreen .home-brand-image {
    display: block;
    width: 260px;
    max-width: 100%;
    height: auto;
    opacity: 1;
}

#homeScreen .version {
    color: #ffffff;
}

#homeScreen .home-project-bar,
#homeScreen .workflow-card {
    background: #ffffff;
    border: 4px solid #f28c18;
    border-radius: 12px;
}

#homeScreen .home-project-bar {
    padding: 22px 18px;
}

#homeScreen .home-project-summary strong,
#homeScreen .workflow-heading h2,
#homeScreen .workflow-card strong {
    text-transform: uppercase;
}

#homeScreen .workflow-heading.compact {
    margin: 30px 0 16px;
}

#homeScreen .workflow-heading .eyebrow {
    color: #f28c18;
}

#homeScreen .workflow-heading h2 {
    color: #ffffff;
}

#homeScreen .workflow-card {
    min-height: 108px;
    padding: 20px 12px;
    grid-template-columns: 48px minmax(0, 1fr);
}

#homeScreen .workflow-icon {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border-radius: 10px;
    background: #fff1e3;
    color: #f28c18;
}

@media (max-width: 800px),
       (orientation: portrait) and (max-width: 1100px) {
    #homeScreen {
        padding: 18px 12px 28px;
    }

    #homeScreen .home-brand {
        min-width: 0;
    }

    #homeScreen .home-brand-image {
        width: 240px;
    }

    #homeScreen .home-project-bar {
        padding: 16px 12px;
    }

    #homeScreen .workflow-card {
        min-height: 96px;
        padding: 16px 12px;
    }
}

/* V1.81: Sansita throughout, with the exact replacement brand image. */
:root,
body,
body *,
button,
input,
select,
textarea {
    font-family: 'Sansita', Arial, sans-serif;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
}

#homeScreen .home-brand-image {
    width: 360px;
}

.brand-button .header-brand-image {
    opacity: 1;
}

@media screen and (min-width: 701px) and (orientation: landscape),
       screen and (min-width: 1101px) {
    #appShell.desktop-wall-elevation #controls > .tile-group {
        grid-column: 1 / -1;
        grid-row: auto !important;
    }
}

@media (max-width: 800px),
       (orientation: portrait) and (max-width: 1100px) {
    #homeScreen .home-brand-image {
        width: 280px;
    }
}

/* V1.82: taller desktop drawings and navy workflow setup pages. */
@media screen and (min-width: 701px) and (orientation: landscape),
       screen and (min-width: 1101px) {
    #appShell #workspace #canvas.canvas-wrap {
        aspect-ratio: 2 / 1 !important;
    }
}

#floorShapeScreen,
#lShapeSetupScreen,
:is(#floorShapeScreen, .mobile-drawing-viewer) .setup-page-header,
#lShapeSetupScreen .setup-page-header {
    background: #102a43;
}

#floorShapeScreen .floor-shape-heading h2,
#floorShapeScreen .floor-shape-heading p,
#lShapeSetupScreen .l-shape-setup-heading-row h2,
#lShapeSetupScreen .l-shape-setup-heading-row p {
    color: #ffffff;
}

#floorShapeScreen .floor-shape-eyebrow {
    color: #f28c18;
}





@media screen and (min-width: 701px) and (orientation: landscape),
       screen and (min-width: 1101px) {
    #appShell #controls > .group,
    #appShell #controls .l-shape-drawing-navigator,
    #appShell #controls .desktop-wall-measurements,
    #appShell #controls .desktop-floor-measurements {
        background: #edf2f5 !important;
    }
    #appShell.desktop-floor-plan #controls > .group,
    #appShell.desktop-floor-plan #controls > .desktop-floor-measurements {
        grid-column: 1 / -1 !important;
        grid-row: auto !important;
    }
    #appShell.desktop-floor-plan #controls .desktop-floor-measurements {
        padding: 10px;
        border: 1px solid #d4dbe0;
        border-radius: 12px;
        margin: 0;
        width: 100%;
    }
    #appShell.desktop-floor-plan .desktop-floor-measurements h3 {
        color: #000;
        font-size: 13px;
        letter-spacing: 0;
        margin: 0 0 12px;
    }
    #appShell.desktop-floor-plan .desktop-floor-measurements .result-grid {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 10px;
    }
    #appShell.desktop-floor-plan .desktop-floor-measurements .result-grid > div {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
        gap: 6px;
        align-items: start;
        grid-column: auto;
    }
    #appShell.desktop-floor-plan .desktop-floor-measurements span,
    #appShell.desktop-floor-plan .desktop-floor-measurements b {
        color: #000;
        font-size: 12px;
        text-align: left;
        overflow-wrap: anywhere;
    }
    #appShell.desktop-floor-plan .desktop-floor-measurements span {
        text-transform: uppercase;
    }
    #appShell.desktop-floor-plan #controls .tile-group label::before {
        content: none !important;
    }
    #appShell.desktop-floor-plan #controls .tile-group label {
        font-size: 11px !important;
    }
}

@media screen and (min-width: 701px) and (orientation: landscape),
       screen and (min-width: 1101px) {
    #appShell.desktop-floor-plan #controls h3,
    #appShell.desktop-floor-plan #drawingTools h3 {
        color: #000;
    }
    #appShell.desktop-floor-plan #workspace h2 {
        text-transform: uppercase;
    }
    #appShell.desktop-floor-plan #drawingTools > .group:has(.pattern-grid) {
        flex: 0 0 200px !important;
        min-width: 0 !important;
        max-width: 200px;
    }
    #appShell.desktop-floor-plan #drawingTools > .zoom-group {
        flex: 0 0 160px;
    }
    #appShell.desktop-floor-plan #drawingTools > .manual-adjustment-group {
        flex: 0 0 180px !important;
        min-width: 180px !important;
    }
    #appShell.desktop-floor-plan #drawingTools > .setout-group {
        min-width: 380px;
    }
}

@media screen and (min-width: 701px) and (orientation: landscape),
       screen and (min-width: 1101px) {
    #appShell.desktop-floor-plan #drawingTools > .group {
        box-sizing: border-box;
    }
    #appShell.desktop-floor-plan #drawingTools .pattern-grid {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 5px;
    }
    #appShell.desktop-floor-plan #drawingTools .pattern-grid button {
        min-width: 0 !important;
        width: 100%;
    }
    #appShell:is(.desktop-floor-plan, .desktop-wall-elevation) #drawingTools > .manual-adjustment-group {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) !important;
        align-content: start;
        gap: 7px;
    }
    #appShell:is(.desktop-floor-plan, .desktop-wall-elevation) #drawingTools > .manual-adjustment-group > * {
        grid-column: 1 !important;
    }
    #appShell:is(.desktop-floor-plan, .desktop-wall-elevation) #drawingTools > .manual-adjustment-group button {
        min-width: 0 !important;
        width: 100%;
    }
}

/* V1.84: desktop controls fit their content and leave the drawing room. */
@media screen and (min-width: 701px) and (orientation: landscape),
       screen and (min-width: 1101px) {
    #appShell #drawingTools > .group {
        height: auto !important;
        min-height: 0 !important;
    }
    #appShell #drawingTools button {
        min-height: 28px !important;
        padding: 4px 8px !important;
        line-height: 1.2;
    }
    #appShell .l-shape-elevation-plan .ntd-perimeter,
    #appShell .l-shape-elevation-plan .l-shape-nav-wall,
    #appShell .l-shape-elevation-plan .l-shape-nav-wall.selected {
        stroke-width: 3px;
    }
    #appShell #controls > .bathroom-pattern-group {
        grid-column: 1 / -1 !important;
        grid-row: auto !important;
        margin: 0;
        padding: 8px;
        border-radius: 12px;
        border: 1px solid #d4dbe0;
    }
    #appShell #controls .bathroom-pattern-group h3 {
        margin: 0 0 6px;
        padding: 0;
        color: #000;
    }
    #appShell #controls .bathroom-pattern-group .pattern-grid {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 5px;
    }
    #appShell #controls .bathroom-pattern-group button {
        min-width: 0;
        min-height: 28px;
        padding: 4px 6px;
    }
    #appShell #controls > .tile-group,
    #appShell:is(.desktop-floor-plan, .desktop-wall-elevation) #controls > .size-group {
        padding: 8px !important;
    }
    #appShell #controls > .tile-group > h3,
    #appShell:is(.desktop-floor-plan, .desktop-wall-elevation) #controls > .size-group > h3 {
        padding: 0 !important;
        margin: 0 0 6px !important;
    }
}

/* V1.85: share the actual desktop viewport between drawing and toolbar. */
@media screen and (min-width: 701px) and (orientation: landscape),
       screen and (min-width: 1101px) {
    #appShell .centre-stage {
        height: 100%;
        min-height: 0 !important;
    }
    #appShell #workspace {
        flex: 1 1 0 !important;
        min-height: 0 !important;
    }
    #appShell #workspace > .panel {
        display: flex;
        flex-direction: column;
        height: 100%;
        min-height: 0;
    }
    #appShell #workspace .title-row {
        flex: 0 0 auto;
    }
    #appShell #workspace .floor-work {
        flex: 1 1 0;
        min-height: 0;
        grid-template-rows: minmax(0, 1fr);
    }
    #appShell #workspace #canvas.canvas-wrap {
        height: 100% !important;
        min-height: 0 !important;
        max-height: none !important;
        aspect-ratio: auto !important;
    }
    #appShell #workspace .results-rail {
        max-height: 100%;
        min-height: 0;
        overflow-y: auto;
        border-right: 0 !important;
    }
    #appShell:is(.desktop-floor-plan, .desktop-wall-elevation) #drawingTools {
        align-items: stretch !important;
        overflow: visible !important;
        padding: 6px 14px !important;
    }
    #appShell #drawingTools > .group {
        height: auto !important;
        min-height: 0 !important;
        padding: 5px 8px !important;
    }
    #appShell #drawingTools > .group h3 {
        margin: 0 0 3px !important;
        line-height: 12px;
    }
    #appShell #drawingTools button {
        min-height: 26px !important;
        padding: 3px 4px !important;
        font-size: 10px;
        line-height: 11px;
    }
    #appShell:is(.desktop-floor-plan, .desktop-wall-elevation) #drawingTools > .setout-group {
        row-gap: 3px;
        column-gap: 8px;
        min-width: 0;
    }
    #appShell #drawingTools .setout-label {
        font-size: 11px;
        line-height: 12px;
    }
    #appShell #drawingTools .wall-pan-row {
        margin-top: 4px;
    }
}

/* V1.86: continuous navy surround; retain borders on the cards themselves. */
@media screen and (min-width: 701px) and (orientation: landscape),
       screen and (min-width: 1101px) {
    #appShell #controls,
    #appShell #drawingTools {
        border: 0 !important;
    }
}

/* V1.87: no desktop floor summary; taller Set-out buttons, persistent Pan row. */
@media screen and (min-width: 701px) and (orientation: landscape),
       screen and (min-width: 1101px) {
    #appShell:is(.desktop-floor-plan, .desktop-wall-elevation) #drawingTools .setout-group button {
        min-height: 36px !important;
        font-size: 11px;
        line-height: 13px;
    }
}

/* V1.88: approved Bathroom rectangle floor is the desktop floor template.
   Card content may vary; the outer frame and toolbar geometry do not. */
@media screen and (min-width: 701px) and (orientation: landscape),
       screen and (min-width: 1101px) {
    #appShell:is(.desktop-floor-plan, .desktop-wall-elevation) main.work-layout {
        grid-template-columns: 250px minmax(0, 1fr) !important;
    }
    #appShell:is(.desktop-floor-plan, .desktop-wall-elevation) #controls {
        width: 250px;
        min-width: 250px;
        max-width: 250px !important;
    }
    #appShell:is(.desktop-floor-plan, .desktop-wall-elevation) #workspace .title-row {
        min-height: 46px;
        flex-direction: column;
        align-items: flex-start;
        justify-content: flex-start;
        gap: 4px;
    }
    #appShell:is(.desktop-floor-plan, .desktop-wall-elevation) #workspace .title-row h2 {
        font-size: 24px;
        font-weight: 700;
        color: #000;
    }
    #appShell:is(.desktop-floor-plan, .desktop-wall-elevation) #drawingTools > .group {
        height: 87px !important;
        min-height: 87px !important;
        max-height: 87px;
    }
    #appShell:is(.desktop-floor-plan, .desktop-wall-elevation) #drawingTools > .zoom-group {
        flex: 0 0 160.305px !important;
        min-width: 160.305px;
    }
    #appShell:is(.desktop-floor-plan, .desktop-wall-elevation) #drawingTools > .manual-adjustment-group {
        flex: 0 0 160.305px !important;
        min-width: 160.305px !important;
    }
    #appShell:is(.desktop-floor-plan, .desktop-wall-elevation) #drawingTools > .setout-group {
        flex: 1 1 0 !important;
        min-width: 0;
    }
    #appShell:is(.desktop-floor-plan, .desktop-wall-elevation) #drawingTools .setout-group button {
        padding: 3px 4px !important;
        overflow-wrap: anywhere;
    }
}

/* V1.89: approved floor-template spacing and toolbar width redistribution. */
@media screen and (min-width: 701px) and (orientation: landscape),
       screen and (min-width: 1101px) {
    #appShell:is(.desktop-floor-plan, .desktop-wall-elevation) #controls > .wall-height-group .field {
        margin: 0 !important;
    }
    #appShell:is(.desktop-floor-plan, .desktop-wall-elevation) .desktop-floor-measurements h3 {
        margin-bottom: 19px !important;
    }
    #appShell:is(.desktop-floor-plan, .desktop-wall-elevation) #controls > .tile-group > h3 {
        margin-bottom: 0 !important;
    }
    #appShell:is(.desktop-floor-plan, .desktop-wall-elevation) #controls > .tile-group {
        row-gap: 6px;
    }
    #appShell:is(.desktop-floor-plan, .desktop-wall-elevation) #controls > .tile-group > .field {
        margin: 0 !important;
    }
    #appShell:is(.desktop-floor-plan, .desktop-wall-elevation) #controls > .tile-group label {
        margin: 0 0 3px !important;
    }
    #appShell:is(.desktop-floor-plan, .desktop-wall-elevation) .desktop-floor-measurements .result-grid > div {
        grid-template-columns: 75px minmax(0, 1fr);
    }
    #appShell:is(.desktop-floor-plan, .desktop-wall-elevation) #drawingTools .manual-adjustment-group button {
        white-space: nowrap;
        width: 100%;
    }
    #appShell:is(.desktop-floor-plan, .desktop-wall-elevation) #drawingTools .segmented:has(> button[data-value="external-corner"]):has(> button[data-shower-position-button]:not([hidden])) > button {
        padding: 1px 3px !important;
        font-size: 10px;
        line-height: 11px;
    }
}

/* V1.90: consistent floor headings and compact content rhythm. */
@media screen and (min-width: 701px) and (orientation: landscape),
       screen and (min-width: 1101px) {
    #appShell:is(.desktop-floor-plan, .desktop-wall-elevation) .desktop-floor-measurements .result-grid {
        gap: 2px;
    }
    #appShell:is(.desktop-floor-plan, .desktop-wall-elevation) .desktop-floor-measurements .result-grid > div {
        padding-bottom: 3px;
    }
    #appShell:is(.desktop-floor-plan, .desktop-wall-elevation) #drawingTools h3,
    #appShell:is(.desktop-floor-plan, .desktop-wall-elevation) #workspace #rightTools h3 {
        color: #000;
        font-size: 12px;
        font-weight: 700;
        line-height: 14px;
        text-transform: uppercase;
    }
    #appShell:is(.desktop-floor-plan, .desktop-wall-elevation) #drawingTools button {
        min-height: 24px !important;
        padding: 2px 4px !important;
        line-height: 11px;
    }
    #appShell:is(.desktop-floor-plan, .desktop-wall-elevation) #drawingTools .setout-group button {
        min-height: 32px !important;
    }
    #appShell:is(.desktop-floor-plan, .desktop-wall-elevation) #drawingTools .segmented:has(> button[data-value="external-corner"]):has(> button[data-shower-position-button]:not([hidden])) > button {
        padding: 1px 3px !important;
    }
}

/* Brick direction belongs to floor Pattern controls, not the narrow Zoom buttons. */
#appShell.desktop-floor-plan #controls #rotateBrick {
    width: auto;
    min-width: 88px;
    white-space: nowrap;
}

#appShell.desktop-floor-plan #controls .zoom-row:has(#rotateBrick) {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Floor set-out references do not operate on the two visual rotated patterns. */
#appShell:is(.desktop-floor-plan, .desktop-wall-elevation) #drawingTools > .setout-unavailable .setout-label {
    opacity: 0.4;
}
#appShell:is(.desktop-floor-plan, .desktop-wall-elevation) #drawingTools > .setout-unavailable .segmented button {
    opacity: 0.4;
    background: #edf1f4 !important;
    color: #555 !important;
    border-color: #d7dde2 !important;
    cursor: not-allowed;
}

/* Shared desktop floor return control, aligned to the middle header workflow. */
#appShell:is(.desktop-floor-plan, .desktop-wall-elevation) #workspace .title-row {
    position: relative;
}
#appShell:is(.desktop-floor-plan, .desktop-wall-elevation) #workspace .floor-setup-back {
    position: absolute;
    box-sizing: border-box;
    background: #273543;
    color: #dfe8ef;
    border: 0;
    cursor: pointer;
}
#appShell:is(.desktop-floor-plan, .desktop-wall-elevation) #workspace .floor-setup-back:hover {
    background: #344657;
}

@media screen and (min-width: 701px) and (orientation: landscape),
       screen and (min-width: 1101px) {
    #appShell > header .project-title {
        font-size: 24px;
        font-weight: 700;
        line-height: 1.2;
    }
}

/* V1.97: desktop wall cards use the accepted floor parameters.
   Keep the existing desktop/mobile conditions and the 250px floor sidebar. */
@media screen and (min-width: 701px) and (orientation: landscape),
       screen and (min-width: 1101px) {
    #appShell.desktop-wall-elevation #controls {
        box-sizing: border-box;
        grid-template-columns: minmax(0, 1fr) !important;
        scrollbar-width: none;
    }

    #appShell.desktop-wall-elevation #controls::-webkit-scrollbar {
        display: none;
    }

    #appShell.desktop-wall-elevation #controls > .group,
    #appShell.desktop-wall-elevation #controls > .desktop-wall-measurements {
        grid-column: 1 / -1 !important;
        grid-row: auto !important;
    }

    #appShell.desktop-wall-elevation #controls > .size-group {
        width: 100%;
    }

    #appShell.desktop-wall-elevation #controls > .tile-group {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 6px 5px;
        padding: 8px !important;
    }

    #appShell.desktop-wall-elevation #controls > .tile-group h3 {
        margin: 0 !important;
        padding: 0 !important;
        font-size: 12px !important;
        font-weight: 700;
        line-height: 14px;
    }

    #appShell.desktop-wall-elevation #controls > .tile-group .field {
        margin: 0 !important;
        min-width: 0;
    }

    #appShell.desktop-wall-elevation #controls > .tile-group label {
        font-size: 11px !important;
        line-height: 12px;
        height: 12px;
        margin: 0 0 3px !important;
    }

    #appShell.desktop-wall-elevation #controls > .tile-group input {
        box-sizing: border-box;
        height: 27px;
        padding: 3px 6px;
        font-size: 12px;
    }

    #appShell.desktop-wall-elevation #controls .desktop-wall-measurements {
        box-sizing: border-box;
        width: 100%;
        margin: 0;
        padding: 10px;
        border: 1px solid #d4dbe0;
        border-radius: 12px;
    }

    #appShell.desktop-wall-elevation #controls .desktop-wall-measurements h3 {
        margin: 1px 0 19px !important;
        padding: 0;
        font-size: 13px !important;
        font-weight: 700;
        line-height: 15px;
    }

    #appShell.desktop-wall-elevation .desktop-wall-measurements dl {
        gap: 2px;
    }

    #appShell.desktop-wall-elevation .desktop-wall-measurements dl > div {
        grid-template-columns: 75px minmax(0, 1fr);
        gap: 6px;
        padding-bottom: 3px;
        border-bottom: 1px solid #d7dfe4;
    }

    #appShell.desktop-wall-elevation .desktop-wall-measurements dt,
    #appShell.desktop-wall-elevation .desktop-wall-measurements dd {
        font-size: 12px;
        line-height: 14px;
        text-align: left;
    }

    #appShell.desktop-wall-elevation .desktop-wall-measurements dd {
        font-weight: 700;
    }

    #appShell.desktop-wall-elevation #controls .l-shape-controls-navigator-slot .l-shape-elevation-plan {
        /* Shorter desktops give space to the cards without clipping controls. */
        height: clamp(60px, calc(100dvh - 650px), 150px);
        min-height: 0;
        max-height: 150px;
        aspect-ratio: auto;
    }

    #appShell.desktop-wall-elevation #controls .l-shape-floor-return {
        min-height: 36px;
        margin-top: 8px;
        border: 0;
        border-radius: 8px;
        font-size: 13px;
    }

    #appShell.desktop-wall-elevation #drawingTools h3 {
        font-size: 13px !important;
        line-height: 15px;
        font-weight: 700;
    }

    #appShell.desktop-wall-elevation #drawingTools > .manual-adjustment-group {
        grid-template-columns: minmax(0, 1fr) !important;
        grid-template-rows: 18px 24px 24px !important;
        align-items: start !important;
        align-content: start;
        gap: 4px !important;
    }

    #appShell.desktop-wall-elevation #drawingTools > .manual-adjustment-group h3 {
        grid-column: 1 !important;
        grid-row: 1;
        margin: 0 0 3px !important;
        white-space: nowrap;
    }

    #appShell.desktop-wall-elevation #drawingTools > .manual-adjustment-group #lockBtn {
        grid-row: 2;
    }

    #appShell.desktop-wall-elevation #drawingTools > .manual-adjustment-group #revertBtn {
        grid-row: 3;
    }

    #appShell.desktop-wall-elevation #drawingTools > .manual-adjustment-group button {
        grid-column: 1 !important;
        width: 100% !important;
        min-width: 0 !important;
        height: 24px;
        min-height: 24px !important;
        margin: 0 !important;
        padding: 2px 4px !important;
        font-size: 10px;
        line-height: 11px;
    }

    #appShell.desktop-wall-elevation #drawingTools .manual-adjustment-group .drag-help {
        display: none !important;
    }

    #appShell.desktop-wall-elevation #rightTools .opening-fields {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px 6px;
    }

    #appShell.desktop-wall-elevation #rightTools .opening-fields .field {
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        gap: 3px;
        min-width: 0;
        margin: 0;
    }

    #appShell.desktop-wall-elevation #rightTools .opening-fields label {
        min-height: 36px;
        margin: 0;
        font-size: 10px;
        line-height: 12px;
    }

    #appShell.desktop-wall-elevation #rightTools .opening-fields input {
        box-sizing: border-box;
        width: 100%;
        height: 28px;
        min-width: 0;
        margin: 0;
    }
}

/* V1.98: wall headings, floor-style BACK, and consistent card typography. */
@media screen and (min-width: 701px) and (orientation: landscape),
       screen and (min-width: 1101px) {
    #appShell.desktop-wall-elevation #workspace .title-row {
        position: relative;
        min-height: 48px;
    }

    #appShell.desktop-wall-elevation .wall-dimensions {
        margin: 0;
        color: #000;
        font-size: 13px;
        line-height: 15px;
        font-weight: 700;
    }

    #appShell.desktop-wall-elevation #workspace .floor-setup-back {
        position: absolute;
        box-sizing: border-box;
        background: #273543;
        color: #dfe8ef;
        border: 0;
        cursor: pointer;
    }

    #appShell.desktop-wall-elevation #workspace .floor-setup-back:hover {
        background: #344657;
    }

    #appShell.desktop-wall-elevation #controls h3,
    #appShell.desktop-wall-elevation #controls > .tile-group h3,
    #appShell.desktop-wall-elevation #controls .desktop-wall-measurements h3,
    #appShell.desktop-wall-elevation #controls .l-shape-elevation-plan-heading strong {
        color: #000;
        font-size: 13px !important;
        line-height: 15px;
        font-weight: 700;
        text-transform: uppercase;
    }
}

#appShell.desktop-wall-elevation #controls #rotateBrick {
    width: auto;
    min-width: 88px;
    white-space: nowrap;
}

#appShell.desktop-wall-elevation #controls .zoom-row:has(#rotateBrick) {
    display: flex;
    align-items: center;
    gap: 8px;
}

.shower-placement-help {
    padding: 0 8px 8px;
    font-size: 12px;
    line-height: 1.3;
}

.shower-placement-help p {
    margin: 0 0 6px;
}

.shower-placement-help button {
    width: 100%;
}

/* V2.02: approved picture cards, scoped to the opening page. */
#homeScreen .home-shell {
    max-width: 1200px;
}

#homeScreen .workflow-cards {
    gap: 18px;
    align-items: stretch;
}

#homeScreen .workflow-card {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto 96px;
    align-items: stretch;
    gap: 0;
    min-width: 0;
    min-height: 0;
    padding: 0;
    overflow: hidden;
    border: 4px solid #f28c18;
    border-radius: 12px;
    color: #111111;
    background: #ffffff;
}

#homeScreen .workflow-art {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 600 / 380;
    object-fit: cover;
}

#homeScreen .workflow-copy {
    align-content: center;
    gap: 5px;
    padding: 14px 42px 14px 18px;
    background: #ffffff;
}

#homeScreen .workflow-card strong {
    font-size: clamp(18px, 1.7vw, 24px);
    line-height: 1.15;
}

#homeScreen .workflow-card small {
    margin: 0;
    color: #43515b;
    font-size: 13px;
    line-height: 1.3;
}

#homeScreen .workflow-arrow {
    position: absolute;
    right: 16px;
    bottom: 27px;
    color: #f28c18;
    font-size: 44px;
    font-weight: 400;
    line-height: 1;
}

#homeScreen .workflow-card:hover {
    border-color: #ff9e30;
    box-shadow: 0 5px 16px #00000026;
}

#homeScreen .workflow-card:focus-visible {
    outline: 3px solid #ffffff;
    outline-offset: 4px;
}

@media (max-width: 800px),
       (orientation: portrait) and (max-width: 1100px) {
    #homeScreen .home-project-actions {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    #homeScreen .home-action-button {
        min-height: 42px;
        padding: 8px 6px;
        font-size: 12px;
        line-height: 1.2;
    }

    #homeScreen .workflow-heading.compact {
        margin: 24px 0 14px;
    }

    #homeScreen .workflow-cards {
        grid-template-columns: minmax(0, 1fr);
        gap: 12px;
    }

    #homeScreen .workflow-card {
        grid-template-columns: 38% minmax(0, 1fr);
        grid-template-rows: minmax(110px, auto);
    }

    #homeScreen .workflow-art {
        height: 100%;
        min-height: 110px;
        aspect-ratio: auto;
        object-fit: cover;
    }

    #homeScreen .workflow-copy {
        padding: 12px 28px 12px 12px;
        gap: 6px;
    }

    #homeScreen .workflow-card strong {
        font-size: clamp(16px, 4.4vw, 22px);
    }

    #homeScreen .workflow-card small {
        font-size: 12px;
        line-height: 1.3;
    }

    #homeScreen .workflow-arrow {
        top: 50%;
        right: 8px;
        bottom: auto;
        transform: translateY(-50%);
        font-size: 32px;
    }
}

/* V2.06: explicit Home action beside the project heading. */
#appShell > header .header-project-heading {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}
#appShell > header .header-home-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 36px;
    width: 36px;
    height: 36px;
    padding: 4px;
    background: transparent;
    color: #fff;
    border-radius: 7px;
}
#appShell > header .header-home-button svg {
    width: 28px;
    height: 28px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}
#appShell > header .header-home-button:hover {
    background: #273543;
}
#appShell > header .header-home-button:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}
@media screen and (min-width: 701px) and (orientation: landscape),
       screen and (min-width: 1101px) {
    #appShell > header {
        display: grid;
        grid-template-columns: 242px minmax(0, 1fr) auto auto;
    }
    #appShell > header .header-project-heading .project-title {
        min-width: 0;
        max-width: none;
    }
}
@media (max-width: 700px), (orientation: portrait) and (max-width: 1100px) {
    #appShell > header .header-project-heading {
        grid-column: 2;
        grid-row: 1;
        justify-content: flex-end;
        gap: 4px;
    }
    #appShell > header .header-home-button {
        flex-basis: 28px;
        width: 28px;
        height: 30px;
    }
    #appShell > header .header-home-button svg {
        width: 22px;
        height: 22px;
    }
}

/* V2.07: shape chooser uses the exact Start-page artwork at its larger size. */
:is(#floorShapeScreen, .mobile-drawing-viewer) .setup-page-header {
    height: auto;
    min-height: 138px;
    padding: 18px 22px;
    justify-content: center;
}
:is(#floorShapeScreen, .mobile-drawing-viewer) .shape-page-brand-image {
    display: block;
    width: 360px;
    max-width: calc(100vw - 90px);
    height: auto;
}
#appShell > header .header-left {
    display: contents;
}
@media screen and (min-width: 701px) and (orientation: landscape),
       screen and (min-width: 1101px) {
    #appShell > header {
        grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    }
    #appShell > header .header-left {
        display: flex;
        align-items: center;
        gap: 12px;
        min-width: 0;
        grid-column: 1;
        grid-row: 1;
    }
    #appShell > header .header-left > .header-project-heading {
        flex: 1 1 0;
        min-width: 0;
    }
    #appShell > header #homeBtn {
        grid-column: 2;
        grid-row: 1;
        justify-self: center;
    }
    #appShell > header nav {
        grid-column: 3;
        grid-row: 1;
        justify-self: end;
        min-width: 0;
    }
}

@media screen and (min-width: 701px) and (orientation: landscape),
       screen and (min-width: 1101px) {
    #appShell > header #homeBtn {
        position: relative;
    }
    #appShell > header #homeBtn .brand-version {
        position: absolute;
        left: calc(100% + 8px);
        top: 0;
    }
}


/* V2.08: match the shape chooser branding without changing compact sizing. */
:is(#lShapeSetupScreen, #rectangleSetupScreen) .l-shape-page-brand-image {
    display: block;
    width: 185px;
    max-width: 100%;
    height: auto;
}

@media (max-width: 700px),
       (orientation: portrait) and (max-width: 1100px) {
    :is(#lShapeSetupScreen, #rectangleSetupScreen) .l-shape-page-brand-image {
        width: 148px;
    }
}

@media screen and (min-width: 701px) and (orientation: landscape),
       screen and (min-width: 1101px) {
    /* 22px header inset + 250px heading + 12px gap = canvas edge at 284px.
       The heading may contract on narrow desktops to keep controls apart. */
    #appShell > header .header-left > .header-project-heading {
        flex: 0 1 250px;
    }

    #lShapeSetupScreen .setup-page-header {
        height: auto;
        min-height: 138px;
        padding: 18px 22px;
        justify-content: center;
    }

    :is(#lShapeSetupScreen, #rectangleSetupScreen) .l-shape-page-brand-image {
        width: 360px;
        max-width: calc(100vw - 90px);
    }
}

/* V2.08: one clear desktop interaction treatment, including dialogs,
   workflow/shape cards, header actions and expandable opening controls.
   Important declarations override earlier selected-control colours only
   during interaction; no dimensions or persistent selection change. */
@layer desktop-interaction {
    @media screen and (min-width: 701px) and (orientation: landscape) and (hover: hover),
           screen and (min-width: 1101px) and (hover: hover) {
        :is(button, summary):not(:disabled):not([aria-disabled="true"]):not([aria-disabled="true"] *) {
            transition: background-color 120ms ease, color 120ms ease, box-shadow 120ms ease;
        }

        :is(button, summary):not(:disabled):not([aria-disabled="true"]):not([aria-disabled="true"] *):is(:hover, :focus-visible) {
            background: #f28c18 !important;
            color: #102a43 !important;
            border-color: #b85d00 !important;
            box-shadow: inset 0 0 0 2px #b85d00 !important;
        }

        /* Picture-card captions have their own white backing. */
        #homeScreen .workflow-card:is(:hover, :focus-visible) .workflow-copy {
            background: #f28c18;
        }

        #homeScreen .workflow-card:is(:hover, :focus-visible) :is(strong, small, .workflow-arrow),
        .floor-shape-card:is(:hover, :focus-visible) :is(strong, small) {
            color: #102a43;
        }

        /* SVG wall targets are buttons too; highlight the real wall interval. */
        svg [role="button"]:not([aria-disabled="true"]):is(:hover, :focus-visible) {
            stroke: #f28c18 !important;
            stroke-opacity: 0.75 !important;
        }
    }
}

/* The drawing column centres its 1100px canvas above a 1687px viewport.
   Follow that same inset without moving the canvas or the centred logo. */
@media screen and (min-width: 1360px) {
    #appShell > header .header-left > .header-project-heading {
        flex: 0 0 calc(250px + max(0px, (100vw - 1687px) / 2));
    }
}

@media (prefers-reduced-motion: reduce) {
    :is(button, summary) {
        transition: none !important;
    }
}


/* V2.09: keep the first action at the canvas edge on narrower desktops.
   Fit the action group into the available space instead of shifting it left. */
@media screen and (min-width: 1101px) and (max-width: 1359px) {
    #appShell > header .header-left > .header-project-heading {
        flex: 0 0 250px;
    }

    #appShell > header .header-project-actions {
        display: grid;
        grid-template-columns: 1.4fr 1fr 0.95fr;
        width: calc((100vw - 803px) / 2);
        gap: 6px;
        align-items: stretch;
    }

    #appShell > header .header-project-actions button {
        min-width: 0;
        min-height: 34px;
        padding: 5px 4px;
        font-size: clamp(8px, 0.8vw, 10px);
        line-height: 1.1;
        overflow-wrap: anywhere;
    }
}

/* V2.10: desktop artwork sources retain the existing card grid and captions. */
#homeScreen .workflow-picture {
    display: block;
    min-width: 0;
}

/* V2.10.2: complete desktop artwork within the original card dimensions. */
@media screen and (min-width: 801px) and (orientation: landscape),
       screen and (min-width: 1101px) {
    #homeScreen .workflow-art {
        object-fit: contain;
    }
}

/* Mobile Start page project menu. Desktop actions retain their original layout. */
#homeScreen .home-project-heading {
    display: contents;
}
#homeScreen .home-project-menu-toggle {
    display: none;
}
@media (max-width: 800px),
       (orientation: portrait) and (max-width: 1100px) {
    #homeScreen .home-project-bar {
        position: relative;
    }
    #homeScreen .home-project-heading {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
    }
    #homeScreen .home-project-menu-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        flex: 0 0 40px;
        width: 40px;
        height: 40px;
        padding: 8px;
        border: 1px solid #cbd3d9;
        border-radius: 7px;
        background: #edf1f4;
        color: #102a43;
    }
    #homeScreen .home-project-menu-toggle svg {
        width: 24px;
        height: 24px;
        fill: none;
        stroke: currentColor;
        stroke-width: 2;
        stroke-linecap: round;
    }
    #homeScreen .home-project-menu-toggle:focus-visible {
        outline: 2px solid #f28c18;
        outline-offset: 2px;
    }
    #homeScreen .home-project-actions {
        display: none;
        position: absolute;
        top: 62px;
        right: 12px;
        z-index: 20;
        width: min(250px, calc(100% - 24px));
        grid-template-columns: minmax(0, 1fr);
        gap: 6px;
        padding: 8px;
        border: 1px solid #cbd3d9;
        border-radius: 8px;
        background: #ffffff;
        box-shadow: 0 6px 18px #00000026;
    }
    #homeScreen .home-project-menu-state:checked ~ .home-project-actions {
        display: grid;
    }
    #homeScreen .home-project-actions .home-action-button {
        width: 100%;
        min-height: 44px;
        text-align: left;
        padding: 10px 12px;
    }
}

/* Mobile menu tap reliability, compact project card and separate Open Project. */
#homeScreen .home-project-menu-state,
#homeScreen .mobile-open-project {
    display: none;
}
#homeScreen .home-workflow-heading-row {
    display: contents;
}
@media (max-width: 800px),
       (orientation: portrait) and (max-width: 1100px) {
    #homeScreen .home-project-bar {
        padding: 8px 12px;
    }
    #homeScreen .home-project-summary {
        gap: 2px;
    }
    #homeScreen .home-project-menu-toggle {
        flex-basis: 32px;
        width: 32px;
        height: 32px;
        padding: 4px;
        box-sizing: border-box;
        cursor: pointer;
    }
    #homeScreen .home-project-menu-state {
        display: block;
        position: absolute;
        top: 8px;
        right: 12px;
        z-index: 2;
        width: 32px;
        height: 32px;
        margin: 0;
        opacity: 0;
        cursor: pointer;
    }
    #homeScreen .home-project-bar:focus-within .home-project-menu-toggle {
        outline: 2px solid #f28c18;
        outline-offset: 2px;
    }
    #homeScreen .home-project-actions {
        top: 46px;
    }
    #homeScreen #homeProjectActions #openProjectBtn {
        display: none;
    }
    #homeScreen .home-workflow-heading-row {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
    }
    #homeScreen .mobile-open-project {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-height: 36px;
        padding: 8px 12px;
        font-size: 12px;
        white-space: nowrap;
    }
}

/* Mobile Start spacing - patch2.10.6. Desktop rules remain unchanged. */
@media (max-width: 800px),
       (orientation: portrait) and (max-width: 1100px) {
    #homeScreen .home-project-bar {
        padding: 8px;
    }
    #homeScreen .home-project-summary {
        padding-right: 40px;
    }
    #homeScreen .home-project-heading {
        display: block;
    }
    #homeScreen .home-project-menu-toggle {
        position: absolute;
        top: 8px;
        right: 8px;
    }
    #homeScreen .home-project-menu-state {
        right: 8px;
    }
    #homeScreen .home-project-actions {
        right: 8px;
    }
    #homeScreen .home-workflow-heading-row {
        align-items: flex-start;
    }
    #homeScreen .home-workflow-heading-row > .eyebrow {
        font-size: 16px;
        font-weight: 700;
        letter-spacing: normal;
    }
    #homeScreen .mobile-open-project {
        min-width: 120px;
        padding-right: 18px;
        padding-left: 18px;
    }
}

/* Mobile Help and project information reading mode - patch2.10.7. */
#homeScreen .mobile-help-action {
    display: none;
}
#helpScreen,
#helpScreen .setup-page-header {
    background: #102a43;
}
#helpScreen .setup-page-header {
    height: auto;
    min-height: 138px;
    padding: 18px 22px;
    justify-content: center;
}
#helpScreen .shape-page-brand-image {
    display: block;
    width: 360px;
    max-width: calc(100vw - 90px);
    height: auto;
}
#helpScreen .floor-shape-heading h2 {
    color: #ffffff;
}
@media (max-width: 800px),
       (orientation: portrait) and (max-width: 1100px) {
    #homeScreen .mobile-help-action {
        display: block;
    }
    .project-information-read-view {
        display: grid;
        gap: 16px;
        margin: 0;
    }
    .project-information-read-view dt {
        margin-bottom: 5px;
        font-size: 12px;
        font-weight: 700;
        color: #53606b;
    }
    .project-information-read-view dd {
        margin: 0;
        color: #17202a;
        white-space: pre-wrap;
        overflow-wrap: anywhere;
    }
}

/* Mobile project heading line box - patch2.10.8.
   Remove inline baseline space without changing either outside card gap. */
@media (max-width: 800px),
       (orientation: portrait) and (max-width: 1100px) {
    #homeScreen .home-project-heading {
        display: flex;
        align-items: flex-start;
    }
    #homeScreen .home-project-heading > .eyebrow {
        display: block;
        line-height: 1.2;
    }
}

/* Mobile Select Floor Shape and Help - patch2.10.9. */
@media (max-width: 800px),
       (orientation: portrait) and (max-width: 1100px) {
    :is(#floorShapeScreen, .mobile-drawing-viewer) .setup-page-header,
    #helpScreen .setup-page-header {
        min-height: 0;
        padding: 8px 12px 4px;
    }
    #floorShapeBackBtn,
    #helpBackBtn {
        flex: 0 0 120px;
        width: 120px;
        min-width: 120px;
        padding-right: 18px;
        padding-left: 18px;
    }
    #floorShapeScreen .floor-shape-shell {
        padding-top: 25px;
    }
    #floorShapeScreen .floor-shape-heading-row {
        align-items: flex-start;
    }
    #floorShapeWorkflowText,
    #floorShapeScreen .floor-shape-copy small {
        display: none;
    }
    #floorShapeScreen .floor-shape-options {
        gap: 15px;
    }
}

/* Mobile Select Floor Shape heading-to-card spacing - patch2.10.11. */
@media (max-width: 800px),
       (orientation: portrait) and (max-width: 1100px) {
    #floorShapeScreen .floor-shape-heading {
        margin-bottom: 15px;
    }
}

@font-face {
    font-family: 'Caveat';
    src: url('../assets/fonts/Caveat-Variable.ttf?v=2.10.12') format('truetype');
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
}
#floorShapeScreen .floor-shape-coming-soon {
    display: none;
}
/* Mobile future-shapes placeholder - patch2.10.12. */
@media (max-width: 800px),
       (orientation: portrait) and (max-width: 1100px) {
    #floorShapeScreen .floor-shape-options {
        grid-auto-rows: 1fr;
    }
    #floorShapeScreen .floor-shape-coming-soon {
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: default;
    }
    #floorShapeScreen .coming-soon-caption {
        font-family: 'Caveat', cursive;
        font-size: clamp(38px, 10vw, 48px);
        font-weight: 700;
        line-height: 1.1;
        text-align: center;
        color: #102a43;
    }
}

#floorShapeScreen .floor-shape-card-arrow,
#floorShapeScreen .coming-soon-shapes {
    display: none;
}
/* Mobile shape cards match the accepted Start-page selector format. */
@media (max-width: 800px),
       (orientation: portrait) and (max-width: 1100px) {
    #floorShapeScreen .floor-shape-shell {
        width: 100%;
        padding-right: 12px;
        padding-left: 12px;
    }
    #floorShapeScreen .floor-shape-card {
        position: relative;
        min-width: 0;
        min-height: 0;
        padding: 0;
        overflow: hidden;
        border: 4px solid #f28c18;
        border-radius: 12px;
        background: #ffffff;
        color: #111111;
    }
    #floorShapeScreen button.floor-shape-card {
        display: grid;
        grid-template-columns: 38% minmax(0, 1fr);
        grid-template-rows: minmax(110px, auto);
        align-items: stretch;
        gap: 0;
    }
    #floorShapeScreen .floor-shape-preview {
        display: block;
        width: 100%;
        height: 100%;
        min-height: 110px;
        max-height: none;
        aspect-ratio: auto;
        background: #cfcfcf;
    }
    #floorShapeScreen .floor-shape-copy {
        min-width: 0;
        align-content: center;
        gap: 6px;
        padding: 12px 28px 12px 12px;
        background: #ffffff;
    }
    #floorShapeScreen .floor-shape-copy strong {
        font-size: clamp(16px, 4.4vw, 22px);
        line-height: 1.15;
        text-transform: uppercase;
    }
    #floorShapeScreen .floor-shape-card-arrow {
        display: block;
        position: absolute;
        top: 50%;
        right: 8px;
        transform: translateY(-50%);
        color: #f28c18;
        font-size: 32px;
        font-weight: 400;
        line-height: 1;
    }
    #floorShapeScreen .floor-shape-coming-soon {
        min-height: 118px;
    }
    #floorShapeScreen .coming-soon-shapes {
        display: block;
        position: absolute;
        inset: 0;
        width: 100%;
        height: 100%;
        fill: none;
        stroke: #f28c18;
        stroke-width: 2;
        stroke-linecap: round;
        stroke-linejoin: round;
        opacity: 0.5;
        pointer-events: none;
    }
    #floorShapeScreen .coming-soon-shapes g:nth-child(even) {
        stroke: #102a43;
        opacity: 0.65;
    }
    #floorShapeScreen .coming-soon-caption {
        position: relative;
        z-index: 1;
    }
}

/* Included in the same mobile card update: orange page heading. */
@media (max-width: 800px),
       (orientation: portrait) and (max-width: 1100px) {
    #floorShapeScreen .floor-shape-heading h2 {
        color: #f28c18;
    }
}

#lShapeSetupScreen .l-shape-mobile-instruction {
    display: none;
}
/* Mobile L-Shape Setup presentation. */
@media (max-width: 800px),
       (orientation: portrait) and (max-width: 1100px) {
    #lShapeSetupScreen .setup-page-header {
        justify-content: space-between;
    }
    #lShapeSetupScreen .l-shape-setup-heading-row {
        display: grid;
        grid-template-columns: minmax(0, 1fr) 120px;
        align-items: start;
        column-gap: 8px;
        row-gap: 6px;
    }
    #lShapeSetupScreen .l-shape-setup-heading-row > div {
        display: contents;
    }
    #lShapeSetupScreen .l-shape-setup-heading-row h2 {
        grid-column: 1;
        grid-row: 1;
        margin: 0;
        color: #f28c18;
    }
    #lShapeSetupWorkflowText,
    #lShapeOrientationLabel {
        display: none;
    }
    #lShapeSetupScreen .l-shape-mobile-instruction {
        display: block;
        grid-column: 1 / -1;
        grid-row: 2;
        margin: 0;
        font-size: 14px;
        line-height: 1.3;
    }
    #lShapeSetupBackBtn {
        grid-column: 2;
        grid-row: 1;
        width: 120px;
        min-width: 120px;
        min-height: 32px;
        padding: 5px 18px;
        font-size: 12px;
    }
    #lShapeSetupScreen .l-shape-orientation-controls {
        width: 100%;
        justify-content: center;
    }
    #lShapeRotateBtn {
        min-width: 180px;
        min-height: 44px;
        padding: 10px 24px;
        font-size: 16px;
        animation: mobile-l-shape-rotate-glow 3.5s ease-in-out infinite;
    }
}
@media (max-width: 800px),
       (orientation: portrait) and (max-width: 1100px) {
    #lShapeSetupScreen .setup-page-header {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 152px);
        align-items: start;
        gap: 4px 8px;
    }

    #lShapeSetupScreen .setup-page-header > .brand-button {
        flex: 0 1 148px;
        min-width: 0;
    }

    #lShapeSetupScreen .mobile-l-shape-setup-actions {
        display: flex;
        flex: 0 1 152px;
        flex-direction: column;
        align-items: flex-end;
        gap: 6px;
        min-width: 0;
        text-align: right;
        grid-column: 2;
        grid-row: 1 / 3;
    }

    #lShapeSetupScreen .mobile-l-shape-setup-actions #lShapeSetupBackBtn {
        width: 100px;
        min-width: 100px;
    }

    #lShapeSetupScreen .l-shape-setup-shell {
        padding-top: 2px;
    }

    #lShapeSetupScreen .l-shape-setup-heading-row {
        display: block;
        grid-column: 1;
        grid-row: 2;
        margin: 0;
    }

    #lShapeSetupScreen .l-shape-setup-heading-row .mobile-workflow-caption {
        margin-top: 2px;
        color: #f28c18 !important;
    }
}

/* Mobile setup guidance and wall-editor protection - patch2.10.16. */
@media (max-width: 800px),
       (orientation: portrait) and (max-width: 1100px) {
    #lShapeSetupScreen[data-mobile-setup-prompt="walls"] #lShapeRotateBtn,
    #lShapeSetupScreen[data-mobile-setup-prompt="complete"] #lShapeRotateBtn {
        animation: none;
    }
    #lShapeSetupScreen[data-mobile-setup-prompt="walls"] .l-shape-mobile-wall-glow line {
        animation: mobile-l-shape-wall-glow 7.2s ease-in-out infinite;
    }
    #lShapeWallDoneBtn {
        background: #263746;
        color: #ffffff;
        border-color: #263746;
    }
    #lShapeWallEditor:not([hidden]) {
        grid-column: 1;
        grid-row: 2;
        position: relative;
        z-index: 1;
    }
    /* Editor occupies the Apply row; conflicts and validation stay below it. */
    #lShapeWallEditor:not([hidden]) ~ .l-shape-setup-actions {
        grid-column: 1;
        grid-row: 2;
        visibility: hidden;
        pointer-events: none;
    }
}
@keyframes mobile-l-shape-wall-glow {
    0%, 16%, 100% {
        opacity: 0;
    }
    5%, 11% {
        opacity: 1;
    }
}
@keyframes mobile-l-shape-rotate-glow {
    0%, 60%, 100% {
        box-shadow: 0 0 0 0 #f28c1800;
    }
    25%, 35% {
        box-shadow: 0 0 16px 3px #f28c1880;
    }
}
@media (prefers-reduced-motion: reduce) {
    #lShapeRotateBtn,
    #lShapeSetupScreen[data-mobile-setup-prompt="walls"] .l-shape-mobile-wall-glow line {
        animation: none;
    }
}

.l-shape-mobile-wall-glow {
    pointer-events: none;
}
.l-shape-mobile-wall-glow line {
    opacity: 0;
    stroke: #f28c18;
    stroke-width: 5;
    stroke-linecap: round;
    filter: drop-shadow(0 0 5px #f28c18);
}

/* Shared mobile L-shape floor pages - patch2.10.18. */
.mobile-l-shape-menu-toggle,
.mobile-l-shape-menu-action {
    display: none;
}
@media (max-width: 700px),
       (orientation: portrait) and (max-width: 1100px) {
    #appShell:is(.mobile-l-shape-plan, .mobile-wall-elevation) > header {
        position: relative !important;
        z-index: 110 !important;
        overflow: visible;
        grid-template-columns: minmax(0, 1fr) auto 36px;
        align-items: center;
    }
    #appShell:is(.mobile-l-shape-plan, .mobile-wall-elevation) > header .header-project-heading {
        grid-column: 2;
        grid-row: 1;
        min-width: 0;
    }
    #appShell:is(.mobile-l-shape-plan, .mobile-wall-elevation) > header .project-title {
        max-width: 110px;
    }
    #appShell:is(.mobile-l-shape-plan, .mobile-wall-elevation) > header > nav,
    #appShell:is(.mobile-l-shape-plan, .mobile-wall-elevation) #workspaceHomeBtn {
        display: none;
    }
    #appShell:is(.mobile-l-shape-plan, .mobile-wall-elevation) .mobile-l-shape-menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        grid-column: 3;
        grid-row: 1;
        width: 36px;
        height: 36px;
        padding: 6px;
        background: #102a43;
        color: #ffffff;
        border: 1px solid #435464;
        border-radius: 7px;
        cursor: pointer;
    }
    .mobile-l-shape-menu-toggle svg {
        display: block;
        flex: 0 0 24px;
        width: 24px;
        height: 24px;
        fill: none;
        stroke: #ffffff;
        stroke-width: 2;
    }
    #appShell:is(.mobile-l-shape-plan, .mobile-wall-elevation) .mobile-l-shape-menu-toggle:focus-visible {
        outline: 2px solid #f28c18;
        outline-offset: 2px;
    }
    #appShell:is(.mobile-l-shape-plan, .mobile-wall-elevation) > header .header-project-actions {
        display: none;
        position: absolute;
        top: calc(100% + 4px);
        right: 9px;
        width: min(240px, calc(100vw - 18px));
        padding: 8px;
        gap: 6px;
        background: #102a43;
        border: 1px solid #f28c18;
        border-radius: 8px;
        box-shadow: 0 6px 18px #00000040;
        z-index: 3;
    }
    #appShell:is(.mobile-l-shape-plan, .mobile-wall-elevation) #mobileLShapeMenuToggle[aria-expanded="true"] ~ .header-left .header-project-actions {
        display: grid;
    }
    #appShell:is(.mobile-l-shape-plan, .mobile-wall-elevation) .header-project-actions button {
        display: block;
        width: 100%;
        min-height: 38px;
        padding: 8px 10px;
        font-size: 12px;
        text-align: left;
    }
    #appShell:is(.mobile-l-shape-plan, .mobile-wall-elevation) #controls {
        grid-template-columns: minmax(0, 1fr) !important;
    }
    #appShell:is(.mobile-l-shape-plan, .mobile-wall-elevation) #controls > .size-group {
        display: none !important;
    }
    #appShell:is(.mobile-l-shape-plan, .mobile-wall-elevation) #controls > .tile-group {
        display: grid !important;
        grid-column: 1 / -1 !important;
        grid-template-columns: auto repeat(3, minmax(0, 1fr)) !important;
        align-items: center;
        width: 100% !important;
        margin: 0 !important;
    }
    #appShell:is(.mobile-l-shape-plan, .mobile-wall-elevation) #controls > .tile-group > h3 {
        grid-column: 1 !important;
        grid-row: 1;
        margin: 0 6px 0 0 !important;
    }
    #appShell:is(.mobile-l-shape-plan, .mobile-wall-elevation) #controls > .tile-group > .field {
        grid-column: auto !important;
        grid-row: 1;
    }
    #appShell:is(.mobile-l-shape-plan, .mobile-wall-elevation) #controls > .tile-group input {
        height: 32px !important;
        min-height: 32px !important;
        padding: 4px 6px !important;
        font-size: 14px !important;
    }
    #appShell:is(.mobile-l-shape-plan, .mobile-wall-elevation) #workspace #canvas {
        display: block !important;
        width: min(86vw, 320px) !important;
        max-width: 100% !important;
        height: min(86vw, 320px) !important;
        aspect-ratio: 1 !important;
        min-height: 0 !important;
        margin: 0 auto;
        padding: 0 !important;
        border: 0;
        border-radius: 9px;
        background: #cfcfcf;
    }
    #appShell:is(.mobile-l-shape-plan, .mobile-wall-elevation) #canvas .floor {
        background: #b7b7b7 !important;
        border: 0 !important;
        box-shadow: none !important;
    }
    #appShell:is(.mobile-l-shape-plan, .mobile-wall-elevation) #canvas .tile {
        background: #f4f3f3 !important;
        border-color: #b7b7b7 !important;
    }
    #appShell:is(.mobile-l-shape-plan, .mobile-wall-elevation) .drawing-boundary polygon:not(:last-child) {
        display: none;
    }
    #appShell:is(.mobile-l-shape-plan, .mobile-wall-elevation) .floor-plan-view-instruction {
        display: none;
    }
}

/* Mobile L-floor Tile button: remove the always-visible input row. */
@media (max-width: 700px),
       (orientation: portrait) and (max-width: 1100px) {
    #appShell:is(.mobile-l-shape-plan, .mobile-wall-elevation) #controls {
        display: contents !important;
    }
    #appShell:is(.mobile-l-shape-plan, .mobile-wall-elevation) #controls > :not(.mobile-l-shape-tile-dialog):not(.mobile-wall-height-dialog):not(.mobile-room-dimensions-dialog) {
        display: none !important;
    }
    #appShell:is(.mobile-l-shape-plan, .mobile-wall-elevation) #workspace {
        padding-top: 0 !important;
    }
    #appShell:is(.mobile-l-shape-plan, .mobile-wall-elevation) #workspace > .panel {
        margin-top: 0;
    }
    #appShell:is(.mobile-l-shape-plan, .mobile-wall-elevation) #workspace .title-row {
        flex-direction: row;
        flex-wrap: nowrap;
        align-items: center;
    }
    #appShell:is(.mobile-l-shape-plan, .mobile-wall-elevation) #workspace .title-row h2 {
        margin: 0;
    }
    #appShell:is(.mobile-l-shape-plan, .mobile-wall-elevation) .mobile-l-shape-tile-button {
        flex: 0 0 auto;
        margin-left: auto;
        min-width: 80px;
        min-height: 32px;
        padding: 5px 16px;
        background: #263746;
        color: #ffffff;
        font-size: 12px;
        font-weight: 700;
    }
    #appShell:is(.mobile-l-shape-plan, .mobile-wall-elevation) :is(.mobile-l-shape-tile-dialog, .mobile-wall-height-dialog, .mobile-room-dimensions-dialog) {
        width: min(360px, calc(100vw - 24px));
        max-height: calc(100dvh - 24px);
        padding: 12px;
        border: 2px solid #f28c18;
        border-radius: 10px;
        background: #ffffff;
        color: #263746;
        overflow: auto;
    }
    :is(.mobile-l-shape-tile-dialog, .mobile-wall-height-dialog, .mobile-room-dimensions-dialog)::backdrop {
        background: #102a4380;
    }
    #appShell:is(.mobile-l-shape-plan, .mobile-wall-elevation) .mobile-tile-dialog-heading {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        margin-bottom: 10px;
    }
    #appShell:is(.mobile-l-shape-plan, .mobile-wall-elevation) .mobile-tile-dialog-heading button {
        min-height: 34px;
        padding: 5px 16px;
        background: #263746;
        color: #ffffff;
        font-size: 12px;
        font-weight: 700;
    }
    #appShell:is(.mobile-l-shape-plan, .mobile-wall-elevation) #controls .mobile-l-shape-tile-dialog .tile-group {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 8px;
        margin: 0 !important;
        padding: 0 !important;
    }
    #appShell:is(.mobile-l-shape-plan, .mobile-wall-elevation) #controls :is(.mobile-l-shape-tile-dialog, .mobile-wall-height-dialog, .mobile-room-dimensions-dialog) input {
        min-height: 36px !important;
        font-size: 16px !important;
    }
}

/* Mobile elevations share the compact floor frame and original live controls. */
@media (max-width: 700px),
       (orientation: portrait) and (max-width: 1100px) {
    #appShell.mobile-wall-elevation #workspace .title-row {
        display: flex !important;
        flex-direction: row;
        flex-wrap: nowrap;
        gap: 6px;
    }
    #appShell.mobile-wall-elevation #workspace .title-row h2 {
        flex: 1 1 auto;
        min-width: 0;
        font-size: 16px;
    }
    #appShell.mobile-wall-elevation .mobile-l-shape-tile-button,
    #appShell.mobile-wall-elevation .mobile-wall-height-button {
        flex: 0 0 auto;
        min-height: 32px;
        padding: 5px 10px;
        background: #263746;
        color: #ffffff;
        font-size: 12px;
        font-weight: 700;
    }
    #appShell.mobile-wall-elevation .mobile-l-shape-tile-button {
        min-width: 60px;
    }
    #appShell.mobile-wall-elevation .mobile-wall-height-button {
        min-width: 92px;
    }
    #appShell.mobile-wall-elevation .mobile-wall-dimension-fields {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
        gap: 8px;
    }
    #appShell.mobile-wall-elevation #drawingTools > .l-shape-drawing-navigator {
        position: static;
        order: 99;
        width: 100%;
        height: auto;
        margin: 8px 0 0;
        padding: 8px;
        background: #ffffff;
        border: 1px solid #d4dbe0;
        border-radius: 10px;
    }
    #appShell.mobile-wall-elevation #drawingTools .l-shape-elevation-plan {
        display: block;
        width: 100%;
        height: 150px;
    }
}
@media (max-width: 700px),
       (orientation: portrait) and (max-width: 1100px) {
    #appShell.mobile-wall-elevation #drawingTools .l-shape-elevation-plan {
        overflow: visible;
        margin: 8px auto;
    }
    #appShell.mobile-wall-elevation #drawingTools .l-shape-nav-floor {
        fill: #e3d8c8;
        stroke: none;
    }
    #appShell.mobile-wall-elevation #drawingTools .l-shape-nav-wall-hit {
        fill: none;
        stroke: transparent;
        pointer-events: stroke;
        cursor: pointer;
    }
    #appShell.mobile-wall-elevation #drawingTools .l-shape-nav-label {
        fill: #263746;
        font-weight: 700;
        pointer-events: none;
        stroke: #f7f2e9;
        stroke-width: 2px;
        paint-order: stroke;
    }
    #appShell.mobile-wall-elevation #drawingTools .l-shape-nav-label.selected {
        fill: #7221b5;
    }
    #appShell.mobile-wall-elevation #drawingTools .l-shape-elevation-plan-heading strong {
        color: #263746;
        font-size: 12px;
    }
    #appShell.mobile-wall-elevation #drawingTools .l-shape-elevation-plan-heading span {
        display: block;
        color: #65717c;
        font-size: 11px;
        margin: 4px 0;
    }
}

/* Shared mobile Position drawer: four columns align with Edit Options. */
@media (max-width: 700px),
       (orientation: portrait) and (max-width: 1100px) {
    #appShell .mobile-position-grid {
        gap: 10px;
    }
    #appShell .mobile-position-row {
        grid-template-columns: minmax(0, 1fr);
        gap: 6px;
    }
    #appShell .mobile-position-axis {
        font-size: 10px;
        line-height: 1.2;
    }
    #appShell .mobile-position-buttons {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 6px;
    }
    #appShell .mobile-position-buttons button {
        height: 40px !important;
        min-height: 40px !important;
        max-height: 40px !important;
        padding: 5px 2px !important;
        font-size: 10px !important;
    }
}

/* Position contrast, floor-only Shower references and three-column wall rows. */
@media (max-width: 700px),
       (orientation: portrait) and (max-width: 1100px) {
    #appShell .mobile-position-buttons button:not(.active) {
        background: #ffffff;
        color: #263746;
        border: 1px solid #cbd4da;
    }
    #appShell .mobile-position-buttons button:disabled {
        opacity: 1;
        background: #ffffff;
        color: #697680;
    }
    #appShell .mobile-position-grid.wall-position .mobile-position-buttons {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
    #appShell .mobile-position-shower-buttons {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    #appShell .mobile-position-shower-buttons button {
        grid-column: auto;
    }
}

/* Mobile Shower controls and inactive Pattern buttons — patch 2.10.26. */
@media (max-width: 700px), (orientation: portrait) and (max-width: 1100px) {
    #appShell .mobile-shower-controls-row {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr);
        align-items: end;
        gap: 10px;
    }
    #appShell .mobile-shower-editor .mobile-opening-editor-head {
        grid-template-columns: auto;
        gap: 4px;
        align-self: center;
    }
    #appShell .mobile-shower-editor .mobile-opening-fields {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    #appShell .mobile-shower-editor .drag-help {
        margin-top: 8px;
    }
    #appShell .mobile-pattern-grid button:not(.active) {
        background: #fff;
        color: #263746;
        border: 1px solid #cbd4da;
    }
}

/* Shared mobile rectangle/floor setup and compact room controls — 2.10.27. */
@media (max-width: 700px), (orientation: portrait) and (max-width: 1100px) {
    #appShell .mobile-pattern-rotate button:not(.active) {
        background: #fff;
        color: #263746;
        border: 1px solid #cbd4da;
    }
    #appShell.mobile-l-shape-plan #workspace .title-row {
        display: flex !important;
        gap: 6px;
    }
    #appShell.mobile-l-shape-plan #workspace .title-row h2 {
        flex: 1 1 auto;
        min-width: 0;
        font-size: 16px;
    }
    #appShell.mobile-l-shape-plan .mobile-l-shape-tile-button,
    #appShell.mobile-l-shape-plan .mobile-room-dimensions-button {
        flex: 0 0 auto;
        min-width: 60px;
        min-height: 32px;
        padding: 5px 10px;
        background: #263746;
        color: #fff;
        font-size: 12px;
        font-weight: 700;
    }
    #appShell .mobile-room-dimension-fields {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }
    #rectangleSetupScreen,
    #rectangleSetupScreen .setup-page-header {
        background: #102a43;
    }
    #rectangleSetupScreen .setup-page-header {
        justify-content: center;
    }
    #rectangleSetupScreen .l-shape-setup-heading-row p {
        color: #fff;
    }
    #rectangleSetupScreen .l-shape-setup-heading-row {
        align-items: flex-start;
        gap: 8px;
    }
    #rectangleSetupScreen .l-shape-setup-heading-row h2 {
        font-size: 20px;
        color: #f28c18;
    }
    #rectangleSetupScreen [data-setup-back] {
        display: block;
        width: 120px;
        min-height: 34px;
    }
    #rectangleSetupScreen .rectangle-setup-form {
        display: grid;
        gap: 12px;
        padding: 12px;
        border: 1px solid #ccd5da;
        border-radius: 10px;
        background: #fff;
    }
    #rectangleSetupScreen svg {
        display: block;
        width: min(86vw, 320px);
        max-width: 100%;
        margin: 0 auto;
        background: #cfcfcf;
        border-radius: 8px;
    }
    #rectangleSetupScreen svg text {
        font-size: 11px;
        fill: #263746;
    }
    #rectangleSetupScreen .rectangle-setup-fields {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }
    #rectangleSetupScreen .rectangle-setup-fields label {
        display: grid;
        gap: 4px;
        min-width: 0;
        font-size: 12px;
    }
    #rectangleSetupScreen input {
        width: 100%;
        min-width: 0;
        min-height: 40px;
        font-size: 16px;
    }
    #rectangleSetupScreen .l-shape-apply-button {
        width: 100%;
    }
}

/* V2.10.28: mobile label/result containment and Bathroom wall summary. */
@media (max-width: 700px), (orientation: portrait) and (max-width: 1100px) {
    #appShell.mobile-l-shape-plan #workspace .result-grid > div {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
        align-items: start;
    }
    #appShell.mobile-l-shape-plan #workspace .result-grid :is(span, b) {
        min-width: 0;
        white-space: normal;
        overflow-wrap: anywhere;
        line-height: 1.25 !important;
    }
    #appShell.mobile-l-shape-plan .mobile-l-shape-back-button {
        flex: 0 0 auto;
        min-width: 60px;
        min-height: 32px;
        padding: 5px 10px;
        background: #263746;
        color: #fff;
        font-size: 12px;
        font-weight: 700;
    }
    #appShell.mobile-bathroom-wall #drawingTools {
        display: none !important;
    }
    #appShell.mobile-bathroom-wall #workspace .floor-work {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 8px !important;
        align-items: start;
    }
    #appShell.mobile-bathroom-wall #workspace #canvas {
        grid-column: 1 / -1;
        grid-row: 1;
    }
    #appShell.mobile-bathroom-wall #workspace .mobile-edit-toolbar {
        grid-column: 1 / -1;
        grid-row: 2;
    }
    #appShell.mobile-bathroom-wall #workspace #surfaceResults {
        grid-column: 1;
        grid-row: 3;
        width: 100%;
        min-width: 0;
        margin: 0 !important;
        padding: 8px !important;
    }
    #appShell.mobile-bathroom-wall #workspace #surfaceResults h3 {
        font-size: 10px !important;
        line-height: 1.3;
        margin: 0 0 8px !important;
    }
    #appShell.mobile-bathroom-wall #workspace #surfaceResults .result-grid {
        grid-template-columns: minmax(0, 1fr) !important;
        gap: 4px !important;
    }
    #appShell.mobile-bathroom-wall #workspace #surfaceResults .result-grid > div {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        gap: 5px !important;
        align-items: start;
    }
    #appShell.mobile-bathroom-wall #workspace #surfaceResults .result-grid :is(span, b) {
        min-width: 0;
        white-space: normal;
        overflow-wrap: anywhere;
        line-height: 1.25 !important;
    }
    #appShell.mobile-bathroom-wall #workspace .floor-work > .l-shape-drawing-navigator {
        position: static;
        grid-column: 2;
        grid-row: 3;
        order: 3;
        width: 100%;
        min-width: 0;
        max-width: none;
        max-height: none;
        height: auto;
        margin: 0;
        padding: 8px;
        background: #fff;
        border: 1px solid #d4dbe0;
        border-radius: 10px;
    }
    #appShell.mobile-bathroom-wall #workspace .l-shape-elevation-plan {
        display: block;
        width: calc(100% - 20px);
        height: 130px;
        max-height: none;
        overflow: visible;
        margin: 10px auto;
    }
    #appShell.mobile-bathroom-wall #workspace .l-shape-elevation-plan-heading strong {
        color: #263746;
        font-size: 10px;
    }
    #appShell.mobile-bathroom-wall #workspace .l-shape-elevation-plan-heading span {
        display: none;
    }
    #appShell.mobile-bathroom-wall #workspace .l-shape-floor-return {
        width: 100%;
        min-width: 0;
        white-space: normal;
        padding: 6px 2px;
        font-size: 10px;
    }
}

/* V2.10.29: mobile workflow context and standalone size labels. */
.mobile-workflow-heading {
    display: contents;
}
.mobile-workflow-caption {
    display: none;
}
@media (max-width: 700px), (orientation: portrait) and (max-width: 1100px) {
    .mobile-workflow-heading {
        display: block;
        flex: 1 1 auto;
        min-width: 0;
    }
    #appShell #workspace .mobile-workflow-heading h2 {
        margin-bottom: 0 !important;
    }
    #appShell #workspace .mobile-workflow-caption,
    .mobile-workflow-caption {
        display: block !important;
        margin: 3px 0 0 !important;
        font-size: 11px !important;
        font-weight: 400;
        line-height: 1.25;
        color: #f28c18 !important;
    }
    .mobile-workflow-caption.on-dark {
        color: #fff !important;
    }
    #appShell.mobile-wall-elevation:not(.mobile-bathroom-wall) .mobile-l-shape-tile-button {
        min-width: 92px;
    }
}

@media (max-width: 700px), (orientation: portrait) and (max-width: 1100px) {
    #lShapeSetupScreen .mobile-workflow-caption {
        grid-column: 1 / -1;
        grid-row: 2;
    }
    #lShapeSetupScreen .l-shape-mobile-instruction {
        grid-row: 3;
    }
}

/* V2.10.30: independent, looping drawing environments on mobile only. */
.mobile-drawing-carousel { display: none; }
@media (max-width: 700px), (orientation: portrait) and (max-width: 1100px) {
    #appShell #workspace .floor-work.has-mobile-drawing-carousel {
        display: flex !important;
        flex-direction: column !important;
        gap: 8px !important;
    }
    #appShell #workspace .mobile-drawing-carousel {
        display: block;
        order: 2;
        width: 100%;
        min-width: 0;
        border: 1px solid #c5ced4;
        border-radius: 8px;
        background: #fff;
        overflow: hidden;
        touch-action: pan-y pinch-zoom;
    }
    #appShell #workspace .mobile-carousel-nav {
        display: flex;
        align-items: stretch;
        gap: 3px;
        padding: 5px;
        background: #eef3f6;
        border-bottom: 1px solid #d4dbe0;
    }
    #appShell #workspace .mobile-carousel-tabs {
        display: flex;
        flex: 1;
        min-width: 0;
        gap: 3px;
    }
    #appShell #workspace .mobile-carousel-nav button {
        background: #fff;
        color: #263746;
        border: 1px solid #c5ced4;
        border-radius: 5px;
        min-width: 0;
        min-height: 36px;
        padding: 5px;
        font-size: 11px;
        line-height: 1.2;
    }
    #appShell #workspace .mobile-carousel-nav .mobile-carousel-tab {
        flex: 1;
        padding: 5px 2px;
        font-size: clamp(9px, 2.5vw, 10px);
        overflow-wrap: anywhere;
    }
    #appShell #workspace .mobile-carousel-nav button[aria-selected="true"] {
        background: #263746;
        color: #fff;
        border-color: #263746;
    }
    #appShell #workspace .mobile-carousel-nav :is(.mobile-carousel-next, .mobile-carousel-previous) {
        flex: 0 0 28px;
        font-size: 24px;
        padding: 0;
    }
    #appShell #workspace .mobile-carousel-panel {
        display: block;
        min-width: 0;
        min-height: 160px;
        padding: 8px;
    }
    #appShell #workspace .mobile-carousel-panel[hidden] { display: none !important; }
    #appShell #workspace .mobile-drawing-carousel :is(.mobile-edit-toolbar, #surfaceResults) {
        width: 100%;
        margin: 0 !important;
        padding: 0 !important;
        border: 0;
        background: #fff;
    }
    #appShell #workspace .mobile-drawing-carousel #surfaceResults { display: block !important; }
    #appShell #workspace .mobile-drawing-carousel .l-shape-drawing-navigator {
        display: block !important;
        position: static;
        width: 100%;
        max-width: none;
        max-height: none;
        margin: 0;
        padding: 4px;
        border: 0;
        box-shadow: none;
        background: #fff;
    }
    #appShell #workspace .mobile-drawing-carousel .l-shape-elevation-plan {
        width: calc(100% - 32px);
        height: 190px;
        max-height: none;
        margin: 10px auto;
        overflow: visible;
    }
    #appShell #workspace .mobile-carousel-dimensions .tile-group {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 8px;
        margin: 0 0 12px;
        padding: 0;
        border: 0;
        background: #fff;
    }
    #appShell #workspace .mobile-carousel-dimensions .tile-group h3 { grid-column: 1 / -1; }
    #appShell #workspace .mobile-carousel-dimensions :is(.mobile-room-dimension-fields, .mobile-wall-dimension-fields) {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }
    #appShell #workspace .mobile-carousel-dimensions .field { min-width: 0; }
    #appShell #workspace .mobile-carousel-dimensions input {
        width: 100%;
        min-width: 0;
        min-height: 36px;
        font-size: 16px;
    }
    #appShell #workspace .mobile-carousel-shape-edit {
        background: #fff;
        color: #263746;
        border: 1px solid #c5ced4;
        padding: 9px;
    }
}

/* V2.10.31: reclaim the mobile drawing title/action row. */
.mobile-drawing-context { display: none; }
@media (max-width: 700px), (orientation: portrait) and (max-width: 1100px) {
    #appShell:is(.mobile-l-shape-plan, .mobile-wall-elevation) > header {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 36px;
        gap: 8px;
    }
    #appShell:is(.mobile-l-shape-plan, .mobile-wall-elevation) > header #homeBtn {
        width: 100%;
        max-width: 170px;
        min-width: 0;
    }
    #appShell:is(.mobile-l-shape-plan, .mobile-wall-elevation) > header .project-title,
    #appShell:is(.mobile-l-shape-plan, .mobile-wall-elevation) #workspace .title-row {
        display: none !important;
    }
    #appShell:is(.mobile-l-shape-plan, .mobile-wall-elevation) > header .mobile-drawing-context {
        display: block;
        min-width: 0;
        text-align: right;
    }
    #appShell > header .mobile-drawing-context h2 {
        color: #fff;
        margin: 0;
        font-size: 12px;
        line-height: 1.15;
        overflow-wrap: anywhere;
    }
    #appShell > header .mobile-drawing-context p {
        color: #fff;
        margin: 3px 0 0;
        font-size: 9px;
        line-height: 1.1;
    }
    #appShell #workspace .mobile-dimension-actions {
        display: flex;
        gap: 8px;
        margin-bottom: 10px;
    }
    #appShell #workspace .mobile-dimension-actions[hidden] { display: none; }
    #appShell #workspace .mobile-dimension-actions button {
        flex: 1;
        min-width: 0;
        min-height: 34px;
        margin: 0;
        padding: 6px;
        background: #263746;
        color: #fff;
        font-size: 12px;
    }
}

/* V2.10.32: compact mobile environments and consistent live measurements. */
@media (max-width: 700px), (orientation: portrait) and (max-width: 1100px) {
    #appShell:is(.mobile-l-shape-plan, .mobile-wall-elevation) #drawingTools,
    #appShell .zoom-group {
        display: none !important;
    }
    #appShell:is(.mobile-l-shape-plan, .mobile-wall-elevation) #workspace > .panel {
        padding-top: 2px !important;
    }
    #appShell #workspace .floor-work.has-mobile-drawing-carousel {
        gap: 2px !important;
    }
    #appShell #workspace .mobile-carousel-panel {
        min-height: 0;
        padding: 6px;
    }
    #appShell #workspace .mobile-drawing-carousel .mobile-edit-toolbar > h3,
    #appShell #workspace .mobile-drawing-carousel #surfaceResults > h3,
    #appShell #workspace .mobile-drawing-carousel .l-shape-elevation-plan-heading,
    #appShell #workspace .mobile-carousel-dimensions h3,
    #appShell #workspace .mobile-drawing-carousel :is(.l-shape-results-notes, .desktop-layout-status) {
        display: none !important;
    }
    #appShell #workspace .mobile-dimension-actions { margin-bottom: 6px; }
    #appShell #workspace .mobile-drawing-carousel #surfaceResults .result-grid {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        grid-auto-flow: row;
        gap: 0 10px !important;
        margin: 0 !important;
    }
    #appShell #workspace .mobile-drawing-carousel #surfaceResults .result-grid > div {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) auto !important;
        grid-column: auto !important;
        grid-row: auto !important;
        align-items: start;
        gap: 4px !important;
        min-width: 0;
        min-height: 22px;
        margin: 0 !important;
        padding: 3px 0 !important;
        border: 0;
        font-size: 11px !important;
        line-height: 1.2 !important;
    }
    #appShell #workspace .mobile-drawing-carousel #surfaceResults .result-grid :is(span, b) {
        display: block;
        min-width: 0;
        margin: 0 !important;
        font-size: 11px !important;
        line-height: 1.2 !important;
        white-space: normal !important;
        overflow-wrap: anywhere;
    }
    #appShell #workspace .mobile-drawing-carousel #surfaceResults .result-grid span { text-align: left; }
    #appShell #workspace .mobile-drawing-carousel #surfaceResults .result-grid b { text-align: right; }
    #appShell #workspace .mobile-drawing-carousel #surfaceResults .result-grid > .mobile-measurement-summary {
        border-top: 1px solid #e0e5e8;
    }
    #appShell #workspace .mobile-drawing-carousel #surfaceResults .result-grid > .mobile-measurement-summary-first {
        grid-column: 1 !important;
    }
    #appShell #workspace .mobile-drawing-carousel #surfaceResults .result-grid > :is(.mobile-measurement-wide, .mobile-measurement-single) {
        grid-column: 1 / -1 !important;
        grid-template-columns: minmax(70px, .3fr) minmax(0, 1fr) !important;
    }
    #appShell #workspace .mobile-drawing-carousel .l-shape-drawing-navigator { padding: 0; }
    #appShell #workspace .mobile-drawing-carousel .l-shape-elevation-plan {
        display: block;
        width: 100%;
        max-width: 210px;
        height: clamp(112px, calc(100dvh - 480px), 160px);
        margin: 2px auto 6px;
    }
    #appShell #workspace .mobile-drawing-carousel .l-shape-floor-return {
        display: block;
        width: 100%;
        min-height: 32px;
        margin: 0;
        padding: 6px;
        font-size: 11px;
    }
    #appShell #workspace .mobile-carousel-dimensions .tile-group { margin-bottom: 8px; }
    #appShell #workspace .mobile-carousel-dimensions .field { margin: 0; }
}

/* V2.10.34: Navigator actions share the image row on mobile only. */
@media (max-width: 700px), (orientation: portrait) and (max-width: 1100px) {
    .mobile-navigator-layout { display: grid; grid-template-columns: minmax(0, 1fr) 112px; gap: 8px; align-items: center; }
    .mobile-navigator-image { min-width: 0; }
    .mobile-navigator-image[hidden] { display: none; }
    #workspace .mobile-navigator-image .l-shape-elevation-plan {
        width: 100%; max-width: 190px; height: 140px; margin: 0 auto;
    }
    .mobile-navigator-image .l-shape-floor-return { display: none !important; }
    .mobile-navigator-actions { display: flex; flex-direction: column; gap: 4px; }
    .mobile-navigator-button { width: 100%; min-height: 32px; padding: 5px 6px; font-size: 12px; }
    .mobile-navigator-workflows { display: block; }
    .mobile-navigator-workflows .mobile-navigator-actions { max-width: 240px; margin: 0 auto; }
}

/* V2.10.35: a separate frozen viewer never manipulates live drawing state. */
.mobile-drawing-magnify {
    display: none;
}

@media (max-width: 700px), (orientation: portrait) and (max-width: 1100px) {
    #workspace .mobile-drawing-magnify {
        display: grid;
        place-items: center;
        position: absolute;
        top: 6px;
        right: 6px;
        z-index: 200;
        width: 40px;
        height: 40px;
        min-height: 40px;
        padding: 8px;
        border: 1px solid #aebbc4;
        border-radius: 8px;
        background: #fff;
        color: #263746;
        box-shadow: 0 1px 4px #102a4326;
        touch-action: manipulation;
    }

    .mobile-drawing-magnify svg {
        width: 22px;
        height: 22px;
        fill: none;
        stroke: currentColor;
        stroke-width: 2;
        stroke-linecap: round;
    }
}

.mobile-drawing-viewer {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
    background: #cdcdcd;
    color: #fff;
    overscroll-behavior: none;
}

.drawing-viewer-bar {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 4px;
    padding: max(4px, env(safe-area-inset-top)) max(6px, env(safe-area-inset-right)) 4px max(6px, env(safe-area-inset-left));
    background: #102a43;
}

.drawing-viewer-bar > span {
    flex: 1;
    min-width: 0;
    font-size: 13px;
}

.drawing-viewer-bar button {
    min-width: 40px;
    min-height: 40px;
    padding: 6px;
    border: 1px solid #aebbc4;
    border-radius: 6px;
    background: #fff;
    color: #263746;
    font-size: 13px;
}

.drawing-viewer-bar button:disabled {
    opacity: .5;
}

.drawing-viewer-stage {
    position: relative;
    flex: 1;
    min-height: 0;
    overflow: hidden;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
    overscroll-behavior: none;
    cursor: grab;
}

.drawing-viewer-stage:active {
    cursor: grabbing;
}

.drawing-viewer-image {
    position: absolute;
    left: 0;
    top: 0;
    transform-origin: 0 0;
    pointer-events: none;
    will-change: transform;
}

.drawing-viewer-image *::before,
.drawing-viewer-image *::after {
    content: none !important;
}

@media print {
    .mobile-drawing-magnify,
    .mobile-drawing-viewer {
        display: none !important;
    }
}

/* V2.10.36: compact opening fields and symmetrical Dimensions actions. */
@media (max-width: 700px), (orientation: portrait) and (max-width: 1100px) {
    #appShell .mobile-opening-compact {
        gap: 6px;
    }

    #appShell .mobile-opening-grid {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr)) 64px;
        gap: 6px 8px;
        align-items: stretch;
    }

    #appShell .mobile-opening-grid > label {
        display: grid;
        gap: 3px;
        min-width: 0;
        margin: 0;
        font-size: 11px;
    }

    #appShell .mobile-opening-grid input[type="number"] {
        box-sizing: border-box;
        width: 100%;
        min-width: 0;
        min-height: 36px;
        margin: 0;
        padding: 5px;
        font-size: 16px;
    }

    #appShell .mobile-opening-grid > .mobile-opening-toggle {
        grid-column: 3;
        grid-row: 1 / 3;
        grid-template-rows: 1fr 1fr;
        justify-items: center;
        align-items: center;
        text-align: center;
        font-size: 12px;
    }

    #appShell .mobile-opening-grid .mobile-opening-toggle input {
        width: 24px;
        height: 24px;
        margin: 0;
    }

    #appShell .mobile-opening-compact .mobile-opening-done {
        min-height: 34px;
        margin: 0;
        padding: 6px;
    }

    #appShell #workspace .mobile-dimension-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    #appShell #workspace .mobile-dimension-actions button {
        box-sizing: border-box;
        width: 100%;
        min-width: 0;
        height: 38px;
        min-height: 38px;
        margin: 0;
        padding: 6px;
        text-align: center;
        line-height: 1.15;
        white-space: normal;
    }

    #appShell #workspace .mobile-dimension-actions button:only-child {
        grid-column: 1 / -1;
    }

    .mobile-carousel-navigator .l-shape-nav-label {
        display: none;
    }
}

/* V2.10.38: mobile menu hierarchy, readable carousel and result columns. */
.mobile-home-menu-action { display: none; }
@media (max-width: 700px), (orientation: portrait) and (max-width: 1100px) {
    #appShell:is(.mobile-l-shape-plan, .mobile-wall-elevation) > header {
        z-index: 500 !important;
    }
    #homeScreen .mobile-home-menu-action,
    #appShell .mobile-workflow-menu {
        display: block;
    }
    :is(#homeProjectActions, #workspaceProjectActions) :is(button, summary) {
        text-transform: uppercase !important;
    }
    .mobile-workflow-menu {
        min-width: 0;
        width: 100%;
    }
    .mobile-workflow-menu summary {
        box-sizing: border-box;
        min-height: 38px;
        padding: 10px;
        border: 1px solid #c5ced4;
        border-radius: 6px;
        background: #fff;
        color: #263746;
        font-size: 12px;
        line-height: 1.2;
        text-align: left;
        cursor: pointer;
    }
    .mobile-workflow-menu summary:focus-visible {
        outline: 2px solid #f28c18;
        outline-offset: 2px;
    }
    #workspaceProjectActions .mobile-workflow-menu summary {
        background: #263746;
        color: #fff;
    }
    .mobile-workflow-submenu {
        display: grid;
        gap: 6px;
        margin: 6px 0 0 10px;
        padding-left: 6px;
        border-left: 2px solid #f28c18;
    }
    #appShell #workspace .mobile-carousel-nav {
        padding: 6px;
        align-items: end;
    }
    #appShell #workspace .mobile-carousel-tabs {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 2fr) minmax(0, 1fr);
        align-items: end;
        gap: 5px;
    }
    #appShell #workspace .mobile-carousel-tabs .mobile-carousel-tab {
        grid-row: 1;
        min-height: 36px;
        padding: 5px 3px;
        font-size: 12px;
        overflow-wrap: normal;
    }
    #appShell #workspace .mobile-carousel-tabs [data-slot="previous"] { grid-column: 1; }
    #appShell #workspace .mobile-carousel-tabs [data-slot="next"] { grid-column: 3; }
    #appShell #workspace .mobile-carousel-tabs [data-slot="active"] {
        grid-column: 2;
        min-height: 46px;
        font-size: 16px;
        font-weight: 700;
        border-bottom-left-radius: 0;
        border-bottom-right-radius: 0;
    }
    #appShell #workspace .mobile-carousel-tabs [hidden],
    #appShell #workspace :is(.mobile-carousel-previous, .mobile-carousel-next) {
        display: none !important;
    }
    #appShell #workspace .mobile-measurement-columns > .mobile-measurement-column-summary {
        padding-left: 6px !important;
        border-left: 1px solid #e0e5e8 !important;
    }
}

/* V2.10.39: size dialogs leave clear space for mobile carousel swipes. */
.mobile-drawing-tile-size { display: none; }
@media (max-width: 700px), (orientation: portrait) and (max-width: 1100px) {
    #appShell .mobile-opening-shortcuts button {
        background: #fff;
        color: #263746;
        border-color: #c5ced4;
    }
    #appShell .mobile-opening-shortcuts button.enabled {
        background: #263746;
        color: #fff;
        border-color: #263746;
    }
    #appShell .mobile-opening-shortcuts button :is(b, span) {
        color: inherit;
    }
    #appShell #workspace :is(.mobile-carousel-dimensions, .mobile-carousel-edit) {
        box-sizing: border-box;
        min-height: 150px;
    }
    #workspace .mobile-drawing-tile-size {
        display: block;
        position: absolute;
        bottom: 6px;
        left: 8px;
        z-index: 200;
        padding: 2px 4px;
        border-radius: 3px;
        background: #ffffffbd;
        color: #263746;
        font-size: 11px;
        line-height: 1.2;
        pointer-events: none;
    }
}
@media print {
    .mobile-drawing-tile-size { display: none !important; }
}

/* V2.10.40: consistent mobile page surround and setup guidance. */
@media screen and (max-width: 800px),
       screen and (orientation: portrait) and (max-width: 1100px) {
    :root, body, .home-screen, .floor-shape-screen, .l-shape-setup-screen,
    .setup-page-header, #appShell, #appShell main,
    #appShell .centre-stage, #appShell #workspace, #appShell > header {
        background: #102a43 !important;
    }
    #floorShapeScreen .floor-shape-heading p,
    #rectangleSetupScreen .l-shape-setup-heading-row p {
        color: #fff;
    }
    #lShapeSetupScreen .l-shape-setup-hint { display: none; }
    #lShapeSetupScreen .l-shape-dimension-panel > .l-shape-mobile-instruction {
        grid-column: 1;
        grid-row: 1;
        margin: 0;
        color: #263746;
        font-size: 14px;
        font-weight: 400;
        line-height: 1.3;
    }
    #lShapeSetupScreen .l-shape-apply-button {
        min-height: 48px;
        padding: 10px 16px;
        font-size: 14px;
    }
}
/* Help content remains readable on its navy page. */
#helpScreen .app-user-guide {
    display: grid;
    gap: 16px;
    color: #263746;
    font-size: 16px;
    line-height: 1.55;
}
#helpScreen .app-user-guide > :is(section, nav) {
    padding: 18px;
    background: #fff;
    border: 1px solid #d4dbe0;
    border-radius: 10px;
    scroll-margin-top: 16px;
    overflow-wrap: anywhere;
}
#helpScreen .app-user-guide h3 { margin: 0 0 10px; font-size: 19px; }
#helpScreen .app-user-guide p { margin: 0 0 12px; }
#helpScreen .app-user-guide a { color: #102a43; text-decoration: underline; }
#helpScreen .help-contents ol { margin: 0; padding-left: 24px; }
#helpScreen .help-contents a { display: block; padding: 8px 0; }
#helpScreen .help-back-to-contents { display: inline-block; padding: 8px 0; }

/* V2.10.42: keep named L-floor cuts readable within the left column. */
@media (max-width: 700px), (orientation: portrait) and (max-width: 1100px) {
    #appShell #workspace .mobile-drawing-carousel #surfaceResults
    .l-shape-results-grid.mobile-measurement-columns > :not(.mobile-measurement-column-summary) {
        grid-template-columns: 42px minmax(0, 1fr) !important;
    }
}

/* V2.10.43: one-tap photo of the frozen drawing and measurements. */
.drawing-viewer-capture svg { display: block; width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.drawing-viewer-bar > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drawing-capture-card *::before, .drawing-capture-card *::after { content: none !important; }
.drawing-capture-status { position: absolute; bottom: 8px; left: 8px; right: 8px; margin: 0; padding: 8px; border-radius: 6px; background: #fff; color: #263746; font-size: 13px; pointer-events: none; }
.drawing-capture-status[hidden] { display: none; }

/* Window/niche tile-alignment controls in the mobile Position editor. */
.mobile-opening-alignment { margin: 10px 0; padding-top: 8px; border-top: 1px solid #c5ced4; }
.mobile-opening-alignment > strong { font-size: 14px; }
.mobile-opening-alignment-choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin-top: 6px; }
.mobile-opening-alignment-choices button { min-height: 44px; padding: 6px; border: 1px solid #b6c2cc; border-radius: 6px; background: #fff; color: #102a43; font-size: 13px; line-height: 1.2; }
.mobile-opening-alignment-choices button:disabled { opacity: .5; }
.mobile-opening-alignment p { margin: 6px 0 0; font-size: 12px; line-height: 1.3; }

/* V2.10.44: simple phone screenshot composition. Branding never scales. */
.drawing-viewer-brand { flex: 0 0 auto; padding: 6px 8px; background: #fff; user-select: none; pointer-events: none; }
.drawing-viewer-brand img { display: block; width: 100%; height: auto; max-height: 112px; object-fit: contain; }
.drawing-viewer-bar { position: absolute; inset: 0 0 auto; z-index: 3; justify-content: center; }
.drawing-viewer-bar > span { display: none; }
.drawing-viewer-bar[hidden], .drawing-viewer-unlock[hidden], .drawing-viewer-measurements[hidden] { display: none !important; }
.drawing-viewer-bar button[aria-pressed="true"] { background: #264b6b; color: #fff; }
.drawing-viewer-stage { width: 100%; height: 100%; }
.drawing-viewer-measurements { position: absolute; top: 0; left: 0; z-index: 2; box-sizing: border-box; padding: 8px; border: 1px solid #9ba9b4; border-radius: 3px; background: #fff; color: #263746; font-size: 12px; line-height: 1.2; transform-origin: 0 0; cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; }
.drawing-viewer-table-title { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: start; padding-bottom: 4px; border-bottom: 1px solid #bdc8cf; overflow-wrap: anywhere; }
.drawing-viewer-table-tiles { padding: 5px 0; }
.drawing-viewer-cuts-heading { display: block; margin: 3px 0; }
.drawing-viewer-measurement-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 10px; }
.drawing-viewer-measurement-grid > div { display: grid; grid-template-columns: minmax(42px, 0.8fr) minmax(0, 1.2fr); gap: 4px; padding: 3px 0; align-self: start; border-bottom: 1px solid #e1e6ea; overflow-wrap: anywhere; }
.drawing-viewer-measurement-grid b { text-align: right; }
.drawing-viewer-table-summary { margin-top: 5px; border-top: 1px solid #bdc8cf; padding-top: 3px; }
.drawing-viewer-table-summary > div { display: flex; justify-content: space-between; gap: 8px; padding: 2px 0; }
.drawing-viewer-unlock { position: absolute; top: 8px; right: 8px; z-index: 4; min-height: 32px; padding: 4px 8px; border: 1px solid #aebbc4; border-radius: 5px; background: #102a43; color: #fff; font-size: 12px; }
.mobile-drawing-viewer[data-locked="true"] .drawing-viewer-stage, .mobile-drawing-viewer[data-locked="true"] .drawing-viewer-measurements { cursor: default; }

/* V2.10.46: mobile Zoom uses the shape chooser brand, a navy surround,
   a padded white drawing sheet, and compact single-column measurements. */
.mobile-drawing-viewer, .drawing-viewer-brand, .drawing-viewer-stage { background: #102a43; }
.drawing-viewer-brand { display: flex; align-items: center; justify-content: center; box-sizing: border-box; flex: 0 0 auto; }
.drawing-viewer-brand .shape-page-brand-image { max-height: none; object-fit: contain; }
.drawing-viewer-bar {
    inset: auto 8px max(8px, env(safe-area-inset-bottom));
    display: grid; grid-template-columns: 34px 46px 34px repeat(3, minmax(0, 1fr));
    gap: 4px; padding: 6px; border: 2px solid #f28c18; border-radius: 8px;
    background: #102a43; box-sizing: border-box; max-width: 520px; margin: 0 auto;
}
.drawing-viewer-bar button { min-width: 0; min-height: 40px; padding: 5px 3px; font-size: 12px; }
.drawing-viewer-paper { border: 2px solid #f28c18; border-radius: 6px; background: #fff; }
.drawing-viewer-measurements { padding: 10px; border: 2px solid #f28c18; border-radius: 6px; background: #fff; font-size: 13px; line-height: 1.25; }
.drawing-viewer-table-title { display: block; padding-bottom: 6px; }
.drawing-viewer-table-title b { display: inline; margin-left: 5px; }
.drawing-viewer-table-tiles { padding: 6px 0; }
.drawing-viewer-cuts-heading { display: flex; justify-content: space-between; gap: 8px; padding: 3px 0; }
.drawing-viewer-measurement-grid { grid-template-columns: minmax(0, 1fr); gap: 0; }
.drawing-viewer-measurement-grid > div { grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 10px; padding: 4px 0; }
.drawing-viewer-table-summary > div { padding: 4px 0; }
.drawing-viewer-unlock { top: auto; bottom: max(8px, env(safe-area-inset-bottom)); border: 2px solid #f28c18; }

/* Keep ordinary scrolling, but prevent Android pull-to-refresh on app pages. */
@media (max-width: 700px), (orientation: portrait) and (max-width: 1100px) {
    html, body {
        overscroll-behavior-y: none;
    }
}

/* V2.10.51: overlay the toolbar on the logo; Lock reveals the logo. */
.drawing-viewer-toolbar-rail {
    position: absolute;
    top: 0;
    left: 0;
    height: calc(64px + max(8px, env(safe-area-inset-top)));
    z-index: 3;
    width: 100%;
    overflow: hidden;
    pointer-events: none;
    background: transparent;
}
.drawing-viewer-toolbar-drawer {
    pointer-events: auto;
    --toolbar-edge-gap: max(8px, calc((100vw - 520px) / 2));
    position: absolute;
    top: max(8px, env(safe-area-inset-top));
    right: var(--toolbar-edge-gap);
    width: calc(100% - 16px);
    max-width: 520px;
    transform: translateX(0);
    transition: transform 180ms ease;
}
.drawing-viewer-toolbar-drawer .drawing-viewer-bar {
    position: relative;
    inset: auto;
    width: 100%;
    max-width: none;
    margin: 0;
}
.mobile-drawing-viewer[data-locked="true"] .drawing-viewer-toolbar-drawer {
    transform: translateX(calc(100% + var(--toolbar-edge-gap)));
}
.drawing-viewer-toolbar-drawer .drawing-viewer-unlock {
    top: 6px;
    left: -36px;
    right: auto;
    bottom: auto;
    width: 36px;
    min-width: 36px;
    min-height: 44px;
    padding: 0;
    border: 2px solid #f28c18;
    border-radius: 8px 0 0 8px;
    font-size: 24px;
    line-height: 1;
}
@media (prefers-reduced-motion: reduce) {
    .drawing-viewer-toolbar-drawer {
        transition: none;
    }
}

/* V2.10.50: one compact Measurements column for every mobile drawing. */
@media (max-width: 700px), (orientation: portrait) and (max-width: 1100px) {
    #appShell #workspace .mobile-drawing-carousel #surfaceResults .result-grid {
        width: 66.666667%;
        max-width: 66.666667vw;
        box-sizing: border-box;
        grid-template-columns: minmax(0, 1fr) !important;
    }
    #appShell #workspace .mobile-measurement-columns > .mobile-measurement-column-summary {
        padding-left: 0 !important;
        border-left: 0 !important;
    }
}

/* V2.10.52: one axis at a time, with the same controls on every mobile drawing. */
@media (max-width: 700px), (orientation: portrait) and (max-width: 1100px) {
    .mobile-edit-drawer [data-position-axis][hidden] { display: none !important; }
    .mobile-position-axis-tabs { display: flex; gap: 8px; margin-bottom: 8px; }
    .mobile-position-axis-tabs button { flex: 1; min-height: 40px; background: #fff; color: #263746; }
    .mobile-position-axis-tabs button.active { background: #263746; color: #fff; }
    #appShell .mobile-position-shower-buttons { grid-template-columns: minmax(0, 1fr); }
    .mobile-position-shower-buttons button { width: 100%; }
    .mobile-position-opening { margin-top: 8px; padding-top: 8px; border-top: 1px solid #c5ced4; }
    .mobile-position-opening .mobile-opening-alignment { margin-top: 8px; }
}

/* V2.10.54: movement axes and compact wall/opening alignment choices. */
@media (max-width: 700px), (orientation: portrait) and (max-width: 1100px) {
    .mobile-position-axis-tabs button {
        border: 1px solid #cbd4da;
        border-radius: 6px;
    }
    .mobile-position-axis-tabs button.active {
        border-color: #263746;
    }
    #appShell .mobile-position-grid.wall-position .mobile-position-buttons.has-floor-lines {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
    #appShell .has-floor-lines .mobile-follow-grout {
        margin: 0 !important;
        grid-column: auto;
    }
    .mobile-position-opening .mobile-opening-alignment {
        padding-top: 0;
        border-top: 0;
    }
    .mobile-position-opening .mobile-opening-alignment-choices {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
    .mobile-position-opening [data-opening-align="tile-centre"] {
        grid-column: 2;
    }
}

/* V2.10.56: content-sized Zoom sheet and width reflow controls. */
.drawing-viewer-paper, .drawing-viewer-measurements {
    border-width: 4px;
}
.drawing-viewer-measurements { overflow-wrap: anywhere; }
.table-resize-handle {
    position: absolute;
    top: 50%;
    width: 24px;
    min-width: 24px;
    min-height: 48px;
    padding: 0;
    transform: translateY(-50%);
    border: 2px solid #f28c18;
    border-radius: 6px;
    background: #102a43;
    color: #fff;
    font-size: 16px;
    cursor: ew-resize;
    touch-action: none;
    z-index: 3;
}
.table-resize-left { left: -12px; }
.table-resize-right { right: -12px; }
.mobile-drawing-viewer[data-locked="true"] .table-resize-handle { display: none !important; }

/* V2.10.58: shared features in the existing desktop workspace. */
@media screen and (min-width: 701px) and (orientation: landscape),
       screen and (min-width: 1101px) {
    #workspace .mobile-drawing-magnify {
        display: grid;
        place-items: center;
        position: absolute;
        top: 6px;
        right: 6px;
        z-index: 200;
        width: 40px;
        height: 40px;
        min-height: 40px;
        padding: 8px;
        border: 1px solid #aebbc4;
        border-radius: 8px;
        background: #fff;
        color: #263746;
        box-shadow: 0 1px 4px #102a4326;
    }
    #workspace .mobile-drawing-magnify svg {
        width: 22px;
        height: 22px;
        fill: none;
        stroke: currentColor;
        stroke-width: 2;
        stroke-linecap: round;
    }
    #workspace .mobile-drawing-tile-size {
        display: block;
        position: absolute;
        bottom: 6px;
        left: 8px;
        z-index: 200;
        padding: 2px 4px;
        border-radius: 3px;
        background: #ffffffbd;
        color: #263746;
        font-size: 11px;
        line-height: 1.2;
        pointer-events: none;
    }
    #appShell.desktop-wall-elevation #drawingTools > .setout-group:has(.desktop-opening-alignments) {
        height: auto !important;
        max-height: none;
    }
    .desktop-opening-alignments {
        grid-column: 1 / -1;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }
    .desktop-opening-alignments > section {
        margin-top: 10px;
        padding-top: 8px;
        border-top: 1px solid #c5ced4;
    }
    .desktop-opening-alignments > section > strong {
        font-size: 13px;
    }
    .desktop-opening-alignments .mobile-opening-alignment {
        margin: 0;
        padding-top: 0;
        border-top: 0;
    }
    .desktop-opening-alignments .mobile-opening-alignment-choices {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
    .desktop-opening-alignments [data-opening-align="tile-centre"] {
        grid-column: 2;
    }
    #homeScreen #mobileHelpBtn,
    #appShell #mobileLShapeHelpBtn {
        display: inline-block;
    }
    #appShell #mobileLShapeHelpBtn {
        position: relative;
        z-index: 2;
    }
}

/* V2.10.60: retain the established desktop frame; drawers share its sidebar. */
@media screen and (min-width: 701px) and (orientation: landscape),
       screen and (min-width: 1101px) {
    html:has(#appShell.desktop-drawer-layout),
    body:has(#appShell.desktop-drawer-layout),
    #appShell.desktop-drawer-layout,
    #appShell.desktop-drawer-layout * {
        scrollbar-width: none !important;
    }
    html:has(#appShell.desktop-drawer-layout)::-webkit-scrollbar,
    body:has(#appShell.desktop-drawer-layout)::-webkit-scrollbar,
    #appShell.desktop-drawer-layout ::-webkit-scrollbar {
        display: none !important;
        width: 0;
        height: 0;
    }
    #appShell.desktop-drawer-layout,
    #appShell.desktop-drawer-layout main.work-layout {
        overflow: visible !important;
    }
    #appShell.desktop-drawer-layout #controls {
        display: block !important;
        overflow: visible !important;
        position: relative;
        z-index: 4;
    }
    #appShell.desktop-drawer-layout #controls > :not(.desktop-drawer-menu),
    #appShell.desktop-drawer-layout [hidden],
    #appShell.desktop-drawer-layout #controls [hidden],
    #appShell.desktop-drawer-layout #drawingTools,
    #appShell.desktop-drawer-layout #surfaceResults,
    #appShell.desktop-drawer-layout .mobile-edit-toolbar,
    #appShell.desktop-drawer-layout .mobile-drawing-magnify {
        display: none !important;
    }
    /* Preserve the canvas viewport previously above the 87px toolbar + 12px padding. */
    #appShell.desktop-drawer-layout .centre-stage {
        box-sizing: border-box;
        padding-bottom: 99px;
    }
    #appShell.desktop-drawer-layout .desktop-drawer-menu {
        display: flex;
        flex-direction: column;
        gap: 8px;
        width: 100%;
        min-width: 0;
    }
    #appShell.desktop-drawer-layout .desktop-sidebar-card {
        display: block;
        box-sizing: border-box;
        margin: 0;
        padding: 8px;
        border: 1px solid #d4dbe0;
        border-radius: 10px;
        background: #edf2f5;
        color: #000;
    }
    #appShell.desktop-drawer-layout .desktop-sidebar-card > h3 {
        margin: 0 0 7px;
        padding: 0;
        font-size: 12px;
        line-height: 14px;
    }
    #appShell.desktop-drawer-layout .desktop-dimensions-card > h4 {
        margin: 8px 0 4px;
        font-size: 11px;
        line-height: 13px;
    }
    #appShell.desktop-drawer-layout .desktop-dimensions-card > .group {
        display: grid !important;
        grid-template-columns: none !important;
        grid-auto-flow: column;
        grid-auto-columns: minmax(0, 1fr);
        gap: 5px;
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
        min-width: 0 !important;
        border: 0 !important;
        background: transparent !important;
    }
    #appShell.desktop-drawer-layout .desktop-dimensions-card > .group > h3,
    #appShell.desktop-drawer-layout .desktop-drawer-content > .group > h3,
    #appShell.desktop-drawer-layout .desktop-drawer-content #rightTools > .group > h3,
    #appShell.desktop-drawer-layout .desktop-drawer-content .drag-help {
        display: none !important;
    }
    #appShell.desktop-drawer-layout .desktop-dimensions-card .field {
        grid-column: auto !important;
        grid-row: auto !important;
        display: block !important;
        min-width: 0;
        width: auto !important;
        margin: 0 !important;
    }
    #appShell.desktop-drawer-layout .desktop-dimensions-card label {
        display: block;
        height: auto !important;
        margin: 0 0 3px;
        font-size: 10px !important;
        line-height: 12px;
        white-space: normal !important;
    }
    #appShell.desktop-drawer-layout .desktop-dimensions-card input {
        box-sizing: border-box;
        width: 100%;
        min-width: 0;
        height: 27px;
        padding: 3px 5px;
        font-size: 12px;
    }
    #appShell.desktop-drawer-layout .desktop-room-edit {
        width: 100%;
        margin-top: 5px;
        min-height: 28px;
        font-size: 11px;
    }
    #appShell.desktop-drawer-layout .desktop-navigator-card .l-shape-drawing-navigator {
        position: static !important;
        max-height: none;
        box-shadow: none;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        border: 0;
        background: transparent !important;
    }
    #appShell.desktop-drawer-layout .desktop-navigator-card .l-shape-elevation-plan-heading {
        display: none;
    }
    #appShell.desktop-drawer-layout .desktop-navigator-card .l-shape-elevation-plan {
        display: block;
        box-sizing: border-box;
        padding: 14px;
        background: #cdcdcd;
        width: 100%;
        height: auto;
        max-height: none;
        aspect-ratio: auto;
        min-height: 0;
    }
    #appShell.desktop-drawer-layout .desktop-navigator-card .l-shape-nav-wall-hit {
        fill: none;
        stroke: transparent;
        pointer-events: stroke;
        cursor: pointer;
    }
    #appShell.desktop-drawer-layout .desktop-navigator-card .l-shape-nav-label {
        display: none;
    }
    #appShell.desktop-drawer-layout .desktop-navigator-card .l-shape-floor-return {
        display: block;
        width: 100%;
        min-height: 28px;
        margin-top: 5px;
        font-size: 11px;
    }
    #appShell.desktop-drawer-layout .desktop-edit-tools {
        padding: 0;
        border: 0;
        background: transparent;
        overflow: visible;
    }
    #appShell.desktop-drawer-layout .desktop-drawer-choice.desktop-edit-toggle {
        width: 100%;
    }
    #appShell.desktop-drawer-layout .desktop-edit-options {
        margin-top: 5px;
    }
    #appShell.desktop-drawer-layout .desktop-drawer-icon {
        display: inline-flex;
        flex: 0 0 16px;
        width: 16px;
        height: 16px;
    }
    #appShell.desktop-drawer-layout .desktop-drawer-icon svg {
        display: block;
        width: 100%;
        height: 100%;
        fill: none;
        stroke: currentColor;
        stroke-width: 1.7;
        stroke-linecap: round;
        stroke-linejoin: round;
    }
    #appShell.desktop-drawer-layout .desktop-drawer-row {
        position: relative;
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        align-items: start;
        gap: 0;
        margin-top: 5px;
    }
    #appShell.desktop-drawer-layout .desktop-drawer-choice {
        display: flex;
        align-items: center;
        gap: 5px;
        box-sizing: border-box;
        width: 100%;
        min-width: 0;
        min-height: 30px;
        padding: 6px 5px;
        border: 1px solid #b85d00;
        border-radius: 6px;
        background: #f28c18;
        color: #102a43;
        text-align: left;
        font-size: 11px;
        line-height: 15px;
        cursor: pointer;
    }
    #appShell.desktop-drawer-layout .desktop-drawer-choice.active {
        box-shadow: inset 0 0 0 2px #b85d00;
    }
    #appShell.desktop-drawer-layout .desktop-drawer-content,
    #appShell.desktop-drawer-layout .desktop-opening-choices {
        box-sizing: border-box;
        min-width: 0;
        padding: 5px 0 0;
        border: 0;
        background: #edf2f5;
    }
    #appShell.desktop-drawer-layout .desktop-drawer-content > .group,
    #appShell.desktop-drawer-layout .desktop-drawer-content #rightTools,
    #appShell.desktop-drawer-layout .desktop-drawer-content #rightTools > .group {
        display: block !important;
        box-sizing: border-box;
        width: 100% !important;
        min-width: 0 !important;
        max-width: none !important;
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;
        margin: 0 !important;
        padding: 0 !important;
        border: 0 !important;
        background: transparent !important;
    }
    /* Match the carousel's compact rows inside the full-width desktop drawers. */
    #appShell.desktop-drawer-layout .desktop-drawer-content :is(.pattern-grid, .desktop-position-axes) {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 4px;
        width: 100%;
        margin: 0 0 4px;
    }
    #appShell.desktop-drawer-layout .desktop-drawer-content .segmented {
        display: grid !important;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 4px;
        width: 100%;
        margin: 0 0 4px;
    }
    #appShell.desktop-drawer-layout .desktop-drawer-content .zoom-row {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) minmax(0, 1.5fr);
        align-items: center;
        gap: 4px;
        width: 100%;
        margin: 0 0 4px;
    }
    #appShell.desktop-drawer-layout .desktop-drawer-content .wall-pan-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    #appShell.desktop-drawer-layout .desktop-drawer-content :is(.bathroom-pattern-group, .toolbar-rotate) .zoom-row {
        grid-template-columns: minmax(0, 1fr) auto;
    }
    #appShell.desktop-drawer-layout .desktop-drawer-content :is(.bathroom-pattern-group, .toolbar-rotate) .zoom-row :is(button, span) {
        white-space: nowrap;
    }
    #appShell.desktop-drawer-layout .desktop-drawer-content .segmented :is([data-value="external-corner"], [data-shower-position-button]) {
        grid-column: 1 / -1;
        white-space: nowrap;
    }
    #appShell.desktop-drawer-layout .desktop-drawer-content .manual-adjustment-group {
        display: block !important;
        width: 100%;
        margin: 0 0 4px !important;
    }
    #appShell.desktop-drawer-layout .desktop-drawer-content .desktop-opening-alignments {
        grid-template-columns: minmax(0, 1fr);
        gap: 6px;
    }
    #appShell.desktop-drawer-layout .desktop-drawer-content .shower-size-fields {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 6px;
    }
    #appShell.desktop-drawer-layout .desktop-drawer-content .mobile-opening-alignment-choices {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 4px;
    }
    #appShell.desktop-drawer-layout .desktop-drawer-content button {
        box-sizing: border-box;
        display: block;
        width: 100%;
        min-width: 0;
        min-height: 30px;
        padding: 5px;
        white-space: normal;
        font-size: 10px;
        line-height: 13px;
    }
    #appShell.desktop-drawer-layout .desktop-drawer-content :is(.setout-label, .setout-note, .zoom-row span) {
        display: block;
        font-size: 10px;
        line-height: 13px;
        overflow-wrap: anywhere;
    }
    #appShell.desktop-drawer-layout .desktop-opening-row {
        position: relative;
        margin-bottom: 4px;
    }
    #appShell.desktop-drawer-layout .desktop-opening-editor {
        position: static;
        width: 100%;
        padding: 5px 0 0;
    }
    #appShell.desktop-drawer-layout .desktop-dimensions-card {
        box-sizing: border-box;
        padding: 8px;
        background: #edf2f5;
        color: #000;
    }
    #appShell.desktop-drawer-layout :is(.desktop-room-edit, [data-shower-done]) {
        background: #102a43;
        border: 1px solid #102a43;
        color: #fff;
    }
    #appShell.desktop-drawer-layout .results-rail {
        display: flex;
        flex-direction: column;
        gap: 8px;
    }
    #appShell.desktop-drawer-layout .desktop-navigator-card {
        width: 100%;
        padding: 10px;
    }
    #appShell.desktop-drawer-layout .desktop-shower-row > .desktop-drawer-content {
        grid-column: 1 / -1;
        margin-top: 5px;
        padding: 0;
    }
    #appShell.desktop-drawer-layout .desktop-drawer-content .opening-fields {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 6px;
    }
    #appShell.desktop-drawer-layout .desktop-drawer-content input {
        box-sizing: border-box;
        width: 100%;
        min-width: 0;
    }
    #appShell.desktop-drawer-layout .desktop-drawer-content label {
        font-size: 10px;
    }
    #appShell.desktop-drawer-layout .desktop-measurement-results {
        box-sizing: border-box;
        width: 100%;
        padding: 10px;
        border: 1px solid #d4dbe0;
        border-radius: 10px;
        background: #edf2f5;
        color: #000;
    }
    #appShell.desktop-drawer-layout .desktop-measurement-results > :is(.desktop-floor-measurements, .desktop-wall-measurements) {
        width: 100%;
        margin: 0;
        padding: 0;
        border: 0;
        background: transparent;
    }
    #appShell.desktop-drawer-layout .desktop-measurement-results h3 {
        margin: 0 0 12px;
        font-size: 13px;
    }
    #appShell.desktop-drawer-layout .desktop-measurement-results :is(dl, .result-grid) {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) !important;
        gap: 5px;
        margin: 0;
    }
    #appShell.desktop-drawer-layout .desktop-measurement-results :is(dl, .result-grid) > div {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        gap: 6px;
        padding: 3px 0;
        border-bottom: 1px solid #d7dfe4;
        font-size: 12px;
        line-height: 14px;
    }
    #appShell.desktop-drawer-layout .desktop-measurement-results :is(dt, dd, span, b) {
        margin: 0;
        text-align: left;
        overflow-wrap: anywhere;
    }
    #appShell.desktop-drawer-layout .desktop-measurement-results :is(dd, b) {
        font-weight: 700;
    }
    #appShell.desktop-drawer-layout #desktopMeasurementResults #surfaceResults {
        display: block !important;
    }
    /* Reuse the existing menu actions and handlers without changing header geometry. */
    #appShell.desktop-drawer-layout > header {
        position: relative;
    }
    #appShell.desktop-drawer-layout > header > nav,
    #appShell.desktop-drawer-layout #workspaceHomeBtn {
        display: none;
    }
    #appShell.desktop-drawer-layout #mobileLShapeMenuToggle {
        display: flex;
        align-items: center;
        justify-content: center;
        position: absolute;
        right: 22px;
        top: 50%;
        transform: translateY(-50%);
        width: 36px;
        height: 36px;
        padding: 6px;
        border: 1px solid #f28c18;
        border-radius: 7px;
        background: #102a43;
        cursor: pointer;
        z-index: 5;
    }
    #appShell.desktop-drawer-layout #mobileLShapeMenuToggle svg {
        width: 24px;
        height: 24px;
        fill: none;
        stroke: #fff;
        stroke-width: 2;
    }
    #appShell.desktop-drawer-layout > header .header-project-actions {
        display: none;
        position: absolute;
        top: calc(100% + 4px);
        right: 22px;
        z-index: 6;
        width: 240px;
        grid-template-columns: minmax(0, 1fr);
        padding: 8px;
        gap: 6px;
        border: 1px solid #f28c18;
        border-radius: 8px;
        background: #102a43;
        box-shadow: 0 6px 18px #0004;
    }
    #appShell.desktop-drawer-layout #mobileLShapeMenuToggle[aria-expanded="true"] ~ .header-left .header-project-actions {
        display: grid;
    }
    #appShell.desktop-drawer-layout .header-project-actions :is(button, .mobile-l-shape-menu-action) {
        display: block;
        box-sizing: border-box;
        width: 100%;
        min-height: 34px;
        padding: 7px 9px;
        text-align: left;
        font-size: 12px;
    }
    #appShell.desktop-drawer-layout .header-project-actions .mobile-workflow-menu {
        padding: 0;
    }
    #appShell.desktop-drawer-layout .header-project-actions summary {
        padding: 9px;
        cursor: pointer;
        color: #fff;
        font-size: 12px;
    }
    #appShell.desktop-drawer-layout .header-project-actions .mobile-workflow-submenu {
        display: grid;
        gap: 5px;
        padding: 0 8px 8px;
    }
    #appShell.desktop-drawer-layout .header-project-actions details:not([open]) > .mobile-workflow-submenu {
        display: none;
    }
}


/* V2.10.64–65: desktop Drawing hierarchy, compact labels and navy/orange states. */
@media screen and (min-width: 701px) and (orientation: landscape),
       screen and (min-width: 1101px) {
    #appShell.desktop-drawer-layout > header {
        height: 138px;
        min-height: 138px;
    }
    #appShell.desktop-drawer-layout main.work-layout {
        height: calc(100vh - 138px) !important;
    }
    /* Reclaim 74px of the reserved bottom space to retain the canvas height. */
    #appShell.desktop-drawer-layout .centre-stage {
        padding-bottom: 25px;
    }
    #appShell.desktop-drawer-layout #homeBtn .header-brand-image {
        width: 360px;
        max-width: calc(100vw - 90px);
    }
    #appShell.desktop-drawer-layout :is(h1, h2, h3, h4, h5, h6, .desktop-drawer-label, .setout-label, .opening-name, .desktop-opening-alignments strong) {
        font-family: 'Sansita', Arial, sans-serif;
        font-weight: 700;
        text-transform: uppercase;
    }
    #appShell.desktop-drawer-layout :is(h1, h2, .header-project-heading strong) {
        font-family: 'Sansita', Arial, sans-serif;
        font-size: 22px;
        line-height: 29px;
        font-weight: 700;
        text-transform: uppercase;
    }
    #appShell.desktop-drawer-layout h3 {
        font-size: 12px !important;
        line-height: 14px;
    }
    #appShell.desktop-drawer-layout .desktop-drawer-label {
        font-size: 11px !important;
        line-height: 15px;
        font-weight: 400;
    }
    #appShell.desktop-drawer-layout :is(h4, h5, h6, .desktop-opening-alignments strong) {
        font-size: 12px !important;
        line-height: 16px;
    }
    #appShell.desktop-drawer-layout .desktop-drawer-content :is(.opening-name, .opening-summary) {
        font: inherit !important;
        color: inherit;
    }
    #appShell.desktop-drawer-layout .desktop-drawer-content .opening-fields label {
        font-size: 10px;
        line-height: 13px;
        color: #fff;
    }
    #appShell.desktop-drawer-layout .desktop-drawer-content .setout-summary {
        display: none !important;
    }
    #appShell.desktop-drawer-layout :is(.desktop-measurement-results, .desktop-navigator-card) {
        border: 1px solid #f28c18;
        background: #102a43;
        color: #fff;
    }
    #appShell.desktop-drawer-layout .desktop-navigator-card .l-shape-elevation-plan {
        background: #102a43;
    }
    #appShell.desktop-drawer-layout :is(.desktop-navigator-card > h3, .desktop-measurement-results h3, .desktop-measurement-results dt, .desktop-measurement-results dd, .desktop-measurement-results span, .desktop-measurement-results b) {
        color: #fff;
    }
    @layer desktop-interaction {
        #appShell.desktop-drawer-layout button:not(.brand-button),
        #appShell.desktop-drawer-layout .header-project-actions summary {
            background: #102a43 !important;
            color: #fff !important;
            border: 1px solid #f28c18 !important;
            box-shadow: none !important;
        }
        #appShell.desktop-drawer-layout button:not(.brand-button):is(.active, [aria-expanded="true"], [aria-pressed="true"], :active),
        #appShell.desktop-drawer-layout .header-project-actions details[open] > summary {
            background: #f28c18 !important;
            color: #102a43 !important;
            border: 1px solid #f28c18 !important;
        }
        #appShell.desktop-drawer-layout #mobileLShapeMenuToggle {
            background: #102a43 !important;
            color: #fff !important;
        }
    }
    #appShell.desktop-drawer-layout #mobileLShapeMenuToggle svg {
        stroke: currentColor;
    }
    #appShell.desktop-drawer-layout :is(button:not(.brand-button), label, summary, .opening-summary, dt, .result-grid > div > span:first-child) {
        text-transform: uppercase;
    }
    #appShell.desktop-drawer-layout :is(.desktop-dimensions-card, .desktop-drawer-content, .desktop-opening-choices, .desktop-edit-options) {
        box-sizing: border-box;
        border: 1px solid #f28c18;
        background: #102a43;
        color: #fff;
    }
    #appShell.desktop-drawer-layout .desktop-drawer-content :is(.opening-control, .opening-fields, .opening-enable) {
        background: #102a43 !important;
        border-color: #f28c18 !important;
    }
    #appShell.desktop-drawer-layout .desktop-measurement-results .measurement-shower-cut {
        background: transparent;
        color: #fff;
    }
    #appShell.desktop-drawer-layout :is(.desktop-dimensions-card, .desktop-drawer-content) :is(label, .setout-label, .opening-summary, .zoom-row span, .setout-note, strong) {
        color: inherit;
    }
    #appShell.desktop-drawer-layout :is(input, textarea, select) {
        text-transform: none;
        background: #fff;
        color: #102a43;
    }
    /* Shared desktop controls must not inherit old wall-only light-theme sizing. */
    #appShell.desktop-drawer-layout #workspace :is(.desktop-navigator-card, .desktop-measurement-results) h3 {
        color: #fff !important;
    }
    #appShell.desktop-drawer-layout #workspace .floor-setup-back {
        right: 0;
        top: 0;
        width: auto;
        height: 30px;
        min-height: 30px;
        padding: 5px 10px;
        border-radius: 6px;
        font: 10px/13px 'Sansita', Arial, sans-serif;
    }
    #appShell.desktop-drawer-layout .desktop-drawer-content .opening-head {
        min-height: 30px !important;
    }
    #appShell.desktop-drawer-layout .desktop-drawer-content .opening-expander {
        min-height: 30px !important;
        padding: 5px !important;
    }
    #appShell.desktop-drawer-layout .desktop-drawer-content .opening-fields label {
        min-height: 0;
        height: auto;
    }
    #appShell.desktop-drawer-layout .desktop-drawer-content .desktop-opening-alignments strong {
        font-size: 10px !important;
        line-height: 13px;
    }
    #appShell.desktop-drawer-layout .desktop-drawer-content .mobile-opening-alignment p {
        color: #fff;
        font-size: 10px;
        line-height: 13px;
    }

    /* V2.10.67: matching typography and independent feature enable controls. */
    #appShell.desktop-drawer-layout .desktop-drawer-menu button,
    #appShell.desktop-drawer-layout .desktop-drawer-label {
        font-family: 'Sansita', Arial, sans-serif !important;
        font-weight: 400 !important;
        font-style: normal !important;
    }
    #appShell.desktop-drawer-layout .desktop-dimensions-card > h4 {
        font-size: 12px !important;
        line-height: 16px;
    }
    #appShell.desktop-drawer-layout .desktop-dimensions-card label {
        font-family: 'Sansita', Arial, sans-serif;
        font-size: 10px !important;
        line-height: 13px;
        font-weight: 400;
    }
    #appShell.desktop-drawer-layout .desktop-drawer-content .setout-label {
        display: block;
        margin-top: 10px;
        padding-top: 8px;
    }
    #appShell.desktop-drawer-layout .desktop-feature-heading {
        display: grid;
        grid-template-columns: minmax(0, 1fr) 30px;
        align-items: center;
        border: 1px solid #f28c18;
        border-radius: 6px;
        background: #102a43;
    }
    #appShell.desktop-drawer-layout .desktop-feature-heading input[type="checkbox"] {
        width: 16px;
        height: 16px;
        margin: 0 auto;
        accent-color: #f28c18;
    }

    /* V2.10.68: original V2.10.58 sidebar font and single-line captions. */
    #appShell.desktop-drawer-layout #controls .desktop-drawer-menu,
    #appShell.desktop-drawer-layout #controls .desktop-drawer-menu *,
    #appShell.desktop-drawer-layout .results-rail :is(h3, dt, .result-grid span) {
        font-family: 'Sansita', Arial, sans-serif !important;
    }
    #appShell.desktop-drawer-layout #controls .desktop-drawer-menu :is(h3, h4, .desktop-drawer-label),
    #appShell.desktop-drawer-layout .results-rail h3 {
        font-size: 13px !important;
        line-height: 15px !important;
        font-weight: 700 !important;
        letter-spacing: 0;
    }
    #appShell.desktop-drawer-layout #controls .desktop-dimensions-card label,
    #appShell.desktop-drawer-layout #controls .desktop-drawer-content label {
        height: auto !important;
        font-size: 11px !important;
        line-height: 12px !important;
        font-weight: 400;
    }
    #appShell.desktop-drawer-layout #controls .desktop-drawer-content .opening-fields label {
        font-size: 9px !important;
    }
    #appShell.desktop-drawer-layout #controls .desktop-drawer-menu :is(button, button *, label, h3, h4, .setout-label, .setout-note, strong, p),
    #appShell.desktop-drawer-layout .results-rail :is(h3, dt, .result-grid > div > span:first-child) {
        white-space: nowrap !important;
        overflow-wrap: normal !important;
        word-break: normal !important;
    }
    #appShell.desktop-drawer-layout #controls .desktop-drawer-content :is(.setout-note, .mobile-opening-alignment p, .shower-placement-help p) {
        font-size: 9px !important;
        line-height: 12px !important;
    }
    #appShell.desktop-drawer-layout .desktop-measurement-results :is(dt, .result-grid > div > span:first-child) {
        font-size: 10px;
        line-height: 13px;
    }
    #appShell.desktop-drawer-layout .desktop-dimensions-card label::before {
        content: none !important;
    }

    #appShell.desktop-drawer-layout #controls .desktop-drawer-menu label {
        overflow: visible !important;
    }
    #appShell.desktop-drawer-layout #workspace :is(h2, h3, .wall-dimensions) {
        white-space: nowrap;
        overflow-wrap: normal;
    }

    /* V2.10.69: each open option owns one card; checkbox shares its header. */
    #appShell.desktop-drawer-layout :is(.desktop-edit-options, .desktop-opening-choices) {
        border: 0;
        background: transparent;
        padding: 0;
    }
    #appShell.desktop-drawer-layout .desktop-option-card {
        border: 1px solid #f28c18;
        border-radius: 6px;
        background: #102a43;
    }
    #appShell.desktop-drawer-layout .desktop-option-card > .desktop-drawer-content {
        border: 0;
        padding: 5px;
    }
    #appShell.desktop-drawer-layout .desktop-drawer-content :is(.opening-control, .opening-fields) {
        border: 0 !important;
    }
    #appShell.desktop-drawer-layout .desktop-feature-heading {
        position: relative;
        display: block;
        border: 0;
        background: transparent;
    }
    #appShell.desktop-drawer-layout .desktop-feature-heading > button {
        padding-right: 30px;
    }
    #appShell.desktop-drawer-layout .desktop-feature-heading > input[type="checkbox"] {
        position: absolute;
        right: 8px;
        top: 50%;
        transform: translateY(-50%);
        margin: 0;
    }
    @layer desktop-interaction {
        #appShell.desktop-drawer-layout .desktop-option-card > .desktop-drawer-choice,
        #appShell.desktop-drawer-layout .desktop-option-card > .desktop-feature-heading > .desktop-drawer-choice {
            border: 0 !important;
            border-radius: 5px 5px 0 0;
        }
    }

    #appShell.desktop-drawer-layout .desktop-drawer-content .opening-fields input {
        height: 28px;
        min-height: 28px;
        font-size: 12px;
    }

    /* V2.10.70: the long Follow label uses its own full-width row. */
    #appShell.desktop-drawer-layout .desktop-drawer-content #followFloorBtn {
        grid-column: 1 / -1;
        width: 100%;
        white-space: nowrap;
    }

    /* V2.10.71: display-only features in the desktop NTD plan. */
    #appShell.desktop-drawer-layout .ntd-shower {
        fill: #bfe2ed;
        fill-opacity: .75;
        stroke: #315c72;
        stroke-width: 2px;
    }
    #appShell.desktop-drawer-layout .ntd-opening {
        stroke-width: 4px;
        stroke-linecap: butt;
    }
    #appShell.desktop-drawer-layout .ntd-window { stroke: #bedceb; }
    #appShell.desktop-drawer-layout .ntd-door { stroke: #102a43; }
    #appShell.desktop-drawer-layout .ntd-niche {
        stroke: #315c72;
        stroke-dasharray: 3 2;
    }

    #appShell.desktop-drawer-layout #workspace > .panel {
        position: relative;
    }
    #appShell.desktop-drawer-layout .desktop-workflow-footer {
        position: absolute;
        left: 32px;
        bottom: 4px;
        font: 400 9px/12px 'Sansita', Arial, sans-serif;
        color: #53606b;
        white-space: nowrap;
        pointer-events: none;
    }

    /* V2.10.72: desktop menu action, card-aligned BACK and continuous corners. */
    #appShell.desktop-drawer-layout .header-project-actions #workspaceOpenBtn {
        display: block !important;
    }
    #appShell.desktop-drawer-layout #workspace .floor-setup-back {
        right: var(--desktop-back-inset, 0px);
        min-width: 64px;
    }
    #appShell.desktop-drawer-layout .desktop-option-card > .desktop-drawer-content {
        border-radius: 0 0 5px 5px;
    }

}

#appShell:not(.desktop-drawer-layout) #workspaceOpenBtn { display: none !important; }
