:root{
    --accent: #ff4030;
    --line: rgba(255,255,255,0.09);
    --ease: cubic-bezier(0.25, 0.6, 0.25, 1);

}

:root[data-theme="dark"]{
    --bg: #151414;
    --panel: rgba(255,255,255,0.05);
    --text: #f1f0f0;
    --muted: #c2c2c2;
    --highlight-2: #faa146;
    --line: rgba(255,255,255,0.09);
    --blur-bg: rgba(21,20,20,0.72);
}

:root[data-theme="light"]{
    --bg: #f1f0f0;
    --panel: rgba(255,255,255,0.72);
    --text: #161616;
    --muted: #686868;
    --highlight-2: #e48a2f;
    --line: rgba(0,0,0,0.09);
    --blur-bg: rgba(241,240,240,0.74);
}

*{
    box-sizing: border-box;
}

html,
body{
    width: 100%;
    max-width: 100vw;
    min-height: 100%;
    margin: 0;
    padding: 0;

    background: var(--bg);
    color: var(--text);

    font-family: "Montserrat", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

    
}

body{
    width: 100vw;
    max-width: 100vw;

    display: flex;
    justify-content: center;
    align-items: flex-start;

    padding: 24px;

    overflow: auto;
}

.viewer-shell{
    width: min(360px, 100%);
    max-width: 100vw;
    height: 260px;
    background: var(--bg);
}

.viewer-card{
    position: relative;

    width: 100%;
    height: 100%;

    overflow: hidden;

    border-radius: 18px;

    background:
        radial-gradient(circle at 50% 38%, rgba(255,255,255,0.05), transparent 46%),
        var(--bg);
}

.viewer{
    position: absolute;
    inset: 0;

    width: 100%;
    height: 100%;
}

.viewer canvas{
    display: block;

    width: 100% !important;
    height: 100% !important;

    outline: none;

    touch-action: none;
}

.share-button-mobile{
    position: absolute;
    left: 12px;
    bottom: 12px;
    z-index: 20;

    display: grid;
    place-items: center;

    width: 38px;
    height: 38px;
    padding: 0;

    border: 1px solid var(--line);
    border-radius: 50%;

    background: rgba(30,28,29,0.72);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);

    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.share-button-mobile img{
    width: 16px;
    height: 16px;
    display: block;
}

.mobile-config-heading{
    position: relative;

    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;

    padding-top: 12px;
}

.mobile-config-heading::before{
    content: "";

    position: absolute;
    top: 0;
    left: 50%;

    width: 125%;
    height: 1px;

    transform: translateX(-50%);

    background: linear-gradient(
        90deg,
        transparent,
        var(--line) 24%,
        var(--line) 76%,
        transparent
    );
}

.mobile-config-availability{
    padding: 0;
    border: 0;
    background: transparent;

    color: var(--accent);

    font: inherit;
    font-size: 0.82rem;
    font-weight: 500;

    cursor: pointer;
}

.mobile-config-availability[hidden]{
    display: none;
}

.mobile-config-availability-tooltip{
    position: absolute;
    z-index: 40;

    top: calc(100% + 8px);
    left: 50%;

    transform: translateX(-50%);

    width: max-content;
    max-width: 220px;

    padding: 8px 10px;

    border: 1px solid var(--line);
    border-radius: 10px;

    background: rgba(30,28,29,0.92);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);

    color: var(--text);

    font-size: 0.68rem;
    line-height: 1.35;
    letter-spacing: 0.02em;
    text-transform: none;

    box-shadow: 0 8px 22px rgba(0,0,0,0.24);
}

.mobile-config-availability-tooltip[hidden]{
    display: none;
}


.mobile-config-group:first-child .mobile-config-heading::before{
    display: none;
}

.mobile-config-surcharge{
    color: var(--highlight-2);
    font-size: 0.68rem;
    font-weight: 400;
    letter-spacing: 0.06em;
}

