
* {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

body {
    margin: 0;
    overflow: hidden;
    background: #333333;
}

/* Loading Screen Overlay */
#loading-overlay {
    display: flex;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    justify-content: center;
    align-items: center;
    z-index: 99999;
    opacity: 1;
    transition: opacity 0.5s ease-out;
}

.loading-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 40px;
}

.loading-text {
    color: #fff;
    font-family: Arial, sans-serif;
    font-size: 24px;
    font-weight: 300;
    letter-spacing: 4px;
}

/* Loading Grid */
.loading-grid {
    display: grid;
    grid-template-columns: repeat(3, 50px);
    grid-template-rows: repeat(3, 50px);
    gap: 6px;
}

.grid-cell {
    width: 50px;
    height: 50px;
    background-color: #222;
    border-radius: 4px;
}

/* Hide A-Frame VR/Fullscreen button */
.a-enter-vr-button,
.a-enter-ar-button,
.a-orientation-modal {
    display: none !important;
}

a-scene {
  height: 100vh;
  width: 100vw;
}

/* CSS3D Container for web surfaces */
.css3d-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    pointer-events: none;
    overflow: hidden;
}

/* Disable context menu via CSS */
*, *::before, *::after {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

#ui-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
}


/* Button container using flexbox - bottom center */
#button-container {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: row;
    gap: 10px;
    pointer-events: none;
    z-index: 1000;
}

/* Base button style */
.mode-button {
    width: 50px;
    height: 54px;
    padding: 6px 4px 4px 4px;
    background-color: rgba(50, 50, 50, 0.5);
    border: 2px solid #aaaa;
    border-radius: 8px;
    color: white;
    font-weight: bold;
    cursor: pointer;
    pointer-events: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    font-family: Arial, sans-serif;
    position: relative;
    gap: 2px;
}

/* Number centered in button */
.mode-button .mode-number {
    font-size: 22px;
    font-weight: bold;
    line-height: 1;
}

/* Label below number inside button */
.mode-button .mode-label {
    font-size: 9px;
    font-weight: normal;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1;
    text-transform: lowercase;
}

.mode-button:hover {
    background-color: rgba(120, 120, 120, 0.8);
    transform: scale(1.1);
}

/* Button active colors - Vibrant colors for each mode */

/* 1 - Selection: Yellow */
#selection-button.active {
    background-color: rgba(200, 170, 0, 0.8);
    border-color: rgba(255, 245, 180, 0.7);
}

/* 2 - Eraser: Red */
#eraser-button.active {
    background-color: rgba(200, 40, 40, 0.8);
    border-color: rgba(255, 180, 180, 0.7);
}

/* 3 - Cube: Green */
#cube-button.active {
    background-color: rgba(40, 160, 40, 0.8);
    border-color: rgba(180, 255, 180, 0.7);
}

/* 4 - Halfblock: Orange */
#halfblock-button.active {
    background-color: rgba(200, 110, 0, 0.8);
    border-color: rgba(255, 220, 180, 0.7);
}

/* 5 - Text: Purple */
#text-button.active {
    background-color: rgba(140, 50, 210, 0.8);
    border-color: rgba(220, 190, 255, 0.7);
}

/* 6 - Image: Blue */
#image-button.active {
    background-color: rgba(25, 95, 200, 0.8);
    border-color: rgba(180, 210, 255, 0.7);
}

/* 7 - Web: Magenta */
#web-button.active {
    background-color: rgba(200, 0, 135, 0.8);
    border-color: rgba(255, 180, 220, 0.7);
}

/* 8 - Portal: Cyan */
#portal-button.active {
    background-color: rgba(0, 165, 165, 0.8);
    border-color: rgba(180, 255, 255, 0.7);
}

/* Halfblock mode panel - color picker + submenu */
#halfblock-panel {
    position: fixed;
    bottom: 85px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #fff;
    border: 1px solid #666;
    border-radius: 8px;
    padding: 4px 8px;
    pointer-events: auto;
    display: none;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    z-index: 1500;
    backdrop-filter: blur(10px);
    height: 45px;
    box-sizing: border-box;
}

#halfblock-panel.active {
    display: flex;
}

#halfblock-submenu {
    display: flex;
    flex-direction: row;
    gap: 6px;
}

#halfblock-submenu button {
    padding: 5px 12px;
    background-color: #fff;
    color: #888;
    border: 1px solid #ccc;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 600;
    font-size: 11px;
    font-family: Arial, sans-serif;
    transition: all 0.2s;
    height: 32px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
}

#halfblock-submenu button:hover {
    background-color: #f0f0f0;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

#halfblock-submenu button.active {
    background-color: #c0e0fc;
    border-color: #5ac8fa;
    color: #000;
}

#duplicate-button {
    position: absolute;
    right: 89px;
    top: calc(50% + 259px);
    width: 49px;
    height: 49px;
    background-color: rgba(100, 100, 100, 0.7);
    border: 3px solid #fff;
    border-radius: 8px;
    color: white;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    pointer-events: auto;
    display: none; /* Hidden - using popup menu instead */
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    font-family: Arial, sans-serif;
}

#duplicate-button:hover {
    background-color: rgba(120, 120, 120, 0.8);
    transform: scale(1.05);
}

/* Cube mode panel - color picker */
#cube-panel {
    position: fixed;
    bottom: 85px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #fff;
    border: 1px solid #666;
    border-radius: 8px;
    padding: 4px 8px;
    pointer-events: auto;
    display: none;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    z-index: 1500;
    backdrop-filter: blur(10px);
    height: 45px;
    box-sizing: border-box;
}

#cube-panel.active {
    display: flex;
}

/* Text mode panel - edit button */
#text-panel {
    position: fixed;
    bottom: 85px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #fff;
    border: 1px solid #666;
    border-radius: 8px;
    padding: 4px 8px;
    pointer-events: auto;
    display: none;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    z-index: 1500;
    backdrop-filter: blur(10px);
    height: 45px;
    box-sizing: border-box;
}

#text-panel.active {
    display: flex;
}

#text-submenu {
    display: flex;
    flex-direction: row;
    gap: 6px;
}

#text-submenu button {
    padding: 5px 12px;
    background-color: #fff;
    color: #888;
    border: 1px solid #ccc;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 600;
    font-size: 11px;
    font-family: Arial, sans-serif;
    transition: all 0.2s;
    height: 32px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
}

#text-submenu button:hover {
    background-color: #f0f0f0;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

#text-submenu button.active {
    background-color: #c0e0fc;
    border-color: #5ac8fa;
    color: #000;
}

/* Selection mode panel */
#selection-panel {
    position: fixed;
    bottom: 85px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #fff;
    border: 1px solid #666;
    border-radius: 8px;
    padding: 4px 8px;
    pointer-events: auto;
    display: none;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    z-index: 1500;
    backdrop-filter: blur(10px);
    height: 45px;
    box-sizing: border-box;
}

#selection-panel.active {
    display: flex;
}

#selection-submenu {
    display: flex;
    flex-direction: row;
    gap: 6px;
}

#selection-submenu button {
    padding: 5px 12px;
    background-color: #fff;
    color: #888;
    border: 1px solid #ccc;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 600;
    font-size: 11px;
    font-family: Arial, sans-serif;
    transition: all 0.2s;
    height: 32px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
}

#selection-submenu button:hover {
    background-color: #f0f0f0;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

#selection-submenu button.active {
    background-color: #c0e0fc;
    border-color: #5ac8fa;
    color: #000;
}

#selection-rectangle-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 999;
}

/* Selection Action Menu - Slide-out Panel */
#selection-action-menu {
    /* Uses slide-out-panel class styles */
    z-index: 3500;
}

.selection-menu-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.selection-action-btn {
    width: 100%;
    padding: 12px;
    background: rgba(255, 255, 255, 0.9);
    color: #333;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
    font-family: Arial, sans-serif;
    transition: all 0.2s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.selection-action-btn:hover {
    background: rgba(255, 255, 255, 1);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.3);
}

.selection-action-btn-danger {
    background: #E74C3C;
    color: white;
}

.selection-action-btn-danger:hover {
    background: #C0392B;
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.4);
}

/* Alignment sections for 2D selection */
.selection-alignment-section {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.selection-alignment-section h4 {
    margin: 0 0 10px 0;
    color: #aaa;
    font-family: Arial, sans-serif;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.alignment-buttons-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
}

.alignment-btn {
    padding: 8px 4px;
    background: rgba(255, 255, 255, 0.1);
    color: #ddd;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 4px;
    cursor: pointer;
    font-family: Arial, sans-serif;
    font-size: 11px;
    font-weight: 600;
    transition: all 0.2s;
}

.alignment-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
    color: #fff;
}

.alignment-section h4 {
    margin: 0 0 10px 0;
    color: #ddd;
    font-size: 12px;
    font-weight: 600;
    font-family: Arial, sans-serif;
    text-align: left;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.alignment-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.alignment-buttons button {
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.05);
    color: #ddd;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    font-size: 12px;
    font-family: Arial, sans-serif;
    transition: all 0.2s;
}

.alignment-buttons button:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(52, 152, 219, 0.5);
    color: #fff;
    transform: translateY(-1px);
}
    justify-content: center;
}

.alignment-buttons button {
    flex: 1;
    padding: 5px 6px;
    font-size: 10px;
    background-color: #95A5A6;
    white-space: nowrap;
}

.alignment-buttons button:hover {
    background-color: #7F8C8D;
}

.edit-text-button {
    padding: 7px 14px;
    background-color: rgba(255, 255, 255, 0.3);
    color: #333;
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 5px;
    cursor: pointer;
    font-weight: 600;
    font-size: 12px;
    font-family: Arial, sans-serif;
    transition: all 0.2s;
    backdrop-filter: blur(5px);
}

.edit-text-button:hover {
    background-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.edit-text-button:active {
    background-color: rgba(255, 255, 255, 0.9);
}

/* Reusable Right Slide-Out Panel Component */
.slide-out-panel {
    position: fixed;
    top: 0;
    bottom: 0;
    right: -320px;
    width: 300px;
    background-color: rgba(0, 0, 0, 0.9);
    border-left: 2px solid #fff;
    padding: 15px;
    padding-top: 55px; /* menu bar (40px) + 5px + top padding (10px) */
    z-index: 1500;
    pointer-events: auto;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: stretch;
    transition: right 0.3s ease;
    overflow-y: auto;
}

.slide-out-panel.active {
    right: 0;
}

.slide-out-panel-header {
    color: white;
    font-family: Arial, sans-serif;
    font-size: 16px;
    font-weight: bold;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
    margin-bottom: 5px;
    flex-shrink: 0;
}

.slide-out-panel-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
}

/* Text Config Panel - uses slide-out-panel base */
#text-config-panel {
    /* Inherits from .slide-out-panel */
}

#text-config-panel.active {
    /* Inherits from .slide-out-panel.active */
}

#text-config-panel textarea {
    width: 100%;
    min-height: 80px;
    font-family: Arial, sans-serif;
    padding: 8px;
    box-sizing: border-box;
    font-size: 14px;
    background: #222;
    color: white;
    border: 2px solid #666;
    border-radius: 4px;
    resize: vertical;
}

#text-config-panel textarea:focus {
    outline: none;
    border-color: #3498DB;
}

