/* Only keep loading panel and other non-layer related styles */ 

body { 
    margin: 0; 
    font-family: 'Roboto', sans-serif;
    touch-action: none;
    overflow: hidden;
}

canvas { 
    display: block; 
    touch-action: none;
    -webkit-user-select: none;
    user-select: none;
    pointer-events: auto !important;
}

.in-iframe {
    pointer-events: auto !important;
    touch-action: none !important;
    z-index: 2147483647;
}

#loadingPanel {
    z-index: 2147483647 !important;
}

/* Add Roboto font */
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;500&display=swap');

/* Loading Panel Styles */
.loading-panel {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(28, 27, 31, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    font-family: 'Roboto', sans-serif;
}

.loading-content {
    background-color: rgb(255, 251, 254);
    padding: 24px;
    border-radius: 28px;
    box-shadow: 0px 8px 12px rgba(0, 0, 0, 0.16), 
                0px 4px 4px rgba(0, 0, 0, 0.08);
    text-align: center;
    min-width: 320px;
    max-width: 90%;
    color: rgb(28, 27, 31);
}

.loading-content h2 {
    margin: 0 0 16px 0;
    font-size: 24px;
    font-weight: 400;
    letter-spacing: 0.15px;
}

.progress-bar-container {
    width: 100%;
    height: 8px;
    background-color: rgb(223, 216, 226);
    border-radius: 8px;
    overflow: hidden;
    margin: 24px 0;
}

.progress-bar {
    width: 0%;
    height: 100%;
    background-color: rgb(103, 80, 164);
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.progress-text {
    font-size: 16px;
    font-weight: 500;
    letter-spacing: 0.1px;
    margin-bottom: 8px;
    color: rgb(28, 27, 31);
}

.download-stats {
    margin-top: 8px;
    font-size: 14px;
    color: #666;
    font-family: 'Roboto', sans-serif;
}

.loading-status {
    margin-top: 18px;
    font-size: 15px;
    color: #6c47a6;
    min-height: 24px;
    font-family: 'Roboto', sans-serif;
    letter-spacing: 0.1px;
    text-align: center;
    transition: color 0.2s;
}

/* Button Styles */
.layer-button {
    position: fixed;
    top: 68px;
    right: 16px;
    width: 40px;
    height: 40px;
    background: white;
    border: none;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 2147483646;
}

.layer-button:hover {
    background-color: #f5f5f5;
    transform: scale(1.05);
}

.layer-button .material-icons {
    font-size: 24px;
    color: #333;
}

.refresh-button {
    position: fixed;
    top: 120px;
    right: 16px;
    width: 40px;
    height: 40px;
    background: white;
    border: none;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 2147483646;
}

.refresh-button:hover {
    background-color: #f5f5f5;
    transform: scale(1.05);
}

.refresh-button .material-icons {
    font-size: 24px;
    color: #333;
}

.refresh-button.spinning .material-icons {
    animation: spin 1s linear infinite;
}

.info-button {
    position: fixed;
    top: 120px;
    right: 16px;
    width: 40px;
    height: 40px;
    background: white;
    border: none;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 2147483646;
}

.info-button:hover {
    background-color: #f5f5f5;
    transform: scale(1.05);
}

.info-button .material-icons {
    font-size: 24px;
    color: #333;
}

.close-button {
    position: fixed;
    top: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
    background: white;
    border: none;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 2147483646;
}

.close-button:hover {
    background-color: #f5f5f5;
    transform: scale(1.05);
}

.close-button .material-icons {
    font-size: 24px;
    color: #333;
}

.screenshot-button {
    position: fixed;
    top: 172px;
    right: 16px;
    width: 40px;
    height: 40px;
    background: white;
    border: none;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 2147483646;
}

.screenshot-button:hover {
    background-color: #f5f5f5;
    transform: scale(1.05);
}

.screenshot-button .material-icons {
    font-size: 24px;
    color: #333;
}

.screenshot-button.capturing {
    background-color: #8B5CF6;
}

.screenshot-button.capturing .material-icons {
    color: white;
}

/* Camera Button Styles */
.camera-button {
    position: fixed;
    top: 224px;
    right: 16px;
    width: 40px;
    height: 40px;
    background: white;
    border: none;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 2147483646;
}

.camera-button:hover {
    background-color: #f5f5f5;
    transform: scale(1.05);
}

.camera-button .material-icons {
    font-size: 24px;
    color: #333;
}

.comment-button:hover {
    background-color: #f5f5f5;
    transform: scale(1.05);
}

.comment-button .material-icons {
    font-size: 24px;
    color: #333;
}

.measurement-button {
    position: fixed;
    top: 276px;
    right: 16px;
    width: 40px;
    height: 40px;
    background: white;
    border: none;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 2147483646;
}

.measurement-button:hover {
    background-color: #f5f5f5;
    transform: scale(1.05);
}

.measurement-button .material-icons {
    font-size: 24px;
    color: #333;
}

.measurement-button.active {
    background-color: #8B5CF6;
}

.measurement-button.active .material-icons {
    color: white;
}

/* Fly Button Styles */
.fly-button {
    position: fixed;
    top: 328px;
    right: 16px;
    width: 40px;
    height: 40px;
    background: white;
    border: none;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 2147483646;
}

.fly-button:hover {
    background-color: #f5f5f5;
    transform: scale(1.05);
}

.fly-button .material-icons {
    font-size: 24px;
    color: #333;
}

.fly-button.active {
    background: #8B5CF6;
}

.fly-button.active .material-icons {
    color: white;
}

.fullscreen-button {
    position: fixed;
    top: 380px;
    right: 16px;
    width: 40px;
    height: 40px;
    background: white;
    border: none;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 2147483646;
}

.fullscreen-button:hover {
    background-color: #f5f5f5;
    transform: scale(1.05);
}

.fullscreen-button .material-icons {
    font-size: 24px;
    color: #333;
}

.fullscreen-button.active {
    background: #8B5CF6;
}

.fullscreen-button.active .material-icons {
    color: white;
}

/* Zoom to Fit button (desktop only) */
.zoomfit-button {
    position: fixed;
    top: 432px;
    right: 16px;
    width: 40px;
    height: 40px;
    background: white;
    border: none;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 2147483646;
}
.zoomfit-button:hover { background-color: #f5f5f5; transform: scale(1.05); }
.zoomfit-button .material-icons { font-size: 24px; color: #333; }
.zoomfit-button .zoomfit-icon { width: 24px; height: 24px; display: block; }

/* Fullscreen mode styles */
.fullscreen-mode {
    overflow: hidden;
}

/* Ensure UI elements remain accessible in fullscreen mode */
.fullscreen-mode .layer-button,
.fullscreen-mode .refresh-button,
.fullscreen-mode .info-button,
.fullscreen-mode .close-button,
.fullscreen-mode .screenshot-button,
.fullscreen-mode .comment-button,
.fullscreen-mode .measurement-button,
.fullscreen-mode .fly-button,
.fullscreen-mode .fullscreen-button,
.fullscreen-mode .display-style-dropdown {
    z-index: 2147483646;
}

/* Ensure panels remain accessible in fullscreen mode */
.fullscreen-mode .layers-panel,
.fullscreen-mode .info-panel,
.fullscreen-mode .comments-panel,
.fullscreen-mode .measurement-panel {
    z-index: 2147483645;
}

/* Ensure dialogs and overlays work in fullscreen mode */
.fullscreen-mode .dialog-overlay,
.fullscreen-mode .config-overlay {
    z-index: 2147483647;
}

.fullscreen-mode .dialog-content,
.fullscreen-mode .config-content {
    z-index: 2147483648;
}

/* Ensure instructions remain visible in fullscreen mode */
.fullscreen-mode .measurement-instruction,
.fullscreen-mode .fly-instruction,
.fullscreen-mode .fullscreen-instruction,
.fullscreen-mode .comment-instruction {
    z-index: 2147483644;
}

/* Ensure file name display remains visible in fullscreen mode */
.fullscreen-mode .file-name-display {
    z-index: 2147483643;
}

/* Ensure footer remains visible in fullscreen mode */
.fullscreen-mode .footer-container {
    z-index: 2147483643;
}

/* Ensure loading panel works in fullscreen mode */
.fullscreen-mode .loading-panel {
    z-index: 2147483649;
}

/* Layers Panel */
.layers-panel {
    position: fixed;
    top: 68px;
    right: 68px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    padding: 12px;
    width: 280px;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
    display: none;
    transition: all 0.2s ease;
    z-index: 2147483645;
}

.layers-panel.visible {
    display: block;
}

.layers-panel h3 {
    margin: 0 0 12px 0;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.layers-list {
    max-height: calc(100vh - 140px);
    overflow-y: auto;
    overflow-x: hidden;
}

.layer-item {
    display: block;
    padding: 4px 0;
    border-bottom: 1px solid #f0f0f0;
    position: relative;
}

.layer-item:last-child {
    border-bottom: none;
}

.layer-checkbox-container {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 28px;
    min-height: 28px;
}

.layer-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    font-size: 12px;
    color: #666;
    cursor: pointer;
    user-select: none;
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.layer-toggle:hover {
    color: #333;
    background-color: #f5f5f5;
    border-radius: 2px;
}

.layer-checkbox {
    -webkit-appearance: none;
    appearance: none;
    margin: 0;
    width: 18px;
    height: 18px;
    border: 2px solid #8B5CF6;
    border-radius: 3px;
    background: white;
    cursor: pointer;
    flex-shrink: 0;
    position: relative;
    transition: all 0.2s ease;
}

.layer-checkbox:hover {
    border-color: #7C3AED;
    transform: scale(1.05);
}

.layer-checkbox:checked {
    background: #8B5CF6;
    border-color: #8B5CF6;
}

.layer-checkbox:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 12px;
    font-weight: bold;
}

.layer-name {
    font-size: 13px;
    color: #333;
    cursor: pointer;
    user-select: none;
    flex: 1;
    line-height: 1.3;
    margin-left: 4px;
}

.layer-children {
    margin-left: 8px;
    border-left: 1px solid #e0e0e0;
    padding-left: 8px;
    margin-top: 2px;
}

/* Parent layer styling */
.layer-item:has(.layer-children) .layer-name {
    font-weight: 500;
}

/* Hover effects */
.layer-checkbox-container:hover {
    background-color: #f8f9fa;
    border-radius: 4px;
    /* keep padding consistent to avoid horizontal jump */
    padding: 4px 28px;
}

/* Better spacing for nested items */
.layer-item .layer-item {
    margin-top: 2px;
}

/* Analysis layer special styling */
.layer-item[data-analysis="true"] .layer-name {
    color: #4a90e2;
}

.layer-item[data-analysis="true"] .layer-checkbox-container:hover {
    background-color: #f0f6ff;
}

/* Info Panel Styles */
.info-panel {
    position: absolute;
    top: 56px;
    left: 16px;
    right: auto;
    margin-top: 0;
    background: none;
    border-radius: 0;
    box-shadow: none;
    padding: 0;
    width: 420px;
    display: none;
    z-index: 2147483645;
    text-align: left;
}

.info-panel.visible {
    display: block;
}

.info-panel h3 {
    margin: 0 0 12px 0;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.info-item {
    margin-bottom: 8px;
    font-size: 13px;
    color: #333;
}

.info-label {
    font-weight: 500;
    margin-right: 8px;
}

.info-value {
    color: #666;
}

/* Comments panel removed */

/* Comment Annotation Styles (3D positioned comments) */
.comment-annotation {
    position: absolute;
    background: rgb(139, 92, 246);
    border: 1px solid #8B5CF6;
    border-radius: 8px;
    padding: 8px 12px;
    font-family: 'Roboto', sans-serif;
    font-size: 12px;
    font-weight: 500;
    color: white;
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.3);
    backdrop-filter: blur(10px);
    z-index: 1001;
    pointer-events: none;
    user-select: none;
    max-width: 300px;
    word-wrap: break-word;
    transform-origin: center bottom;
    transition: opacity 0.2s ease;
}

.comment-annotation::before {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid rgb(139, 92, 246);
}

.comment-annotation::after {
    content: '';
    position: absolute;
    bottom: -7px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 7px solid transparent;
    border-right: 7px solid transparent;
    border-top: 7px solid #8B5CF6;
    z-index: -1;
}

.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
    font-size: 10px;
    opacity: 0.8;
}

.comment-author {
    font-weight: 600;
}

.comment-time {
    font-size: 9px;
}

.comment-delete {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    opacity: 0.7;
    padding: 0;
    margin-left: 8px;
}

.comment-delete:hover {
    opacity: 1;
}

.comment-text {
    line-height: 1.4;
}

.comment-annotation .comment-text {
    color: white;
}

/* Comment Items in Panel */
.comment-item {
    border-bottom: 1px solid #eee;
    padding: 12px 0;
}

.comment-item:last-child {
    border-bottom: none;
}

.comment-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.comment-item-author {
    font-weight: 600;
    font-size: 12px;
    color: #333;
}

.comment-item-time {
    font-size: 10px;
    color: #666;
}

.comment-item-delete {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    color: #999;
    padding: 0;
}

.comment-item-delete:hover {
    color: #8B5CF6;
}

.comment-item-text {
    font-size: 12px;
    color: #333;
    line-height: 1.4;
    margin-bottom: 8px;
}

.comment-item-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.comment-goto,
.comment-view {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 12px;
    padding: 6px 8px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
    font-family: 'Roboto', sans-serif;
    color: #333;
    display: flex;
    align-items: center;
    gap: 4px;
}

.comment-goto:hover,
.comment-view:hover {
    background-color: #f5f5f5;
}

.comment-visibility {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    color: #666;
    cursor: pointer;
}

.no-comments {
    text-align: center;
    color: #666;
    font-size: 12px;
    padding: 20px;
    font-style: italic;
}

/* Comment Mode States */
.comment-button.active {
    background-color: #8B5CF6;
}

.comment-button.active .material-icons,
.comment-button.active .comment-text {
    color: white;
}

.comment-instruction {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    z-index: 2147483647;
    pointer-events: none;
    display: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
}

/* Measurement Panel Styles */
.measurement-panel {
    position: fixed;
    top: 276px; /* align with measurement button */
    right: 68px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    padding: 16px;
    width: 280px;
    display: none;
    z-index: 2147483645;
}

/* Camera Panel Styles */
.camera-panel {
    position: fixed;
    top: 224px; /* align with camera button */
    right: 68px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    padding: 16px;
    width: 280px;
    display: none;
    z-index: 2147483645;
}

.camera-panel.visible {
    display: block !important;
    z-index: 2147483647 !important;
}

.camera-panel h3 {
    margin: 0 0 12px 0;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.camera-controls {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    margin-bottom: 16px;
    width: 100%;
    box-sizing: border-box;
}

.camera-projection-toggle,
.camera-grid-toggle {
    margin-bottom: 4px;
}

.projection-toggle,
.grid-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'Roboto', sans-serif;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    cursor: pointer;
    padding: 8px 0;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.projection-toggle:hover,
.grid-toggle:hover {
    background-color: #f5f5f5;
}

/* Custom checkbox styling to match purple theme */
.projection-toggle input[type="checkbox"],
.grid-toggle input[type="checkbox"] {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid #8B5CF6;
    border-radius: 3px;
    background: white;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
}

.projection-toggle input[type="checkbox"]:hover,
.grid-toggle input[type="checkbox"]:hover {
    border-color: #7C3AED;
    transform: scale(1.05);
}

.projection-toggle input[type="checkbox"]:checked,
.grid-toggle input[type="checkbox"]:checked {
    background: #8B5CF6;
    border-color: #8B5CF6;
}

.projection-toggle input[type="checkbox"]:checked::after,
.grid-toggle input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 12px;
    font-weight: bold;
}

.camera-control {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-family: 'Roboto', sans-serif;
    font-size: 14px;
    color: #333;
}

.camera-control span:first-child {
    font-weight: 500;
    color: #333;
}

.camera-control input[type="range"] {
    width: 100%;
    margin: 4px 0;
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    border-radius: 3px;
    background: #e0e0e0;
    outline: none;
    transition: background 0.2s ease;
}

.camera-control input[type="range"]:hover {
    background: #d0d0d0;
}

.camera-control input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #8B5CF6;
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    transition: all 0.2s ease;
}

.camera-control input[type="range"]::-webkit-slider-thumb:hover {
    background: #7C3AED;
    transform: scale(1.1);
}

.camera-control input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #8B5CF6;
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    transition: all 0.2s ease;
}

.camera-control input[type="range"]::-moz-range-thumb:hover {
    background: #7C3AED;
    transform: scale(1.1);
}

.camera-control input[type="range"]::-webkit-slider-track {
    background: #e0e0e0;
    height: 6px;
    border-radius: 3px;
}

.camera-control input[type="range"]::-moz-range-track {
    background: #e0e0e0;
    height: 6px;
    border-radius: 3px;
    border: none;
}

.camera-value {
    font-size: 12px;
    color: #666;
    font-weight: 500;
    text-align: right;
}

.camera-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 8px;
}

