:root { 
    --google-blue: #1a73e8; 
    --text-dark: #202124; 
    --border-color: #dadce0;
    --bg-dark-tooltip: #1e1e1e;
}

body, html { 
    width: 100%; 
    height: 100%; 
    overflow: hidden; 
    background: #e5e3df; 
    touch-action: manipulation; 
    color: var(--text-dark); 
    font-size: 14px;
    line-height: 1.5;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

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

#map { 
    width: 100%; 
    height: 100%; 
    position: absolute; 
    top: 0; 
    left: 0; 
    z-index: 1; 
}

.gmnoprint.gm-bundled-control-on-bottom {
    margin-right: 10px !important;
}
.gm-style-mtc {
    margin-right: 10px !important;
    margin-top: 16px !important;
}

.left-control-cluster {
    position: absolute; 
    top: 16px; 
    left: 16px; 
    z-index: 10;
    display: flex; 
    flex-direction: column; 
    gap: 10px; 
    width: 360px;
    max-height: calc(100vh - 32px); 
    pointer-events: none;
}
.left-control-cluster > * { 
    pointer-events: auto; 
}

.search-bar {
    background: #ffffff; 
    padding: 4px 12px; 
    border-radius: 8px;
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 6px rgba(0,0,0,0.15); 
    display: flex; 
    align-items: center; 
    width: 100%; 
    height: 48px; 
    gap: 8px;
}

.menu-toggle-btn {
    background: none; 
    border: none; 
    outline: none; 
    font-size: 20px;
    color: var(--text-dark); 
    cursor: pointer; 
    display: flex; 
    align-items: center;
    justify-content: center; 
    width: 32px; 
    height: 32px; 
    border-radius: 4px;
    transition: background 0.15s ease;
}
.menu-toggle-btn:hover { 
    background: #f0f0f0; 
}

.search-bar input { 
    border: none; 
    outline: none; 
    font-size: 15px; 
    width: 100%; 
    color: var(--text-dark); 
    font-family: inherit;
}

.side-panel { 
    background: #ffffff; 
    padding: 18px; 
    border-radius: 8px; 
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15); 
    overflow-y: auto; 
    max-height: calc(100vh - 100px);
    display: none;
}
.side-panel h3 { 
    font-size: 16px; 
    font-weight: 700; 
    margin-bottom: 12px; 
    color: #111111; 
}

.layer-item { 
    display: flex; 
    align-items: center; 
    gap: 10px; 
    margin: 8px 0; 
    font-size: 14px; 
    cursor: pointer; 
    color: var(--text-dark); 
}
.layer-item input { 
    width: 18px; 
    height: 18px; 
    accent-color: var(--google-blue); 
    cursor: pointer; 
}

.cic-info { 
    margin-top: 16px; 
    padding-top: 14px; 
    border-top: 1px solid var(--border-color); 
    font-size: 13px; 
    color: #5f6368; 
    line-height: 1.5; 
}
.cic-info h4 { 
    font-size: 14px; 
    font-weight: 700; 
    color: #202124; 
    margin-bottom: 4px; 
}

.my-location-btn {
    position: absolute; 
    bottom: 105px; 
    right: 10px; 
    z-index: 10;
    width: 40px; 
    height: 40px; 
    background: #ffffff; 
    border-radius: 4px;
    box-shadow: rgba(0, 0, 0, 0.3) 0px 1px 4px -1px; 
    display: flex; 
    justify-content: center; 
    align-items: center;
    cursor: pointer; 
    border: none; 
    outline: none;
}
.my-location-btn:hover { 
    background: #f4f4f4; 
}

/* Маркеры на карте */
.custom-map-pin {
    position: relative; 
    width: 44px; 
    height: 44px; 
    background: #ffffff;
    border: 2px solid var(--google-blue); 
    border-radius: 8px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.35); 
    cursor: pointer; 
    transition: transform 0.15s ease;
    pointer-events: auto;
}
.custom-map-pin:hover { 
    transform: scale(1.18); 
    border-color: #d93025; 
    z-index: 100; 
}
.custom-map-pin img { 
    width: 100%; 
    height: 100%; 
    object-fit: cover; 
    border-radius: 6px; 
    pointer-events: none;
}

