/* ============================================================================
   zz_new_content.css — the new_content builder stylesheet body (R3.2).

   Extracted from assets/styles.css in original order. The zz_ prefix makes
   Dash serve this file AFTER styles.css (assets load alphabetically), so
   these rules keep winning the ties they used to win inside styles.css.
   Tokens (--bc-*) and the --feed-*/builder-route re-point live in
   assets/new_content.css (loads first; definitions are order-agnostic).
   ========================================================================== */

.sp-section-layout-overlay {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  overflow: visible;
}

.sp-section-layout-editor {
  position: absolute;
  inset: 0;
  pointer-events: auto;
  outline: none;
  touch-action: none;
  overflow: visible;
}

.sp-section-layout-gridlines {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  /* 2d: all editor tooling (grid/zones/drag chrome) rides --bc-editor-tool. */
  background-image:
    linear-gradient(to right, color-mix(in srgb, var(--bc-editor-tool) 42%, transparent) 1px, transparent 1px),
    linear-gradient(to bottom, color-mix(in srgb, var(--bc-editor-tool) 42%, transparent) 1px, transparent 1px),
    linear-gradient(to right, color-mix(in srgb, var(--bc-editor-tool) 18%, transparent) 1px, transparent 1px),
    linear-gradient(to bottom, color-mix(in srgb, var(--bc-editor-tool) 18%, transparent) 1px, transparent 1px);
  background-size:
    var(--sp-grid-major-x, 50%) 100%,
    100% var(--sp-grid-major-y, 50%),
    var(--sp-grid-minor-x, 10%) 100%,
    100% var(--sp-grid-minor-y, 10%);
  background-position: 0 0;
}

.sp-section-layout-grid-center {
  position: absolute;
  pointer-events: none;
  background: rgba(255, 255, 255, 0.55);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--bc-editor-tool) 38%, transparent);
}

.sp-section-layout-grid-center--vertical {
  top: 0;
  bottom: 0;
  left: 50%;
  width: 1px;
}

.sp-section-layout-grid-center--horizontal {
  left: 0;
  right: 0;
  top: 50%;
  height: 1px;
}

.sp-section-layout-box {
  position: absolute;
  z-index: 10;
  border: 1px solid color-mix(in srgb, var(--bc-editor-tool) 62%, transparent);
  border-radius: 8px;
  background: transparent;
  box-shadow: none;
  cursor: grab;
  user-select: none;
  touch-action: none;
}

.sp-section-layout-box[data-section-key="graph"] {
  z-index: 10;
  border-color: color-mix(in srgb, var(--bc-editor-tool) 72%, transparent);
  background: transparent;
}

.sp-section-layout-box[data-section-key="source"] {
  z-index: 20;
}

.sp-section-layout-box[data-section-key="subtitle"] {
  z-index: 30;
}

.sp-section-layout-box[data-section-key="title"] {
  z-index: 40;
}

.sp-section-layout-box.is-selected {
  border-color: color-mix(in srgb, var(--bc-editor-tool) 96%, transparent);
  background: transparent;
  box-shadow: none;
}

.sp-section-layout-selection-ring {
  position: absolute;
  z-index: 120;
  border: 2px solid color-mix(in srgb, var(--bc-editor-tool) 98%, transparent);
  border-radius: 8px;
  box-shadow:
    0 0 0 2px color-mix(in srgb, var(--bc-editor-tool) 16%, transparent),
    0 0 0 1px rgba(8, 32, 61, 0.18);
  pointer-events: none;
  display: none;
}

.sp-section-layout-box.is-disabled {
  opacity: 0.45;
  border-style: dashed;
}

.sp-section-layout-box.is-interacting {
  cursor: grabbing;
}

.sp-section-layout-editor[data-chrome-visible="false"] .sp-section-layout-box {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}

.sp-section-layout-editor[data-chrome-visible="false"] .sp-section-layout-box.is-selected {
  border-color: transparent;
  box-shadow: none;
}

.sp-section-layout-editor[data-chrome-visible="false"] .sp-section-layout-selection-ring {
  display: none !important;
}

.sp-section-layout-editor[data-chrome-visible="false"] .sp-section-layout-handle {
  display: none;
}

.sp-section-layout-meta {
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.01em;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.12);
}

.sp-section-layout-meta {
  color: #475569;
}

.sp-section-layout-handle {
  position: absolute;
  right: -5px;
  bottom: -5px;
  width: 12px;
  height: 12px;
  border-radius: 4px;
  border: 1px solid rgba(10, 42, 78, 0.92);
  background: color-mix(in srgb, var(--bc-editor-tool) 96%, transparent);
  cursor: nwse-resize;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.12);
  z-index: 2;
  display: none;
}

.sp-section-layout-box.is-selected .sp-section-layout-handle,
.sp-section-layout-box.is-interacting .sp-section-layout-handle {
  display: block;
}

.sp-section-layout-editor[data-chrome-visible="false"] .sp-section-layout-box.is-selected .sp-section-layout-handle,
.sp-section-layout-editor[data-chrome-visible="false"] .sp-section-layout-box.is-interacting .sp-section-layout-handle {
  display: none;
}

/* Free-form element drag/resize layer (isolated from the section editor). */
.sp-free-form-editor {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: visible;
  /* Must sit ABOVE the section boxes (.sp-section-layout-box is z-index 10, and the
     section editor does not create its own stacking context) so a badge on top of the
     chart is the click target, not the chart box underneath it. */
  z-index: 100;
}

.sp-free-form-box {
  position: absolute;
  pointer-events: auto;
  /* 2d: was lime (content-ish); free-form keeps DASHED borders as its
     distinction from section boxes, but rides the editor tooling blue. */
  border: 1px dashed color-mix(in srgb, var(--bc-editor-tool) 85%, transparent);
  border-radius: 6px;
  background: transparent;
  cursor: grab;
  user-select: none;
  touch-action: none;
}

.sp-free-form-box.is-interacting {
  cursor: grabbing;
  border-style: solid;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--bc-editor-tool) 60%, transparent);
}

.sp-free-form-box-label {
  position: absolute;
  top: -16px;
  left: 0;
  font-size: 10px;
  line-height: 1;
  padding: 2px 4px;
  border-radius: 3px;
  background: rgba(17, 24, 39, 0.82);
  color: #e5e7eb;
  pointer-events: none;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.sp-free-form-handle {
  position: absolute;
  right: -6px;
  bottom: -6px;
  width: 12px;
  height: 12px;
  border-radius: 4px;
  border: 1px solid rgba(10, 42, 78, 0.92);
  background: color-mix(in srgb, var(--bc-editor-tool) 96%, transparent);
  cursor: nwse-resize;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.12);
}

/* Band S stage S-3c (2026-09-05): this July pre-mount header band is scoped
   away from the "Pick your data" entry surface (root `#studio-entry-shell`,
   which never has #new-content-shell) — its (1,2,1) selectors would otherwise beat
   zz_site_chrome.css permanently there and paint the header with --feed-*
   tokens that are undefined on that page. `:has()` takes a selector list, so
   the specificity is unchanged; the guard is an ID like the existing key —
   a class inside an html/body-level `:has()` would add a class-keyed
   invalidation feature to the studio's constant className churn. Still live: the mount gap of the editor
   variants and the anonymous login page of the route (D-3 material). */
html.sp-route-new-content:not(:where([data-sp-has~="studio-or-entry-shell"]):not(#sp-s)),
body.sp-route-new-content:not(:where([data-sp-has~="studio-or-entry-shell"]):not(#sp-s)) {
  background: var(--feed-bg) !important;
}

html.sp-route-new-content:not(:where([data-sp-has~="studio-or-entry-shell"]):not(#sp-s)) #app-container,
body.sp-route-new-content:not(:where([data-sp-has~="studio-or-entry-shell"]):not(#sp-s)) #app-container {
  min-height: 100vh;
  background: var(--feed-bg) !important;
}

body:where([data-sp-has~="studio-shell"]):not(#sp-s) {
  color-scheme: light;
}

body:where([data-sp-has~="studio-theme-dark"]):not(#sp-s):not(.sp-s) {
  color-scheme: dark;
}

/* R3: on the builder route the site header follows the Broadcast tokens —
   the --feed-* vocabulary is re-pointed at --bc-* (theme forking lives in
   the tokens), which turns the Create pill / header accents amber and the
   chrome steel. The feed pages themselves keep their own --feed-* blocks
   (different scope) until the feed restyle phase. */
body:where([data-sp-has~="studio-shell"]):not(#sp-s) {
  --feed-bg: var(--bc-bg);
  --feed-panel: var(--bc-panel);
  --feed-border: var(--bc-border-soft);
  --feed-primary: var(--bc-accent);
  --feed-header-bg: color-mix(in srgb, var(--bc-panel) 92%, transparent);
  --feed-header-border: var(--bc-border-soft);
  --feed-header-shadow: none;
  --feed-header-text: var(--bc-text);
  --feed-header-muted: var(--bc-text2);
  --feed-header-muted-hover: var(--bc-text);
  --feed-theme-btn-bg: var(--bc-raised);
  --feed-theme-btn-border: var(--bc-border);
  --feed-theme-btn-color: var(--bc-text2);
  --feed-user-bg: var(--sp-accent-brand);
  --feed-user-color: #ffffff;
}

body:where([data-sp-has~="studio-shell"]):not(#sp-s),
body:where([data-sp-has~="studio-shell"]):not(#sp-s) #app-container {
  background: var(--feed-bg) !important;
}

body:where([data-sp-has~="studio-shell"]):not(#sp-s) .sp-user-menu-dropdown {
  background: var(--feed-panel) !important;
  border: 1px solid var(--feed-border) !important;
  box-shadow: 0 18px 34px rgba(15, 23, 42, 0.12) !important;
}

body:where([data-sp-has~="studio-shell"]):not(#sp-s) .sp-user-menu-label,
body:where([data-sp-has~="studio-shell"]):not(#sp-s) .sp-user-menu-item {
  color: var(--feed-header-text) !important;
}

body:where([data-sp-has~="studio-shell"]):not(#sp-s),
body:where([data-sp-has~="studio-shell"]):not(#sp-s) #app-container {
  background: var(--bc-bg) !important;
}

#new-content-shell.sp-new-content-page {
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;
  background: var(--bc-bg) !important;
  min-height: calc(100vh - 72px);
}

#new-content-shell .sp-builder-shell-body { display: grid; grid-template-columns: minmax(350px, 430px) minmax(0, 1fr); align-items: stretch; min-height: calc(100vh - 208px); }

#new-content-shell .sp-builder-sidebar { padding: 20px; border-right: 1px solid var(--bc-border-soft); background: var(--bc-panel); overflow: auto; }

#new-content-shell .sp-builder-sidebar-stack,
#new-content-shell .sp-builder-panel-group {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

#new-content-shell .sp-builder-preview-shell { min-width: 0; padding: 18px 22px 24px; background: var(--bc-canvas); }

#new-content-shell .sp-builder-preview-empty { display: none; min-height: calc(100vh - 340px); border: 1px dashed var(--bc-border-soft); background: var(--bc-panel); }

#new-content-shell .sp-builder-preview-shell:has(#preview-wrapper[style*="display: none"]) #preview-empty-state {
  display: block;
}

#new-content-shell .sp-builder-preview-shell:has(#preview-wrapper[style*="display: none"]) .sp-builder-preview-empty .mantine-ThemeIcon-root { background: var(--bc-accent-soft) !important; color: color-mix(in srgb, var(--bc-accent) 76%, var(--bc-text) 24%) !important; }

#new-content-shell .sp-builder-preview-shell:has(#preview-wrapper[style*="display: none"]) .sp-builder-preview-empty .mantine-Paper-root,
#new-content-shell .sp-builder-preview-shell:has(#preview-wrapper[style*="display: none"]) #preview-empty-state {
  color: var(--bc-text);
}

#new-content-shell #preview-wrapper {
  min-width: 0;
}

#new-content-shell .sp-builder-preview-stack {
  gap: 16px;
}

#new-content-shell #figure-card {
  width: 100%;
}

#new-content-shell #preview-controls { background: var(--bc-panel) !important; border-color: var(--bc-border) !important; box-shadow: none !important; }

#new-content-shell .sp-builder-step-card { background: var(--bc-panel) !important; border: 1px solid var(--bc-border-soft) !important; box-shadow: none !important; border-radius: 22px !important; margin: 0 !important; }

#new-content-shell .sp-builder-step-card .mantine-Text-root,
#new-content-shell .sp-builder-preview-panel .mantine-Text-root {
  color: var(--bc-text);
}

#new-content-shell .sp-builder-step-card .mantine-Badge-root { background: var(--bc-raised) !important; border: 1px solid var(--bc-border-soft); color: var(--bc-text2) !important; }

#new-content-shell .sp-builder-step-card .mantine-Divider-root, #new-content-shell .sp-builder-preview-panel .mantine-Divider-root { border-color: var(--bc-border-soft); }

#new-content-shell .sp-builder-step-card .mantine-InputWrapper-label, #new-content-shell .sp-builder-step-card .mantine-Checkbox-label, #new-content-shell .sp-builder-step-card .mantine-Switch-label { color: var(--bc-text) !important; }

#new-content-shell .sp-builder-step-card .mantine-InputWrapper-description,
#new-content-shell .sp-builder-step-card .mantine-Text-root[data-dimmed],
#new-content-shell .sp-builder-step-card .mantine-InputWrapper-description *,
#new-content-shell .sp-builder-step-card .mantine-Text-root[style*="dimmed"],
#new-content-shell .sp-builder-preview-panel .mantine-Text-root[style*="dimmed"] {
  color: var(--bc-text2) !important;
}

#new-content-shell .sp-builder-step-card .mantine-Input-input, #new-content-shell .sp-builder-step-card .mantine-Select-input, #new-content-shell .sp-builder-step-card .mantine-MultiSelect-input, #new-content-shell .sp-builder-step-card .mantine-NumberInput-input, #new-content-shell .sp-builder-step-card .mantine-ColorInput-input, #new-content-shell .sp-builder-step-card textarea, #new-content-shell .sp-builder-step-card .mantine-PillsInput-input { background: var(--bc-raised) !important; border: 1px solid var(--bc-border) !important; color: var(--bc-text) !important; min-height: 40px; }

#new-content-shell .sp-builder-step-card .mantine-Input-input::placeholder, #new-content-shell .sp-builder-step-card textarea::placeholder, #new-content-shell .sp-builder-step-card .mantine-PillsInput-input::placeholder { color: var(--bc-text2) !important; }

body:where([data-sp-has~="studio-shell"]):not(#sp-s) .mantine-Combobox-option[data-combobox-selected] .mantine-CheckIcon-root,
body:where([data-sp-has~="studio-shell"]):not(#sp-s) .mantine-Select-option .mantine-CheckIcon-root,
body:where([data-sp-has~="studio-shell"]):not(#sp-s) .mantine-MultiSelect-option .mantine-CheckIcon-root {
  color: var(--bc-accent) !important;
}

body:where([data-sp-has~="studio-shell"]):not(#sp-s) .mantine-Pill-remove {
  color: var(--bc-accent) !important;
}

#new-content-shell .sp-builder-step-card .mantine-Button-root,
#new-content-shell .sp-builder-step-card .mantine-ActionIcon-root,
#new-content-shell .sp-builder-preview-panel .mantine-Button-root,
#new-content-shell .sp-builder-preview-panel .mantine-ActionIcon-root {
  box-shadow: none !important;
}

#new-content-shell .sp-builder-step-card .mantine-Button-root:not([data-variant="filled"]), #new-content-shell .sp-builder-preview-panel .mantine-Button-root:not([data-variant="filled"]) { background: var(--bc-raised) !important; border: 1px solid var(--bc-border-soft) !important; color: var(--bc-text) !important; }

#new-content-shell .sp-builder-step-card .mantine-Button-root[data-variant="filled"], #new-content-shell .sp-builder-preview-panel .mantine-Button-root[data-variant="filled"] { background: var(--bc-accent) !important; color: var(--bc-accent-ink) !important; }

#new-content-shell .sp-builder-step-card .mantine-SegmentedControl-root, #new-content-shell .sp-builder-step-card .mantine-TabsList-root, #new-content-shell .sp-builder-preview-panel .mantine-SegmentedControl-root { background: var(--bc-raised) !important; border: 1px solid var(--bc-border-soft); }

#new-content-shell .sp-builder-step-card .mantine-SegmentedControl-indicator, #new-content-shell .sp-builder-preview-panel .mantine-SegmentedControl-indicator { background: var(--bc-accent-soft) !important; border: 1px solid color-mix(in srgb, var(--bc-accent) 22%, transparent); }

#new-content-shell .sp-builder-step-card .mantine-SegmentedControl-label, #new-content-shell .sp-builder-step-card .mantine-Tabs-tab, #new-content-shell .sp-builder-preview-panel .mantine-SegmentedControl-label { color: var(--bc-text2) !important; font-weight: 700; }

#new-content-shell .sp-builder-step-card .mantine-Tabs-tab[data-active="true"] { background: var(--bc-accent-soft) !important; color: var(--bc-accent) !important; }

:is(#new-content-shell, #editor-workspace-root) :is(#filter-card, #editor-filter-card) .sp-filter-panel, :is(#new-content-shell, #editor-workspace-root) :is(#filter-card, #editor-filter-card) .sp-db-prefilter-panel, :is(#new-content-shell, #editor-workspace-root) :is(#config-card, #editor-tools) .sp-inspector-option, :is(#new-content-shell, #editor-workspace-root) :is(#config-card, #editor-tools) .sp-step4-field-card, :is(#new-content-shell, #editor-workspace-root) :is(#config-card, #editor-tools) .mantine-Paper-root, :is(#new-content-shell, #editor-workspace-root) :is(#save-card, #editor-save-card) .mantine-Paper-root { background: var(--bc-raised) !important; border-color: var(--bc-border-soft) !important; }

#new-content-shell #config-card .mantine-TabsList-root { gap: 8px; padding: 6px; overflow-x: auto; flex-wrap: nowrap; }

#new-content-shell #config-card .mantine-Tabs-tab { border-radius: 999px; padding: 10px 14px; white-space: nowrap; }

#new-content-shell #save-card .mantine-CheckboxGroup-root .mantine-Checkbox-root { margin-bottom: 8px; }

#new-content-shell .dash-table-container .dash-spreadsheet-container .dash-spreadsheet-inner table { background: var(--bc-raised); color: var(--bc-text); }

#new-content-shell .dash-table-container .dash-spreadsheet-container .dash-spreadsheet-inner th, #new-content-shell .dash-table-container .dash-spreadsheet-container .dash-spreadsheet-inner td { background: var(--bc-raised); color: var(--bc-text); border-color: var(--bc-border-soft); }

@media (max-width: 1340px) {
  #new-content-shell .sp-builder-shell-body { grid-template-columns: minmax(320px, 390px) minmax(0, 1fr); }

}

@media (max-width: 1080px) {
  #new-content-shell.sp-new-content-page {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 8px 7px 14px !important;
  }

  #new-content-shell .sp-builder-shell-frame {
    min-height: auto;
  }

  #new-content-shell .sp-builder-shell-body { grid-template-columns: 1fr; }

  #new-content-shell .sp-builder-sidebar { border-right: 0; border-bottom: 1px solid var(--bc-border-soft); }

  #new-content-shell .sp-builder-preview-shell {
    padding-top: 14px;
  }

  #new-content-shell .sp-builder-preview-empty {
    min-height: 280px;
  }

}

@media (max-width: 760px) {
  #new-content-shell .sp-builder-shell-topbar {
    padding: 20px 18px 14px;
  }

  #new-content-shell .sp-builder-sidebar,
  #new-content-shell .sp-builder-preview-shell {
    padding: 14px;
  }

  #new-content-shell .sp-builder-step-card {
    border-radius: 20px !important;
  }

}

#new-content-shell #filter-card { padding: 10px !important; }

#new-content-shell #filter-card .sp-filter-inline-label { color: var(--bc-text2) !important; letter-spacing: 0.02em; text-transform: uppercase; }

#new-content-shell #filter-card .sp-filter-inline-block { gap: 6px !important; }

#new-content-shell #filter-card .sp-filter-inline-subtitle { color: var(--bc-text) !important; }

#new-content-shell #filter-card .sp-filter-compact-axis-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 14px; }

#new-content-shell #filter-card .sp-filter-pair-grid--compact { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; align-items: end; }

#new-content-shell #config-card { padding: 10px !important; }

#new-content-shell #config-card > .mantine-Stack-root:first-child .mantine-Text-root:last-child { display: none !important; }

#new-content-shell #config-card .sp-step4-field-card, #new-content-shell #config-card .sp-inspector-option { padding: 10px !important; border-radius: 10px !important; }

#new-content-shell #config-card .sp-inspector-option-title, #new-content-shell #config-card .sp-step4-field-card .mantine-InputWrapper-label { font-size: 0.84rem !important; line-height: 1.18 !important; }

#new-content-shell #config-card .sp-inspector-option-desc, #new-content-shell #config-card .sp-step4-field-card .mantine-InputWrapper-description, #new-content-shell #filter-card .mantine-InputWrapper-description { display: none !important; }

#new-content-shell #config-card .sp-layout-foundation-grid,
#new-content-shell #config-card .sp-layout-margin-grid,
#new-content-shell #config-card .sp-layout-section-grid,
#new-content-shell #config-card .sp-step4-behavior-grid,
#new-content-shell #config-card .sp-step4-window-grid {
  gap: 10px !important;
}

#new-content-shell #config-card .sp-layout-foundation-grid, #new-content-shell #config-card .sp-layout-margin-grid, #new-content-shell #config-card .sp-layout-section-grid { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }

#new-content-shell #config-card .sp-layout-section-grid > :nth-child(2) {
  grid-column: auto !important;
}

#new-content-shell #config-card .mantine-Textarea-input { min-height: 70px !important; }

@media (max-width: 1280px) {
  #new-content-shell #config-card .sp-layout-foundation-grid,
  #new-content-shell #config-card .sp-layout-margin-grid,
  #new-content-shell #config-card .sp-layout-section-grid,
  #new-content-shell #config-card .sp-step4-behavior-grid,
  #new-content-shell #config-card .sp-step4-window-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

}

