/* ==========================================
   GLOBAL
========================================== */

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

html{
    scroll-behavior:smooth;
}

body{

    font-family:'Inter',sans-serif;

    background:#fafafa;

    color:#111;

    overflow-x:hidden;

}


/* ==========================================
NAVBAR
========================================== */

.navbar{

    width:100%;

    height:80px;

    display:flex;

    justify-content:space-between;

    align-items:center;

    padding:0 60px;

    position:fixed;

    top:0;

    z-index:1000;

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

    backdrop-filter:blur(20px);

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

    border-bottom:1px solid rgba(0,0,0,.06);

}

.logo{

    font-size:24px;

    font-weight:700;

    letter-spacing:-1px;

}

nav{

    display:flex;

    gap:45px;

}

nav a{

    text-decoration:none;

    color:#444;

    transition:.25s;

    font-weight:500;

}

nav a:hover{

    color:#000;

}

.loginButton{

    border:none;

    background:#111;

    color:white;

    padding:13px 24px;

    border-radius:999px;

    cursor:pointer;

    transition:.3s;

    font-size:15px;

}

.loginButton:hover{

    transform:translateY(-2px);

    background:#000;

}

/* ==========================================
ACCOUNT MENU (dropdown under the name button)
========================================== */

.userMenuWrap{

    position:relative;

}

.userMenu{

    position:absolute;

    top:calc(100% + 10px);

    right:0;

    min-width:180px;

    background:#fff;

    border:1px solid rgba(0,0,0,.08);

    border-radius:16px;

    box-shadow:0 14px 40px rgba(0,0,0,.16);

    padding:8px;

    display:flex;

    flex-direction:column;

    gap:2px;

    z-index:1001;

    animation:popup .18s ease;

}

.userMenuItem{

    border:none;

    background:none;

    text-align:left;

    padding:12px 14px;

    border-radius:10px;

    cursor:pointer;

    font-size:15px;

    color:#222;

    transition:background .15s;

}

.userMenuItem:hover{

    background:#f2f2f2;

}

#menuLogout{

    color:#c0362c;

}

/* ==========================================
"MY SPOTS" PINS (markers floating over owned tiles)
========================================== */

.spotPins{

    position:absolute;

    inset:0;

    pointer-events:none;

    z-index:6;

}

.spotPin{

    position:absolute;

    top:0;

    left:0;

    width:20px;

    height:20px;

    padding:0;

    border:3px solid #fff;

    border-radius:50%;

    background:#111;

    box-shadow:0 2px 8px rgba(0,0,0,.4);

    cursor:pointer;

    pointer-events:auto;

}

/* A soft pulsing halo so a pin is easy to spot even when the cube is zoomed
   right out and the tile itself is only a few pixels. */
.spotPin::after{

    content:"";

    position:absolute;

    inset:-6px;

    border-radius:50%;

    border:2px solid rgba(17,17,17,.5);

    animation:spotPinPulse 1.8s ease-out infinite;

}

@keyframes spotPinPulse{

    0%{ transform:scale(.6); opacity:.9; }

    100%{ transform:scale(1.8); opacity:0; }

}



/* ==========================================
HERO
========================================== */

.hero{

    padding-top:170px;

    max-width:900px;

    margin:auto;

    text-align:center;

}

.hero h1{

    font-size:72px;

    line-height:1.05;

    letter-spacing:-3px;

    margin-bottom:30px;

}

.hero p{

    font-size:21px;

    color:#666;

    line-height:1.8;

    max-width:760px;

    margin:auto;

}

.heroButtons{

    display:flex;

    justify-content:center;

    gap:20px;

    margin-top:50px;

}

.heroButtons button{

    cursor:pointer;

    border:none;

    padding:18px 38px;

    border-radius:999px;

    font-size:16px;

    transition:.3s;

}

#exploreButton{

    background:#111;

    color:white;

}

