/* =========================================================
   BLENDERHUB 3D VIEWER PRO
   Premium Responsive UI
   Desktop + Laptop + Tablet + Mobile
   ========================================================= */

:root {
    --bg: #070b12;
    --bg-2: #0b111b;
    --panel: rgba(13, 19, 30, 0.96);
    --panel-2: rgba(18, 26, 40, 0.98);
    --card: rgba(255, 255, 255, 0.055);
    --card-hover: rgba(255, 255, 255, 0.09);
    --border: rgba(255, 255, 255, 0.09);
    --border-light: rgba(255, 255, 255, 0.14);

    --primary: #6366f1;
    --primary-2: #818cf8;
    --primary-soft: rgba(99, 102, 241, 0.16);

    --success: #22c55e;
    --danger: #ef4444;
    --warning: #f59e0b;

    --text: #f8fafc;
    --text-2: #cbd5e1;
    --muted: #94a3b8;
    --muted-2: #64748b;

    --header-height: 70px;
    --panel-width: 370px;

    --radius-sm: 10px;
    --radius-md: 14px;
    --radius-lg: 20px;

    --shadow-lg:
        0 20px 60px rgba(0, 0, 0, 0.42),
        0 4px 18px rgba(0, 0, 0, 0.25);

    --transition: 180ms cubic-bezier(.2,.8,.2,1);
}

/* =========================================================
   LIGHT THEME (DEFAULT)
   ========================================================= */
:root[data-theme="light"] {
    --bg: #eef2f7;
    --bg-2: #f8fafc;
    --panel: rgba(255,255,255,.97);
    --panel-2: rgba(248,250,252,.99);
    --card: rgba(15,23,42,.045);
    --card-hover: rgba(99,102,241,.09);
    --border: rgba(15,23,42,.10);
    --border-light: rgba(15,23,42,.16);
    --text: #0f172a;
    --text-2: #334155;
    --muted: #64748b;
    --muted-2: #94a3b8;
}


/* =========================================================
   RESET
   ========================================================= */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html,
body {
    width: 100%;
    height: 100%;
    overflow: hidden;
}

body {
    font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont,
        "Segoe UI", sans-serif;

    background:
        radial-gradient(circle at 20% 10%, rgba(99,102,241,.08), transparent 28%),
        radial-gradient(circle at 90% 80%, rgba(56,189,248,.05), transparent 25%),
        var(--bg);

    color: var(--text);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

button,
input,
textarea {
    font: inherit;
}

button {
    border: 0;
    outline: none;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--primary-2);
    outline-offset: 2px;
}

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

.no-select,
button,
.logo,
.model-title,
.model-tag {
    user-select: none;
    -webkit-user-select: none;
}


/* =========================================================
   PREMIUM HEADER
   ========================================================= */

.premium-header {
    position: relative;
    z-index: 100;

    height: var(--header-height);
    width: 100%;

    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;

    padding: 0 18px;

    background:
        linear-gradient(
            180deg,
            rgba(12,18,29,.98),
            rgba(8,13,22,.96)
        );

    border-bottom: 1px solid var(--border);

    box-shadow:
        0 8px 30px rgba(0,0,0,.28);

    backdrop-filter: blur(22px);
    -webkit-backdrop-filter: blur(22px);
}

.header-left {
    display: flex;
    align-items: center;
    justify-content: flex-start;
}

.header-center {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
}

.header-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 9px;
}


/* Logo */

.logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;

    font-size: 17px;
    font-weight: 800;
    letter-spacing: -.4px;

    transition: var(--transition);
}

.logo i {
    width: 35px;
    height: 35px;

    display: grid;
    place-items: center;

    border-radius: 11px;

    color: #fff;

    background:
        linear-gradient(
            135deg,
            #6366f1,
            #8b5cf6
        );

    box-shadow:
        0 8px 25px rgba(99,102,241,.32);
}

.logo:hover {
    transform: translateY(-1px);
}


/* Model title */

.model-header-info {
    display: flex;
    align-items: center;
    gap: 10px;

    min-width: 0;
    max-width: 55vw;
}

.model-title {
    max-width: 38vw;

    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;

    font-size: 15px;
    font-weight: 700;
    letter-spacing: -.2px;
}

.model-tag {
    flex-shrink: 0;

    padding: 5px 9px;

    border: 1px solid rgba(99,102,241,.28);
    border-radius: 999px;

    color: #a5b4fc;
    background: rgba(99,102,241,.10);

    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .7px;
}


/* Header buttons */

.header-btn {
    height: 40px;

    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;

    padding: 0 14px;

    color: var(--text-2);
    background: rgba(255,255,255,.055);

    border: 1px solid var(--border);
    border-radius: 11px;

    cursor: pointer;

    transition:
        transform var(--transition),
        background var(--transition),
        border-color var(--transition),
        color var(--transition);
}

.header-btn:hover {
    color: #fff;
    background: rgba(255,255,255,.10);
    border-color: var(--border-light);
    transform: translateY(-1px);
}

.purchase-header-btn {
    color: #fff;

    background:
        linear-gradient(
            135deg,
            #6366f1,
            #7c3aed
        );

    border-color: transparent;

    box-shadow:
        0 7px 25px rgba(99,102,241,.25);
}

.purchase-header-btn:hover {
    background:
        linear-gradient(
            135deg,
            #7073ff,
            #8b5cf6
        );

    box-shadow:
        0 10px 32px rgba(99,102,241,.38);
}

.menu-btn {
    width: 40px;
    padding: 0;
}


/* =========================================================
   MAIN VIEWER
   ========================================================= */

.viewer-layout {
    position: relative;

    width: 100%;
    height: calc(100vh - var(--header-height));

    display: flex;

    overflow: hidden;
}

.canvas-wrapper {
    position: relative;

    flex: 1;
    min-width: 0;
    height: 100%;

    overflow: hidden;

    background: #080c13;
}

#canvas-container {
    position: absolute;
    inset: 0;

    overflow: hidden;
}

#canvas-container canvas {
    display: block;

    width: 100% !important;
    height: 100% !important;

    touch-action: none;
}


/* =========================================================
   LOADING SCREEN
   ========================================================= */

.loading-overlay {
    position: absolute;
    inset: 0;

    z-index: 90;

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

    background:
        radial-gradient(
            circle at center,
            rgba(17,24,39,.88),
            rgba(3,7,13,.97)
        );

    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);

    transition: opacity .3s ease;
}

