html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
    background: #000;
    font-family: Arial, Helvetica, sans-serif;
    color: #fff;
}

#pano {
    width: 100%;
    height: 100%;
    position: absolute;
    inset: 0;
}

/* ===== Logo / tiêu đề dự án ===== */
#brand {
    position: absolute;
    top: 18px;
    left: 22px;
    z-index: 20;
    pointer-events: none;
    text-shadow: 0 2px 8px rgba(0, 0, 0, .7);
}
#brand .name {
    font-size: 22px;
    font-weight: bold;
    letter-spacing: 2px;
    color: #2563eb;
}
#brand .sub {
    font-size: 11px;
    letter-spacing: 4px;
    opacity: .85;
}
/* Logo ảnh (config.logo) — thay chữ tên dự án ở góc trái */
#brand .brand-logo {
    display: block;
    max-height: 52px;
    max-width: 240px;
    object-fit: contain;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, .55));
}
/* Logo trên màn hình chào */
.intro-logo {
    display: block;
    margin: 0 auto 16px;
    max-height: 110px;
    max-width: min(320px, 60vw);
    object-fit: contain;
    filter: drop-shadow(0 4px 16px rgba(0, 0, 0, .5));
}

/* ===== Nhãn card kiểu Diamond Square =====
   Màu điều khiển bằng biến — đổi trong form "Giao diện & Bộ mẫu" hoặc theo THEME */
