/* Shared Midnight chrome only. Never loaded into the authored page or saved CSS. */
.g7-builder-shell[data-editor-theme=midnight],
.g7-builder-content-view[data-editor-theme=midnight]{
 --e-bg:#101720;--e-head:#0e151e;--e-panel:#19232f;--e-card:#202d3b;--e-field:#141e29;
 --e-ink:#e7edf4;--e-muted:#b0bfd0;--e-line:#4c6075;--e-accent:#7bd4c7;
 --e-accent-ink:#102a29;--e-tint:#243e43;--e-head-ink:#e7edf4;
 --e-shadow:0 12px 36px #0005;--g7-accent:var(--e-accent);color-scheme:dark;
}
/* Routine commands share one quiet surface. Add/edit carry just a hint of mint. */
.g7-builder-shell[data-editor-theme=midnight]{
 --e-action-neutral-bg:#253342;--e-action-neutral-ink:#e0e8f1;--e-action-neutral-line:#4c6075;
 --e-action-add-bg:#243c3e;--e-action-add-ink:#b6e5dd;--e-action-add-line:#4c706e;
 --e-action-edit-bg:#243c3e;--e-action-edit-ink:#b6e5dd;--e-action-edit-line:#4c706e;
 --e-action-move-bg:var(--e-action-neutral-bg);--e-action-move-ink:var(--e-action-neutral-ink);--e-action-move-line:var(--e-action-neutral-line);
 --e-action-preview-bg:var(--e-action-neutral-bg);--e-action-preview-ink:var(--e-action-neutral-ink);--e-action-preview-line:var(--e-action-neutral-line);
 --e-action-history-bg:var(--e-action-neutral-bg);--e-action-history-ink:var(--e-action-neutral-ink);--e-action-history-line:var(--e-action-neutral-line);
 --e-action-danger-bg:#382930;--e-action-danger-ink:#ffc1c5;--e-action-danger-line:#8c626b;
}
.g7-builder-shell[data-editor-theme=midnight] :is(.g7-builder-top,.g7c-selection-toolbar){box-shadow:none}
.g7-builder-shell[data-editor-theme=midnight] .g7c-selection-action{box-shadow:none}
.g7-builder-shell[data-editor-theme=midnight] .g7c-selection-caption{background:var(--e-card)!important;color:var(--e-ink)!important}
.g7-builder-shell[data-editor-theme=midnight] :is(.g7-builder-close,.g7e-help-launcher,.g7-help-launch){background:var(--e-field)!important;color:var(--e-ink)!important;border-color:var(--e-line)!important;box-shadow:none}
.g7-builder-shell[data-editor-theme=midnight] .g7e-help-launcher svg{color:var(--e-accent)}
/* Preserve selected states even when command colours are enabled. */
.g7-builder-shell[data-editor-theme=midnight][data-editor-button-colours] button:is([aria-pressed=true],[aria-selected=true]){
 background:var(--e-tint)!important;color:var(--e-accent)!important;border-color:var(--e-accent)!important;box-shadow:inset 0 -2px var(--e-accent);
}
.g7-builder-shell[data-editor-theme=midnight] button[data-g7-button-tone]:is(.g7c-primary,.g7e-primary,.g7c-template-primary,.g7c-section-preview-add,.g7-generated-add,.ppe-primary,.g7-table-done){
 --g7-button-bg:var(--e-accent);--g7-button-ink:var(--e-accent-ink);--g7-button-line:var(--e-accent);
}
.g7-builder-shell[data-editor-theme=midnight] :is(.g7c-selection-delete,.g7c-template-danger,.g7c-danger,.g7c-selection-action[data-selection-action=delete]){
 background:var(--e-action-danger-bg)!important;color:var(--e-action-danger-ink)!important;border-color:var(--e-action-danger-line)!important;
}
.g7-builder-shell[data-editor-theme=midnight] :is(.g7c-selection-delete,.g7c-template-danger,.g7c-danger,.g7c-selection-action[data-selection-action=delete]):hover:not(:disabled){background:#4b303a!important;color:#ffe3e5!important}
.g7-builder-shell[data-editor-theme=midnight] :is(button,.g7c-button):hover:not(:disabled){border-color:var(--e-accent)!important}
.g7-builder-shell[data-editor-theme=midnight] :is(button,input,select,textarea,summary,a):focus-visible{
 outline:2px solid var(--e-accent)!important;outline-offset:3px;
}
.g7-builder-shell[data-editor-theme=midnight] button:disabled{
 background:var(--e-panel)!important;color:var(--e-muted)!important;border-color:var(--e-line)!important;box-shadow:none;opacity:.55;
}
/* Functional sliders use mint. Colour-picker hue/opacity controls retain their colours. */
.g7-builder-shell[data-editor-theme=midnight] :is(.g7-control-range,.g7c-size-slider,.g7st-field,.g7c-cms-controls) input[type=range]::-webkit-slider-runnable-track{
 background:linear-gradient(to right,var(--e-accent) var(--g7-range-progress,0%),var(--e-line) var(--g7-range-progress,0%))!important;
}
.g7-builder-shell[data-editor-theme=midnight] :is(.g7-control-range,.g7c-size-slider,.g7st-field,.g7c-cms-controls) input[type=range]::-webkit-slider-thumb{
 background:var(--e-accent)!important;border-color:var(--e-field)!important;box-shadow:0 0 0 1px var(--e-accent);
}
.g7-builder-shell[data-editor-theme=midnight] :is(.g7-control-range,.g7c-size-slider,.g7st-field,.g7c-cms-controls) input[type=range]::-moz-range-track{background:var(--e-line)!important}
.g7-builder-shell[data-editor-theme=midnight] :is(.g7-control-range,.g7c-size-slider,.g7st-field,.g7c-cms-controls) input[type=range]::-moz-range-progress{background:var(--e-accent)!important}
.g7-builder-shell[data-editor-theme=midnight] :is(.g7-control-range,.g7c-size-slider,.g7st-field,.g7c-cms-controls) input[type=range]::-moz-range-thumb{background:var(--e-accent)!important;border-color:var(--e-field)!important}
/* Trial invitation belongs to the chrome, with a restrained primary action. */
.g7-builder-shell[data-editor-theme=midnight]>.native-context.ib-trial-install{background:var(--e-panel);border-color:var(--e-line);color:var(--e-ink)}
.g7-builder-shell[data-editor-theme=midnight] .ib-trial-install-copy>strong{color:var(--e-ink)}
.g7-builder-shell[data-editor-theme=midnight] .ib-trial-install-copy>span{color:var(--e-muted)}
.g7-builder-shell[data-editor-theme=midnight] .ib-trial-install-link{background:var(--e-tint);color:var(--e-accent);border-color:#4c706e}
.g7-builder-shell[data-editor-theme=midnight] .ib-trial-install-link:hover{background:#304d50;border-color:var(--e-accent)}
/* Theme swatch reflects the palette, including on pinned editors. */
.g7-builder-shell [data-editor-theme-choice=midnight]{--sample-head:#0e151e!important;--sample-surface:#19232f!important;--sample-accent:#7bd4c7!important}