.mobile-config-label{
    color: var(--text);
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    text-align: center;
}

.mobile-config-options{
    margin-top: 34px;
}

.mobile-rgb-tab{
    position: fixed;
    top: 55%;
    right: 0;
    z-index: 30;

    transform: translateY(-50%);

    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;

    width: 42px;
    height: 280px;
    padding: 10px 7px;

    border: 1px solid var(--line);
    border-right: 0;
    border-radius: 14px 0 0 14px;

    background: rgba(30,28,29,0.82);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.mobile-rgb-tab[hidden]{
    display: none;
}

.mobile-rgb-tab-label{
    color: var(--text);
    font-size: 0.62rem;
    font-weight: 500;
    letter-spacing: 0.12em;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    margin-bottom: 2px;
}

.mobile-rgbw-temperature{
    position: fixed;
    top: 55%;
    left: 0;
    z-index: 30;

    transform: translateY(-50%);

    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;

    width: 42px;
    height: 280px;
    padding: 10px 6px;

    border: 1px solid var(--line);
    border-left: 0;
    border-radius: 0 14px 14px 0;

    background: rgba(30,28,29,0.82);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);

    overflow: hidden;
}

.mobile-rgbw-temperature[hidden]{
    display: none;
}

.mobile-rgbw-temperature-label{
    color: var(--text);
    font-size: 0.62rem;
    font-weight: 500;
    letter-spacing: 0.12em;
    writing-mode: vertical-rl;
    text-orientation: mixed;
}

.mobile-rgbw-temperature-slider{
    width: 200px;
    margin-top: 100px;

    transform: rotate(-90deg);
    transform-origin: center;

    appearance: none;
    -webkit-appearance: none;

    height: 6px;
    border-radius: 999px;

    background: linear-gradient(
        90deg,
        #ffb36b,
        #ffd6a0,
        #f1f0f0,
        #cfe3ff
    );

    touch-action: none;
}

.mobile-rgb-preset{
    width: 24px;
    height: 24px;
    padding: 0;

    border: 1px solid rgba(255,255,255,0.16);
    border-radius: 50%;

    cursor: pointer;
}

.mobile-rgb-preset--red{ 
    background:#ff3b30; 
}

.mobile-rgb-preset--orange{ 
    background:#ff8a2a; 
}

.mobile-rgb-preset--violet{ 
    background:#8a4dff; 
}

.mobile-rgb-preset--pink{ 
    background:#ff4fa3; 
}

.mobile-rgb-preset--green{ 
    background:#3ddc84; 
}

.mobile-rgb-preset--blue{ 
    background:#4f7cff; 
}

.mobile-rgb-preset--turquoise{ 
    background:#35d0c8; 
}
















.mobile-config-swatches{
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    padding-top: 14px;
    padding-bottom: 10px;
    justify-content: center;
}

.mobile-config-swatch{
    display: inline-flex;
    align-items: center;
    gap: 0;

    width: auto;
    min-width: 34px;
    max-width: 34px;
    height: 34px;
    padding: 4px;

    overflow: hidden;

    border: 1px solid var(--line);
    border-radius: 999px;

    background: transparent;
    color: var(--text);

    font: inherit;
    cursor: pointer;

    transition:
        max-width 420ms var(--ease),
        gap 420ms var(--ease),
        padding 420ms var(--ease),
        border-color 300ms var(--ease),
        background 300ms var(--ease);
}

.mobile-config-swatch.is-active{
    max-width: 140px;
    gap: 8px;
    padding-right: 12px;

    border-color: var(--accent);
    background: var(--panel);
}

.mobile-config-swatch-color{
    flex: 0 0 24px;

    width: 24px;
    height: 24px;

    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.16);
}

.mobile-config-swatch-name{
    max-width: 0;

    overflow: hidden;
    opacity: 0;
    white-space: nowrap;

    font-size: 0.72rem;

    transform: translateX(-4px);

    transition:
        max-width 420ms var(--ease),
        opacity 260ms var(--ease),
        transform 420ms var(--ease);
}