:root {
    --lb-bg: rgba(250, 246, 238, .94);   /* nền card (và mũi nhọn dưới card) */
    --lb-icon: #60a5fa;                  /* màu icon */
    --lb-text: #17233e;                  /* màu chữ */
    --lb-line: rgba(255, 255, 255, .9);  /* đường nối xuống */
    --lb-dot: #2563eb;                   /* chấm neo phát sáng */
    --lb-w: 0px;                         /* chiều rộng tối thiểu (0 = tự khít) */
    --lb-h: 0px;                         /* chiều cao tối thiểu (0 = tự khít) */
    --lb-icon-size: 30px;                /* cỡ icon */
    --lb-font: 12.5px;                   /* cỡ chữ */
}
div.vr-label {
    cursor: default;
    pointer-events: none;
}
.vr-label__box {
    position: absolute;
    z-index: 2;              /* card + mũi nhọn nằm TRÊN đường nối */
    bottom: 50px;
    left: 50%;
    transform: translateX(-50%) translateY(16px);
    opacity: 0;
    transition: transform .45s ease .3s, opacity .45s ease .3s;
    white-space: nowrap;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: var(--lb-w, 0px);
    min-height: var(--lb-h, 0px);
    gap: 12px;
    padding: 10px 20px 10px 14px;
    background: var(--lb-bg);
    border-radius: 8px;
    box-shadow: 0 10px 28px rgba(20, 25, 40, .35);
}
.vr-label__box::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 7px solid transparent;
    border-top: 8px solid var(--lb-bg);
}
.vr-label__icon {
    flex: none;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--lb-icon);
}
.vr-label__icon svg {
    width: var(--lb-icon-size, 30px);
    height: var(--lb-icon-size, 30px);
    fill: currentColor;
    stroke: currentColor;
    stroke-width: .8;
    stroke-linejoin: round;
}
.vr-label__title {
    display: block;
    font-size: var(--lb-font, 12.5px);
    font-weight: bold;
    letter-spacing: .4px;
    text-transform: uppercase;
    color: var(--lb-text);
}
.vr-label__sub {
    display: block;
    margin-top: 3px;
    font-size: var(--lb-font, 12.5px);
    font-weight: bold;
    letter-spacing: .4px;
    color: var(--lb-text);
}
.vr-label__line {
    position: absolute;
    z-index: 1;              /* đường nối nằm dưới card, trên nền ảnh */
    bottom: 9px;
    left: 50%;
    width: 0;
    height: 34px;
    border-left: 1.5px solid var(--lb-line);
    /* translateX(-50%) tính theo border-box (gồm cả border) → đường luôn
       đúng tâm dù dày mỏng bao nhiêu, thẳng hàng với mũi nhọn card + chấm neo */
    transform: translateX(-50%) scaleY(0);
    transform-origin: bottom;
    transition: transform .35s ease .12s;
}
.vr-label__dot {
    position: absolute;
    z-index: 2;              /* chấm neo đè lên chân đường nối cho liền mạch */
    bottom: -4px;
    left: 50%;
    width: 10px;
    height: 10px;
    margin-left: -5px;
    border-radius: 50%;
    background: radial-gradient(circle, #ffffff 0%, var(--lb-dot) 60%, var(--lb-dot) 100%);
    box-shadow:
        0 0 10px 3px color-mix(in srgb, var(--lb-dot) 80%, transparent),
        0 0 26px 10px color-mix(in srgb, var(--lb-dot) 40%, transparent);
    opacity: 0;
    transform: scale(.3);
    transition: transform .25s ease, opacity .25s ease;
}
div.vr-label.show { pointer-events: auto; }
div.vr-label.show .vr-label__box {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}
div.vr-label.show .vr-label__line { transform: translateX(-50%) scaleY(1); }
div.vr-label.show .vr-label__dot { transform: scale(1); opacity: 1; animation: dotglow 2s ease-in-out infinite; }
@keyframes dotglow {
    0%, 100% { box-shadow: 0 0 10px 3px color-mix(in srgb, var(--lb-dot) 80%, transparent), 0 0 26px 10px color-mix(in srgb, var(--lb-dot) 40%, transparent); }
    50%      { box-shadow: 0 0 16px 6px color-mix(in srgb, var(--lb-dot) 95%, transparent), 0 0 38px 16px color-mix(in srgb, var(--lb-dot) 60%, transparent); }
}

/* ===== Hotspot CHUYỂN CẢNH ===== */
div.vr-link {
    pointer-events: auto;
    cursor: pointer;
}
.vr-link__btn {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .16);
    border: 2px solid rgba(255, 255, 255, .92);
    backdrop-filter: blur(3px);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .4);
    animation: linkpulse 2.2s ease-out infinite;
    transition: background .2s, transform .2s;
}
div.vr-link:hover .vr-link__btn {
    background: rgba(255, 255, 255, .14);
    transform: translate(-50%, -50%) scale(1.08);
}
.vr-link__btn svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: #fff;
    stroke-width: 2.4;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.vr-link__label {
    position: absolute;
    top: calc(50% + 28px);
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
    font-size: 11.5px;
    font-weight: bold;
    letter-spacing: .8px;
    text-transform: uppercase;
    color: #fff;
    text-shadow: 0 1px 6px rgba(0, 0, 0, .85);
}
@keyframes linkpulse {
    0%   { box-shadow: 0 4px 14px rgba(0, 0, 0, .4), 0 0 0 0 rgba(255, 255, 255, .55); }
    70%  { box-shadow: 0 4px 14px rgba(0, 0, 0, .4), 0 0 0 14px rgba(255, 255, 255, 0); }
    100% { box-shadow: 0 4px 14px rgba(0, 0, 0, .4), 0 0 0 0 rgba(255, 255, 255, 0); }
}

/* ===== Màn hình chào (intro) ===== */
#intro {
    position: absolute;
    inset: 0;
    z-index: 80;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #000;
    transition: opacity .7s ease;
}
#intro.hide { opacity: 0; pointer-events: none; }
.intro-bg {
    position: absolute;
    inset: -40px;
    background-size: cover;
    background-position: center;
    filter: blur(14px) brightness(.5);
}
.intro-content {
    position: relative;
    text-align: center;
    padding: 0 20px;
}
.intro-title {
    font-size: clamp(26px, 5vw, 46px);
    font-weight: bold;
    letter-spacing: 4px;
    color: #2563eb;
    text-shadow: 0 4px 18px rgba(0, 0, 0, .6);
}
.intro-sub {
    margin-top: 10px;
    letter-spacing: 6px;
    font-size: 13px;
    opacity: .85;
}
#intro-start {
    margin-top: 36px;
    padding: 14px 36px;
    border-radius: 999px;
    border: 1.5px solid #fff;
    background: rgba(255, 255, 255, .12);
    color: #fff;
    font-family: inherit;
    font-weight: bold;
    letter-spacing: 2px;
    font-size: 14px;
    cursor: pointer;
    backdrop-filter: blur(2px);
    transition: background .2s, transform .2s;
}
#intro-start:hover {
    background: rgba(255, 255, 255, .3);
    transform: scale(1.04);
}