.heroButtons button:hover{

    transform:translateY(-4px);

}



/* ==========================================
STATS
========================================== */

.stats{

    width:1200px;

    max-width:95%;

    margin:100px auto;

    display:grid;

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

    gap:30px;

}

.card{

    background:white;

    border-radius:24px;

    padding:40px;

    box-shadow:0 12px 35px rgba(0,0,0,.05);

    text-align:center;

}

.card h2{

    font-size:48px;

    margin-bottom:10px;

}

.card span{

    color:#777;

}



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

.canvasWrapper{

    width:95%;

    height:900px;

    margin:0 auto 150px;

    background:white;

    border-radius:30px;

    overflow:hidden;

    position:relative;

    box-shadow:0 20px 60px rgba(0,0,0,.08);

}

.toolbar{

    position:absolute;

    top:20px;

    left:50%;

    transform:translateX(-50%);

    display:flex;

    flex-wrap:wrap;

    justify-content:center;

    align-items:center;

    gap:10px;

    max-width:calc(100% - 32px);

    z-index:50;

}

.toolGroup{

    display:flex;

    gap:6px;

    padding:6px;

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

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

    backdrop-filter:blur(12px);

    border-radius:16px;

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

}

.toolbar button{

    min-width:44px;

    height:44px;

    border:none;

    border-radius:11px;

    cursor:pointer;

    background:white;

    color:#111;

    font-size:17px;

    box-shadow:0 2px 6px rgba(0,0,0,.06);

    transition:background .15s, color .15s;

}

.toolbar .faceButton{

    font-size:15px;

    font-weight:600;

}

.toolbar .modeButton{

    padding:0 16px;

    font-size:14px;

    font-weight:600;

}

.toolbar button:hover{

    background:#111;

    color:white;

}

.toolbar .modeButton.active{

    background:#111;

    color:white;

}

canvas{

    display:block;

    width:100%;

    height:100%;

    cursor:grab;

    background:#fafafa;

}

.canvasLoading{

    position:absolute;

    inset:0;

    z-index:60;

    display:flex;

    flex-direction:column;

    align-items:center;

    justify-content:center;

    gap:18px;

    background:#fafafa;

    color:#888;

    font-size:15px;

    opacity:1;

    transition:opacity .4s ease;

}

/* A dedicated class, not the shared .hidden — that one sets
   display:none immediately, which would skip the fade entirely.
   JS removes the element outright once the transition finishes. */
.canvasLoading.fadeOut{

    opacity:0;

    pointer-events:none;

}

.spinner{

    width:34px;

    height:34px;

    border-radius:50%;

    border:3px solid #e5e5e5;

    border-top-color:#111;

    animation:spin .8s linear infinite;

}

@keyframes spin{

    to{ transform:rotate(360deg); }

}

.onboardingHint{

    position:absolute;

    bottom:25px;

    left:50%;

    transform:translateX(-50%);

    max-width:90%;

    background:rgba(17,17,17,.85);

    color:white;

    padding:14px 46px 14px 20px;

    border-radius:16px;

    font-size:13px;

    z-index:55;

    box-shadow:0 12px 30px rgba(0,0,0,.2);

}

.onboardingHint p{

    margin:0;

}

.onboardingHint .closePanelButton{

    position:absolute;

    top:8px;

    right:8px;

    width:26px;

    height:26px;

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

    color:white;

    font-size:15px;

}

.onboardingHint .closePanelButton:hover{

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

}

.fullscreenButton{

    position:absolute;

    bottom:25px;

    right:25px;

    width:52px;

    height:52px;

    border:none;

    border-radius:50%;

    cursor:pointer;

    background:white;

    color:#111;

    display:flex;

    align-items:center;

    justify-content:center;

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

    z-index:50;

    transition:.3s;

}

.fullscreenButton:hover{

    background:#111;

    color:white;

}

