.sharpsplat-tab-root {
    display: flex;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.sharpsplat-sidebar {
    width: 240px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    border-right: 1px solid #444;
    background: #1a1a1a;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Accordion */
.sharpsplat-accordion {
    flex-shrink: 0;
    border-bottom: 1px solid #444;
}

.sharpsplat-accordion-flex {
    flex-shrink: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.sharpsplat-accordion-header {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 7px 10px;
    background: none;
    border: none;
    color: #aaa;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    text-align: left;
    gap: 6px;
    user-select: none;
}

.sharpsplat-accordion-header:hover {
    color: #ddd;
    background: #222;
}

.sharpsplat-accordion-arrow {
    font-size: 9px;
    display: inline-block;
    transition: transform 0.15s;
    flex-shrink: 0;
}

.sharpsplat-accordion.open > .sharpsplat-accordion-header .sharpsplat-accordion-arrow {
    transform: rotate(90deg);
}

.sharpsplat-accordion-body {
    display: none;
    overflow: hidden;
}

.sharpsplat-accordion-body-flex {
    flex: 1;
    min-height: 0;
    flex-direction: column;
}

.sharpsplat-accordion-body-flex .sharpsplat-file-list {
    flex: 1;
    min-height: 0;
}

.sharpsplat-accordion.open > .sharpsplat-accordion-body {
    display: block;
}

.sharpsplat-accordion-flex.open > .sharpsplat-accordion-body {
    display: flex;
}

.sharpsplat-acc-action-btn {
    margin-left: auto;
    background: none;
    border: none;
    color: #666;
    font-size: 14px;
    cursor: pointer;
    padding: 0 2px;
    line-height: 1;
    flex-shrink: 0;
}

.sharpsplat-acc-action-btn:hover {
    color: #ccc;
}

/* Camera section (legacy class kept for camera-controls/group/row/label/input/btns) */
.sharpsplat-camera-section {
    flex-shrink: 0;
    border-bottom: 1px solid #444;
}

.sharpsplat-sidebar-header {
    display: flex;
    align-items: center;
    padding: 8px 10px;
    border-bottom: 1px solid #444;
    flex-shrink: 0;
}


.sharpsplat-camera-controls {
    display: flex;
    flex-direction: column;
    padding: 10px;
    gap: 14px;
}

.sharpsplat-camera-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.sharpsplat-camera-group-label {
    color: #aaa;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 2px;
}

.sharpsplat-camera-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sharpsplat-camera-label {
    color: #888;
    font-size: 12px;
    width: 14px;
    flex-shrink: 0;
}

.sharpsplat-camera-input {
    flex: 1;
    background: #2a2a2a;
    border: 1px solid #555;
    color: #ccc;
    font-size: 12px;
    padding: 4px 6px;
    border-radius: 3px;
    min-width: 0;
}

.sharpsplat-camera-input:focus {
    outline: none;
    border-color: #7bb3f0;
}

.sharpsplat-camera-btns {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.sharpsplat-camera-btns .basic-button {
    width: 100%;
    font-size: 12px;
    padding: 5px 8px;
}

.sharpsplat-file-list {
    overflow-y: auto;
    padding: 4px 0;
}

.sharpsplat-hint {
    color: #888;
    font-size: 12px;
    padding: 8px 10px;
    display: block;
}

.sharpsplat-file-entry {
    flex: 1;
    min-width: 0;
    padding: 7px 6px 7px 10px;
    background: none;
    border: none;
    color: #ccc;
    font-size: 12px;
    text-align: left;
    cursor: pointer;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sharpsplat-file-entry:hover {
    background: none;
    color: #fff;
}

.sharpsplat-file-row {
    display: flex;
    align-items: center;
    width: 100%;
}

.sharpsplat-file-row:hover {
    background: #2a2a2a;
}

.sharpsplat-file-row.active {
    background: #1e3a5f;
}

.sharpsplat-file-row.active .sharpsplat-file-entry {
    color: #7bb3f0;
}

.sharpsplat-icon-btn {
    flex-shrink: 0;
    padding: 4px 6px;
    background: none;
    border: none;
    color: #888;
    font-size: 14px;
    cursor: pointer;
    line-height: 1;
    text-decoration: none;
    display: flex;
    align-items: center;
}

.sharpsplat-icon-btn:hover {
    color: #fff;
}

.sharpsplat-delete-btn:hover {
    color: #e06060;
}

.sharpsplat-viewer-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #111;
    position: relative;
}

.sharpsplat-viewer-status {
    padding: 6px 12px;
    font-size: 13px;
    color: #aaa;
    background: #1a1a1a;
    border-bottom: 1px solid #444;
    flex-shrink: 0;
}

.sharpsplat-canvas-wrap {
    flex: 1;
    overflow: hidden;
    position: relative;
    width: 100%;
    height: 100%;
}

.sharpsplat-canvas-wrap canvas {
    display: block;
    width: 100%;
    height: 100%;
}

/* Settings panel */
.sharpsplat-settings-panel {
    flex-shrink: 0;
    padding: 10px;
    background: #1a1a1a;
}


.sharpsplat-settings-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-height: 28px;
    padding: 4px 10px;
}

.sharpsplat-settings-label {
    color: #bbb;
    font-size: 12px;
    flex: 1;
    min-width: 0;
}

/* Toggle switch */
.sharpsplat-toggle {
    position: relative;
    display: inline-block;
    width: 34px;
    height: 18px;
    flex-shrink: 0;
    cursor: pointer;
}

.sharpsplat-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.sharpsplat-toggle-slider {
    position: absolute;
    inset: 0;
    background: #444;
    border-radius: 18px;
    transition: background 0.2s;
}

.sharpsplat-toggle-slider::before {
    content: '';
    position: absolute;
    width: 12px;
    height: 12px;
    left: 3px;
    top: 3px;
    background: #aaa;
    border-radius: 50%;
    transition: transform 0.2s, background 0.2s;
}

.sharpsplat-toggle input:checked + .sharpsplat-toggle-slider {
    background: #2a6db5;
}

.sharpsplat-toggle input:checked + .sharpsplat-toggle-slider::before {
    transform: translateX(16px);
    background: #fff;
}

/* Output format select */
.sharpsplat-settings-select {
    background: #2a2a2a;
    border: 1px solid #555;
    color: #ccc;
    font-size: 12px;
    padding: 3px 6px;
    border-radius: 3px;
    flex-shrink: 0;
    cursor: pointer;
}

.sharpsplat-settings-select:focus {
    outline: none;
    border-color: #7bb3f0;
}

/* Input image section */
.sharpsplat-input-wrap {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 10px;
}

.sharpsplat-dropzone {
    border: 1px dashed #555;
    border-radius: 4px;
    background: #202020;
    padding: 12px 8px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}

.sharpsplat-dropzone:hover {
    border-color: #7bb3f0;
    background: #252d36;
}

.sharpsplat-dropzone.drag-active {
    border-color: #7bb3f0;
    background: #1f344a;
}

.sharpsplat-dropzone-main {
    color: #c7d7ea;
    font-size: 12px;
}

.sharpsplat-dropzone-sub {
    color: #8f9aab;
    font-size: 11px;
    margin-top: 4px;
}

.sharpsplat-input-controls {
    display: flex;
    gap: 6px;
}

.sharpsplat-input-controls .basic-button {
    flex: 1;
    font-size: 12px;
    padding: 5px 8px;
}

.sharpsplat-input-preview {
    display: none;
    border: 1px solid #555;
    border-radius: 4px;
    background: #171717;
    padding: 4px;
}

.sharpsplat-input-preview.active {
    display: block;
}

.sharpsplat-input-preview-image {
    display: block;
    width: 100%;
    max-height: 140px;
    object-fit: contain;
    border-radius: 3px;
}

.sharpsplat-input-name {
    color: #aaa;
    font-size: 11px;
    line-height: 1.2;
    word-break: break-all;
}

/* Multi-image thumbnail strip (VGGT mode) */
.sharpsplat-multi-preview-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    padding: 2px 0;
}

.sharpsplat-multi-thumb {
    position: relative;
    width: 52px;
    height: 52px;
    flex-shrink: 0;
    border-radius: 3px;
    overflow: hidden;
    border: 1px solid #555;
    background: #171717;
}

.sharpsplat-multi-thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sharpsplat-multi-thumb-remove {
    position: absolute;
    top: 1px;
    right: 1px;
    width: 16px;
    height: 16px;
    background: rgba(0, 0, 0, 0.65);
    border: none;
    border-radius: 50%;
    color: #ccc;
    font-size: 11px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.sharpsplat-multi-thumb-remove:hover {
    background: rgba(180, 60, 60, 0.85);
    color: #fff;
}

#sharpsplat_generate_btn {
    width: 100%;
    font-size: 12px;
    padding: 6px 8px;
}

#sharpsplat_generate_btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Sidebar footer (no longer used, kept for safety) */
.sharpsplat-sidebar-footer {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    padding: 4px 6px;
    border-top: 1px solid #444;
}

.sharpsplat-gear-btn {
    background: none;
    border: none;
    color: #666;
    font-size: 16px;
    cursor: pointer;
    padding: 4px 6px;
    line-height: 1;
    border-radius: 3px;
    transition: color 0.15s;
}

.sharpsplat-gear-btn:hover,
.sharpsplat-gear-btn.active {
    color: #bbb;
}

/* Export Canvas sidebar section */
.sharpsplat-export-wrap {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 10px;
}

.sharpsplat-export-custom {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 0 0 0 4px;
}

#sharpsplat_export_btn {
    width: 100%;
    font-size: 12px;
    padding: 6px 8px;
}

/* Export canvas crop indicator — covers only the canvas area */
.sharpsplat-export-overlay {
    position: absolute;
    inset: 0;
    z-index: 200;
    display: flex;
    flex-direction: column;
    pointer-events: none;
}

.sharpsplat-export-viewport {
    flex: 1;
    width: 100%;
    position: relative;
    overflow: hidden;
    clip-path: inset(0);
}

/* The viewport box — transparent window showing the capture region.
   box-shadow with a huge spread darkens everything outside the box. */
.sharpsplat-export-viewport-box {
    position: absolute;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.55);
    border: 2px solid rgba(120, 180, 255, 0.9);
    outline: 1px solid rgba(0, 0, 0, 0.4);
    box-sizing: border-box;
    pointer-events: none;
}

