:root {
    --background: #f3f4f6;
    --surface: #ffffff;
    --primary: #111827;
    --primary-hover: #1f2937;
    --secondary: #e5e7eb;
    --secondary-hover: #d1d5db;
    --text: #111827;
    --muted: #6b7280;
    --border: #d1d5db;
    --success: #047857;
    --success-background: #d1fae5;
    --error: #b91c1c;
    --error-background: #fee2e2;
    --accent: #b08d57;
    --radius: 18px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--background);
    color: var(--text);
    font-family:
        Inter,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
}

button,
input,
a {
    font: inherit;
}

button,
.file-button,
.download-button {
    -webkit-tap-highlight-color: transparent;
}

.app-container {
    width: min(100%, 920px);
    margin: 0 auto;
    padding:
        max(18px, env(safe-area-inset-top))
        14px
        max(32px, env(safe-area-inset-bottom));
}

.app-header {
    padding: 22px 8px 18px;
    text-align: center;
}

.eyebrow {
    margin: 0 0 6px;
    color: var(--accent);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

.app-header h1 {
    margin: 0;
    font-size: clamp(28px, 7vw, 46px);
    line-height: 1.1;
}

.intro {
    max-width: 660px;
    margin: 14px auto 0;
    color: var(--muted);
    font-size: 16px;
    line-height: 1.6;
}

.card {
    margin-bottom: 16px;
    padding: 18px;
    border: 1px solid rgba(209, 213, 219, 0.7);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: 0 8px 28px rgba(17, 24, 39, 0.06);
}

.step-heading {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 18px;
}

.step-number {
    display: inline-flex;
    flex: 0 0 36px;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    font-weight: 800;
}

.step-heading h2 {
    margin: 2px 0 4px;
    font-size: 20px;
}

.step-heading p {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.5;
}

.file-button,
button,
.download-button {
    display: flex;
    width: 100%;
    min-height: 50px;
    align-items: center;
    justify-content: center;
    padding: 12px 16px;
    border: 0;
    border-radius: 12px;
    background: var(--primary);
    color: white;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition:
        transform 0.15s ease,
        background 0.15s ease,
        opacity 0.15s ease;
}

.file-button:hover,
button:hover,
.download-button:hover {
    background: var(--primary-hover);
}

.file-button:active,
button:active,
.download-button:active {
    transform: scale(0.99);
}

button:disabled {
    cursor: not-allowed;
    opacity: 0.42;
}

#upload-button {
    margin-top: 12px;
}

.secondary-button {
    background: var(--secondary);
    color: var(--text);
}

.secondary-button:hover {
    background: var(--secondary-hover);
}

.small-text {
    margin: 10px 0 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.5;
}

.progress-wrapper {
    margin-top: 16px;
}

.progress-track {
    width: 100%;
    height: 10px;
    overflow: hidden;
    border-radius: 999px;
    background: #e5e7eb;
}

.progress-bar {
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: var(--primary);
    transition: width 0.2s ease;
}

.success-message {
    margin-top: 14px;
    padding: 12px;
    border-radius: 10px;
    background: var(--success-background);
    color: var(--success);
    font-size: 14px;
    font-weight: 700;
}

.loading-message {
    padding: 14px;
    border-radius: 10px;
    background: #f9fafb;
    color: var(--muted);
    text-align: center;
}

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

.rug-card {
    position: relative;
    overflow: hidden;
    padding: 8px;
    border: 3px solid transparent;
    border-radius: 14px;
    background: #f9fafb;
    cursor: pointer;
    transition:
        border-color 0.15s ease,
        transform 0.15s ease;
}

.rug-card:hover {
    transform: translateY(-2px);
}

.rug-card.selected {
    border-color: var(--primary);
}

.rug-card.selected::after {
    position: absolute;
    top: 12px;
    right: 12px;
    display: flex;
    width: 28px;
    height: 28px;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    content: "✓";
    font-weight: 800;
}

.rug-card img {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    border-radius: 10px;
    background: white;
    object-fit: contain;
}

.rug-card h3 {
    margin: 10px 4px 4px;
    font-size: 15px;
}

.rug-card p {
    margin: 0 4px 4px;
    color: var(--muted);
    font-size: 12px;
}

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

.point-order span {
    padding: 9px;
    border-radius: 9px;
    background: #f3f4f6;
    color: #374151;
    font-size: 12px;
    font-weight: 700;
    text-align: center;
}

.canvas-placeholder {
    display: flex;
    min-height: 220px;
    align-items: center;
    justify-content: center;
    padding: 20px;
    border: 2px dashed var(--border);
    border-radius: 14px;
    color: var(--muted);
    text-align: center;
}