.loading-content {
    width: min(330px, calc(100vw - 40px));

    padding: 30px 26px;

    text-align: center;

    border: 1px solid var(--border);
    border-radius: 22px;

    background: rgba(15,23,36,.78);

    box-shadow: var(--shadow-lg);
}

.premium-loader {
    position: relative;

    width: 58px;
    height: 58px;

    margin: 0 auto 20px;
}

.loader-circle {
    position: absolute;
    inset: 0;

    border-radius: 50%;

    border: 3px solid transparent;
    border-top-color: var(--primary);

    animation: spin 1s linear infinite;
}

.loader-circle:nth-child(2) {
    inset: 7px;
    border-top-color: #8b5cf6;
    animation-duration: .75s;
    animation-direction: reverse;
}

.loader-circle:nth-child(3) {
    inset: 14px;
    border-top-color: #38bdf8;
    animation-duration: .55s;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-content h3 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 17px;
}

.progress-container {
    width: 100%;
}

.progress-bar {
    height: 6px;

    overflow: hidden;

    border-radius: 999px;

    background: rgba(255,255,255,.08);
}

.progress-fill {
    width: 0;
    height: 100%;

    border-radius: inherit;

    background:
        linear-gradient(
            90deg,
            #6366f1,
            #8b5cf6,
            #38bdf8
        );

    box-shadow:
        0 0 18px rgba(99,102,241,.55);

    transition: width .2s ease;
}

.progress-text {
    margin-top: 9px;

    color: var(--muted);

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


/* =========================================================
   FLOATING CONTROLS
   ========================================================= */

.floating-controls {
    position: absolute;

    z-index: 30;

    left: 18px;
    right: 18px;
    bottom: 18px;

    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;

    pointer-events: none;
}

.control-group-left,
.control-group-center,
.control-group-right {
    display: flex;
    align-items: center;
    gap: 7px;

    pointer-events: auto;
}

.control-group-center {
    justify-content: center;

    padding: 5px;

    border: 1px solid var(--border);
    border-radius: 14px;

    background: rgba(9,14,23,.72);

    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);

    box-shadow:
        0 10px 35px rgba(0,0,0,.30);
}

.control-group-right {
    justify-content: flex-end;
}

.float-btn {
    width: 42px;
    height: 42px;

    display: grid;
    place-items: center;

    color: #cbd5e1;

    background: rgba(13,19,30,.78);

    border: 1px solid var(--border);
    border-radius: 12px;

    cursor: pointer;

    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);

    box-shadow:
        0 7px 20px rgba(0,0,0,.22);

    transition:
        transform var(--transition),
        background var(--transition),
        color var(--transition),
        border-color var(--transition);
}

.float-btn:hover {
    color: #fff;

    background: rgba(99,102,241,.18);
    border-color: rgba(129,140,248,.35);

    transform: translateY(-2px);
}

.float-btn.active {
    color: #fff;

    background:
        linear-gradient(
            135deg,
            rgba(99,102,241,.95),
            rgba(124,58,237,.95)
        );

    border-color: rgba(165,180,252,.35);

    box-shadow:
        0 7px 25px rgba(99,102,241,.28);
}

.float-btn.large {
    width: 48px;
    height: 48px;

    border-radius: 13px;

    background: rgba(255,255,255,.06);
}


/* =========================================================
   MODEL INFO BADGE
   ========================================================= */

.model-info-badge {
    position: absolute;

    z-index: 20;

    top: 17px;
    left: 17px;

    display: flex;
    align-items: center;

    padding: 8px 12px;

    border: 1px solid var(--border);

    border-radius: 11px;

    background: rgba(8,13,22,.70);

    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);

    box-shadow:
        0 8px 25px rgba(0,0,0,.20);
}

.badge-item {
    display: flex;
    align-items: center;
    gap: 7px;

    color: var(--muted);

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

.badge-item i {
    color: var(--primary-2);
}

.badge-divider {
    width: 1px;
    height: 16px;

    margin: 0 11px;

    background: var(--border);
}


/* =========================================================
   FPS
   ========================================================= */

.fps-counter {
    position: absolute;

    z-index: 20;

    top: 17px;
    right: 17px;

    padding: 6px 9px;

    color: #86efac;

    background: rgba(7,18,12,.72);

    border: 1px solid rgba(34,197,94,.18);
    border-radius: 8px;

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

    backdrop-filter: blur(12px);
}


/* =========================================================
   MEASURE DISPLAY
   ========================================================= */

.measure-display {
    position: absolute;

    z-index: 50;

    top: 65px;
    left: 50%;

    transform: translateX(-50%);

    align-items: center;
    gap: 9px;

    padding: 9px 11px 9px 14px;

    color: #fff;

    background: rgba(12,18,29,.90);

    border: 1px solid rgba(99,102,241,.35);
    border-radius: 12px;

    box-shadow:
        0 10px 35px rgba(0,0,0,.30);

    backdrop-filter: blur(18px);
}

.measure-display > i {
    color: var(--primary-2);
}

#measureValue {
    font-size: 12px;
    font-weight: 700;
}

.measure-clear {
    width: 25px;
    height: 25px;

    display: grid;
    place-items: center;

    color: #94a3b8;

    background: rgba(255,255,255,.06);

    border-radius: 7px;

    cursor: pointer;
}

.measure-clear:hover {
    color: #fff;
    background: rgba(239,68,68,.20);
}


/* =========================================================
   SIDE PANEL
   ========================================================= */

.side-panel {
    position: relative;
    z-index: 80;

    flex: 0 0 var(--panel-width);

    width: var(--panel-width);
    height: 100%;

    display: flex;
    flex-direction: column;

    background:
        linear-gradient(
            180deg,
            rgba(12,18,29,.98),
            rgba(8,13,22,.99)
        );

    border-left: 1px solid var(--border);

    box-shadow:
        -15px 0 45px rgba(0,0,0,.25);
}


/* Panel header */

.panel-header {
    min-height: 62px;

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

    padding: 0 16px;

    border-bottom: 1px solid var(--border);

    background: rgba(255,255,255,.018);
}

.panel-header h3 {
    display: flex;
    align-items: center;
    gap: 9px;

    font-size: 14px;
    font-weight: 750;
}