.canvasWrapper.fullscreenActive{

    position:fixed;

    inset:0;

    width:100vw;

    height:100vh;

    margin:0;

    border-radius:0;

    box-shadow:none;

    z-index:2000;

}

body.noScroll{

    overflow:hidden;

}



/* ==========================================
HOW IT WORKS
========================================== */

.howItWorks{

    width:1200px;

    max-width:92%;

    margin:auto;

    text-align:center;

    padding-bottom:120px;

}

.howItWorks h2{

    font-size:48px;

    margin-bottom:70px;

}

.steps{

    display:grid;

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

    gap:40px;

}

.step{

    background:white;

    border-radius:28px;

    padding:45px;

    box-shadow:0 15px 35px rgba(0,0,0,.05);

}

.number{

    width:60px;

    height:60px;

    margin:auto;

    border-radius:50%;

    background:#111;

    color:white;

    display:flex;

    justify-content:center;

    align-items:center;

    font-size:24px;

    margin-bottom:25px;

}

.step h3{

    margin-bottom:20px;

    font-size:24px;

}

.step p{

    color:#666;

    line-height:1.7;

}

/* The slide-to-see-more arrow only exists in the mobile carousel; on desktop
   the four steps sit side by side, so it stays hidden. */
.carouselHint{

    display:none;

}



/* ==========================================
FOOTER
========================================== */

footer{

    border-top:1px solid #ececec;

    padding:45px;

    text-align:center;

    color:#888;

}

.navHomeLink{

    color:inherit;

    text-decoration:none;

}

.footerLinks{

    margin-top:14px;

    display:flex;

    justify-content:center;

    gap:24px;

    flex-wrap:wrap;

}

.footerLinks a{

    color:#888;

    text-decoration:none;

    font-size:14px;

}

.footerLinks a:hover{

    color:#111;

    text-decoration:underline;

}



/* ==========================================
LEGAL PAGES (privacy / terms / community rules)
========================================== */

.legalPage{

    max-width:760px;

    margin:0 auto;

    padding:170px 25px 120px;

}

.legalPage .backLink{

    display:inline-block;

    margin-bottom:30px;

    color:#666;

    text-decoration:none;

    font-size:14px;

}

.legalPage .backLink:hover{

    color:#111;

}

.legalPage h1{

    font-size:44px;

    letter-spacing:-1px;

    margin-bottom:10px;

}

.legalPage .updatedDate{

    color:#999;

    margin-bottom:50px;

    font-size:14px;

}

.legalPage h2{

    font-size:23px;

    margin-top:46px;

    margin-bottom:16px;

}

.legalPage p, .legalPage li{

    color:#444;

    line-height:1.8;

    font-size:16px;

}

.legalPage p{

    margin-bottom:14px;

}

.legalPage ul{

    padding-left:22px;

    margin-bottom:20px;

}

.legalPage a{

    color:#111;

}

.legalCard{

    background:white;

    border-radius:30px;

    padding:50px;

    box-shadow:0 20px 60px rgba(0,0,0,.08);

}

.legalCard h2:first-child{

    margin-top:0;

}



/* ==========================================
ADMIN DASHBOARD
========================================== */

.adminPage{

    max-width:1000px;

    margin:0 auto;

    padding:170px 25px 120px;

}

.adminPage h1{

    font-size:44px;

    letter-spacing:-1px;

    margin-bottom:40px;

}

.adminGate{

    background:white;

    border-radius:20px;

    padding:40px;

    text-align:center;

    box-shadow:0 12px 35px rgba(0,0,0,.05);

}

.adminSection{

    margin-bottom:60px;

}

.adminSection h2{

    font-size:22px;

    margin-bottom:20px;

}

.adminEmpty{

    color:#999;

    font-style:italic;

}

.adminSearch{

    width:100%;

    padding:14px 16px;

    border-radius:12px;

    border:1px solid #ddd;

    font-size:15px;

    margin-bottom:20px;

}