@media (max-width: 900px) {
  #new-content-shell #filter-card .sp-filter-compact-axis-grid,
  #new-content-shell #filter-card .sp-filter-pair-grid--compact,
  #new-content-shell #config-card .sp-layout-foundation-grid,
  #new-content-shell #config-card .sp-layout-margin-grid,
  #new-content-shell #config-card .sp-layout-section-grid,
  #new-content-shell #config-card .sp-step4-behavior-grid,
  #new-content-shell #config-card .sp-step4-window-grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }

}

#new-content-shell #filter-card .sp-filter-inline-block { gap: 6px !important; padding: 10px 0 !important; border-top: 1px solid var(--bc-border-soft); }

#new-content-shell #filter-card .sp-filter-inline-block:first-child { border-top: 0; padding-top: 2px !important; }

#new-content-shell #filter-card .sp-filter-inline-label { color: var(--bc-text2) !important; font-size: 0.75rem !important; font-weight: 700 !important; letter-spacing: 0.02em; text-transform: uppercase; }

#new-content-shell #filter-card .sp-filter-compact-axis-grid { grid-template-columns: minmax(0, 1fr) !important; gap: 10px !important; }

#new-content-shell #filter-card .sp-filter-compact-axis-grid > .mantine-Stack-root { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 10px 14px; align-items: end; }

#new-content-shell #filter-card .sp-filter-inline-subtitle { font-size: 0.82rem !important; font-weight: 700 !important; color: var(--bc-text) !important; padding-top: 2px; }

#new-content-shell #filter-card .sp-filter-pair-grid--compact { gap: 10px !important; }

#new-content-shell #config-card > .mantine-Stack-root:first-child .mantine-Text-root:last-child { color: var(--bc-text2) !important; }

#new-content-shell #config-card .sp-config-root-tabs .mantine-Tabs-tab { border: 1px solid var(--bc-border-soft) !important; background: var(--bc-raised) !important; color: var(--bc-text2) !important; }

#new-content-shell #config-card .sp-config-root-tabs .mantine-Tabs-tab[data-active="true"] { background: var(--bc-accent-soft) !important; border-color: color-mix(in srgb, var(--bc-accent) 24%, transparent) !important; color: var(--bc-accent) !important; }

#new-content-shell #config-card .sp-config-root-panel-surface { background: var(--bc-panel) !important; border: 1px solid var(--bc-border-soft) !important; }

#new-content-shell #config-card .sp-inspector-subsection { border-top: 1px solid var(--bc-border-soft); }

#new-content-shell #config-card .sp-inspector-subsection-title { color: var(--bc-text2) !important; }

#new-content-shell #config-card .sp-inspector-subsection-body .sp-step4-field-card, #new-content-shell #config-card .sp-inspector-subsection-body .sp-inspector-option { border-bottom-color: var(--bc-border-soft) !important; }

@media (max-width: 900px) {
  #new-content-shell #filter-card .sp-filter-compact-axis-grid > .mantine-Stack-root { grid-template-columns: minmax(0, 1fr) !important; }

}

#new-content-shell .sp-preview-layer-item { border-color: var(--bc-border-soft); background: var(--bc-raised); box-shadow: none; }

#new-content-shell .sp-preview-layer-item:hover { border-color: color-mix(in srgb, var(--bc-accent) 22%, transparent); box-shadow: 0 10px 24px rgba(0, 0, 0, 0.32); }

#new-content-shell .sp-preview-layer-item.is-active { border-color: color-mix(in srgb, var(--bc-accent) 48%, transparent); background: linear-gradient(180deg, color-mix(in srgb, var(--bc-accent) 14%, transparent), color-mix(in srgb, var(--bc-accent) 8%, transparent)); box-shadow: 0 0 0 1px color-mix(in srgb, var(--bc-accent) 18%, transparent); }

#new-content-shell .sp-preview-layer-item-badge { background: var(--bc-raised); color: var(--bc-text2); }

#new-content-shell .sp-preview-layer-item.is-active .sp-preview-layer-item-badge { background: var(--bc-accent-soft); color: var(--bc-accent); }

#new-content-shell .sp-preview-mode-control { flex: 0 0 auto; }

#new-content-shell #preview-edit-row .sp-preview-mode-control .mantine-SegmentedControl-root { background: color-mix(in srgb, var(--bc-panel) 92%, transparent) !important; border: 1px solid var(--bc-border) !important; }

#new-content-shell #preview-controls .sp-preview-play-toggle { background: var(--bc-accent) !important; border: 0 !important; color: var(--bc-accent-ink) !important; box-shadow: none !important; }

#new-content-shell #preview-controls .sp-preview-play-toggle[data-disabled="true"], #new-content-shell #preview-controls .sp-preview-play-toggle:disabled { background: var(--bc-raised) !important; color: var(--bc-text2) !important; }

#new-content-shell .sp-builder-sidebar, #new-content-shell .sp-builder-preview-shell { background: transparent !important; }

#new-content-shell .sp-builder-step-card, #new-content-shell #filter-card, #new-content-shell #config-card, #new-content-shell #visual-type-card, #new-content-shell #save-card, #new-content-shell #figure-card, #new-content-shell #preview-sidecar-card { background: var(--bc-panel) !important; border-color: var(--bc-border) !important; }

#new-content-shell .sp-setup-flow {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

#new-content-shell .sp-setup-stage-card {
  border-radius: 24px !important;
}

#new-content-shell .sp-setup-stage-header {
  gap: 8px !important;
}

#new-content-shell .sp-setup-stage-meta {
  align-items: center;
}

#new-content-shell .sp-setup-step-badge {
  background: color-mix(in srgb, var(--bc-accent) 18%, transparent) !important;
  border: 1px solid color-mix(in srgb, var(--bc-accent) 24%, transparent) !important;
  color: color-mix(in srgb, var(--bc-accent) 76%, #ffffff 24%) !important;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

#new-content-shell .sp-setup-step-eyebrow {
  color: var(--bc-faint) !important;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

#new-content-shell .sp-setup-stage-description,
#new-content-shell .sp-setup-stage-helper {
  color: var(--bc-text2) !important;
}

#new-content-shell .sp-setup-choice-control {
  background: var(--bc-raised) !important;
  border: 1px solid var(--bc-border) !important;
  border-radius: 20px !important;
  padding: 6px !important;
}

#new-content-shell .sp-setup-choice-control .mantine-SegmentedControl-indicator {
  background: color-mix(in srgb, var(--bc-accent) 18%, var(--bc-panel) 82%) !important;
  border: 1px solid color-mix(in srgb, var(--bc-accent) 24%, var(--bc-panel) 76%) !important;
  border-radius: 16px !important;
  box-shadow: none !important;
}

#new-content-shell .sp-setup-choice-control .mantine-SegmentedControl-label {
  min-height: 76px !important;
  padding: 14px 16px !important;
  color: var(--bc-text) !important;
}

#new-content-shell .sp-setup-choice-control--visual .mantine-SegmentedControl-label {
  min-height: 84px !important;
}

#new-content-shell .sp-setup-choice-label {
  width: 100%;
  align-items: flex-start;
}

#new-content-shell .sp-setup-choice-control--visual .sp-visual-choice-compact {
  width: 100%;
}

#new-content-shell .sp-setup-choice-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  color: color-mix(in srgb, var(--bc-accent) 62%, #ffffff 38%);
  flex: 0 0 34px;
}

#new-content-shell .sp-setup-choice-title {
  color: var(--bc-text) !important;
  line-height: 1.2;
}

#new-content-shell .sp-setup-choice-caption {
  color: var(--bc-text2) !important;
  line-height: 1.35;
}

#new-content-shell .sp-setup-data-panel {
  gap: 14px !important;
}

#new-content-shell .sp-setup-data-surface,
#new-content-shell .sp-setup-load-panel,
#new-content-shell .sp-setup-overview-next-card {
  background: color-mix(in srgb, var(--bc-raised) 86%, transparent) !important;
  border: 1px solid var(--bc-border) !important;
  border-radius: 18px !important;
}

#new-content-shell .sp-setup-data-surface {
  padding: 16px 18px;
}

#new-content-shell .sp-setup-data-preview {
  padding-top: 12px;
  border-top: 1px solid var(--bc-border);
}

#new-content-shell .sp-setup-data-preview:empty {
  display: none;
}

#new-content-shell .sp-setup-profile-actions,
#new-content-shell .sp-setup-profile-switches {
  align-items: center;
}

#new-content-shell .sp-setup-load-button {
  min-width: 260px !important;
  height: 44px !important;
  border-radius: 14px !important;
}

@media (max-width: 720px) {
  #new-content-shell .sp-setup-choice-control .mantine-SegmentedControl-label {
    min-height: 64px !important;
    padding: 12px !important;
  }

  #new-content-shell .sp-setup-choice-icon {
    width: 30px;
    height: 30px;
    border-radius: 10px;
    flex-basis: 30px;
  }

  #new-content-shell .sp-setup-load-cta-group,
  #new-content-shell .sp-setup-load-button {
    width: 100%;
    min-width: 0 !important;
  }

}

#new-content-shell #builder-nav-meta,
#new-content-shell .sp-setup-stage-meta,
#new-content-shell .sp-setup-stage-description,
#new-content-shell .sp-setup-stage-helper,
#new-content-shell .sp-setup-choice-caption,
#new-content-shell .sp-setup-support-copy {
  display: none !important;
}

#new-content-shell .sp-setup-flow {
  gap: 12px;
}

#new-content-shell .sp-setup-stage-card {
  border-radius: 20px !important;
}

#new-content-shell .sp-setup-stage-header {
  gap: 2px !important;
}

#new-content-shell .sp-setup-choice-control .mantine-SegmentedControl-label {
  min-height: 58px !important;
  padding: 10px 14px !important;
}

#new-content-shell .sp-setup-choice-control--visual .mantine-SegmentedControl-label {
  min-height: 64px !important;
}

#new-content-shell .sp-setup-choice-icon {
  width: 30px;
  height: 30px;
  border-radius: 10px;
  flex-basis: 30px;
}

#new-content-shell .sp-setup-data-surface,
#new-content-shell .sp-setup-load-panel {
  padding: 14px 16px;
}

#new-content-shell .sp-builder-preview-empty--compact {
  min-height: auto !important;
  width: min(100%, 460px);
  margin-left: auto;
  border-style: solid !important;
}

@media (max-width: 720px) {
  #new-content-shell .sp-builder-preview-empty--compact {
    width: 100%;
    margin-left: 0;
  }

}

#new-content-shell .sp-question-library-status {
  color: var(--bc-text2) !important;
  line-height: 1.45;
}

#new-content-shell .sp-builder-shell-frame {
  width: 100%;
  margin: 0;
  overflow: hidden;
}

#new-content-shell .sp-builder-shell-topbar {
  border-bottom: 1px solid var(--bc-border);
}

#new-content-shell .sp-editor-topbar-mode {
  min-width: 184px;
}

#new-content-shell .sp-editor-topbar-export.mantine-Button-root {
  height: 36px;
  padding-inline: 14px;
  border-radius: 14px !important;
}

#new-content-shell .mantine-SegmentedControl-label {
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1.2;
  text-align: center;
}

#new-content-shell .mantine-SegmentedControl-label > * {
  margin-top: 0;
  margin-bottom: 0;
}

#new-content-shell .sp-editor-topbar-mode .mantine-SegmentedControl-root {
  min-width: 184px;
  background: color-mix(in srgb, var(--bc-panel) 94%, transparent) !important;
  border: 1px solid var(--bc-border) !important;
}

#new-content-shell .sp-editor-topbar-mode .mantine-SegmentedControl-label {
  min-height: 34px;
  padding: 6px 12px;
  font-size: 0.85rem;
  color: var(--bc-text2) !important;
  font-weight: 700;
}

#new-content-shell .sp-editor-topbar-mode .mantine-SegmentedControl-indicator {
  background: var(--bc-accent-soft) !important;
  border: 1px solid color-mix(in srgb, var(--bc-accent) 22%, transparent) !important;
}

#new-content-shell .sp-editor-topbar-mode .mantine-SegmentedControl-control[data-active="true"] .mantine-SegmentedControl-label,
#new-content-shell .sp-editor-topbar-mode [data-segmented-control-control][data-active="true"] .mantine-SegmentedControl-label {
  color: var(--bc-accent) !important;
}

#new-content-shell #builder-shell-body.sp-builder-shell-body--workspace,
#new-content-shell #builder-shell-body.sp-builder-shell-body--question {
  display: flex !important;
  align-items: stretch;
  gap: 0;
  justify-content: center;
  min-height: calc(100vh - 180px);
}

#new-content-shell #workspace-left-panel,
#new-content-shell #workspace-right-panel,
#new-content-shell #builder-preview-shell {
  min-height: 0;
}

#new-content-shell #workspace-left-panel,
#new-content-shell #workspace-right-panel {
  display: flex;
  overflow: auto;
  background: color-mix(in srgb, var(--bc-panel) 96%, transparent);
  transition: flex-basis 240ms ease, width 240ms ease, max-width 240ms ease, opacity 200ms ease, transform 200ms ease, border-color 200ms ease;
}

#new-content-shell #workspace-left-panel {
  border-right: 1px solid var(--bc-border);
  resize: horizontal;
}

#new-content-shell #workspace-right-panel {
  border-left: 1px solid var(--bc-border);
  resize: horizontal;
}

#new-content-shell #builder-preview-shell {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: stretch;
  background:
    radial-gradient(circle at top, color-mix(in srgb, var(--bc-accent) 12%, transparent) 0%, transparent 34%),
    linear-gradient(180deg, rgba(18, 22, 28, 0.96), rgba(14, 18, 24, 0.98));
  transition: flex-basis 220ms ease, width 220ms ease, max-width 220ms ease, opacity 220ms ease;
}

#new-content-shell .sp-editor-panel-stack,
#new-content-shell .sp-builder-sidebar-stack {
  width: 100%;
  min-height: 0;
  padding: 16px;
}

#new-content-shell .sp-editor-panel-header {
  padding-bottom: 4px;
  border-bottom: 1px solid color-mix(in srgb, var(--bc-border) 85%, transparent);
}

#new-content-shell .sp-editor-panel-heading {
  gap: 4px !important;
}

#new-content-shell .sp-editor-panel-heading-row {
  gap: 8px !important;
}

#new-content-shell .sp-editor-panel-heading-icon {
  background: color-mix(in srgb, var(--bc-accent) 16%, transparent) !important;
  border: 1px solid color-mix(in srgb, var(--bc-accent) 20%, transparent) !important;
  color: var(--bc-accent) !important;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--bc-accent) 8%, transparent);
}

#new-content-shell .sp-editor-panel-heading-title {
  font-size: 0.98rem !important;
  font-weight: 800 !important;
  letter-spacing: 0.01em;
  color: var(--bc-text) !important;
}

#new-content-shell .sp-editor-panel-heading-copy {
  padding-left: 34px;
}

#new-content-shell .sp-editor-panel-scroll {
  min-height: 0;
  overflow: auto;
  padding-right: 2px;
}

#new-content-shell .sp-workspace-section-layout-panel {
  width: 100%;
  flex: 0 0 auto;
  overflow: hidden;
  border-color: color-mix(in srgb, var(--bc-border) 88%, transparent) !important;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--bc-raised) 94%, transparent), color-mix(in srgb, var(--bc-panel) 98%, transparent)) !important;
  box-shadow: none !important;
}

#new-content-shell .sp-workspace-section-layout-shell {
  padding: 10px;
  gap: 8px !important;
}

#new-content-shell .sp-workspace-section-layout-title {
  padding: 0 2px 2px;
}

#new-content-shell .sp-workspace-layer-panel {
  max-height: min(42vh, 360px);
  overflow: auto;
  padding-right: 2px;
}

#new-content-shell #workspace-left-panel .sp-builder-step-card,
#new-content-shell #workspace-right-panel .sp-builder-step-card,
#new-content-shell #workspace-left-panel #filter-card,
#new-content-shell #builder-preview-shell > #preview-empty-state,
#new-content-shell #builder-preview-shell > #preview-wrapper {
  width: 100%;
}

#new-content-shell .sp-builder-preview-stack {
  width: 100%;
  min-height: 0;
  max-width: none;
  margin: 0 auto;
  gap: 10px !important;
}

#new-content-shell #figure-card {
  width: 100%;
  padding: 0 !important;
}

#new-content-shell .sp-preview-canvas-selection {
  position: absolute;
  inset: 10px;
  border: 2px solid color-mix(in srgb, var(--bc-accent) 70%, #ffffff 30%);
  border-radius: 20px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  pointer-events: none;
}

#new-content-shell .sp-setup-db-load-footer {
  padding-top: 10px;
  border-top: 1px solid color-mix(in srgb, var(--bc-border) 84%, transparent);
}

#new-content-shell .sp-setup-db-load-footer .sp-setup-support-copy {
  max-width: 36ch;
  flex: 1 1 220px;
}

#new-content-shell #builder-preview-shell #dataset-step-wrapper .sp-setup-db-load-footer .sp-setup-load-button {
  min-width: 184px !important;
  height: 40px !important;
  border-radius: 12px !important;
}

#new-content-shell #workspace-left-panel .sp-editor-panel-header,
#new-content-shell #workspace-right-panel .sp-editor-panel-header {
  padding-bottom: 8px;
}

#new-content-shell #workspace-right-panel .sp-editor-panel-header {
  display: none !important;
}

#new-content-shell #workspace-left-panel .sp-editor-panel-heading-copy,
#new-content-shell #workspace-right-panel .sp-editor-panel-heading-copy {
  padding-left: 0;
  max-width: 34ch;
  line-height: 1.42;
}

#new-content-shell #workspace-left-panel .sp-builder-step-card {
  padding: 14px !important;
}

#new-content-shell #workspace-left-panel .sp-builder-step-card > .mantine-Stack-root {
  gap: 12px !important;
}

#new-content-shell #workspace-left-panel .sp-setup-database-stage,
#new-content-shell #workspace-left-panel .sp-setup-data-panel {
  gap: 10px !important;
}

#new-content-shell #workspace-left-panel .sp-question-library-status {
  font-size: 0.75rem !important;
}

#new-content-shell #workspace-left-panel .sp-workspace-dataset-summary {
  border-radius: 14px !important;
  padding: 10px 12px !important;
  background: color-mix(in srgb, var(--bc-panel) 88%, transparent) !important;
}

#new-content-shell #workspace-left-panel .sp-setup-profile-actions {
  gap: 8px !important;
}

#new-content-shell #workspace-left-panel .sp-setup-profile-actions .mantine-Button-root {
  flex: 1 1 160px;
  min-height: 38px;
}

#new-content-shell #workspace-left-panel .sp-setup-load-button {
  min-width: 184px !important;
  height: 40px !important;
  border-radius: 12px !important;
}

#new-content-shell #workspace-right-panel #visual-type-step-wrapper .sp-builder-step-card {
  padding: 12px !important;
}

#new-content-shell #workspace-right-panel #visual-type-step-wrapper .sp-setup-stage-description,
#new-content-shell #workspace-right-panel #visual-type-step-wrapper .sp-setup-stage-helper {
  display: none !important;
}

#new-content-shell #workspace-right-panel #visual-type-step-wrapper .sp-setup-choice-control--visual .mantine-SegmentedControl-label {
  min-height: 34px !important;
}

#new-content-shell #guided-creator-panel .sp-basics-row {
  min-height: 30px;
}

#new-content-shell #data-preview-wrapper {
  max-width: 980px !important;
  border-radius: 22px !important;
  border: 1px solid color-mix(in srgb, var(--bc-border) 88%, transparent) !important;
  background:
    radial-gradient(circle at top, color-mix(in srgb, var(--bc-accent) 8%, transparent) 0%, transparent 32%),
    color-mix(in srgb, var(--bc-raised) 94%, transparent) !important;
  box-shadow: none !important;
}

#new-content-shell #data-preview-wrapper .mantine-Alert-root {
  margin: 0;
}

#new-content-shell #data-preview-wrapper .dash-table-container {
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--bc-border) 88%, transparent);
}

#new-content-shell #data-preview-wrapper .dash-spreadsheet-container .dash-spreadsheet-inner table {
  background: color-mix(in srgb, var(--bc-panel) 94%, transparent);
}

#new-content-shell #figure-card,
#new-content-shell #filter-card {
  width: 100%;
  max-width: 920px;
  margin-left: auto;
  margin-right: auto;
}

#new-content-shell #preview-wrapper .sp-builder-preview-stack {
  gap: 8px !important;
}

#new-content-shell #preview-surface {
  width: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

#new-content-shell #filter-step-wrapper {
  margin-top: 8px;
}

#new-content-shell #preview-active-profile {
  min-width: 0;
  max-width: 260px;
  padding: 6px 10px;
  border-radius: 14px;
  border: 1px solid color-mix(in srgb, var(--bc-border) 88%, transparent);
  background: color-mix(in srgb, var(--bc-panel) 86%, transparent);
}

#new-content-shell #preview-active-profile .mantine-Text-root:first-child {
  color: var(--bc-text2) !important;
  font-size: 0.7rem !important;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

#new-content-shell #preview-active-profile .mantine-Text-root:last-child {
  color: var(--bc-text) !important;
  line-height: 1.2;
}

#new-content-shell #preview-data-toolbar {
  width: 100%;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr);
  align-items: stretch;
  gap: 6px !important;
  padding-top: 10px;
  border-top: 1px solid color-mix(in srgb, var(--bc-border) 82%, transparent);
}

#new-content-shell #preview-data-toolbar .mantine-MultiSelect-root,
#new-content-shell #preview-data-toolbar .mantine-PillsInput-root,
#new-content-shell #preview-data-toolbar .mantine-InputWrapper-root {
  width: 100%;
}

