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-off {
    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-num { width: 100%; min-width: 0; box-sizing: border-box; padding: 2px 4px; font-size: 11px; text-align: right; color: #9be9f5; background: rgba(0, 0, 0, 0.35); border: 1px solid rgba(0, 229, 255, 0.28); border-radius: 4px; }
.ml-num:focus { outline: none; border-color: #00e5ff; }
.ml-num:disabled { opacity: 0.6; }
.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: 84px; margin: 0 0 0 4px; padding: 2px 4px; font-size: 11px; background: #1b2027; color: #dfe6ee; border: 1px solid #484a52; border-radius: 6px; }

/* =========================================================
   BRAND THEME v3 – light, airy frosted glass (homepage family)
   translucent slate-blue panels · soft teal accent · regular weights
========================================================= */
:root { --text: #e8eef4; --mut: #aebccb; --line: rgba(255, 255, 255, 0.13); --glass: rgba(14, 22, 32, 0.8); --glass-hi: rgba(255, 255, 255, 0.08); --teal: #3cc4d4; --teal2: #2aa9ba; }
body { font-family: Inter, system-ui, "Segoe UI", sans-serif; font-weight: 400; }
b, strong { font-weight: 600; }
#ui-header h3, .splash-title, .ml-sub-head, .modal-card h2 { font-family: Poppins, Inter, sans-serif; font-weight: 500; }

/* panel */
#ui { background: var(--glass); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; backdrop-filter: blur(18px) saturate(1.25); -webkit-backdrop-filter: blur(18px) saturate(1.25); box-shadow: 0 14px 44px rgba(0, 0, 0, 0.4); font-size: 12.5px; }
#ui-header h3 { font-size: 15px; font-weight: 600; }
#ui-header h3::before { content: ""; display: block; width: 26px; height: 2px; border-radius: 2px; margin-bottom: 7px; background: linear-gradient(90deg, var(--teal), rgba(60, 196, 212, 0.15)); }
#status { color: #b9c7d4; font-size: 12px; }
#ui-toggle { color: var(--mut); }

/* buttons: quiet, translucent, small */
button { font-family: Inter, system-ui, sans-serif; font-weight: 500; font-size: 12.5px; padding: 6px 12px; border-radius: 9px; color: var(--text); background: var(--glass-hi); border: 1px solid var(--line); box-shadow: none; margin-top: 8px; }
button:hover:not(:disabled) { background: rgba(255, 255, 255, 0.14); box-shadow: none; transform: none; }
button:active:not(:disabled) { transform: none; box-shadow: none; background: rgba(255, 255, 255, 0.1); }
button:disabled { background: rgba(255, 255, 255, 0.04); color: #6b7785; border-color: transparent; }
#generateBtn, .blue-btn { background: rgba(60, 196, 212, 0.2); border-color: rgba(60, 196, 212, 0.5); color: #bff1f7; }
#generateBtn:hover:not(:disabled), .blue-btn:hover:not(:disabled) { background: rgba(60, 196, 212, 0.3); }
#resetBtn { background: transparent; color: #f2a5a9; border: 1px solid rgba(242, 165, 169, 0.35); }
#resetBtn:hover:not(:disabled) { background: rgba(242, 165, 169, 0.12); box-shadow: none; }

/* tabs */
#ui-tabs { background: rgba(255, 255, 255, 0.05); border: 1px solid var(--line); border-radius: 10px; padding: 3px; gap: 2px; }
#ui-tabs .ui-tab { margin: 0; border: 0; border-radius: 7px; padding: 6px 4px; font-size: 12px; font-weight: 500; color: var(--mut); background: transparent; }
#ui-tabs .ui-tab:hover:not(:disabled) { background: rgba(255, 255, 255, 0.07); color: var(--text); }
#ui-tabs .ui-tab.active { background: rgba(60, 196, 212, 0.2); color: #bff1f7; box-shadow: inset 0 0 0 1px rgba(60, 196, 212, 0.45); }

/* panel content */
.ml { color: var(--text); font-size: 12px; }
.ml .ml-search, .ml .ml-name, .filter-select, #editor-descriptor { background: rgba(255, 255, 255, 0.06); border: 1px solid var(--line); border-radius: 8px; color: var(--text); font-weight: 400; }
.ml .ml-search:focus { border-color: var(--teal); }
.ml-status { color: var(--teal); }
.ml-sub-head { font-weight: 500; color: var(--text); }
.ml .ml-mini { background: var(--glass-hi); border: 1px solid var(--line); color: var(--text); border-radius: 8px; font-weight: 500; font-size: 11.5px; padding: 4px 9px; box-shadow: none; margin: 0; }
.ml .ml-mini:hover:not(:disabled) { background: rgba(255, 255, 255, 0.14); }
.ml .ml-mini.active, .ml .ml-upload-btn, .ml .ml-carry .ml-mini.active { background: rgba(60, 196, 212, 0.22); border-color: rgba(60, 196, 212, 0.5); color: #bff1f7; }
.ml .ml-mini.danger { background: rgba(242, 120, 126, 0.14); border-color: rgba(242, 120, 126, 0.35); color: #f6b5b8; }
.pl-row { background: rgba(255, 255, 255, 0.05); border-radius: 8px; }
.pl-row:hover { background: rgba(255, 255, 255, 0.1); }
.pl-row.on { border-color: rgba(60, 196, 212, 0.55); background: rgba(60, 196, 212, 0.12); }
.st-thumb, .st-block { border-radius: 10px; border-color: var(--line); }
.st-thumb:hover { border-color: var(--teal); }
.st-block { background: rgba(255, 255, 255, 0.04); }
.st-block.st-title-img { border-color: rgba(60, 196, 212, 0.6); box-shadow: 0 0 0 1px rgba(60, 196, 212, 0.2); }
.checkbox-label { color: var(--text); font-weight: 400; }
.checkbox-label input { accent-color: var(--teal); }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.2); border-radius: 8px; }

/* viewer controls */
#viewer-tools button, #viewer-tools select, #flyBtn, #snapBtn, .follow-select, #skySelect { background: var(--glass); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border: 1px solid var(--line); color: var(--text); border-radius: 9px; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2); font-family: Inter, sans-serif; font-weight: 500; font-size: 12.5px; padding: 6px 11px; margin: 0; }
#flyBtn:hover:not(:disabled), #snapBtn:hover:not(:disabled), .follow-select:hover { background: rgba(255, 255, 255, 0.16); box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2); }
#flyBtn.active { background: rgba(60, 196, 212, 0.3); border-color: rgba(60, 196, 212, 0.6); color: #e6fbfe; }
#skySelect { max-width: 150px; }

/* account control: avatar → dropdown (Home · My profile · Log out) */
#infoBtn { display: none !important; }
#acctBar { position: absolute; top: 12px; right: 16px; z-index: 3000; }
#acctBar .avbtn { width: 32px; height: 32px; padding: 0; margin: 0; border-radius: 50%; background: var(--glass); border: 1px solid var(--line); overflow: hidden; display: grid; place-items: center; backdrop-filter: blur(14px); box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2); cursor: pointer; }
#acctBar .avbtn img { width: 100%; height: 100%; object-fit: cover; display: block; }
#acctBar .avbtn:hover:not(:disabled) { border-color: var(--teal); background: var(--glass); }
#acctBar .menu { position: absolute; right: 0; top: 40px; min-width: 170px; padding: 5px; border-radius: 10px; background: rgba(14, 22, 32, 0.92); border: 1px solid var(--line); backdrop-filter: blur(18px) saturate(1.2); box-shadow: 0 14px 40px rgba(0, 0, 0, 0.35); display: none; }
#acctBar.open .menu { display: block; }
#acctBar .menu .who { padding: 7px 10px 8px; color: var(--mut); font-size: 11.5px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
#acctBar .menu a, #acctBar .menu button { display: flex; align-items: center; gap: 8px; width: 100%; box-sizing: border-box; text-align: left; margin: 0; padding: 7px 10px; border: 0; border-radius: 7px; background: transparent; color: var(--text); font-size: 12.5px; font-weight: 400; text-decoration: none; cursor: pointer; }
#acctBar .menu a:hover, #acctBar .menu button:hover:not(:disabled) { background: rgba(255, 255, 255, 0.1); }

/* generation progress: multicolour bar (1/3 -> 2/3 -> 3/3) replaces the small accent line */
#ui-header h3::before { display: none !important; }
#ui-header .header-text { flex: 1 1 auto; min-width: 0; }
#gen-bar { height: 3px; width: 100%; margin: 0 0 9px; border-radius: 3px; background: rgba(255,255,255,.08); overflow: hidden; }
#gen-bar i { display: block; height: 100%; width: 12%; border-radius: 3px; background: linear-gradient(90deg, #14b8cc, #3ddc97 55%, #ffc857); transition: width .6s ease; }
#gen-bar.idle i { width: 0; }
#gen-bar.done i { opacity: 1; }
#generateBtn:disabled { background: rgba(255,255,255,.06) !important; color: #8b949e !important; border: 1px solid rgba(255,255,255,.1) !important; box-shadow: none !important; cursor: wait; opacity: .85; }

.st-sum { resize: none; font: inherit; line-height: 1.35; min-height: 44px; margin-top: 6px; }

/* dark dropdown lists (author / day / sky / follow selects) */
select, .filter-select { color-scheme: dark; }
select option, select optgroup, .filter-select option { background: #1a2129; color: #e6ebf0; }
select option:checked, select option:hover { background: #2a6f7a linear-gradient(0deg, #2a6f7a, #2a6f7a); color: #fff; }
#ui { width: auto; }
#acctBar .avbtn.txt { width: auto; padding: 0 13px; border-radius: 16px; font-size: 12px; font-weight: 400; color: var(--text); }
#acctBar .menu a, #acctBar .menu button { letter-spacing: .01em; }

#wiki-overlay { display: none !important; }   /* legacy gallery list removed – browse via the map markers, 3D orbs and the Photos tab */

/* glassbox runs down to just above the Leaflet credit when open */
#ui.meshed:not(.collapsed) { bottom: 34px; }
#ui.meshed:not(.collapsed) #ui-collapsible { flex: 1 1 auto; min-height: 0; max-height: none; }

.st-place.need{border-color:#ff8a85!important;box-shadow:0 0 0 2px rgba(255,138,133,.25)}

.st-placerow{display:flex;flex-direction:column;gap:4px}.st-pnote{font-size:11.5px;color:#9fb0bd;min-height:0;display:flex;align-items:center;gap:6px}.st-pnote:empty{display:none}
.st-pnote.ok{color:#5fd6a8}.st-pnote.fail{color:#ff8a85}.st-pnote.edited{color:#9fb0bd}
.st-spin{width:11px;height:11px;border:2px solid rgba(255,255,255,.25);border-top-color:#14c8e0;border-radius:50%;display:inline-block;animation:stspin .8s linear infinite}@keyframes stspin{to{transform:rotate(360deg)}}
#acctBar .menu .gsign { padding: 6px 4px 2px; border-top: 1px solid var(--line); margin-top: 4px; line-height: 0; }
#acctBar .menu .gsign a { line-height: 1.4; }

/* ---- Bring your own API keys (experimental): gear row in the Options pane + dialog ---- */
#gen-options button.byo-open { display: flex; align-items: center; gap: 8px; width: 100%; margin: 2px 0 0; padding: 7px 10px; background: transparent; border: 1px dashed var(--line); border-radius: 9px; color: var(--mut); font-size: 12px; font-weight: 400; text-align: left; line-height: 1.3; }
#gen-options button.byo-open:hover:not(:disabled) { background: var(--glass-hi); color: var(--text); }
#gen-options button.byo-open.on { border-style: solid; border-color: rgba(60, 196, 212, 0.45); color: #bff1f7; }
.byo-open .byo-gear { font-size: 15px; line-height: 1; flex: none; }
.byo-open .byo-lbl { flex: 0 1 auto; }
.byo-open .byo-badge { flex: none; color: var(--teal); white-space: pre; }
.byo-overlay { display: none; position: fixed; inset: 0; z-index: 4500; background: rgba(0, 0, 0, 0.72); backdrop-filter: blur(5px); align-items: flex-start; justify-content: center; padding: 18px 12px; overflow-y: auto; box-sizing: border-box; }
.byo-overlay.on { display: flex; }
.byo-card { position: relative; width: 100%; max-width: 640px; margin: auto; box-sizing: border-box; background: rgba(22, 28, 36, 0.97); border: 1px solid var(--line); border-radius: 14px; padding: 22px 24px 18px; color: var(--text); box-shadow: 0 16px 48px rgba(0, 0, 0, 0.6); font-size: 13px; line-height: 1.45; }
.byo-card h2 { margin: 0 34px 10px 0; font-size: 18px; font-weight: 600; color: #fff; }
.byo-card button.byo-x { position: absolute; top: 14px; right: 14px; width: 32px; height: 32px; margin: 0; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--mut); font-size: 22px; line-height: 1; }
.byo-lead { margin: 0 0 10px; color: var(--mut); }
.byo-facts { margin: 0 0 12px; padding: 10px 12px 10px 28px; background: rgba(255, 255, 255, 0.05); border: 1px solid var(--line); border-radius: 10px; color: var(--mut); font-size: 12px; }
.byo-facts li { margin: 3px 0; }
.byo-mode { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; font-size: 12.5px; color: var(--mut); }
.byo-mode select { flex: 1 1 auto; min-width: 0; padding: 5px 8px; background: var(--glass-hi); color: var(--text); border: 1px solid var(--line); border-radius: 8px; font-size: 12px; }
.byo-prov { margin: 0 0 10px; padding: 12px; background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line); border-radius: 11px; }
.byo-ph { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin-bottom: 4px; }
.byo-ph b { font-size: 14px; color: #fff; }
.byo-uses { color: var(--mut); font-size: 12px; }
.byo-checks { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 2px 0 6px; font-size: 12px; color: var(--mut); }
.byo-checks label { display: inline-flex; align-items: center; gap: 4px; cursor: pointer; }
.byo-checks input { accent-color: var(--teal); }
.byo-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin-top: 6px; }
.byo-row input { flex: 1 1 200px; min-width: 0; padding: 7px 9px; background: rgba(0, 0, 0, 0.3); color: var(--text); border: 1px solid var(--line); border-radius: 8px; font: 12.5px ui-monospace, Consolas, monospace; }
.byo-row input:focus { outline: 2px solid rgba(60, 196, 212, 0.5); outline-offset: 0; }
.byo-row button { width: auto; margin: 0; padding: 6px 12px; }
.byo-row button.byo-save { background: rgba(60, 196, 212, 0.2); border-color: rgba(60, 196, 212, 0.5); color: #bff1f7; }
.byo-link { color: var(--teal); font-size: 12px; text-decoration: none; }
.byo-link:hover { text-decoration: underline; }
.byo-help { margin-top: 5px; font-size: 11.5px; color: #8fa0b0; }
.byo-msg { margin-top: 6px; font-size: 12px; white-space: pre-line; color: var(--mut); }
.byo-msg:empty { display: none; }
.byo-msg.ok { color: #5fd6a8; }
.byo-msg.bad { color: #ff9a95; }
.byo-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 6px; }
.byo-foot button { width: auto; margin: 0; padding: 6px 14px; }
.byo-foot .byo-rmall { background: transparent; color: #f2a5a9; border-color: rgba(242, 165, 169, 0.35); }
#byo-toast { position: fixed; left: 50%; bottom: 52px; transform: translate(-50%, 12px); max-width: min(560px, 92vw); z-index: 5000; padding: 10px 14px; background: rgba(40, 24, 24, 0.95); color: #ffd7d4; border: 1px solid rgba(255, 138, 133, 0.5); border-radius: 10px; font-size: 12.5px; line-height: 1.4; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; }
#byo-toast.on { opacity: 1; transform: translate(-50%, 0); }
@media (max-width: 520px) { .byo-card { padding: 18px 14px 14px; } .byo-mode { flex-direction: column; align-items: stretch; gap: 4px; } }

/* ---- map credits: compact, and tucked behind the control panel instead of spilling over it ---- */
.leaflet-bottom { z-index: 400; }
.leaflet-control-attribution { font-size: 9.5px !important; line-height: 1.3 !important; padding: 1px 6px !important; max-width: min(60vw, 560px); }

/* Render quality note: bottom of the 3D viewer until a model exists */
#viewer-note { position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); z-index: 4; width: min(880px, calc(100% - 24px)); box-sizing: border-box; padding: 6px 12px 7px; background: var(--glass); border: 1px solid var(--line); border-radius: 10px; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); color: var(--mut); font-size: 10.5px; line-height: 1.45; }
#viewer-note > b { color: var(--text); font-size: 11px; font-weight: 600; margin-right: 6px; }
#viewer-note span b { color: var(--text); font-weight: 600; }
#viewer-note a { margin-left: 4px; color: var(--teal); text-decoration: none; font-weight: 500; white-space: nowrap; }
#viewer-note a:hover { text-decoration: underline; }
#status { margin-bottom: 6px; }