.adminCard{

    background:white;

    border-radius:16px;

    padding:20px 24px;

    margin-bottom:14px;

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

    display:flex;

    justify-content:space-between;

    align-items:center;

    gap:20px;

    flex-wrap:wrap;

}

.adminCardInfo{

    flex:1;

    min-width:220px;

}

.adminCardInfo strong{

    display:block;

    margin-bottom:4px;

}

.adminCardInfo span{

    display:block;

    margin-bottom:2px;

    color:#888;

    font-size:13px;

}

.adminCardActions{

    display:flex;

    gap:8px;

    flex-wrap:wrap;

}

.adminButton{

    padding:9px 16px;

    border:none;

    border-radius:10px;

    background:#f0f0f0;

    cursor:pointer;

    font-size:13px;

    font-weight:600;

    transition:.2s;

}

.adminButton:hover{

    background:#111;

    color:white;

}

.adminButton.danger{

    background:#fbeaea;

    color:#c0392b;

}

.adminButton.danger:hover{

    background:#c0392b;

    color:white;

}

.adminThumbnail{

    width:60px;

    height:60px;

    object-fit:cover;

    border-radius:10px;

    flex-shrink:0;

    background:#eee;

}

.adminThumbnail.hasImage{

    cursor:pointer;

}

.imageLightbox{

    position:fixed;

    inset:0;

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

    display:flex;

    align-items:center;

    justify-content:center;

    z-index:3000;

}

.imageLightbox.hidden{

    display:none;

}

.imageLightbox img{

    max-width:90vw;

    max-height:90vh;

    border-radius:12px;

}

.imageLightbox .closePanelButton{

    position:fixed;

    top:20px;

    right:20px;

    background:white;

}



/* ==========================================
MODAL
========================================== */

.modal{

    position:fixed;

    inset:0;

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

    display:flex;

    justify-content:center;

    align-items:center;

    padding:20px;

    z-index:9999;

    overscroll-behavior:contain;

}

.hidden{

    display:none;

}

/* While any modal is open, freeze the page underneath so a scroll gesture
   moves the modal's own content, never the background. */
body:has(.modal:not(.hidden)){

    overflow:hidden;

}

.modalContent{

    width:480px;

    background:white;

    border-radius:30px;

    padding:45px;

    animation:popup .25s ease;

    /* Cap the card to the viewport and let it scroll inside itself, so a tall
       upload/edit modal scrolls its own content instead of the page behind it
       (which used to move while the modal stayed put). */
    max-height:calc(100dvh - 40px);

    overflow-y:auto;

    overscroll-behavior:contain;

    -webkit-overflow-scrolling:touch;

    /* Slim, fully-rounded scrollbar so the scroll track reads as a soft pill
       down the right side rather than a hard-edged system bar. */
    scrollbar-width:thin;                    /* Firefox */

    scrollbar-color:#c4c4c4 transparent;     /* Firefox: thumb, track */

}

.modalContent::-webkit-scrollbar{

    width:8px;

}

.modalContent::-webkit-scrollbar-track{

    background:transparent;

    margin:16px 0;                           /* keep the thumb clear of the rounded corners */

}

.modalContent::-webkit-scrollbar-thumb{

    background:#c4c4c4;

    border-radius:999px;

}

.modalContent::-webkit-scrollbar-thumb:hover{

    background:#a8a8a8;

}

.modalContent h2{

    margin-bottom:30px;

}

.modalContent p{

    margin-bottom:20px;

    font-size:18px;

}

.modalContent input{

    width:100%;

    margin-bottom:20px;

    padding:16px;

    border-radius:14px;

    border:1px solid #ddd;

    font-size:16px;

}

.modalContent button{

    width:100%;

    padding:17px;

    border:none;

    border-radius:16px;

    background:#111;

    color:white;

    cursor:pointer;

}



/* ==========================================
SELECTION PANEL
========================================== */