#new-content-shell #preview-data-toolbar .mantine-Input-input,
#new-content-shell #preview-data-toolbar .mantine-MultiSelect-input,
#new-content-shell #preview-data-toolbar .mantine-PillsInput-input {
  min-height: 34px !important;
  height: 34px !important;
  border-radius: 12px !important;
}

#new-content-shell #preview-data-toolbar .mantine-Button-root {
  min-width: 84px;
  min-height: 32px;
  border-radius: 11px !important;
}

#new-content-shell #filter-collapse {
  width: 100%;
  max-width: var(--sp-preview-stage-max-width, 920px);
  margin: 0 auto;
}

#new-content-shell #filter-card {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  padding: 0 !important;
  box-sizing: border-box;
}

#new-content-shell #filter-card .sp-filter-panel-compact {
  padding: 12px 14px;
  border: 1px solid color-mix(in srgb, var(--bc-border) 88%, transparent);
  border-radius: 18px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--bc-raised) 94%, transparent), color-mix(in srgb, var(--bc-panel) 98%, transparent));
}

#new-content-shell #filter-card .sp-filter-inline-block {
  gap: 8px !important;
}

#new-content-shell #filter-card .sp-filter-compact-axis-grid {
  gap: 12px !important;
}

#new-content-shell #filter-card .sp-filter-pair-grid--compact {
  gap: 10px !important;
}

@media (max-width: 1180px) {
  #new-content-shell #builder-shell-body.sp-builder-shell-body--workspace,
  #new-content-shell #builder-shell-body.sp-builder-shell-body--question {
    flex-direction: column;
  }

  #new-content-shell #workspace-left-panel {
    order: 0 !important;
  }

  #new-content-shell #builder-preview-shell {
    order: 1 !important;
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    padding: 14px 16px 20px;
  }

  #new-content-shell #workspace-right-panel {
    order: 2 !important;
  }

  #new-content-shell #workspace-left-panel,
  #new-content-shell #workspace-right-panel {
    flex: 0 0 auto !important;
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    resize: none;
    border-left: 0;
    border-right: 0;
    border-bottom: 1px solid var(--bc-border);
  }

  #new-content-shell #workspace-right-panel {
    border-top: 1px solid var(--bc-border);
    border-bottom: 0;
  }

}

#new-content-shell #workspace-left-panel {
  flex: 0 0 360px;
  width: 360px;
  min-width: 320px;
  max-width: 400px;
}

#new-content-shell #workspace-left-panel .sp-builder-sidebar-stack {
  padding: 18px 18px 22px !important;
  gap: 18px !important;
}

#new-content-shell #workspace-left-panel .sp-editor-panel-header {
  padding-bottom: 0;
  border-bottom: 0;
}

#new-content-shell #workspace-left-panel .sp-editor-panel-heading-copy {
  max-width: 28ch;
  color: color-mix(in srgb, var(--bc-text2) 92%, #cbd5e1 8%) !important;
}

#new-content-shell #workspace-left-panel .sp-setup-flow {
  gap: 18px;
}

#new-content-shell #workspace-left-panel .sp-builder-step-card--source,
#new-content-shell #workspace-left-panel .sp-builder-step-card--mode {
  padding: 0 !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}

#new-content-shell #workspace-left-panel .sp-builder-step-card--source > .mantine-Stack-root,
#new-content-shell #workspace-left-panel .sp-builder-step-card--mode > .mantine-Stack-root {
  gap: 10px !important;
}

#new-content-shell #workspace-left-panel .sp-builder-step-card--source .sp-setup-stage-header,
#new-content-shell #workspace-left-panel .sp-builder-step-card--mode .sp-setup-stage-header {
  gap: 6px !important;
  padding-bottom: 10px;
  border-bottom: 1px solid color-mix(in srgb, var(--bc-border) 76%, transparent);
}

#new-content-shell #workspace-left-panel .sp-builder-step-card--source .sp-setup-stage-description {
  display: none !important;
}

#new-content-shell #workspace-left-panel .sp-builder-step-card--source .sp-setup-choice-control,
#new-content-shell #workspace-left-panel .sp-builder-step-card--mode .sp-setup-choice-control {
  padding: 4px !important;
  border-radius: 16px !important;
  background: color-mix(in srgb, var(--bc-panel) 76%, transparent) !important;
  border: 1px solid color-mix(in srgb, var(--bc-border) 82%, transparent) !important;
}

#new-content-shell #workspace-left-panel .sp-builder-step-card--source .mantine-SegmentedControl-label,
#new-content-shell #workspace-left-panel .sp-builder-step-card--mode .mantine-SegmentedControl-label {
  min-height: 42px !important;
  justify-content: flex-start;
  text-align: left;
}

#new-content-shell #workspace-left-panel .sp-builder-step-card--source .sp-setup-choice-copy,
#new-content-shell #workspace-left-panel .sp-builder-step-card--mode .sp-setup-choice-copy {
  align-items: flex-start;
}

#new-content-shell #workspace-left-panel .sp-builder-step-card--source .sp-setup-choice-caption {
  display: none !important;
}

#new-content-shell #workspace-left-panel .sp-setup-stage-helper {
  display: none !important;
}

#new-content-shell #builder-preview-shell #data-preview-wrapper {
  border-radius: 20px !important;
}

@media (max-width: 1440px) {
  #new-content-shell #workspace-left-panel {
    flex: 0 0 340px;
    width: 340px;
    min-width: 300px;
  }

}

@media (min-width: 1181px) {
  #new-content-shell {
    --sp-workspace-side-panel-height: 100dvh;
    --sp-workspace-side-panel-left: 0px;
    --sp-workspace-side-panel-top: 0px;
    --sp-workspace-side-panel-width: 0px;
  }

  #new-content-shell #builder-shell-body.sp-builder-shell-body--workspace {
    padding-left: var(--sp-workspace-side-panel-width);
  }

  #new-content-shell .sp-builder-shell-frame:has(#builder-shell-body.sp-builder-shell-body--workspace) {
    overflow: visible;
  }

  #new-content-shell #builder-shell-body.sp-builder-shell-body--workspace #workspace-left-panel,
  #new-content-shell #builder-shell-body.sp-builder-shell-body--workspace #workspace-right-panel {
    display: block;
    box-sizing: border-box;
    height: var(--sp-workspace-side-panel-height);
    max-height: var(--sp-workspace-side-panel-height);
    left: var(--sp-workspace-side-panel-left);
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    position: fixed;
    top: var(--sp-workspace-side-panel-top);
    z-index: 40;
    scrollbar-gutter: stable;
  }

  #new-content-shell #builder-shell-body.sp-builder-shell-body--workspace #workspace-left-panel .sp-builder-sidebar-stack,
  #new-content-shell #builder-shell-body.sp-builder-shell-body--workspace #workspace-right-panel .sp-builder-sidebar-stack,
  #new-content-shell #builder-shell-body.sp-builder-shell-body--workspace #workspace-left-panel .sp-setup-flow,
  #new-content-shell #builder-shell-body.sp-builder-shell-body--workspace #workspace-right-panel .sp-setup-flow {
    flex: 0 0 auto !important;
    min-height: auto !important;
  }

  #new-content-shell #builder-shell-body.sp-builder-shell-body--workspace #workspace-left-panel .sp-editor-panel-scroll,
  #new-content-shell #builder-shell-body.sp-builder-shell-body--workspace #workspace-right-panel .sp-editor-panel-scroll {
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
  }

}

@media (max-width: 1180px) {
  #new-content-shell #workspace-left-panel,
  #new-content-shell #workspace-right-panel {
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
  }

  #new-content-shell .sp-editor-topbar-actions {
    width: 100%;
    margin-left: 0;
    flex-wrap: wrap !important;
  }

}

#new-content-shell .sp-builder-shell-topbar {
  padding: 4px 18px !important;
  min-height: 42px;
}

#new-content-shell .sp-builder-shell-topbar-inner {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  column-gap: 28px;
  row-gap: 8px;
  flex-wrap: nowrap !important;
  min-height: 34px;
}

#new-content-shell .sp-builder-shell-topbar-primary {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 32px;
}

#new-content-shell .sp-builder-shell-heading-inline {
  flex: 0 0 auto;
  min-width: 0;
  gap: 10px !important;
  min-height: 30px;
}

#new-content-shell .sp-editor-topbar-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 7px;
  flex: 0 0 auto;
  justify-content: flex-end;
  min-width: 0;
  flex-wrap: nowrap !important;
}

#new-content-shell .sp-editor-topbar-export.mantine-Button-root {
  height: 30px !important;
  min-height: 30px !important;
  padding-inline: 10px !important;
  border-radius: 10px !important;
  font-size: 0.76rem !important;
}

/* Starting-preset trigger: keep it a compact 30px icon button in line with the
   Save/Export controls. Without this it renders at the Mantine "lg" default
   (~42px), which on narrower viewports tips the actions row into a second line. */
#new-content-shell .sp-editor-topbar-actions .sp-preview-preset-trigger.mantine-ActionIcon-root {
  width: 30px !important;
  min-width: 30px !important;
  height: 30px !important;
  min-height: 30px !important;
  border-radius: 10px !important;
  flex: 0 0 auto;
  /* Tonal secondary of the same accent the Save/Export CTAs use: soft accent fill +
     accent-tinted border so this sits between them as one quiet member of the action
     group, instead of a flat dark block that reads as a different color family. */
  background: color-mix(in srgb, var(--bc-accent) 14%, transparent) !important;
  border: 1px solid color-mix(in srgb, var(--bc-accent) 40%, transparent) !important;
  color: var(--bc-accent) !important;
}

#new-content-shell .sp-editor-topbar-actions .sp-preview-preset-trigger.mantine-ActionIcon-root:hover {
  background: color-mix(in srgb, var(--bc-accent) 24%, transparent) !important;
  border-color: color-mix(in srgb, var(--bc-accent) 60%, transparent) !important;
  color: var(--bc-accent) !important;
}

#new-content-shell .sp-editor-topbar-actions .sp-preview-preset-trigger .iconify,
#new-content-shell .sp-editor-topbar-actions .sp-preview-preset-trigger svg {
  width: 16px !important;
  height: 16px !important;
  color: var(--bc-accent) !important;
}

#new-content-shell #workspace-left-panel .sp-builder-sidebar-stack {
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

#new-content-shell #workspace-left-panel .sp-setup-flow {
  flex: 1 1 auto;
  min-height: 0;
}

#new-content-shell #builder-preview-shell {
  flex: 1 1 auto !important;
  width: auto !important;
  max-width: none !important;
  min-width: 0 !important;
  padding: 8px 28px 30px;
}

#new-content-shell #builder-preview-shell > #dataset-step-wrapper,
#new-content-shell #builder-preview-shell > #data-preview-wrapper {
  width: 100% !important;
  max-width: none !important;
  margin: 0 0 16px 0 !important;
}

#new-content-shell #builder-preview-shell #dataset-step-wrapper .sp-builder-step-card,
#new-content-shell #builder-preview-shell #data-preview-wrapper {
  width: 100% !important;
}

#new-content-shell #builder-preview-shell #data-preview-wrapper {
  max-width: none !important;
}

#new-content-shell #builder-preview-shell #dataset-step-wrapper .sp-builder-step-card--data-intake {
  padding: 22px 24px 24px !important;
  border-radius: 20px !important;
}

#new-content-shell #builder-preview-shell #dataset-step-wrapper .sp-builder-step-card--data-intake > .mantine-Stack-root {
  gap: 14px !important;
}

#new-content-shell #builder-preview-shell #dataset-step-wrapper .sp-setup-intake-mode {
  padding: 6px;
  border: 1px solid color-mix(in srgb, var(--bc-border) 82%, transparent);
  border-radius: 18px;
  background: color-mix(in srgb, var(--bc-panel) 78%, transparent);
}

#new-content-shell #builder-preview-shell #dataset-step-wrapper .sp-setup-intake-mode .sp-setup-choice-control {
  width: 100%;
}

#new-content-shell #builder-preview-shell #dataset-step-wrapper .sp-setup-intake-mode .mantine-SegmentedControl-root {
  background: transparent !important;
  border: 0 !important;
}

#new-content-shell #builder-preview-shell #dataset-step-wrapper .sp-setup-intake-mode .mantine-SegmentedControl-label {
  min-height: 48px !important;
  padding: 8px 14px !important;
  justify-content: center;
}

#new-content-shell #builder-preview-shell #dataset-step-wrapper .sp-setup-intake-mode .sp-setup-choice-label {
  align-items: center;
  justify-content: center;
}

#new-content-shell #builder-preview-shell #dataset-step-wrapper .sp-setup-intake-mode .sp-setup-choice-icon {
  width: 28px;
  height: 28px;
  flex-basis: 28px;
  border-radius: 10px;
}

#new-content-shell #builder-preview-shell #dataset-step-wrapper .sp-setup-intake-mode .sp-setup-choice-copy {
  min-width: 0;
}

@media (max-width: 1280px) {
  #new-content-shell .sp-builder-shell-topbar-inner {
    gap: 18px;
  }

  #new-content-shell .sp-builder-shell-topbar-primary {
    gap: 18px;
  }

}

@media (max-width: 1180px) {
  #new-content-shell .sp-builder-shell-topbar-inner {
    flex-wrap: wrap !important;
    align-items: flex-start;
  }

  #new-content-shell .sp-builder-shell-topbar-primary,
  #new-content-shell .sp-editor-topbar-actions {
    width: 100%;
  }

  #new-content-shell .sp-editor-topbar-actions {
    margin-left: 0;
    justify-content: space-between;
  }

}

/* Guided creation panel: keeps the default path compact while preserving the full advanced editor below. */
#new-content-shell #guided-creator-panel {
  min-width: 0;
  width: 100%;
}

#new-content-shell .sp-guided-summary-card,
#new-content-shell .sp-guided-card {
  background: color-mix(in srgb, var(--bc-raised) 92%, transparent) !important;
  border: 1px solid color-mix(in srgb, var(--bc-border) 88%, transparent) !important;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.12);
}

#new-content-shell .sp-guided-summary-card {
  position: sticky;
  top: 0;
  z-index: 4;
}

#new-content-shell .sp-guided-card {
  overflow: visible;
}

#new-content-shell .sp-guided-card-badge,
#new-content-shell .sp-guided-summary-badge {
  color: color-mix(in srgb, var(--bc-accent) 76%, #ffffff 24%) !important;
  border: 1px solid color-mix(in srgb, var(--bc-accent) 18%, transparent) !important;
  background: color-mix(in srgb, var(--bc-accent) 11%, transparent) !important;
  max-width: 100%;
}

#new-content-shell .sp-guided-summary {
  min-height: 24px;
}

#new-content-shell .sp-guided-status {
  min-height: 18px;
}

#new-content-shell .sp-guided-switch-grid {
  padding: 8px 0 2px;
}

#new-content-shell #guided-creator-panel #visual-type-card {
  margin-bottom: 0 !important;
  box-shadow: none !important;
  background: color-mix(in srgb, var(--bc-raised) 92%, transparent) !important;
  border-color: color-mix(in srgb, var(--bc-border) 88%, transparent) !important;
}

#new-content-shell #guided-creator-panel .sp-setup-choice-control--visual .mantine-SegmentedControl-label {
  min-height: 58px !important;
  padding: 10px 12px !important;
}

#new-content-shell #guided-creator-panel .sp-setup-choice-control--visual .sp-setup-choice-caption {
  display: none;
}

#new-content-shell #guided-creator-panel .sp-setup-choice-control--visual .sp-setup-choice-label {
  align-items: center;
}

#new-content-shell #guided-creator-panel .sp-setup-choice-control--visual .sp-setup-choice-icon {
  width: 30px;
  height: 30px;
  flex-basis: 30px;
}

#new-content-shell .sp-guided-preset-management,
#new-content-shell .sp-guided-advanced-accordion {
  width: 100%;
}

#new-content-shell .sp-guided-preset-management > .mantine-Accordion-item,
#new-content-shell .sp-guided-advanced-accordion > .mantine-Accordion-item {
  border-radius: 16px !important;
  border: 1px solid color-mix(in srgb, var(--bc-border) 88%, transparent) !important;
  background: color-mix(in srgb, var(--bc-raised) 86%, transparent) !important;
  overflow: hidden;
}

#new-content-shell .sp-guided-preset-management .mantine-Accordion-control,
#new-content-shell .sp-guided-advanced-accordion .mantine-Accordion-control {
  min-height: 48px;
  padding: 12px 14px !important;
}

/* "More settings" is now the always-open main control panel (replaces the
   former collapsible .sp-guided-advanced-accordion). Keep the same flattened
   look for the config card and the layers section inside it. */
#new-content-shell .sp-guided-main-settings {
  width: 100%;
}

#new-content-shell .sp-guided-main-settings #config-card {
  margin-bottom: 0 !important;
  box-shadow: none !important;
}

#new-content-shell .sp-guided-main-settings #workspace-layout-section-accordion {
  margin-bottom: 0;
}

@media (max-width: 720px) {
  #new-content-shell .sp-guided-summary-card {
    position: static;
  }

}

#new-content-shell #builder-preview-shell #dataset-step-wrapper #db-question-summary {
  display: none !important;
}

#new-content-shell #builder-preview-shell #dataset-step-wrapper,
#new-content-shell #builder-preview-shell #dataset-step-wrapper .sp-builder-step-card,
#new-content-shell #builder-preview-shell #dataset-step-wrapper .sp-setup-data-surface,
#new-content-shell #builder-preview-shell #dataset-step-wrapper .sp-setup-database-stage {
  position: relative;
  overflow: visible !important;
}

#new-content-shell #builder-preview-shell #dataset-step-wrapper {
  z-index: 18;
  isolation: isolate;
}

#new-content-shell #builder-preview-shell #data-preview-wrapper {
  position: relative;
  z-index: 1;
}

#new-content-shell #builder-preview-shell #dataset-step-wrapper .sp-setup-database-stage {
  gap: 12px !important;
}

#new-content-shell #builder-preview-shell #dataset-step-wrapper .sp-setup-db-load-footer {
  padding-top: 2px;
  border-top: 0;
  justify-content: flex-start !important;
  align-items: flex-start !important;
  gap: 12px !important;
}

#new-content-shell #builder-preview-shell #dataset-step-wrapper #db-filter-accordion-wrap {
  position: relative;
  flex: 0 0 auto;
  min-width: 0;
  z-index: 42;
}

#new-content-shell #builder-preview-shell #dataset-step-wrapper #db-filter-accordion-wrap .sp-workspace-icon-accordion {
  width: auto !important;
}

#new-content-shell #builder-preview-shell #dataset-step-wrapper #db-filter-accordion-wrap .mantine-Accordion-item {
  border: 0 !important;
  background: transparent !important;
  overflow: visible !important;
}

#new-content-shell #builder-preview-shell #dataset-step-wrapper #db-filter-accordion-wrap .mantine-Accordion-control {
  min-height: 40px;
  padding: 0 14px !important;
  border-radius: 12px !important;
  border: 1px solid var(--bc-border) !important;
  background: color-mix(in srgb, var(--bc-raised) 94%, transparent) !important;
}

#new-content-shell #builder-preview-shell #dataset-step-wrapper #db-filter-accordion-wrap .mantine-Accordion-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 0.86rem !important;
}

#new-content-shell #builder-preview-shell #dataset-step-wrapper #db-filter-accordion-wrap .mantine-Accordion-chevron {
  display: none !important;
}

#new-content-shell #builder-preview-shell #dataset-step-wrapper #db-filter-accordion-wrap .mantine-Accordion-panel {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  width: min(760px, calc(100vw - 220px));
  padding: 0 !important;
  z-index: 60;
}

#new-content-shell #builder-preview-shell #dataset-step-wrapper #db-filter-accordion-wrap .sp-db-prefilter-panel {
  box-shadow: 0 22px 44px rgba(3, 7, 18, 0.22) !important;
}

#new-content-shell #builder-preview-shell #dataset-step-wrapper .sp-setup-load-button {
  min-width: 184px !important;
}

#new-content-shell #data-preview-wrapper #workspace-dataset-summary {
  width: 100%;
}

#new-content-shell #data-preview-wrapper .sp-workspace-dataset-summary {
  margin: 0 0 2px;
}

#new-content-shell #config-card .sp-inspector-subsection-body .mantine-Accordion-chevron { color: var(--bc-text2) !important; }

#new-content-shell #workspace-selection-empty-state .mantine-Text-root:last-child { margin-top: 4px; color: var(--bc-text2) !important; }

#new-content-shell #builder-shell-body,
#new-content-shell #builder-preview-shell,
#new-content-shell #builder-preview-shell .sp-builder-preview-stack {
  overflow: visible !important;
}

#new-content-shell #builder-preview-shell > #dataset-step-wrapper {
  position: relative;
  z-index: 120;
}

#new-content-shell #builder-preview-shell > #data-preview-wrapper {
  z-index: 0 !important;
}

#new-content-shell #builder-preview-shell #dataset-step-wrapper .sp-builder-step-card,
#new-content-shell #builder-preview-shell #dataset-step-wrapper .sp-setup-data-surface,
#new-content-shell #builder-preview-shell #dataset-step-wrapper .sp-setup-database-stage,
#new-content-shell #builder-preview-shell #dataset-step-wrapper #db-filter-accordion-wrap,
#new-content-shell #builder-preview-shell #dataset-step-wrapper #db-filter-accordion-wrap .mantine-Accordion-item,
#new-content-shell #builder-preview-shell #dataset-step-wrapper #db-filter-accordion-wrap .mantine-Accordion-panel {
  overflow: visible !important;
}

#new-content-shell #builder-preview-shell #dataset-step-wrapper #db-filter-accordion-wrap .mantine-Accordion-panel {
  z-index: 240 !important;
}

#new-content-shell #builder-preview-shell #dataset-step-wrapper #db-filter-accordion-wrap .sp-db-prefilter-panel {
  position: relative;
  z-index: 241 !important;
}