#map-custom-tooltip {
    position: absolute;
    display: none;
    z-index: 9999;
    pointer-events: none;
    padding: 14px 16px;
    width: 260px;
    color: #ffffff;
    font-size: 13px;
    line-height: 1.5;
    background: var(--bg-dark-tooltip);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.35);
    border: 1px solid #333333;
    font-family: inherit;
}
#map-custom-tooltip h5 {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 8px;
    color: #ffffff;
    line-height: 1.3;
}
#map-custom-tooltip .img-box {
    width: 100%;
    height: 130px;
    background: #111111;
    border-radius: 8px;
    border: 1px solid #333333;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
#map-custom-tooltip img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
}
#map-custom-tooltip .tooltip-desc {
    font-size: 13px;
    color: #e0e0e0;
    line-height: 1.5;
}

/* Реестр альбомов */
.full-registry-modal {
    position: fixed; 
    top: 0; 
    left: 0; 
    width: 100vw; 
    height: 100vh;
    background: #ffffff; 
    z-index: 2000; 
    display: none;
    flex-direction: column; 
    color: #212529; 
    overflow: hidden;
    font-family: inherit;
}

.registry-top-bar {
    height: 56px; 
    padding: 0 20px; 
    display: flex; 
    align-items: center;
    justify-content: space-between; 
    border-bottom: 1px solid var(--border-color);
    background: #ffffff; 
    flex-shrink: 0;
}
.registry-title { 
    font-size: 16px; 
    font-weight: 700; 
    color: #111111; 
    text-overflow: ellipsis; 
    overflow: hidden; 
    white-space: nowrap; 
}
.registry-close-btn { 
    cursor: pointer; 
    font-size: 32px; 
    color: #5f6368; 
    line-height: 1; 
    padding: 0 8px; 
}

.registry-body { 
    flex: 1; 
    display: flex; 
    height: calc(100vh - 56px); 
    overflow: hidden; 
}

.registry-sidebar {
    width: 340px; 
    border-right: 1px solid var(--border-color); 
    padding: 24px;
    display: flex; 
    flex-direction: column; 
    gap: 16px; 
    background: #f8f9fa; 
    overflow-y: auto; 
    flex-shrink: 0;
}
.registry-sidebar h2 { 
    font-size: 20px; 
    font-weight: 700; 
    color: #111111; 
    line-height: 1.3; 
}
.registry-sidebar p { 
    font-size: 14px; 
    color: #4a4d51; 
    line-height: 1.6; 
}

.meta-info-badge {
    background: #ffffff; 
    border: 1px solid var(--border-color); 
    border-radius: 10px;
    padding: 14px; 
    display: flex; 
    flex-direction: column; 
    gap: 8px; 
    font-size: 13px;
}
.meta-info-item { 
    display: flex; 
    justify-content: space-between; 
    color: #3c4043; 
}
.meta-info-item strong { 
    color: #111111; 
    font-weight: 600; 
}

.registry-content { 
    flex: 1; 
    padding: 24px; 
    overflow-y: auto; 
    background: #ffffff; 
}

.bundles-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); 
    gap: 20px; 
    width: 100%; 
}

.bundle-card {
    border-radius: 12px; 
    border: 1px solid var(--border-color); 
    padding: 10px; 
    overflow: visible; 
    cursor: pointer;
    transition: all 0.2s ease-in-out; 
    background: #ffffff; 
    display: flex; 
    flex-direction: column; 
    gap: 10px; 
    position: relative;
}
.bundle-card:hover { 
    transform: translateY(-4px); 
    box-shadow: 0 8px 20px rgba(0,0,0,0.12); 
    border-color: var(--google-blue); 
}

.bundle-card .img-wrapper {
    width: 100%; 
    height: 200px; 
    border-radius: 8px; 
    overflow: hidden; 
    background: #f1f3f4;
    display: flex; 
    align-items: center; 
    justify-content: center; 
    position: relative;
}
.bundle-card .img-wrapper img { 
    max-width: 100%;
    max-height: 100%;
    object-fit: contain; 
    display: block;
}

