/* ===== PREMIUM VISUALIZER UPGRADES ===== */
.visualizer-wrap {
    background: var(--white);
    border-radius: 24px;
    padding: 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0, 0, 0, 0.03);
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 40px;
}

.viz-room {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.05);
}

#vizMaskCanvas {
    transition: opacity 0.3s ease-in-out;
}

.viz-compare-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 10;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(8px);
    border: none;
    padding: 8px 16px;
    border-radius: 50px;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--ink);
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: all 0.2s;
    user-select: none;
    -webkit-user-select: none;
}

.viz-compare-btn:active,
.viz-compare-btn.held {
    background: var(--white);
    transform: scale(0.95);
}

.premium-tabs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

.premium-room {
    height: 80px;
    background-size: cover;
    background-position: center;
    border-radius: 12px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    border: 2px solid transparent;
    transition: all 0.3s;
}

.premium-room::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(0deg, rgba(0, 0, 0, 0.6) 0%, transparent 100%);
}

.premium-room .room-label {
    position: absolute;
    bottom: 8px;
    left: 8px;
    z-index: 2;
    color: var(--white);
    font-size: 0.8rem;
    font-weight: 600;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.premium-room:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

.premium-room.active {
    border-color: var(--gold);
    transform: scale(1.02);
}

/* Upload Your Own Room Card */
.upload-room-btn {
    background: rgba(201, 168, 76, 0.08) !important;
    border: 2px dashed rgba(201, 168, 76, 0.5) !important;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
}

.upload-room-btn:hover {
    border-color: var(--gold) !important;
    background: rgba(201, 168, 76, 0.15) !important;
    transform: translateY(-3px);
}

.upload-room-btn.active {
    border-color: var(--gold) !important;
    border-style: solid !important;
}

.upload-room-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    z-index: 2;
    pointer-events: none;
}

.upload-room-icon span {
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--white);
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
    letter-spacing: 0.03em;
}

/* Hide the icon once thumbnail is loaded */
.upload-room-btn.has-image .upload-room-icon {
    display: none;
}


/* ===== SCROLL ANIMATION ===== */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.7s ease;
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ===== PAGE NAV PILLS ===== */
.page-nav {
    position: fixed;
    left: 24px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 800;
}

.page-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.2);
    cursor: pointer;
    transition: all 0.3s;
    border: 2px solid transparent;
}

.page-dot.active {
    background: var(--gold);
    transform: scale(1.4);
}

.page-dot:hover {
    background: var(--gold);
}

/* ===== TOAST ===== */
.toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--ink);
    color: var(--white);
    padding: 14px 28px;
    border-radius: 50px;
    font-size: 0.88rem;
    font-weight: 500;
    z-index: 3000;
    opacity: 0;
    transition: all 0.4s;
    pointer-events: none;
    white-space: nowrap;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    .hero-content {
        grid-template-columns: 1fr;
        gap: 40px;
        padding: 120px 40px 80px;
    }

    .hero-right {
        display: none;
    }

    .visualizer-wrap {
        grid-template-columns: 1fr;
    }

    .calc-wrap {
        grid-template-columns: 1fr;
    }

    .booking-wrap {
        grid-template-columns: 1fr;
    }

    #about {
        grid-template-columns: 1fr;
    }

    .contact-wrap {
        grid-template-columns: 1fr;
    }

    .inspiration-grid {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: auto;
    }

    .inspo-card:first-child {
        grid-row: auto;
    }

    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 40px;
    }

    .page-nav {
        display: none;
    }
}

@media (max-width: 768px) {
    nav {
        padding: 16px 24px;
    }

    nav.scrolled {
        padding: 12px 24px;
    }

    .nav-links {
        display: none;
    }

    .hamburger {
        display: flex;
    }

    section {
        padding: 70px 24px;
    }

    #colors,
    #calculator,
    #visualizer,
    #booking,
    #contact,
    #testimonials {
        padding: 70px 24px;
    }

    .trust-strip {
        padding: 32px 24px;
        gap: 32px;
    }

    footer {
        padding: 60px 24px 32px;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .footer-bottom {
        flex-direction: column;
        text-align: center;
    }

    .hero-stats {
        gap: 24px;
    }

    .inspiration-grid {
        grid-template-columns: 1fr;
    }

    .floating-btn span {
        display: none;
    }

    .floating-btn {
        padding: 16px 20px;
        border-radius: 50%;
    }
}

/* ===== CAROUSEL ===== */
.hero-carousel {
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
}

.hero-slide {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transition: opacity 1.5s ease-in-out, transform 8s ease-out;
    transform: scale(1.05);
}