@media (max-width: 720px) {
  #new-content-shell .sp-builder-shell-topbar {
    padding: 12px 14px !important;
  }

  #new-content-shell .sp-builder-shell-topbar-inner,
  #new-content-shell .sp-builder-shell-topbar-primary {
    width: 100% !important;
    flex-wrap: wrap !important;
    align-items: flex-start !important;
    gap: 10px !important;
  }

  #new-content-shell .sp-builder-shell-heading-inline {
    width: 100% !important;
    min-width: 0 !important;
  }

  #new-content-shell #workspace-left-panel,
  #new-content-shell #workspace-right-panel,
  #new-content-shell #builder-preview-shell {
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
  }

  #new-content-shell #builder-preview-shell {
    padding: 14px 12px 80px !important;
  }

  #new-content-shell #builder-preview-shell #dataset-step-wrapper .sp-setup-intake-mode {
    padding: 4px;
  }

  #new-content-shell #builder-preview-shell #dataset-step-wrapper .sp-setup-intake-mode .mantine-SegmentedControl-label {
    min-height: 42px !important;
    padding: 6px 4px !important;
  }

  #new-content-shell #builder-preview-shell #dataset-step-wrapper .sp-setup-intake-mode .sp-setup-choice-label {
    gap: 0 !important;
  }

  #new-content-shell #builder-preview-shell #dataset-step-wrapper .sp-setup-intake-mode .sp-setup-choice-icon {
    display: none !important;
  }

  #new-content-shell #builder-preview-shell #dataset-step-wrapper .sp-setup-intake-mode .sp-setup-choice-title {
    font-size: 0.76rem !important;
    white-space: nowrap;
  }

  #new-content-shell .sp-setup-choice-control--data,
  #new-content-shell .sp-setup-choice-control--source {
    width: 100% !important;
    overflow: hidden !important;
  }

  #new-content-shell .sp-setup-choice-control--data .mantine-SegmentedControl-root,
  #new-content-shell .sp-setup-choice-control--source .mantine-SegmentedControl-root {
    width: 100% !important;
  }

  #new-content-shell .sp-setup-choice-control--data .mantine-SegmentedControl-label,
  #new-content-shell .sp-setup-choice-control--source .mantine-SegmentedControl-label {
    min-height: 46px !important;
    padding: 6px 8px !important;
  }

  #new-content-shell .sp-setup-choice-control--data .sp-setup-choice-caption,
  #new-content-shell .sp-setup-choice-control--source .sp-setup-choice-caption {
    display: none !important;
  }

  #new-content-shell .sp-setup-choice-control--data .sp-setup-choice-copy,
  #new-content-shell .sp-setup-choice-control--source .sp-setup-choice-copy {
    gap: 0 !important;
  }

  #new-content-shell .sp-setup-choice-control--data .sp-setup-choice-title,
  #new-content-shell .sp-setup-choice-control--source .sp-setup-choice-title {
    font-size: 0.85rem !important;
    line-height: 1.15 !important;
  }

  #new-content-shell .sp-setup-choice-control--data .sp-setup-choice-icon,
  #new-content-shell .sp-setup-choice-control--source .sp-setup-choice-icon {
    width: 22px;
    height: 22px;
    flex-basis: 22px;
    border-radius: 7px;
  }

  #new-content-shell #preview-controls {
    max-width: none !important;
    padding: 0 !important;
    border-radius: 0 !important;
    gap: 8px !important;
  }

  #new-content-shell .sp-preview-primary-panel,
  #new-content-shell .sp-preview-action-panel {
    padding: 8px 10px !important;
    border-radius: 15px !important;
  }

  #new-content-shell #preview-edit-row {
    flex-wrap: wrap !important;
    align-items: stretch !important;
    gap: 8px !important;
  }

  #new-content-shell #preview-edit-row > * {
    min-width: 0 !important;
  }

  #new-content-shell .sp-preview-controls-toolbar {
    width: 100% !important;
    margin-left: 0 !important;
    justify-content: flex-start !important;
    gap: 8px !important;
  }

  #new-content-shell #preview-active-profile {
    width: 100% !important;
    max-width: none !important;
    padding: 8px 10px !important;
  }

  #new-content-shell #preview-data-toolbar {
    padding-top: 0 !important;
    gap: 8px !important;
    align-items: stretch !important;
  }

  #new-content-shell #preview-data-toolbar > .mantine-Group-root:last-child {
    width: 100% !important;
    justify-content: space-between !important;
    gap: 8px !important;
  }

  #new-content-shell .sp-preview-secondary-actions {
    margin-left: 0 !important;
  }

  #new-content-shell #preview-data-toolbar .mantine-Button-root {
    min-width: 0 !important;
    flex: 1 1 0 !important;
  }

  #new-content-shell #preview-wrapper .sp-builder-preview-stack {
    gap: 8px !important;
  }

}

@media (max-width: 520px) {
  #new-content-shell .sp-builder-shell-topbar {
    padding: 10px 12px !important;
  }

  #new-content-shell .sp-editor-topbar-export.mantine-Button-root {
    min-width: 96px !important;
    padding-inline: 12px !important;
  }

}

#new-content-shell #config-card {
  padding: 10px !important;
}

#new-content-shell #config-card > .mantine-Stack-root:first-child .mantine-Text-root:last-child {
  margin-top: 4px;
}

#new-content-shell #config-card .sp-config-root-tabs {
  gap: 0;
  width: 100%;
}

#new-content-shell #config-card .sp-config-root-tabs-list {
  display: grid !important;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
  padding: 0 !important;
  margin: 0 0 8px !important;
  background: transparent !important;
  border: 0 !important;
}

#new-content-shell #config-card .sp-config-root-tabs .mantine-Tabs-tab {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  width: 100% !important;
  min-width: 0 !important;
  height: 46px;
  padding: 0 !important;
  border-radius: 12px !important;
}

#new-content-shell #config-card .sp-config-root-tabs .mantine-Tabs-panel {
  padding-top: 0 !important;
}

#new-content-shell #config-card .sp-config-root-panel-surface {
  border-radius: 16px !important;
}

/* R3 round 2: tabs carry labels now — the icon span no longer fills the tab
   (that icon-only-era sizing shoved the new labels outside the pill). */
#new-content-shell #config-card .sp-config-root-tab-icon {
  width: auto;
  height: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

#new-content-shell #config-card .sp-config-root-tab-icon > * {
  width: 16px !important;
  height: 16px !important;
}

#new-content-shell #config-card .sp-inspector-root-panel {
  gap: 10px !important;
}

#new-content-shell #config-card .sp-inspector-subsection {
  padding: 10px 0;
  border-top: 1px solid color-mix(in srgb, var(--bc-border) 76%, transparent);
}

#new-content-shell #config-card .sp-inspector-subsection:first-child {
  border-top: 0;
  padding-top: 2px;
}

#new-content-shell #config-card .sp-inspector-subsection-header {
  margin-bottom: 8px;
}

#new-content-shell #config-card .sp-inspector-subsection-title {
  font-size: 0.75rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

#new-content-shell #config-card .sp-inspector-subsection-actions {
  margin-left: auto;
}

#new-content-shell #config-card .sp-inspector-subsection-body > .mantine-Stack-root,
#new-content-shell #config-card .sp-inspector-subsection-body > .mantine-Box-root > .mantine-Stack-root {
  gap: 10px !important;
}

#new-content-shell #workspace-selection-empty-state {
  padding: 4px 0 2px;
}

#new-content-shell #config-card .mantine-Textarea-input {
  min-height: 82px !important;
}

#new-content-shell #config-card .mantine-SegmentedControl-label {
  min-height: 32px !important;
  padding: 0 10px !important;
  font-size: 0.86rem !important;
}

/* Per-element settings (Title / Subtitle / Source / Frame label) — compact,
   video-editor-style inspector. Field rows inside are turned into label|control
   grids by the shared #section-text-cards-wrap compact rules above; here we make
   the surrounding panel + per-element grouping cards tight and flat. */
#new-content-shell #config-card #section-text-cards-wrap.sp-workspace-section-text-cards {
  padding: 10px 12px 12px !important;
}

#new-content-shell #config-card #section-text-cards-wrap > .mantine-Stack-root {
  gap: 10px !important;
}

#new-content-shell #config-card #section-text-cards-wrap .sp-workspace-element-card {
  background: transparent !important;
  border: 0 !important;
  border-top: 1px solid color-mix(in srgb, var(--bc-border) 70%, transparent) !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  padding: 4px 0 0 !important;
}

#new-content-shell #config-card #section-text-cards-wrap .sp-workspace-element-card:first-of-type {
  border-top: 0 !important;
}

#new-content-shell #config-card #section-text-cards-wrap .sp-workspace-element-card > .mantine-Stack-root {
  gap: 2px !important;
}

#new-content-shell #config-card #section-text-cards-wrap .sp-workspace-element-card-title {
  font-size: 0.72rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  opacity: 0.72;
  padding: 2px 0;
}

#new-content-shell #preview-controls {
  width: 100%;
  max-width: none !important;
}

#new-content-shell #preview-controls {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 0 !important;
  margin: 0 0 8px !important;
  border: 0 !important;
  border-radius: 0;
  background: transparent !important;
  box-shadow: none !important;
  box-sizing: border-box;
}

#new-content-shell #preview-controls { background: transparent !important; border-color: transparent !important; box-shadow: none !important; }

#new-content-shell .sp-builder-preview-toolbar {
  width: 100%;
}

#new-content-shell .sp-preview-primary-panel,
#new-content-shell .sp-preview-action-panel {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid color-mix(in srgb, var(--bc-border) 86%, transparent);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--bc-raised) 94%, transparent), color-mix(in srgb, var(--bc-panel) 98%, transparent));
  box-shadow: none;
}

#new-content-shell .sp-preview-primary-panel {
  padding: 14px 16px;
  border-radius: 20px;
  container-type: inline-size;
}

#new-content-shell .sp-preview-action-panel {
  max-width: var(--sp-preview-stage-max-width, 920px);
  margin: 0 auto;
  padding: 8px 10px;
  border-radius: 15px;
}

#new-content-shell #preview-edit-row {
  width: 100%;
  min-height: 34px;
  padding: 0;
  margin-bottom: 0 !important;
  flex-wrap: wrap !important;
  gap: 10px !important;
}

#new-content-shell .sp-preview-controls-toolbar {
  flex: 1 1 360px;
  flex-wrap: wrap !important;
  justify-content: flex-end;
  margin-left: auto;
  min-width: 0;
  max-width: 100%;
  gap: 12px !important;
}

#new-content-shell #preview-data-toolbar {
  padding-top: 0 !important;
  border-top: 0 !important;
}

#new-content-shell .sp-preview-visible-data {
  width: 100%;
  flex: none !important;
  min-width: 0;
}

#new-content-shell .sp-preview-secondary-actions {
  width: 100%;
  flex: none !important;
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start;
  gap: 6px !important;
  margin-left: 0;
}

#new-content-shell .sp-preview-secondary-actions .mantine-ActionIcon-root {
  width: 34px !important;
  min-width: 34px !important;
}

#new-content-shell .sp-preview-secondary-actions #btn-apply-filters {
  min-width: 92px !important;
  padding-left: 12px !important;
  padding-right: 12px !important;
  font-size: 0.82rem !important;
}

#new-content-shell .sp-preview-secondary-actions #data-stats-banner {
  height: 34px;
  display: none !important;
  align-items: center;
  white-space: nowrap;
  margin-left: 4px;
}

#new-content-shell #playback-row {
  justify-content: flex-end;
  margin-top: 6px !important;
  position: relative;
}

#new-content-shell #preview-controls .mantine-Switch-root {
  margin: 0;
}

#new-content-shell #preview-controls .mantine-Switch-body {
  margin-right: 8px;
}

#new-content-shell #preview-edit-row {
  align-items: center !important;
  justify-content: flex-start !important;
}

#new-content-shell .sp-preview-motion-controls {
  flex: 0 1 auto;
  min-width: 0;
}

#new-content-shell .sp-preview-controls-toolbar {
  align-self: flex-end;
  gap: 8px !important;
}

#new-content-shell #preview-format-mode.sp-editor-topbar-mode {
  min-width: 156px !important;
}

#new-content-shell #preview-active-profile {
  display: none !important;
}

#new-content-shell #config-card .sp-step4-field-card:has(#display-target-legacy),
#new-content-shell #config-card .sp-step4-field-card:has(#layout-output-preset),
#new-content-shell #config-card .sp-step4-field-card:has(#layout-canvas-width),
#new-content-shell #config-card .sp-step4-field-card:has(#layout-canvas-height) {
  display: none !important;
}

#new-content-shell .sp-preview-primary-panel {
  padding: 9px 12px !important;
  border-radius: 16px !important;
}

#new-content-shell .sp-preview-primary-panel .mantine-SegmentedControl-root,
#new-content-shell #save-card .sp-export-fps-control.mantine-SegmentedControl-root {
  min-height: 34px !important;
  padding: 3px !important;
  border-radius: 12px !important;
  background: color-mix(in srgb, var(--bc-raised) 82%, transparent) !important;
  border: 1px solid color-mix(in srgb, var(--bc-border) 92%, transparent) !important;
}

#new-content-shell .sp-preview-primary-panel .mantine-SegmentedControl-indicator,
#new-content-shell #save-card .sp-export-fps-control .mantine-SegmentedControl-indicator {
  border-radius: 9px !important;
  background: color-mix(in srgb, var(--bc-accent) 18%, var(--bc-panel) 82%) !important;
  border: 1px solid color-mix(in srgb, var(--bc-accent) 28%, transparent) !important;
  box-shadow: none !important;
}

#new-content-shell .sp-preview-primary-panel .mantine-SegmentedControl-label,
#new-content-shell #save-card .sp-export-fps-control .mantine-SegmentedControl-label {
  min-height: 28px !important;
  padding: 0 9px !important;
  color: var(--bc-text2) !important;
  font-size: 0.76rem !important;
  font-weight: 700 !important;
  line-height: 1 !important;
}

#new-content-shell .sp-preview-mode-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  color: currentColor;
}

#new-content-shell .sp-preview-primary-panel .mantine-SegmentedControl-control[data-active="true"] .mantine-SegmentedControl-label,
#new-content-shell .sp-preview-primary-panel [data-segmented-control-control][data-active="true"] .mantine-SegmentedControl-label,
#new-content-shell #save-card .sp-export-fps-control .mantine-SegmentedControl-control[data-active="true"] .mantine-SegmentedControl-label,
#new-content-shell #save-card .sp-export-fps-control [data-segmented-control-control][data-active="true"] .mantine-SegmentedControl-label {
  color: var(--bc-accent) !important;
}

#new-content-shell .sp-preview-duration-shell {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 0 7px 0 9px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--bc-raised) 82%, transparent);
  border: 1px solid color-mix(in srgb, var(--bc-border) 92%, transparent);
}

#new-content-shell .sp-preview-aspect-shell {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 0 6px 0 9px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--bc-raised) 82%, transparent);
  border: 1px solid color-mix(in srgb, var(--bc-border) 92%, transparent);
}

#new-content-shell .sp-preview-grid-shell {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 0 7px 0 9px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--bc-raised) 82%, transparent);
  border: 1px solid color-mix(in srgb, var(--bc-border) 92%, transparent);
}

#new-content-shell .sp-preview-grid-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  color: var(--bc-text2);
}

#new-content-shell .sp-preview-grid-step {
  flex: 0 0 auto;
}

#new-content-shell .sp-preview-duration-label,
#new-content-shell .sp-preview-duration-unit {
  color: var(--bc-text2) !important;
  font-size: 0.76rem !important;
  font-weight: 700 !important;
  line-height: 1 !important;
}

#new-content-shell .sp-preview-duration-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  color: var(--bc-text2);
}

#new-content-shell .sp-preview-aspect-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  color: var(--bc-text2);
}

#new-content-shell .sp-preview-duration-control {
  width: 64px !important;
}

#new-content-shell .sp-preview-duration-control .mantine-Input-wrapper {
  width: 64px !important;
}

#new-content-shell .sp-preview-aspect-control {
  width: 94px !important;
}

#new-content-shell .sp-preview-aspect-control .mantine-Input-wrapper {
  width: 94px !important;
}

#new-content-shell .sp-preview-aspect-control .mantine-Select-input,
#new-content-shell .sp-preview-aspect-control .mantine-Input-input {
  min-height: 30px !important;
  height: 30px !important;
  border-radius: 0 !important;
  background: transparent !important;
  border: 0 !important;
  color: var(--bc-text) !important;
  font-size: 0.8rem !important;
  font-weight: 800 !important;
  padding-left: 0 !important;
  padding-right: 18px !important;
}

#new-content-shell .sp-preview-aspect-control .mantine-Input-section {
  color: var(--bc-text2) !important;
}

#new-content-shell .sp-export-fps-shell {
  display: grid;
  gap: 3px;
  flex: 0 0 auto;
  min-width: 0;
}

#new-content-shell #save-card .sp-export-settings-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  width: 100%;
}

/* UX 3.3 (decision D-15, 2026-09-14): the export drawer's default section (quality ·
   size note · Export) and the collapsed "Advanced" accordion around the rest of the
   card. Presentation only — the components inside keep their ids, values and props. */
#new-content-shell #save-card .sp-export-default {
  gap: 10px;
  margin-top: 10px;
}

#new-content-shell #save-card .sp-export-default #btn-export-video {
  width: 100%;
  margin-top: 2px;
}

#new-content-shell #save-card .sp-export-advanced {
  margin-top: 14px;
}

#new-content-shell #save-card .sp-export-advanced .mantine-Accordion-item {
  background: transparent;
  border-color: var(--bc-border);
}

#new-content-shell #save-card .sp-export-advanced .mantine-Accordion-control {
  padding: 10px 12px;
}

#new-content-shell #save-card .sp-export-advanced .mantine-Accordion-content {
  padding: 4px 12px 12px;
}

#new-content-shell #save-card .sp-export-radio-group {
  min-width: 0;
}

#new-content-shell #save-card .sp-export-radio-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 14px;
  margin-top: 6px;
}

#new-content-shell #save-card .sp-export-radio-group--execution .mantine-Group-root {
  margin-top: 6px;
}

#new-content-shell #save-card .sp-export-capture-control,
#new-content-shell #save-card .sp-export-capture-control .mantine-SegmentedControl-root,
#new-content-shell #save-card .sp-export-encoder-control,
#new-content-shell #save-card .sp-export-encoder-control .mantine-SegmentedControl-root,
#new-content-shell #save-card .sp-export-worker-control,
#new-content-shell #save-card .sp-export-worker-control .mantine-SegmentedControl-root,
#new-content-shell #save-card .sp-export-frame-update-control,
#new-content-shell #save-card .sp-export-frame-update-control .mantine-SegmentedControl-root,
#new-content-shell #save-card .sp-export-page-recycle-control,
#new-content-shell #save-card .sp-export-page-recycle-control .mantine-SegmentedControl-root {
  width: 100%;
}

#new-content-shell #save-card .mantine-Radio-root {
  min-width: 0;
}

#new-content-shell #save-card .mantine-Radio-label {
  color: var(--bc-text) !important;
  font-size: 0.86rem !important;
  font-weight: 700 !important;
  line-height: 1.2 !important;
}

#new-content-shell #save-card .mantine-Radio-radio {
  background: color-mix(in srgb, var(--bc-raised) 82%, transparent) !important;
  border-color: color-mix(in srgb, var(--bc-border) 92%, transparent) !important;
}

#new-content-shell #save-card .mantine-Radio-radio:checked {
  background: var(--bc-accent) !important;
  border-color: var(--bc-accent) !important;
}

#new-content-shell .sp-export-field-label {
  color: var(--bc-text2);
  font-size: 0.76rem;
  font-weight: 700;
  line-height: 1;
}

#new-content-shell .sp-preview-duration-control .mantine-NumberInput-input,
#new-content-shell .sp-preview-duration-control .mantine-Input-input {
  min-height: 30px !important;
  height: 30px !important;
  border-radius: 0 !important;
  background: transparent !important;
  border: 0 !important;
  color: var(--bc-text) !important;
  font-size: 0.8rem !important;
  font-weight: 800 !important;
  padding: 0 20px 0 0 !important;
  text-align: right !important;
}

#new-content-shell .sp-preview-duration-control .mantine-NumberInput-controls {
  width: 18px !important;
  right: 0 !important;
  border-left: 1px solid color-mix(in srgb, var(--bc-border) 82%, transparent) !important;
}

#new-content-shell .sp-preview-duration-control .mantine-NumberInput-control {
  width: 18px !important;
  min-height: 14px !important;
  height: 14px !important;
  border: 0 !important;
  color: var(--bc-text2) !important;
  background: transparent !important;
}

#new-content-shell .sp-preview-duration-control .mantine-NumberInput-control:hover {
  color: var(--bc-accent) !important;
  background: color-mix(in srgb, var(--bc-accent) 10%, transparent) !important;
}

#new-content-shell .sp-preview-fps-control {
  min-width: 158px;
}

#new-content-shell .sp-preview-fps-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-width: 0;
  white-space: nowrap;
  line-height: 1;
}

#new-content-shell .sp-preview-fps-premium {
  display: inline-flex;
  align-items: center;
  height: 16px;
  padding: 0 6px;
  border-radius: 999px;
  background: linear-gradient(135deg, #f6d365 0%, #fda085 100%);
  color: #18202a;
  font-size: 0.58rem;
  font-weight: 800;
}

#new-content-shell .sp-preview-save-profile.mantine-Button-root {
  height: 34px !important;
  min-height: 34px !important;
  min-width: 78px !important;
  padding: 0 13px !important;
  border-radius: 12px !important;
  /* R3 band 2: the "match the Export CTA blue gradient" paint was retired —
     the Broadcast filled-button rule paints both primary CTAs amber. */
  font-size: 0.78rem !important;
  font-weight: 800 !important;
  letter-spacing: 0 !important;
}

#new-content-shell .sp-preview-save-profile .mantine-Button-section {
  margin-inline-end: 6px !important;
}

@media (max-width: 1100px) {
  #new-content-shell #preview-edit-row {
    flex-wrap: wrap !important;
  }

  #new-content-shell .sp-preview-controls-toolbar {
    justify-content: flex-start;
    width: 100%;
    margin-left: 0;
  }

  #new-content-shell .sp-preview-motion-controls {
    flex: 1 1 100%;
    width: 100%;
  }

}