.camera-reset-btn {
    background: none;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 8px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
    font-family: 'Roboto', sans-serif;
    font-size: 14px;
    font-weight: 500;
    color: #333;
}

.camera-reset-btn:hover {
    background-color: #f5f5f5;
}

.camera-reset-btn .material-icons {
    font-size: 20px;
    color: #333;
}

.measurement-panel.visible {
    display: block;
}

.measurement-panel h3 {
    margin: 0 0 12px 0;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.measurement-controls {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    margin-bottom: 16px;
    width: 100%;
    box-sizing: border-box;
}

.add-measurement-btn,
.clear-measurements-btn {
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
    font-family: 'Roboto', sans-serif;
    font-size: 14px;
    font-weight: 500;
    color: #333;
}

.add-measurement-btn:hover,
.clear-measurements-btn:hover {
    background-color: #f5f5f5;
}

.add-measurement-btn .material-icons,
.clear-measurements-btn .material-icons {
    font-size: 20px;
    color: #333;
}

.measurement-list {
    margin-top: 16px;
    width: 100%;
    box-sizing: border-box;
}

.measurement-item {
    border-bottom: 1px solid #eee;
    padding: 12px 0;
    width: 100%;
    box-sizing: border-box;
}

.measurement-item:last-child {
    border-bottom: none;
}

.measurement-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.measurement-number {
    font-weight: 600;
    font-size: 12px;
    color: #333;
}

.measurement-item-delete {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    color: #999;
    padding: 0;
}

.measurement-item-delete:hover {
    color: #ff4444;
}

.measurement-item-distance {
    font-size: 12px;
    color: #666;
    font-weight: 500;
}

.no-measurements {
    text-align: center;
    color: #666;
    font-size: 12px;
    padding: 20px;
    font-style: italic;
    width: 100%;
    box-sizing: border-box;
}

/* Measurement Labels (3D positioned) */
.measurement-label {
    position: absolute;
    background: #ff4444;
    border: none;
    border-radius: 999px;
    padding: 3px 12px;
    font-family: 'Roboto', sans-serif;
    font-size: 12px;
    font-weight: 500;
    color: white;
    z-index: 1002;
    pointer-events: none;
    user-select: none;
    white-space: nowrap;
    transform-origin: center;
    transition: opacity 0.2s ease;
    min-width: 0;
    min-height: 0;
    box-shadow: none;
    line-height: 1.2;
    letter-spacing: 0.01em;
}

/* Measurement Mode States */
.measurement-instruction {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    z-index: 2147483647;
    pointer-events: none;
    display: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
}

/* Fly Mode States */
.fly-instruction {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    z-index: 2147483647;
    pointer-events: none;
    display: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
}

/* Fullscreen Mode States */
.fullscreen-instruction {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    z-index: 2147483647;
    pointer-events: none;
    display: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
}

/* File name display in top left */
.file-name-display {
    position: fixed;
    top: 16px;
    left: 16px;
    font-family: 'Roboto', sans-serif;
    font-size: 1.2em;
    font-weight: 300;
    color: #222;
    background: none;
    box-shadow: none;
    border-radius: 0;
    padding: 0;
    z-index: 2147483646;
    max-width: calc(100vw - 200px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Footer Styles */
.footer-container {
    position: fixed;
    bottom: 16px;
    left: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 2147483646;
}

.footer-logo {
    height: 40px;
    width: auto;
    opacity: 0.9;
    transition: opacity 0.2s ease;
}

.footer-logo:hover {
    opacity: 1;
}

.confidential-text {
    color: #666;
    font-size: 12px;
    font-family: 'Roboto', sans-serif;
    opacity: 0.9;
    white-space: nowrap;
}

.desktop-text {
    display: inline;
}

.mobile-text {
    display: none;
}

/* Annotation styles (DOM-based tags) */
.annotation {
    position: absolute;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid #ccc;
    border-radius: 8px;
    padding: 8px 12px;
    font-family: 'Roboto', sans-serif;
    font-size: 12px;
    font-weight: 500;
    color: #333;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(10px);
    z-index: 1000;
    pointer-events: none;
    user-select: none;
    white-space: nowrap;
    line-height: 1.4;
    max-width: 300px;
    word-wrap: break-word;
    transform-origin: center bottom;
    transition: opacity 0.2s ease;
}

.annotation::before {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid rgba(255, 255, 255, 0.95);
}

.annotation::after {
    content: '';
    position: absolute;
    bottom: -7px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 7px solid transparent;
    border-right: 7px solid transparent;
    border-top: 7px solid #ccc;
    z-index: -1;
}

/* Export Dialog Styles */
.export-type-dialog,
.import-type-dialog,
.rhino-export-dialog,
.loading-dialog,
.comment-dialog,
.screenshot-dialog {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2147483648;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dialog-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.dialog-content {
    background: white;
    border-radius: 12px;
    padding: 24px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    position: relative;
    z-index: 1;
}

.dialog-content h3 {
    margin: 0 0 16px 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.dialog-content p {
    margin: 0 0 20px 0;
    color: #666;
    font-size: 14px;
}

.export-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 20px 0;
}

.export-option {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
}

.export-option:hover:not(:disabled) {
    border-color: #8B5CF6;
    background: #f3f0ff;
}

.export-option:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #f5f5f5;
}

.option-icon {
    font-size: 24px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    border-radius: 6px;
    flex-shrink: 0;
}

.option-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
}

.option-desc {
    font-size: 13px;
    color: #666;
    line-height: 1.4;
}

.dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

.cancel-btn {
    padding: 10px 20px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    background: white;
    color: #666;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
}

.cancel-btn:hover {
    background: #f5f5f5;
    border-color: #ccc;
}

/* Comment Dialog Specific Styles */
.comment-dialog .dialog-content {
    min-width: 400px;
    max-width: 500px;
}

.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #333;
}

.input-group input,
.input-group textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-family: 'Roboto', sans-serif;
    font-size: 14px;
    line-height: 1.5;
    box-sizing: border-box;
    transition: border-color 0.2s ease;
}