.hero-slide.active {
    opacity: 1;
    transform: scale(1);
}

.hero-overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(135deg, rgba(26, 18, 8, 0.85) 0%, rgba(44, 24, 16, 0.7) 30%, rgba(13, 26, 18, 0.75) 70%, rgba(10, 21, 32, 0.9) 100%);
}

/* ===== PREMIUM QUALITY ENHANCEMENTS & COMPREHENSIVE MOBILE TWEAKS ===== */
/* Enhance shadows and borders globally */
.product-card,
.service-card,
.booking-form,
.calc-result,
.calc-form {
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(0, 0, 0, 0.02);
    border-radius: 24px;
}

.inspo-card {
    border-radius: 24px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
}

.btn-primary {
    box-shadow: 0 10px 30px rgba(201, 168, 76, 0.3);
}

/* Unified Mobile App-Like Experience */
@media (max-width: 768px) {

    /* Bulletproof Body Containment */
    html,
    body {
        overflow-x: hidden;
        width: 100%;
        max-width: 100vw;
        position: relative;
    }

    /* Fluid scaling typography */
    .hero-title {
        font-size: clamp(2.2rem, 9vw, 2.8rem);
        line-height: 1.1;
        margin-bottom: 16px;
    }

    .section-title {
        font-size: clamp(1.8rem, 8vw, 2.2rem);
        line-height: 1.15;
        margin-bottom: 12px;
    }

    /* Tighter global padding for true edge-to-edge feel */
    section,
    #colors,
    #calculator,
    #visualizer,
    #booking,
    #contact {
        padding: 60px 20px;
        overflow: hidden;
        max-width: 100vw;
        box-sizing: border-box;
    }

    /* Edge-to-Edge horizontal scrolling carousels ("End to End") */
    .products-grid,
    .inspiration-grid,
    .services-grid,
    .trust-strip,
    .color-grid {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        gap: 16px;
        margin: 0 -20px;
        padding: 10px 20px 24px;
        width: calc(100% + 40px);
        -ms-overflow-style: none;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
    }

    .products-grid::-webkit-scrollbar,
    .inspiration-grid::-webkit-scrollbar,
    .testimonials-grid::-webkit-scrollbar,
    .services-grid::-webkit-scrollbar,
    .trust-strip::-webkit-scrollbar,
    .color-grid::-webkit-scrollbar {
        display: none;
    }

    /* Properly sized cards matching service style */
    .service-card {
        min-width: 280px;
        max-width: 82vw;
        scroll-snap-align: center;
        flex: 0 0 auto;
        padding: 28px 24px;
    }

    .product-card {
        min-width: 260px;
        scroll-snap-align: center;
        flex: 0 0 auto;
    }

    .inspo-card {
        min-width: 260px;
        scroll-snap-align: center;
        flex: 0 0 auto;
        height: 300px;
    }

    .inspo-card:first-child {
        grid-row: auto;
    }

    /* Trust strip horizontal */
    .trust-strip {
        gap: 20px;
    }

    .trust-item {
        min-width: 200px;
        scroll-snap-align: center;
        justify-content: flex-start;
    }

    /* Removed dangerous 100vh constraints entirely */
    #visualizer {
        max-height: max-content;
        overflow-y: visible;
        background: var(--white) !important;
        padding: 40px 16px !important;
    }

    .visualizer-wrap {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 16px;
        margin-top: 16px;
        border: none;
        box-shadow: none;
    }

    .viz-left {
        display: contents;
    }

    .viz-room {
        height: auto;
        aspect-ratio: 4/3;
        border-radius: 16px;
        margin-bottom: 12px;
        position: sticky;
        top: 60px;
        /* Sticky below standard mobile header */
        z-index: 100;
        box-shadow: 0 16px 40px rgba(0, 0, 0, 0.15);
        border: 1px solid rgba(0, 0, 0, 0.05);
        order: -2;
    }

    .viz-tooltip {
        order: 1;
        margin-top: 8px !important;
        padding: 12px 16px !important;
        font-size: 0.75rem !important;
    }

    .viz-controls {
        display: flex;
        flex-direction: column;
        order: -1;
    }

    .premium-tabs {
        overflow-x: auto;
        display: flex;
        scrollbar-width: none;
        padding-bottom: 8px;
        margin-bottom: 16px;
    }

    .premium-tabs::-webkit-scrollbar {
        display: none;
    }

    .premium-room {
        width: 110px;
        flex-shrink: 0;
        height: 70px;
    }

    /* Palette Horizontal Scroll - Premium Mobile UX */
    .viz-palette {
        gap: 12px;
        justify-content: flex-start;
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 16px;
        margin: 0 -16px 16px;
        padding-left: 16px;
        padding-right: 16px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .viz-palette::-webkit-scrollbar {
        display: none;
    }

    .viz-color {
        width: 44px;
        height: 44px;
        flex-shrink: 0;
        border-radius: 12px;
        border: 2px solid transparent;
    }

    .viz-color:active {
        transform: scale(0.9);
    }

    .viz-selected-display {
        padding: 12px 16px;
        margin-bottom: 16px;
        border-radius: 16px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
        border: 1px solid #eee;
    }

    /* Custom Colour Picker & Slider */
    .viz-custom-color-btn {
        position: relative;
        overflow: hidden;
        border-radius: 10px;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        border: 1px dashed #ccc;
        width: 42px;
        height: 42px;
        background: transparent;
        transition: all 0.3s;
    }

    .viz-custom-color-btn:hover {
        border-color: var(--gold);
        background: rgba(201, 168, 76, 0.1);
    }

    .viz-custom-color-btn input[type="color"] {
        position: absolute;
        inset: -10px;
        opacity: 0;
        cursor: pointer;
        width: 200%;
        height: 200%;
    }

    .viz-slider-wrap {
        margin-bottom: 24px;
        padding: 16px;
        background: #fafafa;
        border-radius: 16px;
        border: 1px solid #eee;
    }

    .viz-slider-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 12px;
    }

    .viz-slider-header h4 {
        font-size: 0.85rem;
        color: var(--ink);
        margin: 0;
        font-weight: 600;
    }

    .viz-slider-val {
        font-size: 0.8rem;
        font-weight: 700;
        color: var(--gold);
    }

    .viz-range {
        width: 100%;
        appearance: none;
        height: 6px;
        background: #e5e5e5;
        border-radius: 4px;
        outline: none;
    }

    .viz-range::-webkit-slider-thumb {
        appearance: none;
        width: 18px;
        height: 18px;
        border-radius: 50%;
        background: var(--gold);
        cursor: ew-resize;
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    }

    /* Scanning Overlay */
    .viz-scanning-overlay {
        position: absolute;
        inset: 0;
        z-index: 50;
        background: rgba(255, 255, 255, 0.85);
        backdrop-filter: blur(4px);
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        transition: opacity 0.5s;
        opacity: 0;
        pointer-events: none;
    }

    .viz-scanning-overlay.active {
        opacity: 1;
        pointer-events: all;
    }

    .viz-spinner {
        width: 40px;
        height: 40px;
        border: 4px solid #f0ece6;
        border-top-color: var(--gold);
        border-radius: 50%;
        animation: vizSpin 1s linear infinite;
        margin-bottom: 12px;
    }

    @keyframes vizSpin {
        to {
            transform: rotate(360deg);
        }
    }

    .viz-scanning-text {
        font-family: var(--font-body);
        font-weight: 600;
        font-size: 0.9rem;
        color: var(--ink);
        letter-spacing: 0.05em;
    }
}