@media (max-width: 720px) {
  #new-content-shell .sp-preview-motion-controls {
    flex-wrap: wrap !important;
    align-items: center !important;
  }

  #new-content-shell .sp-preview-duration-shell {
    flex: 1 1 128px;
  }

  #new-content-shell .sp-preview-aspect-shell {
    flex: 1 1 188px;
  }

  #new-content-shell .sp-preview-aspect-control,
  #new-content-shell .sp-preview-aspect-control .mantine-Input-wrapper {
    width: 100% !important;
  }

  #new-content-shell #save-card .sp-export-fps-control {
    min-width: 0;
    width: 100%;
  }

  #new-content-shell #save-card .sp-export-fps-shell {
    flex: 1 1 168px;
  }

  #new-content-shell .sp-preview-controls-toolbar {
    flex-wrap: wrap !important;
  }

}

@media (max-width: 720px) {
  #new-content-shell #workspace-left-panel {
    flex: 0 0 auto !important;
    width: 100% !important;
    min-height: 0 !important;
    height: auto !important;
  }

  #new-content-shell #workspace-left-panel .sp-builder-sidebar-stack {
    min-height: auto !important;
    padding: 14px 12px 16px !important;
    gap: 12px !important;
  }

  #new-content-shell #workspace-left-panel .sp-setup-flow {
    flex: 0 0 auto !important;
    min-height: 0 !important;
    gap: 12px !important;
  }

  #new-content-shell .sp-editor-topbar-actions {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto !important;
    align-items: end !important;
    gap: 10px !important;
    width: 100% !important;
    margin-left: 0 !important;
  }

  #new-content-shell .sp-editor-topbar-export.mantine-Button-root {
    grid-column: 2;
    justify-self: end;
    margin-left: 0 !important;
    min-width: 88px !important;
    padding-inline: 12px !important;
  }

  #new-content-shell #workspace-left-panel .sp-builder-step-card--source .mantine-SegmentedControl-label {
    min-height: 44px !important;
    padding: 6px 8px !important;
    justify-content: center !important;
    text-align: center !important;
  }

  #new-content-shell #workspace-left-panel .sp-builder-step-card--source .sp-setup-choice-label {
    justify-content: center !important;
    gap: 8px !important;
  }

  #new-content-shell #workspace-left-panel .sp-builder-step-card--source .sp-setup-choice-copy {
    align-items: center !important;
    gap: 0 !important;
  }

  #new-content-shell #workspace-left-panel .sp-builder-step-card--source .sp-setup-choice-title {
    font-size: 0.84rem !important;
    line-height: 1.15 !important;
    white-space: nowrap !important;
  }

  #new-content-shell #workspace-left-panel .sp-builder-step-card--source .sp-setup-choice-icon {
    width: 18px !important;
    height: 18px !important;
    flex-basis: 18px !important;
  }

  #new-content-shell #preview-controls {
    padding: 0 !important;
  }

  #new-content-shell .sp-preview-primary-panel,
  #new-content-shell .sp-preview-action-panel {
    padding: 10px !important;
  }

  #new-content-shell #preview-data-toolbar {
    flex-direction: column !important;
    justify-content: flex-start !important;
    align-items: stretch !important;
    gap: 6px !important;
    padding-top: 0 !important;
    min-height: 0 !important;
  }

  #new-content-shell #preview-data-toolbar > .mantine-Stack-root:first-child {
    flex: 0 0 auto !important;
    width: 100% !important;
    min-width: 0 !important;
    min-height: 0 !important;
  }

  #new-content-shell #preview-data-toolbar > .mantine-Group-root:last-child {
    width: 100% !important;
    justify-content: flex-start !important;
    align-items: center !important;
    gap: 6px !important;
  }

  #new-content-shell #preview-data-toolbar .mantine-Button-root {
    flex: 0 0 auto !important;
    min-width: 0 !important;
  }

  #new-content-shell #preview-data-toolbar #data-stats-banner {
    display: none !important;
  }

  #new-content-shell .sp-preview-workbench {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
  }

  #new-content-shell #preview-sidecar-card {
    width: 100% !important;
    max-width: none !important;
    min-height: 0 !important;
    height: auto !important;
    flex: 0 0 auto !important;
    align-self: auto !important;
  }

  #new-content-shell #preview-sidecar-card .mantine-Stack-root,
  #new-content-shell .sp-workspace-layer-panel {
    min-height: 0 !important;
    height: auto !important;
  }

}

@media (max-width: 520px) {
  #new-content-shell .sp-editor-topbar-export.mantine-Button-root {
    min-width: 82px !important;
    padding-inline: 10px !important;
  }

}

#new-content-shell .sp-preview-mode-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 0;
  white-space: nowrap;
}

#new-content-shell .sp-preview-mode-label-text {
  line-height: 1;
}

#new-content-shell .sp-preview-action-panel {
  padding: 6px 8px !important;
  border-radius: 14px !important;
  width: min(100%, max(640px, var(--sp-preview-stage-max-width, 920px))) !important;
  max-width: min(100%, max(640px, var(--sp-preview-stage-max-width, 920px))) !important;
  container-type: inline-size;
}

#new-content-shell #preview-data-toolbar.sp-preview-action-grid {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) max-content;
  align-items: center !important;
  gap: 6px !important;
  width: 100%;
}

#new-content-shell #preview-data-toolbar.sp-preview-action-grid > .sp-preview-visible-data {
  width: auto !important;
  min-width: 0 !important;
  flex: none !important;
}

#new-content-shell .sp-preview-visible-data .mantine-MultiSelect-root {
  width: 100%;
}

#new-content-shell .sp-preview-visible-data .mantine-MultiSelect-input {
  min-height: 32px !important;
  height: 32px !important;
  border-radius: 10px !important;
}

#new-content-shell #preview-data-toolbar.sp-preview-action-grid > .sp-preview-secondary-actions {
  width: auto !important;
  flex: none !important;
  justify-content: flex-end !important;
  align-items: center !important;
  flex-wrap: nowrap !important;
  gap: 6px !important;
  padding-top: 0;
  padding-left: 7px;
  border-top: 0;
  border-left: 1px solid color-mix(in srgb, var(--bc-border) 78%, transparent);
}

#new-content-shell .sp-preview-secondary-actions .mantine-ActionIcon-root {
  width: 32px !important;
  min-width: 32px !important;
}

#new-content-shell .sp-preview-secondary-actions #btn-apply-filters {
  min-width: 84px !important;
  padding-inline: 9px !important;
  border-radius: 10px !important;
}

/* Keep the shell header as three predictable zones: page context, preview controls, and status/actions. */
#new-content-shell .sp-builder-shell-topbar-inner {
  display: grid !important;
  grid-template-areas: "primary controls actions";
  grid-template-columns: minmax(220px, max-content) minmax(420px, 1fr) minmax(0, max-content);
  align-items: center !important;
  column-gap: 12px !important;
  row-gap: 8px !important;
  flex-wrap: initial !important;
  min-width: 0;
}

#new-content-shell .sp-builder-shell-topbar-primary {
  grid-area: primary;
  justify-self: start;
  width: auto;
  max-width: 100%;
  min-width: 0;
}

#new-content-shell .sp-builder-shell-topbar #preview-controls {
  grid-area: controls;
  justify-self: center;
  align-self: center;
  width: fit-content !important;
  max-width: 100% !important;
  min-width: 0 !important;
  margin: 0 !important;
}

#new-content-shell .sp-builder-shell-topbar .sp-editor-topbar-actions {
  grid-area: actions;
  justify-self: end;
  display: flex !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  gap: 7px !important;
  width: max-content;
  max-width: 100%;
  min-width: 0;
  margin-left: 0 !important;
}

/* Status pill is the only shrinkable item; the buttons keep their natural size and
   can never be pushed to a second row (flex-wrap:nowrap). */
/* `.sp-tip` is the C1 replacement of the dmc.Tooltip wrapper (a span, not a div) —
   see zz_studio_header.css. `.mantine-Tooltip-root` stays for any tooltip left. */
#new-content-shell .sp-builder-shell-topbar .sp-editor-topbar-actions > .mantine-Tooltip-root,
#new-content-shell .sp-builder-shell-topbar .sp-editor-topbar-actions > .sp-tip,
#new-content-shell .sp-builder-shell-topbar .sp-editor-topbar-actions > .sp-editor-topbar-export,
#new-content-shell .sp-builder-shell-topbar .sp-editor-topbar-actions > div:has(#btn-profile-save-topbar),
#new-content-shell .sp-builder-shell-topbar .sp-editor-topbar-actions > div:has(#preset-modal-trigger) {
  flex: 0 0 auto;
}

#new-content-shell .sp-builder-shell-topbar:has(#preview-controls[style*="display: none"]) #btn-profile-save-topbar {
  display: none !important;
}

#new-content-shell .sp-builder-shell-topbar #preview-controls .sp-preview-primary-panel {
  width: 100% !important;
  max-width: 100% !important;
  container-type: normal !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

#new-content-shell .sp-builder-shell-topbar #preview-edit-row {
  min-height: 30px;
  height: 30px;
  width: fit-content !important;
  max-width: 100% !important;
  flex-wrap: nowrap !important;
  justify-content: center !important;
  align-items: center !important;
  gap: 6px !important;
}

#new-content-shell .sp-builder-shell-topbar #preview-format-mode.sp-editor-topbar-mode {
  min-width: 120px !important;
}

#new-content-shell .sp-builder-shell-topbar #preview-controls .mantine-SegmentedControl-root,
#new-content-shell .sp-builder-shell-topbar .sp-preview-aspect-shell,
#new-content-shell .sp-builder-shell-topbar .sp-preview-grid-shell,
#new-content-shell .sp-builder-shell-topbar .sp-preview-duration-shell {
  background: color-mix(in srgb, var(--bc-raised) 72%, transparent) !important;
  border-color: color-mix(in srgb, var(--bc-border) 82%, transparent) !important;
  box-shadow: none !important;
}

#new-content-shell .sp-builder-shell-topbar .sp-preview-aspect-shell,
#new-content-shell .sp-builder-shell-topbar .sp-preview-grid-shell,
#new-content-shell .sp-builder-shell-topbar .sp-preview-duration-shell {
  min-height: 30px;
  height: 30px;
  gap: 4px;
  padding-inline: 7px 5px;
  border-radius: 9px;
}

#new-content-shell .sp-builder-shell-topbar .sp-preview-aspect-icon,
#new-content-shell .sp-builder-shell-topbar .sp-preview-grid-icon,
#new-content-shell .sp-builder-shell-topbar .sp-preview-duration-icon {
  width: 12px;
  height: 12px;
  flex-basis: 12px;
}

#new-content-shell .sp-builder-shell-topbar .sp-preview-duration-label,
#new-content-shell .sp-builder-shell-topbar .sp-preview-duration-unit {
  font-size: 0.7rem !important;
}

#new-content-shell .sp-builder-shell-topbar .sp-preview-aspect-control,
#new-content-shell .sp-builder-shell-topbar .sp-preview-aspect-control .mantine-Input-wrapper {
  width: 76px !important;
}

#new-content-shell .sp-builder-shell-topbar .sp-preview-duration-control,
#new-content-shell .sp-builder-shell-topbar .sp-preview-duration-control .mantine-Input-wrapper {
  width: 52px !important;
}

#new-content-shell .sp-builder-shell-topbar .sp-preview-grid-step,
#new-content-shell .sp-builder-shell-topbar .sp-preview-grid-step .mantine-Input-wrapper {
  width: 58px !important;
}

#new-content-shell .sp-builder-shell-topbar .sp-preview-aspect-control .mantine-Select-input,
#new-content-shell .sp-builder-shell-topbar .sp-preview-aspect-control .mantine-Input-input,
#new-content-shell .sp-builder-shell-topbar .sp-preview-duration-control .mantine-NumberInput-input,
#new-content-shell .sp-builder-shell-topbar .sp-preview-duration-control .mantine-Input-input,
#new-content-shell .sp-builder-shell-topbar .sp-preview-grid-step .mantine-NumberInput-input,
#new-content-shell .sp-builder-shell-topbar .sp-preview-grid-step .mantine-Input-input {
  min-height: 28px !important;
  height: 28px !important;
  font-size: 0.74rem !important;
}

#new-content-shell .sp-builder-shell-topbar .sp-preview-duration-control .mantine-NumberInput-controls,
#new-content-shell .sp-builder-shell-topbar .sp-preview-grid-step .mantine-NumberInput-controls {
  width: 16px !important;
}

#new-content-shell .sp-builder-shell-topbar .sp-preview-duration-control .mantine-NumberInput-control,
#new-content-shell .sp-builder-shell-topbar .sp-preview-grid-step .mantine-NumberInput-control {
  width: 16px !important;
  min-height: 13px !important;
  height: 13px !important;
}

#new-content-shell .sp-builder-shell-topbar .sp-preview-primary-panel .mantine-SegmentedControl-root {
  min-height: 30px !important;
  height: 30px !important;
  border-radius: 9px !important;
}

#new-content-shell .sp-builder-shell-topbar .sp-preview-primary-panel .mantine-SegmentedControl-label {
  min-height: 24px !important;
  padding-inline: 7px !important;
  font-size: 0.72rem !important;
}

#new-content-shell .sp-builder-shell-topbar .sp-preview-motion-controls {
  flex: 0 0 auto;
  width: auto !important;
  min-width: 0;
}

#new-content-shell .sp-builder-shell-topbar .sp-preview-controls-toolbar {
  flex: 0 1 auto;
  width: auto !important;
  margin-left: 0 !important;
  justify-content: flex-start;
  flex-wrap: nowrap !important;
  gap: 6px !important;
}

#new-content-shell .sp-builder-shell-topbar .sp-preview-save-profile.mantine-Button-root {
  height: 30px !important;
  min-height: 30px !important;
  min-width: 66px !important;
  padding-inline: 10px !important;
  border-radius: 10px !important;
  box-shadow: none !important;
  font-size: 0.76rem !important;
}

#new-content-shell .sp-builder-shell-topbar .sp-editor-topbar-export.mantine-Button-root {
  height: 30px !important;
  min-height: 30px !important;
  min-width: 80px !important;
  padding-inline: 10px !important;
  border-radius: 10px !important;
  font-size: 0.76rem !important;
}

@media (max-width: 1499px) {
  #new-content-shell .sp-builder-shell-topbar-inner {
    grid-template-areas:
      "primary actions"
      "controls controls";
    grid-template-columns: minmax(0, 1fr) minmax(360px, max-content);
    align-items: center !important;
  }

  #new-content-shell .sp-builder-shell-topbar #preview-controls {
    width: 100% !important;
    justify-self: stretch;
  }

  #new-content-shell .sp-builder-shell-topbar #preview-edit-row {
    width: 100% !important;
    justify-content: center !important;
  }

}

@media (max-width: 980px) {
  #new-content-shell .sp-builder-shell-topbar-inner {
    grid-template-areas:
      "primary"
      "controls"
      "actions";
    grid-template-columns: minmax(0, 1fr);
  }

  #new-content-shell .sp-builder-shell-topbar-primary,
  #new-content-shell .sp-builder-shell-topbar .sp-editor-topbar-actions {
    width: 100% !important;
  }

  #new-content-shell .sp-builder-shell-topbar-primary {
    justify-content: flex-start !important;
  }

  #new-content-shell .sp-builder-shell-topbar .sp-editor-topbar-actions {
    grid-template-columns: minmax(0, 1fr) max-content max-content;
    justify-self: stretch;
  }

  #new-content-shell .sp-builder-shell-topbar #preview-edit-row {
    justify-content: flex-start !important;
  }

}

@media (max-width: 860px) {
  #new-content-shell .sp-builder-shell-topbar #preview-edit-row {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    align-items: center !important;
    height: auto !important;
    gap: 6px !important;
  }

  #new-content-shell .sp-builder-shell-topbar #preview-format-mode.sp-editor-topbar-mode,
  #new-content-shell .sp-builder-shell-topbar .sp-preview-motion-controls,
  #new-content-shell .sp-builder-shell-topbar .sp-preview-aspect-shell,
  #new-content-shell .sp-builder-shell-topbar .sp-preview-duration-shell {
    width: 100% !important;
    min-width: 0 !important;
  }

  #new-content-shell .sp-builder-shell-topbar .sp-preview-motion-controls {
    display: flex !important;
  }

  #new-content-shell .sp-builder-shell-topbar .sp-preview-controls-toolbar {
    display: grid !important;
    grid-column: 1 / -1;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    width: 100% !important;
    margin-left: 0 !important;
    justify-content: stretch;
    gap: 6px !important;
  }

}

@media (max-width: 720px) {
  #new-content-shell .sp-builder-shell-topbar {
    padding: 6px 10px !important;
  }

  #new-content-shell .sp-builder-shell-topbar-primary {
    align-items: center !important;
    gap: 7px !important;
  }

  #new-content-shell .sp-builder-shell-heading-inline {
    width: auto !important;
    flex: 1 1 auto;
  }

  #new-content-shell .sp-builder-shell-topbar .sp-editor-topbar-actions {
    grid-template-columns: minmax(0, 1fr) 34px 34px !important;
    gap: 6px !important;
  }

  #new-content-shell .sp-builder-shell-topbar .sp-preview-save-profile.mantine-Button-root,
  #new-content-shell .sp-builder-shell-topbar .sp-editor-topbar-export.mantine-Button-root {
    justify-self: stretch !important;
    width: 34px !important;
    min-width: 34px !important;
    padding-inline: 0 !important;
    justify-content: center;
  }

  #new-content-shell .sp-builder-shell-topbar .sp-editor-topbar-actions > :is(div, .sp-tip):has(#btn-profile-save-topbar) {
    width: 34px !important;
    min-width: 34px !important;
    height: 30px !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
  }

  #new-content-shell .sp-builder-shell-topbar .sp-preview-save-profile .mantine-Button-label,
  #new-content-shell .sp-builder-shell-topbar .sp-editor-topbar-export .mantine-Button-label {
    display: none !important;
  }

  #new-content-shell .sp-builder-shell-topbar .sp-preview-save-profile .mantine-Button-section,
  #new-content-shell .sp-builder-shell-topbar .sp-editor-topbar-export .mantine-Button-section {
    margin: 0 !important;
  }

}

@media (max-width: 520px) {
  #new-content-shell .sp-builder-shell-topbar #preview-edit-row {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  #new-content-shell .sp-builder-shell-topbar .sp-preview-controls-toolbar {
    display: contents !important;
  }

  #new-content-shell .sp-builder-shell-topbar .sp-preview-motion-controls {
    grid-column: 1;
    order: 2;
  }

  #new-content-shell .sp-builder-shell-topbar .sp-preview-duration-shell {
    grid-column: 2;
    order: 2;
  }

  #new-content-shell .sp-builder-shell-topbar #preview-format-mode.sp-editor-topbar-mode {
    grid-column: 1 / -1;
    order: 3;
  }

}

/* Simple mode hides the Pro-only inspector surface (Motion tab, Axes fine-
   tuning, Manual frame, Timed pictures). Gating class is swapped on
   #config-card by its clientside in pages/new_content/page.py — hides only,
   never deletes (controls stay mounted for callback wiring). */
/* --- R3.2 second pass: the compact/parity inspector bands (their
   selectors carry :is(...) lists; inserted BEFORE the R2.2+ bands that
   must keep out-cascading them). --- */

#new-content-shell #config-card :is(.sp-inspector-subsection-body, #workspace-selection-controls-wrap, #section-text-cards-wrap) .sp-inspector-option-title, #new-content-shell #config-card :is(.sp-inspector-subsection-body, #workspace-selection-controls-wrap, #section-text-cards-wrap) .mantine-InputWrapper-label { color: var(--bc-text) !important; }

#new-content-shell #config-card .sp-inspector-subsection-body .sp-layout-foundation-grid,
#new-content-shell #config-card .sp-inspector-subsection-body .sp-layout-margin-grid,
#new-content-shell #config-card :is(.sp-inspector-subsection-body, #workspace-selection-controls-wrap, #section-text-cards-wrap) .sp-layout-section-grid,
#new-content-shell #config-card .sp-inspector-subsection-body .sp-step4-behavior-grid,
#new-content-shell #config-card .sp-inspector-subsection-body .sp-step4-window-grid {
  grid-template-columns: minmax(0, 1fr) !important;
  gap: 6px !important;
  width: 100% !important;
}

#new-content-shell #config-card :is(.sp-inspector-subsection-body, #workspace-selection-controls-wrap, #section-text-cards-wrap) .sp-step4-field-card,
#new-content-shell #config-card :is(.sp-inspector-subsection-body, #workspace-selection-controls-wrap, #section-text-cards-wrap) .sp-inspector-option {
  min-width: 0 !important;
  background: transparent !important;
  border: 0 !important;
  border-bottom: 1px solid color-mix(in srgb, var(--bc-border) 76%, transparent) !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  padding: 8px 0 !important;
}

#new-content-shell #config-card :is(.sp-inspector-subsection-body, #workspace-selection-controls-wrap, #section-text-cards-wrap) .sp-step4-field-card:last-child,
#new-content-shell #config-card :is(.sp-inspector-subsection-body, #workspace-selection-controls-wrap, #section-text-cards-wrap) .sp-inspector-option:last-child {
  border-bottom: 0 !important;
}

#new-content-shell #config-card :is(.sp-inspector-subsection-body, #workspace-selection-controls-wrap, #section-text-cards-wrap) .sp-step4-field-card > .mantine-Stack-root {
  display: grid;
  grid-template-columns: minmax(132px, 168px) minmax(0, 1fr) !important;
  gap: 10px 14px !important;
  align-items: start;
}

#new-content-shell #config-card :is(.sp-inspector-subsection-body, #workspace-selection-controls-wrap, #section-text-cards-wrap) .sp-step4-field-card > .mantine-Stack-root > * {
  min-width: 0 !important;
  max-width: 100% !important;
}