.selectionPanel{

    position:absolute;

    bottom:25px;

    left:25px;

    width:280px;

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

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

    backdrop-filter:blur(20px);

    border-radius:22px;

    padding:24px;

    box-shadow:0 20px 50px rgba(0,0,0,.12);

    z-index:50;

}

.selRow{

    display:flex;

    justify-content:space-between;

    align-items:center;

    padding:8px 0;

    font-size:15px;

}

.selRow.total{

    border-top:1px solid #eee;

    margin-top:6px;

    padding-top:14px;

    font-weight:600;

    font-size:17px;

}

.stepper{

    display:flex;

    align-items:center;

    gap:10px;

}

.stepper button{

    width:30px;

    height:30px;

    border:none;

    border-radius:50%;

    background:#f0f0f0;

    cursor:pointer;

    font-size:16px;

    transition:.2s;

}

.stepper button:hover{

    background:#111;

    color:white;

}

.stepper span{

    width:26px;

    text-align:center;

}

.warning{

    color:#c0392b;

    font-size:13px;

    margin-top:6px;

}

.agreeRow{

    display:flex;

    align-items:flex-start;

    gap:10px;

    margin-top:14px;

    cursor:pointer;

}

.agreeRow input{

    margin-top:3px;

    flex-shrink:0;

}

.agreeRow span{

    font-size:12px;

    line-height:1.6;

    color:#777;

}

.agreeRow a{

    color:#444;

}

.panelButtons{

    display:flex;

    gap:10px;

    margin-top:18px;

}

.panelButtons button{

    flex:1;

    padding:14px;

    border:none;

    border-radius:14px;

    cursor:pointer;

    font-size:15px;

}

#continueButton{

    background:#111;

    color:white;

}

#continueButton:disabled{

    background:#ccc;

    cursor:not-allowed;

}

.ghostButton{

    background:#f0f0f0;

}


/* ==========================================
TILE ACTION PANEL (edit / links)
========================================== */

.tilePanelBackdrop{

    position:absolute;

    inset:0;

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

    display:flex;

    justify-content:center;

    align-items:center;

    z-index:80;

}

.tilePanelBackdrop.hidden{

    display:none;

}

.tileActionPanel{

    position:relative;

    width:340px;

    max-width:85%;

    background:white;

    border-radius:24px;

    padding:40px 30px 30px;

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

    text-align:center;

    animation:popup .2s ease;

}

.closePanelButton{

    position:absolute;

    top:14px;

    right:14px;

    width:36px;

    height:36px;

    border:none;

    border-radius:50%;

    background:#f0f0f0;

    cursor:pointer;

    font-size:20px;

    line-height:1;

    display:flex;

    align-items:center;

    justify-content:center;

    transition:.2s;

}

.closePanelButton:hover{

    background:#111;

    color:white;

}

.tilePanelOwnerName{

    font-size:14px;

    color:#999;

    margin-bottom:18px;

    font-weight:600;

    text-transform:uppercase;

    letter-spacing:.5px;

}

.tilePanelButton{

    display:block;

    width:100%;

    padding:18px;

    margin-bottom:12px;

    border:none;

    border-radius:14px;

    background:#111;

    color:white;

    font-size:16px;

    font-weight:600;

    cursor:pointer;

    transition:.25s;

    overflow-wrap:anywhere;

}

.tilePanelButton:hover{

    transform:translateY(-2px);

}

.tilePanelButton.secondary{

    background:#f0f0f0;

    color:#111;

}

.tilePanelButton:last-child{

    margin-bottom:0;

}

.tilePanelEmpty{

    color:#999;

    font-style:italic;

    padding:10px 0 20px;

}

.tilePanelReportLink{

    display:block;

    width:100%;

    margin-top:14px;

    padding:0;

    border:none;

    background:none;

    color:#bbb;

    font-size:12px;

    cursor:pointer;

    text-decoration:underline;

}

.tilePanelReportLink:hover{

    color:#c0392b;

}