.panel-header h3 i {
    color: var(--primary-2);
}

.close-btn {
    width: 32px;
    height: 32px;

    display: grid;
    place-items: center;

    color: var(--muted);

    background: rgba(255,255,255,.05);

    border: 1px solid var(--border);
    border-radius: 9px;

    cursor: pointer;

    transition: var(--transition);
}

.close-btn:hover {
    color: #fff;
    background: rgba(239,68,68,.15);
    border-color: rgba(239,68,68,.25);
}


/* =========================================================
   TABS
   ========================================================= */

.tabs-nav {
    display: grid;
    grid-template-columns: repeat(9, 1fr);

    gap: 3px;

    padding: 7px;

    border-bottom: 1px solid var(--border);

    background: rgba(4,8,15,.50);
}

.tab-btn {
    position: relative;

    min-width: 0;
    height: 39px;

    display: grid;
    place-items: center;

    color: var(--muted-2);

    background: transparent;

    border-radius: 9px;

    cursor: pointer;

    transition: var(--transition);
}

.tab-btn:hover {
    color: var(--text-2);
    background: rgba(255,255,255,.05);
}

.tab-btn.active {
    color: #fff;

    background:
        linear-gradient(
            135deg,
            rgba(99,102,241,.95),
            rgba(124,58,237,.95)
        );

    box-shadow:
        0 5px 16px rgba(99,102,241,.20);
}

.tab-btn i {
    font-size: 12px;
}


/* =========================================================
   PANEL BODY
   ========================================================= */

.panel-body {
    flex: 1;

    min-height: 0;

    overflow-y: auto;
    overflow-x: hidden;

    padding: 17px 15px 30px;

    scrollbar-width: thin;
    scrollbar-color: rgba(148,163,184,.25) transparent;
}

.panel-body::-webkit-scrollbar {
    width: 5px;
}

.panel-body::-webkit-scrollbar-track {
    background: transparent;
}

.panel-body::-webkit-scrollbar-thumb {
    background: rgba(148,163,184,.22);
    border-radius: 99px;
}

.tab-content {
    display: none;

    animation: tabIn .22s ease;
}

.tab-content.active {
    display: block;
}

@keyframes tabIn {
    from {
        opacity: 0;
        transform: translateY(4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tab-content > h4 {
    display: flex;
    align-items: center;
    gap: 8px;

    margin-bottom: 11px;

    color: #e2e8f0;

    font-size: 12px;
    font-weight: 750;
    letter-spacing: -.1px;
}

.tab-content > h4 i {
    color: var(--primary-2);
    font-size: 11px;
}


/* =========================================================
   CONTROL GRID
   ========================================================= */

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

    gap: 7px;
}

.control-btn {
    min-height: 48px;

    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;

    padding: 8px 7px;

    color: #cbd5e1;

    background:
        linear-gradient(
            180deg,
            rgba(255,255,255,.055),
            rgba(255,255,255,.035)
        );

    border: 1px solid var(--border);
    border-radius: 11px;

    font-size: 10px;
    font-weight: 650;

    cursor: pointer;

    transition:
        transform var(--transition),
        background var(--transition),
        color var(--transition),
        border-color var(--transition),
        box-shadow var(--transition);
}

.control-btn i {
    flex-shrink: 0;

    color: #818cf8;

    font-size: 11px;
}

.control-btn:hover {
    color: #fff;

    background:
        linear-gradient(
            180deg,
            rgba(99,102,241,.15),
            rgba(99,102,241,.08)
        );

    border-color: rgba(129,140,248,.25);

    transform: translateY(-1px);
}

.control-btn.active {
    color: #fff;

    background:
        linear-gradient(
            135deg,
            rgba(99,102,241,.92),
            rgba(124,58,237,.92)
        );

    border-color: rgba(165,180,252,.25);

    box-shadow:
        0 7px 20px rgba(99,102,241,.18);
}

.control-btn.active i {
    color: #fff;
}


/* =========================================================
   SPEED / RANGE CONTROLS
   ========================================================= */

.speed-control {
    margin-top: 15px;
    padding: 12px;

    border: 1px solid rgba(255,255,255,.065);
    border-radius: 13px;

    background: rgba(255,255,255,.025);
}

.speed-header {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 10px;

    margin-bottom: 10px;
}

.speed-header label {
    display: flex;
    align-items: center;
    gap: 7px;

    min-width: 0;

    color: #cbd5e1;

    font-size: 10px;
    font-weight: 650;
}

.speed-header label i {
    color: #818cf8;
}

.speed-header span {
    flex-shrink: 0;

    color: #a5b4fc;

    font-size: 10px;
    font-weight: 750;
}


/* Range */

input[type="range"] {
    appearance: none;
    -webkit-appearance: none;

    width: 100%;
    height: 4px;

    border-radius: 999px;

    background:
        linear-gradient(
            90deg,
            #6366f1,
            rgba(255,255,255,.12)
        );

    cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    -webkit-appearance: none;

    width: 16px;
    height: 16px;

    border-radius: 50%;

    background: #fff;

    border: 3px solid #6366f1;

    box-shadow:
        0 2px 10px rgba(99,102,241,.45);

    transition: transform .15s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.15);
}

input[type="range"]::-moz-range-thumb {
    width: 16px;
    height: 16px;

    border-radius: 50%;

    background: #fff;

    border: 3px solid #6366f1;

    box-shadow:
        0 2px 10px rgba(99,102,241,.45);
}


/* =========================================================
   COLOR PICKERS
   ========================================================= */

.color-picker-section {
    margin-top: 15px;
    padding: 12px;

    border: 1px solid rgba(255,255,255,.065);
    border-radius: 13px;

    background: rgba(255,255,255,.025);
}

.color-options {
    display: flex;
    flex-wrap: wrap;
    align-items: center;

    gap: 8px;

    margin-top: 10px;
}

.color-dot {
    position: relative;

    width: 27px;
    height: 27px;

    flex: 0 0 27px;

    border: 2px solid rgba(255,255,255,.20);
    border-radius: 50%;

    cursor: pointer;

    transition:
        transform .15s ease,
        border-color .15s ease,
        box-shadow .15s ease;
}

.color-dot:hover {
    transform: scale(1.15);

    border-color: #fff;

    box-shadow:
        0 0 0 3px rgba(99,102,241,.15);
}

.color-input {
    width: 30px;
    height: 30px;

    padding: 0;

    overflow: hidden;

    border: 2px solid rgba(255,255,255,.18);
    border-radius: 50%;

    background: transparent;

    cursor: pointer;
}

.color-input::-webkit-color-swatch-wrapper {
    padding: 0;
}

.color-input::-webkit-color-swatch {
    border: 0;
    border-radius: 50%;
}


/* =========================================================
   INFO CARDS
   ========================================================= */

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

    gap: 7px;

    margin-top: 10px;
}