#new-content-shell #config-card :is(.sp-inspector-subsection-body, #workspace-selection-controls-wrap, #section-text-cards-wrap) .sp-inspector-option > .mantine-Group-root {
  gap: 16px !important;
  align-items: center !important;
  flex-wrap: nowrap !important;
}

#new-content-shell #config-card :is(.sp-inspector-subsection-body, #workspace-selection-controls-wrap, #section-text-cards-wrap) .sp-inspector-option-copy {
  gap: 3px !important;
  min-width: 0 !important;
}

#new-content-shell #config-card :is(.sp-inspector-subsection-body, #workspace-selection-controls-wrap, #section-text-cards-wrap) .sp-inspector-option .mantine-Switch-root {
  margin-left: auto;
}

#new-content-shell #config-card :is(.sp-inspector-subsection-body, #workspace-selection-controls-wrap, #section-text-cards-wrap) .sp-inspector-option-title,
#new-content-shell #config-card :is(.sp-inspector-subsection-body, #workspace-selection-controls-wrap, #section-text-cards-wrap) .mantine-InputWrapper-label {
  font-size: 0.92rem !important;
  font-weight: 600 !important;
  line-height: 1.25 !important;
}

#new-content-shell #config-card :is(.sp-inspector-subsection-body, #workspace-selection-controls-wrap, #section-text-cards-wrap) .sp-inspector-option-desc,
#new-content-shell #config-card :is(.sp-inspector-subsection-body, #workspace-selection-controls-wrap, #section-text-cards-wrap) .mantine-InputWrapper-description {
  display: none !important;
}

#new-content-shell #config-card :is(.sp-inspector-subsection-body, #workspace-selection-controls-wrap, #section-text-cards-wrap) .mantine-Textarea-root,
#new-content-shell #config-card :is(.sp-inspector-subsection-body, #workspace-selection-controls-wrap, #section-text-cards-wrap) .mantine-InputWrapper-root,
#new-content-shell #config-card :is(.sp-inspector-subsection-body, #workspace-selection-controls-wrap, #section-text-cards-wrap) .mantine-Select-root,
#new-content-shell #config-card :is(.sp-inspector-subsection-body, #workspace-selection-controls-wrap, #section-text-cards-wrap) .mantine-MultiSelect-root,
#new-content-shell #config-card :is(.sp-inspector-subsection-body, #workspace-selection-controls-wrap, #section-text-cards-wrap) .mantine-NumberInput-root,
#new-content-shell #config-card :is(.sp-inspector-subsection-body, #workspace-selection-controls-wrap, #section-text-cards-wrap) .mantine-ColorInput-root,
#new-content-shell #config-card :is(.sp-inspector-subsection-body, #workspace-selection-controls-wrap, #section-text-cards-wrap) .mantine-SegmentedControl-root {
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
}

#new-content-shell #config-card :is(.sp-inspector-subsection-body, #workspace-selection-controls-wrap, #section-text-cards-wrap) .mantine-SegmentedControl-root {
  max-width: 320px !important;
}

#new-content-shell .sp-preview-secondary-actions :is(.mantine-ActionIcon-root, .mantine-Button-root) {
  height: 34px !important;
  min-height: 34px !important;
}

@media (max-width: 1280px) {
  #new-content-shell #config-card :is(.sp-inspector-subsection-body, #workspace-selection-controls-wrap, #section-text-cards-wrap) .sp-step4-field-card > .mantine-Stack-root {
    grid-template-columns: minmax(118px, 148px) minmax(0, 1fr) !important;
  }

}

@media (max-width: 900px) {
  #new-content-shell #config-card :is(.sp-inspector-subsection-body, #workspace-selection-controls-wrap, #section-text-cards-wrap) .sp-step4-field-card > .mantine-Stack-root {
    grid-template-columns: minmax(0, 1fr) !important;
  }

}

#new-content-shell .sp-preview-visible-data :is(.mantine-MultiSelect-pill, .mantine-Pill-root) {
  border-radius: 999px !important;
}

#new-content-shell .sp-preview-secondary-actions :is(.mantine-ActionIcon-root, .mantine-Button-root) {
  height: 32px !important;
  min-height: 32px !important;
}


/* --- R3.2 second pass: the compact/parity inspector bands (their
   selectors carry :is(...) lists; inserted BEFORE the R2.2+ bands that
   must keep out-cascading them). --- */

@container (max-width: 840px) {
  #new-content-shell #preview-edit-row {
    align-items: flex-start !important;
  }

  #new-content-shell .sp-preview-controls-toolbar {
    flex: 1 1 100%;
    width: 100%;
    margin-left: 0;
    justify-content: flex-start;
    align-self: stretch;
  }

}

@container (max-width: 560px) {
  #new-content-shell .sp-preview-motion-controls,
  #new-content-shell .sp-preview-controls-toolbar {
    flex: 1 1 100%;
    width: 100%;
  }

  #new-content-shell .sp-preview-controls-toolbar {
    gap: 7px !important;
  }

}

@container (max-width: 500px) {
  #new-content-shell #preview-data-toolbar.sp-preview-action-grid {
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch !important;
  }

  #new-content-shell #preview-data-toolbar.sp-preview-action-grid > .sp-preview-secondary-actions {
    width: 100% !important;
    justify-content: flex-start !important;
    flex-wrap: wrap !important;
    padding-top: 8px;
    padding-left: 0;
    border-top: 1px solid color-mix(in srgb, var(--bc-border) 78%, transparent);
    border-left: 0;
  }

}


#new-content-shell .sp-inspector-simple .sp-pro-only {
  display: none;
}

/* Tab panel surface: no inner border-in-border card. */
#new-content-shell #config-card .sp-config-root-panel-surface {
  border: 0 !important;
  box-shadow: none !important;
  background: transparent !important;
  padding: 6px 2px 10px !important;
}

/* Group headers -> eyebrows: condensed caps + hairline rule (mockup .eyebrow). */
#new-content-shell #config-card .sp-inspector-subsection-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 14px 0 4px;
}

#new-content-shell #config-card .sp-inspector-subsection:first-child > .sp-inspector-subsection-header {
  margin-top: 4px;
}

#new-content-shell #config-card .sp-inspector-subsection-title {
  font-size: 10.5px !important;
  font-weight: 700 !important;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.72;
  white-space: nowrap;
}

#new-content-shell #config-card .sp-inspector-subsection-header::after {
  content: "";
  flex: 1;
  height: 1px;
  background: color-mix(in srgb, var(--bc-border) 70%, transparent);
}

/* PRO chip on Pro-only groups (visible only in Pro mode by definition). */
#new-content-shell #config-card .sp-inspector-subsection.sp-pro-only .sp-inspector-subsection-title::after {
  content: "PRO";
  margin-left: 8px;
  padding: 1px 7px;
  border: 1px solid color-mix(in srgb, var(--bc-border) 90%, transparent);
  border-radius: 999px;
  font-size: 9px;
  letter-spacing: 0.08em;
  opacity: 0.85;
}

/* Block Papers inside a group body lose their card chrome (they sit under an
   eyebrow now). Two levels: direct children + blocks inside wrapper divs
   (e.g. .sp-step4-axis-layout). Deeper cards (annotation card lists, element
   cards) intentionally keep their chrome. */
#new-content-shell #config-card .sp-inspector-subsection-body > .mantine-Paper-root,
#new-content-shell #config-card .sp-inspector-subsection-body > div:not([class*="mantine"]) > .mantine-Paper-root {
  border: 0 !important;
  box-shadow: none !important;
  background: transparent !important;
  padding: 0 !important;
}

/* Accordions inside group bodies: separated-card look -> flat rows. */
#new-content-shell #config-card .sp-inspector-subsection-body .mantine-Accordion-item {
  border: 0 !important;
  border-bottom: 1px solid color-mix(in srgb, var(--bc-border) 76%, transparent) !important;
  border-radius: 0 !important;
  background: transparent !important;
}

#new-content-shell #config-card .sp-inspector-subsection-body .mantine-Accordion-control {
  padding: 7px 2px !important;
  min-height: 0 !important;
}

#new-content-shell #config-card .sp-inspector-subsection-body .mantine-Accordion-content {
  padding: 2px 2px 10px !important;
}

/* Quick-style card (Chart > Look): flat block, no bordered card. */
#new-content-shell #config-card .sp-guided-card--style {
  border: 0 !important;
  box-shadow: none !important;
  background: transparent !important;
  padding: 0 !important;
}

/* Tighter vertical rhythm between groups/blocks. */
#new-content-shell #config-card .sp-inspector-root-panel {
  gap: 4px !important;
}

#new-content-shell #config-card .sp-inspector-subsection-body > .mantine-Stack-root {
  gap: 6px !important;
}

/* === R2.4b builder Home view (new_content) =============================== */
#new-content-shell .sp-builder-home {
  flex: 1;
  min-height: 60vh;
  padding: 28px 30px 44px;
}

#new-content-shell .sp-builder-home-inner {
  max-width: 980px;
  margin: 0 auto;
}

#new-content-shell .sp-builder-home-eyebrow {
  font-size: 10.5px !important;
  font-weight: 700 !important;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.72;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 22px 0 10px;
}

#new-content-shell .sp-builder-home-eyebrow::after {
  content: "";
  flex: 1;
  height: 1px;
  background: color-mix(in srgb, var(--bc-border) 70%, transparent);
}

#new-content-shell .sp-builder-home-startgrid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

#new-content-shell .sp-builder-home-start {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 16px;
  border: 1px solid var(--bc-border);
  border-radius: 10px;
  background: color-mix(in srgb, var(--bc-raised) 96%, transparent);
  color: var(--bc-text);
  text-align: left;
  cursor: pointer;
  text-decoration: none;
  transition: border-color 120ms ease, transform 120ms ease;
}

#new-content-shell .sp-builder-home-start:hover {
  border-color: var(--bc-accent);
  transform: translateY(-1px);
}

#new-content-shell .sp-builder-home-start-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--bc-accent-soft, color-mix(in srgb, var(--sp-accent) 14%, transparent));
  color: var(--bc-accent, var(--sp-accent));
  margin-bottom: 2px;
}

#new-content-shell .sp-builder-home-recents {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
}

#new-content-shell .sp-builder-home-recent {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--bc-border);
  border-radius: 10px;
  background: color-mix(in srgb, var(--bc-raised) 96%, transparent);
  color: var(--bc-text);
  text-decoration: none;
  transition: border-color 120ms ease;
}

#new-content-shell .sp-builder-home-recent:hover {
  border-color: var(--bc-accent);
}

#new-content-shell .sp-builder-home-recent-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--bc-accent-soft, color-mix(in srgb, var(--sp-accent) 14%, transparent));
  color: var(--bc-accent, var(--sp-accent));
}

/* R3 design round 2: FULL-BLEED editor (mockup/CapCut-style) — the floating
   artboard frame is gone; the builder owns the viewport. */
#new-content-shell .sp-builder-shell-frame {
  min-height: calc(100vh - 72px);
  background: var(--bc-bg) !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  color: var(--bc-text);
}

#new-content-shell .sp-builder-shell-topbar {
  background: var(--bc-panel) !important;
  border-bottom: 1px solid var(--bc-border) !important;
}

#new-content-shell .sp-builder-step-card,
#new-content-shell .sp-guided-summary-card,
#new-content-shell #config-card,
#new-content-shell #filter-card,
#new-content-shell #save-card,
#new-content-shell #visual-type-card,
#new-content-shell #figure-card {
  background: var(--bc-panel) !important;
  border: 1px solid var(--bc-border-soft) !important;
  border-radius: var(--bc-r) !important;
  box-shadow: none !important;
}

/* Inputs (mockup .msel): raised well, 1px border, radius 4. Covers
   TextInput/Select/NumberInput/PillsInput/Textarea inners (Mantine v7 all
   render .mantine-Input-input). */