.input-group textarea {
    resize: vertical;
    min-height: 100px;
}

.input-group input:focus,
.input-group textarea:focus {
    outline: none;
    border-color: #8B5CF6;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.input-group input::placeholder,
.input-group textarea::placeholder {
    color: #999;
}

.submit-btn {
    background: #8B5CF6;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.submit-btn:hover {
    background: #7C3AED;
}

.submit-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Loading Dialog Styles */
.loading-dialog .dialog-content {
    text-align: center;
    padding: 32px;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #8B5CF6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px auto;
}

.loading-dialog h3 {
    color: #333;
    font-size: 16px;
    font-weight: 500;
    margin: 0;
}

/* Rhino Export Specific Styles */

/* Animations */
@keyframes spin {
    100% { transform: rotate(360deg); }
}

/* Mobile Responsive Styles */
@media (max-width: 768px) {
    .layer-button, .refresh-button, .info-button, .close-button,
    .screenshot-button, .comment-button, .display-style-button,
    .measurement-button, .fly-button, .fullscreen-button, .camera-button,
    .add-model-button {
        width: 48px !important;
        height: 48px !important;
        min-width: 48px !important;
        min-height: 48px !important;
        max-width: 48px !important;
        max-height: 48px !important;
        padding: 0 !important;
        box-sizing: border-box;
    }
    .layer-button .material-icons,
    .add-model-button .material-icons,
    .refresh-button .material-icons,
    .info-button .material-icons,
    .close-button .material-icons,
    .screenshot-button .material-icons,
    .comment-button .material-icons,
    .display-style-button .material-icons,
    .measurement-button .material-icons,
    .fly-button .material-icons,
    .fullscreen-button .material-icons,
    .camera-button .material-icons {
        font-size: 28px !important;
        line-height: 48px !important;
    }
    .screenshot-button:hover,
    .comment-button:hover,
    .display-style-button:hover,
    .fullscreen-button:hover {
        transform: scale(1.05);
    }

    /* Adjust layers panel for mobile */
    .layers-panel {
        position: fixed !important;
        top: 50% !important;
        left: 50% !important;
        transform: translate(-50%, -50%) !important;
        margin: 0 auto !important;
        width: 75vw !important;
        max-width: 340px !important;
        max-height: calc(100vh - 160px) !important; /* 64px top + 96px bottom for header/footer clearance */
        overflow-y: auto !important;
        z-index: 2147483645 !important;
        border-radius: 12px !important;
        box-shadow: 0 4px 24px rgba(0,0,0,0.18) !important;
        padding-right: 24px !important; /* Add space for FAB */
    }

    .layers-panel.visible {
        transform: translateX(0);
    }

    /* Make panel background more opaque on mobile */
    .layers-panel {
        background: rgba(255, 255, 255, 0.95);
    }

    /* Adjust camera panel for mobile */
    .camera-panel {
        position: fixed !important;
        top: 50% !important;
        left: 50% !important;
        transform: translate(-50%, -50%) !important;
        margin: 0 auto !important;
        width: 75vw !important;
        max-width: 340px !important;
        max-height: calc(100vh - 160px) !important; /* 64px top + 96px bottom for header/footer clearance */
        overflow-y: auto !important;
        z-index: 2147483645 !important;
        border-radius: 12px !important;
        box-shadow: 0 4px 24px rgba(0,0,0,0.18) !important;
        padding-right: 24px !important; /* Add space for FAB */
        background: rgba(255, 255, 255, 0.95) !important;
    }

    .camera-panel.visible {
        transform: translate(-50%, -50%) !important;
    }


    /* Larger checkboxes and text for touch */
    .layer-item {
        padding: 12px 0;
    }

    .layer-item input[type="checkbox"] {
        width: 20px;
        height: 20px;
    }

    .layer-item label {
        font-size: 16px;
    }

    /* Adjust footer for mobile */
    .footer-container {
        flex-direction: row;
        align-items: center;
        gap: 4px;
        left: 8px;
        right: 8px;
        bottom: 8px;
        width: auto;
        max-width: calc(100% - 32px);
    }

    .footer-logo {
        height: 32px;
    }

    .confidential-text {
        font-size: 10px;
        line-height: 1.2;
        white-space: nowrap;
        text-align: left;
    }

    /* Loading panel adjustments */
    .loading-content {
        margin: 16px;
        padding: 20px;
    }

    .desktop-text {
        display: none;
    }

    .mobile-text {
        display: inline;
    }

    /* Mobile adjustments for file name */
    .file-name-display {
        font-size: 1em;
        max-width: calc(100vw - 120px);
        padding: 0;
        top: 8px;
        left: 8px;
        right: 8px;
    }

    /* Mobile adjustments for annotations */
    .annotation {
        font-size: 11px;
        padding: 6px 10px;
        max-width: 250px;
    }

    /* Mobile adjustments for comments */
    .comments-panel {
        max-width: calc(100vw - 32px);
        font-size: 12px;
    }

    .comment-annotation {
        font-size: 11px;
        padding: 6px 10px;
        max-width: 250px;
    }

    /* Mobile adjustments for dialogs */
    .dialog-content {
        width: 95%;
        padding: 20px;
        margin: 16px;
    }

    .screenshot-dialog .dialog-content {
        min-width: auto;
        width: 95%;
    }

    .screenshot-options {
        gap: 10px;
    }

    .screenshot-option {
        padding: 12px;
        gap: 12px;
    }

    .screenshot-option .material-icons {
        font-size: 20px;
        width: 28px;
        height: 28px;
    }

    .option-details .option-title {
        font-size: 15px;
    }

    .option-details .option-desc {
        font-size: 12px;
    }

    .export-options {
        gap: 10px;
    }

    /* Mobile adjustments for measurement instruction */
    .measurement-instruction {
        bottom: 100px;
        font-size: 12px;
        padding: 10px 16px;
    }

    /* FAB styles for mobile */
    .fab-menu {
        position: fixed;
        bottom: 16px;
        right: 16px;
        z-index: 2147483647;
        display: flex;
        flex-direction: column;
        align-items: flex-end;
        gap: 0;
    }
    .fab-main {
        width: 48px;
        height: 48px;
        border-radius: 8px;
        background: #fff;
        color: #8B5CF6;
        display: flex;
        align-items: center;
        justify-content: center;
        box-shadow: 0 4px 12px rgba(0,0,0,0.18);
        cursor: pointer;
        font-size: 28px;
        border: none;
        outline: none;
        transition: background 0.2s, color 0.2s;
        margin: 0;
        min-width: 48px;
        min-height: 48px;
        max-width: 48px;
        max-height: 48px;
        padding: 0;
    }
    .fab-main:active {
        background: #7C3AED;
    }
    .fab-main .material-icons {
        font-size: 28px !important;
        line-height: 48px !important;
    }
    .fab-actions {
        display: none;
        flex-direction: column;
        align-items: flex-end;
        gap: 12px;
        position: absolute;
        bottom: 60px; /* 48px (button) + 8px gap */
        right: 0;
        z-index: 1;
        margin-bottom: 0;
    }
    .fab-actions > .layer-button,
    .fab-actions > .add-model-button,
    .fab-actions > .refresh-button,
    .fab-actions > .info-button,
    .fab-actions > .close-button,
    .fab-actions > .screenshot-button,
    .fab-actions > .comment-button,
    .fab-actions > .display-style-dropdown,
    .fab-actions > .measurement-button,
    .fab-actions > .fly-button,
    .fab-actions > .fullscreen-button,
    .fab-actions > .camera-button {
        margin: 0 !important;
        position: static !important;
    }

    /* Explicit ordering for FAB buttons */
    .fab-actions > .camera-button {
        order: 1;
    }
    .fab-actions > .layer-button {
        order: 2;
    }
    .fab-actions > .add-model-button {
        order: 3;
    }
    .fab-actions > .display-style-dropdown {
        order: 4;
    }
    .fab-menu.expanded .fab-actions {
        display: flex;
    }
    .fab-menu.expanded .fab-main {
        background: #8B5CF6;
        color: #fff;
    }
    /* Hide all menu buttons by default on mobile */
    .layer-button, .add-model-button, .refresh-button, .info-button, .close-button,
    .screenshot-button, .comment-button, .display-style-button,
    .measurement-button, .fly-button, .fullscreen-button, .camera-button, .zoomfit-button {
        display: none !important;
    }
    /* Show menu buttons only when inside .fab-actions and .fab-menu.expanded */
    .fab-menu.expanded .fab-actions .layer-button,
    .fab-menu.expanded .fab-actions .add-model-button,
    .fab-menu.expanded .fab-actions .refresh-button,
    .fab-menu.expanded .fab-actions .info-button,
    .fab-menu.expanded .fab-actions .close-button,
    .fab-menu.expanded .fab-actions .screenshot-button,
    .fab-menu.expanded .fab-actions .comment-button,
    .fab-menu.expanded .fab-actions .display-style-button,
    .fab-menu.expanded .fab-actions .measurement-button,
    .fab-menu.expanded .fab-actions .fly-button,
    .fab-menu.expanded .fab-actions .fullscreen-button,
    .fab-menu.expanded .fab-actions .camera-button {
        display: flex !important;
    }
    /* Ensure FAB is always visible */
    .fab-menu {
        display: flex !important;
    }

    /* Treat display-style menu as a panel on mobile */
    .display-style-menu {
        position: fixed !important;
        top: 50% !important;
        left: 50% !important;
        transform: translate(-50%, -50%) !important;
        margin: 0 auto !important;
        width: 75vw !important;
        max-width: 340px !important;
        max-height: calc(100vh - 160px) !important; /* 64px top + 96px bottom for header/footer clearance */
        overflow-y: auto !important;
        z-index: 2147483647 !important;
        border-radius: 12px !important;
        box-shadow: 0 4px 24px rgba(0,0,0,0.18) !important;
        background: #fff !important;
        display: none !important;
    }
    .display-style-menu.visible {
        display: block !important;
    }

    /* Model Management dialog – make consistent with other mobile panels */
    .model-management-dialog {
        display: none; /* toggled by JS */
        align-items: center;
        justify-content: center;
        position: fixed;
        top: 0; left: 0; right: 0; bottom: 0;
        z-index: 2147483647 !important;
    }
    /* Remove background overlay on mobile for consistency with other panels */
    .model-management-dialog .dialog-overlay {
        display: none !important;
    }
    .model-management-dialog .dialog-content {
        position: relative;
        background: rgba(255,255,255,0.95) !important;
        border-radius: 12px !important;
        box-shadow: 0 4px 24px rgba(0,0,0,0.18) !important;
        width: 75vw !important;
        max-width: 340px !important;
        max-height: calc(100vh - 160px) !important;
        overflow-y: auto !important;
        padding: 16px !important; /* match other panels */
        margin: 0 !important; /* no extra outer margins */
    }
    /* Explicitly remove inner paddings on mobile for tighter layout */
    .model-management-dialog .dialog-header,
    .model-management-dialog .dialog-body {
        padding: 0 !important;
    }
    .model-management-dialog .dialog-header h3 {
        margin: 0 0 12px 0 !important;
        font-size: 14px !important;
        font-weight: 500 !important;
        color: #333 !important;
        text-transform: uppercase !important;
        letter-spacing: 0.1em !important;
    }
    .model-management-dialog .dialog-body,
    .model-management-dialog .model-list,
    .model-management-dialog .model-list-item,
    .model-management-dialog .model-name {
        font-size: 13px !important;
        color: #333 !important;
    }
    .model-management-dialog .model-unload-btn {
        background: white !important;
        color: #333 !important;
        border: 1px solid #ddd !important;
    }
    .model-management-dialog .load-model-btn {
        background: #8B5CF6 !important;
        color: #fff !important;
        font-size: 14px !important;
        border-radius: 8px !important;
    }
    /* Hide close button on mobile to rely on tap-outside */
    .model-management-dialog .dialog-close-btn {
        display: none !important;
    }
}

/* Small mobile devices */
@media (max-width: 380px) {
    .confidential-text {
        font-size: 9px;
    }

    .footer-logo {
        height: 28px;
    }

    .footer-container {
        gap: 2px;
    }


}

@media (max-width: 480px) {
    .annotation {
        font-size: 10px;
        padding: 5px 8px;
        max-width: 200px;
    }

    .comment-annotation {
        font-size: 10px;
        padding: 5px 8px;
        max-width: 200px;
    }

    .comments-panel {
        padding: 12px;
    }

    .comment-item {
        padding: 8px 0;
    }

    .dialog-content {
        width: 98%;
        padding: 16px;
        margin: 8px;
    }

    .export-option {
        flex-direction: column;
        text-align: center;
        gap: 8px;
    }

    .option-icon {
        margin: 0 auto;
    }
}

/* Screenshot Dialog Specific Styles */
.screenshot-dialog .dialog-content {
    min-width: 450px;
    max-width: 600px;
}

.screenshot-preview {
    margin: 16px 0;
    text-align: center;
}

.screenshot-preview img {
    max-width: 100%;
    max-height: 200px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.screenshot-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 20px 0;
}

.screenshot-option {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
}

.screenshot-option:hover {
    border-color: #8B5CF6;
    background: #f3f0ff;
}

.screenshot-option .material-icons {
    font-size: 24px;
    color: #8B5CF6;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f3f0ff;
    border-radius: 6px;
    flex-shrink: 0;
}

.option-details {
    flex: 1;
}

.option-details .option-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
}