.info-card {
    min-width: 0;

    display: flex;
    align-items: center;
    gap: 9px;

    min-height: 58px;

    padding: 9px;

    background:
        linear-gradient(
            135deg,
            rgba(255,255,255,.055),
            rgba(255,255,255,.025)
        );

    border: 1px solid var(--border);
    border-radius: 12px;
}

.info-icon-box {
    width: 31px;
    height: 31px;

    flex: 0 0 31px;

    display: grid;
    place-items: center;

    color: #a5b4fc;

    background: rgba(99,102,241,.12);

    border-radius: 9px;

    font-size: 11px;
}

.info-icon-box.success {
    color: #86efac;
    background: rgba(34,197,94,.10);
}

.info-content {
    min-width: 0;

    display: flex;
    flex-direction: column;
    gap: 3px;
}

.info-label {
    color: var(--muted-2);

    font-size: 8px;
    font-weight: 650;

    text-transform: uppercase;
    letter-spacing: .45px;
}

.info-value {
    overflow: hidden;

    color: #e2e8f0;

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

    white-space: nowrap;
    text-overflow: ellipsis;
}

.info-value.success {
    color: #86efac;
}


/* =========================================================
   MEASURE INFO
   ========================================================= */

.measure-info {
    margin-top: 12px;

    padding: 11px 12px;

    border: 1px solid rgba(99,102,241,.14);
    border-radius: 11px;

    background: rgba(99,102,241,.055);
}

.measure-info p {
    display: flex;
    align-items: flex-start;
    gap: 8px;

    color: var(--muted);

    font-size: 10px;
    line-height: 1.55;
}

.measure-info i {
    flex-shrink: 0;
    margin-top: 2px;
    color: var(--primary-2);
}


/* =========================================================
   ANIMATION STATUS
   ========================================================= */

.anim-status {
    display: flex;
    align-items: flex-start;
    gap: 9px;

    margin-top: 14px;

    padding: 11px;

    color: var(--muted);

    background: rgba(255,255,255,.035);

    border: 1px solid var(--border);
    border-radius: 11px;

    font-size: 10px;
    line-height: 1.5;
}

.anim-status i {
    color: var(--primary-2);
    margin-top: 2px;
}


/* =========================================================
   EMBED CODE
   ========================================================= */

.embed-box {
    margin-top: 10px;
}

.embed-box textarea {
    width: 100%;
    height: 100px;

    display: block;

    resize: none;

    padding: 11px;

    color: #a5b4fc;

    background: #060a11;

    border: 1px solid var(--border);
    border-radius: 11px;

    font-family:
        ui-monospace,
        SFMono-Regular,
        Menlo,
        Monaco,
        Consolas,
        monospace;

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

    outline: none;
}

.embed-box textarea:focus {
    border-color: rgba(99,102,241,.45);
}


/* =========================================================
   SOCIAL
   ========================================================= */

.social-actions {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;

    gap: 7px;
}

.social-btn {
    min-height: 48px;

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

    gap: 4px;

    color: var(--muted);

    background: rgba(255,255,255,.045);

    border: 1px solid var(--border);
    border-radius: 11px;

    cursor: pointer;

    transition: var(--transition);
}

.social-btn:hover {
    color: #fff;

    background: rgba(255,255,255,.08);

    transform: translateY(-1px);
}

.social-btn i {
    font-size: 13px;
}

.social-btn span {
    font-size: 9px;
    font-weight: 650;
}

.social-btn.active {
    color: #f472b6;

    background: rgba(236,72,153,.10);

    border-color: rgba(236,72,153,.22);
}

.social-count {
    font-size: 8px !important;
}


/* =========================================================
   REVIEW
   ========================================================= */

.review-summary {
    padding: 13px;

    background:
        linear-gradient(
            135deg,
            rgba(255,255,255,.055),
            rgba(255,255,255,.025)
        );

    border: 1px solid var(--border);
    border-radius: 13px;
}

.review-stars {
    display: flex;
    align-items: center;
    gap: 3px;

    color: #fbbf24;

    font-size: 12px;
}

.review-stars span {
    margin-left: 7px;

    color: #e2e8f0;

    font-size: 10px;
    font-weight: 700;
}

.review-summary p {
    margin-top: 6px;

    color: var(--muted);

    font-size: 9px;
}


/* =========================================================
   PREVIEW CARD
   ========================================================= */

.preview-card {
    display: flex;
    align-items: center;
    gap: 12px;

    margin-top: 13px;
    padding: 12px;

    background:
        linear-gradient(
            135deg,
            rgba(99,102,241,.12),
            rgba(124,58,237,.055)
        );

    border: 1px solid rgba(99,102,241,.17);
    border-radius: 14px;
}

.preview-icon {
    width: 43px;
    height: 43px;

    flex: 0 0 43px;

    display: grid;
    place-items: center;

    color: #c4b5fd;

    background:
        linear-gradient(
            135deg,
            rgba(99,102,241,.25),
            rgba(124,58,237,.20)
        );

    border-radius: 12px;

    font-size: 17px;
}

.preview-info {
    min-width: 0;
}

.preview-info h4 {
    overflow: hidden;

    color: #fff;

    font-size: 11px;
    font-weight: 750;

    white-space: nowrap;
    text-overflow: ellipsis;
}

.preview-info p {
    margin-top: 4px;

    color: var(--muted);

    font-size: 9px;
}


/* =========================================================
   PURCHASE
   ========================================================= */

.purchase-section {
    margin-top: 14px;
    padding: 15px;

    text-align: center;

    background:
        radial-gradient(
            circle at top,
            rgba(99,102,241,.16),
            transparent 70%
        ),
        rgba(255,255,255,.035);

    border: 1px solid rgba(99,102,241,.20);
    border-radius: 15px;
}

.purchase-section h4 {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;

    color: #f1f5f9;

    font-size: 11px;
}