.mobile-config-swatch.is-active{
    width: auto;
    gap: 8px;
    padding-right: 12px;

    border-color: var(--accent);
    background: var(--panel);
}

.mobile-config-swatch.is-active .mobile-config-swatch-name{
    max-width: 90px;
    opacity: 1;
    transform: translateX(0);
}

.mobile-config-swatch--oak .mobile-config-swatch-color{
    background: #b98a5c;
}

.mobile-config-swatch--ash .mobile-config-swatch-color{
    background: #c9b89a;
}

.mobile-config-swatch--walnut .mobile-config-swatch-color{
    background: #65452f;
}

.mobile-config-swatch--b1-white .mobile-config-swatch-color{
    background: #f1f0f0;
}

.mobile-config-swatch--b1-lightgray .mobile-config-swatch-color{
    background: #b8b8b8;
}

.mobile-config-swatch--b1-darkgray .mobile-config-swatch-color{
    background: #5f5f5f;
}

.mobile-config-swatch--b1-black .mobile-config-swatch-color{
    background: #1a1a1a;
}

.mobile-config-swatch--b2-white .mobile-config-swatch-color{
    background: #f1f0f0;
}

.mobile-config-swatch--b2-lightgray .mobile-config-swatch-color{
    background: #b8b8b8;
}

.mobile-config-swatch--b2-darkgray .mobile-config-swatch-color{
    background: #5f5f5f;
}

.mobile-config-swatch--b2-black .mobile-config-swatch-color{
    background: #1a1a1a;
}

.mobile-config-swatch--light-warm .mobile-config-swatch-color{
    background: #ffd6a0;
}

.mobile-config-swatch--light-cold .mobile-config-swatch-color{
    background: #e8f2ff;
}

.mobile-config-swatch--light-rgb .mobile-config-swatch-color{
    background: conic-gradient(
        #ff4030,
        #faa146,
        #67a86b,
        #4f8cff,
        #b15cff,
        #ff4030
    );
}

.mobile-config-swatch--light-rgbw .mobile-config-swatch-color{
    background: conic-gradient(
        #ff4030 0deg,
        #faa146 60deg,
        #67a86b 120deg,
        #4f8cff 180deg,
        #b15cff 240deg,
        #f1f0f0 300deg,
        #ff4030 360deg
    );
}


.mobile-config-group{
    display: grid;
    gap: 12px;
    justify-items: center;
}

/* =========================
   Loading
========================= */

.loading{
    position: absolute;
    inset: 0;
    z-index: 10;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;

    padding: 24px;

    background: var(--bg);

    color: var(--muted);

    font-size: 0.72rem;
    font-weight: 400;
    letter-spacing: 0.12em;
    text-transform: uppercase;

    transition:
        opacity 320ms ease,
        visibility 320ms ease;
}

.loading.is-hidden{
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loading-line{
    width: min(180px, 56vw);
    height: 1px;

    overflow: hidden;

    background: var(--line);
}

.loading-line span{
    display: block;

    width: 42%;
    height: 100%;

    background: var(--accent);

    animation: loadingLine 1.35s ease-in-out infinite;
}

@keyframes loadingLine{
    0%{
        transform: translateX(-120%);
    }

    50%{
        transform: translateX(140%);
    }

    100%{
        transform: translateX(320%);
    }
}


/* =========================
   Small Screens
========================= */

@media (max-width: 380px){
    .loading{
        font-size: 0.66rem;
    }

    .loading-line{
        width: min(150px, 52vw);
    }
}


/* =========================
   Reduced Motion
========================= */

@media (prefers-reduced-motion: reduce){
    .loading,
    .loading-line span{
        transition: none;
        animation: none;
    }

    .loading-line span{
        width: 100%;
    }
}