/* Ẩn hộp mặc định của Pannellum */
.pnlm-panorama-info { display: none !important; }
.pnlm-about-msg { display: none !important; }

/* ===== Thanh menu xanh ===== */
#menubar {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 26px;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    pointer-events: none;
}
.mb-pill {
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 22px;
    color: #fff;   /* màu chữ + icon (đổi được trong Giao diện menu) */
    background: linear-gradient(180deg, #2a63c4 0%, #174084 100%);
    border-radius: 999px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, .45);
}
.mb-btn {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 8px 14px;
    background: none;
    border: 0;
    color: inherit;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 12px;
    font-weight: bold;
    letter-spacing: 1px;
    white-space: nowrap;
    cursor: pointer;
    opacity: .95;
    transition: opacity .15s, transform .15s;
}
.mb-btn:hover { opacity: 1; transform: translateY(-1px); }
.mb-btn .ic {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border: 1.5px solid currentColor;
    border-radius: 50%;
    flex: none;
}
.mb-pill.plain .ic { border: none; }
.mb-btn .ic svg {
    width: 15px;
    height: 15px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}
/* ===== Logo phình to giữa thanh menu (menubar.logoCenter) ===== */
.mb-pill.haslogo { overflow: visible; }
.mb-logo {
    pointer-events: auto;
    cursor: pointer;
    flex: none;
    width: 68px;
    height: 68px;
    margin: -22px 10px;
    border-radius: 50%;
    background: #ffffff center/cover no-repeat;
    border: 3px solid rgba(255, 255, 255, .95);
    box-shadow: 0 6px 20px rgba(0, 0, 0, .45);
    transition: transform .2s ease;
}
.mb-logo:hover { transform: scale(1.08); }

.mb-arrow {
    pointer-events: auto;
    color: #fff;
    font-size: 30px;
    font-weight: bold;
    letter-spacing: -8px;
    padding: 0 12px 4px 6px;
    cursor: pointer;
    text-shadow: 0 2px 8px rgba(0, 0, 0, .8);
    user-select: none;
    transition: transform .15s;
}
.mb-arrow:hover { transform: scale(1.15); }

/* ===== Kiểu "Thanh icon gọn" (compact): icon nổi + nhãn nhỏ dưới, như control bar ===== */
.mb-pill.compact { padding: 5px 7px; gap: 1px; }
.mb-pill.compact .mb-btn {
    flex-direction: column;
    gap: 3px;
    padding: 7px 14px;
    border-radius: 12px;
    font-size: 9px;
    letter-spacing: .5px;
    opacity: .8;
    transition: background .18s ease, transform .18s ease, opacity .18s ease;
}
.mb-pill.compact .mb-btn:hover {
    background: rgba(255, 255, 255, .16);
    opacity: 1;
    transform: translateY(-2px);
}
.mb-pill.compact .mb-btn:active { transform: translateY(0); }
.mb-pill.compact .mb-btn .ic {
    width: 22px;
    height: 22px;
    border: none;
    margin-bottom: 1px;
    transition: transform .18s ease;
}
.mb-pill.compact .mb-btn:hover .ic { transform: scale(1.12); }
.mb-pill.compact .mb-btn .ic svg { width: 19px; height: 19px; stroke-width: 2; }
.mb-pill.compact .mb-lbl { font-size: 9px; }