.option-details .option-desc {
    font-size: 13px;
    color: #666;
    line-height: 1.4;
}

/* Screenshot Feedback Message */
.screenshot-feedback {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    z-index: 2147483649;
    pointer-events: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.preview-loading {
    padding: 60px 20px;
    text-align: center;
    color: #666;
    font-style: italic;
    background: #f8f9fa;
    border-radius: 8px;
    border: 2px dashed #ddd;
}

/* Configuration modal styles */
.config-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
}

.config-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
}

.config-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 12px;
    padding: 32px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.config-content h3 {
    margin: 0 0 16px 0;
    color: #333;
    font-size: 24px;
}

.config-content p {
    margin: 0 0 24px 0;
    color: #666;
    line-height: 1.5;
}

.config-input-group {
    margin-bottom: 24px;
}

.config-input-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
}

.config-input-group input {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.config-input-group input:focus {
    outline: none;
    border-color: #8b5cf6;
}

.config-input-group small {
    display: block;
    margin-top: 8px;
    color: #666;
    font-size: 14px;
}

.config-input-group small a {
    color: #8b5cf6;
    text-decoration: none;
}

.config-input-group small a:hover {
    text-decoration: underline;
}

.config-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
}

.config-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.config-btn.primary {
    background: #8b5cf6;
    color: white;
}