.canvas-wrapper {
    position: relative;
    width: 100%;
    overflow: hidden;
    border-radius: 14px;
    background: #111827;
}

#room-canvas {
    display: block;
    width: 100%;
    height: auto;
    margin: auto;
    touch-action: none;
    cursor: crosshair;
}

.canvas-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 14px;
}

.canvas-controls p {
    margin: 0;
    font-weight: 700;
}

.canvas-controls button {
    width: auto;
    min-width: 140px;
}

.selection-summary {
    margin-bottom: 14px;
    padding: 12px 14px;
    border-radius: 12px;
    background: #f9fafb;
}

.selection-summary p {
    margin: 6px 0;
    color: var(--muted);
    font-size: 14px;
}

.selection-summary strong {
    color: var(--text);
}

.result-image {
    display: block;
    width: 100%;
    border-radius: 14px;
    background: #f3f4f6;
}

.result-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 14px;
}

.message-box {
    position: fixed;
    right: 14px;
    bottom: max(14px, env(safe-area-inset-bottom));
    left: 14px;
    z-index: 999;
    max-width: 700px;
    margin: 0 auto;
    padding: 14px 16px;
    border-radius: 12px;
    box-shadow: 0 12px 36px rgba(17, 24, 39, 0.25);
    font-weight: 700;
}

.message-box.error {
    background: var(--error-background);
    color: var(--error);
}

.message-box.success {
    background: var(--success-background);
    color: var(--success);
}

.hidden {
    display: none !important;
}

@media (min-width: 700px) {
    .card {
        padding: 24px;
    }

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

    .point-order {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 520px) {
    .app-container {
        padding-right: 10px;
        padding-left: 10px;
    }

    .card {
        padding: 15px;
        border-radius: 15px;
    }

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

    .canvas-controls {
        align-items: stretch;
        flex-direction: column;
    }

    .canvas-controls button {
        width: 100%;
    }

    .result-actions {
        grid-template-columns: 1fr;
    }
}

/* Camera and gallery controls */
.photo-source-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 12px;
}

.photo-source-actions .file-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    margin: 0;
}

@media (max-width: 600px) {
    .photo-source-actions {
        flex-direction: column;
    }

    .photo-source-actions .file-button {
        width: 100%;
        box-sizing: border-box;
    }
}


/* Keep canvas pointer interaction fully controlled by JavaScript */
#room-canvas {
    position: relative;
    z-index: 2;
    pointer-events: auto;
    user-select: none;
    -webkit-user-select: none;
}

/* ==========================================================
   Rug catalogue and preview workspace
   ========================================================== */

.workspace-card {
    overflow: visible;
}

.rug-workspace {
    display: grid;
    grid-template-columns: minmax(280px, 350px) minmax(0, 1fr);
    gap: 24px;
    align-items: start;
}

.rug-browser {
    position: sticky;
    top: 20px;
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 40px);
    min-height: 520px;
    padding: 18px;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    background: #f9fafb;
}

.rug-browser-header {
    margin-bottom: 14px;
}

.rug-browser-header h3,
.workspace-view-heading h3 {
    margin: 0;
}

.rug-browser-header p,
.workspace-view-heading p {
    margin: 5px 0 0;
}

.rug-filter-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.rug-filter-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
    font-size: 0.83rem;
    font-weight: 700;
    color: #374151;
}

.rug-filter-field select {
    width: 100%;
    min-height: 42px;
    padding: 8px 10px;
    border: 1px solid #d1d5db;
    border-radius: 9px;
    background: #ffffff;
    color: #111827;
    font: inherit;
    font-weight: 500;
}

.rug-filter-field select:focus {
    outline: 3px solid rgba(37, 99, 235, 0.15);
    border-color: #2563eb;
}

.catalogue-clear-button {
    width: 100%;
    margin: 12px 0;
}

.rug-results {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    overflow-y: auto;
    padding: 2px 5px 10px 2px;
    scrollbar-width: thin;
}

.rug-results .rug-card {
    min-width: 0;
    padding: 8px;
    border-radius: 12px;
    background: #ffffff;
}

.rug-results .rug-card img {
    width: 100%;
    height: 135px;
    object-fit: contain;
    border-radius: 8px;
    background: #ffffff;
}

.rug-results .rug-card h3 {
    margin: 8px 0 4px;
    font-size: 0.86rem;
    line-height: 1.25;
}

.rug-results .rug-card p {
    margin: 2px 0;
    font-size: 0.76rem;
    line-height: 1.3;
}