.text-color-column {
    display: flex;
    flex-direction: column;
    gap: 8px;
    justify-content: center;
}

.text-align-column {
    display: flex;
    flex-direction: column;
    gap: 5px;
    justify-content: center;
}

.text-align-column label {
    color: white;
    font-family: Arial, sans-serif;
    font-size: 12px;
    font-weight: bold;
    white-space: nowrap;
}

.text-align-column select {
    padding: 6px 10px;
    background: #222;
    color: white;
    border: 2px solid #666;
    border-radius: 4px;
    font-size: 13px;
    font-family: Arial, sans-serif;
    cursor: pointer;
}

.text-align-column select:focus {
    outline: none;
    border-color: #3498DB;
}

.text-control-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.text-control-group label {
    color: white;
    font-family: Arial, sans-serif;
    font-size: 12px;
    font-weight: bold;
    white-space: nowrap;
    min-width: 70px;
}

.text-control-group input[type="color"] {
    width: 50px;
    height: 30px;
    border: 2px solid #666;
    border-radius: 4px;
    cursor: pointer;
    background: transparent;
}

.text-control-group input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 2px;
}

.text-control-group input[type="color"]::-webkit-color-swatch {
    border: none;
    border-radius: 2px;
}

.text-control-group input[type="color"]:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.text-control-group select {
    padding: 6px 10px;
    background: #222;
    color: white;
    border: 2px solid #666;
    border-radius: 4px;
    font-family: Arial, sans-serif;
    font-size: 12px;
    cursor: pointer;
    min-width: 120px;
}

.text-control-group select:focus {
    outline: none;
    border-color: #3498DB;
}

.text-checkbox-label {
    display: flex;
    align-items: center;
    gap: 4px;
    color: white;
    font-family: Arial, sans-serif;
    font-size: 11px;
    cursor: pointer;
    white-space: nowrap;
}

.text-checkbox-label input[type="checkbox"] {
    width: 14px;
    height: 14px;
    cursor: pointer;
}

.text-options-column {
    display: flex;
    flex-direction: column;
    gap: 8px;
    justify-content: center;
}

/* Text edit buttons (shown in editing mode) */
.text-edit-buttons {
    display: none;
    flex-direction: row;
    gap: 8px;
    justify-content: flex-end;
    margin-top: auto;
    padding-top: 10px;
}

#text-config-panel.editing-mode .text-edit-buttons {
    display: flex;
}

.text-edit-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-family: Arial, sans-serif;
    cursor: pointer;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.2s;
    min-width: 90px;
}

.text-edit-btn.accept {
    background: rgba(46, 204, 113, 0.9);
    color: white;
}

.text-edit-btn.accept:hover {
    background: rgba(46, 204, 113, 1);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(46, 204, 113, 0.4);
}

.text-edit-btn.cancel {
    background: rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.text-edit-btn.cancel:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.2);
}

/* Markdown Config Panel - uses slide-out-panel base */
#markdown-config-popup {
    /* Inherits from .slide-out-panel */
}

.markdown-control-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.markdown-control-group label {
    color: white;
    font-family: Arial, sans-serif;
    font-size: 12px;
    font-weight: bold;
}

.markdown-control-group textarea {
    width: 100%;
    min-height: 200px;
    flex: 1;
    font-family: 'Courier New', monospace;
    padding: 8px;
    box-sizing: border-box;
    font-size: 13px;
    background: #222;
    color: white;
    border: 2px solid #666;
    border-radius: 4px;
    resize: vertical;
}

.markdown-control-group textarea:focus {
    outline: none;
    border-color: #3498DB;
}

.markdown-control-group input[type="color"] {
    width: 60px;
    height: 30px;
    border: 2px solid #666;
    border-radius: 4px;
    cursor: pointer;
    background: transparent;
}

.markdown-colors-row {
    display: flex;
    flex-direction: row;
    gap: 20px;
}

.markdown-color-group {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
}

.markdown-color-group label {
    color: white;
    font-family: Arial, sans-serif;
    font-size: 12px;
    font-weight: bold;
}

.markdown-color-group input[type="color"] {
    width: 50px;
    height: 28px;
    border: 2px solid #666;
    border-radius: 4px;
    cursor: pointer;
    background: transparent;
}

.markdown-options-row {
    display: flex;
    flex-direction: row;
    gap: 20px;
}

.markdown-option-group {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
}

.markdown-option-group label {
    color: white;
    font-family: Arial, sans-serif;
    font-size: 12px;
    font-weight: bold;
}

.markdown-option-group select {
    padding: 4px 8px;
    font-size: 12px;
    border: 2px solid #666;
    border-radius: 4px;
    background: #222;
    color: white;
    cursor: pointer;
}

.markdown-option-group select:focus {
    outline: none;
    border-color: #3498DB;
}

/* Individual option rows (align, font on separate rows) */
.markdown-option-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.markdown-option-row label {
    color: white;
    font-family: Arial, sans-serif;
    font-size: 12px;
    font-weight: bold;
    min-width: 40px;
}

.markdown-option-row select {
    flex: 1;
    padding: 6px 10px;
    font-size: 12px;
    border: 2px solid #666;
    border-radius: 4px;
    background: #222;
    color: white;
    cursor: pointer;
}

.markdown-option-row select:focus {
    outline: none;
    border-color: #3498DB;
}

.markdown-buttons {
    display: none;
    flex-direction: row;
    gap: 8px;
    justify-content: flex-end;
    margin-top: auto;
    padding-top: 10px;
}

#markdown-config-popup.editing-mode .markdown-buttons {
    display: flex;
}

.markdown-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-family: Arial, sans-serif;
    cursor: pointer;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.2s;
}

.markdown-btn.apply {
    background: rgba(46, 204, 113, 0.9);
    color: white;
}

.markdown-btn.apply:hover {
    background: rgba(46, 204, 113, 1);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(46, 204, 113, 0.4);
}

.markdown-btn.cancel {
    background: rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.markdown-btn.cancel:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.2);
}

/* Web Config Popup - now a slide-out panel */
#web-config-popup {
    /* Uses slide-out-panel class styles */
    z-index: 2000;
}

#web-config-popup .slide-out-panel-content {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Webview accordion container */
.webview-accordion {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding-right: 4px;
}

.webview-accordion::-webkit-scrollbar {
    width: 6px;
}

.webview-accordion::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

.webview-accordion::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.webview-accordion::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Accordion items using details/summary */
.accordion-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    overflow: hidden;
}

.accordion-item[open] {
    background: rgba(52, 152, 219, 0.08);
    border-color: rgba(52, 152, 219, 0.3);
}

.accordion-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    cursor: pointer;
    user-select: none;
    list-style: none;
}

.accordion-summary::-webkit-details-marker {
    display: none;
}

.accordion-summary:hover {
    background: rgba(255, 255, 255, 0.05);
}

.accordion-title {
    color: #fff;
    font-family: Arial, sans-serif;
    font-size: 13px;
    font-weight: 600;
}

.accordion-arrow {
    color: #888;
    font-size: 10px;
    transition: transform 0.2s;
}

.accordion-item[open] .accordion-arrow {
    transform: rotate(180deg);
}

.accordion-content {
    padding: 10px 12px 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.accordion-desc {
    color: #aaa;
    font-family: Arial, sans-serif;
    font-size: 12px;
    margin: 0 0 10px 0;
    line-height: 1.4;
}

.accordion-content .service-input {
    width: 100%;
    padding: 8px 10px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 4px;
    color: #fff;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    box-sizing: border-box;
}

.accordion-content .service-input:focus {
    outline: none;
    border-color: #3498DB;
}

.accordion-content textarea.service-input {
    resize: vertical;
    min-height: 60px;
}

.accordion-content textarea.service-input-large {
    min-height: 150px;
}

.accordion-extra-fields {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.accordion-extra-fields label {
    color: #888;
    font-family: Arial, sans-serif;
    font-size: 11px;
    font-weight: 600;
}

.accordion-extra-fields input {
    width: 100%;
    padding: 6px 8px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    color: #fff;
    font-family: 'Courier New', monospace;
    font-size: 11px;
    box-sizing: border-box;
}

.accordion-extra-fields input:focus {
    outline: none;
    border-color: #3498DB;
}

/* Webview name input */
.webview-name-input-container {
    margin-bottom: 12px;
}

.webview-name-input {
    width: 100%;
    padding: 8px 10px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 4px;
    color: #fff;
    font-family: Arial, sans-serif;
    font-size: 12px;
    box-sizing: border-box;
}

.webview-name-input:focus {
    outline: none;
    border-color: #3498DB;
}

.webview-name-input::placeholder {
    color: #888;
}

/* Webview apply button */
.webview-apply-btn {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #27AE60 0%, #229954 100%);
    color: white;
    border: none;
    border-radius: 6px;
    font-family: Arial, sans-serif;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: auto;
}

.webview-apply-btn:hover {
    background: linear-gradient(135deg, #2ECC71 0%, #27AE60 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(39, 174, 96, 0.4);
}


/* Modal action buttons */
.modal-actions {
    display: flex;
    gap: 12px;
    border-top: 1px solid #333;
    padding: 18px 25px;
    background: rgba(0, 0, 0, 0.2);
    margin: 0;
}

.modal-actions button {
    flex: 1;
    margin: 0;
    padding: 13px 24px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: Arial, sans-serif;
    border: none;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

#web-apply {
    background: linear-gradient(135deg, #27AE60 0%, #229954 100%);
    color: white;
}

#web-apply:hover {
    background: linear-gradient(135deg, #2ECC71 0%, #27AE60 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(39, 174, 96, 0.4);
}

#web-cancel {
    background: linear-gradient(135deg, #E74C3C 0%, #C0392B 100%);
    color: white;
}

#skybox-accept {
    background: linear-gradient(135deg, #3498DB 0%, #2980B9 100%);
    color: white;
}

#skybox-accept:hover {
    background: linear-gradient(135deg, #5DADE2 0%, #3498DB 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.4);
}

#skybox-selector-cancel {
    background: transparent;
    color: #ddd;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

#skybox-selector-cancel:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.5);
    color: #fff;
    transform: translateY(-1px);
}

#web-cancel:hover {
    background: linear-gradient(135deg, #EC7063 0%, #E74C3C 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.4);
}

/* Pill buttons */
.pill-container {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 5px;
}

.pill-button {
    padding: 10px 18px;
    background: rgba(255, 255, 255, 0.04);
    color: #bbb;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    cursor: pointer;
    font-family: Arial, sans-serif;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s;
    margin: 0;
    letter-spacing: 0.3px;
}

.pill-button:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
    color: #fff;
    transform: translateY(-1px);
}

.pill-button.active {
    background: rgba(52, 152, 219, 0.2);
    border-color: rgba(52, 152, 219, 0.5);
    color: #fff;
    box-shadow: 0 0 0 1px rgba(52, 152, 219, 0.2);
}

.pill-button.active:hover {
    background: rgba(52, 152, 219, 0.25);
    border-color: rgba(52, 152, 219, 0.6);
}

/* Web Tabs */
.web-tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid #333;
    background: rgba(0, 0, 0, 0.15);
}

.web-tab {
    flex: 1;
    padding: 14px 20px;
    background: transparent;
    color: #888;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    font-family: Arial, sans-serif;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.web-tab:hover {
    background: rgba(255, 255, 255, 0.03);
    color: #bbb;
}

.web-tab.active {
    color: #fff;
    border-bottom-color: #3498DB;
    background: rgba(52, 152, 219, 0.08);
}

.web-tab-content {
    display: none !important;
    flex: 1;
    overflow: hidden;
    min-height: 0;
}

.web-tab-content.active {
    display: flex !important;
    flex-direction: column;
    overflow: hidden;
}

/* Embed Container */
.embed-container {
    display: flex;
    gap: 0;
    flex: 1;
    overflow: hidden;
    min-height: 0;
}

.service-sidebar {
    width: 200px;
    overflow-y: auto;
    border-right: 1px solid #333;
    padding: 20px 15px 20px 25px;
    background: rgba(0, 0, 0, 0.15);
}

/* Custom scrollbar for service sidebar */
.service-sidebar::-webkit-scrollbar {
    width: 6px;
}

.service-sidebar::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

.service-sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.service-sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

.service-button {
    width: 100%;
    padding: 14px 12px;
    margin-bottom: 10px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s;
}

.service-button:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateX(3px);
}

