/* ============================================================
   EXACT3D PLAYER — THEME 2
   maincss_theme2.css  v2
   Class names match index_theme2.php (document 4 structure)
   ============================================================ */

:root {
    --primary-color:      #2196F3;
    --secondary-color:    #FFC107;
    --background-color:   #FFFFFF;
    --surface-color:      #F5F5F5;
    --text-primary:       #212121;
    --text-secondary:     #757575;
    --accent-color:       #FF5722;
    --button-bg:          #2196F3;
    --button-text:        #FFFFFF;
    --panel-bg:           #f5f5f5;
    --font-family:        'al2', sans-serif;
    --font-size-base:     14px;
    --font-size-header:   18px;
    --font-size-button:   14px;
    --panel-width:        430px;
    --toolbar-height:     60px;
    --panel-pad:          18px;
}

@font-face {
    font-family: "al2";
    src: url(libs/AeonikPro-Light.woff2) format("truetype");
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    background: #f0f0f0;
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    color: var(--text-primary);
    overflow: hidden;
}
h1,h2,h3,h4,h5,h6 { font-family: var(--font-family); font-weight: 200; }
h2 {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 10px 0 6px;
    padding-bottom: 4px;
    border-bottom: 1px solid #d3d3d3;
    font-weight: 400;
}
div { font-family: var(--font-family); }

::-webkit-scrollbar            { width: 4px; background: transparent; }
::-webkit-scrollbar-thumb      { background: #d0d0d0; border-radius: 10px; }

/* ============================================================
   MAIN GRID
   ============================================================ */
.containerMAIN {
    display: grid;
    grid-template-columns: 1fr var(--panel-width);
    height: 100vh;
    width: 100vw;
    overflow: hidden;
}

/* ============================================================
   CANVAS AREA
   ============================================================ */
.canvas-area {
    position: relative;
    width: 100%;
    height: 100vh;
    overflow: hidden;
}

.canvas-logo {
    position: absolute;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
}

@media only screen and (max-width: 768px) {
    .canvas-logo {
        left: 50%;
        transform: translateX(-50%);
    }
}
.canvas-logo img { width: 110px; display: block; }

#unidm-container {
    position: absolute;
    inset: 0;
    width: 100% !important;
    height: 100% !important;
}
#unidm-canvas {
    width: 100% !important;
    height: 100% !important;
}

#loading-container {
    position: absolute;
    top: 55%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 13px;
    color: #ccc;
    z-index: 10;
}
#unidm-loading-bar {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 200px;
    z-index: 10;
}
#unidm-progress-bar-empty {
    width: 100%;
    height: 3px;
    background: rgba(255,255,255,0.15);
    border-radius: 3px;
    overflow: hidden;
}
#unidm-progress-bar-full {
    height: 100%;
    background: #fff;
    border-radius: 3px;
    width: 0%;
    transition: width 0.3s ease;
}

.animationLoaderWrap {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1000;
}

.handPointerNudge {
    position: absolute;
    top: 67%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 50px;
    color: grey;
    opacity: 0.5;
    display: none;
    pointer-events: none;
    animation: nudge 2s ease-in-out infinite;
}
@keyframes nudge {
    0%   { left: 50%; }
    31%  { left: 48%; }
    71%  { left: 52%; }
    100% { left: 50%; }
}

#exact-logo {
    position: absolute;
    bottom: 4px;
    right: 16px;
    opacity: 0.4;
}
#exact-logo img { width: 88px; }