/* ==========================================
MOBILE "OPEN ON A COMPUTER" NOTICE

Hidden everywhere by default; the responsive block at the bottom
switches it on only for small (phone) screens. Sits above the navbar,
canvas, and modals so it's the first thing seen on load.
========================================== */

.mobileNotice{

    display:none;

    position:fixed;

    inset:0;

    z-index:12000;

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

    justify-content:center;

    align-items:center;

    padding:24px;

}

.mobileNotice.dismissed{

    display:none;

}

.mobileNoticeCard{

    position:relative;

    width:100%;

    max-width:340px;

    background:white;

    border-radius:24px;

    padding:42px 26px 30px;

    text-align:center;

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

    animation:popup .2s ease;

}

.mobileNoticeCard p{

    font-size:16px;

    line-height:1.6;

    color:#333;

    margin:0;

}


/* ==========================================
GOOGLE / PAYMENT BUTTONS
========================================== */

.googleButton{

    display:flex;

    justify-content:center;

    align-items:center;

}

.finePrint{

    font-size:12px;

    color:#999;

    margin-top:14px;

    text-align:center;

}

.modalContent input:disabled{

    color:#aaa;

    background:#f7f7f7;

}


/* ==========================================
LINK ROWS / IMAGE PREVIEW (upload modal)
========================================== */

.linkRow{

    display:flex;

    gap:8px;

    align-items:flex-start;

    margin-bottom:12px;

}

.linkFields{

    flex:1;

    min-width:0;

    display:flex;

    flex-direction:column;

    gap:8px;

}

.linkRow input{

    margin-bottom:0;

}

.linkRow .removeLinkButton{

    width:48px;

    border-radius:14px;

    border:1px solid #ddd;

    background:white;

    cursor:pointer;

    font-size:16px;

    flex-shrink:0;

}

.smallButton{

    width:100%;

    margin-bottom:18px;

    padding:13px;

    font-size:14px;

}

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

@keyframes popup{

    from{

        opacity:0;

        transform:scale(.92);

    }

    to{

        opacity:1;

        transform:scale(1);

    }

}



/* ==========================================
RESPONSIVE
========================================== */

