/* Platform View Generator — classes prefixed vg- to avoid CSS/JS conflicts. */

/** Design tokens shared across the tab bar, device toggle, file panel, and editor toolbar -- scoped to #vg-root (not :root) so they never leak into the host page's own styling. */
#vg-root {
    --vg-gray-50: #f9fafb;
    --vg-gray-100: #f3f4f6;
    --vg-gray-200: #e5e7eb;
    --vg-gray-300: #d1d5db;
    --vg-gray-500: #6b7280;
    --vg-gray-700: #374151;
    --vg-gray-900: #111827;

    --vg-accent: #2563eb;
    --vg-accent-tint: #eff6ff;
    --vg-accent-text: #1d4ed8;

    --vg-css-color: #2563eb;
    --vg-css-color-tint: #eff6ff;
    --vg-js-color: #d97706;
    --vg-js-color-tint: #fffbeb;

    --vg-card-radius: 10px;
    --vg-pill-radius: 999px;
    --vg-control-radius: 7px;
    --vg-border: 1px solid var(--vg-gray-200);
}

/* ── Outer container (applied by PropertyFormBuilder) ─────────── */
/* !important overrides the platform wrapper's own layout rules. */
.platform-view-generator-container {
    display: block !important;
    width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    box-shadow: none !important;
}

/* The .pvg wrapper fills whatever height the platform gives the workarea */
#vg-root {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: calc(100vh - 85px);
    min-height: 500px;
    overflow: hidden;
    background: #f3f3f3;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    font-size: 13px;
    color: #333;
    box-sizing: border-box;
    border: 1px solid #ddd;
    border-radius: 4px;
}

/* ── Layout ───────────────────────────────────────────────────── */
#vg-maincontainer {
    display: flex;
    flex-direction: row;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

/* ── Sidebar ──────────────────────────────────────────────────── */
/* Fluid width: scales with container, clamped 240-350px. */
#vg-rightcontainer {
    width: clamp(240px, 22%, 350px);
    min-width: 240px;
    max-width: 350px;
    flex: 0 1 auto;
    background: #f8f8f8;
    border-right: 1px solid #e0e0e0;
    display: flex;
    flex-direction: column;
    overflow: auto;
}

#vg-sidebar-header {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 10px 14px;
    background: #fff;
    border-bottom: 1px solid #e0e0e0;
    flex-shrink: 0;
}

.vg-header-icon {
    font-size: 16px;
}

/* ── Dynamic webapp / view name block ── */
#vg-sidebar-title {
    display: flex;
    flex-direction: column;
    gap: 3px;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    margin-top: 8px;
}

.vg-sidebar-webapp-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.vg-sidebar-webapp-name {
    font-size: 12px;
    font-weight: 700;
    color: #1a1a1a;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#vg-sidebar-view-row {
    display: flex;
    align-items: center;
    gap: 5px;
}

#vg-sidebar-view-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    object-fit: contain;
}

.vg-sidebar-view-name {
    font-size: 15px;
    font-weight: 900;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* !important kept: overrides platform heading/title resets that bleed
   into sidebar content via tag-level or generic class rules. */
.view-generator-sidebar-title {
    font-size: 12px !important;
    font-weight: 700 !important;
    color: #333 !important;
    margin: 0 !important;
    padding: 0 !important;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    line-height: 1 !important;
    border: none !important;
    background: none !important;
    flex: 1;
}

.vg-publish-btn {
    margin-left: auto;
    width: 45px;
    height: 20px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 2px solid transparent;
    border-radius: 4px;
    cursor: pointer;
    margin: 2px;
    transition: border-color 0.15s, background 0.15s;
    flex-shrink: 0;
}

.vg-publish-btn:disabled,
.vg-publish-btn--loading {
    opacity: 0.45;
    cursor: not-allowed;
}

.vg-publish-icon {
    background-image: url(/o/static-resources/views/_dist/designer/web/images/webpagestoolbar.png);
    background-repeat: no-repeat;
    width: 40px;
    height: 38px;
}

/* sprite position — mirrors .SaveAndPublishImg */
.vg-publish-icon.SaveAndPublishImg {
    background-position: -201px -226px;
}

#vg-device-toggle {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: var(--vg-gray-100);
    border-radius: var(--vg-pill-radius);
    padding: 3px;
    margin: 2px 6px;
    flex-shrink: 0;
}