.rug-card-meta {
    color: #6b7280;
    text-transform: capitalize;
}

.empty-catalogue-message {
    grid-column: 1 / -1;
    padding: 22px 12px;
    text-align: center;
    color: #6b7280;
}

.visual-workspace {
    min-width: 0;
    overflow: hidden;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    background: #ffffff;
}

.workspace-tabs {
    display: flex;
    gap: 4px;
    padding: 8px;
    border-bottom: 1px solid #e5e7eb;
    background: #f9fafb;
}

.workspace-tab {
    flex: 1;
    min-height: 44px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: #4b5563;
    font-weight: 700;
    cursor: pointer;
}

.workspace-tab:hover {
    background: #e5e7eb;
}

.workspace-tab.active {
    background: #111827;
    color: #ffffff;
}

.workspace-view {
    padding: 18px;
}

.workspace-view-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}

.visual-workspace .canvas-wrapper {
    max-width: none;
}

.visual-workspace #room-canvas {
    width: 100%;
}

.visual-workspace .result-image {
    display: block;
    width: 100%;
    height: auto;
    max-width: none;
    max-height: none;
    margin: 0;
    border-radius: 12px;
}

.preview-result {
    width: 100%;
}

.workspace-footer {
    padding: 16px 18px 18px;
    border-top: 1px solid #e5e7eb;
    background: #f9fafb;
}

.workspace-footer .selection-summary {
    margin-bottom: 14px;
}

.workspace-footer #generate-button {
    width: 100%;
}