.bundle-card-footer { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    font-size: 14px; 
    font-weight: 700; 
    color: #212529; 
    padding: 2px 4px; 
}

.custom-popover-tooltip {
    position: absolute; 
    top: 100%; 
    left: 50%; 
    transform: translateX(-50%) translateY(8px);
    width: 250px; 
    background: var(--bg-dark-tooltip); 
    color: #e0e0e0; 
    padding: 12px 14px; 
    font-size: 13px; 
    line-height: 1.5;
    border-radius: 8px; 
    box-shadow: 0 8px 24px rgba(0,0,0,0.35); 
    border: 1px solid #333333;
    opacity: 0; 
    visibility: hidden; 
    transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
    z-index: 500; 
    pointer-events: none; 
    text-align: left;
    font-family: inherit;
}
.custom-popover-tooltip::before {
    content: "";
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 6px;
    border-style: solid;
    border-color: transparent transparent #333333 transparent;
    display: block !important;
}
.bundle-card:hover .custom-popover-tooltip {
    opacity: 1; 
    visibility: visible; 
    transform: translateX(-50%) translateY(12px);
}

/* Инспектор */
.inspector-modal {
    position: fixed; 
    top: 0; 
    left: 0; 
    width: 100vw; 
    height: 100vh;
    background: #000000; 
    z-index: 3000; 
    display: none;
    flex-direction: column; 
    color: #ffffff; 
    touch-action: none;
    font-family: inherit;
}

.inspector-top-bar {
    height: 60px; 
    padding: 0 16px; 
    display: flex; 
    align-items: center;
    justify-content: space-between; 
    background: #141414;
    border-bottom: 1px solid #282828; 
    z-index: 200; 
    gap: 12px; 
    flex-shrink: 0;
}

.inspector-modal:fullscreen .inspector-top-bar,
.inspector-modal:-webkit-full-screen .inspector-top-bar { 
    display: none !important; 
}

.btn-group-cluster { 
    display: flex; 
    align-items: center; 
    gap: 8px; 
    flex-shrink: 0; 
}

.nav-btn {
    background: #222222; 
    border: 1px solid #3d3d3d; 
    color: #e0e0e0;
    padding: 8px 16px; 
    border-radius: 20px; 
    cursor: pointer; 
    font-size: 13px; 
    font-weight: 500;
    transition: all 0.15s ease; 
    white-space: nowrap; 
    height: 36px; 
    display: inline-flex; 
    align-items: center; 
    justify-content: center;
}
.nav-btn:hover { 
    background: #333333; 
    color: #ffffff; 
    border-color: #555555; 
}
.nav-btn.active { 
    background: var(--google-blue); 
    color: #ffffff; 
    border-color: var(--google-blue); 
}
.nav-btn.active-toggle { 
    background: #d97706; 
    color: #ffffff; 
    border-color: #f59e0b; 
}

.inspector-viewport { 
    flex: 1; 
    position: relative; 
    display: flex; 
    justify-content: center; 
    align-items: center; 
    overflow: hidden; 
    padding: 0; 
    width: 100%; 
    height: calc(100vh - 60px);
}

.click-zone { 
    position: absolute; 
    top: 0; 
    bottom: 0; 
    width: 12%; 
    z-index: 100; 
    cursor: pointer; 
    display: flex; 
    align-items: center; 
    font-size: 38px; 
    color: rgba(255,255,255,0.4); 
    padding: 16px; 
    user-select: none; 
    transition: color 0.15s ease, background 0.15s ease;
    background: transparent;
}
.click-zone-left { 
    left: 0; 
    justify-content: flex-start; 
}
.click-zone-right { 
    right: 0; 
    justify-content: flex-end; 
}

