/* Editor chrome is neutral. These rules never target the canvas or toolbar. */
.app .left-panel.sidebar-materials,
.app .right-panel.sidebar-editor { background: #151515; }
.app .sidebar-materials .left-head { flex: 0 0 auto; height: auto; padding-bottom: 0; }
.app .sidebar-materials .left-options { justify-content: space-between; }
.app .sidebar-materials .style-library { padding: 16px; gap: 12px; }
.app .sidebar-materials .style-library > h2 { display: flex; align-items: center; justify-content: space-between; margin: 0; font-size: 12px; font-weight: 500; }
.app .sidebar-materials .style-list { flex: 0 1 auto; gap: 8px; padding: 0; overflow: visible; background: transparent; }
.app .sidebar-materials .style-library { overflow-y: auto; scrollbar-width: thin; scrollbar-color: #555 transparent; }
.sidebar-section-count { color: #888; font-size: 11px; font-weight: 400; }
.app .sidebar-materials .sidebar-material-row { position: relative; display: flex; align-items: center; gap: 10px; flex: 0 0 auto; min-height: 84px; padding: 9px; border: 1px solid #303030; border-radius: 6px; background: #1b1b1b; cursor: pointer; }
.app .sidebar-materials .sidebar-material-row:hover { border-color: #666; background: #222; }
.app .sidebar-materials .sidebar-material-row.is-selected { border-color: #aaa; background: #262626; }
.app .sidebar-materials .sidebar-material-row:focus-within { outline: 1px solid #ddd; outline-offset: 2px; }
.app .sidebar-materials .sidebar-material-row .title-card { flex: 0 0 96px; width: 96px; height: 64px; min-height: 64px; max-height: 64px; margin: 0; padding: 0; border: 0; border-radius: 2px; outline: 0; box-shadow: none; }
.app .sidebar-materials .title-card > .corner-check { display: none; }
.sidebar-material-copy { display: flex; flex-direction: column; flex: 1; min-width: 0; gap: 5px; }
.sidebar-material-name { color: #e5e5e5; font-size: 12px; white-space: nowrap; }
.sidebar-material-number { color: #888; font-size: 11px; font-variant-numeric: tabular-nums; }
.sidebar-line-icon { display: block; flex: 0 0 14px; width: 14px; height: 14px; }
.sidebar-material-check { display: grid; place-items: center; flex: 0 0 16px; width: 16px; height: 16px; border: 1px solid #444; border-radius: 4px; color: transparent; }
.sidebar-material-check .sidebar-line-icon { width: 12px; height: 12px; }
.is-selected > .sidebar-material-check { background: #eee; border-color: #eee; color: #222; }
.sidebar-material-note { margin: 0; color: #888; font-size: 11px; line-height: 18px; }

.app .right-panel.sidebar-editor { display: flex; flex-direction: column; }
.app .sidebar-editor .right-header { flex: 0 0 auto; height: auto; min-height: 0; padding: 16px; }
.app .sidebar-editor .right-header::after { display: none; }
.app .sidebar-editor .right-header h2 { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 18px; color: #eee; font-size: 14px; }
.sidebar-selection-label { overflow: hidden; color: #999; font-size: 11px; font-weight: 400; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-frame-tools { position: relative; display: flex; align-items: center; min-width: 0; height: 22px; padding-right: 32px; }
.app .sidebar-editor .sidebar-frame-menu-trigger { position: absolute; right: 0; top: 50%; transform: translateY(-50%); display: grid; place-items: center; width: 28px; height: 28px; min-width: 28px; padding: 0; border: 1px solid transparent; border-radius: 8px; background: transparent; color: #aaa; cursor: pointer; }
.sidebar-frame-menu-trigger .sidebar-line-icon { width: 16px; height: 16px; }
.app .sidebar-editor .sidebar-frame-menu-trigger:disabled { opacity: .35; cursor: default; }
.sidebar-frame-menu,
.sidebar-add-menu { position: absolute; z-index: 30; top: calc(100% + 6px); right: 0; width: 168px; }
.app .sidebar-editor .sidebar-frame-menu-item:last-child { margin-top: 4px; border-top: 1px solid #3b3d43; border-radius: 0; }
.sidebar-frame-confirm .sidebar-confirm-delete { border-color: #aaa; background: #e5e5e5; color: #222; }
.sidebar-frame-confirm .sidebar-confirm-delete:hover { background: #fff; }
.app .sidebar-editor .sidebar-layout-fields { display: grid; grid-template-columns: minmax(0, calc(50% - 8px)) minmax(0, 1fr); gap: 24px; margin-top: 16px; }
.app .sidebar-editor .sidebar-field { display: flex; flex-direction: column; align-items: stretch; gap: 8px; min-width: 0; color: #aaa; font-size: 12px; }
.app .sidebar-editor .sidebar-field > .select-button { width: 100%; min-width: 0; }
.app .sidebar-editor .sidebar-field > .mode-pair { display: flex; width: 100%; }
.app .sidebar-editor .sidebar-field > .mode-pair button { flex: 1; }
.sidebar-surface-field { display: flex; align-items: center; justify-content: space-between; gap: 4px; height: 28px; font-size: 11px; }
.app .sidebar-editor .title-icon-editor { margin-top: 16px; padding-top: 0; border-top: 1px solid #303030; }
.sidebar-icon-disclosure > summary { display: flex; align-items: center; gap: 8px; min-height: 39px; padding: 0; list-style: none; color: #aaa; font-size: 12px; cursor: pointer; }
.sidebar-icon-disclosure > summary::-webkit-details-marker { display: none; }
.sidebar-icon-label { flex: 1; }
.sidebar-icon-state { color: #808080; font-size: 11px; font-weight: 400; }
.sidebar-icon-chevron { display: flex; flex: 0 0 14px; }
.sidebar-icon-disclosure[open] .sidebar-icon-chevron { transform: rotate(180deg); }
.sidebar-icon-fields { padding: 0 0 12px; }
.app .sidebar-editor .sidebar-icon-fields .row { flex-wrap: wrap; gap: 8px; }
.app .sidebar-editor .sidebar-icon-fields .row > span:first-child { display: none; }
.app .sidebar-editor .sidebar-icon-fields .title-icon-actions { flex-wrap: wrap; }
.sidebar-list-heading { position: relative; z-index: 31; display: flex; align-items: center; justify-content: space-between; gap: 8px; flex: 0 0 auto; margin: 0 16px; padding: 14px 0 10px; border-top: 1px solid #303030; color: #aaa; font-size: 12px; }
.sidebar-list-label { display: flex; align-items: center; gap: 6px; min-width: 0; white-space: nowrap; }
.app .sidebar-editor .sidebar-add-component { display: grid; place-items: center; flex: 0 0 28px; width: 28px; min-width: 28px; height: 28px; padding: 0; border: 1px solid transparent; border-radius: 8px; background: transparent; color: #aaa; box-shadow: none; cursor: pointer; }
.sidebar-add-component .sidebar-line-icon { width: 16px; height: 16px; }
.app .sidebar-editor .sidebar-add-component:disabled { opacity: .4; cursor: default; }
.sidebar-add-menu { top: calc(100% - 4px); }
/* The native scrollbar lives inside the existing 16px right inset, rather
   than adding a second inset that narrows every component card. */
.app .sidebar-editor .config-list { flex: 1 1 0; height: auto; min-height: 0; padding: 0 max(0px, calc(16px - var(--sidebar-scrollbar-width, 0px))) 16px 16px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: #555 transparent; scrollbar-gutter: stable; }
.app .sidebar-editor .config-list::-webkit-scrollbar { width: 5px; }
.app .sidebar-editor .config-list::-webkit-scrollbar-thumb { border-radius: 8px; background: #555; }
.app .sidebar-editor .config-group { height: auto; min-height: 0; margin: 0 0 8px; padding: 0; border: 1px solid #303030; border-radius: 6px; background: #1b1b1b; overflow: hidden; }
.app .sidebar-editor .config-group::before { display: none; }
.app .sidebar-editor .config-group.sidebar-component-expanded { border-color: #737373; }
.app .sidebar-editor .sidebar-component-expanded > .group-title { background: #262626; }
.app .sidebar-editor .config-group .group-title { display: flex; align-items: center; gap: 4px; height: 48px; margin: 0; padding: 0 8px 0 10px; }
.app .sidebar-editor .content-sort-handle { flex: 0 0 28px; width: 28px; min-width: 28px; height: 28px; }
.app .sidebar-editor .content-sort-handle .vc-button__icon { width: 16px; height: 16px; }
.app .sidebar-editor .sidebar-component-toggle { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; height: 100%; padding: 0; border: 0; background: transparent; color: #ddd; text-align: left; cursor: pointer; }
.sidebar-component-number { display: grid; place-items: center; flex: 0 0 24px; width: 24px; height: 24px; aspect-ratio: 1; border-radius: 5px; background: #303030; color: #ccc; font-size: 11px; font-variant-numeric: tabular-nums; }
.sidebar-component-expanded .sidebar-component-number { background: #444; color: #fff; }
.sidebar-component-type-icon { display: flex; align-items: center; flex: 0 0 14px; color: #aaa; }
.sidebar-component-name { flex: 1; overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-component-count { color: #999; font-size: 11px; white-space: nowrap; }
.app .sidebar-editor .sidebar-component-details { padding: 14px 10px 12px; border-top: 1px solid #303030; }
.app .sidebar-editor .sidebar-component-details[hidden] { display: none; }
.app .sidebar-editor .sidebar-component-details > .data-type-editor { margin-top: 14px; padding-top: 14px; border-top: 1px solid #303030; }
.app .sidebar-editor .sidebar-component-details .row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; height: auto; }
.app .sidebar-editor .sidebar-component-details .content-title-row { display: grid; grid-template-columns: max-content minmax(0, 1fr); align-items: center; column-gap: 12px; height: 24px; min-height: 24px; }
.app .sidebar-editor .sidebar-component-details .content-title-toggle { width: auto; }
.app .sidebar-editor .sidebar-component-details .content-title-row > .pager { display: flex; flex: initial; width: auto; min-width: 0; gap: 3px; margin: 0; }
.app .sidebar-editor .sidebar-component-details .pager > div { flex: 1; width: auto; min-width: 0; overflow: hidden; }
.app .sidebar-editor .sidebar-component-details .pager button { flex: 0 0 24px; }
.app .sidebar-editor .sidebar-component-details .pager.is-disabled { opacity: .35; }
.app .sidebar-editor .sidebar-component-details .data-type-editor > .row:first-child { flex-wrap: nowrap; }
.app .sidebar-editor .sidebar-component-details .data-type-editor > .row:first-child label { min-width: 0; }
.app .sidebar-editor .sidebar-component-details .data-select { min-width: 0; max-width: 100%; }
.sidebar-type-fields,
.sidebar-chart-extra { display: grid; grid-template-columns: minmax(0, 120px) minmax(72px, 1fr); gap: 12px; }
.sidebar-editor-field { display: flex; flex-direction: column; align-items: stretch; gap: 6px; min-width: 0; }
.sidebar-field-label { color: #aaa; font-size: 11px; line-height: 18px; }
.app .sidebar-editor .sidebar-editor-field > .select-button { width: 100%; min-width: 0; }
.sidebar-chart-extra { align-items: center; margin-top: 10px; }
.app .sidebar-editor .sidebar-chart-extra > .series-count-select { width: 100%; min-width: 0; }
/* Keep the original controls and handlers, present one current style instead of
   all legacy carousels/lists. No component artwork rules are changed. */
.app .sidebar-editor .sidebar-component-details :is(.style-strip,.metric-strip,.composite-style-list,.chart-style-list) { display: none; }
.sidebar-current-style { margin-top: 16px; padding-top: 12px; border-top: 1px solid #303030; }
.sidebar-style-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; color: #aaa; font-size: 12px; }
.sidebar-style-status { color: #888; font-size: 11px; }
.app .sidebar-editor .sidebar-browse-styles { display: inline-flex; align-items: center; justify-content: center; gap: 5px; min-height: 28px; padding: 0 8px; border: 1px solid #ffffff26; border-radius: 6px; background: #2d2f33; color: #ebf2fa; font-size: 11px; white-space: nowrap; cursor: pointer; }
.app .sidebar-editor .sidebar-browse-styles .sidebar-line-icon { width: 12px; height: 12px; flex-basis: 12px; }
.app .sidebar-editor .sidebar-current-style-card { display: block; width: 100%; padding: 8px 10px; border: 1px solid #555; border-radius: 6px; background: #0a0b0d; text-align: left; cursor: pointer; }
.app .sidebar-editor .sidebar-current-style-card:disabled { cursor: default; opacity: 1; }
.sidebar-current-art { position: relative; display: flex; align-items: center; justify-content: center; height: 90px; overflow: hidden; }
.sidebar-style-artwork { position: relative; display: flex; align-items: center; justify-content: center; flex: 1; width: 100%; height: 100%; min-width: 0; padding: 8px; overflow: hidden; pointer-events: none; --vc-single-thumbnail-scale: 1; --vc-icon-thumbnail-scale: .75; }
.sidebar-style-artwork > .vc-single-data-thumbnail { --vc-single-thumbnail-scale: 1; }
.sidebar-style-artwork > .screen-title-panel__content-block { flex: 1; width: 100%; height: 100%; min-height: 0; }
.sidebar-style-artwork > .vc-composite-metric-thumbnail { flex: 1; }
.sidebar-current-caption { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 4px; }
.sidebar-current-caption > .sidebar-line-icon { flex: 0 0 13px; width: 13px; height: 13px; color: #eee; }
.sidebar-style-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-top: 9px; }
.sidebar-style-navigation { display: flex; align-items: center; gap: 4px; }
.app .sidebar-editor .sidebar-style-arrow { flex: 0 0 24px; width: 24px; height: 28px; min-width: 24px; padding: 3px; }
.sidebar-style-position { min-width: 32px; color: #999; font-size: 11px; text-align: center; font-variant-numeric: tabular-nums; }
.sidebar-style-caption { margin: 0; color: #aaa; font-size: 11px; line-height: 18px; }
.sidebar-applied-note { display: flex; align-items: center; gap: 5px; margin: 14px 0 0; color: #888; font-size: 11px; }
.sidebar-component-footer { position: relative; display: flex; align-items: center; min-height: 20px; margin-top: 14px; }
.sidebar-component-footer .sidebar-applied-note { margin: 0; padding-right: 32px; }
.app .sidebar-editor .sidebar-component-delete { position: absolute; right: 0; top: 50%; transform: translateY(-50%); display: grid; place-items: center; width: 28px; min-width: 28px; height: 28px; padding: 0; border: 1px solid transparent; border-radius: 4px; background: transparent; color: #999; box-shadow: none; cursor: pointer; }
.app .sidebar-editor :is(.content-sort-handle,.sidebar-component-delete,.sidebar-frame-menu-trigger) { border-radius: 8px; }
.app .sidebar-editor :is(.sidebar-component-delete,.sidebar-frame-menu-trigger,.sidebar-add-component) { color: #888; }
.app .sidebar-editor :is(.content-sort-handle,.sidebar-component-delete,.sidebar-frame-menu-trigger,.sidebar-add-component):hover:not(:disabled),
.app .sidebar-editor :is(.sidebar-frame-menu-trigger,.sidebar-add-component)[aria-expanded="true"] { border-color: rgba(255, 255, 255, .32); background: #202228; color: #eee; }
.sidebar-action-feedback { position: absolute; z-index: 40; bottom: 64px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; justify-content: space-between; gap: 24px; width: max-content; min-width: 240px; max-width: calc(100% - 32px); min-height: 44px; padding: 8px 12px; border: 1px solid #555; border-radius: 8px; background: #2a2a2a; color: #eee; box-shadow: 0 4px 16px #0005; font-size: 12px; line-height: 20px; }
.sidebar-action-feedback[hidden] { display: none !important; }
.sidebar-action-feedback .sidebar-undo-button { display: inline-flex; align-items: center; justify-content: center; flex: none; min-height: 28px; padding: 0 4px; border: 0; border-radius: 4px; background: transparent; color: #a0a0a0; font-size: 12px; font-weight: 400; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; transition: color .15s; }
.sidebar-action-feedback .sidebar-undo-button:hover { color: #ddd; }
.sidebar-action-feedback .sidebar-undo-button:focus-visible { outline: 2px solid #aaa; outline-offset: 2px; }
.app .sidebar-editor :is(.sidebar-frame-menu-trigger,.sidebar-frame-menu-item,.sidebar-component-delete,.sidebar-add-component,.sidebar-add-menu-item):focus-visible { outline: 2px solid #bbb; outline-offset: -2px; }
.sidebar-no-style { color: #888; font-size: 12px; }
.sidebar-list-footer { flex: 0 0 auto; margin: 0; padding: 12px 16px; border-top: 1px solid #303030; color: #888; font-size: 11px; line-height: 18px; }
.app .sidebar-editor .config-list.is-empty { flex: 0 0 0; padding: 0; }
.app .sidebar-editor.has-title-selection .config-list.is-empty + .config-empty-state { position: static; inset: auto; flex: 1; }
.app .sidebar-editor .config-list.is-sorting { padding-top: calc(16px + var(--content-sort-offset, 0px)); }
.app .sidebar-editor .config-list.is-sorting .config-group { height: 64px; min-height: 64px; padding: 8px; background: #262626; }
.app .sidebar-editor .config-list.is-sorting .group-title { height: 24px; margin: 0 0 2px; padding: 0; }
.app .sidebar-editor .config-list.is-sorting .sidebar-component-number { height: 24px; }
.app .sidebar-editor .config-list.is-sorting .is-sort-source { border-color: #bbb; background: #ffffff08; }
.content-sort-ghost:has(.sidebar-component-toggle) { border-color: #ddd; background: #303030; color: #eee; }
.content-sort-ghost .sidebar-component-toggle { display: flex; align-items: center; flex: 1; gap: calc(8px * var(--content-sort-scale)); min-width: 0; padding: 0; border: 0; background: transparent; color: inherit; }
.content-sort-ghost .sidebar-component-number { flex-basis: calc(20px * var(--content-sort-scale)); width: calc(20px * var(--content-sort-scale)); height: calc(20px * var(--content-sort-scale)); font-size: calc(11px * var(--content-sort-scale)); }
.content-sort-ghost .sidebar-component-name { font-size: calc(12px * var(--content-sort-scale)); }
.content-sort-ghost .sidebar-component-count { font-size: calc(11px * var(--content-sort-scale)); }
.content-sort-ghost .sidebar-component-type-icon { flex-basis: calc(14px * var(--content-sort-scale)); }
.content-sort-ghost .sidebar-component-type-icon .sidebar-line-icon { width: calc(14px * var(--content-sort-scale)); height: calc(14px * var(--content-sort-scale)); flex-basis: calc(14px * var(--content-sort-scale)); }
.content-sort-ghost:has(.sidebar-component-toggle) .content-sort-summary { color: #aaa; }
.sidebar-editor [hidden], .sidebar-materials [hidden] { display: none !important; }

.sidebar-style-gallery { box-sizing: border-box; width: min(760px, calc(100vw - 48px)); max-height: calc(100vh - 48px); padding: 0; overflow: auto; border: 1px solid #555; border-radius: 12px; background: #191919; color: #eee; font: 13px/1.5 var(--vc-font, sans-serif); color-scheme: dark; scrollbar-color: #555 transparent; }
.sidebar-style-gallery * { box-sizing: border-box; }
.sidebar-style-gallery::backdrop { background: #0009; }
.sidebar-gallery-header { display: flex; align-items: center; justify-content: space-between; padding: 18px 24px; border-bottom: 1px solid #333; }
.sidebar-gallery-header h2 { margin: 0; font-size: 16px; font-weight: 500; }
.sidebar-style-gallery .sidebar-gallery-close { width: 28px; height: 28px; padding: 0; border: 0; background: transparent; color: #bbb; font-size: 24px; cursor: pointer; }
.sidebar-gallery-description { margin: 16px 24px; color: #999; font-size: 12px; }
.sidebar-gallery-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; padding: 0 24px 24px; }
.sidebar-gallery-option { display: flex; flex-direction: column; align-items: stretch; height: 164px; padding: 0; overflow: hidden; border: 1px solid #444; border-radius: 6px; background: #0b0c0e; color: #bbb; cursor: pointer; text-align: left; }
.sidebar-gallery-option:hover { border-color: #999; }
.sidebar-gallery-option.is-selected { border-color: #eee; color: #eee; }
.sidebar-gallery-option > .sidebar-style-artwork { flex: 1; min-height: 0; }
.sidebar-gallery-option-name { display: block; padding: 8px 12px; border-top: 1px solid #333; background: #222; font-size: 12px; }
.sidebar-gallery-footer { display: flex; align-items: center; gap: 12px; padding: 16px 24px; border-top: 1px solid #333; }
.sidebar-gallery-page { color: #aaa; font-size: 12px; }
.sidebar-gallery-done { margin-left: auto; }
.sidebar-style-gallery [hidden] { display: none !important; }
.sidebar-style-gallery button:focus-visible,
.app .sidebar-editor .sidebar-component-toggle:focus-visible,
.app .sidebar-editor .sidebar-browse-styles:focus-visible { outline: 2px solid #bbb; outline-offset: -2px; }
@media (max-width: 640px) { .sidebar-gallery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