.purchase-section h4 i {
    color: #a5b4fc;
}

.purchase-desc {
    margin: 7px 0 12px;

    color: var(--muted);

    font-size: 9px;
    line-height: 1.5;
}

.purchase-btn-large {
    width: 100%;
    min-height: 45px;

    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;

    color: #fff;

    background:
        linear-gradient(
            135deg,
            #6366f1,
            #7c3aed
        );

    border-radius: 11px;

    font-size: 10px;
    font-weight: 750;

    cursor: pointer;

    box-shadow:
        0 8px 25px rgba(99,102,241,.25);

    transition: var(--transition);
}

.purchase-btn-large:hover {
    transform: translateY(-2px);

    box-shadow:
        0 12px 32px rgba(99,102,241,.38);
}


/* =========================================================
   BACK BUTTON
   ========================================================= */

.back-btn {
    min-height: 43px;

    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;

    margin-top: 9px;

    color: var(--muted);

    background: rgba(255,255,255,.035);

    border: 1px solid var(--border);
    border-radius: 11px;

    font-size: 10px;
    font-weight: 650;

    transition: var(--transition);
}

.back-btn:hover {
    color: #fff;
    background: rgba(255,255,255,.07);
}


/* =========================================================
   HOTSPOTS
   ========================================================= */

.hotspot {
    position: absolute;

    z-index: 35;

    width: 17px;
    height: 17px;

    display: grid;
    place-items: center;

    cursor: pointer;
}

.hotspot-pulse {
    position: absolute;
    inset: 0;

    border-radius: 50%;

    background: #6366f1;

    box-shadow:
        0 0 0 5px rgba(99,102,241,.20),
        0 0 20px rgba(99,102,241,.75);

    animation: hotspotPulse 1.7s infinite;
}

.hotspot-label {
    position: absolute;

    left: 23px;
    top: 50%;

    transform: translateY(-50%);

    padding: 5px 8px;

    color: #fff;

    background: rgba(8,13,22,.90);

    border: 1px solid var(--border);
    border-radius: 7px;

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

    white-space: nowrap;

    opacity: 0;

    pointer-events: none;

    transition: opacity .2s ease;
}

.hotspot:hover .hotspot-label {
    opacity: 1;
}

@keyframes hotspotPulse {
    0%, 100% {
        transform: scale(.85);
        opacity: .7;
    }

    50% {
        transform: scale(1.2);
        opacity: 1;
    }
}


/* =========================================================
   FULLSCREEN TOPBAR
   ========================================================= */