.config-btn.primary:hover {
    background: #7c3aed;
}

.config-btn.secondary {
    background: #f3f4f6;
    color: #374151;
}

.config-btn.secondary:hover {
    background: #e5e7eb;
}

.setup-instructions ol {
    text-align: left;
    padding-left: 20px;
}

.setup-instructions li {
    margin-bottom: 12px;
    line-height: 1.5;
}

.setup-instructions ul {
    margin: 8px 0;
    padding-left: 20px;
}

.setup-instructions code {
    background: #f3f4f6;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
}

/* Add Model Button Styles */
.add-model-button {
    position: fixed;
    top: 484px;
    right: 16px;
    width: 40px;
    height: 40px;
    background: white;
    border: none;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 2147483646;
}

.add-model-button:hover {
    background-color: #f5f5f5;
    transform: scale(1.05);
}

.add-model-button .material-icons {
    font-size: 24px;
    color: #333;
}

/* Display Style Dropdown Styles */
.display-style-dropdown {
    position: fixed;
    top: 536px;
    right: 16px;
    z-index: 2147483646;
}

.display-style-button {
    width: 40px;
    height: 40px;
    background: white;
    border: none;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.display-style-button:hover {
    background-color: #f5f5f5;
    transform: scale(1.05);
}

.display-style-button .material-icons {
    font-size: 24px;
    color: #333;
}

.display-style-menu {
    position: absolute;
    top: 0;
    right: 100%;
    margin-right: 8px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    padding: 8px;
    min-width: 160px;
    display: none;
    z-index: 2147483647;
}

.display-style-dropdown.active .display-style-menu {
    display: block;
}

.display-style-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px; /* Material 3 touch target ~48px height incl. spacing */
    cursor: pointer;
    border-radius: 6px;
    transition: background-color 0.2s ease;
}