.vg-device-btn {
    width: 28px;
    height: 26px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: var(--vg-pill-radius);
    cursor: pointer;
    color: var(--vg-gray-500);
    transition: background 0.15s, color 0.15s, box-shadow 0.15s;
    flex-shrink: 0;
}

.vg-device-btn:hover {
    background: rgba(0, 0, 0, 0.06);
}

.vg-device-btn--active {
    background: #ffffff;
    color: var(--vg-gray-900);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

.vg-device-icon {
    background-image: url(/o/static-resources/views/_dist/designer/web/images/webpagestoolbar.png);
    background-repeat: no-repeat;
    width: 20px;
    height: 20px;
    display: inline-block;
}

/* sprite positions — mirror .toolbarDesktop/.toolbarTablet/.toolbarPhone in view-builder.scss */

.vg-device-icon-desktop {
    background-position: -206px -164px;
}

.vg-device-icon-tablet {
    background-position: -245px -165px;
}

.vg-device-icon-mobile {
    background-position: -166px -125px;
}

/* ── Folder ───────────────────────────────────────────────────── */
.vg-folder {
    background: #fff;
    border: var(--vg-border);
    border-radius: var(--vg-card-radius);
    margin: 0 10px 8px;
    overflow: hidden;
    flex-shrink: 0;
}

.vg-folder-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 14px;
    background: #fff;
    cursor: pointer;
    user-select: none;
    transition: background 0.15s;
}

.vg-folder-header:hover {
    background: var(--vg-gray-50);
}

/* sprite-based chevron (reuses the existing down-caret glyph, no new asset) --
   points right when collapsed via rotate(-90deg), down when expanded at 0deg */
.vg-chevron {
    background-image: url(/o/static-resources/views/_dist/designer/web/images/webpagestoolbar.png);
    background-repeat: no-repeat;
    background-position: -48px -90px;
    width: 14px;
    height: 10px;
    transition: transform 0.15s ease;
    display: inline-flex;
    transform: rotate(-90deg);
}

.vg-folder.vg-expanded>.vg-folder-header {
    background: var(--vg-gray-50);
}

.vg-folder.vg-expanded>.vg-folder-header .vg-chevron {
    transform: rotate(0deg);
}

.vg-folder-icon {
    background-image: url(/o/static-resources/views/_dist/designer/web/images/webpagestoolbar.png);
    background-repeat: no-repeat;
    background-position: -54px -270px;
    width: 20px;
    height: 20px;
    display: inline-block;
}

/* scaled down 0.7x (sprite 310x300 -> 217x210) to match the compact button size */
.vg-icon-plus {
    background-image: url(/o/static-resources/views/_dist/designer/web/images/webpagestoolbar.png);
    background-repeat: no-repeat;
    background-size: 217px 210px;
    background-position: -7px -189px;
    width: 14px;
    height: 14px;
    display: inline-block;
}

.vg-folder-label {
    flex: 1;
    font-size: 13px;
    font-weight: 600;
    color: var(--vg-gray-900);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.vg-folder-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
}

/* !important overrides platform's generic button/link styles. */
.vg-action-btn {
    display: inline-flex !important;
    align-items: center !important;
    gap: 4px !important;
    padding: 5px 10px !important;
    font-size: 12px !important;
    background: #fff !important;
    border: var(--vg-border) !important;
    border-radius: var(--vg-control-radius) !important;
    cursor: pointer !important;
    color: var(--vg-gray-700) !important;
    line-height: 1.4 !important;
    transition: all 0.15s;
    box-shadow: none !important;
    outline: none !important;
}

.vg-action-btn:hover {
    background: var(--vg-gray-50) !important;
    border-color: var(--vg-gray-300) !important;
}