.fullscreen-topbar {
    position: fixed;
    z-index: 1000;

    top: 0;
    left: 0;
    right: 0;

    height: 62px;

    display: none;
    align-items: center;
    justify-content: space-between;

    padding: 0 14px;

    background:
        linear-gradient(
            180deg,
            rgba(7,11,18,.96),
            rgba(7,11,18,.72)
        );

    border-bottom: 1px solid var(--border);

    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.fs-topbar-left,
.fs-topbar-right {
    display: flex;
    align-items: center;
    gap: 9px;
}

.fs-btn {
    height: 38px;

    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;

    padding: 0 12px;

    color: #cbd5e1;

    background: rgba(255,255,255,.06);

    border: 1px solid var(--border);
    border-radius: 10px;

    cursor: pointer;
}

.fs-btn:hover {
    color: #fff;
    background: rgba(255,255,255,.10);
}

.fs-model-info h3 {
    max-width: 300px;

    overflow: hidden;

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

    white-space: nowrap;
    text-overflow: ellipsis;
}

.fs-model-info span {
    display: block;

    margin-top: 3px;

    color: var(--muted-2);

    font-size: 8px;
}

.purchase-fs-btn {
    color: #fff;

    background:
        linear-gradient(
            135deg,
            #6366f1,
            #7c3aed
        );

    border-color: transparent;
}


/* =========================================================
   MOBILE CONTROLS
   ========================================================= */

.mobile-controls {
    display: none;
}


/* =========================================================
   PANEL OVERLAY
   ========================================================= */

.panel-overlay {
    display: none;
}


/* =========================================================
   TABLET / SMALL LAPTOP
   ========================================================= */

@media (max-width: 1100px) {

    :root {
        --panel-width: 340px;
    }

    .floating-controls {
        left: 12px;
        right: 12px;
        bottom: 12px;
    }

    .float-btn {
        width: 39px;
        height: 39px;
    }

    .float-btn.large {
        width: 44px;
        height: 44px;
    }

    .model-title {
        max-width: 30vw;
    }

}


/* =========================================================
   TABLET
   ========================================================= */

@media (max-width: 900px) {

    :root {
        --header-height: 62px;
        --panel-width: 350px;
    }

    .premium-header {
        padding: 0 12px;
    }

    .logo span {
        display: none;
    }

    .logo i {
        width: 36px;
        height: 36px;
    }

    .model-header-info {
        max-width: 48vw;
    }

    .model-title {
        max-width: 30vw;
    }

    .viewer-layout {
        height: calc(100vh - var(--header-height));
    }

    .floating-controls {
        left: 10px;
        right: 10px;
    }

}


/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 768px) {

    html,
    body {
        overflow: hidden;
    }

    :root {
        --header-height: 58px;
    }

    .premium-header {
        height: var(--header-height);

        grid-template-columns: auto 1fr auto;

        padding: 0 10px;

        background:
            linear-gradient(
                180deg,
                rgba(7,11,18,.98),
                rgba(7,11,18,.92)
            );
    }

    .logo {
        gap: 0;
    }

    .logo i {
        width: 35px;
        height: 35px;
    }

    .header-center {
        padding: 0 8px;
    }

    .model-header-info {
        width: 100%;
        max-width: none;

        justify-content: center;

        gap: 6px;
    }

    .model-title {
        max-width: 48vw;

        font-size: 12px;
    }

    .model-tag {
        padding: 4px 7px;

        font-size: 8px;
    }

    .header-right {
        gap: 5px;
    }

    .purchase-header-btn {
        width: 36px;
        height: 36px;

        padding: 0;

        border-radius: 10px;
    }

    .purchase-header-btn .btn-text {
        display: none;
    }

    .menu-btn {
        width: 36px;
        height: 36px;
    }


    /* Viewer */

    .viewer-layout {
        height: calc(100vh - var(--header-height));

        display: block;
    }

    .canvas-wrapper {
        width: 100%;
        height: 100%;
    }


    /* Hide desktop controls */

    .floating-controls {
        display: none !important;
    }

    .model-info-badge {
        top: 10px;
        left: 10px;

        padding: 6px 9px;
    }

    .badge-item {
        font-size: 8px;
    }

    .badge-divider {
        margin: 0 7px;
    }

    .fps-counter {
        top: 10px;
        right: 10px;

        padding: 5px 7px;

        font-size: 8px;
    }


    /* Mobile bottom navigation */

    .mobile-controls {
        position: fixed;

        z-index: 500;

        left: 8px;
        right: 8px;
        bottom: max(8px, env(safe-area-inset-bottom));

        display: block;

        pointer-events: none;
    }

    .mobile-controls-inner {
        width: 100%;

        display: grid;
        grid-template-columns:
            repeat(5, 1fr)
            repeat(3, 1fr);

        gap: 5px;

        padding: 6px;

        border: 1px solid rgba(255,255,255,.10);
        border-radius: 17px;

        background:
            linear-gradient(
                180deg,
                rgba(14,21,33,.91),
                rgba(7,12,20,.96)
            );

        box-shadow:
            0 12px 40px rgba(0,0,0,.48),
            0 2px 8px rgba(0,0,0,.25);

        backdrop-filter: blur(22px);
        -webkit-backdrop-filter: blur(22px);

        pointer-events: auto;
    }

    .mobile-btn {
        height: 43px;

        display: grid;
        place-items: center;

        color: #94a3b8;

        background: transparent;

        border: 1px solid transparent;
        border-radius: 12px;

        cursor: pointer;

        transition: var(--transition);
    }

    .mobile-btn:active {
        transform: scale(.92);
    }

    .mobile-btn:hover {
        color: #fff;
        background: rgba(255,255,255,.07);
    }

    .mobile-btn.active {
        color: #fff;

        background:
            linear-gradient(
                135deg,
                #6366f1,
                #7c3aed
            );

        border-color: rgba(165,180,252,.25);
    }

    .purchase-btn-mobile {
        color: #fff;

        background:
            linear-gradient(
                135deg,
                #6366f1,
                #7c3aed
            );

        box-shadow:
            0 5px 16px rgba(99,102,241,.30);
    }


    /* Side panel mobile */

    .side-panel {
        position: fixed;

        z-index: 700;

        top: 0;
        right: 0;
        bottom: 0;

        width: min(92vw, 390px);
        height: 100dvh;

        transform: translateX(105%);

        border-left: 1px solid rgba(255,255,255,.12);

        box-shadow:
            -25px 0 70px rgba(0,0,0,.55);

        transition:
            transform .32s cubic-bezier(.2,.8,.2,1);
    }

    .side-panel.open {
        transform: translateX(0);
    }


    /* Overlay */

    .panel-overlay {
        position: fixed;

        z-index: 650;

        inset: 0;

        display: block;

        background: rgba(0,0,0,.60);

        opacity: 0;
        visibility: hidden;

        pointer-events: none;

        backdrop-filter: blur(4px);
        -webkit-backdrop-filter: blur(4px);

        transition:
            opacity .25s ease,
            visibility .25s ease;
    }

    .panel-overlay.active {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }


    /* Panel */

    .panel-header {
        min-height: 60px;

        padding:
            0
            14px
            0
            17px;
    }

    .tabs-nav {
        padding: 7px 8px;

        grid-template-columns: repeat(9, 1fr);
    }

    .tab-btn {
        height: 40px;
    }

    .panel-body {
        padding: 16px 13px 35px;
    }


    /* Loading */

    .loading-content {
        padding: 27px 21px;
        border-radius: 20px;
    }


    /* Measure */

    .measure-display {
        top: 55px;
    }


    /* Fullscreen */

    .fullscreen-topbar {
        height: 56px;
    }

    .fs-model-info h3 {
        max-width: 45vw;
    }

}


/* =========================================================
   SMALL MOBILE
   ========================================================= */

@media (max-width: 480px) {

    .premium-header {
        padding: 0 7px;
    }

    .model-title {
        max-width: 43vw;
        font-size: 11px;
    }

    .model-tag {
        display: none;
    }

    .logo i {
        width: 34px;
        height: 34px;
    }

    .purchase-header-btn,
    .menu-btn {
        width: 34px;
        height: 34px;
    }

    .mobile-controls {
        left: 5px;
        right: 5px;
    }

    .mobile-controls-inner {
        gap: 3px;
        padding: 5px;

        border-radius: 15px;
    }

    .mobile-btn {
        height: 41px;
        border-radius: 10px;
    }

    .mobile-btn i {
        font-size: 12px;
    }

    .side-panel {
        width: 94vw;
    }

    .panel-body {
        padding-left: 11px;
        padding-right: 11px;
    }

    .control-grid {
        gap: 6px;
    }

    .control-btn {
        min-height: 46px;
        font-size: 9px;
    }

    .info-grid {
        gap: 6px;
    }

    .info-card {
        min-height: 55px;
        padding: 8px;
    }

    .social-actions {
        gap: 5px;
    }

}


/* =========================================================
   VERY SMALL PHONES
   ========================================================= */

@media (max-width: 360px) {

    .model-title {
        max-width: 40vw;
        font-size: 10px;
    }

    .mobile-controls-inner {
        grid-template-columns: repeat(8, 1fr);
    }

    .mobile-btn {
        height: 39px;
    }

    .mobile-btn i {
        font-size: 11px;
    }

    .control-btn {
        min-height: 44px;
    }

    .control-btn i {
        font-size: 10px;
    }

}


/* =========================================================
   LANDSCAPE MOBILE
   ========================================================= */

@media (max-width: 900px) and (orientation: landscape) {

    :root {
        --header-height: 50px;
    }

    .premium-header {
        height: 50px;
    }

    .viewer-layout {
        height: calc(100vh - 50px);
    }

    .mobile-controls {
        bottom: 5px;
    }

    .mobile-btn {
        height: 35px;
    }

    .mobile-controls-inner {
        padding: 4px;
        border-radius: 12px;
    }

    .model-info-badge {
        top: 7px;
    }

    .fps-counter {
        top: 7px;
    }

}


/* =========================================================
   FULLSCREEN MODE
   ========================================================= */