.service-button.active {
    background: rgba(52, 152, 219, 0.15);
    border-color: rgba(52, 152, 219, 0.5);
    box-shadow: inset 3px 0 0 #3498DB;
}

.service-name {
    color: #fff;
    font-family: Arial, sans-serif;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 4px;
    letter-spacing: 0.3px;
}

.service-desc {
    color: #888;
    font-family: Arial, sans-serif;
    font-size: 11px;
    line-height: 1.3;
}

.service-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 15px;
    overflow-y: auto;
    padding: 25px 25px 25px 20px;
}

/* Custom scrollbar for service content */
.service-content::-webkit-scrollbar {
    width: 6px;
}

.service-content::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

.service-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.service-content::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

#service-instructions {
    color: #bbb;
    font-family: Arial, sans-serif;
    font-size: 13px;
    line-height: 1.7;
    padding: 16px 18px;
    background: rgba(52, 152, 219, 0.06);
    border-left: 3px solid #3498DB;
    border-radius: 6px;
    margin: 0;
}

#service-instructions h4 {
    margin: 0 0 10px 0;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.3px;
}

#service-instructions p {
    margin: 0 0 10px 0;
    color: #bbb;
}

#service-instructions p:last-child {
    margin-bottom: 0;
}

#service-instructions code {
    background: rgba(0, 0, 0, 0.4);
    padding: 3px 7px;
    border-radius: 4px;
    color: #5DADE2;
    font-family: 'Courier New', monospace;
    font-size: 12px;
}

#service-instructions a {
    color: #5DADE2;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s;
}

#service-instructions a:hover {
    color: #7EC8E3;
    text-decoration: underline;
}

#service-input-textarea {
    flex: 1;
    min-height: 0;
    padding: 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: #fff;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.5;
    resize: vertical;
    transition: all 0.2s;
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
}

#service-input-textarea:focus {
    outline: none;
    border-color: rgba(52, 152, 219, 0.5);
    background: rgba(255, 255, 255, 0.06);
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.1);
}

#service-input-url {
    width: 100%;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: #fff;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    transition: all 0.2s;
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
}

#service-input-url:focus {
    outline: none;
    border-color: rgba(52, 152, 219, 0.5);
    background: rgba(255, 255, 255, 0.06);
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.1);
}

#image-upload-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(0, 0, 0, 0.95);
    border: 3px solid #fff;
    border-radius: 10px;
    padding: 20px;
    z-index: 2000;
    display: none;
    pointer-events: auto;
    min-width: 500px;
    min-height: 300px;
}

#image-upload-modal.active {
    display: block;
}

#image-upload-modal h3 {
    margin: 0 0 15px 0;
    color: white;
    font-family: Arial, sans-serif;
}

#image-drop-zone {
    border: 3px dashed #fff;
    border-radius: 10px;
    padding: 40px;
    text-align: center;
    color: white;
    font-family: Arial, sans-serif;
    cursor: pointer;
    transition: all 0.2s;
}

#image-drop-zone.dragover {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: #fa0;
}

#image-drop-zone:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

#image-file-input {
    display: none;
}

#image-upload-modal button {
    margin-top: 15px;
    padding: 10px 20px;
    background-color: #27AE60;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
}

#image-upload-modal button:hover {
    background-color: #229954;
}

#image-url-controls {
    position: fixed;
    bottom: 120px;
    left: 10px;
    height: auto;
    background-color: transparent;
    border: none;
    display: none;
    padding: 0;
    box-sizing: border-box;
    z-index: 1500;
    pointer-events: none;
}

#image-url-controls.active {
    display: block;
}

#image-gallery {
    position: fixed;
    top: 0;
    bottom: 0;
    right: -320px;
    width: 300px;
    background-color: rgba(0, 0, 0, 0.8);
    border-left: 2px solid #fff;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 15px;
    padding-top: 55px; /* menu bar (40px) + 5px + top padding (10px) */
    box-sizing: border-box;
    z-index: 1500;
    pointer-events: auto;
    transition: right 0.3s ease;
}

#image-gallery.active {
    right: 0;
}

#image-gallery .slide-out-panel-header {
    color: white;
    font-family: Arial, sans-serif;
    font-size: 16px;
    font-weight: bold;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
    margin-bottom: 5px;
    flex-shrink: 0;
    width: 100%;
    text-align: left;
}

.image-gallery-tabs {
    display: flex;
    width: 100%;
    margin-bottom: 10px;
    flex-shrink: 0;
}

.image-gallery-tab {
    flex: 1;
    padding: 8px 12px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.6);
    font-family: Arial, sans-serif;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.image-gallery-tab:first-child {
    border-radius: 4px 0 0 4px;
}

.image-gallery-tab:last-child {
    border-radius: 0 4px 4px 0;
}

.image-gallery-tab:hover {
    background: rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.8);
}

.image-gallery-tab.active {
    background: rgba(93, 173, 226, 0.6);
    color: white;
}

#image-gallery-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    width: 100%;
    align-content: start;
}

#image-gallery.empty {
    justify-content: center;
}

#image-gallery-placeholder {
    grid-column: span 4;
    color: rgba(255, 255, 255, 0.25);
    font-family: Arial, sans-serif;
    font-size: 14px;
    pointer-events: none;
    text-align: center;
    padding: 5px 0;
}

#image-gallery.dragover {
    background-color: rgba(50, 100, 200, 0.3);
    border-left: 3px solid #0af;
}

#image-scaling-mode-container {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 0;
    flex-shrink: 0;
    width: 100%;
    flex-wrap: wrap;
    margin-top: auto;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.scaling-mode-label {
    color: rgba(255, 255, 255, 0.6);
    font-size: 11px;
    font-family: Arial, sans-serif;
    margin-right: 4px;
}

.scaling-mode-btn {
    padding: 4px 8px;
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    cursor: pointer;
    font-size: 11px;
    font-family: Arial, sans-serif;
    transition: all 0.15s;
}

.scaling-mode-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.scaling-mode-btn.active {
    background: #3498DB;
    color: white;
    border-color: #3498DB;
}

#image-browse-button {
    margin-top: 10px;
    padding: 10px 20px;
    background: #3498DB;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    font-size: 12px;
    pointer-events: auto;
    flex-shrink: 0;
    width: 100%;
}

#image-browse-button:hover {
    background: #5DADE2;
}

.gallery-image-item {
    display: block;
    width: 60px;
    height: 60px;
    position: relative;
    border: 3px solid transparent;
    border-radius: 6px;
    transition: all 0.2s;
    cursor: pointer;
    z-index: 1;
    box-sizing: border-box;
    justify-self: center;
    padding: 4px;
    background: transparent;
}

.gallery-image-item.current {
    border-color: #f0c000;
    box-shadow: 0 0 8px rgba(240, 192, 0, 0.6);
    background: rgba(0, 0, 0, 0.3);
}

.gallery-image-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 3px;
}

.gallery-image-delete {
    position: absolute;
    top: -3px;
    right: -3px;
    width: 14px;
    height: 14px;
    background-color: #f00;
    color: white;
    border: 1px solid #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    font-weight: bold;
    cursor: pointer;
    pointer-events: auto;
}

.gallery-image-delete:hover {
    background-color: #c00;
}

.color-indicator {
    width: 32px;
    height: 32px;
    background-color: #FFFFFF;
    border: 2px solid #000;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    flex-shrink: 0;
}

.color-indicator > div {
    position: absolute;
}

.color-indicator:hover {
    transform: scale(1.1);
}

.color-picker-dropdown {
    position: absolute;
    right: -145px;
    top: -260px;
    background-color: rgba(0, 0, 0, 0.9);
    border: 2px solid #fff;
    border-radius: 10px;
    padding: 30px 10px 10px 10px;
    pointer-events: auto;
    display: none;
    flex-wrap: wrap;
    align-content: flex-start;
    justify-content: flex-start;
    width: 152px;
    gap: 8px;
}

.color-picker-dropdown.active {
    display: flex;
}

.color-picker-close {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 20px;
    height: 20px;
    background-color: rgba(255, 255, 255, 0.2);
    border: 1px solid #fff;
    border-radius: 50%;
    color: white;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    line-height: 1;
    z-index: 10;
}

.color-picker-close:hover {
    background-color: rgba(255, 255, 255, 0.4);
    transform: scale(1.1);
}

#custom-color-input {
    width: 100%;
    height: 35px;
    cursor: pointer;
    border: 2px solid #fff;
    border-radius: 5px;
    background: transparent;
}

.color-option {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid #666;
    transition: all 0.2s;
    position: relative;
    box-sizing: border-box;
}

.color-option:hover {
    transform: scale(1.2);
    border-color: #fff;
}

.color-option.selected {
    border-color: #0f0;
    border-width: 3px;
}

.color-picker-reset {
    position: absolute;
    top: 7px;
    left: 10px;
    color: white;
    font-size: 11px;
    text-decoration: underline;
    cursor: pointer;
    transition: opacity 0.2s;
    user-select: none;
    background: none;
    border: none;
    padding: 0;
}

.color-picker-reset:hover {
    color: #ccc;
}

.color-picker-controls {
    display: contents;
}

.color-control-btn {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid #666;
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 16px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    user-select: none;
    box-sizing: border-box;
}

.color-control-btn:hover {
    transform: scale(1.15);
    border-color: #fff;
    background-color: rgba(255, 255, 255, 0.2);
}

/* Portal Config Slide-out Panel */
#portal-config-popup {
    /* Uses slide-out-panel class styles */
    z-index: 2000;
}

#portal-config-popup .slide-out-panel-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.portal-control-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.portal-control-group label {
    color: #aaa;
    font-family: Arial, sans-serif;
    font-size: 12px;
    font-weight: 600;
}

#portal-config-popup select {
    width: 100%;
    padding: 8px 10px;
    font-family: Arial, sans-serif;
    font-size: 13px;
    box-sizing: border-box;
    background-color: #222;
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 4px;
}

#portal-config-popup select:focus {
    outline: none;
    border-color: #3498DB;
}