:is(#new-content-shell, #editor-workspace-root) .mantine-Input-input,
:is(#new-content-shell, #editor-workspace-root) .mantine-PillsInput-input,
:is(#new-content-shell, #editor-workspace-root) .mantine-Textarea-input {
  background: var(--bc-raised) !important;
  border: 1px solid var(--bc-border) !important;
  color: var(--bc-text) !important;
  border-radius: var(--bc-rs) !important;
  box-shadow: none !important;
}

:is(#new-content-shell, #editor-workspace-root) .mantine-Input-input::placeholder,
:is(#new-content-shell, #editor-workspace-root) .mantine-PillsInput-input::placeholder {
  color: var(--bc-faint) !important;
}

/* Segmented controls (mockup .seg): sunken track, raised active pill. */
:is(#new-content-shell, #editor-workspace-root) .mantine-SegmentedControl-root {
  background: var(--bc-sunken) !important;
  border: 1px solid var(--bc-border-soft) !important;
  border-radius: var(--bc-rs) !important;
  box-shadow: none !important;
}

:is(#new-content-shell, #editor-workspace-root) .mantine-SegmentedControl-indicator {
  background: var(--bc-raised) !important;
  border-radius: calc(var(--bc-rs) - 1px) !important;
  box-shadow: inset 0 0 0 1px var(--bc-border) !important;
}

:is(#new-content-shell, #editor-workspace-root) .mantine-SegmentedControl-label {
  color: var(--bc-text2) !important;
}

:is(#new-content-shell, #editor-workspace-root) .mantine-SegmentedControl-control[data-active] .mantine-SegmentedControl-label,
:is(#new-content-shell, #editor-workspace-root) .mantine-SegmentedControl-label[data-active] {
  color: var(--bc-text) !important;
}

/* Buttons. Default/outline/light -> mockup .ibtn (raised, bordered, muted
   ink); subtle/transparent keep their ghost look, token ink only; filled ->
   .ibtn.primary (amber fill, dark ink) — this retires the blue/gradient
   CTAs (Save / Export / Apply / Load dataset). */
:is(#new-content-shell, #editor-workspace-root) .mantine-Button-root:not([data-variant="filled"]):not([data-variant="gradient"]):not([data-variant="subtle"]):not([data-variant="transparent"]) {
  background: var(--bc-raised) !important;
  border: 1px solid var(--bc-border) !important;
  color: var(--bc-text2) !important;
  border-radius: var(--bc-rs) !important;
  box-shadow: none !important;
}

:is(#new-content-shell, #editor-workspace-root) .mantine-Button-root:not([data-variant="filled"]):not([data-variant="gradient"]):not([data-variant="subtle"]):not([data-variant="transparent"]):hover {
  color: var(--bc-text) !important;
  border-color: var(--bc-border) !important;
}

:is(#new-content-shell, #editor-workspace-root) .mantine-Button-root[data-variant="subtle"],
:is(#new-content-shell, #editor-workspace-root) .mantine-Button-root[data-variant="transparent"] {
  color: var(--bc-text2) !important;
}

:is(#new-content-shell, #editor-workspace-root) .mantine-Button-root[data-variant="subtle"]:hover,
:is(#new-content-shell, #editor-workspace-root) .mantine-Button-root[data-variant="transparent"]:hover {
  color: var(--bc-text) !important;
  background: var(--bc-accent-soft) !important;
}

:is(#new-content-shell, #editor-workspace-root) .mantine-Button-root[data-variant="filled"],
:is(#new-content-shell, #editor-workspace-root) .mantine-Button-root[data-variant="gradient"] {
  background: var(--bc-accent) !important;
  border: 1px solid var(--bc-accent) !important;
  color: var(--bc-accent-ink) !important;
  border-radius: var(--bc-rs) !important;
  box-shadow: none !important;
}

:is(#new-content-shell, #editor-workspace-root) .mantine-Button-root[data-variant="filled"]:hover,
:is(#new-content-shell, #editor-workspace-root) .mantine-Button-root[data-variant="gradient"]:hover {
  filter: brightness(1.06);
}

/* Filled action icons (Play, topbar icon actions): amber, shape kept. */
:is(#new-content-shell, #editor-workspace-root) .mantine-ActionIcon-root[data-variant="filled"] {
  background: var(--bc-accent) !important;
  border-color: var(--bc-accent) !important;
  color: var(--bc-accent-ink) !important;
}

/* Switch ON state: scoreboard amber (mockup .tgl.on). */
:is(#new-content-shell, #editor-workspace-root) .mantine-Switch-input:checked + .mantine-Switch-track {
  background: var(--bc-accent) !important;
  border-color: var(--bc-accent) !important;
}

:is(#new-content-shell, #editor-workspace-root) .mantine-Switch-input:checked + .mantine-Switch-track .mantine-Switch-thumb {
  background: var(--bc-accent-ink) !important;
  border-color: var(--bc-accent-ink) !important;
}

/* Kill Mantine's default thumb indicator: a 40%-size dot inside the knob
   tinted with --switch-bg. The amber ON rule above sets the track's
   `background` but never the --switch-bg var, so on checked switches the dot
   stayed Mantine-primary-blue (the "blue dot on every toggle"). Mockup knobs
   are plain, so drop the indicator on every switch. */
:is(#new-content-shell, #editor-workspace-root) .mantine-Switch-thumb::before {
  display: none !important;
}

/* Sliders: amber playhead/track fill. */
:is(#new-content-shell, #editor-workspace-root) .mantine-Slider-bar {
  background: var(--bc-accent) !important;
}

:is(#new-content-shell, #editor-workspace-root) .mantine-Slider-thumb {
  background: var(--bc-raised) !important;
  border-color: var(--bc-accent) !important;
}

/* Active tab (chart-type picker, inspector surface tabs): amber wash
   (mockup .itab.on) — unifies the per-theme literal ambers already in use. */
:is(#new-content-shell, #editor-workspace-root) .mantine-Tabs-tab[data-active] {
  background: var(--bc-accent-soft) !important;
  color: var(--bc-text) !important;
}

/* Play is a gradient ActionIcon (indigo->cyan component prop) — bring
   gradient ActionIcons into the amber primary treatment too. */
:is(#new-content-shell, #editor-workspace-root) .mantine-ActionIcon-root[data-variant="gradient"] {
  background: var(--bc-accent) !important;
  border-color: var(--bc-accent) !important;
  color: var(--bc-accent-ink) !important;
}

/* Ghost icon buttons (default/light/subtle ActionIcons): mockup .ibtn ink —
   muted, text on hover. Filled/gradient stay amber (rules above). */
:is(#new-content-shell, #editor-workspace-root) .mantine-ActionIcon-root[data-variant="default"],
:is(#new-content-shell, #editor-workspace-root) .mantine-ActionIcon-root[data-variant="light"],
:is(#new-content-shell, #editor-workspace-root) .mantine-ActionIcon-root[data-variant="subtle"] {
  color: var(--bc-text2) !important;
}

:is(#new-content-shell, #editor-workspace-root) .mantine-ActionIcon-root[data-variant="default"]:hover,
:is(#new-content-shell, #editor-workspace-root) .mantine-ActionIcon-root[data-variant="light"]:hover,
:is(#new-content-shell, #editor-workspace-root) .mantine-ActionIcon-root[data-variant="subtle"]:hover {
  color: var(--bc-text) !important;
  background: var(--bc-accent-soft) !important;
}

/* In-shell entity pills (filter MultiSelect chips): mockup .fchip — raised
   neutral chip, muted remove glyph. */
:is(#new-content-shell, #editor-workspace-root) .mantine-Pill-root {
  background: var(--bc-raised) !important;
  border: 1px solid var(--bc-border) !important;
  color: var(--bc-text) !important;
}

:is(#new-content-shell, #editor-workspace-root) .mantine-Pill-remove {
  color: var(--bc-faint) !important;
}

/* 2d re-point: this R3 band skinned the section boxes with the CONTENT accent
   (amber); zones/drag chrome is editor tooling and rides --bc-editor-tool now
   (kickoff §2d). The playhead below stays on the chrome accent — it is
   playback chrome, not a zone outline. */
:is(#new-content-shell, #editor-workspace-root) .sp-section-layout-box {
  border-color: color-mix(in srgb, var(--bc-editor-tool) 42%, transparent);
}

:is(#new-content-shell, #editor-workspace-root) .sp-section-layout-box[data-section-key="graph"] {
  border-color: color-mix(in srgb, var(--bc-editor-tool) 58%, transparent);
}

:is(#new-content-shell, #editor-workspace-root) .sp-section-layout-box.is-selected {
  border-color: var(--bc-editor-tool);
}

:is(#new-content-shell, #editor-workspace-root) .sp-section-layout-selection-ring {
  border-color: var(--bc-editor-tool);
  box-shadow:
    0 0 0 2px color-mix(in srgb, var(--bc-editor-tool) 14%, transparent),
    0 0 0 1px rgba(0, 0, 0, 0.18);
}

:is(#new-content-shell, #editor-workspace-root) .sp-section-layout-handle {
  background: var(--bc-editor-tool);
  border-color: var(--bc-accent-ink);
}

/* The amber overrides above OUT-SPECIFY the chrome-hide band
   (.sp-section-layout-editor[data-chrome-visible="false"] ... at 0,3,0 vs
   1,1,0 here), which broke "boxes disappear while playing" — re-assert the
   hide at higher specificity (user-reported regression). */
:is(#new-content-shell, #editor-workspace-root) .sp-section-layout-editor[data-chrome-visible="false"] .sp-section-layout-box,
:is(#new-content-shell, #editor-workspace-root) .sp-section-layout-editor[data-chrome-visible="false"] .sp-section-layout-box[data-section-key="graph"],
:is(#new-content-shell, #editor-workspace-root) .sp-section-layout-editor[data-chrome-visible="false"] .sp-section-layout-box.is-selected {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}

/* 4.1 Inspector moves to the RIGHT (mockup: canvas left, inspector right).
   Desktop only: the side panel is position:fixed, JS-pinned to the frame's
   LEFT edge via --sp-workspace-side-panel-left (new_content_layout_editor.js
   updateWorkspaceSidePanelHeight). We keep the JS untouched and ignore its
   left coordinate: pin `right` to the frame's right edge instead, derived
   from the frame metrics (width: min(1920px, 100vw - 32px), centered, shell
   side padding 10px => gap = max(16px, (100vw - 1920px) / 2)). If those
   frame metrics ever change, update this calc. Body clearance flips from
   padding-left to padding-right. Mobile (<=1180px) stays stacked. */
@media (min-width: 1181px) {
  #new-content-shell #builder-shell-body.sp-builder-shell-body--workspace {
    padding-left: 0 !important;
    padding-right: var(--sp-workspace-side-panel-width);
  }

  #new-content-shell #builder-shell-body.sp-builder-shell-body--workspace #workspace-left-panel,
  #new-content-shell #builder-shell-body.sp-builder-shell-body--workspace #workspace-right-panel {
    left: auto !important;
    right: 0;
  }

}

/* 4.2 Topbar strip metrics (mockup .tb: tight bar, 30px controls). */
#new-content-shell .sp-builder-shell-topbar {
  min-height: 46px;
}

#new-content-shell .sp-builder-shell-topbar .mantine-Button-root {
  height: 30px !important;
  min-height: 30px !important;
  padding-inline: 10px !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  border-radius: var(--bc-rs) !important;
}

#new-content-shell .sp-builder-shell-topbar .mantine-Input-input,
#new-content-shell .sp-builder-shell-topbar .mantine-Select-input,
#new-content-shell .sp-builder-shell-topbar .mantine-NumberInput-input {
  min-height: 30px !important;
  height: 30px !important;
  font-size: 12px !important;
  font-weight: 600 !important;
}

#new-content-shell .sp-builder-shell-topbar .mantine-SegmentedControl-root {
  height: 30px;
}

#new-content-shell .sp-builder-shell-topbar .mantine-SegmentedControl-label {
  font-size: 12px !important;
  padding-block: 4px !important;
}

/* 4.3 Dense type scale (mockup: 12.5px/600 labels, 11px helpers, control
   text 12.5px). Textareas/PillsInputs keep auto height (font only). */
:is(#new-content-shell, #editor-workspace-root) .mantine-InputWrapper-label,
:is(#new-content-shell, #editor-workspace-root) .mantine-Switch-label,
:is(#new-content-shell, #editor-workspace-root) .mantine-Checkbox-label,
:is(#new-content-shell, #editor-workspace-root) .mantine-Radio-label {
  font-size: 12.5px !important;
  font-weight: 600 !important;
}

:is(#new-content-shell, #editor-workspace-root) .mantine-InputWrapper-description {
  font-size: 11px !important;
}

:is(#new-content-shell, #editor-workspace-root) :is(#config-card, #editor-tools) .mantine-Input-input,
:is(#new-content-shell, #editor-workspace-root) :is(#filter-card, #editor-filter-card) .mantine-Input-input {
  font-size: 12.5px !important;
}

:is(#new-content-shell, #editor-workspace-root) :is(#config-card, #editor-tools) .mantine-Input-input:not(.mantine-Textarea-input):not(.mantine-PillsInput-input),
:is(#new-content-shell, #editor-workspace-root) :is(#filter-card, #editor-filter-card) .mantine-Input-input:not(.mantine-Textarea-input):not(.mantine-PillsInput-input) {
  min-height: 30px !important;
  height: 30px !important;
}

:is(#new-content-shell, #editor-workspace-root) .mantine-SegmentedControl-label {
  font-size: 12px !important;
  font-weight: 600 !important;
}

:is(#new-content-shell, #editor-workspace-root) .mantine-Tabs-tab {
  font-size: 12.5px !important;
  font-weight: 600 !important;
}

:is(#new-content-shell, #editor-workspace-root) .mantine-Button-root {
  font-size: 12.5px !important;
}

/* Tabular mono numerals (mockup --m-num) where numbers live. */
:is(#new-content-shell, #editor-workspace-root) .mantine-NumberInput-input,
:is(#new-content-shell, #editor-workspace-root) .mantine-Slider-markLabel,
:is(#new-content-shell, #editor-workspace-root) :is(#playback-row, #editor-playback-row) {
  font-family: var(--bc-num) !important;
  font-variant-numeric: tabular-nums;
}

/* Portaled dropdowns (render as <body> children; tokens resolve there since
   the body:has scope move): raised steel menus, amber hover. Replaces the
   per-theme literal pairs visually; the pairs are deleted in the cleanup
   pass. */
body:where([data-sp-has~="studio-shell"]):not(#sp-s) .mantine-Select-dropdown,
body:where([data-sp-has~="studio-shell"]):not(#sp-s) .mantine-MultiSelect-dropdown,
body:where([data-sp-has~="studio-shell"]):not(#sp-s) .mantine-Combobox-dropdown,
body:where([data-sp-has~="studio-shell"]):not(#sp-s) .mantine-Popover-dropdown {
  background: var(--bc-raised) !important;
  border: 1px solid var(--bc-border) !important;
  color: var(--bc-text) !important;
  border-radius: var(--bc-r) !important;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35) !important;
}

body:where([data-sp-has~="studio-shell"]):not(#sp-s) .mantine-Combobox-option,
body:where([data-sp-has~="studio-shell"]):not(#sp-s) .mantine-Select-option {
  color: var(--bc-text2) !important;
  font-size: 12.5px !important;
  border-radius: var(--bc-rs) !important;
}

body:where([data-sp-has~="studio-shell"]):not(#sp-s) .mantine-Combobox-option:hover,
body:where([data-sp-has~="studio-shell"]):not(#sp-s) .mantine-Select-option:hover {
  background: var(--bc-accent-soft) !important;
  color: var(--bc-text) !important;
}

body:where([data-sp-has~="studio-shell"]):not(#sp-s) .mantine-Combobox-option[data-combobox-selected],
body:where([data-sp-has~="studio-shell"]):not(#sp-s) .mantine-Select-option[data-combobox-selected] {
  background: var(--bc-accent-soft) !important;
  color: var(--bc-text) !important;
}

/* 4.5 Transport bar (mockup bottom bar). Play + #playback-row are SIBLINGS
   inside .sp-transport-bar; the row stays slider-only (the play loop paints
   progress on the slider itself). The bar hides whenever playback is
   unavailable (the row's display is callback-written). */
:is(#new-content-shell, #editor-workspace-root) .sp-transport-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bc-panel);
  border: 1px solid var(--bc-border-soft);
  border-radius: var(--bc-r);
  padding: 8px 12px;
  margin-top: 6px;
}

:where(html[data-sp-has~="playback-row-hidden"]):not(#sp-s):not(.sp-s) :is(#new-content-shell, #editor-workspace-root) .sp-transport-bar {
  display: none;
}

:is(#new-content-shell, #editor-workspace-root) .sp-transport-bar :is(#playback-row, #editor-playback-row) {
  margin-top: 0 !important;
  flex: 1 1 auto;
  min-width: 0;
}

/* #preview-surface centers its children (align-items:center), so this flex
   bar shrink-wrapped and the flex:1 scrubber collapsed to just its thumb (the
   floating "225" pill). Match the canvas card width (figure-card's inline
   max-width = _story_preview_stage_width_px 437 + _preview_frame_chrome_px 28)
   so the bar spans a real scrubber directly under the preview. */
#new-content-shell #preview-surface > .sp-transport-bar {
  width: 100%;
  max-width: 465px;
}

/* Default-variant ActionIcons (fullscreen, small utility icons) rendered as
   dark circles on the light theme (legacy dark literals) — raised token
   treatment works in both themes. */
#new-content-shell .mantine-ActionIcon-root[data-variant="default"] {
  background: var(--bc-raised) !important;
  border: 1px solid var(--bc-border) !important;
}

/* Mantine mark labels are absolutely positioned below the track and add no
   height; after the density pass the following row overlapped them
   (user-reported: "Line glow" marks colliding with "Entity labels"). */
#new-content-shell .mantine-Slider-root:has(.mantine-Slider-markLabel) {
  margin-bottom: 18px;
}

/* --- R3 band 5: structural topbar pieces (breadcrumb, status dot) -------- */
#new-content-shell .sp-builder-breadcrumb-name {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--bc-text2);
  white-space: nowrap;
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
}

#new-content-shell .sp-builder-breadcrumb-name:not(:empty)::before {
  content: "/";
  margin-right: 6px;
  color: var(--bc-faint);
}

#new-content-shell .sp-builder-anim-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--bc-text2);
  white-space: nowrap;
}

/* Dot-only: hidden until the status callback tags is-ready / is-stale
   (the wording rides the title tooltip). */
#new-content-shell .sp-builder-anim-status:not(.is-ready):not(.is-stale),
#new-content-shell .sp-builder-anim-status.is-hidden {
  display: none;
}

#new-content-shell .sp-builder-anim-status::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--bc-good);
  flex: 0 0 auto;
}

#new-content-shell .sp-builder-anim-status.is-stale::before {
  background: var(--bc-warn);
}

/* Band 5 space recovery: the actions cluster gained undo/redo + the status
   dot; tighter gaps + a shorter breadcrumb keep the middle Grid stepper and
   the Full/Compact labels from clipping at 1600w. */
#new-content-shell .sp-builder-shell-topbar-inner {
  column-gap: 8px !important;
}

#new-content-shell .sp-editor-topbar-actions {
  gap: 6px !important;
}

#new-content-shell .sp-builder-breadcrumb-name {
  max-width: 200px;
}

#new-content-shell .sp-builder-shell-topbar .mantine-SegmentedControl-label {
  padding-inline: 8px !important;
}

/* The Full/Compact segmented must keep its natural width (it was the flex
   item that absorbed the squeeze and clipped "Compact"); the duration input
   gives back the difference. */
#new-content-shell .sp-builder-shell-topbar .mantine-SegmentedControl-root {
  flex: 0 0 auto;
}

#new-content-shell .sp-preview-duration-control {
  width: 72px !important;
}

/* --- R3 band 6: SHOWING chips filter summary (mockup .fchip row) --------- */
#new-content-shell .sp-filter-chips-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  min-height: 30px;
}

#new-content-shell .sp-filter-chips-eyebrow {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--bc-faint);
  margin-right: 2px;
}

#new-content-shell .sp-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid var(--bc-border);
  background: var(--bc-raised);
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 600;
  color: var(--bc-text);
  white-space: nowrap;
}

#new-content-shell .sp-filter-chip--more {
  background: transparent;
  border-style: dashed;
  color: var(--bc-text2);
}

/* Summary state (default): chips + Edit filter visible, the raw entity
   MultiSelect / Apply / Filters cluster hidden. is-editing (written by the
   Edit-filter clientside) swaps them; Apply returns to summary. */
#new-content-shell #preview-data-toolbar:not(.is-editing) .sp-preview-visible-data .mantine-MultiSelect-root,
#new-content-shell #preview-data-toolbar:not(.is-editing) .sp-preview-visible-data .mantine-InputWrapper-root {
  display: none;
}

#new-content-shell #preview-data-toolbar:not(.is-editing) #btn-apply-filters,
#new-content-shell #preview-data-toolbar:not(.is-editing) #btn-toggle-more-filters {
  display: none !important;
}

#new-content-shell #preview-data-toolbar.is-editing .sp-filter-chips-row {
  display: none;
}


/* --- R3 design round 2: full-bleed chrome ------------------------------- */
/* The builder owns the viewport on desktop: the site header hides and the
   topbar becomes the app bar (mockup "brand-dot StatsPoint / project"). The
   brand link is the way back to the feed. Mobile keeps the site header. */
#new-content-shell .sp-builder-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 800;
  color: var(--bc-text);
  text-decoration: none;
  white-space: nowrap;
}

#new-content-shell .sp-builder-brand::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--bc-accent);
  flex: 0 0 auto;
}

#new-content-shell .sp-builder-brand:hover {
  color: var(--bc-accent);
}

/* --- R3 design round 2: Data drawer (mockup .drawer/.srcseg/.dv) --------- */
/* Dense, quiet setup surface: slim header, icon+label source tabs (no
   description lines, no step chips), tight cards, mono preview table. */

#new-content-shell .sp-workspace-data-panel {
  width: 420px;
  max-width: 94vw;
}

#new-content-shell .sp-workspace-data-drawer .sp-workspace-export-header {
  padding: 10px 14px;
  border-bottom: 1px solid var(--bc-border-soft);
}

#new-content-shell .sp-workspace-data-body {
  padding: 12px 14px;
}

/* #workspace-left-panel hosts BOTH the stats/question source step AND the
   question workspace — hiding the whole panel (as round 2 briefly did to
   match the mockup) makes Question-card creation unreachable, because
   source-type-select is the only entry into question mode. Keep the panel
   visible and densify the source step instead: kill the DATA/Start chips and
   helper copy — the drawer title already says where we are, and the srcseg
   rules below reduce the segmented control to icon + label. */
#new-content-shell .sp-workspace-data-drawer .sp-setup-stage-meta,
#new-content-shell .sp-workspace-data-drawer .sp-setup-stage-header > .mantine-Text-root,
#new-content-shell .sp-workspace-data-drawer .sp-setup-stage-helper {
  display: none !important;
}

#new-content-shell .sp-workspace-data-drawer .sp-setup-stage-header .mantine-Text-root {
  font-size: 13px !important;
  font-weight: 700 !important;
}

#new-content-shell .sp-workspace-data-drawer .sp-setup-stage-header svg {
  width: 15px;
  height: 15px;
  color: var(--bc-text2);
}

/* Choice segmented controls -> mockup .srcseg: flat bar, icon + label only,
   amber wash + underline on the active segment. */
#new-content-shell .sp-workspace-data-drawer .sp-setup-choice-copy > .mantine-Text-root:last-child {
  display: none !important;
}

#new-content-shell .sp-workspace-data-drawer .sp-setup-choice-icon {
  width: auto;
  height: auto;
  background: transparent !important;
  border: 0 !important;
  color: var(--bc-text2);
}

#new-content-shell .sp-workspace-data-drawer .sp-setup-choice-label .mantine-Text-root {
  font-size: 12.5px !important;
  font-weight: 600 !important;
}

#new-content-shell .sp-workspace-data-drawer .sp-setup-choice-control .mantine-SegmentedControl-root,
#new-content-shell .sp-workspace-data-drawer .mantine-SegmentedControl-root {
  border-radius: var(--bc-r) !important;
}

#new-content-shell .sp-workspace-data-drawer .mantine-SegmentedControl-indicator {
  background: var(--bc-accent-soft) !important;
  box-shadow: inset 0 -2px 0 var(--bc-accent) !important;
  border-radius: calc(var(--bc-r) - 2px) !important;
}

#new-content-shell .sp-workspace-data-drawer .mantine-SegmentedControl-label {
  padding-block: 8px !important;
}

/* Cards inside the drawer: tighter rhythm. */
#new-content-shell .sp-workspace-data-drawer .sp-builder-step-card {
  padding: 12px !important;
  margin-bottom: 10px !important;
}

#new-content-shell .sp-workspace-data-drawer .sp-builder-step-card .mantine-Stack-root {
  gap: 10px !important;
}

/* Dataset preview -> mockup table.dv: mono numerals, hairline rows. */
#new-content-shell .sp-workspace-data-drawer .dash-spreadsheet-inner th {
  font-size: 9.5px !important;
  font-weight: 600 !important;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--bc-faint) !important;
  padding: 5px 8px !important;
}

#new-content-shell .sp-workspace-data-drawer .dash-spreadsheet-inner td {
  font-family: var(--bc-num) !important;
  font-variant-numeric: tabular-nums;
  font-size: 11px !important;
  padding: 4.5px 8px !important;
  border-color: var(--bc-border-soft) !important;
}

/* (content-visibility experiment REMOVED: #workspace-left-panel lives INSIDE
   the drawer — skipping its rendering broke Mantine Select value retention,
   which gutted the deeplink's workspace-ready gate.) */

/* --- R3 design round 2: one-Inspector right panel ------------------------ */

/* The summary chips card duplicated the topbar breadcrumb + status — gone
   from view (stays mounted: quick-creator-summary is callback-written). */
#new-content-shell .sp-guided-summary-card {
  display: none !important;
}

/* Labeled root tabs (mockup .itab): equal-width flat tabs, amber underline
   wash on the active one (base wash from the band-2 Tabs rule). */
#new-content-shell .sp-config-root-tabs .mantine-TabsList-root {
  display: flex !important;
  gap: 4px !important;
  padding: 3px !important;
}

#new-content-shell .sp-config-root-tab {
  flex: 1 1 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 32px !important;
  border-radius: var(--bc-rs) !important;
  padding: 0 6px !important;
}

#new-content-shell .sp-config-root-tab-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

#new-content-shell .sp-config-root-tab-icon {
  display: inline-flex;
  align-items: center;
}

#new-content-shell .sp-config-root-tab[data-active] {
  box-shadow: inset 0 -2px 0 var(--bc-accent) !important;
}

/* Type / Playback / Aggregate inside the Chart tab: flat rows, no nested
   card chrome. */
#new-content-shell .sp-inspector-root-panel #visual-type-card {
  background: transparent !important;
  border: 0 !important;
  padding: 0 !important;
  box-shadow: none !important;
}

#new-content-shell .sp-inspector-root-panel .sp-guided-template-step {
  margin-bottom: 2px;
}

/* Layers panel inside the Element tab: flat group with an eyebrow title. */
#new-content-shell .sp-inspector-root-panel .sp-workspace-section-layout-panel {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}

#new-content-shell .sp-inspector-root-panel .sp-workspace-section-layout-title .mantine-Text-root {
  font-size: 10px !important;
  font-weight: 700 !important;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--bc-text2) !important;
}

/* Mockup opens straight to the source segmented control: drop the "Set up
   your data" intake heading (its title, icon, badge and helper all live
   inside it). The data-preview header stays — compact, helper copy off. */
#new-content-shell .sp-workspace-data-drawer .sp-setup-intake-heading,
#new-content-shell .sp-workspace-data-drawer #data-preview-copy {
  display: none !important;
}

#new-content-shell .sp-workspace-data-drawer #data-preview-heading {
  font-size: 13px !important;
  font-weight: 700 !important;
}

/* Icons inside the 3-way source segmented (Saved stats / Manual rows /
   Upload) — dropped so the third segment doesn't clip at drawer width. */
#new-content-shell .sp-workspace-data-drawer .sp-setup-choice-control--data .sp-setup-choice-icon {
  display: none !important;
}

/* --- R3 round 2: vertical density (user feedback: components too tall) --- */
/* Both panels: 30px control wells, tight rows. Textareas/PillsInputs keep
   auto height. */
#new-content-shell .sp-workspace-data-drawer .mantine-Input-input:not(.mantine-Textarea-input):not(.mantine-PillsInput-input),
#new-content-shell .sp-workspace-data-drawer .mantine-Select-input,
#new-content-shell .sp-inspector-root-panel .mantine-Input-input:not(.mantine-Textarea-input):not(.mantine-PillsInput-input),
#new-content-shell .sp-inspector-root-panel .mantine-Select-input {
  min-height: 30px !important;
  height: 30px !important;
  font-size: 12.5px !important;
}

#new-content-shell .sp-workspace-data-drawer .mantine-SegmentedControl-label {
  padding-block: 6px !important;
  font-size: 12px !important;
}

#new-content-shell .sp-workspace-data-drawer .mantine-Button-root {
  height: 32px !important;
  min-height: 32px !important;
}

#new-content-shell .sp-inspector-root-panel .mantine-SegmentedControl-label {
  padding-block: 5px !important;
}

#new-content-shell .sp-inspector-root-panel .sp-basics-row {
  min-height: 30px;
}

#new-content-shell .sp-inspector-root-panel .sp-basics-row > .mantine-Text-root {
  font-size: 12.5px !important;
  white-space: nowrap;
}

#new-content-shell .sp-inspector-root-panel > * + * {
  margin-top: 2px;
}

#new-content-shell .sp-guided-main-settings {
  padding: 10px !important;
}

#new-content-shell .sp-workspace-data-body > * + * {
  margin-top: 8px;
}

/* --- R3 round 2c: production polish (B2C SaaS finish) -------------------- */

/* 1. Root tabs: flat text tabs (mockup .itab) — inactive tabs lose the boxy
   raised-button look entirely; only the active one carries the amber wash. */
#new-content-shell .sp-config-root-tab:not([data-active]) {
  background: transparent !important;
  border-color: transparent !important;
}

/* 2. THE core row grammar: label left, control right (mockup rows). Applies
   to every InputWrapper in the inspector panels except full-width controls
   (textareas, pills inputs, sliders). */
#new-content-shell .sp-inspector-root-panel .mantine-InputWrapper-root:not(:has(.mantine-Textarea-input)):not(:has(.mantine-PillsInput-input)):not(:has(.mantine-Slider-root)):not(.mantine-Group-root *) {
  display: grid;
  grid-template-columns: minmax(90px, 42%) minmax(0, 1fr);
  align-items: center;
  column-gap: 10px;
  min-height: 30px;
}

#new-content-shell .sp-inspector-root-panel .mantine-InputWrapper-root > .mantine-InputWrapper-label {
  font-size: 12.5px !important;
  font-weight: 500 !important;
  color: var(--bc-text2) !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Numeric inputs: compact, right-aligned in their cell. */
#new-content-shell .sp-inspector-root-panel .mantine-NumberInput-root {
  justify-self: end;
  width: 110px;
}

/* 3. Legacy multi-column control grids collapse to a clean single column —
   at panel width they crammed labels ("Marker size", "Line width"). */
#new-content-shell #config-card .sp-layout-foundation-grid,
#new-content-shell #config-card .sp-layout-margin-grid,
#new-content-shell #config-card .sp-layout-section-grid,
#new-content-shell #config-card .sp-step4-behavior-grid,
#new-content-shell #config-card .sp-step4-window-grid {
  grid-template-columns: minmax(0, 1fr) !important;
  gap: 6px !important;
}

/* 4. Helper prose out of the flow (tooltips-someday); descriptions gone. */
#new-content-shell .sp-inspector-root-panel .mantine-InputWrapper-description {
  display: none !important;
}

/* 5. Consistent geometry: every well/button/segment in panels rides the
   4px radius; kills the leftover 10-14px pills. */
#new-content-shell .sp-inspector-root-panel .mantine-Input-input,
#new-content-shell .sp-inspector-root-panel .mantine-Button-root,
#new-content-shell .sp-inspector-root-panel .mantine-SegmentedControl-root,
#new-content-shell .sp-workspace-data-drawer .mantine-Input-input,
#new-content-shell .sp-workspace-data-drawer .mantine-Button-root {
  border-radius: var(--bc-rs) !important;
}