@media (max-width: 960px) {
    .rug-workspace {
        grid-template-columns: minmax(240px, 310px) minmax(0, 1fr);
        gap: 16px;
    }

    .rug-results {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    .rug-workspace {
        grid-template-columns: 1fr;
    }

    .rug-browser {
        position: static;
        max-height: none;
        min-height: 0;
    }

    .rug-results {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        max-height: 460px;
    }

    .workspace-view-heading {
        flex-direction: column;
    }

    .workspace-view-heading button {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .rug-filter-grid,
    .rug-results {
        grid-template-columns: 1fr;
    }

    .rug-results .rug-card img {
        height: 190px;
    }
}

/* ==========================================================
   Desktop catalogue refinements
   ========================================================== */

@media (min-width: 961px) {
    /*
     * Approximately 25% catalogue and 75% visual workspace.
     * The 1fr / 3fr ratio also handles the column gap safely.
     */
    .rug-workspace {
        grid-template-columns:
            minmax(250px, 1fr)
            minmax(0, 3fr);
        gap: 22px;
    }

    /*
     * Allow only the catalogue results to scroll.
     * Filters and Clear Filters remain visible.
     */
    .rug-browser {
        min-height: 600px;
        max-height: calc(100vh - 40px);
        overflow: hidden;
    }

    .rug-results {
        flex: 1;
        min-height: 0;
        grid-template-columns: 1fr;
        align-content: start;
        overflow-y: auto;
        overflow-x: hidden;
        overscroll-behavior: contain;
        padding: 4px 7px 18px 2px;
    }

    /*
     * One large rug per row.
     */
    .rug-results .rug-card {
        display: block;
        width: 100%;
        padding: 12px;
    }

    .rug-results .rug-card img {
        display: block;
        width: 100%;
        height: 210px;
        object-fit: contain;
        margin: 0 auto;
    }

    .rug-results .rug-card h3 {
        margin-top: 10px;
        font-size: 0.95rem;
    }

    .rug-results .rug-card p {
        font-size: 0.82rem;
    }
}

/*
 * Improve the scrollbar without hiding it.
 */
.rug-results::-webkit-scrollbar {
    width: 9px;
}

.rug-results::-webkit-scrollbar-track {
    border-radius: 999px;
    background: #e5e7eb;
}

.rug-results::-webkit-scrollbar-thumb {
    border: 2px solid #e5e7eb;
    border-radius: 999px;
    background: #9ca3af;
}

.rug-results::-webkit-scrollbar-thumb:hover {
    background: #6b7280;
}

/* ==========================================================
   Compact catalogue typography and natural rug proportions
   ========================================================== */

@media (min-width: 761px) {
    .rug-browser {
        padding: 14px;
    }

    .rug-browser-header {
        margin-bottom: 10px;
    }

    .rug-browser-header h3 {
        font-size: 1rem;
        line-height: 1.2;
    }

    .rug-browser-header .small-text,
    #rug-result-count {
        margin-top: 3px;
        font-size: 0.76rem;
        line-height: 1.3;
    }

    .rug-filter-grid {
        gap: 8px;
    }

    .rug-filter-field {
        gap: 3px;
        font-size: 0.74rem;
        line-height: 1.2;
    }

    .rug-filter-field select {
        min-height: 36px;
        padding: 6px 8px;
        border-radius: 8px;
        font-size: 0.78rem;
        line-height: 1.2;
    }

    .catalogue-clear-button {
        min-height: 38px;
        margin: 10px 0;
        padding: 7px 10px;
        font-size: 0.78rem;
        line-height: 1.2;
    }

    /*
     * One card per row.
     * No fixed image height: preserve each rug's real proportions.
     */
    .rug-results {
        grid-template-columns: 1fr;
        gap: 12px;
        padding: 3px 7px 16px 2px;
    }

    .rug-results .rug-card {
        display: block;
        width: 100%;
        height: auto;
        min-height: 0;
        padding: 10px;
        overflow: visible;
        border-radius: 12px;
    }

    .rug-results .rug-card img {
        display: block;
        width: 100%;
        height: auto;
        max-height: none;
        aspect-ratio: auto;
        object-fit: contain;
        object-position: center;
        margin: 0 auto;
        border-radius: 7px;
    }

    .rug-results .rug-card h3 {
        margin: 8px 0 3px;
        font-size: 0.78rem;
        line-height: 1.25;
    }

    .rug-results .rug-card p {
        margin: 2px 0;
        font-size: 0.69rem;
        line-height: 1.25;
    }

    .rug-card.selected {
        outline-width: 2px;
        outline-offset: -2px;
    }
}

/* ==========================================================
   FINAL desktop rug catalogue layout
   ========================================================== */

@media (min-width: 961px) {
    .rug-workspace {
        grid-template-columns: minmax(260px, 25%) minmax(0, 75%);
        gap: 20px;
    }

    .rug-browser {
        display: flex;
        flex-direction: column;
        height: calc(100vh - 40px);
        max-height: calc(100vh - 40px);
        min-height: 0;
        overflow: hidden;
        padding: 12px;
    }

    .rug-browser-header {
        flex: 0 0 auto;
    }

    .rug-filter-grid,
    .catalogue-clear-button {
        flex: 0 0 auto;
    }

    .rug-results {
        display: flex;
        flex: 1 1 auto;
        min-height: 0;
        flex-direction: column;
        gap: 12px;
        overflow-y: auto;
        overflow-x: hidden;
        padding: 4px 6px 16px 2px;
    }

    .rug-results .rug-card {
        display: flex;
        flex: 0 0 auto;
        width: 100%;
        min-height: 0;
        flex-direction: column;
        align-items: stretch;
        padding: 10px;
        overflow: visible;
        border-radius: 12px;
        background: #ffffff;
    }

    .rug-results .rug-card img {
        display: block;
        width: auto;
        max-width: 100%;
        height: auto;
        max-height: 360px;
        align-self: center;
        aspect-ratio: unset;
        object-fit: contain;
        object-position: center;
        border-radius: 8px;
    }

    .rug-results .rug-card h3 {
        margin: 8px 0 3px;
        font-size: 0.78rem;
        line-height: 1.2;
    }

    .rug-results .rug-card p {
        margin: 1px 0;
        font-size: 0.68rem;
        line-height: 1.2;
    }

    .rug-filter-field {
        font-size: 0.7rem;
    }

    .rug-filter-field select {
        min-height: 34px;
        padding: 5px 7px;
        font-size: 0.72rem;
    }

    .catalogue-clear-button {
        min-height: 34px;
        padding: 6px 8px;
        font-size: 0.72rem;
    }
}


/* =========================================================
   WooCommerce-selected rug mode
   ========================================================= */

.rug-workspace.woocommerce-mode {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    width: 100% !important;
    max-width: none !important;
    gap: 0 !important;
}

.rug-workspace.woocommerce-mode .rug-browser {
    display: none !important;
}

.rug-workspace.woocommerce-mode .visual-workspace {
    grid-column: 1 / -1 !important;
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
}

.woocommerce-rug-mode .workspace-card {
    width: 100% !important;
}

.woocommerce-rug-mode .workspace-view {
    width: 100% !important;
    max-width: none !important;
}

.woocommerce-rug-mode .canvas-wrapper,
.woocommerce-rug-mode .canvas-placeholder {
    width: 100% !important;
    max-width: none !important;
}


/* Selected WooCommerce variation */

.selected-woocommerce-rug {
    display: flex;
    align-items: center;
    gap: 22px;

    width: 100%;
    box-sizing: border-box;

    padding: 18px;
    margin: 0 0 20px;

    border: 1px solid #e5e7eb;
    border-radius: 14px;

    background: #ffffff;
}

.selected-rug-image-wrap {
    width: 120px;
    height: 150px;
    flex: 0 0 120px;

    display: flex;
    align-items: center;
    justify-content: center;

    overflow: hidden;

    border-radius: 10px;
    background: #f8fafc;
}

.selected-rug-image {
    width: 100%;
    height: 100%;

    object-fit: contain;
    display: block;
}

.selected-rug-information {
    min-width: 0;
}

.selected-rug-eyebrow {
    margin: 0 0 5px;

    font-size: 12px;
    font-weight: 700;

    text-transform: uppercase;
    letter-spacing: 0.06em;

    color: #6b7280;
}

.selected-rug-name {
    margin: 0 0 10px;

    font-size: 22px;
    line-height: 1.2;
}

.selected-rug-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;

    margin-bottom: 8px;
}