/* Primary "+ New" action -- accent-filled, per file-panel spec */
.vg-action-btn--primary {
    background: var(--vg-accent) !important;
    border-color: var(--vg-accent) !important;
    color: #fff !important;
}

.vg-action-btn--primary:hover {
    background: var(--vg-accent-text) !important;
    border-color: var(--vg-accent-text) !important;
}

/* Icon-only secondary action (Upload) -- square, no label */
.vg-action-btn--icon-only {
    padding: 5px 7px !important;
}

/* sprite-based upload icon (webpagestoolbar.png), replaces ti-upload */
/* scaled down 0.7x (sprite 310x300 -> 217x210) to match the compact button size */
.vg-icon-upload {
    background-image: url(/o/static-resources/views/_dist/designer/web/images/webpagestoolbar.png);
    background-repeat: no-repeat;
    background-size: 217px 210px;
    background-position: -172px -3px;
    width: 14px;
    height: 15px;
    display: inline-block;
}

/* ── Folder content ───────────────────────────────────────────── */
.vg-folder-content {
    display: none;
    background: #fff;
    overflow-y: auto;
    max-height: 200px;
    border-top: var(--vg-border);
}

.vg-folder.vg-expanded>.vg-folder-content {
    display: block;
}

.vg-file-list {
    padding: 6px;
}

.vg-file-list-empty {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 8px;
    color: var(--vg-gray-500);
    font-size: 12px;
}

.vg-file-list-empty-icon {
    font-size: 15px;
}

.vg-file-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 8px;
    border-radius: var(--vg-control-radius);
    cursor: pointer;
    font-size: 12px;
    color: var(--vg-gray-700);
    border-left: 2px solid transparent;
    transition: background 0.12s, border-color 0.12s;
}

.vg-file-item:hover {
    background: var(--vg-gray-50);
}

/* Selected/associated file: lighter tint + colored left accent, matching file type.
   Unselected rows keep the same 2px transparent left border above so nothing shifts. */
.vg-file-item--css.vg-active {
    background: var(--vg-css-color-tint);
    color: var(--vg-css-color);
    font-weight: 600;
    border-left-color: var(--vg-css-color);
    margin-bottom: 5px;
}

.vg-file-item--js.vg-active {
    background: var(--vg-js-color-tint);
    color: var(--vg-js-color);
    font-weight: 600;
    border-left-color: var(--vg-js-color);
}

/* sprite-based CSS/JS file-type badges (webpagestoolbar.png), replace ti-brand-css3/ti-brand-javascript.
   Kept at native sprite resolution (unlike the other icons) -- the baked-in "CSS"/"JS"
   text is already at the pixel-legibility floor, so downscaling turns it to mush. */
.vg-file-type-icon {
    background-image: url(/o/static-resources/views/_dist/designer/web/images/webpagestoolbar.png);
    background-repeat: no-repeat;
    display: inline-block;
    flex-shrink: 0;
}

.vg-file-type-icon--css {
    background-position: -86px -5px;
    width: 18px;
    height: 22px;
}

.vg-file-type-icon--js {
    background-position: -128px -5px;
    width: 18px;
    height: 22px;
}

/* sprite-based Save toolbar icon (webpagestoolbar.png), replacing ti-device-floppy -- same sprite/convention as the CSS/JS file-type badges above. */
.vg-editor-toolbar-icon {
    background-image: url(/o/static-resources/views/_dist/designer/web/images/webpagestoolbar.png);
    background-repeat: no-repeat;
    display: inline-block;
    flex-shrink: 0;
}

.vg-editor-toolbar-icon--save {
    background-position: -125px -203px;
    width: 20px;
    height: 20px;
    transform: scale(0.75);
}

/* sprite-based Preview/HTML Editor tab icons (webpagestoolbar.png), replacing ti-eye/ti-code -- same sprite/convention as the icons above. */
.vg-tab-icon {
    background-image: url(/o/static-resources/views/_dist/designer/web/images/webpagestoolbar.png);
    background-repeat: no-repeat;
    display: inline-block;
    flex-shrink: 0;
    transform: scale(0.7);
}