/* Extra mobile hardening for sections that use inline desktop spacing */
@media (max-width: 768px) {
    #colors,
    #visualizer,
    #contact {
        padding: 60px 20px !important;
    }

    #visualizer > div,
    #colors > div {
        max-width: 100% !important;
    }

    .gallery-carousel {
        margin-left: -4px;
        margin-right: -4px;
    }

    .gallery-carousel img {
        width: 84vw !important;
        min-width: 240px !important;
        height: 240px !important;
    }

    .viz-actions > div[style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
    }
}

/* Keep visualizer pages aligned-left on mobile (loaded after style.css) */
@media (max-width: 768px) {
    body,
    h1,
    h2,
    h3,
    h4,
    h5,
    h6,
    p,
    a,
    span,
    li,
    label,
    button,
    input,
    select,
    textarea,
    .section-title,
    .section-sub,
    .section-label,
    .footer-bottom,
    .footer-bottom p,
    [style*="text-align: center"],
    .mobile-nav a {
        text-align: left !important;
    }

    [style*="justify-content: center"].section-label {
        justify-content: flex-start !important;
    }
}

/* ===== BRAND-GRADE VISUALIZER UI ===== */
#visualizer .visualizer-wrap {
    background: linear-gradient(165deg, #ffffff 0%, #fcfaf6 100%);
    border-radius: 28px;
    border: 1px solid rgba(201, 168, 76, 0.22);
    box-shadow: 0 30px 70px rgba(16, 18, 25, 0.12);
    padding: clamp(18px, 2vw, 30px);
    gap: clamp(20px, 2vw, 34px);
    align-items: stretch;
}

