body { 
    margin: 0; 
    overflow: hidden; 
    background: #1a1a1a; 
    color: white; 
    font-family: sans-serif; 
    display: flex; 
    height: 100vh; 
    position: relative;
}

#map-container { 
    width: 40%; 
    height: 100%; 
    position: relative; 
    border-right: 2px solid #333; 
}

#map { 
    width: 100%; 
    height: 100%; 
}

#viewer-container { 
    width: 60%; 
    height: 100%; 
    position: relative; 
    background: linear-gradient(135deg, #1c2128 0%, #0d1115 50%, #050608 100%);
    background-size: 200% 200%;
}

/* Centered splash / watermark on load */
#viewer-splash {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 2;
    opacity: 0.25; 
    transition: opacity 0.5s ease;
}

.splash-logo {
    width: 72px;
    height: 72px;
    object-fit: contain;
    margin-bottom: 14px;
}

.splash-title {
    font-family: "Century Gothic", CenturyGothic, AppleGothic, sans-serif;
    color: #ffffff;
    font-size: 20px;
    font-weight: 600;
    letter-spacing: 1.5px;
    white-space: nowrap;
}

canvas { 
    display: block; 
    position: relative;
    z-index: 3;
}

/* =========================================
   TOP RIGHT INFO BUTTON (WHOLE PAGE)
========================================= */
#infoBtn {
    position: absolute;
    top: 15px;
    right: 20px;
    z-index: 3000;
    background: rgba(20, 20, 20, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #eee;
    padding: 8px 14px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    font-size: 13px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
    transition: all 0.2s ease;
    width: auto;
    margin-top: 0;
}

#infoBtn:hover {
    background: rgba(40, 40, 40, 0.95);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

/* =========================================
   INFO MODAL (CONSISTENT GLASSMORPHISM)
========================================= */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(6px);
    z-index: 4000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.modal-card {
    background: rgba(25, 25, 28, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 14px;
    padding: 25px 30px;
    width: 100%;
    max-width: 650px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6);
    position: relative;
    color: #ddd;
}

.modal-card h2 {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 20px;
    color: #fff;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 10px;
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: transparent;
    border: none;
    color: #aaa;
    font-size: 22px;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    box-shadow: none;
    margin: 0;
    padding: 0;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    transform: none;
}

.modal-body {
    display: flex;
    gap: 25px;
}

.modal-left {
    flex: 1.1;
    font-size: 13px;
    line-height: 1.5;
    color: #bbb;
}

.modal-left p {
    margin-top: 0;
    margin-bottom: 15px;
}

.try-title {
    font-weight: bold;
    color: #fff;
    margin-bottom: 8px !important;
}

.sim-promo {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.05);
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    text-decoration: none;
    color: #2ea44f;
    font-weight: bold;
    font-size: 13px;
    transition: background 0.2s;
}

.sim-promo:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #34bd5a;
}

.sim-logo {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.modal-right {
    flex: 0.9;
    background: rgba(15, 15, 18, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    padding: 15px;
    display: flex;
    flex-direction: column;
}

.dev-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    height: 100%;
    justify-content: center;
}

.dev-img-space {
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    overflow: hidden;
}

.dev-avatar {
    width: 36px;
    height: 36px;
    object-fit: contain;
}

.dev-details h3 {
    margin: 0 0 4px 0;
    font-size: 14px;
    color: #fff;
}

.dev-name {
    font-size: 13px;
    color: #888;
    margin: 0 0 12px 0;
}

.dev-link {
    display: block;
    font-size: 12px;
    color: #58a6ff;
    text-decoration: none;
    margin-bottom: 6px;
    transition: color 0.2s;
}

.dev-link:hover {
    color: #79c0ff;
    text-decoration: underline;
}

/* =========================================
   TOP UI PANEL (GLASSMORPHISM)
========================================= */
#ui {
    position: absolute; 
    top: 10px; 
    left: 58px;    
    right: 18px;   
    width: auto;   
    z-index: 1000; 
    padding: 18px 20px;
    
    background: rgba(20, 20, 20, 0.85); 
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.15); 
    border-radius: 12px; 
    box-shadow: 0 10px 30px rgba(0,0,0,0.5); 
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}