/* ===== Popup ===== */
#modal {
    position: absolute;
    inset: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(5, 9, 20, .68);
    backdrop-filter: blur(10px) saturate(1.15);
    -webkit-backdrop-filter: blur(10px) saturate(1.15);
}
#modal.hidden { display: none; }
.modal-box {
    position: relative;
    max-width: min(860px, 92vw);
    max-height: 86vh;
    background: linear-gradient(165deg, rgba(30, 42, 70, .92) 0%, rgba(10, 15, 30, .97) 100%);
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 20px;
    box-shadow:
        0 30px 90px rgba(0, 0, 0, .65),
        inset 0 1px 0 rgba(255, 255, 255, .08);
    overflow: hidden;
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}
.modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 2;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, .25);
    background: rgba(255, 255, 255, .08);
    color: #fff;
    font-size: 13px;
    cursor: pointer;
    transition: background .2s, transform .25s;
}
.modal-close:hover {
    background: rgba(255, 255, 255, .22);
    transform: rotate(90deg);
}
.modal-content {
    padding: 30px;
    color: #fff;
    font-size: 14px;
    line-height: 1.7;
    overflow: auto;
    max-height: 86vh;
    text-align: center;
}
.modal-content h2 {
    margin: 0 0 12px;
    color: #2563eb;
    letter-spacing: 1px;
}
.modal-content iframe {
    width: min(800px, 88vw);
    aspect-ratio: 16 / 9;
    border: 0;
    display: block;
}
.modal-content img { max-width: 100%; border-radius: 8px; }

/* ===== Trình phát video tùy biến (giấu toàn bộ giao diện YouTube) ===== */
.modal-box:has(.vplayer) { max-width: min(1160px, 94vw); }
.vplayer { width: min(1080px, 90vw); }
.vplayer .vp-frame {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: 12px;
    background: #000;
}
.vplayer .vp-frame:fullscreen { border-radius: 0; }
/* Cắt mép trên/dưới của khung YouTube để giấu thanh tiêu đề + logo */
.vplayer .vp-yt {
    position: absolute;
    left: 0;
    width: 100%;
    height: calc(100% + 124px);
    top: -62px;
    border: 0;
}
.vplayer .vp-native {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
}
/* Lớp chắn: chặn giao diện YouTube; click = phát / tạm dừng */
.vplayer .vp-shield {
    position: absolute;
    inset: 0;
    cursor: pointer;
}
/* Nút tròn giữa — chỉ hiện khi đang tạm dừng */
.vplayer .vp-center {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 76px;
    height: 76px;
    border-radius: 50%;
    background: rgba(10, 16, 30, .55);
    border: 2px solid rgba(255, 255, 255, .9);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform .15s, background .2s;
}
.vplayer.paused .vp-center { display: flex; }
.vplayer .vp-center:hover {
    background: rgba(10, 16, 30, .75);
    transform: translate(-50%, -50%) scale(1.07);
}
.vplayer .vp-center svg { width: 30px; height: 30px; fill: #fff; margin-left: 4px; }
/* Thanh điều khiển nằm TRONG video: hover hoặc đang dừng mới hiện */
.vplayer .vp-bar {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 26px 14px 12px;
    background: linear-gradient(0deg, rgba(0, 0, 0, .65), rgba(0, 0, 0, 0));
    opacity: 0;
    transition: opacity .25s;
}
.vplayer .vp-frame:hover .vp-bar,
.vplayer.paused .vp-bar { opacity: 1; }
.vplayer .vp-spacer { flex: 1; }
.vplayer .vp-btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 1.5px solid rgba(255, 255, 255, .75);
    background: rgba(255, 255, 255, .1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background .2s;
}
.vplayer .vp-btn:hover { background: rgba(255, 255, 255, .28); }
.vplayer .vp-btn svg { width: 18px; height: 18px; fill: #fff; }
.vplayer .vp-btn svg.ln { fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.modal-content .popup-desc {
    text-align: left;
    margin: 0 auto 14px;
    max-width: 640px;
    line-height: 1.8;
    opacity: .95;
}
/* Nhãn có popup: hiệu ứng gợi ý click được */
.vr-label__box.has-popup:hover {
    box-shadow: 0 10px 28px rgba(20, 25, 40, .35), 0 0 0 2px rgba(37, 99, 235, .8);
}

/* ===== Lớp SVG tuyến đường + khu vực ===== */
#overlay {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    /* Phải nổi trên canvas ảnh 360 (render-container), nhưng đứng trước
       .pnlm-ui (cùng z-index 1, thứ tự DOM quyết định) nên nhãn vẫn nằm trên hình vẽ */
    z-index: 1;
}
#overlay path.route {
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 16 12;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, .6));
    animation: dashflow 1.1s linear infinite;
}
@keyframes dashflow {
    to { stroke-dashoffset: -28; }
}
/* ===== Kiểu nét tuyến đường (shape.style — chọn trong editor) =====
   Mặc định .route là nét đứt chạy; các kiểu dưới đây ghi đè. */