#new-content-shell .sp-builder-shell-topbar .mantine-Select-input,
#new-content-shell .sp-builder-shell-topbar .mantine-NumberInput-input,
#new-content-shell .sp-builder-shell-topbar .mantine-SegmentedControl-root {
  border-radius: var(--bc-rs) !important;
}

/* 6. Subsection rhythm: eyebrow, then rows, hairline between groups. */
#new-content-shell .sp-inspector-root-panel .sp-inspector-subsection {
  padding-top: 10px;
}

#new-content-shell .sp-inspector-root-panel .sp-inspector-subsection-body > * + * {
  margin-top: 6px;
}

/* Composite rows (a NumberInput + Switch sharing a Group): keep natural flow,
   compact label on top, no fixed width. */
#new-content-shell .sp-inspector-root-panel .mantine-Group-root .mantine-InputWrapper-root .mantine-InputWrapper-label {
  font-size: 11px !important;
  color: var(--bc-text2) !important;
}

#new-content-shell .sp-inspector-root-panel .mantine-Group-root .mantine-NumberInput-root {
  width: 80px;
  justify-self: start;
}

/* Helper prose (dimmed xs Texts) leaves the flow — production panels explain
   via tooltips, not paragraphs. (Style-sniff: Mantine inlines the dimmed
   color var; precedent selectors elsewhere in this band.) */
#new-content-shell .sp-inspector-root-panel .mantine-Text-root[style*="dimmed"] {
  display: none !important;
}

/* --- R3 round 2d: alignment triage (user screenshot) --------------------- */

/* Inactive root tabs: the legacy raised-box rule out-ranked the flatten —
   re-assert at winning specificity. */
#new-content-shell #config-card .sp-config-root-tabs .mantine-Tabs-tab:not([data-active]) {
  background: transparent !important;
  border-color: transparent !important;
  box-shadow: none !important;
  color: var(--bc-text2) !important;
}

/* Composite groups (side-by-side steppers + switches): wrap cleanly on a
   12px grid, bottom-aligned, no fixed widths fighting the labels. */
#new-content-shell .sp-inspector-root-panel .mantine-Group-root:has(> .mantine-InputWrapper-root) {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 8px 14px;
}

#new-content-shell .sp-inspector-root-panel .mantine-Group-root .mantine-NumberInput-root {
  width: 96px;
}

/* One surface, not boxes-in-boxes: the tab panel surface keeps its border,
   the first inner block (chart type card zone) drops its own. */
#new-content-shell .sp-config-root-panel-surface {
  padding: 10px !important;
}

#new-content-shell .sp-inspector-root-panel > .sp-guided-template-step .mantine-SegmentedControl-root {
  border: 0 !important;
  background: var(--bc-sunken) !important;
}

/* Rhythm: consistent 8px between rows, 30px switch rows. */
#new-content-shell .sp-inspector-root-panel {
  gap: 8px !important;
}

#new-content-shell .sp-inspector-root-panel .mantine-Switch-root {
  min-height: 28px;
}

/* --- R3 round 2e: the Data drawer sits BELOW the app bar (mockup .drawer
   top:52px) — full-bleed made the drawer occlude the topbar's left half
   (user report: "missing top main panel"). The app bar stays visible and
   interactive in both drawer variants.
   2a re-point: the global header is hidden on /new_content now, so "the app
   bar" = the builder topbar alone (was 104px = 58 header + 46 topbar). */
#new-content-shell .sp-workspace-data-drawer .sp-workspace-export-panel {
  top: 46px !important;
  height: calc(100vh - 46px) !important;
  max-height: calc(100vh - 46px) !important;
}

#new-content-shell .sp-workspace-data-drawer .sp-workspace-export-backdrop {
  top: 46px !important;
  height: calc(100vh - 46px) !important;
}

/* ==========================================================================
   Phase 2d (ui_redesign_kickoff) — profile/platform safe-zone boxes ride the
   editor tooling blue too. Base rule + local vars live in styles.css:493
   (unscoped); this later, higher-specificity override re-points them without
   touching styles.css.
   ========================================================================== */

#new-content-shell .sp-preview-layout-zone {
  --sp-preview-zone-border: color-mix(in srgb, var(--bc-editor-tool) 72%, transparent);
  --sp-preview-zone-fill: color-mix(in srgb, var(--bc-editor-tool) 10%, transparent);
}

/* ==========================================================================
   Phase 2a (ui_redesign_kickoff) — single header row: SUPERSEDED by Band S
   stage S-1a (decision S2 in docs/design/builder_v6_decisions.md, 2026-09-05,
   plan docs/new_content/studio_entry_plan.md §3). The global app header is
   VISIBLE on /new_content again, as on every other route: the route-class
   hide (`html/body.sp-route-new-content .sp-top-shell {display:none}`) and
   its reclaimed-height re-points are DELETED here. Every re-point was the
   base minimum minus the header's 58px (.sp-app-page-container styles.css:73,
   .sp-new-content-page :638, .sp-builder-shell-body :647 / :1186,
   .sp-builder-preview-empty :660), so the base rules simply apply again.
   The mounted studio's header is painted by assets/zz_site_chrome.css (DS
   dark on every route, `body:has(#app-container)` = (1,1,1), loads last),
   verified by computed style under the light app theme. The two older
   header-styling bands in this file are NOT deleted here (S-1a instruction)
   and are D-3 material with this evidence (S-1a probe, 2026-09-05):
   * the post-mount band `body:has(#new-content-shell) .sp-top-*` :404–460 —
     out-painted for every geometry/colour property the site-chrome file also
     sets; still live: the `#nav_question` active tint (:453, (2,0,1) beats the
     site-chrome pill at (1,2,1): 14% vs 16% orange — invisible) and hover
     colours;
   * the pre-mount band `sp-route-new-content:not(:has(#new-content-shell))`
     :242–366 — LIVE: its selectors are (1,2,1) and beat the site-chrome rules,
     so the header on this route is painted with the --feed-* tokens (navy
     header, blue Create pill / avatar under the light theme) while the studio
     has not mounted yet (the 6–10 s mount gap) and permanently on the
     anonymous login page of the route. Deleting the band (D-3) makes both
     surfaces DS dark; S-3b's pre-mount skeleton work touches the same window.
   The `sp-route-new-content` stamp (00_theme_bootstrap.js) stays: the C6 dark
   pin and the CSS scoping key on it. The studio topbar is a sub-row under the
   header (assets/zz_studio_header.css).
   ========================================================================== */

/* 2a topbar brand cluster: pure anchor (no id, no callbacks) authored in
   pages/new_content/layout.py — SP mark + "Feed" with a back arrow. */
#new-content-shell .sp-builder-topbar-feed-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  text-decoration: none;
  color: var(--bc-text2);
  font-size: 12.5px;
  font-weight: 700;
  white-space: nowrap;
}

#new-content-shell .sp-builder-topbar-feed-link:hover {
  color: var(--bc-text);
}

#new-content-shell .sp-builder-topbar-brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 7px;
  background: var(--bc-accent);
  color: var(--bc-accent-ink);
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.02em;
  flex: 0 0 auto;
}

#new-content-shell .sp-builder-topbar-back-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* ==========================================================================
   Phase 2c (ui_redesign_kickoff) — inspector row normalization. CSS-only.
   One row grammar (mockup .insp-row / kit .sp-ui-insp-row): label LEFT
   (ellipsis), control RIGHT, 38px min row. Applied to the label-carrying
   single-control types only (NumberInput / Select / ColorInput) — TextInput,
   Textarea, MultiSelect, SegmentedControl, Slider keep their stacked
   full-width layout (they need the horizontal room). The :has(> label) guard
   leaves bare label-less inputs (entity override swatches, pair grids)
   untouched. Scope: .sp-inspector-root-panel = every root tab's content
   (shared tab factory + the Element panel).
   ========================================================================== */

#new-content-shell .sp-inspector-root-panel .mantine-NumberInput-root:has(> .mantine-InputWrapper-label),
#new-content-shell .sp-inspector-root-panel .mantine-Select-root:has(> .mantine-InputWrapper-label),
#new-content-shell .sp-inspector-root-panel .mantine-ColorInput-root:has(> .mantine-InputWrapper-label) {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  column-gap: 10px;
  align-items: center;
  min-height: 38px;
  /* the row owns sizing — beats authored inline w= widths */
  width: 100% !important;
}

#new-content-shell .sp-inspector-root-panel .mantine-NumberInput-root:has(> .mantine-InputWrapper-label) > .mantine-InputWrapper-label,
#new-content-shell .sp-inspector-root-panel .mantine-Select-root:has(> .mantine-InputWrapper-label) > .mantine-InputWrapper-label,
#new-content-shell .sp-inspector-root-panel .mantine-ColorInput-root:has(> .mantine-InputWrapper-label) > .mantine-InputWrapper-label {
  grid-column: 1;
  grid-row: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 0;
}

#new-content-shell .sp-inspector-root-panel .mantine-NumberInput-root:has(> .mantine-InputWrapper-label) > .mantine-InputWrapper-description,
#new-content-shell .sp-inspector-root-panel .mantine-Select-root:has(> .mantine-InputWrapper-label) > .mantine-InputWrapper-description,
#new-content-shell .sp-inspector-root-panel .mantine-ColorInput-root:has(> .mantine-InputWrapper-label) > .mantine-InputWrapper-description {
  grid-column: 1;
  grid-row: 2;
  margin: 0;
}

#new-content-shell .sp-inspector-root-panel .mantine-NumberInput-root:has(> .mantine-InputWrapper-label) > .mantine-InputWrapper-error {
  grid-column: 1 / -1;
  margin: 0;
}

#new-content-shell .sp-inspector-root-panel .mantine-NumberInput-root:has(> .mantine-InputWrapper-label) > .mantine-Input-wrapper,
#new-content-shell .sp-inspector-root-panel .mantine-Select-root:has(> .mantine-InputWrapper-label) > .mantine-Input-wrapper,
#new-content-shell .sp-inspector-root-panel .mantine-ColorInput-root:has(> .mantine-InputWrapper-label) > .mantine-Input-wrapper {
  grid-column: 2;
  grid-row: 1;
  margin: 0;
}

/* Control-cell widths (mockup: compact numeric boxes, pill selects/swatches) */
#new-content-shell .sp-inspector-root-panel .mantine-NumberInput-root:has(> .mantine-InputWrapper-label) > .mantine-Input-wrapper {
  width: 120px;
}

#new-content-shell .sp-inspector-root-panel .mantine-Select-root:has(> .mantine-InputWrapper-label) > .mantine-Input-wrapper,
#new-content-shell .sp-inspector-root-panel .mantine-ColorInput-root:has(> .mantine-InputWrapper-label) > .mantine-Input-wrapper {
  width: 176px;
}

/* Switch rows: label LEFT, track RIGHT (Mantine default is track-then-label) */
#new-content-shell .sp-inspector-root-panel .mantine-Switch-root {
  width: 100% !important;
}

#new-content-shell .sp-inspector-root-panel .mantine-Switch-body {
  width: 100%;
  flex-direction: row-reverse;
  align-items: center;
  gap: 10px;
}

#new-content-shell .sp-inspector-root-panel .mantine-Switch-labelWrapper {
  flex: 1 1 auto;
  min-width: 0;
  padding-inline-start: 0;
}

/* --- 2a follow-up: topbar density ladder (user report: clusters collide on
   "Full HD" = 1920 device px at 125% OS scaling = 1536 CSS px). The loaded
   topbar needs ~1690px; between the desktop layout and the ≤1180 wrap there
   was no compression strategy, so the Grid/undo cluster clipped into the
   Platform select. Tiers: shed the decorative left-cluster text first, then
   the breadcrumb, then let the bar wrap. NOTE: the ≤1180 breakpoint is
   COUPLED to new_content_layout_editor.js (innerWidth <= 1180 drops the
   side-panel vars) — never move it. */
@media (min-width: 1181px) and (max-width: 1780px) {
  /* The SP mark keeps being the way back (link carries title="Back to feed");
     "Content Studio" is decorative — the breadcrumb keeps the context. */
  #new-content-shell .sp-builder-topbar-back-label,
  #new-content-shell .sp-builder-brand {
    display: none;
  }

  #new-content-shell .sp-editor-topbar-platform {
    width: 122px !important;
    min-width: 122px !important;
  }
}

@media (min-width: 1181px) and (max-width: 1520px) {
  #new-content-shell .sp-builder-breadcrumb-name {
    display: none;
  }

  #new-content-shell .sp-editor-topbar-platform {
    width: 104px !important;
    min-width: 104px !important;
  }
}

/* Narrow desktop (above the JS-coupled 1180): let the actions cluster flow
   to a second line instead of colliding. */
@media (min-width: 1181px) and (max-width: 1330px) {
  #new-content-shell .sp-builder-shell-topbar-inner {
    flex-wrap: wrap !important;
  }
}

/* 2c scoped bug fix: "Logo gap (px)" × "Marker size" label collision — the
   look group's grow/wrap Group crammed row neighbours onto shared lines; it
   now stacks one control per row (the row grammar owns the width). */
#new-content-shell .sp-inspector-root-panel .mantine-Group-root:has(> #style-logo-gap-wrap) {
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
}

/* Mantine grow-Group caps each child at max-width calc(100%/N - gap) — in the
   stacked layout that squeezed the plain-div wraps (and their labels) to
   ~58px. Lift the cap for every child of THIS group (the labeled input roots
   already carry Mantine's own max-width:100%). */
#new-content-shell .sp-inspector-root-panel .mantine-Group-root:has(> #style-logo-gap-wrap) > * {
  max-width: 100% !important;
  flex-basis: auto;
}

#new-content-shell #style-logo-gap-wrap,
#new-content-shell #style-marker-size-wrap {
  width: 100%;
}


/* ==========================================================================
   Experience redesign, stage A (docs/new_content/experience_redesign.md) —
   tap-to-load saved-stats picker inside the Data drawer. The card list
   (#question-picker-list, rendered by _render_question_picker) replaces the
   sel-question dropdown as the visible selection surface; a tap rides the
   deeplink-fire load path. Chrome tokens only (--bc-*), content untouched.
   ========================================================================== */

#new-content-shell .sp-question-picker-search {
  margin-top: 2px;
}

#new-content-shell .sp-question-picker-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#new-content-shell .sp-question-picker-status {
  margin: 4px 2px;
  font-size: 12px;
  color: var(--bc-text2);
}

#new-content-shell .sp-question-pick-card {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  background: var(--bc-raised);
  border: 1px solid var(--bc-border);
  border-radius: 12px;
  padding: 10px 12px;
  cursor: pointer;
  color: var(--bc-text);
  font-family: inherit;
  transition: border-color 120ms ease, background 120ms ease;
}

#new-content-shell .sp-question-pick-card:hover {
  border-color: color-mix(in srgb, var(--bc-accent) 55%, var(--bc-border));
}

#new-content-shell .sp-question-pick-card.is-active {
  border-color: var(--bc-accent);
  background: color-mix(in srgb, var(--bc-accent) 12%, var(--bc-raised));
}

#new-content-shell .sp-question-pick-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

#new-content-shell .sp-question-pick-cat {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--bc-accent);
}

#new-content-shell .sp-question-pick-title {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#new-content-shell .sp-question-pick-meta {
  font-size: 11px;
  color: var(--bc-text2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#new-content-shell .sp-question-pick-chevron {
  flex: none;
  color: var(--bc-text2);
}

/* Tap-to-load makes btn-load a secondary "reload with filters" action — the
   primary gesture is the card tap. De-emphasize, keep id/behavior intact. */
#new-content-shell .sp-setup-load-button {
  opacity: 0.85;
}

/* Mobile: the Data drawer becomes the full-width picker surface (the builder
   topbar stays visible as the way back). */
@media (max-width: 640px) {
  #new-content-shell .sp-workspace-data-drawer .sp-workspace-export-panel {
    width: 100vw !important;
    max-width: 100vw !important;
    border-right: 0 !important;
  }
}

/* ==========================================================================
   Experience redesign, stage B2 (docs/new_content/experience_redesign.md) —
   MOBILE TOPBAR: one 48px row — SP mark (back) · dataset title · undo/redo ·
   Data (icon) · Export. Everything hidden here stays reachable elsewhere:
   platform/ratio → Canvas tab presets, duration → Motion, profile save →
   Export drawer / preset modal, Boxes/Grid/Full-Compact = desktop editor
   conveniences. Hide-only (ids stay mounted for callbacks), ≤640 scoped.
   ========================================================================== */

@media (max-width: 640px) {
  #new-content-shell .sp-builder-shell-topbar {
    padding: 8px 10px !important;
  }

  /* the topbar-inner is a named-area GRID (zz≈3228); ≤980 stacks
     primary/controls/actions as rows — re-template to ONE row here
     (controls is display:none on mobile anyway) */
  #new-content-shell .sp-builder-shell-topbar-inner {
    grid-template-areas: "primary actions" !important;
    grid-template-columns: minmax(0, 1fr) max-content !important;
    column-gap: 8px !important;
    align-items: center !important;
  }

  #new-content-shell .sp-builder-shell-topbar-primary {
    width: auto !important;
    min-width: 0;
    flex-wrap: nowrap !important;
    gap: 8px !important;
  }

  #new-content-shell .sp-builder-shell-heading-inline {
    flex: 1 1 auto;
    width: auto !important;
    min-width: 0 !important;
    gap: 8px !important;
  }

  #new-content-shell .sp-builder-topbar-back-label,
  #new-content-shell .sp-builder-brand,
  #new-content-shell .sp-editor-topbar-platform,
  #new-content-shell .sp-editor-topbar-zones,
  #new-content-shell .sp-preview-save-profile,
  #new-content-shell .sp-preview-preset-trigger {
    display: none !important;
  }

  /* UX 3.3 (decision D-53, 2026-09-14): the toolbar #preview-controls is no longer
     hidden as a whole — only the Boxes switch (`.sp-preview-boxes-toggle`, the SAME
     dmc.Switch `layout-editor-overlay-visible`, one writer) reaches the phone, as the
     topbar's own second row above the canvas, right-aligned. Everything else in the
     row stays a desktop convenience: Full / Compact (after 3.2 the whole stage is
     scaled to fit, Compact's crop is redundant here), Grid + the nudge step, the
     motion / aspect cluster. Hide-only — every id stays mounted for its callbacks.
     The row auto-places into an implicit grid row spanning both columns, so it takes
     no space while the callback keeps the toolbar `display: none` (pre-data). */
  #new-content-shell .sp-builder-shell-topbar #preview-controls {
    grid-area: auto;
    grid-column: 1 / -1;
    justify-self: end;
    width: max-content !important;
  }

  #new-content-shell .sp-builder-shell-topbar #preview-edit-row {
    display: flex !important;
    width: auto !important;
    height: auto !important;
    min-height: 0;
    justify-content: flex-end !important;
  }

  #new-content-shell .sp-builder-shell-topbar #preview-edit-row > *:not(.sp-preview-controls-toolbar),
  #new-content-shell .sp-builder-shell-topbar .sp-preview-controls-toolbar > *:not(.sp-preview-boxes-toggle) {
    display: none !important;
  }

  /* the ≤520 band makes the toolbar `display: contents`; keep it a plain flex row here */
  #new-content-shell .sp-builder-shell-topbar .sp-preview-controls-toolbar {
    display: flex !important;
    width: auto !important;
  }

  /* the loaded dataset name IS the title — one line, ellipsis */
  #new-content-shell .sp-builder-breadcrumb-name {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  /* "← Edit data" (plan A5b): keep the label — an icon-only arrow would read
     as a second back button next to the SP mark; the breadcrumb yields width */
  #new-content-shell .sp-editor-topbar-data {
    flex: 0 0 auto;
    padding: 0 8px;
  }

  #new-content-shell .sp-editor-topbar-data .mantine-Button-label {
    font-size: 12px;
  }

  #new-content-shell .sp-editor-topbar-data .mantine-Button-section {
    margin-inline-end: 4px;
  }

  /* longer selector: the ≤980 band sets width:100% at id+2class specificity */
  #new-content-shell .sp-builder-shell-topbar .sp-editor-topbar-actions {
    display: flex !important;
    width: max-content !important;
    justify-self: end;
    margin-left: 0 !important;
    gap: 6px !important;
  }
}

/* ==========================================================================
   Experience redesign, stage B3/C (docs/new_content/experience_redesign.md) —
   mobile canvas column: the "Showing ..." filter summary (#preview-action-panel)
   is desktop chrome; on phones it ate ~120px above the stage. Filters re-home
   into the Data surface in stage D. Hide-only, ≤640 scoped.
   ========================================================================== */

@media (max-width: 640px) {
  #new-content-shell #preview-action-panel {
    display: none !important;
  }

  /* the canvas card is the stage — drop its desktop card chrome */
  #new-content-shell #figure-card {
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
  }

  #new-content-shell .sp-builder-preview-shell {
    padding-top: 6px !important;
  }
}

/* Stage C: the zz≈2657 rule hides the layout-output-preset card in favor of
   the TOPBAR ratio selector — which the mobile band hides. Inside the SETUP
   panel the card IS the format surface: un-hide it there (both breakpoints;
   the value stays synced with the topbar path via the existing callbacks). */
#new-content-shell #config-card .mantine-Tabs-panel[id$="-panel-setup"] .sp-step4-field-card:has(#layout-output-preset) {
  display: block !important;
}

/* Stage C styling: Setup "Format" ratio chips (mockup fmt-row look) */
#new-content-shell .sp-setup-format-chips .mantine-SegmentedControl-label {
  font-size: 11.5px !important;
  font-weight: 700 !important;
  padding: 8px 4px !important;
}

#new-content-shell .sp-setup-format-chips.mantine-SegmentedControl-root {
  background: var(--bc-sunken) !important;
  border: 1px solid var(--bc-border-soft) !important;
  border-radius: 12px !important;
}