.canvas-wrapper:fullscreen {
    width: 100vw;
    height: 100vh;

    background: #05080e;
}

.canvas-wrapper:-webkit-full-screen {
    width: 100vw;
    height: 100vh;

    background: #05080e;
}


/* =========================================================
   FULLSCREEN CANVAS
   ========================================================= */

.canvas-wrapper:fullscreen #canvas-container,
.canvas-wrapper:-webkit-full-screen #canvas-container {
    width: 100%;
    height: 100%;
}


/* =========================================================
   ACCESSIBILITY / REDUCED MOTION
   ========================================================= */

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }

}


/* =========================================================
   TOUCH OPTIMIZATION
   ========================================================= */

@media (hover: none) {

    .control-btn:hover,
    .float-btn:hover,
    .header-btn:hover,
    .social-btn:hover,
    .mobile-btn:hover {
        transform: none;
    }

    .control-btn,
    .float-btn,
    .mobile-btn,
    .header-btn,
    .social-btn {
        -webkit-tap-highlight-color: transparent;
    }

}


/* =========================================================
   SAFARI / IOS SAFE AREA
   ========================================================= */

@supports (padding: max(0px)) {

    .mobile-controls {
        bottom: max(
            8px,
            env(safe-area-inset-bottom)
        );
    }

}


/* =========================================================
   PRINT
   ========================================================= */

@media print {

    .premium-header,
    .side-panel,
    .floating-controls,
    .mobile-controls,
    .model-info-badge,
    .fps-counter,
    .loading-overlay {
        display: none !important;
    }

    html,
    body {
        overflow: visible;
    }
}

/* =========================================================
   BLENDERHUB THEME SYSTEM + NAV FIXES
   ========================================================= */

html[data-theme="light"] body {
    background:
        radial-gradient(circle at 20% 10%, rgba(99,102,241,.10), transparent 28%),
        radial-gradient(circle at 90% 80%, rgba(56,189,248,.08), transparent 25%),
        var(--bg);
    color: var(--text);
}

html[data-theme="light"] .premium-header,
html[data-theme="light"] .side-panel {
    background:
        linear-gradient(180deg, rgba(255,255,255,.98), rgba(246,248,252,.98));
    color: var(--text);
}

html[data-theme="light"] .premium-header {
    box-shadow: 0 8px 30px rgba(15,23,42,.10);
}

html[data-theme="light"] .canvas-wrapper {
    background: #e9eef5;
}

html[data-theme="light"] .control-btn,
html[data-theme="light"] .float-btn,
html[data-theme="light"] .header-btn,
html[data-theme="light"] .mobile-btn {
    color: #475569;
    background: rgba(255,255,255,.72);
    border-color: rgba(15,23,42,.10);
}

html[data-theme="light"] .control-btn:hover,
html[data-theme="light"] .float-btn:hover,
html[data-theme="light"] .header-btn:hover,
html[data-theme="light"] .mobile-btn:hover {
    color: #111827;
    background: rgba(99,102,241,.10);
    border-color: rgba(99,102,241,.22);
}

html[data-theme="light"] .control-btn.active,
html[data-theme="light"] .float-btn.active,
html[data-theme="light"] .mobile-btn.active {
    color: #fff;
}

html[data-theme="light"] .panel-header,
html[data-theme="light"] .tabs-nav {
    background: rgba(255,255,255,.70);
}

html[data-theme="light"] .speed-control,
html[data-theme="light"] .color-picker-section,
html[data-theme="light"] .info-card {
    background: rgba(15,23,42,.035);
    border-color: rgba(15,23,42,.08);
}

html[data-theme="light"] .tab-content > h4,
html[data-theme="light"] .speed-header label,
html[data-theme="light"] .info-label {
    color: #334155;
}

html[data-theme="light"] .model-info-badge {
    color: #334155;
    background: rgba(255,255,255,.82);
    border-color: rgba(15,23,42,.10);
}

html[data-theme="light"] .loading-overlay {
    background: radial-gradient(circle at center, rgba(248,250,252,.90), rgba(226,232,240,.97));
}

html[data-theme="light"] .loading-content {
    background: rgba(255,255,255,.90);
    color: #0f172a;
}

html[data-theme="light"] .mobile-controls-inner {
    background: linear-gradient(180deg, rgba(255,255,255,.94), rgba(241,245,249,.98));
    border-color: rgba(15,23,42,.12);
    box-shadow: 0 12px 40px rgba(15,23,42,.16);
}

.theme-btn {
    min-width: 86px;
}

.theme-btn i {
    color: var(--primary-2);
}

.back-header-btn {
    margin-left: 9px;
    min-width: 72px;
}

.back-header-btn i {
    color: var(--primary-2);
}

.side-panel.panel-closed {
    display: none;
}

@media (min-width: 769px) {
    .panel-overlay {
        display: none !important;
    }
}

@media (max-width: 768px) {
    .back-header-btn {
        height: 36px;
        min-width: 0;
        padding: 0 9px;
        gap: 5px;
        border-radius: 10px;
    }

    .back-header-btn span {
        display: inline;
        font-size: 10px;
    }

    .theme-btn {
        min-width: 0;
    }

    .theme-btn .theme-btn-text {
        display: none;
    }

    .side-panel {
        width: 70vw !important;
        max-width: 390px;
        min-width: 270px;
    }
}

@media (max-width: 480px) {
    .back-header-btn {
        padding: 0 7px;
    }

    .back-header-btn span {
        display: none;
    }

    .side-panel {
        width: 70vw !important;
        min-width: 250px;
    }

    .theme-btn {
        width: 34px;
        height: 34px;
        padding: 0;
    }
}

@media (max-width: 360px) {
    .side-panel {
        width: 72vw !important;
        min-width: 240px;
    }
}

/* Fullscreen must own the whole viewport; never let the normal header
   layout leak back into the page when exiting fullscreen. */
body.is-fullscreen .premium-header,
body.is-fullscreen .mobile-controls,
body.is-fullscreen .floating-controls,
body.is-fullscreen .model-info-badge {
    display: none !important;
}

body.is-fullscreen .canvas-wrapper:fullscreen,
body.is-fullscreen .canvas-wrapper:-webkit-full-screen {
    width: 100vw !important;
    height: 100vh !important;
    margin: 0 !important;
    position: fixed !important;
    inset: 0 !important;
}