.display-style-option:hover {
    background-color: #f5f5f5;
}

.display-style-option .material-icons {
    font-size: 20px;
    color: #333;
}

.display-style-option span:not(.material-icons) {
    font-family: 'Roboto', sans-serif;
    font-size: 14px;
    color: #333;
}

.display-style-option.active {
    background-color: #f0f0f0;
}

.display-style-option.active .material-icons {
    color: #8B5CF6;
}

.display-style-option.active span:not(.material-icons) {
    color: #8B5CF6;
    font-weight: 500;
}

/* Model Management Dialog Styles */
.model-management-dialog {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2147483648;
    display: none;
}

.model-management-dialog.visible {
    display: flex;
    align-items: center;
    justify-content: center;
}

.model-management-dialog .dialog-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.model-management-dialog .dialog-content {
    background: white;
    border-radius: 12px;
    padding: 24px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    position: relative;
    z-index: 1;
}

.model-management-dialog .dialog-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.model-management-dialog .dialog-content h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.dialog-close-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.dialog-close-btn:hover {
    background-color: #f5f5f5;
}

.dialog-close-btn .material-icons {
    font-size: 24px;
    color: #666;
}

    /* remove legacy section spacing to avoid deep margins */
    .model-management-section { margin: 0 !important; padding: 0 !important; }

    .model-manager-body h4 {
    margin: 0 0 16px 0;
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.model-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.model-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background: #fafafa;
    transition: all 0.2s ease;
}