#ui-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    cursor: pointer;
    margin-bottom: 0px;
}

.header-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

#ui-header h3 {
    margin: 0;
    font-size: 16px;
}

#status { 
    font-size: 12px; 
    line-height: 1.4; 
    color: #bbb; 
    margin: 0; 
}

#ui-toggle {
    font-size: 12px;
    color: #ccc;
    padding-top: 3px;
    margin-left: 15px;
}

/* Collapsed state rules */
#ui.collapsed #ui-collapsible {
    display: none;
}

.checkbox-group { 
    display: flex; 
    flex-direction: column; 
    gap: 12px; 
    margin-top: 15px; 
    margin-bottom: 5px;
}

.checkbox-label { 
    font-size: 13px; 
    color: #eee; 
    display: flex; 
    align-items: center; 
    cursor: pointer; 
    margin: 0; 
    line-height: 1.2;
}

.checkbox-label input { 
    margin: 0 10px 0 0; 
    cursor: pointer; 
    flex-shrink: 0; 
}

/* =========================================
   BUTTONS
========================================= */
button {
    background: linear-gradient(135deg, #2ea44f 0%, #22863a 100%);
    color: white; 
    border: 1px solid rgba(255, 255, 255, 0.1); 
    padding: 8px 15px; 
    border-radius: 6px; 
    cursor: pointer; 
    font-weight: bold; 
    font-size: 13px;
    width: 100%; 
    margin-top: 12px; 
    transition: all 0.2s ease;
    box-shadow: 0 3px 10px rgba(46, 164, 79, 0.2);
}

button:disabled { 
    background: #333; 
    color: #777;
    border: 1px solid transparent;
    box-shadow: none;
    cursor: not-allowed; 
    transform: none;
}

button:hover:not(:disabled) { 
    background: linear-gradient(135deg, #34bd5a 0%, #2ea44f 100%);
    box-shadow: 0 5px 14px rgba(46, 164, 79, 0.35);
    transform: translateY(-1px);
}

button:active:not(:disabled) {
    transform: translateY(1px);
    box-shadow: 0 2px 5px rgba(46, 164, 79, 0.25);
}

#resetBtn {
    background: linear-gradient(135deg, #941b1e 0%, #600d12 100%);
    box-shadow: 0 3px 10px rgba(148, 27, 30, 0.3);
}

#resetBtn:hover {
    background: linear-gradient(135deg, #b82328 0%, #801217 100%);
    box-shadow: 0 5px 14px rgba(184, 35, 40, 0.4);
}

.blue-btn {
    background: linear-gradient(135deg, #0366d6 0%, #005cc5 100%);
    box-shadow: 0 3px 10px rgba(3, 102, 214, 0.2);
    margin-top: 8px;
}

.blue-btn:hover {
    background: linear-gradient(135deg, #2188ff 0%, #0366d6 100%);
    box-shadow: 0 5px 14px rgba(3, 102, 214, 0.35);
}

/* =========================================
   PHOTO OPTIONS (inside the options dropdown)
========================================= */
#gen-options { 
    display: flex; 
    flex-direction: column; 
    gap: 12px; 
}

#photo-options { 
    display: none; 
    flex-direction: column; 
    gap: 12px; 
}

.photo-link {
    margin-left: 8px;
    color: #00e5ff;
    font-size: 12px;
    text-decoration: none;
    border-bottom: 1px dotted rgba(0, 229, 255, 0.6);
}
.photo-link:hover { color: #7df3ff; }

#pt-status { font-size: 12px; line-height: 1.35; color: #bbb; margin-top: -4px; }
#pt-status:empty { display: none; }

#day-filter-block {
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 12px;
    color: #ddd;
}
#pt-count { margin-bottom: 8px; color: #888; }
#day-filter-block label { 
    display: block; 
    margin-bottom: 4px; 
    margin-top: 10px; 
    color: #eee; 
    font-weight: bold; 
}
#day-filter-block label:first-of-type { 
    margin-top: 0; 
}