.vg-tab-icon--preview {
    background-position: -86px -203px;
    width: 21px;
    height: 21px;
}

.vg-tab-icon--code {
    background-position: -168px -203px;
    width: 16px;
    height: 20px;
}

.vg-file-name {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

/* the filename's own text box, separate from the icon -- ellipsis needs a single inline-text
   box to truncate into, not a flex container mixing an icon element and a loose text node */
.vg-file-name-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

/* Drag handle + delete are hover-reveal only, to keep the row uncluttered at rest.
   Delete icon is the sprite's trash-can glyph (webpagestoolbar.png), not a font icon.
   Scaled down 0.7x (sprite 310x300 -> 217x210) to match the compact row size. */
.vg-delete-btn {
    background-image: url(/o/static-resources/views/_dist/designer/web/images/webpagestoolbar.png);
    background-repeat: no-repeat;
    background-size: 217px 210px;
    background-position: -201px -32px;
    width: 11px;
    height: 14px;
    padding: 3px;
    cursor: pointer;
    border-radius: 3px;
    opacity: 0;
    transition: all 0.15s;
    flex-shrink: 0;
    display: inline-block;
}

.vg-file-item:hover .vg-delete-btn {
    opacity: 1;
}

.vg-file-drag-handle {
    cursor: grab;
    color: var(--vg-gray-300);
    font-size: 14px;
    padding: 0 2px 0 0;
    line-height: 1;
    opacity: 0;
    transition: opacity 0.15s;
    flex-shrink: 0;
}

.vg-file-item:hover .vg-file-drag-handle {
    opacity: 1;
}

.vg-file-item.vg-file-dragging {
    opacity: 0.4;
}

.vg-file-item.vg-file-dragover {
    border-top: 2px solid #0078d4;
}

/* ── Main area ────────────────────────────────────────────────── */
#vg-centercontainer {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    background: #fff;
    overflow: hidden;
}

/* ── Tab bar ──────────────────────────────────────────────────────
   Two rows sharing one bar: the Preview/HTML Editor pill toggle (fixed,
   never scrolls) and the file-tab row (#tab-navigation, scrolls independently
   when many files are open). */
#vg-tab-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    background: var(--vg-gray-50);
    border-bottom: var(--vg-border);
    flex-shrink: 0;
    min-width: 0;
}

#vg-tab-divider {
    width: 1px;
    align-self: stretch;
    background: var(--vg-gray-200);
    flex-shrink: 0;
}

/* Shared base for both the pill toggle and the file-tab row's tabs */
.vg-tab {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 12px;
    white-space: nowrap;
    position: relative;
    user-select: none;
    min-width: fit-content;
    transition: background 0.12s, color 0.12s;
}

/* Hides a tab button without being blocked by display: flex above */
.vg-tab--hidden {
    display: none !important;
}

/* ── Pill toggle: Live Preview / HTML Editor ── */
#vg-tab-pill {
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 3px;
    background: var(--vg-gray-100);
    border-radius: var(--vg-pill-radius);
    flex-shrink: 0;
}

/* Only vg-tab-pill's two direct children (Preview/HTML Editor) get pill styling -- scoped by parent id instead of a dedicated class */
#vg-tab-pill>.vg-tab {
    padding: 6px 12px;
    border-radius: var(--vg-pill-radius);
    color: var(--vg-gray-500);
    background: transparent;
    font-weight: 500;
}

#vg-tab-pill>.vg-tab i {
    font-size: 14px;
}

#vg-tab-pill>.vg-tab:hover {
    color: var(--vg-gray-700);
}

#vg-tab-pill>.vg-tab.vg-active {
    background: #fff;
    color: var(--vg-gray-900);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

/* ── File-tab row ── */
.vg-tab-nav {
    display: flex;
    flex-direction: row;
    gap: 2px;
    overflow-x: auto;
    overflow-y: hidden;
    flex: 1;
    min-width: 0;
}

.vg-tab-nav::-webkit-scrollbar {
    height: 3px;
}