.click-zone:hover { 
    color: rgba(255,255,255,0.95); 
}
.click-zone-left:hover {
    background: linear-gradient(to right, rgba(0,0,0,0.4) 0%, rgba(0,0,0,0) 100%);
}
.click-zone-right:hover {
    background: linear-gradient(to left, rgba(0,0,0,0.4) 0%, rgba(0,0,0,0) 100%);
}

.unified-viewer-box {
    position: relative; 
    width: 84vw; 
    height: 82vh; 
    max-width: 1300px;
    max-height: 850px;
    display: flex; 
    justify-content: center; 
    align-items: center;
    overflow: hidden; 
    margin: auto;
    transition: all 0.2s ease;
}

.inspector-modal:fullscreen .unified-viewer-box,
.inspector-modal:-webkit-full-screen .unified-viewer-box {
    width: 98vw !important;
    height: 96vh !important;
    max-width: none !important;
    max-height: none !important;
}

.img-layer-holder {
    position: absolute;
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%;
    display: flex; 
    justify-content: center; 
    align-items: center;
    pointer-events: auto;
    cursor: zoom-in;
}

.layer-img {
    position: absolute; 
    width: 100%; 
    height: 100%; 
    object-fit: contain; 
    object-position: center;
    display: block;
    pointer-events: none;
}

#master-bg-img { 
    z-index: 1; 
}
#slave-fg-img { 
    z-index: 2; 
    clip-path: polygon(0 0, 50% 0, 50% 100%, 0 100%); 
}

.split-divider-line {
    position: absolute; 
    top: 0; 
    bottom: 0; 
    width: 40px;
    z-index: 50; 
    left: 50%; 
    transform: translateX(-50%);
    display: none; 
    cursor: ew-resize; 
    touch-action: none;
}
.split-divider-line::before {
    content: ""; 
    position: absolute; 
    top: 0; 
    bottom: 0; 
    left: 50%; 
    transform: translateX(-50%);
    width: 3px; 
    background: var(--google-blue); 
    box-shadow: 0 0 8px rgba(0,0,0,0.8);
}
.split-divider-line::after {
    content: "↔"; 
    position: absolute; 
    top: 50%; 
    left: 50%; 
    transform: translate(-50%, -50%);
    width: 48px; 
    height: 48px; 
    background: var(--google-blue); 
    color: #ffffff;
    border-radius: 50%; 
    display: flex; 
    align-items: center; 
    justify-content: center;
    font-size: 22px; 
    font-weight: bold; 
    box-shadow: 0 4px 16px rgba(0,0,0,0.8);
    border: 2px solid #ffffff;
}

#three-viewport-box { 
    width: 100% !important; 
    height: 100% !important; 
    display: none; 
    position: absolute; 
    top: 0; 
    left: 0; 
    z-index: 10; 
    touch-action: none;
}
#three-viewport-box canvas { 
    width: 100% !important; 
    height: 100% !important; 
    outline: none; 
    display: block; 
}

#youtube-player-frame { 
    width: 100%; 
    height: 100%; 
    border: none; 
    display: none; 
    z-index: 20; 
}

.ar-connect-box {
    width: 320px; 
    height: 600px; 
    max-height: 78vh; 
    display: none; 
    flex-direction: column;
    justify-content: space-between; 
    align-items: center; 
    background: #18181b;
    border-radius: 40px; 
    text-align: center; 
    padding: 30px 20px 20px 20px; 
    border: 5px solid #3f3f46;
    box-shadow: 0 20px 50px rgba(0,0,0,0.9); 
    margin: auto; 
    z-index: 20; 
    position: relative;
}
.ar-connect-box::before {
    content: ""; 
    position: absolute; 
    top: 12px; 
    width: 80px; 
    height: 6px; 
    background: #3f3f46; 
    border-radius: 4px;
}
.ar-connect-box::after {
    content: ""; 
    position: absolute; 
    bottom: 8px; 
    width: 110px; 
    height: 4px; 
    background: #52525b; 
    border-radius: 2px;
}
.qr-card { 
    background: #ffffff; 
    padding: 20px; 
    border-radius: 24px; 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    gap: 12px; 
    color: #000000; 
    width: 100%; 
    margin-top: 10px;
}