#portal-config-popup input[type="color"] {
    width: 100%;
    height: 36px;
    padding: 2px;
    box-sizing: border-box;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 4px;
    cursor: pointer;
    background: #222;
}

#portal-preview-container {
    background-color: rgba(0, 0, 0, 0.3);
    border-radius: 6px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

#portal-visual-preview {
    position: relative;
    width: 120px;
    height: 120px;
}

#portal-ring-preview {
    position: absolute;
    width: 120px;
    height: 120px;
    border: 6px solid #00ccff;
    border-radius: 50%;
    box-sizing: border-box;
}

#portal-center-preview {
    position: absolute;
    top: 6px;
    left: 6px;
    width: 108px;
    height: 108px;
    border-radius: 50%;
    background-color: #333;
    overflow: hidden;
    box-sizing: border-box;
}

#portal-screenshot-preview {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: none;
    border-radius: 50%;
}

#portal-space-name-preview {
    color: white;
    font-family: Arial, sans-serif;
    font-size: 13px;
    font-weight: 600;
    margin: 10px 0 0 0;
    text-align: center;
}

.portal-apply-btn {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #27AE60 0%, #229954 100%);
    color: white;
    border: none;
    border-radius: 6px;
    font-family: Arial, sans-serif;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: auto;
}

.portal-apply-btn:hover {
    background: linear-gradient(135deg, #2ECC71 0%, #27AE60 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(39, 174, 96, 0.4);
}

.portal-mode-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

#portal-custom-path {
    flex: 1;
    padding: 8px 10px;
    font-family: Arial, sans-serif;
    font-size: 13px;
    box-sizing: border-box;
    background-color: #222;
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 4px;
}

#portal-custom-path:focus {
    outline: none;
    border-color: #3498DB;
}

#portal-custom-path::placeholder {
    color: #666;
}

.portal-lookup-btn {
    padding: 8px 14px;
    background: #3498DB;
    color: white;
    border: none;
    border-radius: 4px;
    font-family: Arial, sans-serif;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}

.portal-lookup-btn:hover {
    background: #2980B9;
}

#portal-custom-status {
    font-family: Arial, sans-serif;
    font-size: 11px;
    min-height: 14px;
}

#portal-custom-status.error {
    color: #E74C3C;
}

#portal-custom-status.success {
    color: #27AE60;
}

/* Left Panel Container */
#left-panel-container {
    position: absolute;
    top: 50px;
    left: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

#instructions {
    color: #ccc;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    background: rgba(20, 20, 28, 0.92);
    padding: 8px 10px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.07);
    font-size: 11px;
    line-height: 1.3;
    cursor: pointer;
    transition: all 0.2s;
    width: auto;
    min-width: 180px;
    box-sizing: border-box;
    pointer-events: auto;
    display: none;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}

#instructions.active {
    display: block;
}

#instructions.collapsed .instructions-content {
    display: none;
}

.instructions-content {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-top: 0;
}

.instructions-content .ctrl-title {
    font-size: 10px;
    font-weight: 600;
    color: #fff;
    padding: 1px 0 4px;
}

.instructions-content .ctrl-row {
    display: flex;
    align-items: center;
    padding: 1.5px 0;
    gap: 0;
}

.instructions-content .ctrl-keys {
    display: flex;
    align-items: center;
    gap: 2px;
    flex-shrink: 0;
    white-space: nowrap;
}

.instructions-content .ctrl-dash {
    color: #444;
    margin: 0 6px;
    font-size: 9px;
}

.instructions-content .ctrl-action {
    color: #888;
    font-size: 10px;
    white-space: nowrap;
}

.instructions-content kbd {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    font-family: 'SF Mono', 'Menlo', 'Consolas', monospace;
    font-size: 9px;
    color: #e0e0e0;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 4px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.3), inset 0 1px 0 rgba(255,255,255,0.06);
    line-height: 1;
    box-sizing: border-box;
    text-align: center;
}

.instructions-content kbd.arrow {
    font-size: 13px;
    font-family: inherit;
}

.instructions-content .ctrl-connector {
    color: #999;
    font-size: 9px;
    font-weight: 400;
    padding: 0 1px;
}

.instructions-content .ctrl-sep {
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    margin: 4px 0;
}

.instructions-content .ctrl-note {
    color: #777;
    font-size: 9px;
    font-style: italic;
    padding: 2px 0;
}

#instructions-header {
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #fff;
    margin-bottom: 4px;
}

#instructions-toggle {
    font-size: 10px;
    color: #666;
    transition: transform 0.2s;
}

#instructions.collapsed #instructions-toggle {
    transform: rotate(-90deg);
}

/* Webviews Panel */
#webviews-panel {
    color: white;
    font-family: Arial, sans-serif;
    background-color: rgba(0, 0, 0, 0.8);
    padding: 12px;
    border-radius: 5px;
    border: 1px solid #999;
    font-size: 10px;
    line-height: 1.5;
    cursor: pointer;
    transition: all 0.3s;
    width: 175px;
    box-sizing: border-box;
    pointer-events: auto;
}

#webviews-panel.collapsed {
}

#webviews-panel.collapsed #webviews-content {
    display: none;
}

#webviews-content {
    display: block;
    margin-top: 10px;
    max-height: 300px;
    overflow-y: auto;
}

#webviews-content::-webkit-scrollbar {
    width: 6px;
}

#webviews-content::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

#webviews-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

#webviews-content::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

#webviews-header {
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

#webviews-toggle {
    font-size: 10px;
}

#webviews-settings-btn {
    margin-left: auto;
    cursor: pointer;
    opacity: 0.6;
    font-size: 18px;
}

#webviews-settings-btn:hover {
    opacity: 1;
}

#webviews-header {
    position: relative;
}

#webviews-header > span:nth-child(2) {
    white-space: nowrap;
}

#max-active-select {
    position: absolute;
    right: 0;
    top: 100%;
    margin-top: 4px;
    background: rgba(30, 30, 30, 0.98);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 12px;
    cursor: pointer;
    outline: none;
    z-index: 100;
}

#max-active-select.hidden {
    display: none;
}

#max-active-select:focus {
    border-color: #3498db;
}

.webview-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    margin-bottom: 6px;
    transition: all 0.2s;
    cursor: pointer;
}

.webview-list-item:hover {
    background: rgba(255, 255, 255, 0.15);
}

.webview-list-item-info {
    flex: 1;
    min-width: 0;
}

.webview-list-item-type {
    font-weight: 600;
    font-size: 11px;
    color: #ddd;
    margin-bottom: 2px;
}

.webview-list-item-domain {
    font-size: 10px;
    color: #aaa;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.webview-deactivate-btn {
    width: 20px;
    height: 20px;
    background-color: rgba(255, 255, 255, 0.1);
    color: #888;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    font-weight: bold;
    flex-shrink: 0;
    margin-left: 8px;
}

.webview-deactivate-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
    color: #fff;
}

#dsl-panel {
    position: absolute;
    top: 10px;
    left: 20px;
    width: 220px;
    background-color: rgba(0, 0, 0, 0.6);
    border-radius: 5px;
    padding: 15px;
    pointer-events: auto;
    font-family: 'Courier New', monospace;
    cursor: pointer;
    transition: all 0.3s;
}

#dsl-panel.collapsed {
    padding: 10px 15px;
}

#dsl-panel.collapsed .dsl-content {
    display: none;
}

#dsl-header {
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 8px;
    color: white;
    font-family: Arial, sans-serif;
    font-size: 14px;
}

#dsl-toggle {
    font-size: 10px;
}

.dsl-content {
    margin-top: 10px;
}

#dsl-panel h3 {
    margin: 0 0 10px 0;
    color: white;
    font-family: Arial, sans-serif;
    font-size: 16px;
    display: none;
}

#dsl-input {
    width: 100%;
    height: 300px;
    background-color: #1e1e1e;
    color: #d4d4d4;
    border: 1px solid #555;
    border-radius: 5px;
    padding: 10px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    resize: vertical;
    box-sizing: border-box;
}

#dsl-apply {
    width: 100%;
    margin-top: 10px;
    padding: 10px;
    background-color: #3498DB;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    font-size: 14px;
}

#dsl-apply:hover {
    background-color: #2980B9;
}

#dsl-output {
    margin-top: 10px;
    padding: 10px;
    background-color: rgba(0, 0, 0, 0.5);
    border-radius: 5px;
    color: #0f0;
    font-size: 12px;
    min-height: 20px;
    max-height: 100px;
    overflow-y: auto;
}

#dsl-output.error {
    color: #f00;
}

/* Menu Bar */
#menu-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, rgba(20, 20, 20, 0.95) 0%, rgba(35, 35, 35, 0.95) 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding: 0 20px;
    z-index: 3000;
    pointer-events: auto;
    backdrop-filter: blur(10px);
}

#menu-bar-left {
    flex: 1;
    display: flex;
    align-items: center;
}

#menu-bar-center {
    display: flex;
    align-items: center;
    gap: 0;
}

#menu-bar-right {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    color: white;
    font-family: Arial, sans-serif;
    font-size: 14px;
}

/* User menu (logged in) */
.user-menu {
    display: flex;
    align-items: center;
    gap: 8px;
}

.user-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background:
        radial-gradient(circle at 0% 100%, rgba(255, 45, 146, 0.85) 0%, transparent 55%),
        radial-gradient(circle at 100% 0%, rgba(0, 212, 255, 0.85) 0%, transparent 55%),
        radial-gradient(circle at 80% 80%, rgba(168, 85, 247, 0.7) 0%, transparent 50%),
        radial-gradient(circle at 30% 20%, rgba(255, 214, 10, 0.5) 0%, transparent 45%),
        linear-gradient(135deg, #ff2d92 0%, #a855f7 50%, #00d4ff 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
    color: white;
    text-transform: uppercase;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
    box-shadow: 0 2px 10px rgba(168, 85, 247, 0.45);
}

.user-avatar-image {
    object-fit: cover;
    background: none;
}

.user-avatar-initial {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    text-shadow: 0 0 3px rgba(0,0,0,1), 0 1px 2px rgba(0,0,0,1), 0 0 10px rgba(0,0,0,0.8), 0 2px 6px rgba(0,0,0,0.9);
}

/* User dropdown (shared component) */
.user-dropdown {
    position: relative;
}
.user-dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.4rem;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s;
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.9);
    font-size: 13px;
    line-height: 1;
    margin-bottom: 0;
}
.user-dropdown-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
}
.user-dropdown-toggle svg {
    transition: transform 0.2s;
    opacity: 0.7;
}
.user-dropdown.open .user-dropdown-toggle svg {
    transform: rotate(180deg);
}
.user-dropdown-menu {
    position: absolute;
    top: calc(100% + 0.35rem);
    right: 0;
    min-width: 180px;
    background: #1a1f35;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.15s ease;
    z-index: 10000;
}
.user-dropdown.open .user-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.user-dropdown-menu a,
.user-dropdown-menu button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.6rem 0.875rem;
    text-decoration: none;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.8rem;
    border: none;
    background: transparent;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    text-align: left;
}
.user-dropdown-menu a:hover,
.user-dropdown-menu button:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}
.user-dropdown-menu a:first-child {
    border-radius: 7px 7px 0 0;
}
.user-dropdown-menu a:last-child,
.user-dropdown-menu button:last-child,
.user-dropdown-menu .logout-item button {
    border-radius: 0 0 7px 7px;
}
.user-dropdown-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 0.25rem 0;
}
.user-dropdown-menu .logout-item {
    margin: 0;
    padding: 0;
}
.user-dropdown-menu .logout-item button {
    color: #ff6b6b;
}
.user-dropdown-menu .logout-item button:hover {
    background: rgba(255, 107, 107, 0.15);
    color: #ff6b6b;
}
.header-avatar {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}
.header-avatar-initial {
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 600;
    color: white;
    text-transform: uppercase;
    text-shadow: 0 0 3px rgba(0,0,0,1), 0 1px 2px rgba(0,0,0,1);
    box-shadow: 0 2px 8px rgba(168, 85, 247, 0.45);
}