.vg-tab-nav::-webkit-scrollbar-thumb {
    background: var(--vg-gray-300);
}

.vg-file-tab {
    padding: 7px 10px;
    border-radius: var(--vg-control-radius);
    background: transparent;
    color: var(--vg-gray-700);
}

.vg-file-tab:hover {
    background: var(--vg-gray-100);
}

/* sprite-based CSS/JS file-type badges (webpagestoolbar.png), replace ti-brand-css3/ti-brand-javascript.
   Kept at native sprite resolution (unlike the other icons) -- the baked-in "CSS"/"JS"
   text is already at the pixel-legibility floor, so downscaling turns it to mush. */
.vg-file-tab-icon {
    background-image: url(/o/static-resources/views/_dist/designer/web/images/webpagestoolbar.png);
    background-repeat: no-repeat;
    display: inline-block;
    flex-shrink: 0;
}

.vg-file-tab-icon--css {
    background-position: -86px -5px;
    width: 18px;
    height: 21px;
}

.vg-file-tab-icon--js {
    background-position: -128px -5px;
    width: 15px;
    height: 19px;
}

/* Active tint matches the file's type accent -- blue for CSS, amber for JS */
.vg-file-tab--css.vg-active {
    background: var(--vg-css-color-tint);
    color: var(--vg-css-color);
    font-weight: 600;
}

.vg-file-tab--js.vg-active {
    background: var(--vg-js-color-tint);
    color: var(--vg-js-color);
    font-weight: 600;
}

.vg-tab-close {
    font-size: 13px;
    line-height: 1;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 3px;
    color: var(--vg-gray-500);
    cursor: pointer;
    opacity: 0;
    transition: all 0.12s;
    flex-shrink: 0;
}

.vg-tab-dirty {
    position: absolute;
    top: 3px;
    right: 3px;
    font-size: 14px;
    font-weight: 900;
    color: #e81123;
    line-height: 1;
    pointer-events: none;
    user-select: none;
}

.vg-tab:hover .vg-tab-close {
    opacity: 1;
}

.vg-tab-close:hover {
    background: #e81123;
    color: #fff;
}

/* ── Tab content panes ────────────────────────────────────────── */
#vg-tab-content {
    flex: 1;
    min-height: 0;
    position: relative;
    overflow: hidden;
}

.vg-tab-pane {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    flex-direction: column;
}

.vg-tab-pane.vg-active {
    display: flex;
}

/* ── Code editor ──────────────────────────────────────────────── */
/* !important overrides platform's generic textarea resets. */
.vg-code-editor {
    flex: 1 !important;
    width: 100% !important;
    height: 100% !important;
    resize: none !important;
    border: none !important;
    outline: none !important;
    padding: 14px !important;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace !important;
    font-size: 13px !important;
    line-height: 1.6 !important;
    color: #1e1e1e !important;
    background: #fff !important;
    box-sizing: border-box !important;
}

.vg-code-editor::placeholder {
    color: #aaa;
}

/* ── CodeMirror full-height overrides ─────────────────────────── */
/* Force CodeMirror's own wrapper to fill the tab-content pane. */
.vg-tab-pane .CodeMirror {
    flex: 1 !important;
    width: 100% !important;
    height: 100% !important;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace !important;
    font-size: 13px !important;
    line-height: 1.6 !important;
    border: none !important;
    box-sizing: border-box !important;
}

.vg-tab-pane .CodeMirror-scroll {
    height: 100% !important;
    min-height: 0 !important;
    box-sizing: border-box !important;
}

/* Slightly darker gutter than the code area, to visually separate line numbers */
.vg-tab-pane .CodeMirror-gutters {
    background: var(--vg-gray-50) !important;
    border-right: var(--vg-border) !important;
}

/* ── Editor toolbar (Format / Save / Find + Saved indicator) ──── */
.vg-editor-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 10px;
    background: var(--vg-gray-50);
    border-bottom: var(--vg-border);
    flex-shrink: 0;
}

.vg-editor-toolbar-actions {
    display: flex;
    align-items: center;
    gap: 2px;
}