.fullscreen-topbar {
    box-sizing: border-box;
}

#hotspotContainer .hotspot {
    position: absolute;
    transform: translate(-50%, -50%);
    z-index: 90;
    pointer-events: auto;
}

/* =========================================================
   BLENDERHUB FINAL SAFETY OVERRIDES
   ========================================================= */
html:not([data-theme="dark"]) body {
    background: var(--bg);
    color: var(--text);
}

@media (max-width: 768px) {
    .side-panel {
        width: 70vw !important;
        max-width: 390px;
    }
}

/* Browser fullscreen fallback: keep the viewer stable after exit. */
:fullscreen {
    overflow: hidden !important;
}

/* =========================================================
   MOBILE BOTTOM CONTROL SHEET
   Category tabs stay at the bottom; controls remain above.
   Desktop / laptop layout is untouched.
   ========================================================= */
@media (max-width: 768px) {
    .side-panel {
        top: auto !important;
        right: 0 !important;
        bottom: 0 !important;
        left: 0 !important;

        width: 100% !important;
        max-width: none !important;
        min-width: 0 !important;
        height: var(--mobile-panel-height, 40dvh) !important;
        max-height: var(--mobile-panel-height, 40dvh) !important;
        min-height: 0 !important;

        display: flex !important;
        flex-direction: column !important;

        border-left: 0 !important;
        border-top: 1px solid rgba(255,255,255,.12);
        border-radius: 18px 18px 0 0;

        transform: translateY(105%) !important;
        transition: transform .32s cubic-bezier(.2,.8,.2,1);
    }

    .side-panel.open {
        transform: translateY(0) !important;
    }

    /* Header remains at the top of the bottom sheet. */
    .side-panel .panel-header {
        order: 1;
        flex: 0 0 48px;
        min-height: 48px !important;
        height: 48px;
        padding: 0 12px;
    }

    /* Controls are the main scrollable area. */
    .side-panel .panel-body {
        order: 2;
        flex: 1 1 auto;
        min-height: 0 !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        padding: 12px 11px 12px !important;
        -webkit-overflow-scrolling: touch;
    }

    /* Category navigation moves from the top to the bottom. */
    .side-panel .tabs-nav {
        order: 3;
        flex: 0 0 55px;
        min-height: 55px;
        height: 55px;
        width: 100%;

        display: flex !important;
        align-items: center;
        gap: 5px;
        padding: 6px 8px calc(6px + env(safe-area-inset-bottom)) !important;

        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;

        border-top: 1px solid var(--border);
        border-bottom: 0 !important;
    }

    .side-panel .tabs-nav::-webkit-scrollbar {
        display: none;
    }

    /* Keep every category button usable instead of squeezing 9 into one row. */
    .side-panel .tab-btn {
        flex: 0 0 42px;
        width: 42px;
        min-width: 42px;
        height: 40px;
    }
}

@media (max-width: 480px) {
    .side-panel {
        height: var(--mobile-panel-height, 40dvh) !important;
        max-height: var(--mobile-panel-height, 40dvh) !important;
        border-radius: 16px 16px 0 0;
    }

    .side-panel .panel-header {
        flex-basis: 46px;
        min-height: 46px !important;
        height: 46px;
    }

    .side-panel .panel-body {
        padding: 10px 10px 10px !important;
    }

    .side-panel .tabs-nav {
        flex-basis: 53px;
        min-height: 53px;
        height: 53px;
    }

    .side-panel .tab-btn {
        flex-basis: 40px;
        width: 40px;
        min-width: 40px;
        height: 38px;
    }
}


/* =========================================================
   FINAL MOBILE + RESET FIXES
   ========================================================= */
@media (max-width: 768px) {
    .panel-overlay {
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
    }

    .side-panel .category-reset-btn {
        width: 100%;
        min-height: 40px;
        margin: 0 0 10px;
    }

    .side-panel .panel-body {
        scrollbar-width: thin;
    }
}

/* Light theme: non-active controls must always remain readable. */
html[data-theme="light"] .control-btn:not(.active),
html[data-theme="light"] .float-btn:not(.active),
html[data-theme="light"] .mobile-btn:not(.active),
html[data-theme="light"] .social-btn:not(.active) {
    color: #475569 !important;
}

html[data-theme="light"] .control-btn:not(.active) i,
html[data-theme="light"] .float-btn:not(.active) i,
html[data-theme="light"] .mobile-btn:not(.active) i,
html[data-theme="light"] .social-btn:not(.active) i {
    color: #818cf8 !important;
}

html[data-theme="light"] .control-btn.active,
html[data-theme="light"] .float-btn.active,
html[data-theme="light"] .mobile-btn.active,
html[data-theme="light"] .social-btn.active {
    color: #fff !important;
}

/* Keep the newly added full-reset control visually identical to existing controls. */
.category-reset-btn {
    margin-bottom: 10px;
}


/* =========================================================
   MOBILE PANEL HANDLE + LIVE MODEL
   Resize with one finger; release to keep that height;
   fast/downward swipe closes the sheet.
   ========================================================= */
@media (max-width: 768px) {
    .side-panel {
        touch-action: auto;
        overscroll-behavior: contain;
    }

    .side-panel .panel-body {
        touch-action: pan-y;
    }

    .side-panel .panel-header {
        position: relative;
    }

    .panel-drag-handle {
        position: absolute;
        left: 50%;
        top: 50%;
        transform: translate(-50%, -50%);
        width: 58px;
        height: 34px;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 4px;
        border-radius: 12px;
        cursor: grab;
        touch-action: none;
        z-index: 3;
        -webkit-tap-highlight-color: transparent;
    }

    .panel-drag-handle:active {
        cursor: grabbing;
    }

    .panel-drag-handle span {
        width: 5px;
        height: 5px;
        border-radius: 50%;
        background: currentColor;
        opacity: .55;
    }

    /* No blur and no dimming: the 3D model stays fully visible/live. */
    .panel-overlay,
    .panel-overlay.active {
        background: transparent !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        opacity: 0 !important;
        visibility: hidden !important;
        pointer-events: none !important;
    }

    /* The panel itself must remain interactive above the viewer. */
    .side-panel,
    .side-panel.open {
        z-index: 700 !important;
    }
}

@media (max-width: 480px) {
    .panel-drag-handle {
        width: 54px;
        height: 32px;
    }
}