.user-name-link {
    color: white;
    text-decoration: none;
    font-size: 13px;
    opacity: 0.9;
    transition: opacity 0.2s;
}

.user-name-link:hover {
    opacity: 1;
    text-decoration: underline;
}

/* Auth links (not logged in) */
.auth-links {
    display: flex;
    align-items: center;
    gap: 12px;
}

.auth-link {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: 13px;
    padding: 5px 12px;
    border-radius: 5px;
    transition: all 0.15s;
    font-weight: 500;
}

.auth-link:hover {
    color: white;
    opacity: 1;
}

.auth-link-primary {
    background: #6366f1;
    color: white;
}

.auth-link-primary:hover {
    background: #5558e3;
}

#speed-indicator {
    padding: 4px 10px;
    border: none;
    border-radius: 4px;
    color: white;
    font-family: Arial, sans-serif;
    font-size: 13px;
    font-weight: bold;
    cursor: pointer;
    transition: opacity 0.2s;
}

#speed-indicator:hover {
    opacity: 0.8;
}

#space-name-display {
    color: white;
    font-family: Arial, sans-serif;
    font-size: 16px;
    font-weight: 500;
}

.menu-bar-link {
    color: inherit;
    text-decoration: none;
}

.menu-bar-link:hover {
    text-decoration: underline;
}

.menu-item {
    position: relative;
    display: inline-block;
}

.menu-label {
    padding: 10px 18px;
    color: #ddd;
    font-family: Arial, sans-serif;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    display: inline-block;
    transition: all 0.2s;
    border-radius: 4px;
}

.menu-label:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.menu-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 180px;
    background: linear-gradient(135deg, rgba(30, 30, 30, 0.98) 0%, rgba(45, 45, 45, 0.98) 100%);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    margin-top: 5px;
    padding: 6px 0;
    display: none;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    z-index: 3001;
}

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

.menu-option {
    padding: 10px 18px;
    color: #ccc;
    font-family: Arial, sans-serif;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.15s;
}

.menu-option:hover {
    background: rgba(52, 152, 219, 0.2);
    color: #fff;
}

.menu-separator {
    height: 1px;
    background: rgba(255, 255, 255, 0.15);
    margin: 6px 12px;
}

/* Menu option with checkmark */
.menu-option .checkmark {
    color: #2ecc71;
    font-weight: bold;
    margin-right: 5px;
}

/* Keep checkmark and label together (prevent space-between from separating them) */
.menu-option .checkmark + span {
    margin-right: auto;
}

/* Disabled menu option */
.menu-option.disabled {
    color: #666;
    cursor: default;
}

.menu-option.disabled:hover {
    background: transparent;
    color: #666;
}

/* Menu option with keyboard shortcut */
.menu-option {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.menu-option-label {
    flex: 1;
}

.menu-shortcut {
    color: #777;
    font-size: 11px;
    margin-left: 20px;
    font-family: monospace;
}

.menu-option.disabled .menu-shortcut {
    color: #555;
}

/* Changes list in Changes menu */
.changes-list {
    max-height: 300px;
    overflow-y: auto;
    overflow-x: hidden;
}

.changes-list::-webkit-scrollbar {
    width: 6px;
}

.changes-list::-webkit-scrollbar-track {
    background: #1a1a1a;
}

.changes-list::-webkit-scrollbar-thumb {
    background: #444;
    border-radius: 3px;
}

.changes-list::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.changes-empty {
    color: #666;
    font-style: italic;
    padding: 8px 12px;
    font-size: 12px;
}

.change-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 12px;
    font-size: 12px;
    color: #ccc;
    cursor: default;
    border-bottom: 1px solid #333;
}

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

.change-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.change-item-label {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-right: 8px;
}

.change-item-rollback {
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #888;
    cursor: pointer;
    border-radius: 3px;
    flex-shrink: 0;
}

.change-item-rollback:hover {
    background: rgba(100, 150, 255, 0.3);
    color: #6699ff;
}

.change-item.undone {
    opacity: 0.5;
}

.change-item.undone .change-item-label {
    text-decoration: line-through;
}

#edit-dropdown {
    min-width: 200px;
}

/* Auto-save message */
#auto-save-message {
    color: #4ade80;
    font-size: 13px;
    font-weight: 500;
    margin-left: 15px;
    padding: 5px 14px;
    font-family: sans-serif;
    background: rgba(74, 222, 128, 0.15);
    border: 1px solid #4ade80;
    border-radius: 8px;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

#auto-save-message.visible {
    opacity: 1;
}

#auto-save-message.no-save {
    display: inline-block !important;
    color: #f59e0b !important;
    background: rgba(245, 158, 11, 0.15) !important;
    border-color: #ff6a00 !important;
    opacity: 1 !important;
}

/* Save Reminder Panel - for new spaces without screenshot */
#save-reminder-panel {
    color: white;
    font-family: Arial, sans-serif;
    background-color: rgba(34, 80, 50, 0.9);
    padding: 8px 12px;
    border-radius: 5px;
    border: 1px solid #4caf50;
    font-size: 10px;
    line-height: 1.4;
    width: 175px;
    box-sizing: border-box;
    pointer-events: auto;
    margin-bottom: 8px;
    transition: opacity 0.5s ease, transform 0.5s ease;
}

#save-reminder-panel.fade-out {
    opacity: 0;
    transform: translateY(-10px);
}

#save-reminder-panel strong {
    color: #ffff00;
}

/* Bookmarks Panel - styled like instructions/webviews panels */
#bookmarks-panel {
    color: white;
    font-family: Arial, sans-serif;
    background-color: rgba(0, 0, 0, 0.8);
    padding: 12px;
    border-radius: 5px;
    border: 1px solid #999;
    font-size: 10px;
    line-height: 1.5;
    cursor: pointer;
    transition: all 0.3s;
    width: 175px;
    box-sizing: border-box;
    pointer-events: auto;
    display: none;
}

#bookmarks-panel.active {
    display: block;
}

#bookmarks-panel.collapsed {
}

#bookmarks-panel.collapsed #bookmarks-content {
    display: none;
}

#bookmarks-content {
    display: block;
    margin-top: 10px;
    max-height: 300px;
    overflow-y: auto;
}

#bookmarks-content::-webkit-scrollbar {
    width: 6px;
}

#bookmarks-content::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

#bookmarks-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

#bookmarks-content::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

#bookmarks-header {
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

#bookmarks-toggle {
    font-size: 10px;
}

#bookmarks-add-btn {
    margin-left: auto;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    border-radius: 4px;
    color: #fff;
    width: 22px;
    height: 22px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    line-height: 1;
}

#bookmarks-add-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.bookmarks-instructions {
    color: #888;
    font-size: 10px;
    margin-bottom: 8px;
    font-style: italic;
}

.bookmark-list-item {
    display: flex;
    align-items: center;
    padding: 8px 10px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    margin-bottom: 6px;
    transition: all 0.2s;
    cursor: pointer;
    opacity: 0.7;
}

.bookmark-list-item:hover {
    background: rgba(255, 255, 255, 0.15);
    opacity: 1;
}

.bookmark-list-item.current {
    background: rgba(52, 152, 219, 0.3);
    opacity: 1;
}

.bookmark-list-item:last-child {
    margin-bottom: 0;
}

.bookmark-item-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bookmark-item-menu-btn {
    flex-shrink: 0;
    width: 20px;
    text-align: center;
    font-size: 16px;
    line-height: 1;
    opacity: 0;
    cursor: pointer;
    border-radius: 3px;
    transition: opacity 0.15s;
    margin-left: auto;
    margin-right: -4px;
}

.bookmark-list-item:hover .bookmark-item-menu-btn {
    opacity: 0.6;
}

.bookmark-item-menu-btn:hover {
    opacity: 1 !important;
    background: rgba(255, 255, 255, 0.15);
}

.bookmark-item-popup-menu {
    background: rgba(30, 30, 30, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    padding: 4px 0;
    z-index: 10000;
    min-width: 100px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.bookmark-item-popup-option {
    padding: 6px 14px;
    color: #ddd;
    font-size: 13px;
    cursor: pointer;
    white-space: nowrap;
}

.bookmark-item-popup-option:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

/* Drag states */
.bookmark-list-item {
    cursor: grab;
}

.bookmark-list-item:active {
    cursor: grabbing;
}

.bookmark-list-item.dragging {
    display: none;
}

/* Drop indicator - same shape as bookmark item with light blue background */
.bookmark-drop-indicator {
    display: flex;
    align-items: center;
    padding: 8px 10px;
    background: rgba(52, 152, 219, 0.3);
    border: 1px dashed rgba(52, 152, 219, 0.6);
    border-radius: 4px;
    margin-bottom: 6px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 12px;
}

/* Hidden drop zone at end of list */
.bookmark-drop-zone {
    height: 10px;
}

.bookmarks-empty {
    color: #666;
    font-size: 11px;
    font-style: italic;
    text-align: center;
    padding: 10px 0;
}

/* DSL Modal Popup */
#dsl-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    border: 1px solid #666;
    border-radius: 12px;
    padding: 0;
    z-index: 3500;
    display: none;
    pointer-events: auto;
    width: 600px;
    max-height: 80vh;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
    overflow: hidden;
    flex-direction: column;
}

#dsl-popup.active {
    display: flex;
}

#dsl-popup h3 {
    margin: 0;
    padding: 20px 25px;
    color: white;
    font-family: Arial, sans-serif;
    font-size: 18px;
    font-weight: 600;
    border-bottom: 1px solid #333;
    background: rgba(0, 0, 0, 0.2);
}

.dsl-popup-content {
    padding: 25px;
    overflow-y: auto;
    flex: 1;
}

.dsl-popup-content::-webkit-scrollbar {
    width: 6px;
}

.dsl-popup-content::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

.dsl-popup-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.dsl-popup-content::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

#dsl-popup textarea {
    width: 100%;
    height: 350px;
    background-color: rgba(30, 30, 30, 0.9);
    color: #d4d4d4;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    padding: 14px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    resize: vertical;
    box-sizing: border-box;
    transition: all 0.2s;
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
}

#dsl-popup textarea:focus {
    outline: none;
    border-color: rgba(52, 152, 219, 0.5);
    background: rgba(30, 30, 30, 1);
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.1);
}

#dsl-popup-output {
    margin-top: 15px;
    padding: 12px 14px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #0f0;
    font-size: 12px;
    font-family: 'Courier New', monospace;
    min-height: 30px;
    max-height: 100px;
    overflow-y: auto;
}