#overlay path.route.rs-dashstill { animation: none; }               /* nét đứt tĩnh */
#overlay path.route.rs-solid,
#overlay path.route.rs-glow,
#overlay path.route.rs-casing,
#overlay path.route.rs-casing-under {
    stroke-dasharray: none;                                          /* nét liền */
    animation: none;
}
#overlay path.route.rs-dots {                                        /* chấm bi */
    stroke-dasharray: 0.1 13;
    stroke-linecap: round;
    animation: none;
}
/* Viền bản đồ: lớp trắng dưới đổ bóng, lõi màu trên không bóng đôi */
#overlay path.route.rs-casing { filter: none; }
#overlay path.zone {
    stroke-linejoin: round;
    stroke-linecap: round;
    stroke-dasharray: 10 8;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, .45));
    animation: zonepulse 2.6s ease-in-out infinite;
}
@keyframes zonepulse {
    0%, 100% { fill-opacity: .55; }
    50%      { fill-opacity: 1; }
}
#overlay circle.vert {
    fill: #ff4757;
    stroke: #fff;
    stroke-width: 2;
    pointer-events: all;
    cursor: grab;
}
#overlay circle.vert:hover { fill: #2563eb; }

/* Đường mờ xem trước khi đang vẽ */
#overlay path.ghost {
    fill: none;
    stroke: rgba(255, 255, 255, .75);
    stroke-width: 2;
    stroke-dasharray: 6 6;
    pointer-events: none;
}

/* Con trỏ dấu + khi đang ở chế độ đặt nhãn / vẽ hình */
#pano.drawing, #pano.drawing * { cursor: crosshair !important; }
/* Rê chuột gần đỉnh: con trỏ bàn tay cầm nắm (đè cả crosshair khi đang vẽ) */
#pano.vert-hover, #pano.vert-hover * { cursor: grab !important; }
/* Đỉnh đang được rê gần: phóng to + đổi màu xanh để biết "cầm được rồi" */
#overlay circle.vert.hot {
    fill: #2563eb;
    stroke: #ffffff;
    stroke-width: 3;
    filter: drop-shadow(0 0 6px rgba(37, 99, 235, .9));
}
/* Chấm trắng giữa cạnh: click để chèn đỉnh mới (chế độ chỉnh đỉnh) */
#overlay circle.vert.mid {
    fill: rgba(255, 255, 255, .92);
    stroke: #e11d48;
    stroke-width: 2;
}
#overlay circle.vert.mid.hot {
    fill: #2563eb;
    stroke: #ffffff;
    stroke-width: 3;
    filter: drop-shadow(0 0 6px rgba(37, 99, 235, .9));
}

/* ===== Toast ===== */
#toast {
    position: absolute;
    left: 50%;
    bottom: 110px;
    transform: translateX(-50%);
    z-index: 60;
    padding: 10px 20px;
    background: rgba(0, 0, 0, .8);
    color: #fff;
    font-size: 13px;
    border-radius: 20px;
    opacity: 0;
    pointer-events: none;
    transition: opacity .3s;
}
#toast.show { opacity: 1; }