@media(max-width:900px){

.hero h1{

    font-size:46px;

}

.stats{

    grid-template-columns:1fr;

}

.navbar{

    padding:0 25px;

}

/* Header: brand name on the left (shown again on mobile — it was hidden), the
   sign-in button stays on the right. */
nav{

    display:flex;

}

nav h1{

    font-size:20px;

    letter-spacing:-1px;

}

/* Explore button: centered and only as wide as its label (column layout used to
   stretch it edge to edge). */
.heroButtons{

    flex-direction:column;

    align-items:center;

}

/* Canvas: narrower than the viewport so there are gutters on either side of the
   cube to scroll the page past it, instead of every touch grabbing the cube. */
.canvasWrapper{

    height:600px;

    width:80%;

}

/* Fullscreen (the outward-arrows) button moves to the top-left corner on phones:
   at the bottom-right it collided with the phone's browser bar and the selection
   sheet. The top-left is clear (zoom sits centered, the A–F row is lower). */
.fullscreenButton{

    top:14px;

    left:14px;

    bottom:auto;

    right:auto;

}

/* How it works: a swipeable horizontal carousel instead of an oversized stack.
   Starts on step 1; the subtle arrow hints there's more to the right. */
.stepsWrap{

    position:relative;

}

.steps{

    display:flex;

    grid-template-columns:none;

    overflow-x:auto;

    scroll-snap-type:x mandatory;

    gap:16px;

    padding:4px 4px 12px;

    -webkit-overflow-scrolling:touch;

    scrollbar-width:none;

}

.steps::-webkit-scrollbar{

    display:none;

}

.step{

    flex:0 0 82%;

    scroll-snap-align:center;

    padding:36px 30px;

}

.carouselHint{

    display:flex;

    position:absolute;

    top:50%;

    right:2px;

    color:#111;

    opacity:.3;

    pointer-events:none;

    z-index:5;

    animation:carouselNudge 1.8s ease-in-out infinite;

}

@keyframes carouselNudge{

    0%,100%{ transform:translate(0,-50%); }

    50%{ transform:translate(6px,-50%); }

}

.legalCard{

    padding:30px;

}

/* Suggest desktop only on phones. .dismissed (higher specificity) still wins,
   so closing it keeps it closed. */
.mobileNotice{

    display:flex;

}

/* Selection panel: a compact bottom sheet spanning the canvas width instead of
   a 280px block that buried the cube. Keeps the area you're selecting visible
   above it, and Cancel always in reach. (The cube also stays rotatable during a
   selection on touch — see appm.js — so you can turn it to see your area.) */
.selectionPanel{

    position:fixed;

    left:8px;

    right:8px;

    bottom:8px;

    width:auto;

    padding:14px 16px 16px;

    border-radius:18px;

    max-height:80vh;

    overflow-y:auto;

}

/* The flex column (used to move the buttons to the top) must NOT override the
   .hidden class that keeps the panel closed until a double-tap opens it — so it
   only applies while the panel is actually shown. Otherwise the panel stayed
   visible permanently and Cancel couldn't hide it. */
.selectionPanel:not(.hidden){

    display:flex;

    flex-direction:column;

}

/* Left/Right/Up/Down in a 2x2 grid rather than four stacked rows, so the sheet
   stays short and the cube keeps most of the screen. */
.selGrid{

    display:grid;

    grid-template-columns:1fr 1fr;

    column-gap:8px;

}

.selGrid .selRow{

    padding:6px 0;

    font-size:13px;

}

.selectionPanel .selRow.total{

    font-size:15px;

    padding-top:12px;

}

.selectionPanel .stepper{

    gap:4px;

}

.selectionPanel .stepper button{

    width:30px;

    height:30px;

    font-size:16px;

}

.selectionPanel .stepper span{

    width:18px;

}

.selectionPanel .agreeRow{

    margin-top:10px;

}

.selectionPanel .agreeRow span{

    font-size:11px;

    line-height:1.5;

}

.selectionPanel .panelButtons{

    order:-1;

    margin-top:0;

    margin-bottom:14px;

}

.selectionPanel .panelButtons button{

    padding:13px;

    font-size:15px;

}

}

/* ===== interactive image cropper (upload modal) ===== */
.cropStage{
    margin:10px 0 4px;
}
.cropFrame{
    position:relative;
    margin:0 auto;
    overflow:hidden;
    border-radius:12px;
    background:#ffffff;
    cursor:grab;
    touch-action:none;             /* we own the drag gesture */
    box-shadow:inset 0 0 0 1px rgba(0,0,0,.08);
}
.cropFrame:active{ cursor:grabbing; }
.cropImage{
    position:absolute;
    top:0;
    left:0;
    max-width:none;                /* JS sizes it in px; don't let a global img rule shrink it */
    user-select:none;
    -webkit-user-drag:none;
    pointer-events:none;           /* the frame handles dragging */
}
.cropZoomRow{
    display:flex;
    align-items:center;
    gap:10px;
    max-width:300px;
    margin:14px auto 0;
    font-size:13px;
    color:#555;
}
.cropZoomRow input[type=range]{ flex:1; }
.cropHint{
    text-align:center;
    font-size:12px;
    color:#888;
    line-height:1.5;
    margin:10px auto 0;
    max-width:320px;
}

/* ===== 404 page ===== */
.notFoundPage{
    max-width:600px;
    margin:0 auto;
    padding:140px 24px;
    text-align:center;
}
.notFoundPage h1{
    font-size:96px;
    margin:0 0 8px;
    letter-spacing:2px;
}
.notFoundPage p{
    font-size:18px;
    color:#666;
    margin:0 0 30px;
}
.notFoundLink{
    display:inline-block;
    padding:14px 28px;
    border-radius:14px;
    background:#111;
    color:white;
    font-weight:600;
    text-decoration:none;
}
.notFoundLink:hover{ opacity:.85; }