#dsl-popup-output.error {
    color: #f00;
}

.dsl-popup-actions {
    display: flex;
    gap: 12px;
    border-top: 1px solid #333;
    padding: 18px 25px;
    background: rgba(0, 0, 0, 0.2);
}

.dsl-popup-actions button {
    flex: 1;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: Arial, sans-serif;
    border: none;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

#dsl-popup-apply {
    background: linear-gradient(135deg, #3498DB 0%, #2980B9 100%);
    color: white;
}

#dsl-popup-apply:hover {
    background: linear-gradient(135deg, #5DADE2 0%, #3498DB 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.4);
}

#dsl-popup-close {
    background: linear-gradient(135deg, #95A5A6 0%, #7F8C8D 100%);
    color: white;
}

#dsl-popup-close:hover {
    background: linear-gradient(135deg, #B3B3B3 0%, #95A5A6 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(149, 165, 166, 0.4);
}

/* Settings Modal */
#settings-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    border: 1px solid #666;
    border-radius: 12px;
    padding: 0;
    z-index: 3500;
    display: none;
    pointer-events: auto;
    width: 450px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
}

#settings-popup.active {
    display: block;
}

#settings-popup h3 {
    margin: 0;
    padding: 20px 25px;
    color: white;
    font-family: Arial, sans-serif;
    font-size: 18px;
    font-weight: 600;
    border-bottom: 1px solid #333;
    background: rgba(0, 0, 0, 0.2);
}

.settings-close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 32px;
    height: 32px;
    background-color: rgba(255, 255, 255, 0.1);
    color: #ddd;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    cursor: pointer;
    font-size: 24px;
    line-height: 1;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    font-family: Arial, sans-serif;
    z-index: 10;
}

.settings-close-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.settings-content {
    padding: 25px;
}

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

.setting-group:last-child {
    margin-bottom: 0;
}

.setting-group label {
    display: block;
    margin-bottom: 8px;
    color: #ddd;
    font-family: Arial, sans-serif;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.setting-group select {
    width: 100%;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: #fff;
    font-family: Arial, sans-serif;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
}

.setting-group select:focus {
    outline: none;
    border-color: rgba(52, 152, 219, 0.5);
    background: rgba(255, 255, 255, 0.06);
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.1);
}

.setting-group select option {
    background: #2d2d2d;
    color: #fff;
}

.setting-group input[type="color"] {
    width: 100%;
    height: 45px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.setting-group input[type="color"]:hover {
    border-color: rgba(255, 255, 255, 0.2);
}

.setting-group input[type="color"]:focus {
    outline: none;
    border-color: rgba(52, 152, 219, 0.5);
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.1);
}

/* Add Bookmark Modal */
#add-bookmark-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    border: 1px solid #666;
    border-radius: 12px;
    padding: 25px;
    z-index: 3500;
    display: none;
    pointer-events: auto;
    width: 400px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
}

#add-bookmark-popup.active {
    display: block;
}

#add-bookmark-popup h3 {
    margin: 0 0 20px 0;
    color: white;
    font-family: Arial, sans-serif;
    font-size: 18px;
    font-weight: 600;
}

#add-bookmark-popup label {
    display: block;
    margin-bottom: 8px;
    color: #ddd;
    font-family: Arial, sans-serif;
    font-size: 13px;
    font-weight: 600;
}

#bookmark-name-input {
    width: 100%;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: #fff;
    font-family: Arial, sans-serif;
    font-size: 14px;
    box-sizing: border-box;
    margin-bottom: 20px;
    transition: all 0.2s;
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
}

#bookmark-name-input:focus {
    outline: none;
    border-color: rgba(52, 152, 219, 0.5);
    background: rgba(255, 255, 255, 0.06);
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.1);
}

/* Manage Bookmarks Modal */
#manage-bookmarks-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    border: 1px solid #666;
    border-radius: 12px;
    padding: 0;
    z-index: 3500;
    display: none;
    pointer-events: auto;
    width: 500px;
    max-height: 600px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
}

#manage-bookmarks-popup.active {
    display: block;
}

#manage-bookmarks-popup h3 {
    margin: 0;
    padding: 20px 25px;
    color: white;
    font-family: Arial, sans-serif;
    font-size: 18px;
    font-weight: 600;
    border-bottom: 1px solid #333;
    background: rgba(0, 0, 0, 0.2);
}

#manage-bookmarks-list {
    padding: 20px 25px;
    max-height: 500px;
    overflow-y: auto;
}

#manage-bookmarks-list::-webkit-scrollbar {
    width: 6px;
}

#manage-bookmarks-list::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

#manage-bookmarks-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

#manage-bookmarks-list::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

.manage-bookmark-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    margin-bottom: 10px;
    transition: all 0.2s;
}

.manage-bookmark-item:hover {
    background: rgba(255, 255, 255, 0.08);
}

.manage-bookmark-name {
    flex: 1;
    color: #fff;
    font-family: Arial, sans-serif;
    font-size: 14px;
    font-weight: 600;
}

.manage-bookmark-name input {
    width: 100%;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    padding: 6px 10px;
    color: #fff;
    font-family: Arial, sans-serif;
    font-size: 14px;
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
}

.manage-bookmark-name input:focus {
    outline: none;
    border-color: rgba(52, 152, 219, 0.5);
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.1);
}

.manage-bookmark-actions {
    display: flex;
    gap: 8px;
}

.manage-bookmark-btn {
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-family: Arial, sans-serif;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.2s;
}

.edit-bookmark-btn {
    background: rgba(52, 152, 219, 0.2);
    color: #5DADE2;
    border: 1px solid rgba(52, 152, 219, 0.4);
}

.edit-bookmark-btn:hover {
    background: rgba(52, 152, 219, 0.3);
    color: #fff;
}

.delete-bookmark-btn {
    background: rgba(231, 76, 60, 0.2);
    color: #E74C3C;
    border: 1px solid rgba(231, 76, 60, 0.4);
}

.delete-bookmark-btn:hover {
    background: rgba(231, 76, 60, 0.3);
    color: #fff;
}

.save-bookmark-btn {
    background: rgba(39, 174, 96, 0.2);
    color: #27AE60;
    border: 1px solid rgba(39, 174, 96, 0.4);
}

.save-bookmark-btn:hover {
    background: rgba(39, 174, 96, 0.3);
    color: #fff;
}

.cancel-edit-btn {
    background: rgba(149, 165, 166, 0.2);
    color: #95A5A6;
    border: 1px solid rgba(149, 165, 166, 0.4);
}

.cancel-edit-btn:hover {
    background: rgba(149, 165, 166, 0.3);
    color: #fff;
}

/* Skybox Selector Modal */
#skybox-selector-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 0;
    display: none;
    pointer-events: auto;
    width: 480px;
    max-height: 80vh;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
    overflow: hidden;
    z-index: 3600;
}

#skybox-selector-popup.active {
    display: flex;
    flex-direction: column;
}

#skybox-selector-popup h3 {
    margin: 0;
    padding: 20px 25px;
    color: white;
    font-family: Arial, sans-serif;
    font-size: 18px;
    font-weight: 600;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

#skybox-grid {
    display: grid;
    grid-template-columns: repeat(4, 100px);
    gap: 10px;
    padding: 20px;
    overflow-y: auto;
    max-height: calc(80vh - 160px);
    justify-content: center;
}

#skybox-grid::-webkit-scrollbar {
    width: 8px;
}

#skybox-grid::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

#skybox-grid::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

#skybox-grid::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

.skybox-grid-item {
    transition: all 0.2s;
}

.skybox-grid-item:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.5);
}

.skybox-grid-item.selected {
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.5);
}

/* Recolor Modal Backdrop */
/* Recolor Slide-out Panel */
#recolor-popup {
    /* Uses slide-out-panel class styles */
    z-index: 10000;
    padding-top: 0;
}

#recolor-popup .slide-out-panel-content {
    overflow-y: auto;
    padding-bottom: 15px;
}

.recolor-content {
    display: flex;
    flex-direction: column;
}

.recolor-back-btn {
    background: transparent;
    border: none;
    color: #3498DB;
    font-family: Arial, sans-serif;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    padding: 8px 15px 4px 15px;
    border-radius: 0;
    transition: all 0.2s;
    display: block;
    text-align: left;
}

.recolor-back-btn:hover {
    color: #5DADE2;
}

.recolor-dimensions {
    display: flex;
    gap: 15px;
    padding: 8px 10px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    margin-bottom: 10px;
    font-family: Arial, sans-serif;
    font-size: 12px;
    color: #ddd;
    font-weight: 600;
}

.recolor-dimensions span:first-child {
    color: #888;
}

.recolor-dimensions span:not(:first-child) {
    color: #5DADE2;
}

.recolor-setting-group {
    margin-bottom: 10px;
}

.recolor-setting-group label {
    display: block;
    margin-bottom: 4px;
    color: #aaa;
    font-family: Arial, sans-serif;
    font-size: 11px;
    font-weight: 600;
}

.recolor-setting-group select,
.recolor-setting-group input[type="color"] {
    width: 100%;
    padding: 6px 10px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    color: #fff;
    font-family: Arial, sans-serif;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.recolor-setting-group select:hover {
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.06);
}

.recolor-setting-group select:focus {
    outline: none;
    border-color: rgba(52, 152, 219, 0.5);
    background: rgba(255, 255, 255, 0.06);
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.1);
}

.recolor-color-indicator {
    width: 32px;
    height: 32px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    cursor: pointer;
    position: relative;
    background: linear-gradient(135deg, #C62828 0%, #E53935 100%);
    transition: all 0.2s;
    z-index: 100;
}

.recolor-color-indicator:hover {
    border-color: rgba(255, 255, 255, 0.4);
    transform: scale(1.05);
}

.recolor-color-picker-dropdown {
    position: absolute;
    top: -180px;
    left: 30px;
    background-color: rgba(0, 0, 0, 0.9);
    border: 2px solid #fff;
    border-radius: 10px;
    padding: 30px 10px 10px 10px;
    pointer-events: auto;
    display: none;
    flex-wrap: wrap;
    align-content: flex-start;
    justify-content: flex-start;
    width: 152px;
    gap: 8px;
    z-index: 10001;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.recolor-color-picker-dropdown.active {
    display: flex;
}

.recolor-color-slots {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    margin-bottom: 10px;
    margin-top: 8px;
    position: relative;
    z-index: 1;
}

.color-slot {
    width: 100%;
    max-width: 50px;
    aspect-ratio: 1;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    background: rgba(255, 255, 255, 0.05);
    position: relative;
}

.color-slot:hover {
    border-color: rgba(255, 255, 255, 0.4);
    transform: scale(1.05);
}

.color-slot.filled {
    border-color: rgba(255, 255, 255, 0.3);
}

.color-slot.filled:hover {
    border-color: rgba(231, 76, 60, 0.6);
}

.recolor-apply-button {
    width: 100%;
    padding: 10px 16px;
    background: linear-gradient(135deg, #27AE60 0%, #229954 100%);
    border: none;
    border-radius: 6px;
    color: white;
    font-family: Arial, sans-serif;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-transform: uppercase;
    margin-top: 5px;
    letter-spacing: 0.5px;
}

.recolor-apply-button:hover {
    background: linear-gradient(135deg, #229954 0%, #1E8449 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(39, 174, 96, 0.3);
}

.recolor-apply-button:active {
    transform: translateY(0);
}

/* Create Region Modal */
#save-region-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    border: 1px solid #666;
    border-radius: 12px;
    padding: 25px;
    z-index: 3500;
    display: none;
    pointer-events: auto;
    width: 400px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
}

#save-region-popup.active {
    display: block;
}

#save-region-popup h3 {
    margin: 0 0 20px 0;
    color: white;
    font-family: Arial, sans-serif;
    font-size: 18px;
    font-weight: 600;
}

#save-region-popup label {
    display: block;
    margin-bottom: 8px;
    color: #ddd;
    font-family: Arial, sans-serif;
    font-size: 13px;
    font-weight: 600;
}