#visualizer .viz-left {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

#visualizer .viz-room {
    width: 100%;
    min-height: 100%;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.7);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.5),
        0 18px 42px rgba(11, 15, 24, 0.18);
    background: #d9cbb6;
}

#visualizer .viz-precision-bar {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

#visualizer .viz-tool-btn {
    border: 1px solid #ddd3bf;
    background: #f6f1e7;
    color: #1f232f;
    border-radius: 999px;
    min-height: 34px;
    padding: 0 14px;
    font-size: 0.76rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

#visualizer .viz-tool-btn:hover {
    border-color: #c9a84c;
}

#visualizer .viz-tool-btn.active {
    background: linear-gradient(135deg, #e8d08a 0%, #c9a84c 100%);
    border-color: #c9a84c;
    color: #171a24;
    box-shadow: 0 8px 18px rgba(201, 168, 76, 0.28);
}

#visualizer .viz-room::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.26) 0%, rgba(255, 255, 255, 0) 35%),
        linear-gradient(0deg, rgba(8, 11, 18, 0.22) 0%, rgba(8, 11, 18, 0) 45%);
    pointer-events: none;
    z-index: 2;
}

#visualizer .viz-room-topbar {
    position: absolute;
    top: 12px;
    left: 12px;
    right: 12px;
    z-index: 4;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(10, 12, 18, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.22);
    backdrop-filter: blur(10px);
}

#visualizer .viz-chip {
    display: inline-flex;
    align-items: center;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-weight: 700;
    color: #13161f;
    background: linear-gradient(135deg, #f7dfa3 0%, #c9a84c 100%);
}

#visualizer .viz-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #42d88f;
    box-shadow: 0 0 0 6px rgba(66, 216, 143, 0.2);
}

#visualizer .viz-status-text {
    font-size: 0.76rem;
    font-weight: 600;
    color: #f7f8fa;
    letter-spacing: 0.03em;
}

#visualizer .viz-controls {
    background: linear-gradient(180deg, #ffffff 0%, #f7f4ef 100%);
    border-radius: 18px;
    border: 1px solid rgba(201, 168, 76, 0.18);
    padding: clamp(16px, 1.6vw, 22px);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.65),
        0 12px 28px rgba(26, 21, 10, 0.08);
    display: flex;
    flex-direction: column;
    gap: 14px;
}

#visualizer .viz-selected-display {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px;
    background: #fff;
    border: 1px solid #ece6d9;
    border-radius: 14px;
}

#visualizer .viz-selected-swatch {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    border: 2px solid #fff;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.22);
    flex: 0 0 40px;
}

#visualizer .viz-selected-label {
    font-size: 0.68rem;
    line-height: 1.2;
    color: #8e8678;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 700;
}

#visualizer .viz-selected-info h4 {
    font-family: var(--font-display);
    font-size: 1.02rem;
    line-height: 1.2;
    color: #11131a;
    margin: 2px 0 1px;
}

#visualizer #vizColorCode {
    font-size: 0.78rem;
    font-weight: 600;
    color: #7e7569;
}

#visualizer .viz-section-title {
    margin: 2px 0 0;
    font-size: 0.86rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #5d5649;
    font-weight: 700;
    font-family: var(--font-body);
}

#visualizer .premium-tabs {
    margin-bottom: 2px;
}

#visualizer .premium-room {
    height: 88px;
    border-radius: 13px;
    border-width: 1px;
}

#visualizer .premium-room.active {
    border-color: #c9a84c;
    box-shadow: 0 10px 20px rgba(201, 168, 76, 0.25);
}

#visualizer .premium-room .room-label {
    font-size: 0.74rem;
    letter-spacing: 0.03em;
}

#visualizer .viz-palette {
    margin-top: 2px;
    padding: 4px 2px 10px;
}

#visualizer .viz-color {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    border: 2px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.16);
}

#visualizer .viz-color.selected {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
    outline: 2px solid #1d1f27;
    outline-offset: 2px;
}

#visualizer .viz-actions {
    margin-top: 4px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

#visualizer .viz-actions-secondary {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

#visualizer .viz-btn-main,
#visualizer .viz-btn-quiet,
#visualizer .viz-btn-accent {
    width: 100%;
    justify-content: center;
    min-height: 44px;
    font-size: 0.86rem;
    letter-spacing: 0.03em;
}

#visualizer .viz-btn-main {
    color: #171a24;
    background: linear-gradient(135deg, #e8d08a 0%, #c9a84c 100%);
    box-shadow: 0 10px 26px rgba(201, 168, 76, 0.35);
}