.vg-editor-toolbar-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: var(--vg-control-radius);
    color: var(--vg-gray-500);
    font-size: 14px;
    cursor: pointer;
    transition: background 0.12s, color 0.12s;
}

.vg-editor-toolbar-btn:hover {
    background: var(--vg-gray-200);
    color: var(--vg-gray-900);
}

.vg-editor-save-indicator {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    color: var(--vg-gray-500);
}

.vg-editor-save-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #16a34a;
    flex-shrink: 0;
}

.vg-editor-save-indicator--dirty .vg-editor-save-dot {
    background: var(--vg-js-color);
}

/* ── Editor status bar (Ln/Col + language) ─────────────────────── */
.vg-editor-statusbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 10px;
    background: var(--vg-gray-50);
    border-top: var(--vg-border);
    font-size: 11px;
    color: var(--vg-gray-500);
    flex-shrink: 0;
}

/* ── Preview frame ────────────────────────────────────────────── */
.vg-preview-frame {
    flex: 1;
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

/* ── Device preview emulation (Tablet / Mobile) ──────────────────── */
.vg-tab-pane.vg-preview-tablet,
.vg-tab-pane.vg-preview-mobile {
    align-items: center;
    background: #e9e9e9;
    padding: 16px 0;
    overflow: auto;
}

.vg-preview-tablet .vg-preview-frame {
    flex: none;
    width: 768px;
    max-width: 100%;
    box-shadow: 0 0 8px rgba(0, 0, 0, 0.15);
    border-radius: 4px;
}

.vg-preview-mobile .vg-preview-frame {
    flex: none;
    width: 375px;
    max-width: 100%;
    box-shadow: 0 0 8px rgba(0, 0, 0, 0.15);
    border-radius: 4px;
}

/* ── Sidebar tab bar: Files | Style | Layers | Settings ─────────── */
/* Style/Layers/Settings panes come from platform-preview-inspector.css (.preview-inspector-pane). */
#vg-panelswitcher {
    display: flex;
    flex: 0 0 auto;
    border-bottom: 1px solid #e0e0e0;
    background: #fff;
}

.vg-sidebar-tab {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: #666;
    padding: 7px 2px;
    cursor: pointer;
}

#vg-sidebar-tab-icon-files,
#vg-sidebar-tab-icon-style,
#vg-sidebar-tab-icon-layers {
    font-size: 14px;
}

#vg-sidebar-tab-label-files,
#vg-sidebar-tab-label-style,
#vg-sidebar-tab-label-layers {
    font-size: 10.5px;
    font-weight: 600;
}

.vg-sidebar-tab:hover:not(.vg-sidebar-tab--disabled) {
    color: #0078d4;
}

.vg-sidebar-tab.vg-active {
    color: #0078d4;
    border-bottom-color: #0078d4;
}

.vg-sidebar-tab--disabled {
    color: #ccc;
    cursor: not-allowed;
}

#vg-panel-container {
    flex: 1;
    min-height: 0;
    min-width: 0; /* flex items default to min-width:auto, which refuses to shrink below content's natural width -- without this, deeply-nested nowrap tree rows in the Layers tab force the whole sidebar wider than its clamped width instead of the rows truncating */
    overflow-y: auto;
}

#vg-filecontainer,
#vg-stylescontainer,
#vg-layerscontainer {
    display: none;
    top: 45px;
    overflow-y: auto;
    height: calc(100% - 50px);
    right: 0px;
    left: 0px;
    overflow-x: hidden;
}

#vg-filecontainer.vg-active,
#vg-stylescontainer.vg-active,
#vg-layerscontainer.vg-active {
    display: block;
}

/* ── Scrollbars ───────────────────────────────────────────────── */
#vg-rightcontainer::-webkit-scrollbar,
.vg-folder-content::-webkit-scrollbar,
.vg-code-editor::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

#vg-rightcontainer::-webkit-scrollbar-thumb,
.vg-folder-content::-webkit-scrollbar-thumb,
.vg-code-editor::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 4px;
}