#save-region-name-input {
    width: 100%;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: #fff;
    font-family: Arial, sans-serif;
    font-size: 14px;
    margin-bottom: 20px;
    box-sizing: border-box;
}

#save-region-name-input:focus {
    outline: none;
    border-color: rgba(52, 152, 219, 0.5);
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.1);
}

/* Regions Modal */
#regions-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    border: 1px solid #666;
    border-radius: 12px;
    padding: 0;
    z-index: 3500;
    display: none;
    pointer-events: auto;
    width: 600px;
    max-height: 600px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
}

#regions-popup.active {
    display: block;
}

#regions-popup h3 {
    margin: 0;
    padding: 20px 25px;
    color: white;
    font-family: Arial, sans-serif;
    font-size: 18px;
    font-weight: 600;
    border-bottom: 1px solid #333;
    background: rgba(0, 0, 0, 0.2);
}

#regions-list {
    padding: 20px 25px;
    max-height: 500px;
    overflow-y: auto;
}

#regions-list::-webkit-scrollbar {
    width: 6px;
}

#regions-list::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

#regions-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

#regions-list::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Region Settings Modal */
#region-settings-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    border: 1px solid #666;
    border-radius: 12px;
    padding: 0;
    z-index: 3600;
    display: none;
    pointer-events: auto;
    width: 400px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
}

#region-settings-popup.active {
    display: block;
}

#region-settings-popup h3 {
    margin: 0;
    padding: 20px 25px;
    color: white;
    font-family: Arial, sans-serif;
    font-size: 18px;
    font-weight: 600;
    border-bottom: 1px solid #333;
    background: rgba(0, 0, 0, 0.2);
}

.region-settings-content {
    padding: 20px 25px;
}

.region-settings-content .setting-group {
    margin-bottom: 15px;
}

.region-settings-content label {
    display: block;
    margin-bottom: 8px;
    color: #ddd;
    font-family: Arial, sans-serif;
    font-size: 13px;
    font-weight: 600;
}

#region-settings-name {
    width: 100%;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: #fff;
    font-family: Arial, sans-serif;
    font-size: 14px;
    box-sizing: border-box;
}

#region-settings-name:focus {
    outline: none;
    border-color: rgba(52, 152, 219, 0.5);
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.1);
}

#region-bounds-color {
    width: 100%;
    height: 40px;
    padding: 4px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    cursor: pointer;
    box-sizing: border-box;
}

#region-settings-save,
#region-settings-delete {
    width: 100%;
    padding: 12px 20px;
    border: none;
    border-radius: 6px;
    color: white;
    font-family: Arial, sans-serif;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 0;
}

#region-settings-save:hover {
    opacity: 0.9;
}

#region-settings-delete:hover {
    opacity: 0.9;
}

/* Debug Overlay */
#debug-overlay {
    display: none;
    position: fixed;
    bottom: 20px;
    left: 20px;
    background: rgba(0, 0, 0, 0.85);
    color: #0f0;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    padding: 12px 16px;
    border-radius: 6px;
    border: 1px solid rgba(0, 255, 0, 0.3);
    z-index: 10000;
    pointer-events: none;
    min-width: 280px;
    line-height: 1.5;
}

#debug-overlay.active {
    display: block;
}

#debug-fps-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(0, 255, 0, 0.2);
}

#debug-fps {
    color: #0ff;
    font-weight: bold;
    white-space: nowrap;
}

#debug-fps-sparkline {
    flex: 1;
    height: 20px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 2px;
}

#debug-fps-sparkline polyline {
    fill: none;
    stroke: #0ff;
    stroke-width: 1.5;
}

#debug-selection {
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(0, 255, 0, 0.2);
    color: #f0a;
    max-height: 150px;
    overflow-y: auto;
}

#debug-selection:empty {
    display: none;
}

#debug-objects {
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(0, 255, 0, 0.2);
}

#debug-player {
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(0, 255, 0, 0.2);
}

#debug-hover {
    color: #ff0;
}

#debug-overlay .debug-label {
    color: #888;
}

#debug-overlay .debug-value {
    color: #0f0;
}

/* =================================
   Placeable Hover Toolbar (now 3D, HTML hidden)
   ================================= */
.placeable-toolbar {
    display: none !important;
}

/* Editing mode button text changes */
.slide-out-panel.editing-mode .markdown-btn.apply,
.slide-out-panel.editing-mode .portal-apply-btn,
.slide-out-panel.editing-mode .text-edit-btn.accept,
#image-gallery.editing-mode .image-tile::after {
    content: 'Update';
}

/* Portal apply button text change when editing */
#portal-config-popup.editing-mode #portal-apply {
    font-size: 0;
}
#portal-config-popup.editing-mode #portal-apply::after {
    font-size: 14px;
    content: 'Update Portal';
}

/* Markdown apply button text change when editing */
#markdown-config-popup.editing-mode #markdown-apply {
    font-size: 0;
}
#markdown-config-popup.editing-mode #markdown-apply::after {
    font-size: 14px;
    content: 'Update';
}

/* Image gallery editing mode indicator */
#image-gallery.editing-mode::before {
    content: 'Select replacement image';
    display: block;
    background: rgba(52, 152, 219, 0.2);
    border: 1px solid rgba(52, 152, 219, 0.5);
    padding: 8px 12px;
    margin-bottom: 10px;
    border-radius: 4px;
    font-size: 13px;
    color: #3498DB;
}

/* Danger menu option (red text) */
.menu-option-danger {
    color: #e74c3c !important;
}

.menu-option-danger:hover {
    background: rgba(231, 76, 60, 0.2) !important;
    color: #ff6b5b !important;
}

/* Delete Space Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10001;
}

.modal-content {
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 8px;
    padding: 24px;
    max-width: 450px;
    width: 90%;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.modal-content h3 {
    margin: 0 0 16px 0;
    color: #fff;
    font-family: Arial, sans-serif;
    font-size: 18px;
}

.modal-content p {
    color: #aaa;
    font-family: Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    margin: 0 0 16px 0;
}

.modal-content p strong {
    color: #fff;
    font-family: monospace;
    background: #333;
    padding: 2px 6px;
    border-radius: 3px;
}

.modal-content input[type="text"] {
    width: 100%;
    padding: 10px 12px;
    background: #2a2a2a;
    border: 1px solid #444;
    border-radius: 4px;
    color: #fff;
    font-family: monospace;
    font-size: 14px;
    margin-bottom: 20px;
    box-sizing: border-box;
}

.modal-content input[type="text"]:focus {
    outline: none;
    border-color: #666;
}

.modal-content input[type="text"]::placeholder {
    color: #666;
}

.delete-modal .modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.delete-modal .btn {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    font-family: Arial, sans-serif;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.15s;
}

.delete-modal .btn-secondary {
    background: #333;
    color: #ccc;
}

.delete-modal .btn-secondary:hover {
    background: #444;
    color: #fff;
}

.delete-modal .btn-danger {
    background: #c0392b;
    color: #fff;
}

.delete-modal .btn-danger:hover:not(:disabled) {
    background: #e74c3c;
}

.delete-modal .btn-danger:disabled {
    background: #5a5a5a;
    color: #888;
    cursor: not-allowed;
}

/* Deletion Warning Banner */
#deletion-warning-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: #c0392b;
    color: #fff;
    padding: 10px 20px;
    text-align: center;
    font-family: Arial, sans-serif;
    font-size: 14px;
    z-index: 10002;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
}

#deletion-warning-banner .restore-link {
    color: #fff;
    font-weight: 600;
    text-decoration: underline;
    cursor: pointer;
}

#deletion-warning-banner .restore-link:hover {
    color: #ffcccb;
}

/* Form error text */
.error-text {
    color: #c0392b;
    font-size: 0.85em;
    margin-top: 0.25rem;
    display: block;
}

/* ============================================
   Onboarding: Shared kbd style
   ============================================ */

.onboarding-kbd,
.coach-hint kbd,
#manual-popup kbd {
    display: inline-block;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 5px;
    padding: 3px 8px;
    font-family: 'SF Mono', 'Menlo', 'Consolas', monospace;
    font-size: 12px;
    color: #e0e0e0;
    min-width: 22px;
    text-align: center;
    line-height: 1.4;
    box-shadow: 0 1px 2px rgba(0,0,0,0.3), inset 0 1px 0 rgba(255,255,255,0.06);
}

/* ============================================
   Flight/Walk Mode Indicator
   ============================================ */

.mode-indicator {
    position: fixed;
    bottom: 12px;
    left: 12px;
    z-index: 1000;
    padding: 4px 10px;
    background: rgba(22, 22, 26, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 6px;
    color: rgba(255,255,255,0.6);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
    font-size: 11px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    pointer-events: none;
}

/* ============================================
   Onboarding: Coach Hints
   ============================================ */

.coach-hint {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1100;
    max-width: 320px;
    background: rgba(22,22,26,0.88);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px;
    padding: 10px 24px 10px 16px;
    color: white;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
    font-size: 13px;
    line-height: 1.45;
    box-shadow: 0 8px 32px rgba(0,0,0,0.35), 0 0 0 1px rgba(255,255,255,0.04);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    text-align: center;
}

.coach-hint.visible {
    opacity: 1;
    pointer-events: auto;
}

.coach-hint.fading-out {
    opacity: 0;
    transition: opacity 0.4s ease;
}

/* Anchor positions */
.coach-hint.--center {
    bottom: 120px;
}

.coach-hint.--toolbar {
    bottom: 90px;
}

.coach-hint-text {
    color: rgba(255,255,255,0.75);
}

.coach-hint kbd {
    font-size: 11px;
    padding: 2px 6px;
    vertical-align: 1px;
}

.coach-hint-close {
    position: absolute;
    top: 4px;
    right: 6px;
    background: none;
    border: none;
    color: rgba(255,255,255,0.4);
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    padding: 2px 4px;
}
.coach-hint-close:hover {
    color: rgba(255,255,255,0.9);
}

/* ============================================
   Onboarding: Mode Guide
   ============================================ */

#mode-guide {
    display: none;
    position: fixed;
    bottom: 145px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1600;
    max-width: 420px;
    width: 90vw;
    background: rgba(20, 20, 30, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    padding: 16px 20px 14px;
    color: rgba(255,255,255,0.85);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    font-size: 14px;
    line-height: 1.55;
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}

#mode-guide.active {
    display: block;
}