/* ===== BẢNG BIÊN TẬP (Studio) ===== */
#ed-panel {
    position: absolute;
    top: 70px;
    left: 16px;
    z-index: 40;
    width: 250px;
    background: rgba(9, 17, 33, .82); backdrop-filter: blur(8px);
    border: 1px solid #2563eb55;
    border-radius: 12px;
    padding: 12px;
    font-size: 12px;
    user-select: none;
}
.ed-head {
    font-weight: bold;
    letter-spacing: 1px;
    color: #2563eb;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.ed-back { color: #9fb6dd; font-size: 11px; text-decoration: none; font-weight: normal; }
.ed-back:hover { color: #fff; }
#ed-panel button {
    font-family: inherit;
    margin: 2px;
    padding: 6px 10px;
    background: rgba(255, 255, 255, .1);
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 8px;
    color: #fff;
    font-size: 11px;
    font-weight: bold;
    cursor: pointer;
}
#ed-panel button:hover { background: rgba(37, 99, 235, .4); }
#ed-panel .ed-modes button.on {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}
#ed-panel button.save {
    background: #16a34a;
    border-color: #16a34a;
}
/* Nút "Hoàn tất hình" nhấp nháy khi đã đủ điểm để chốt */
#ed-panel button.ready {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
    animation: readypulse 1s ease-in-out infinite;
}
@keyframes readypulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(37, 99, 235, .7); }
    50%      { box-shadow: 0 0 0 6px rgba(37, 99, 235, 0); }
}
#ed-panel button.save:hover { background: #15803d; }
.ed-hint { margin: 8px 2px; line-height: 1.5; opacity: .85; }
.ed-sub { margin: 8px 2px 4px; opacity: .6; font-size: 11px; }
.ed-shape-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4px;
    padding: 3px;
    margin: 2px 0;
    background: rgba(255, 255, 255, .06);
    border-radius: 6px;
}
.ed-shape-row button { padding: 4px 7px !important; }
.ed-shape-row .shape-name {
    flex: 1;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 7px;
    background: none !important;
    border: none !important;
    font-weight: normal !important;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}
.ed-shape-row .shape-name:hover { color: #2563eb; }
.ed-shape-row .sw {
    flex: none;
    width: 14px;
    height: 14px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, .5);
}

/* Hàng chọn màu + mẫu nhanh trong form hình vẽ */
.ed-colorrow {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
}
.ed-colorrow input[type=color] {
    width: 44px;
    height: 32px;
    padding: 2px;
    background: #081c3f;
    border: 1px solid #2c4a80;
    border-radius: 8px;
    cursor: pointer;
}
.ed-colorrow input[type=range] { flex: 1; }
.ed-sizegrid {
    display: grid;
    grid-template-columns: 92px 1fr;
    align-items: center;
    gap: 8px 12px;
    margin-top: 4px;
    font-size: 12px;
}
.ed-sizegrid span { white-space: nowrap; }
.ed-sizegrid b { font-weight: 600; opacity: .6; margin-left: 2px; }
.ed-sizegrid input[type=range] { width: 100%; }
.ed-presets { display: flex; flex-wrap: wrap; gap: 6px; }
.ed-presets .preset {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    background: #081c3f;
    border: 1px solid #2c4a80;
    border-radius: 16px;
    color: #dfe8f5;
    font-size: 11px;
    cursor: pointer;
}
.ed-presets .preset:hover { border-color: #2563eb; }
.ed-presets .preset span {
    width: 13px;
    height: 13px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, .5);
}
.ed-presets .preset.theme {
    border-color: #2563ebaa;
    font-weight: bold;
}
.ed-presets .preset.theme span {
    width: 22px;
    border-radius: 6px;
}
.ed-actions { margin-top: 10px; display: flex; flex-direction: column; gap: 4px; }
.ed-actions button { width: 100%; }
.ed-tabs { display: flex; flex-wrap: wrap; gap: 2px; margin-bottom: 6px; }
.ed-tabs button.on { background: #2563eb; border-color: #4d8af0; }

/* Form trong modal của editor */
.ed-form { text-align: left; min-width: min(420px, 84vw); }
.ed-form h2 { text-align: center; }
.ed-form label {
    display: block;
    font-size: 11px;
    margin: 12px 0 4px;
    opacity: .75;
    text-transform: uppercase;
    letter-spacing: .5px;
}
.ed-form input[type=text], .ed-form textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 9px 11px;
    background: #081c3f;
    border: 1px solid #2c4a80;
    border-radius: 8px;
    color: #fff;
    font-size: 13px;
    font-family: inherit;
}
.ed-icons { display: flex; flex-wrap: wrap; gap: 6px; }
.ed-icons button {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #081c3f;
    border: 2px solid #2c4a80;
    border-radius: 10px;
    color: #60a5fa;
    cursor: pointer;
}
.ed-icons button svg { width: 24px; height: 24px; fill: currentColor; }
.ed-icons button.on { border-color: #2563eb; background: #14305e; }
/* Hàng cấu hình từng nút menu */
.ed-btnrow {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 5px 0;
}
.ed-btnrow input[type=checkbox] { width: 16px; height: 16px; }
.ed-btnrow .ed-btnicon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border: 1px solid #2c4a80;
    border-radius: 50%;
    color: #9fb6dd;
    flex: none;
}
.ed-btnrow .ed-btnicon svg {
    width: 13px;
    height: 13px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
}
.ed-btnrow input[type=text] { flex: 1; }
.ed-form select {
    padding: 8px 10px;
    background: #081c3f;
    border: 1px solid #2c4a80;
    border-radius: 8px;
    color: #fff;
    font-size: 13px;
    font-family: inherit;
}