.model-list-item:hover {
    background: #f0f0f0;
    border-color: #ccc;
}

/* Removed color badge */

.model-name {
    flex: 1;
    font-weight: 500;
    color: #333;
    margin-right: 12px;
    font-size: 13px; /* Match layer names */
}

/* Model names in layers panel */
.model-layer-name {
    font-size: 13px !important; /* Match layer names font size */
    font-weight: 600 !important; /* Make model names bold in multi-model mode */
}

.model-controls {
    display: flex;
    align-items: center;
    gap: 12px; /* Increased spacing for better visual separation */
}


.model-unload-btn {
    background: white;
    color: #333;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 6px 12px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.model-unload-btn:hover {
    background: #f5f5f5;
    border-color: #bbb;
}

.load-model-section {
    border-top: 1px solid #e0e0e0;
    padding-top: 24px;
}

.load-model-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #8B5CF6;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease;
    width: 100%;
    justify-content: center;
}

.load-model-btn:hover {
    background: #7C3AED;
}

.load-model-btn .material-icons {
    font-size: 20px;
}

/* Mobile responsive styles */
@media (max-width: 768px) {
    .dialog-content {
        width: 95%;
        max-height: 90vh;
    }
    
    .dialog-header {
        padding: 16px 20px;
    }
    
    .dialog-body {
        padding: 20px;
    }
    
    .model-list-item {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
    }
    
    .model-controls {
        width: 100%;
        justify-content: space-between;
    }
}

 