/* Corner resize handles — purely decorative */
.sharpsplat-export-viewport-box::before,
.sharpsplat-export-viewport-box::after {
    content: '';
    position: absolute;
    width: 14px;
    height: 14px;
    border-color: rgba(120, 180, 255, 1);
    border-style: solid;
}

.sharpsplat-export-viewport-box::before {
    top: -2px;
    left: -2px;
    border-width: 3px 0 0 3px;
}

.sharpsplat-export-viewport-box::after {
    bottom: -2px;
    right: -2px;
    border-width: 0 3px 3px 0;
}

#sharpsplat_export_actions {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

#sharpsplat_export_actions .basic-button {
    width: 100%;
    font-size: 12px;
    padding: 6px 8px;
}

.sharpsplat-export-cancel-btn {
    background: #3a1f1f !important;
    border-color: #774 !important;
}

.sharpsplat-export-cancel-btn:hover {
    background: #5a2f2f !important;
}

/* Repair Prompt button */
.sharpsplat-repair-prompt-btn {
    margin-top: 6px;
    width: 100%;
}

/* Toast notifications */
.sharpsplat-toast-container {
    position: absolute;
    top: 16px;
    right: 16px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    pointer-events: none;
    z-index: 200;
}

.sharpsplat-toast {
    background: #2a2a2a;
    color: #ddd;
    border: 1px solid #555;
    border-radius: 6px;
    padding: 8px 16px;
    font-size: 13px;
    opacity: 0;
    transition: opacity 0.2s ease;
    white-space: nowrap;
}

.sharpsplat-toast.visible {
    opacity: 1;
}