/* ===== admin menu + views ===== */
.adminMenu{
    display:flex;
    flex-wrap:wrap;
    justify-content:center;
    gap:8px;
    margin:0 auto 40px;
    padding:8px;
    background:#f2f2f4;
    border-radius:16px;
    position:sticky;
    top:12px;
    z-index:20;
}
.adminMenu button{
    border:none;
    background:transparent;
    padding:10px 18px;
    border-radius:11px;
    font-size:14px;
    font-weight:600;
    color:#555;
    cursor:pointer;
    transition:background .15s, color .15s;
}
.adminMenu button:hover{ color:#111; }
.adminMenu button.active{ background:#111; color:white; }

.adminView{ animation:fadeIn .2s ease; }

/* overview stat tiles */
.overviewStats{
    display:grid;
    grid-template-columns:repeat(4, 1fr);
    gap:16px;
    margin-bottom:28px;
}
.statTile{
    background:white;
    border-radius:16px;
    padding:22px;
    text-align:center;
    box-shadow:0 8px 25px rgba(0,0,0,.05);
}
.statTile strong{
    display:block;
    font-size:28px;
    margin-bottom:6px;
}
.statTile span{ color:#888; font-size:13px; }

/* charts */
.chartCard{
    background:white;
    border-radius:16px;
    padding:24px;
    margin-bottom:20px;
    box-shadow:0 8px 25px rgba(0,0,0,.05);
}
.chartCard h3{ margin:0 0 16px; font-size:16px; }
.chartBox{ width:100%; }
.chartEmpty{ color:#999; font-size:14px; text-align:center; padding:40px 0; }

/* filters row */
.adminFilters{
    display:flex;
    flex-wrap:wrap;
    gap:12px;
    margin-bottom:18px;
}
.adminFilters .adminSearch{ margin:0; flex:1; min-width:200px; }
.adminSelect{
    padding:12px 14px;
    border:1px solid #ddd;
    border-radius:12px;
    background:white;
    font-size:14px;
    cursor:pointer;
}

@media(max-width:700px){
    .overviewStats{ grid-template-columns:repeat(2, 1fr); }
}

/* per-space analytics in the Spaces list */
.adminStat{
    color:#111 !important;
    font-weight:600;
    font-size:13px;
}
.adminInlineButton{
    align-self:flex-start;
    margin-top:6px;
    border:none;
    background:#f0f0f0;
    color:#333;
    padding:5px 12px;
    border-radius:8px;
    font-size:12px;
    cursor:pointer;
}
.adminInlineButton:hover{ background:#e4e4e4; }
.ownerEmail{
    display:inline-block;
    margin-top:6px;
    font-size:13px;
    color:#111;
    user-select:all;
}

/* live "online now" banner */
.onlineNow{
    display:flex;
    align-items:center;
    gap:10px;
    background:white;
    border-radius:16px;
    padding:16px 22px;
    margin-bottom:20px;
    font-size:15px;
    color:#555;
    box-shadow:0 8px 25px rgba(0,0,0,.05);
}
.onlineNow strong{ font-size:22px; color:#111; }
.onlineDot{
    width:10px;
    height:10px;
    border-radius:50%;
    background:#22c55e;
    box-shadow:0 0 0 0 rgba(34,197,94,.6);
    animation:onlinePulse 2s infinite;
}
@keyframes onlinePulse{
    0%{ box-shadow:0 0 0 0 rgba(34,197,94,.5); }
    70%{ box-shadow:0 0 0 8px rgba(34,197,94,0); }
    100%{ box-shadow:0 0 0 0 rgba(34,197,94,0); }
}