.filter-select {
    width: 100%;
    box-sizing: border-box;
    padding: 5px 6px;
    margin-bottom: 8px;
    background: #222;
    color: #eee;
    border: 1px solid #555;
    border-radius: 5px;
    font-size: 12px;
}
#route-info { margin-top: 6px; color: #9be9f5; line-height: 1.35; }
#route-info:empty { display: none; }

.route-pin span {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #00e5ff;
    color: #00252b;
    border: 2px solid #fff;
    font: bold 10px sans-serif;
    box-sizing: border-box;
}

/* =========================================
   3D VIEWER TOOLS & FOLLOW DROPDOWNS
========================================= */
#viewer-tools {
    position: absolute;
    top: 15px;
    left: 15px;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
}

#flyBtn {
    width: auto;
    margin: 0;
    padding: 8px 14px;
    background: rgba(20, 20, 20, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #eee;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

#flyBtn:hover:not(:disabled) {
    background: rgba(40, 40, 40, 0.95);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

#flyBtn.active {
    background: linear-gradient(135deg, #2ea44f 0%, #22863a 100%);
    border-color: rgba(255, 255, 255, 0.3);
}

.follow-select {
    background: rgba(20, 20, 20, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #eee;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    outline: none;
    width: 160px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}
.follow-select:hover {
    background: rgba(40, 40, 40, 0.95);
    color: #fff;
}

#fly-hint {
    display: none;
    padding: 8px 12px;
    font-size: 11px;
    line-height: 1.6;
    color: #ccc;
    background: rgba(20, 20, 20, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    pointer-events: none;
}

#fly-hint b { color: #fff; }

#removeOrbBtn {
    display: none;
    position: absolute;
    bottom: 20px;
    left: 0;
    right: 0;
    margin: 0 auto;
    width: max-content;
    z-index: 10;
    background: linear-gradient(135deg, #941b1e 0%, #600d12 100%);
    box-shadow: 0 3px 10px rgba(148, 27, 30, 0.4);
}

#removeOrbBtn:hover:not(:disabled) {
    background: linear-gradient(135deg, #b82328 0%, #801217 100%);
    box-shadow: 0 5px 14px rgba(184, 35, 40, 0.4);
}

/* =========================================
   WIKIMEDIA & PHOTO VIEWER UI
========================================= */
#wiki-overlay { 
    position: absolute; 
    top: 20px; 
    bottom: 250px; 
    left: 20px; 
    right: 20px; 
    z-index: 900; 
    background: rgba(0,0,0,0.85); 
    border-radius: 8px; 
    box-shadow: 0 4px 6px rgba(0,0,0,0.5); 
    display: none; 
    flex-direction: column; 
    border: 1px solid #444; 
}
#wiki-overlay.collapsed { bottom: auto; }
#wiki-overlay.collapsed #wiki-content, #wiki-overlay.collapsed #wiki-pagination { display: none; }
#wiki-overlay.collapsed #wiki-header { border-radius: 8px; }
#wiki-header { padding: 10px 15px; background: #333; border-radius: 8px 8px 0 0; display: flex; justify-content: space-between; align-items: center; cursor: pointer; }
#wiki-content { overflow-y: auto; padding: 10px; flex: 1; }
.wiki-item { display: flex; gap: 15px; margin-bottom: 12px; padding: 12px; background: #222; border-radius: 4px; align-items: flex-start; }
.wiki-item img { width: 120px; height: 120px; object-fit: cover; border-radius: 4px; }
.wiki-item-info { flex: 1; display: flex; flex-direction: column; align-self: stretch; }
.wiki-item-info strong { font-size: 14px; margin-bottom: 10px; word-break: break-word; }
.wiki-btn-group { display: flex; gap: 10px; margin-top: auto; }
.wiki-btn { background: #444; border: none; color: white; padding: 6px 10px; margin: 0; width: auto; border-radius: 4px; cursor: pointer; font-size: 11px; font-weight: bold; flex: 1; box-shadow: none; }
.wiki-btn.fly { background: #2ea44f; }
.wiki-btn.fly:hover { background: #2c974b; transform: none; box-shadow: none; }
.wiki-btn.max:hover { background: #555; transform: none; box-shadow: none;}
#wiki-pagination { display: flex; justify-content: space-between; padding: 10px; background: #222; border-radius: 0 0 8px 8px; }
.page-btn { width: 48%; padding: 6px; margin: 0; background: #555; box-shadow: none; }
.wiki-item.active { outline: 2px solid #ffeb3b; }

#image-viewer { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.95); z-index: 2000; display: none; flex-direction: column; justify-content: center; align-items: center; padding: 20px; box-sizing: border-box; text-align: center; }
#image-viewer img { width: 100%; flex: 1; min-height: 0; object-fit: contain; }
#image-viewer h3 { color: white; margin: 12px 0 0 0; font-size: 16px; word-break: break-word; }
#close-viewer-btn { position: absolute; top: 20px; right: 20px; background: #d73a49; border: none; color: white; width: 40px; height: 40px; border-radius: 50%; font-size: 18px; padding: 0; margin: 0; font-weight: bold; cursor: pointer; display: flex; justify-content: center; align-items: center; box-shadow: none; z-index: 1; }
#close-viewer-btn:hover { background: #cb2431; transform: scale(1.05); }

#viewer-credit {
    margin-top: 8px;
    max-width: 92%;
    font-size: 12px;
    line-height: 1.5;
    color: #bbb;
}
#viewer-credit a { color: #58a6ff; text-decoration: none; }
#viewer-credit a:hover { text-decoration: underline; }
#viewer-credit .credit-note { display: block; margin-top: 2px; font-size: 11px; color: #888; }

@keyframes flashGreen {
    0% { color: #fff; }
    30% { color: #2ea44f; text-shadow: 0 0 8px rgba(46, 164, 79, 0.6); }
    100% { color: #fff; }
}

#ui-toggle.flash-green {
    animation: flashGreen 0.8s ease-in-out 0.5s 1; 
}

#snap-flash {
    position: absolute;
    inset: 0;
    z-index: 9;
    background: #fff;
    opacity: 0;
    pointer-events: none;
}
#snap-flash.go { animation: snapFlash 0.35s ease-out; }
@keyframes snapFlash { 0% { opacity: 0.7; } 100% { opacity: 0; } }

#photo-editor-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.9);
    z-index: 5000;
    display: none;
    justify-content: center;
    align-items: center;
}

#photo-editor-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

#editor-img-preview {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

#editor-glassbox {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(20, 20, 20, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    padding: 15px;
    width: 300px;
    color: #fff;
    display: flex;
    flex-direction: column;
    gap: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    z-index: 5001;
}

/* =========================================
   3D MODEL LIBRARY (inside the glassbox)
========================================= */
#ui-collapsible {
    max-height: calc(100vh - 230px);
    overflow-y: auto;
    padding-right: 4px;
    scrollbar-width: thin;
}

.ml { font-size: 12px; color: #ddd; }
.ml-body { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }

.ml-status { min-height: 0; color: #00e5ff; font-size: 11px; }
.ml-status:empty { display: none; }
.ml-status.warn { color: #ffb4a8; }

.ml .ml-search { width: 100%; box-sizing: border-box; padding: 7px 9px; background: rgba(0, 0, 0, 0.45); border: 1px solid #555; color: #fff; border-radius: 6px; outline: none; font-size: 12px; }
.ml .ml-search:focus { border-color: #00e5ff; }


.ml-list { display: flex; flex-direction: column; gap: 4px; max-height: 230px; overflow-y: auto; scrollbar-width: thin; }
.ml-scene-list { max-height: 170px; }
.ml-row { display: flex; align-items: center; gap: 10px; padding: 6px; border-radius: 6px; cursor: pointer; background: rgba(255, 255, 255, 0.05); border: 1px solid transparent; transition: background 0.15s; }
.ml-row:hover { background: rgba(255, 255, 255, 0.12); }
.ml-row.sel { border-color: #00e5ff; background: rgba(0, 229, 255, 0.1); }
.ml-row.dim { opacity: 0.5; }
.ml-row.ml-cat, .ml-row.ml-back { justify-content: space-between; padding: 10px; }
.ml-row.ml-back { color: #aaa; font-weight: bold; }
.ml-txt { flex: 1; min-width: 0; }
.ml-title { font-weight: bold; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ml-subtitle { color: #8b949e; font-size: 11px; }
.ml-empty { color: #888; padding: 6px; }

.ml-tile { position: relative; flex-shrink: 0; width: 42px; height: 42px; border-radius: 6px; overflow: hidden; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #2b3340 0%, #161a20 100%); }
.ml-emoji { font-size: 22px; }
.ml-thumb { width: 100%; height: 100%; object-fit: cover; }
.ml-badge { position: absolute; right: 2px; bottom: 2px; width: 15px; height: 15px; padding: 1px; box-sizing: border-box; object-fit: contain; border-radius: 4px; background: rgba(0, 0, 0, 0.7); }

.ml-sub-head { display: none; align-items: center; justify-content: space-between; margin-top: 6px; font-weight: bold; color: #fff; }

.ml-inspector { display: flex; flex-direction: column; gap: 8px; padding: 10px; border-radius: 8px; background: rgba(0, 229, 255, 0.07); border: 1px solid rgba(0, 229, 255, 0.28); }
.ml-insp-top { display: flex; gap: 6px; }
.ml .ml-name { flex: 1; min-width: 0; padding: 6px 8px; background: rgba(0, 0, 0, 0.45); border: 1px solid #555; border-radius: 6px; color: #fff; font-size: 12px; font-weight: bold; outline: none; }
.ml-row-btns { display: flex; gap: 4px; }
.ml-row-btns.ml-wrap { flex-wrap: wrap; }

.ml .ml-mini { width: auto; margin: 0; padding: 5px 9px; flex: 0 0 auto; font-size: 11px; background: #2f3138; border: 1px solid #484a52; box-shadow: none; }
.ml .ml-row-btns:not(.ml-wrap) .ml-mini { flex: 1; }
.ml .ml-mini:hover:not(:disabled) { background: #3d4049; box-shadow: none; transform: none; }
.ml .ml-mini.active { background: #0366d6; border-color: #2188ff; }
.ml .ml-mini.danger { background: #7a1a1d; border-color: #a02327; }
.ml .ml-mini.danger:hover:not(:disabled) { background: #9a2327; }
.ml .ml-mini.ml-icon { padding: 3px 7px; }
.ml .ml-x { padding: 5px 9px; }

.ml-slider-row { display: grid; grid-template-columns: 48px 1fr 92px; gap: 8px; align-items: center; }
.ml-slider-row.disabled { opacity: 0.4; }
.ml-slider-row input[type=range] { width: 100%; margin: 0; accent-color: #00e5ff; }
.ml-val { color: #9be9f5; font-size: 11px; text-align: right; white-space: nowrap; }
.ml-checks { display: flex; gap: 14px; flex-wrap: wrap; }
.ml-check { display: flex; align-items: center; gap: 4px; cursor: pointer; color: #eee; }
.ml-check input { margin: 0 4px 0 0; }
.ml-hint { color: #6e7681; font-size: 10.5px; line-height: 1.4; }


/* ---- placing / selected state ---- */
.ml-row.sel { border-color: #00e5ff; background: rgba(0, 229, 255, 0.16); box-shadow: 0 0 0 1px rgba(0, 229, 255, 0.5), 0 0 14px rgba(0, 229, 255, 0.35); }
.ml-row.placing::after { content: '✓ PLACING'; margin-left: auto; padding: 2px 7px; border-radius: 10px; background: #00e5ff; color: #00252b; font-size: 10px; font-weight: bold; letter-spacing: 0.5px; animation: mlPulse 1s ease-in-out infinite; }
@keyframes mlPulse { 50% { opacity: 0.55; } }

.ml-carry { position: sticky; top: 0; z-index: 5; margin: 10px 0 0; padding: 10px; border-radius: 8px; background: linear-gradient(135deg, rgba(0, 120, 150, 0.95) 0%, rgba(3, 80, 140, 0.95) 100%); border: 1px solid #00e5ff; box-shadow: 0 6px 20px rgba(0, 229, 255, 0.25); }
.ml-carry-title { font-size: 13px; color: #fff; margin-bottom: 4px; }
.ml-carry-title strong { color: #7df3ff; }
.ml-carry-hint { font-size: 10.5px; line-height: 1.45; color: #cfeff5; margin-bottom: 6px; }
.ml-carry-size { font-size: 11px; color: #9be9f5; margin-bottom: 6px; }
.ml .ml-carry .ml-mini { background: rgba(0, 0, 0, 0.35); border-color: rgba(255, 255, 255, 0.25); }
.ml .ml-carry .ml-mini.active { background: #2ea44f; border-color: #5fd37d; }
.ml .ml-carry .ml-mini.danger { background: #941b1e; }

.carry-cross { position: absolute; left: 50%; top: 50%; width: 26px; height: 26px; transform: translate(-50%, -50%); pointer-events: none; z-index: 8; }
.carry-cross::before, .carry-cross::after { content: ''; position: absolute; background: #00e5ff; box-shadow: 0 0 6px rgba(0, 0, 0, 0.8); }
.carry-cross::before { left: 50%; top: 0; width: 2px; height: 100%; transform: translateX(-50%); }
.carry-cross::after { top: 50%; left: 0; height: 2px; width: 100%; transform: translateY(-50%); }


/* ---- glassbox tabs ---- */
#ui-tabs { display: flex; gap: 4px; margin-bottom: 12px; padding: 3px; border-radius: 10px; background: rgba(0, 0, 0, 0.35); border: 1px solid rgba(255, 255, 255, 0.08); position: sticky; top: 0; z-index: 6; backdrop-filter: blur(6px); }
#ui-tabs .ui-tab { flex: 1; width: auto; margin: 0; padding: 8px 6px; font-size: 12.5px; font-weight: 600; border-radius: 8px; border: none; background: transparent; color: #aab2bd; box-shadow: none; white-space: nowrap; }
#ui-tabs .ui-tab:hover:not(:disabled) { background: rgba(255, 255, 255, 0.08); color: #fff; box-shadow: none; transform: none; }
#ui-tabs .ui-tab.active { background: linear-gradient(135deg, #2ea44f 0%, #22863a 100%); color: #fff; }
#ml-count { margin-left: 2px; font-weight: normal; opacity: 0.85; }

/* ---- library list: groups + uploads ---- */
.ml-group { margin: 6px 0 2px; font-size: 10.5px; font-weight: bold; letter-spacing: 0.6px; text-transform: uppercase; color: #8b949e; }
.ml-group:first-child { margin-top: 0; }
.ml-upload { display: flex; align-items: center; gap: 8px; }
.ml .ml-upload-btn { flex: 0 0 auto; background: #0366d6; border-color: #2188ff; }
.ml .ml-upload-btn:hover:not(:disabled) { background: #1f7ae0; }
.ml-upload-note { color: #6e7681; font-size: 10.5px; line-height: 1.3; }
.ml-library.drop { outline: 2px dashed #00e5ff; outline-offset: 2px; background: rgba(0, 229, 255, 0.06); }
.ml-user-tile { background: linear-gradient(135deg, #3a3f4f 0%, #1c2030 100%); }
.ml-library { max-height: 260px; }

/* ---- brush mode + collapsible groups ---- */
.ml-seg .ml-mini { padding: 7px 8px; font-size: 12px; }
.ml-group-toggle { cursor: pointer; user-select: none; padding: 5px 4px; border-radius: 4px; }
.ml-group-toggle:hover { background: rgba(255, 255, 255, 0.07); color: #fff; }
.ml-row.brushing::after { content: '🖌 BRUSH'; margin-left: auto; padding: 2px 7px; border-radius: 10px; background: #ff9f1a; color: #2b1700; font-size: 10px; font-weight: bold; letter-spacing: 0.5px; }
.ml-brushcard { border-color: rgba(255, 159, 26, 0.45); background: rgba(255, 159, 26, 0.07); }
.ml-brush-label { color: #ffd9a0; font-size: 12px; }
.ml-brush-label strong { color: #fff; }
.ml-library { max-height: 300px; }


/* =========================================
   POI LAYERS
========================================= */
.pl-head { margin: 15px 0 8px 0; font-size: 13px; font-weight: bold; color: #fff; text-transform: uppercase; letter-spacing: 0.5px; }
.pl-section { margin-bottom: 12px; }
.pl-row { display: flex; align-items: center; gap: 8px; padding: 6px; border-radius: 6px; cursor: pointer; background: rgba(255, 255, 255, 0.05); border: 1px solid transparent; transition: background 0.15s; margin-bottom: 4px; }
.pl-row:hover { background: rgba(255, 255, 255, 0.12); }
.pl-row.on { border-color: #2ea44f; background: rgba(46, 164, 79, 0.15); }
.pl-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; box-shadow: 0 0 4px rgba(0,0,0,0.5); }
.pl-name { flex: 1; font-size: 12px; font-weight: bold; color: #eee; }
.pl-meta { font-size: 10px; color: #888; font-weight: bold; }
.pl-meta.err { color: #ff5c5c; cursor: pointer; }
.pl-scene { display: block; margin-bottom: 6px; color: #ccc; font-size: 13px; }
.pl-scene.disabled { opacity: 0.5; cursor: not-allowed; }
.pl-info-title { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.pl-info-title strong { font-size: 14px; color: #fff; }
.pl-fact { font-size: 12px; color: #ccc; padding: 4px 0; border-bottom: 1px solid rgba(255,255,255,0.05); }
.pl-link { color: #58a6ff; text-decoration: none; }
.pl-link:hover { text-decoration: underline; }
.pl-custom { display: flex; gap: 6px; margin-bottom: 12px; }
.pl-settings { background: rgba(0,0,0,0.2); border: 1px solid rgba(255,255,255,0.1); }
.pl-mine { background: rgba(255, 159, 26, 0.1); border: 1px solid rgba(255, 159, 26, 0.3); }


/* =========================================
   TABS (4), SKY + SNAPSHOT TOOLS, STORY
========================================= */
#ui-tabs .ui-tab { padding: 8px 4px; font-size: 12px; }
#tool-row { display: flex; gap: 6px; align-items: stretch; }
#skySelect { width: auto; max-width: 170px; margin: 0; }
#snapBtn { width: auto; margin: 0; padding: 8px 12px; background: rgba(20, 20, 20, 0.85); backdrop-filter: blur(10px); border: 1px solid rgba(255, 255, 255, 0.15); color: #eee; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4); }
#snapBtn:hover:not(:disabled) { background: rgba(40, 40, 40, 0.95); box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4); }
#viewer-story-btn { width: auto; margin: 12px 0 0 0; padding: 8px 18px; }
.pl-meta.ready { color: #6e7681; font-weight: normal; }

.st-title { font-weight: bold; font-size: 14px; }
.st-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; max-height: 190px; overflow-y: auto; padding: 2px; scrollbar-width: thin; }
.st-grid.drop { outline: 2px dashed #00e5ff; outline-offset: 2px; }
.st-grid .ml-empty { grid-column: 1 / -1; }
.st-thumb { position: relative; aspect-ratio: 16 / 10; border-radius: 6px; overflow: hidden; cursor: pointer; background: #111; border: 1px solid rgba(255, 255, 255, 0.12); }
.st-thumb:hover { border-color: #00e5ff; }
.st-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.st-tag { position: absolute; left: 3px; bottom: 3px; font-size: 11px; background: rgba(0, 0, 0, 0.6); border-radius: 4px; padding: 0 4px; }
.ml .st-x { position: absolute; right: 3px; top: 3px; padding: 1px 5px; opacity: 0; }
.st-thumb:hover .st-x { opacity: 1; }
.st-blocks { display: flex; flex-direction: column; gap: 8px; }
.st-block { padding: 8px; border-radius: 8px; background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.1); display: flex; flex-direction: column; gap: 6px; }
.st-block-head { display: flex; justify-content: space-between; align-items: center; font-size: 11px; color: #9aa4af; font-weight: bold; }
.st-text { width: 100%; box-sizing: border-box; background: rgba(0, 0, 0, 0.45); color: #fff; border: 1px solid #555; border-radius: 6px; padding: 8px; font: 13px/1.5 system-ui, sans-serif; resize: vertical; outline: none; }
.st-text:focus { border-color: #00e5ff; }
.st-img { width: 100%; border-radius: 6px; display: block; max-height: 150px; object-fit: cover; }

.st-reader { position: absolute; top: 0; right: 0; bottom: 0; width: min(560px, 94%); z-index: 900; overflow-y: auto; background: rgba(250, 250, 248, 0.97); color: #1c2128; box-shadow: -10px 0 40px rgba(0, 0, 0, 0.45); }
.st-reader-x { position: sticky; top: 10px; float: right; margin: 10px 12px 0 0; width: 34px; height: 34px; padding: 0; border-radius: 50%; background: #1c2128; color: #fff; border: none; z-index: 2; cursor: pointer; font-size: 14px; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3); }
.st-doc { padding: 34px 28px 70px; font: 16.5px/1.7 Georgia, 'Times New Roman', serif; }
.st-doc h1 { font: 700 2em/1.2 system-ui, sans-serif; margin: 0 0 4px; }
.st-doc h2 { font: 700 1.4em/1.3 system-ui, sans-serif; margin: 1.6em 0 .4em; }
.st-doc .st-by { font: 13px system-ui, sans-serif; color: #667; margin-bottom: 1.6em; }
.st-doc figure { margin: 1.5em 0; }
.st-doc figure img { width: 100%; display: block; border-radius: 6px; cursor: zoom-in; }
.st-doc figcaption { font: 13px/1.5 system-ui, sans-serif; color: #556; padding-top: 6px; }
.st-doc .st-credit { display: block; font-size: 11.5px; color: #889; }
.st-doc a { color: #0b66d6; }
.st-view { margin-top: 8px; width: auto; padding: 6px 12px; font: 600 12.5px system-ui, sans-serif; background: #0b66d6; color: #fff; border: none; border-radius: 6px; cursor: pointer; }
.st-view:hover { background: #1f7ae0; }
.st-lightbox { position: absolute; inset: 0; z-index: 1500; background: rgba(0, 0, 0, 0.92); display: flex; align-items: center; justify-content: center; padding: 20px; cursor: zoom-out; }
.st-lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; }

/* Places: top-N picker */
.pl-top { width: auto; max-width: 72px; margin: 0 0 0 4px; padding: 2px 4px; font-size: 11px; background: #1b2027; color: #dfe6ee; border: 1px solid #484a52; border-radius: 6px; }