.mode-guide-header {
    margin-bottom: 10px;
    position: relative;
}

.mode-guide-close {
    position: absolute;
    top: -2px;
    right: -6px;
    background: none;
    border: none;
    color: rgba(255,255,255,0.4);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    padding: 2px 4px;
}
.mode-guide-close:hover {
    color: rgba(255,255,255,0.9);
}

.mode-guide-title {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: rgba(255,255,255,0.95);
}

.mode-guide-dots {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid rgba(255,255,255,0.06);
}

.mode-guide-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    transition: background 0.2s;
}

.mode-guide-dot.active {
    background: rgba(255,255,255,0.8);
}

.mode-guide-dot.completed {
    background: rgba(255,255,255,0.45);
}

.mode-guide-body {
    margin-bottom: 12px;
    color: rgba(255,255,255,0.75);
}

.mode-guide-body kbd {
    display: inline-block;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 5px;
    padding: 2px 7px;
    font-family: inherit;
    font-size: 12px;
    line-height: 1.4;
    color: rgba(255,255,255,0.9);
    vertical-align: 1px;
}

.mode-guide-body kbd.arrow {
    min-width: 22px;
    text-align: center;
    font-size: 14px;
    padding: 1px 5px;
}

/* Key table within mode guide slides */
.mode-guide-body .guide-keys {
    margin: 8px 0 2px;
    gap: 5px;
}

.mode-guide-body .guide-keys .tour-key-row {
    font-size: 13px;
    color: rgba(255,255,255,0.7);
}

.mode-guide-body .guide-keys .tour-key-row .keys {
    min-width: 100px;
    justify-content: flex-end;
}

.mode-guide-body .guide-keys .tour-key-row .label {
    text-align: left;
    min-width: unset;
}

.mode-guide-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.mode-guide-back,
.mode-guide-next,
.mode-guide-dismiss {
    font-family: inherit;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.15);
    color: rgba(255,255,255,0.85);
    padding: 5px 14px;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.15s;
}

.mode-guide-back:hover,
.mode-guide-next:hover,
.mode-guide-dismiss:hover {
    background: rgba(255,255,255,0.18);
}

/* ============================================
   Onboarding: Guided Tour
   ============================================ */

#tour-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 5000;
}

#tour-overlay.active {
    display: flex;
    justify-content: center;
    align-items: center;
}

.tour-backdrop {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    transition: opacity 0.3s ease;
}

#tour-overlay.has-spotlight .tour-backdrop {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

/* Spotlight cutout — positioned absolutely, box-shadow creates the darkened surround */
.tour-spotlight {
    position: absolute;
    border-radius: 10px;
    box-shadow: 0 0 0 9999px rgba(0,0,0,0.6);
    transition: top 0.3s ease, left 0.3s ease, width 0.3s ease, height 0.3s ease;
    z-index: 5001;
    pointer-events: none;
}

.tour-spotlight.active {
    /* When spotlight is active, hide the backdrop to avoid double-darkening */
}

.tour-card {
    position: relative;
    z-index: 5002;
    max-width: 480px;
    width: 90vw;
    background: rgba(22,22,26,0.95);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 14px;
    padding: 28px 32px 20px;
    color: white;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
    box-shadow: 0 16px 64px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.04);
    opacity: 1;
    transition: opacity 0.3s ease;
}

.tour-card.fading {
    opacity: 0;
}

.tour-card-step {
    font-size: 11px;
    color: rgba(255,255,255,0.35);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 8px;
}

.tour-card-title {
    margin: 0 0 14px;
    font-size: 20px;
    font-weight: 600;
    color: #fff;
    letter-spacing: -0.2px;
}

.tour-card-body {
    font-size: 14px;
    line-height: 1.55;
    color: rgba(255,255,255,0.72);
    margin-bottom: 20px;
}

.tour-card-body p {
    margin: 0 0 10px;
}

.tour-card-body p:last-child {
    margin-bottom: 0;
}

/* Key diagram grid */
.tour-keys {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 14px 0;
}

.tour-key-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: rgba(255,255,255,0.55);
}

.tour-key-row .label {
    min-width: 80px;
    text-align: right;
    flex-shrink: 0;
}

.tour-key-row .keys {
    display: flex;
    gap: 4px;
    align-items: center;
}

.tour-key-row kbd {
    display: inline-block;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 5px;
    padding: 3px 8px;
    font-family: 'SF Mono', 'Menlo', 'Consolas', monospace;
    font-size: 12px;
    color: #e0e0e0;
    min-width: 22px;
    text-align: center;
    line-height: 1.4;
    box-shadow: 0 1px 2px rgba(0,0,0,0.3), inset 0 1px 0 rgba(255,255,255,0.06);
}

/* WASD cluster */
.tour-wasd {
    display: inline-grid;
    grid-template-columns: repeat(3, 30px);
    grid-template-rows: repeat(2, 28px);
    gap: 3px;
    margin-right: 8px;
}

.tour-wasd kbd {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 5px;
    font-family: 'SF Mono', 'Menlo', 'Consolas', monospace;
    font-size: 12px;
    color: #e0e0e0;
    box-shadow: 0 1px 2px rgba(0,0,0,0.3), inset 0 1px 0 rgba(255,255,255,0.06);
    padding: 0;
    min-width: 0;
    line-height: 1;
}

.tour-wasd .w { grid-column: 2; grid-row: 1; }
.tour-wasd .a { grid-column: 1; grid-row: 2; }
.tour-wasd .s { grid-column: 2; grid-row: 2; }
.tour-wasd .d { grid-column: 3; grid-row: 2; }

/* Card footer */
.tour-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid rgba(255,255,255,0.06);
    padding-top: 14px;
    margin-top: 4px;
}

.tour-dots {
    display: flex;
    gap: 6px;
}

.tour-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: rgba(255,255,255,0.15);
    transition: background 0.2s ease;
}

.tour-dot.active {
    background: rgba(255,255,255,0.7);
}

.tour-dot.completed {
    background: rgba(255,255,255,0.35);
}

.tour-nav {
    display: flex;
    gap: 6px;
    align-items: center;
}

.tour-skip {
    background: none;
    border: none;
    color: rgba(255,255,255,0.35);
    font-size: 12px;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 6px;
    transition: color 0.15s ease, background 0.15s ease;
    font-family: inherit;
}

.tour-skip:hover {
    color: rgba(255,255,255,0.6);
    background: rgba(255,255,255,0.05);
}

.tour-back,
.tour-next {
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.8);
    font-size: 13px;
    cursor: pointer;
    padding: 6px 14px;
    border-radius: 8px;
    transition: background 0.15s ease, color 0.15s ease;
    font-family: inherit;
}

.tour-back:hover,
.tour-next:hover {
    background: rgba(255,255,255,0.14);
    color: #fff;
}

.tour-next {
    background: rgba(255,255,255,0.12);
    color: #fff;
}

.tour-back:disabled {
    opacity: 0.3;
    cursor: default;
    pointer-events: none;
}

/* Tour card positioning when spotlight is active */
#tour-overlay.has-spotlight .tour-card {
    position: absolute;
}

/* Responsive */
@media (max-width: 520px) {
    .tour-card {
        padding: 20px 18px 16px;
        border-radius: 10px;
    }
    .tour-card-title {
        font-size: 17px;
    }
    .tour-card-body {
        font-size: 13px;
    }
    .tour-key-row .label {
        min-width: 60px;
        font-size: 11px;
    }
}

/* ============================================
   Onboarding: Manual Modal
   ============================================ */

#manual-popup {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 4000;
}

#manual-popup.active {
    display: flex;
    justify-content: center;
    align-items: center;
}

.manual-backdrop {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.manual-container {
    position: relative;
    display: flex;
    width: 800px;
    max-width: 95vw;
    height: 600px;
    max-height: 85vh;
    background: rgba(22,22,26,0.95);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 16px;
    box-shadow: 0 24px 80px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.04);
    overflow: hidden;
    z-index: 1;
}

.manual-close {
    position: absolute;
    top: 14px; right: 16px;
    background: none; border: none;
    color: rgba(255,255,255,0.3); font-size: 20px;
    cursor: pointer;
    z-index: 2;
    line-height: 1;
    padding: 2px;
    transition: color 0.15s;
}
.manual-close:hover { color: rgba(255,255,255,0.6); }

.manual-sidebar {
    width: 220px;
    min-width: 220px;
    border-right: 1px solid rgba(255,255,255,0.06);
    display: flex;
    flex-direction: column;
    padding: 16px 0;
    overflow-y: auto;
}

.manual-progress {
    padding: 0 16px 12px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    margin-bottom: 8px;
}

.manual-progress-bar {
    height: 4px;
    background: rgba(255,255,255,0.06);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 6px;
}

.manual-progress-fill {
    height: 100%;
    background: #4CAF50;
    border-radius: 2px;
    width: 0%;
    transition: width 0.3s ease;
}

.manual-progress-text {
    font-size: 11px;
    color: rgba(255,255,255,0.35);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
}

.manual-search {
    margin: 4px 12px 8px;
    padding: 7px 10px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 8px;
    color: white;
    font-size: 12px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.15s;
}
.manual-search::placeholder { color: rgba(255,255,255,0.25); }
.manual-search:focus { border-color: rgba(255,255,255,0.2); }

.manual-sidebar-topics {
    flex: 1;
    overflow-y: auto;
    padding: 0 8px;
}

.manual-category {
    margin-bottom: 6px;
}

.manual-category-title {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255,255,255,0.3);
    padding: 8px 8px 4px;
    font-family: inherit;
}

.manual-topic {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 8px;
    border-radius: 6px;
    cursor: pointer;
    font-family: inherit;
    font-size: 13px;
    color: rgba(255,255,255,0.55);
    transition: all 0.1s;
}
.manual-topic:hover {
    background: rgba(255,255,255,0.05);
    color: rgba(255,255,255,0.7);
}
.manual-topic.active {
    background: rgba(255,255,255,0.08);
    color: #fff;
}

.manual-topic-check {
    width: 14px;
    font-size: 12px;
    color: #4CAF50;
    flex-shrink: 0;
}

.manual-topic-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.manual-reset {
    margin: 8px 12px;
    padding: 7px;
    background: none;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 8px;
    color: rgba(255,255,255,0.35);
    font-size: 11px;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.15s;
}
.manual-reset:hover {
    background: rgba(255,255,255,0.04);
    color: rgba(255,255,255,0.55);
}

.manual-content-panel {
    flex: 1;
    padding: 30px 35px;
    overflow-y: auto;
    color: white;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
}

.manual-topic-title {
    margin: 0 0 16px;
    font-size: 20px;
    font-weight: 600;
}

.manual-topic-desc {
    font-size: 14px;
    line-height: 1.6;
    color: rgba(255,255,255,0.55);
    margin-bottom: 24px;
}

.manual-controls-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.manual-controls-table th {
    text-align: left;
    padding: 8px 12px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.35);
    font-weight: 500;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.manual-controls-table td {
    padding: 10px 12px;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    color: rgba(255,255,255,0.55);
}

.manual-controls-table tr:last-child td {
    border-bottom: none;
}

.manual-controls-table kbd {
    margin-right: 3px;
}