#visualizer .viz-btn-quiet {
    color: #1f232f;
    border-color: #ddd3bf;
    background: #f5f0e5;
}

#visualizer .viz-btn-accent {
    color: #151823;
    border-color: #c9a84c;
    background: rgba(201, 168, 76, 0.08);
}

#visualizer .viz-tooltip {
    margin-top: 4px;
    padding: 13px 14px;
    background: linear-gradient(135deg, #fffdf8 0%, #f5f0e5 100%);
    border-radius: 12px;
    border: 1px solid #e9dfc7;
}

#visualizer .viz-tooltip p {
    margin: 0;
    font-size: 0.74rem !important;
    color: #5d5448 !important;
}

@media (max-width: 1024px) {
    #visualizer .visualizer-wrap {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    #visualizer .visualizer-wrap {
        border-radius: 18px;
        padding: 14px;
        gap: 14px;
    }

    #visualizer .viz-room {
        position: relative;
        top: 0;
        order: 0;
    }

    #visualizer .viz-precision-bar {
        gap: 6px;
    }

    #visualizer .viz-tool-btn {
        min-height: 32px;
        padding: 0 12px;
        font-size: 0.7rem;
    }

    #visualizer .viz-room-topbar {
        left: 10px;
        right: 10px;
        top: 10px;
    }

    #visualizer .viz-controls {
        order: 1;
        padding: 12px;
        gap: 12px;
    }

    #visualizer .premium-tabs {
        display: flex;
        gap: 10px;
    }

    #visualizer .premium-room {
        width: 108px;
        min-width: 108px;
        height: 74px;
    }

    #visualizer .viz-actions-secondary {
        grid-template-columns: 1fr;
    }
}

/* ===== FINAL RESPONSIVE FIXES ===== */
#visualizer .viz-room {
    aspect-ratio: 4 / 3;
    min-height: 260px;
}

#visualizer #vizImg,
#visualizer #vizMaskCanvas {
    width: 100%;
    height: 100%;
}

@media (max-width: 1024px) {
    #visualizer .visualizer-wrap {
        gap: 16px;
    }

    #visualizer .viz-controls {
        width: 100%;
    }
}

@media (max-width: 768px) {
    #visualizer {
        padding: 56px 16px !important;
    }

    #visualizer .visualizer-wrap {
        border-radius: 16px;
        padding: 12px;
        gap: 12px;
        box-shadow: 0 14px 36px rgba(16, 18, 25, 0.12);
    }

    #visualizer .viz-left {
        display: flex;
        flex-direction: column;
        gap: 8px;
    }

    #visualizer .viz-room {
        position: relative !important;
        top: 0 !important;
        z-index: 1;
        min-height: 210px;
        aspect-ratio: 16 / 10;
        margin-bottom: 0;
    }

    #visualizer .viz-controls {
        order: 2;
        padding: 12px;
        gap: 10px;
    }

    #visualizer .viz-selected-display {
        padding: 10px;
        gap: 10px;
    }

    #visualizer .viz-selected-swatch {
        width: 34px;
        height: 34px;
        flex-basis: 34px;
    }

    #visualizer .premium-tabs {
        display: flex;
        overflow-x: auto;
        gap: 8px;
        padding-bottom: 6px;
    }

    #visualizer .premium-room {
        min-width: 96px;
        width: 96px;
        height: 68px;
    }

    #visualizer .viz-palette {
        margin: 0;
        padding: 2px 0 10px;
    }

    #visualizer .viz-precision-bar {
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 4px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    #visualizer .viz-precision-bar::-webkit-scrollbar,
    #visualizer .premium-tabs::-webkit-scrollbar {
        display: none;
    }

    #visualizer .viz-tool-btn {
        white-space: nowrap;
    }

    #visualizer .viz-actions {
        gap: 8px;
    }

    #visualizer .viz-btn-main,
    #visualizer .viz-btn-quiet,
    #visualizer .viz-btn-accent {
        min-height: 40px;
        font-size: 0.82rem;
    }

    #visualizer .viz-tooltip {
        padding: 10px 12px;
    }

    #visualizer .viz-tooltip p {
        font-size: 0.7rem !important;
        line-height: 1.45;
    }
}

@media (max-width: 480px) {
    #visualizer .viz-room {
        min-height: 190px;
    }

    #visualizer .viz-room-topbar {
        padding: 6px 8px;
        gap: 6px;
    }

    #visualizer .viz-chip {
        padding: 4px 8px;
        font-size: 0.62rem;
    }

    #visualizer .viz-status-text {
        font-size: 0.68rem;
    }
}