/* Fullscreen — top right of canvas */
.canvas-fullscreen {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 200;
    width: 36px;
    height: 36px;
    background: rgba(10,10,10,0.6);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.1);
    transition: background 0.2s;
    font-size: 13px;
}
.canvas-fullscreen:hover { background: rgba(255,255,255,0.9); color: #111; }

/* ── VERTICAL ICON STRIP ── */
.wrapIcons {
    position: absolute !important;
    right: 14px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    bottom: auto !important;
    left: auto !important;
    z-index: 200;
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
}

.icoF {
    font-family: var(--font-family);
    font-size: 13px;
    background: rgba(10,10,10,0.75);
    color: #fff;
    width: 46px;
    height: 46px;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    cursor: pointer;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.08);
    transition: background 0.2s, color 0.2s;
    flex-shrink: 0;
}
.icoF:hover { background: rgba(255,255,255,0.92); color: #111; }
.icoF:hover img { filter: brightness(0); }
.icoF img { width: 16px; }

/* FIX #3: 3D sub-options flow INLINE in the column — no position:absolute */
.down3D-options {
    display: none;
    flex-direction: column;
    gap: 8px;
    align-items: center;
}

/* ============================================================
   LANGUAGE SWITCHER — fixed, appears over panel top-right
   FIX #2: position:fixed so only ONE instance visible
   ============================================================ */
.langWrap {
    position: fixed !important;
    top: 5px !important;
    right: 14px !important;
    z-index: 99999;
}
.langSwitcher {
    font-family: var(--font-family);
    font-size: 12px;
    width: 32px;
    height: 32px;
    border: 1px solid #bbb;
    border-radius: 50%;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    color: var(--text-primary);
    background: rgba(255,255,255,0.9);
    backdrop-filter: blur(8px);
    transition: background 0.2s, color 0.2s;
}
.langSwitcher:hover { background: #111; color: #fff; border-color: #111; }

/* ============================================================
   RIGHT PANEL
   ============================================================ */
.right-panel {
    position: relative;
    background: var(--panel-bg);
    border-left: 1px solid #e0e0e0;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
    width: var(--panel-width);
}

/* ============================================================
   TABS
   ============================================================ */
.tab-bar {
    display: flex;
    border-bottom: 1px solid #e0e0e0;
    flex-shrink: 0;
    padding: 0 4px;
    padding-right: 42px;
    background: white;
}
.tab-btn {
    flex: 1;
    padding: 15px 4px 12px;
    border: none;
    background: transparent;
    font-family: var(--font-family);
    font-size: 12px;
    color: var(--text-secondary);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: color 0.2s, border-color 0.2s;
    white-space: nowrap;
    letter-spacing: 0.02em;
}
.tab-btn:hover { color: var(--text-primary); }
.tab-btn.active {
    color: var(--text-primary);
    border-bottom-color: var(--text-primary);
    font-weight: 600;
}

.tab-pane {
    display: none;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
}
.tab-pane.active { display: flex; }

.tab-stub {
    padding: 40px var(--panel-pad);
    color: var(--text-secondary);
    font-size: 13px;
    text-align: center;
}

/* ============================================================
   CATEGORY PILLS
   ============================================================ */
.cat-pills-wrap {
    padding: var(--panel-pad) var(--panel-pad) 10px;
    flex-shrink: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 7px;
}
.cat-pill {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 9px 12px;
    border: 1px solid #ddd;
    border-radius: 7px;
    background: #fff;
    font-family: var(--font-family);
    font-size: 13px;
    color: var(--text-primary);
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    text-align: left;
    line-height: 1.3;
}
.cat-pill:hover { border-color: #aaa; background: #f8f8f8; }
.cat-pill.active {
    background: var(--text-primary);
    border-color: var(--text-primary);
    color: #fff;
}
.pill-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pill-count { font-size: 11px; opacity: 0.5; margin-left: 5px; flex-shrink: 0; }
.cat-pill.active .pill-count { opacity: 0.7; }

/* ============================================================
   FILTER AREA (search + dropdowns)
   ============================================================ */
.tex-filter-area {
    padding: 0 var(--panel-pad) 10px;
    flex-shrink: 0;
}
.active-tex-label {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}
.active-tex-label strong { color: var(--text-primary); font-weight: 600; }

.search-wrap {
    display: flex;
    align-items: center;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    background: #fafafa;
    margin-bottom: 8px;
}
.search-icon { padding: 0 10px; color: #bbb; font-size: 12px; flex-shrink: 0; }
#textureSearch {
    border: none;
    background: transparent;
    font-family: var(--font-family);
    font-size: 13px;
    padding: 9px 8px 9px 0;
    width: 100%;
    outline: none;
    color: var(--text-primary);
}
#textureSearch::placeholder { color: #ccc; }

/* 2×2 filter grid */
.filter-dropdowns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 7px;
}
.filter-col { display: flex; flex-direction: column; gap: 3px; }
.filter-label { font-size: 11px; color: var(--text-secondary); letter-spacing: 0.03em; }
.filter-select {
    font-family: var(--font-family);
    font-size: 12px;
    padding: 6px 24px 6px 8px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    background: #fff;
    color: var(--text-primary);
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23999'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 7px center;
    cursor: pointer;
    outline: none;
}
.filter-select:focus { border-color: #aaa; }

/* ============================================================
   TEXTURE SECTIONS
   ============================================================ */
.tex-sections-wrap {
    flex: 1;
    overflow-y: auto;
    padding: 0 var(--panel-pad);
}
.texture-group-section         { display: none; }
.texture-group-section.active  { display: block; }

/* section.plan — block not table */
section.plan { display: block; }

/* ── THE GRID ── */
/* FIX #4: overMaterials is a 3-col grid, labels show name below thumb */
.overMaterials {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    margin-bottom: 10px;
    grid-auto-flow: dense; /* ← add this */
}

/* Hide radio inputs (no form wrapper in theme2) */
.overMaterials input[type="radio"] { display: none; }

/* Label */
.overMaterials label.col {
    float: none !important;
    display: flex;
    flex-direction: column;
    height: auto !important;
    cursor: pointer;
    border: none !important;        /* ← remove border from label */
    border-radius: 0 !important;
    overflow: visible !important;   /* ← allow name to sit outside */
    background: transparent !important;
    position: relative;
    opacity: 0;
    transform: translateY(14px);
    animation: texFadeUp 0.3s ease forwards;
    transition: border-color 0.15s;
    font-size: 12px;
    font-weight: 600;
}
.overMaterials label.col:hover { border-color: #bbb; }

/* Checked */
.overMaterials input[type="radio"]:checked + label.col {
    border-color: var(--text-primary);
}
.overMaterials input[type="radio"]:checked + label.col::after {
    content: "";
    position: absolute;
    bottom: 0; right: 12px;
    border-left: 7px solid transparent;
    border-right: 7px solid transparent;
    border-bottom: 10px solid white;
    z-index: 1;
}
/* Checked — border on image only */
.overMaterials input[type="radio"]:checked + label.col img {
    border-color: var(--text-primary);
}

/* Remove the old ::after triangle — now on image not label */
.overMaterials input[type="radio"]:checked + label.col::after {
    display: none;
}

/* Thumbnail */
.overMaterials label.col img {
    width: 100% !important;
    height: 64px !important;
    aspect-ratio: unset;
    object-fit: cover;
    display: block;
    border-radius: 6px;
    border: 2px solid transparent;
    transition: border-color 0.15s;
    box-sizing: border-box;
    margin-bottom: 4px;
}
/* Hover — border on image */
.overMaterials label.col:hover img {
    border-color: #bbb;
}

/* FIX #4: texture name below thumbnail */
.tex-name {
    font-size: 9px;             /* ← smaller */
    color: var(--text-secondary);
    text-align: center;
    padding: 3px 3px 4px;
    background: #fff;
    line-height: 1.2;
    word-break: break-word;
}

/* selectedTextureType */
.selectedTextureType {
    font-size: 11px;
    color: var(--text-secondary);
    text-align: right;
    padding: 2px 0 8px;
    display: block;
}

/* Stagger animation */
@keyframes texFadeUp {
    to { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   DISCLAIMER
   ============================================================ */
.panel-disclaimer {
    padding: 12px var(--panel-pad) 16px;
    font-size: 11px;
    color: var(--text-secondary);
    line-height: 1.5;
    border-top: 1px solid #d3d3d3;
    flex-shrink: 0;
    text-align: justify;
}

/* ============================================================
   WALK / ORBIT TOGGLE — centred over canvas, not full page
   ============================================================ */
.camera-toggle {
    position: fixed;
    bottom: 28px;
    /* Centre over the canvas portion, not the full viewport */
    left: calc(50% - var(--panel-width) / 2);
    transform: translateX(-50%);
    z-index: 9999;
    display: flex;
    align-items: center;
    background: rgba(10,10,10,0.92);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 100px;
    padding: 5px;
    backdrop-filter: blur(20px);
    box-shadow: 0 8px 32px rgba(0,0,0,0.6), 0 1px 0 rgba(255,255,255,0.04) inset;
}
.toggle-btn {
    position: relative;
    display: flex; align-items: center; gap: 8px;
    padding: 10px 22px;
    border: none; background: transparent;
    color: rgba(255,255,255,0.35);
    font-family: 'DM Mono', monospace;
    font-size: 11px; font-weight: 500;
    letter-spacing: 0.12em; text-transform: uppercase;
    cursor: pointer; border-radius: 100px;
    transition: color 0.25s ease;
    white-space: nowrap; z-index: 1; user-select: none;
}
.toggle-btn svg { width: 14px; height: 14px; opacity: 0.5; transition: opacity 0.25s; flex-shrink: 0; }
.toggle-btn.active { color: #fff; }
.toggle-btn.active svg { opacity: 1; }
.toggle-pill {
    position: absolute; top: 5px; left: 5px;
    height: calc(100% - 10px);
    background: rgba(255,255,255,0.1);
    border-radius: 100px; border: 1px solid rgba(255,255,255,0.12);
    transition: transform 0.3s cubic-bezier(0.4,0,0.2,1), width 0.3s cubic-bezier(0.4,0,0.2,1);
    pointer-events: none;
}
.mode-dot {
    width: 6px; height: 6px; border-radius: 50%;
    background: rgba(255,255,255,0.3); flex-shrink: 0;
    transition: background 0.25s, box-shadow 0.25s;
}
.toggle-btn.active .mode-dot  { background: #fff; box-shadow: 0 0 8px rgba(255,255,255,0.6); }
#btn-walk.active  .mode-dot   { background: #7ee8a2; box-shadow: 0 0 8px rgba(126,232,162,0.7); }
#btn-orbit.active .mode-dot   { background: #7eb8e8; box-shadow: 0 0 8px rgba(126,184,232,0.7); }
.toggle-divider { width: 1px; height: 16px; background: rgba(255,255,255,0.08); flex-shrink: 0; }

@media (hover: none) and (pointer: coarse) { .camera-toggle { display: none; } }
body.is-touch-device .camera-toggle { display: none; }

/* ============================================================
   MODALS
   ============================================================ */
#qrModal {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.5);
    display: none; align-items: center; justify-content: center; z-index: 9999;
}
.modal-content { background:#fff; padding:20px; border-radius:10px; text-align:center; max-width:80%; }
#qrCode { margin:20px auto; display:flex; justify-content:center; }
.close-btn    { margin-top:10px; padding:8px 15px; background:#fff; color:#000; border-radius:5px; cursor:pointer; border:1px solid #000; font-family:var(--font-family); }
.generate-btn { margin-top:10px; padding:8px 15px; background:#000; color:#fff; border:none; border-radius:5px; cursor:pointer; font-family:var(--font-family); }

#unidm-tag-panel {
    position:fixed; top:10px; left:10px;
    background:#fff9e2; border:1px solid #ddd; border-radius:10px;
    padding:8px 16px; font-size:22px; z-index:1000;
    box-shadow:1px 2px 8px rgba(128,128,128,0.13); display:none;
}
#unidmcp-message-panel {
    position:fixed; top:60px; left:10px;
    background:#e2f9ff; border:1px solid #0088cc; border-radius:10px;
    padding:8px 16px; font-size:18px; z-index:1000; max-width:300px; display:none;
}

/* ============================================================
   MOBILE  ≤ 768px
   FIX #5: panel always visible, stacked layout
   ============================================================ */
@media only screen and (max-width: 768px) {
    body { overflow: auto; }
    .containerMAIN {
        display: flex;
        flex-direction: column;
        height: auto;
        min-height: 100vh;
        width: 100vw;
    }
    .canvas-area {
        height: 55vh;
        width: 100%;
        flex-shrink: 0;
    }
    .right-panel {
        width: 100% !important;
        height: auto;
        flex: 1;
        border-left: none;
        border-top: 1px solid #e0e0e0;
        min-height: 45vh;
    }
    .wrapIcons {
        flex-direction: row !important;
        top: auto !important;
        bottom: 10px !important;
        left: 10px !important;
        right: auto !important;
        transform: none !important;
    }
    .down3D-options { flex-direction: row !important; }
    .camera-toggle  { bottom: 10px; left: 50%; transform: translateX(-50%); }
    .icoF.downPDF   { display: none; }
    .langWrap       { top: 10px !important; right: 10px !important; }
    .canvas-logo img { width: 80px; }
    .canvas-fullscreen { display: none; }
    .cat-pills-wrap { grid-template-columns: 1fr 1fr; }
    .filter-dropdowns { grid-template-columns: 1fr 1fr; }
}


/* ============================================================
   MOBILE BOTTOM SHEET  (≤ 768px)
   ============================================================ */
@media only screen and (max-width: 768px) {

    /* Canvas always fills the full screen */
    .containerMAIN {
        display: block !important;
        height: 100vh;
        width: 100vw;
        overflow: hidden;
    }
    .canvas-area {
        position: fixed !important;
        inset: 0 !important;
        height: 100vh !important;
        width: 100vw !important;
        z-index: 0;
    }

    /* Panel sheet — NO overflow:hidden, let content breathe */
    .right-panel {
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        height: 55vh !important;        /* fixed height so transform works */
        max-height: 55vh !important;
        border-left: none !important;
        border-top: 1px solid #e0e0e0;
        border-radius: 16px 16px 0 0;
        box-shadow: 0 -4px 24px rgba(0,0,0,0.13);
        z-index: 500;
        background: var(--panel-bg);
        display: flex !important;
        flex-direction: column;
        transform: translateY(calc(100% - 52px));
        transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
        overflow: hidden;               /* clip the rounded corners only */
    }

    /* When open: slide up to show 55vh */
    .right-panel.sheet-open {
        transform: translateY(0);
    }

    /* Tab bar — fixed height, never scrolls */
    .tab-bar {
        flex-shrink: 0;
        height: 52px;
        padding-right: 4px !important;
        border-radius: 16px 16px 0 0;
        padding-top: 10px;
    }
    /* Visual drag handle above tabs */
    .tab-bar::before {
        /*content: '';*/ /* temp off */
        display: block;
        width: 36px;
        height: 4px;
        background: #ddd;
        border-radius: 4px;
        margin: 0 auto 8px;
    }

    .overMaterials label.col[style*="display: none"] {
        visibility: hidden !important;
        opacity: 0 !important;
    }


    .tab-pane {
        flex: 1;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch;
        /* Remove internal scroll from children */
    }
    .tab-pane.active {
        display: flex;
        flex-direction: column;
    }

    /* tex-sections-wrap — NO internal scroll on mobile, parent scrolls */
    .tex-sections-wrap {
        overflow: visible !important;
        flex: none !important;
    }

    /* pills + filter area — also flow naturally, no shrink */
    .cat-pills-wrap,
    .tex-filter-area,
    .panel-disclaimer {
        flex-shrink: 0;
    }

    /* Content area — scrollable */
    .tab-pane.active {
        overflow-y: auto;
        max-height: calc(55vh - 52px); /* 55vh minus tab bar height */
    }

    /* Icon strip — horizontal, bottom-left of canvas, above the sheet tab bar */
    .wrapIcons {
        position: fixed !important;
        bottom: 62px !important;  /* just above the visible tab bar strip */
        left: 12px !important;
        right: auto !important;
        top: auto !important;
        transform: none !important;
        flex-direction: row !important;
        z-index: 600;
    }
    .down3D-options { flex-direction: row !important; }

    /* Walk/orbit toggle — also lifts above sheet */
    .camera-toggle {
        bottom: 62px !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        z-index: 600;
    }

    /* Lang switcher — top right, always on canvas */
    .langWrap {
        top: 14px !important;
        right: 14px !important;
        z-index: 600;
    }

    .icoF.downPDF { display: none; }
    .canvas-fullscreen { display: none; }
    .cat-pills-wrap { grid-template-columns: 1fr 1fr; }
    .filter-dropdowns { grid-template-columns: 1fr 1fr; }
}

.canvas-model-title {
    font-size: 17px;
    color: rgb(0 0 0 / 75%);
    margin-top: 3px;
    letter-spacing: 0.04em;
    /* text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4); */
    padding: var(--panel-pad) var(--panel-pad) 10px;
    /* font-size: 17px !important; */
    font-weight: 700;
}
.overMaterials label.col .tex-name {
    font-size: 9px;
    color: var(--text-secondary);
    text-align: center;
    padding: 3px 2px 4px;
    background: transparent;    /* ← no white bg needed */
    line-height: 1.2;
    word-break: break-word;
    pointer-events: none;       /* ← point 3: name not clickable */
    user-select: none;
}

.icoF-3d-wrap {
    position: relative;
}

.down3D-options {
    display: none;
    position: absolute;
    right: 56px;
    top: 0;
    flex-direction: column;
    gap: 8px;
    align-items: center;
    z-index: 300;
}
@media only screen and (max-width: 768px) {
    .down3D-options {
        position: absolute;
        right: auto !important;
        left: 0 !important;
        top: auto !important;
        bottom: 56px !important;  /* above the 3D button */
        flex-direction: column !important;
        gap: 8px;
    }
}


/* ── OVERVIEW TAB ── */
.overview-wrap {
    flex: 1;
    overflow-y: auto;
    padding: var(--panel-pad);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.overview-title {
    font-size: 15px;
    color: var(--text-primary);
    font-weight: 600;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.overview-selections {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.overview-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
    border-bottom: 1px solid #d3d3d3;
}

.overview-part {
    font-size: 11px;
    color: var(--text-secondary);
    flex: 0 0 40%;
}

.overview-value {
    font-size: 12px;
    color: var(--text-primary);
    font-weight: 500;
    text-align: right;
    flex: 1;
}

.overview-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}

.overview-part {
    font-size: 11px;
    color: var(--text-secondary);
    flex: 0 0 40%;
    line-height: 1.3;
}

.overview-value {
    font-size: 12px;
    color: var(--text-primary);
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex: 1;
    text-align: right;
}

.overview-thumb {
    width: 100px;
    height: 50px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid #eee;
    flex-shrink: 0;
}

.overview-thumb-placeholder {
    width: 36px;
    height: 36px;
    border-radius: 4px;
    background: #f0f0f0;
    flex-shrink: 0;
}

/* ── SPACE TAB ── */
.space-grid {
    padding: var(--panel-pad);
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow-y: auto;
    flex: 1;
}

.space-card {
    cursor: pointer;
    border-radius: 10px;
    overflow: hidden;
    border: 2px solid transparent;
    transition: border-color 0.2s, transform 0.2s;
}

.space-card:hover {
    border-color: var(--text-primary);
}

.space-card.active {
    border-color: var(--text-primary);
}

.space-img-wrap {
    position: relative;
    overflow: hidden;
    border-radius: 8px 8px 0 0;
}

.space-img-wrap img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.space-card:hover .space-img-wrap img {
    transform: scale(1.05); /* ← zoom on hover */
}

.space-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s;
}

.space-overlay span {
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.05em;
    border: 1px solid rgba(255,255,255,0.6);
    padding: 6px 18px;
    border-radius: 20px;
}

.space-card:hover .space-overlay {
    opacity: 1;
}

.space-card.active .space-overlay {
    opacity: 1;
    background: rgba(0,0,0,0.2);
}

.space-label {
    padding: 8px 12px 10px;
    font-size: 12px;
    color: var(--text-primary);
    background: #f8f8f8;
    border-radius: 0 0 8px 8px;
    font-weight: 500;
}

.space-card.active .space-label {
    background: var(--text-primary);
    color: #fff;
}
/* Overlay — only on hover, never on active */
.space-card:hover:not(.active) .space-overlay {
    opacity: 1;
}

/* Active card — no overlay ever */
.space-card.active .space-overlay {
    display: none;
}


/* ── OVERVIEW SEND ── */
.overview-send-wrap {
    padding: 16px 0 8px;
    margin-top: auto;
}

.overview-send-btn {
    width: 100%;
    padding: 13px 20px;
    background: var(--text-primary);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-family: var(--font-family);
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.03em;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background 0.2s, transform 0.15s;
}

.overview-send-btn:hover {
    background: #333;
    transform: translateY(-1px);
}

.overview-send-btn:active {
    transform: translateY(0);
}

.overview-send-btn i {
    font-size: 13px;
    opacity: 0.85;
}



/* Ruler button — same style as fullscreen, positioned to its left */
.canvas-ruler {
    position: absolute;
    top: 14px;
    right: 58px; /* 14px (fullscreen right) + 36px (fullscreen width) + 8px gap */
    z-index: 200;
    width: 36px;
    height: 36px;
    background: rgba(10,10,10,0.6);
    color: rgba(255,255,255,0.7);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.1);
    transition: background 0.2s, color 0.2s, box-shadow 0.2s;
    font-size: 13px;
}
.canvas-ruler:hover {
    background: rgba(255,255,255,0.9);
    color: #111;
}
.canvas-ruler.active {
    background: rgb(255 255 255 / 35%);
    color: #84dba4;
    border-color: rgb(53 167 116 / 79%);
    box-shadow: 0 0 12px rgba(255, 255, 255, 0.1);
}

/* Instruction bar — bottom of canvas, above camera toggle */
.ruler-instructions {
    position: fixed;
    bottom: 80px; /* above the camera-toggle */
    left: calc(50% - var(--panel-width, 0px) / 2);
    transform: translateX(-50%);
    z-index: 9998;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
}
.ruler-instructions.visible {
    opacity: 1;
    pointer-events: auto;
}

.ruler-instructions-inner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 18px;
    background: rgba(10,10,10,0.88);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 100px;
    backdrop-filter: blur(20px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
    font-family: 'DM Mono', monospace;
    font-size: 11px;
    letter-spacing: 0.05em;
    white-space: nowrap;
    user-select: none;
}

.ruler-step {
    color: rgba(255,255,255,0.9);
    font-weight: 500;
}

.ruler-hint {
    color: rgba(255,255,255,0.35);
}

.ruler-divider {
    color: rgba(255,255,255,0.1);
    font-size: 10px;
}

.ruler-close {
    cursor: pointer;
    transition: color 0.2s;
    display: flex;
    align-items: center;
}
.ruler-close:hover {
    color: rgba(255,255,255,0.8);
}

/* Hide on touch devices */
@media (hover: none) and (pointer: coarse) {
    .ruler-instructions { display: none; }
}
body.is-touch-device .ruler-instructions { display: none; }
@media only screen and (max-width: 768px) {
    .canvas-ruler { display: none !important; }
}