.selected-rug-meta span {
    padding: 5px 9px;

    border-radius: 999px;
    background: #f3f4f6;

    font-size: 13px;
    font-weight: 600;
}

.selected-rug-stock {
    margin: 0;

    font-size: 12px;
    color: #6b7280;
}


/* Mobile */

@media (max-width: 640px) {

    .selected-woocommerce-rug {
        align-items: flex-start;
        gap: 14px;
        padding: 14px;
    }

    .selected-rug-image-wrap {
        width: 90px;
        height: 120px;
        flex-basis: 90px;
    }

    .selected-rug-name {
        font-size: 18px;
    }

    .rug-workspace.woocommerce-mode {
        display: block !important;
    }

    .woocommerce-rug-mode .visual-workspace {
        width: 100% !important;
    }
}



/* =========================================================
   Rug placement instruction
   ========================================================= */

.placement-instruction {
    display: flex;
    align-items: flex-start;
    gap: 14px;

    width: 100%;
    box-sizing: border-box;

    margin: 0 0 18px;
    padding: 16px 18px;

    border: 1px solid #dbe4ea;
    border-radius: 12px;

    background: #f8fafc;

    transition:
        box-shadow 0.25s ease,
        border-color 0.25s ease,
        transform 0.25s ease,
        background 0.25s ease;
}

.placement-instruction.hidden {
    display: none !important;
}

.placement-instruction-icon {
    width: 28px;
    height: 28px;
    flex: 0 0 28px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 50%;

    background: #111827;
    color: #ffffff;

    font-size: 14px;
    font-weight: 700;
    line-height: 1;
}

.placement-instruction-content {
    min-width: 0;
}

.placement-instruction-content h3 {
    margin: 0 0 6px;

    font-size: 16px;
    line-height: 1.3;
}

.placement-instruction-content p {
    margin: 0;

    font-size: 14px;
    line-height: 1.55;

    color: #4b5563;
}

.placement-instruction-highlight {
    border-color: #111827;

    background: #ffffff;

    box-shadow:
        0 0 0 3px rgba(17, 24, 39, 0.08),
        0 8px 24px rgba(17, 24, 39, 0.08);

    transform: translateY(-1px);
}


/* Make Generate Preview visually clear */

#preview-tab,
#generate-preview-button,
button[data-action="preview"] {
    font-weight: 700;
}


@media (max-width: 640px) {

    .placement-instruction {
        gap: 11px;
        padding: 14px;
    }

    .placement-instruction-content h3 {
        font-size: 15px;
    }

    .placement-instruction-content p {
        font-size: 13px;
    }
}



/* =========================================================
   Simplified customer flow
   Hide Edit Placement / Preview tab selector.
   Preview result is shown only after Generate Preview.
   ========================================================= */

.workspace-tabs {
    display: none !important;
}

.visual-workspace {
    padding-top: 0 !important;
}

.workspace-view {
    margin-top: 0 !important;
}


/* ==========================================================
   Full-width room placement canvas
   WooCommerce Virtual Rug mode
   ========================================================== */

.woocommerce-rug-mode .canvas-wrapper {
    width: 100% !important;
    max-width: none !important;

    /*
     * Let the wrapper follow the real aspect ratio of the
     * canvas instead of reserving unused side space.
     */
    background: transparent;
}

.woocommerce-rug-mode #room-canvas {
    display: block;

    /*
     * Fill the complete available workspace width while
     * preserving the room photo's original aspect ratio.
     */
    width: 100% !important;
    height: auto !important;

    /*
     * The previous 75vh limit caused portrait room photos
     * to be visually constrained and left large side bars.
     */
    max-width: none !important;
    max-height: none !important;

    margin: 0 !important;
    object-fit: initial !important;

    border-radius: 14px;
}