.ed-form-actions { margin-top: 18px; display: flex; gap: 8px; justify-content: flex-end; }
.ed-form-actions button {
    padding: 9px 20px;
    border-radius: 8px;
    border: 0;
    font-weight: bold;
    font-size: 13px;
    cursor: pointer;
    font-family: inherit;
}
.ed-form-actions .save { background: #2ea35a; color: #fff; }
.ed-form-actions .save:hover { background: #37b968; }
.ed-form-actions .danger { background: #8d3040; color: #fff; }
.ed-form-actions .danger:hover { background: #a63a4d; }

@media (max-width: 760px) {
    #brand .name { font-size: 16px; }
    .vr-label__box { padding: 5px 12px 5px 6px; gap: 8px; }
    .vr-label__icon svg { width: 22px; height: 22px; }
    .vr-label__title, .vr-label__sub { font-size: 10.5px; }
    #menubar { gap: 6px; bottom: 14px; }
    .mb-pill {
        max-width: 78vw;
        overflow-x: auto;
        padding: 6px 14px;
        scrollbar-width: none;
    }
    .mb-pill::-webkit-scrollbar { display: none; }
    .mb-btn { padding: 6px 8px; font-size: 10px; }
    .mb-btn .ic { width: 24px; height: 24px; }
    .mb-logo { width: 52px; height: 52px; margin: -14px 6px; border-width: 2px; }
    #ed-panel { width: 200px; top: 60px; left: 8px; }
}


/* ===== Popup bản đồ trong tour ===== */
.modal-box:has(.mapviewer) { max-width: min(1160px, 94vw); }
.mapviewer { width: min(1080px, 90vw); }
.mapviewer .mp-frame {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    border-radius: 12px;
    background: #0a1526;
}
.mapviewer .mp-frame:fullscreen { border-radius: 0; }
.mapviewer .mp-map {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}
.mapviewer .mp-fabs {
    position: absolute;
    top: 12px;
    right: 12px;
    display: flex;
    gap: 8px;
}
.mapviewer .vp-btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 1.5px solid rgba(255, 255, 255, .75);
    background: rgba(10, 16, 30, .6);
    backdrop-filter: blur(3px);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background .2s;
}
.mapviewer .vp-btn:hover { background: rgba(10, 16, 30, .88); }
.mapviewer .vp-btn svg.ln { width: 18px; height: 18px; fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }


/* ===== Trình chiếu thư viện ảnh ===== */
.modal-box:has(.galviewer) { max-width: min(1160px, 94vw); }
.galviewer { width: min(1080px, 90vw); }
.galviewer .gv-frame {
    position: relative;
    width: 100%;
    height: min(66vh, 680px);   /* CỐ ĐỊNH — không nhảy khung khi chuyển ảnh */
    overflow: hidden;
    border-radius: 14px;
    background: #05080f;
    border: 1px solid rgba(255, 255, 255, .08);
}
.galviewer .gv-frame:fullscreen { border-radius: 0; height: 100% !important; }
.galviewer .gv-img {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 12.5%;
    width: 75%;
    height: 100%;
    object-fit: contain;
    cursor: zoom-in;
    transition: opacity .28s ease, transform .28s ease;
}
.galviewer .gv-frame:fullscreen .gv-img { cursor: zoom-out; }
.galviewer .gv-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, .28);
    background: rgba(255, 255, 255, .07);
    backdrop-filter: blur(6px);
    color: #fff;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    opacity: .5;
    transition: opacity .2s, background .2s, transform .15s;
}
.galviewer .gv-nav:hover {
    background: rgba(255, 255, 255, .2);
    opacity: 1;
    transform: translateY(-50%) scale(1.08);
}
.galviewer .gv-prev { left: 14px; }
.galviewer .gv-next { right: 14px; }
.galviewer .gv-count {
    position: absolute;
    right: 14px;
    top: 12px;
    padding: 4px 12px;
    border-radius: 999px;
    background: rgba(8, 12, 24, .55);
    border: 1px solid rgba(255, 255, 255, .15);
    backdrop-filter: blur(4px);
    font-size: 11px;
    font-weight: bold;
    letter-spacing: 2px;
    color: #fff;
}


/* Hiệu ứng chuyển ảnh mượt + nút điều hướng hiện rõ khi rê chuột */
.galviewer .gv-img.switching { opacity: 0; transform: scale(1.02); }
.galviewer .gv-frame:hover .gv-nav { opacity: 1; }
.galviewer .gv-frame:fullscreen .gv-img { cursor: zoom-out; }


/* ===== Slide kiểu peek: ảnh trước/sau mờ hé hai bên ===== */
.galviewer .gv-side {
    position: absolute;
    top: 10%;              /* JS tự căn theo chiều cao ảnh chính */
    height: 80%;
    width: 10.5%;
    object-fit: cover;
    border-radius: 10px;
    filter: brightness(.32) saturate(.65);
    cursor: pointer;
    transition: filter .25s, transform .25s, height .3s ease, top .3s ease;
}
.galviewer .gv-side:hover {
    filter: brightness(.55) saturate(.85);
    transform: scale(1.03);
}
.galviewer .gv-side-prev { left: 0; }
.galviewer .gv-side-next { right: 0; }
.galviewer .gv-side[hidden] { display: none; }
.galviewer .gv-frame:fullscreen .gv-side { top: 6%; height: 88%; }

/* ===== Nút chọn ảnh + danh sách tiến trình upload ===== */
.ed-uprow { margin: 4px 0 6px; }
.ed-upbtn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 16px;
    border-radius: 8px;
    border: 1px solid rgba(125, 125, 125, .45);
    background: rgba(125, 125, 125, .12);
    color: inherit;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background .2s;
}
.ed-upbtn:hover { background: rgba(125, 125, 125, .25); }
.ed-uplist { max-height: 132px; overflow-y: auto; margin-bottom: 6px; }
.ed-uprow-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 5px 0;
    font-size: 12px;
}
.ed-uprow-item .nm {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    opacity: .85;
}
.ed-uprow-item .bar {
    display: block;
    width: 110px;
    height: 5px;
    border-radius: 3px;
    background: rgba(125, 125, 125, .28);
    overflow: hidden;
    flex: none;
}
.ed-uprow-item .bar i {
    display: block;
    height: 100%;
    width: 0;
    border-radius: 3px;
    background: #3b82f6;
    transition: width .2s;
}
.ed-uprow-item .st { min-width: 74px; text-align: right; flex: none; }
.ed-uprow-item.done .st { color: #16a34a; font-weight: 600; }
.ed-uprow-item.done .bar i { background: #16a34a; }
.ed-uprow-item.err .st { color: #dc2626; font-weight: 600; }
.ed-uprow-item.err .bar i { background: #dc2626; width: 100%; }

/* ===== Trình bày phần giới thiệu ===== */
.info-body {
    text-align: left;
    max-width: 620px;
    margin: 0 auto;
    line-height: 1.85;
    font-size: 14.5px;
}
.info-body h2 { text-align: center; margin: 0 0 16px; }
.info-body p { margin: 0 0 12px; }
.info-body ul { margin: 0 0 12px; padding-left: 22px; }
.info-body li { margin: 5px 0; }


/* Nền mờ ambient: lấp phần hở trên/dưới bằng chính ảnh đang xem phóng to làm mờ */
.galviewer .gv-blurbg {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 12.5%;
    width: 75%;
    height: 100%;
    object-fit: cover;
    filter: blur(28px) brightness(.5) saturate(1.15);
    transform: scale(1.15);
    transition: opacity .28s ease;
}
.galviewer .gv-blurbg.switching { opacity: 0; }
