/* ============================================================================
   zz_studio_finetuning.css — the Post studio FINE-TUNING settings-group card
   (plan stages C-5a + C-5b + C-5c + C-6c-i; docs/design/new_content_screen.md §6.1 +
   §6.4; decisions C8 (PRO = the shipped free Simple/Pro reveal, no paywall) +
   C10 (accordion order) in docs/design/builder_v6_decisions.md; map rows A1
   cfg-show-value-labels + cfg-value-label-*, A3 "Values card", B4 Motion tab
   (C-5a), B3 Annotate tab, B2 "Background style" / "Brand chip (watermark)" /
   "Season chip + Story beat", B1 "Source card" (C-5b), A3 "Look group" /
   "Bar chart sections" / "Axes — fine tuning", B2 "Manual frame & margins" +
   "Dead frame controls" (C-5c), B1 "Layers panel" / "Element typography cards" /
   "Selected element settings" (C-6c-i) in docs/new_content/studio_control_map.md).

   Scope: :is(#new-content-shell, #editor-workspace-root) .sp-studio-card--finetuning. The shared card
   grammar (.sp-studio-card, -head, -eyebrow, -body, .sp-studio-row,
   .sp-studio-row-label, .sp-studio-toggle) lives in zz_studio_output.css (C-2)
   / zz_studio_text.css (C-3) / zz_studio_look.css (C-4) and is only USED here;
   the DS toggle geometry is restated under THIS card's scope (the C-3/C-4
   pattern — those files stay untouched).

   Pieces:
   * PRO badge (DS §5 "PRO badge / PRO režim"): a CSS ::after on the card's
     eyebrow — mono 700 pill, neutral #22242B / #6E6A63 while :is(#config-card, #editor-tools) is
     .sp-inspector-simple, active #FF6B2C / #0D0E12 in .sp-inspector-pro.
   * The reveal (C8): `.sp-ft-unlock` is a plain <label for="inspector-pro-toggle">
     — the DS §1.5 PRO unlock button (linear-gradient(140deg,#2A1608,#1A1108),
     border + text #FF6B2C, pill, 34px / 42px on mobile). Which of its two spans
     shows follows :is(#config-card, #editor-tools)'s Simple/Pro class. No id, no callback.
   * `.sp-ft-body` is `.sp-pro-only`: the EXISTING gate rule
     (zz_new_content.css `:is(#new-content-shell, #editor-workspace-root) .sp-inspector-simple .sp-pro-only
     { display:none }`) hides it in Simple mode. This file therefore NEVER sets
     `display` on .sp-ft-body (equal specificity + later file order would
     defeat the gate) — tests/new_content/test_studio_finetuning.py guards it.
   * The accordion (DS §5 "Akordeonová karta"): item ground #13141A, hairline
     #1B1C22, radius 12, title #F2EFE9, chevron #6E6A63; ONE dmc.Accordion with
     multiple=False = "at most one expanded" without a callback.
   * FT-1 rows: DS §4 toggle rows (label left, 38×24 track right), the DS
     label + mono value row (Max decimals) and the DS input row (Value suffix);
     the Chart-tab "Values" detail set sits under a hairline as `.sp-ft-values-
     detail` in the inspector's own dense grammar (the R3 root-panel rules
     still apply inside the card — Switch rows label-left, inputs 30px).
   * FT-3: the former Motion tab wholesale; the Paper of the final-hold block
     loses its card chrome, the nested Timing internals / Motion density
     accordions keep the R3 flat-row look (they sit inside an id-less
     .sp-inspector-subsection-body, as they did in the tab).
   * FT-2 (C-5b): the former Annotate tab wholesale — the seven-group
     `.sp-config-settings-accordion` inside an id-less subsection body, so the
     R3 flat-accordion rules and new_content_annotations.css keep applying;
     this file only lets the two DataTables and the pattern cards shrink to
     the card's width (min-width 0 + horizontal scroll inside the table).
   * FT-4 (C-5b): headline rows in the DS grammar — "Background style" = the
     7-value Select in the DS input skin (`.sp-ft-select`, the C-4 Select
     skin restated), "Header glow" = DS toggle row, "Watermark" = a head row
     (label + DS toggle) over the DS text input (the C-3 TEXT-row pattern,
     `.sp-ft-row-head`), "Source" = the autosize Textarea in the DS input skin
     (`.sp-ft-textarea`, the C-3 textarea skin restated); then, under a
     "Detail" hairline (`.sp-ft-canvas-detail`, an id-less subsection), the
     Background / Story blocks accordions and the Source typography cards in
     the inspector's dense grammar exactly as they rendered in the Canvas /
     Element tabs.
   * FT-5 (C-5c): headline rows in the DS grammar — "Line width" / "Marker
     size" = the whole callback-gated wrappers (style-line-width-wrap /
     style-marker-size-wrap, `style` written by control_gating) as the row's
     control, the row hiding with its wrapper through `:has([style*="display:
     none"])` (CSS only — the gating is untouched; the nested "Bar chart"
     subsection hides the same way when both bar wrappers are hidden); "Show dots" + "Line glow"
     = DS toggle rows, the glow row over the SAME dmc.Slider in the DS §4
     slider skin (`.sp-ft-slider`: track #2A2C33 4px, bar + thumb #FF6B2C,
     mono marks; Mantine Slider vars); "Head / logo size" = the DS mono value
     row; "Fill between lines" = the SAME 5-value SegmentedControl in the DS
     segment skin (`.sp-ft-segments`, the C-2/C-4 skin restated). Under the
     "Detail" hairline + eyebrow (`.sp-ft-chart-detail`): logo gap, the
     initials fallback, the three ColorInputs and the nested "Bar chart"
     subsection (the two bar-gated wrappers with their Dividers / Papers,
     card chrome flattened) in the inspector's dense grammar.
   * FT-6 (C-5c): one id-less `.sp-ft-advanced-section` holding the control
     map's sub-headings as nested titled subsections (`.sp-ft-advanced-group`
     — mono CAPS 10px #6E6A63 titles over a hairline); the "Scatter" group
     hides together with its gated `scatter-settings-panel` (`:has()` on the
     inline display); the entity-overrides Paper loses its card chrome; the
     four CSS-dead frame controls stay hidden by the zz_new_content.css
     `:has(#id)` rules (id-keyed — they work anywhere); the scatter quadrants
     DataTable shrinks to the card (min-width 0 + horizontal scroll, the FT-2
     pattern).
   * FT-6 "Elements & layers" (C-6c-i): the former Element tab wholesale as
     the FIRST sub-heading (`.sp-ft-elements-section`, also an
     `.sp-ft-advanced-group` — flush, the "Frame & padding" group takes the
     hairline instead): the callback-gated Layers panel
     (`workspace-layout-section-accordion`, already flattened by the R3
     `.sp-inspector-root-panel` rule — the Setup panel carries that class),
     the contextual panel (`workspace-selection-empty-state` +
     `workspace-selection-controls-wrap`; its `style` is callback-written, so
     this file NEVER sets `display` on it — only its Paper chrome is
     flattened at 3 ids against the zz_new_content.css:741 `!important` band)
     and the three typography cards (`section-text-cards-wrap`, the Paper
     chrome + the :2462 `!important` padding flattened the same way; the
     inner element cards keep their id-keyed :2470 flat look). The R3
     dense-grammar rules keyed on the two ids (:3592–3690) and on
     `.sp-inspector-root-panel` keep matching in the new home — nothing is
     restated. The inner "Position & size (manual)" accordion and the
     `.sp-layout-section-grid` (:is(#config-card-keyed, #editor-config-card-keyed)) render as they did.

   Cascade: this file sorts BEFORE zz_studio_header / _look / _output / _text
   ("zz_studio_f" < "zz_studio_h"), so every override of the shared grammar
   or of a zz_new_content.css !important band carries :is(#config-card, #editor-tools) (2 ids) and
   wins on specificity, never on order. The parked-tab rule
   (`sp-config-root-tab--parked`) is NOT repeated here — it lives in
   zz_studio_look.css and is only used. Nothing in styles.css /
   zz_new_content.css is edited.
   ========================================================================== */

:is(#new-content-shell, #editor-workspace-root) .sp-studio-card--finetuning {
  --st-input-h: 34px;
  --st-toggle-w: 38px;
  --st-toggle-h: 24px;
  --st-toggle-knob: 18px;
  --st-toggle-inset: 3px;
  --st-unlock-h: 34px;
  --st-ft-control-h: 40px;
  --st-ft-inset: #13141a;    /* DS §1.1 "Vnořená karta" (surface-inset) — no --bc-* token yet */
  --st-ft-neutral: var(--sp-chip);  /* DS §1.1 "Dráha / neutrální chip" — no --bc-* token yet */
}

/* ---- PRO badge on the eyebrow (DS §5) ------------------------------------ */
:is(#new-content-shell, #editor-workspace-root) .sp-studio-card--finetuning .sp-studio-card-eyebrow::after {
  content: "PRO";
  display: inline-block;
  margin-left: 8px;
  padding: 3px 7px;
  border-radius: 999px;
  background: var(--st-ft-neutral);
  color: var(--bc-faint);
  font-family: var(--st-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1;
  vertical-align: middle;
  transition: background-color 0.15s ease, color 0.15s ease;
}

/* "active" while the reveal is on (the Pro clientside owns :is(#config-card, #editor-tools)'s class) */
:is(#new-content-shell, #editor-workspace-root) :is(#config-card, #editor-tools).sp-inspector-pro .sp-studio-card--finetuning .sp-studio-card-eyebrow::after {
  background: var(--bc-accent);
  color: var(--bc-accent-ink);
}

/* ---- the reveal: a <label> for the shipped Pro switch (DS §1.5) ---------- */
:is(#new-content-shell, #editor-workspace-root) .sp-studio-card--finetuning .sp-ft-unlock {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: var(--st-unlock-h);
  margin: 0;
  padding: 0 14px;
  border: 1px solid var(--bc-accent);
  border-radius: 999px;
  background: linear-gradient(140deg, #2a1608, #1a1108);
  color: var(--bc-accent);
  font-family: var(--st-ui);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: border-color 0.15s ease, color 0.15s ease;
}

:is(#new-content-shell, #editor-workspace-root) .sp-studio-card--finetuning .sp-ft-unlock:hover {
  border-color: var(--bc-accent-hover);
  color: var(--bc-accent-hover);
}

:is(#new-content-shell, #editor-workspace-root) .sp-studio-card--finetuning .sp-ft-unlock-off,
:is(#new-content-shell, #editor-workspace-root) .sp-studio-card--finetuning .sp-ft-unlock-on {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* locked = 🔒 (DS §4 "PRO sekce: zamčeno = ztlumit + ikona"), open = ▴ */
:is(#new-content-shell, #editor-workspace-root) .sp-studio-card--finetuning .sp-ft-unlock-off::before {
  content: "\1F512";
  font-size: 12px;
  line-height: 1;
}

:is(#new-content-shell, #editor-workspace-root) .sp-studio-card--finetuning .sp-ft-unlock-on::after {
  content: "\25B4";
  font-size: 12px;
  line-height: 1;
}

/* which caption shows follows :is(#config-card, #editor-tools)'s Simple/Pro class */
:is(#new-content-shell, #editor-workspace-root) :is(#config-card, #editor-tools).sp-inspector-simple .sp-studio-card--finetuning .sp-ft-unlock-on,
:is(#new-content-shell, #editor-workspace-root) :is(#config-card, #editor-tools).sp-inspector-pro .sp-studio-card--finetuning .sp-ft-unlock-off {
  display: none;
}

/* the keyboard path: the switch's own focus ring lands on the label */
:is(#new-content-shell, #editor-workspace-root) :is(#config-card, #editor-tools) .sp-studio-card--finetuning:has(:is(#inspector-pro-toggle, #editor-inspector-pro-toggle):focus-visible) .sp-ft-unlock,
:is(#new-content-shell, #editor-workspace-root) .sp-studio-card--finetuning .sp-ft-unlock:focus-visible {
  outline: 2px solid var(--bc-accent);
  outline-offset: 2px;
}

/* ---- the body (.sp-pro-only — NO display rule here, see the header) ------ */
:is(#new-content-shell, #editor-workspace-root) .sp-studio-card--finetuning .sp-ft-body {
  margin-top: 2px;
  min-width: 0;
}

/* ---- the accordion (DS §5 "Akordeonová karta") -------------------------- */
:is(#new-content-shell, #editor-workspace-root) :is(#config-card, #editor-tools) .sp-studio-card--finetuning .sp-ft-accordion {
  width: 100%;
  min-width: 0;
}

:is(#new-content-shell, #editor-workspace-root) :is(#config-card, #editor-tools) .sp-studio-card--finetuning .sp-ft-accordion > .sp-ft-item {
  margin-top: 8px !important;
  border: 1px solid var(--bc-border-soft) !important;
  border-radius: 12px !important;
  background: var(--st-ft-inset) !important;
  box-shadow: none !important;
  overflow: hidden;
  transition: border-color 0.15s ease;
}

:is(#new-content-shell, #editor-workspace-root) :is(#config-card, #editor-tools) .sp-studio-card--finetuning .sp-ft-accordion > .sp-ft-item:first-child {
  margin-top: 0 !important;
}

:is(#new-content-shell, #editor-workspace-root) :is(#config-card, #editor-tools) .sp-studio-card--finetuning .sp-ft-accordion > .sp-ft-item[data-active] {
  border-color: var(--bc-border) !important;
}

:is(#new-content-shell, #editor-workspace-root) :is(#config-card, #editor-tools) .sp-studio-card--finetuning .sp-ft-item > .mantine-Accordion-itemTitle {
  margin: 0;
  font-size: inherit;
}

:is(#new-content-shell, #editor-workspace-root) :is(#config-card, #editor-tools) .sp-studio-card--finetuning .sp-ft-item .sp-ft-control {
  box-sizing: border-box;
  min-height: var(--st-ft-control-h) !important;
  padding: 8px 12px !important;
  background: transparent !important;
  color: var(--bc-text) !important;
  font-family: var(--st-ui);
  font-size: 13px !important;
  font-weight: 600 !important;
  line-height: 1.2;
  border-radius: 0 !important;
}

:is(#new-content-shell, #editor-workspace-root) :is(#config-card, #editor-tools) .sp-studio-card--finetuning .sp-ft-item .sp-ft-control:hover {
  background: color-mix(in srgb, var(--bc-text) 4%, transparent) !important;
}

:is(#new-content-shell, #editor-workspace-root) :is(#config-card, #editor-tools) .sp-studio-card--finetuning .sp-ft-item .sp-ft-control .mantine-Accordion-label {
  padding: 0 !important;
  color: var(--bc-text) !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  line-height: 1.2 !important;
}

:is(#new-content-shell, #editor-workspace-root) :is(#config-card, #editor-tools) .sp-studio-card--finetuning .sp-ft-item .sp-ft-control .mantine-Accordion-chevron {
  color: var(--bc-faint) !important;
}

:is(#new-content-shell, #editor-workspace-root) :is(#config-card, #editor-tools) .sp-studio-card--finetuning .sp-ft-item[data-active] > .mantine-Accordion-itemTitle {
  border-bottom: 1px solid var(--bc-border-soft);
}

:is(#new-content-shell, #editor-workspace-root) :is(#config-card, #editor-tools) .sp-studio-card--finetuning .sp-ft-item > .mantine-Accordion-panel .mantine-Accordion-content {
  padding: 10px 12px 12px !important;
}

:is(#new-content-shell, #editor-workspace-root) .sp-studio-card--finetuning .sp-ft-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

/* ---- FT-1 rows ------------------------------------------------------------ */
:is(#new-content-shell, #editor-workspace-root) .sp-studio-card--finetuning .sp-ft-row--toggle,
:is(#new-content-shell, #editor-workspace-root) .sp-studio-card--finetuning .sp-ft-row--number {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 32px;
}

/* the headline toggle off: the row label dims so the state reads without the toggle */
:is(#new-content-shell, #editor-workspace-root) .sp-studio-card--finetuning .sp-ft-row--toggle:has(.sp-studio-toggle .mantine-Switch-input:not(:checked)) .sp-studio-row-label {
  color: var(--bc-faint);
}

/* DS toggle (§4) — geometry via Mantine's Switch vars. The
   .sp-inspector-root-panel rule (zz_new_content.css:5105) stretches every
   Switch root to 100% and reverses its body for label-left rows; this toggle
   has no label and sits in its own row, so it shrinks back to its track. */
:is(#new-content-shell, #editor-workspace-root) .sp-studio-card--finetuning .sp-studio-toggle.mantine-Switch-root {
  --switch-width: var(--st-toggle-w);
  --switch-height: var(--st-toggle-h);
  --switch-thumb-size: var(--st-toggle-knob);
  --switch-track-padding: var(--st-toggle-inset);
  --switch-radius: 999px;
  width: auto !important;
  min-height: 0;
  flex: 0 0 auto;
  margin: 0;
}

:is(#new-content-shell, #editor-workspace-root) .sp-studio-card--finetuning .sp-studio-toggle .mantine-Switch-body {
  width: auto;
  gap: 0;
}

:is(#new-content-shell, #editor-workspace-root) .sp-studio-card--finetuning .sp-studio-toggle .mantine-Switch-track {
  box-sizing: border-box;
  width: var(--st-toggle-w);
  min-width: var(--st-toggle-w);
  height: var(--st-toggle-h);
  border: 0;
  border-radius: 999px;
  background: var(--bc-border);
  cursor: pointer;
  transition: background-color 0.2s ease;
}

:is(#new-content-shell, #editor-workspace-root) .sp-studio-card--finetuning .sp-studio-toggle .mantine-Switch-thumb {
  width: var(--st-toggle-knob);
  height: var(--st-toggle-knob);
  border: 0;
  border-radius: 999px;
  background: var(--bc-text);
  inset-inline-start: var(--st-toggle-inset);
  transition: inset-inline-start 0.2s ease;
}

/* ON: orange track (DS §4 "Toggle" — the switch idiom stays orange, C5); the
   knob stays #F2EFE9 (the older amber rule at zz_new_content.css:4078 paints
   it ink — overridden here at higher specificity). */
:is(#new-content-shell, #editor-workspace-root) .sp-studio-card--finetuning .sp-studio-toggle .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) .sp-studio-card--finetuning .sp-studio-toggle .mantine-Switch-input:checked + .mantine-Switch-track .mantine-Switch-thumb {
  background: var(--bc-text) !important;
  border-color: var(--bc-text) !important;
  inset-inline-start: calc(100% - var(--st-toggle-knob) - var(--st-toggle-inset));
}

:is(#new-content-shell, #editor-workspace-root) .sp-studio-card--finetuning .sp-studio-toggle .mantine-Switch-input:focus-visible + .mantine-Switch-track {
  outline: 2px solid var(--bc-accent);
  outline-offset: 2px;
}

/* Max decimals: the DS label + mono value row (the C-2 duration skin).
   Selector weight: the R3 density rule (zz_new_content.css:4267, 2 ids + 3
   classes, !important) sets 30px on every inspector input and :4796 turns
   every InputWrapper into a two-column label grid; these chains carry 2 ids
   + 3 classes and win on specificity. */
:is(#new-content-shell, #editor-workspace-root) :is(#config-card, #editor-tools) .sp-studio-card--finetuning .sp-ft-number-input.mantine-NumberInput-root,
:is(#new-content-shell, #editor-workspace-root) :is(#config-card, #editor-tools) .sp-studio-card--finetuning .sp-ft-number-input .mantine-Input-wrapper {
  display: block !important;
  width: 96px !important;
  min-width: 0 !important;
  max-width: 96px !important;
  flex: 0 0 auto;
}

:is(#new-content-shell, #editor-workspace-root) :is(#config-card, #editor-tools) .sp-studio-card--finetuning .sp-ft-number-input .mantine-NumberInput-input,
:is(#new-content-shell, #editor-workspace-root) :is(#config-card, #editor-tools) .sp-studio-card--finetuning .sp-ft-number-input .mantine-Input-input {
  box-sizing: border-box;
  min-height: 32px !important;
  height: 32px !important;
  padding: 0 24px 0 10px !important;
  border: 1px solid var(--bc-border) !important;
  border-radius: 10px !important;
  background: var(--bc-raised) !important;
  color: var(--bc-text) !important;
  font-family: var(--st-mono) !important;
  font-size: 12.5px !important;
  font-weight: 700 !important;
  font-variant-numeric: tabular-nums;
  text-align: right !important;
  box-shadow: none !important;
  transition: border-color 0.15s ease;
}

:is(#new-content-shell, #editor-workspace-root) :is(#config-card, #editor-tools) .sp-studio-card--finetuning .sp-ft-number-input .mantine-Input-input:focus,
:is(#new-content-shell, #editor-workspace-root) :is(#config-card, #editor-tools) .sp-studio-card--finetuning .sp-ft-number-input .mantine-Input-input:focus-visible {
  border-color: var(--bc-accent) !important;
  outline: none;
}

:is(#new-content-shell, #editor-workspace-root) :is(#config-card, #editor-tools) .sp-studio-card--finetuning .sp-ft-number-input .mantine-NumberInput-controls {
  width: 20px !important;
  right: 2px !important;
  border: 0 !important;
}

:is(#new-content-shell, #editor-workspace-root) :is(#config-card, #editor-tools) .sp-studio-card--finetuning .sp-ft-number-input .mantine-NumberInput-control {
  width: 20px !important;
  min-height: 14px !important;
  height: 14px !important;
  border: 0 !important;
  background: transparent !important;
  color: var(--bc-text2) !important;
}

:is(#new-content-shell, #editor-workspace-root) :is(#config-card, #editor-tools) .sp-studio-card--finetuning .sp-ft-number-input .mantine-NumberInput-control:hover {
  color: var(--bc-accent) !important;
  background: color-mix(in srgb, var(--bc-accent) 10%, transparent) !important;
}

/* Value suffix: the DS input row (the C-3 input skin) */
:is(#new-content-shell, #editor-workspace-root) :is(#config-card, #editor-tools) .sp-studio-card--finetuning .sp-ft-text-input.mantine-TextInput-root,
:is(#new-content-shell, #editor-workspace-root) :is(#config-card, #editor-tools) .sp-studio-card--finetuning .sp-ft-text-input.mantine-InputWrapper-root,
:is(#new-content-shell, #editor-workspace-root) :is(#config-card, #editor-tools) .sp-studio-card--finetuning .sp-ft-text-input .mantine-Input-wrapper {
  display: block !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
}

:is(#new-content-shell, #editor-workspace-root) :is(#config-card, #editor-tools) .sp-studio-card--finetuning .sp-ft-text-input .mantine-Input-input {
  box-sizing: border-box;
  min-height: var(--st-input-h) !important;
  height: var(--st-input-h) !important;
  padding: 0 10px !important;
  border: 1px solid var(--bc-border) !important;
  border-radius: 10px !important;
  background: var(--bc-raised) !important;
  color: var(--bc-text) !important;
  font-family: var(--st-ui) !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  line-height: 1.35 !important;
  box-shadow: none !important;
  transition: border-color 0.15s ease;
}

:is(#new-content-shell, #editor-workspace-root) :is(#config-card, #editor-tools) .sp-studio-card--finetuning .sp-ft-text-input .mantine-Input-input::placeholder {
  color: var(--bc-faint) !important;
  opacity: 1;
}

:is(#new-content-shell, #editor-workspace-root) :is(#config-card, #editor-tools) .sp-studio-card--finetuning .sp-ft-text-input .mantine-Input-input:focus,
:is(#new-content-shell, #editor-workspace-root) :is(#config-card, #editor-tools) .sp-studio-card--finetuning .sp-ft-text-input .mantine-Input-input:focus-visible {
  border-color: var(--bc-accent) !important;
  outline: none;
}

/* the Chart-tab "Values" detail set: under a hairline, in the dense inspector grammar */
:is(#new-content-shell, #editor-workspace-root) .sp-studio-card--finetuning .sp-ft-values-detail {
  margin-top: 4px;
  padding-top: 10px;
  border-top: 1px solid var(--bc-border-soft);
  min-width: 0;
}

:is(#new-content-shell, #editor-workspace-root) .sp-studio-card--finetuning .sp-ft-values-detail::before {
  content: "Detail";
  display: block;
  margin-bottom: 8px;
  font-family: var(--st-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  line-height: 1;
  color: var(--bc-faint);
}

/* ---- FT-3: the former Motion tab ----------------------------------------- */
:is(#new-content-shell, #editor-workspace-root) :is(#config-card, #editor-tools) .sp-studio-card--finetuning .sp-ft-motion-section {
  padding: 0;
  border-top: 0;
}

/* the final-hold Paper loses its card chrome (it sits inside an accordion card now) */
:is(#new-content-shell, #editor-workspace-root) :is(#config-card, #editor-tools) .sp-studio-card--finetuning .sp-ft-item--motion .mantine-Paper-root {
  border: 0 !important;
  box-shadow: none !important;
  background: transparent !important;
  padding: 0 !important;
}

:is(#new-content-shell, #editor-workspace-root) :is(#config-card, #editor-tools) .sp-studio-card--finetuning .sp-ft-item--motion .mantine-Paper-root .mantine-Alert-root {
  background: color-mix(in srgb, var(--bc-text) 4%, transparent) !important;
}

/* ---- FT-2: the former Annotate tab ---------------------------------------- */
:is(#new-content-shell, #editor-workspace-root) :is(#config-card, #editor-tools) .sp-studio-card--finetuning .sp-ft-annotations-section {
  padding: 0;
  border-top: 0;
  min-width: 0;
}

/* the seven-group accordion and its pattern cards may never widen the card;
   the two DataTables scroll horizontally inside their own container */
:is(#new-content-shell, #editor-workspace-root) :is(#config-card, #editor-tools) .sp-studio-card--finetuning .sp-ft-item--annotations .mantine-Accordion-item,
:is(#new-content-shell, #editor-workspace-root) :is(#config-card, #editor-tools) .sp-studio-card--finetuning .sp-ft-item--annotations .mantine-Accordion-panel,
:is(#new-content-shell, #editor-workspace-root) :is(#config-card, #editor-tools) .sp-studio-card--finetuning .sp-ft-item--annotations .mantine-Accordion-content,
:is(#new-content-shell, #editor-workspace-root) :is(#config-card, #editor-tools) .sp-studio-card--finetuning .sp-ft-item--annotations .sp-annotation-card {
  min-width: 0;
  max-width: 100%;
}

:is(#new-content-shell, #editor-workspace-root) :is(#config-card, #editor-tools) .sp-studio-card--finetuning .sp-ft-item--annotations .dash-table-container,
:is(#new-content-shell, #editor-workspace-root) :is(#config-card, #editor-tools) .sp-studio-card--finetuning .sp-ft-item--annotations .dash-spreadsheet-container {
  max-width: 100%;
  overflow-x: auto;
}

/* ---- FT-4: Canvas & branding ------------------------------------------------ */
/* Watermark: label left, DS toggle right, the text input beneath (the C-3 row) */
:is(#new-content-shell, #editor-workspace-root) .sp-studio-card--finetuning .sp-ft-row-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: var(--st-toggle-h);
}

:is(#new-content-shell, #editor-workspace-root) .sp-studio-card--finetuning .sp-ft-row--watermark:has(.sp-studio-toggle .mantine-Switch-input:not(:checked)) .sp-studio-row-label {
  color: var(--bc-faint);
}

/* Background style: the Select in the DS input skin (the C-4 skin restated).
   Selector weight: zz_new_content.css:4796 turns every InputWrapper into a
   two-column label grid and :4742 sizes every Select input 30px (!important),
   both at 1 id + classes; these chains carry 2 ids and win. */
:is(#new-content-shell, #editor-workspace-root) :is(#config-card, #editor-tools) .sp-studio-card--finetuning .sp-ft-select.mantine-Select-root,
:is(#new-content-shell, #editor-workspace-root) :is(#config-card, #editor-tools) .sp-studio-card--finetuning .sp-ft-select.mantine-InputWrapper-root {
  display: block !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
}

:is(#new-content-shell, #editor-workspace-root) :is(#config-card, #editor-tools) .sp-studio-card--finetuning .sp-ft-select > .mantine-Input-wrapper,
:is(#new-content-shell, #editor-workspace-root) :is(#config-card, #editor-tools) .sp-studio-card--finetuning .sp-ft-select .mantine-Input-wrapper {
  width: 100% !important;
}

:is(#new-content-shell, #editor-workspace-root) :is(#config-card, #editor-tools) .sp-studio-card--finetuning .sp-ft-select .mantine-Select-input,
:is(#new-content-shell, #editor-workspace-root) :is(#config-card, #editor-tools) .sp-studio-card--finetuning .sp-ft-select .mantine-Input-input {
  box-sizing: border-box;
  min-height: var(--st-input-h) !important;
  height: var(--st-input-h) !important;
  padding: 0 32px 0 10px !important;
  border: 1px solid var(--bc-border) !important;
  border-radius: 10px !important;
  background: var(--bc-raised) !important;
  color: var(--bc-text) !important;
  font-family: var(--st-ui) !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  line-height: 1.2 !important;
  box-shadow: none !important;
  cursor: pointer;
  transition: border-color 0.15s ease;
}

:is(#new-content-shell, #editor-workspace-root) :is(#config-card, #editor-tools) .sp-studio-card--finetuning .sp-ft-select .mantine-Select-input:focus,
:is(#new-content-shell, #editor-workspace-root) :is(#config-card, #editor-tools) .sp-studio-card--finetuning .sp-ft-select .mantine-Select-input:focus-visible {
  border-color: var(--bc-accent) !important;
  outline: none;
}

:is(#new-content-shell, #editor-workspace-root) :is(#config-card, #editor-tools) .sp-studio-card--finetuning .sp-ft-select .mantine-Input-section {
  color: var(--bc-text2);
}

/* Source: the autosize Textarea in the DS input skin (the C-3 skin restated;
   the 82px floor of the R3 band relaxed to two rows, as in the TEXT card) */
:is(#new-content-shell, #editor-workspace-root) :is(#config-card, #editor-tools) .sp-studio-card--finetuning .sp-ft-textarea.mantine-Textarea-root,
:is(#new-content-shell, #editor-workspace-root) :is(#config-card, #editor-tools) .sp-studio-card--finetuning .sp-ft-textarea.mantine-InputWrapper-root,
:is(#new-content-shell, #editor-workspace-root) :is(#config-card, #editor-tools) .sp-studio-card--finetuning .sp-ft-textarea .mantine-Input-wrapper {
  display: block !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
}

:is(#new-content-shell, #editor-workspace-root) :is(#config-card, #editor-tools) .sp-studio-card--finetuning .sp-ft-textarea .mantine-Textarea-input,
:is(#new-content-shell, #editor-workspace-root) :is(#config-card, #editor-tools) .sp-studio-card--finetuning .sp-ft-textarea .mantine-Input-input {
  box-sizing: border-box;
  min-height: 56px !important;
  padding: 8px 10px !important;
  border: 1px solid var(--bc-border) !important;
  border-radius: 10px !important;
  background: var(--bc-raised) !important;
  color: var(--bc-text) !important;
  font-family: var(--st-ui) !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  line-height: 1.35 !important;
  box-shadow: none !important;
  resize: none;
  transition: border-color 0.15s ease;
}

:is(#new-content-shell, #editor-workspace-root) :is(#config-card, #editor-tools) .sp-studio-card--finetuning .sp-ft-textarea .mantine-Textarea-input::placeholder {
  color: var(--bc-faint) !important;
  opacity: 1;
}

:is(#new-content-shell, #editor-workspace-root) :is(#config-card, #editor-tools) .sp-studio-card--finetuning .sp-ft-textarea .mantine-Textarea-input:focus,
:is(#new-content-shell, #editor-workspace-root) :is(#config-card, #editor-tools) .sp-studio-card--finetuning .sp-ft-textarea .mantine-Textarea-input:focus-visible {
  border-color: var(--bc-accent) !important;
  outline: none;
}

/* the FT-4 "Detail" block: an id-less subsection under a hairline + mono
   eyebrow (the FT-1 pattern); inside it the Background / Story blocks
   accordions and the Source typography cards keep the inspector's dense
   grammar (.sp-inspector-subsection-body rules) as in their old tabs */
:is(#new-content-shell, #editor-workspace-root) :is(#config-card, #editor-tools) .sp-studio-card--finetuning .sp-ft-canvas-detail {
  margin-top: 4px;
  padding: 10px 0 0;
  border-top: 1px solid var(--bc-border-soft);
  min-width: 0;
}

:is(#new-content-shell, #editor-workspace-root) :is(#config-card, #editor-tools) .sp-studio-card--finetuning .sp-ft-canvas-detail::before {
  content: "Detail";
  display: block;
  margin-bottom: 8px;
  font-family: var(--st-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  line-height: 1;
  color: var(--bc-faint);
}

:is(#new-content-shell, #editor-workspace-root) :is(#config-card, #editor-tools) .sp-studio-card--finetuning .sp-ft-canvas-detail .sp-ft-source-typography {
  padding: 8px 0 0;
  border-top: 1px solid var(--bc-border-soft);
}

:is(#new-content-shell, #editor-workspace-root) :is(#config-card, #editor-tools) .sp-studio-card--finetuning .sp-ft-canvas-detail .sp-ft-source-typography > .sp-inspector-subsection-header {
  margin: 4px 0 2px;
}

/* ---- FT-5: Chart look -------------------------------------------------------- */
/* a headline row whose control is a callback-gated wrapper hides with it
   (control_gating writes {} / {display: none} on the wrapper's inline style) */
:is(#new-content-shell, #editor-workspace-root) .sp-studio-card--finetuning .sp-ft-row--gated:has(> [id][style*="display: none"]),
:is(#new-content-shell, #editor-workspace-root) .sp-studio-card--finetuning .sp-ft-row--gated:has(> [id][style*="display:none"]) {
  display: none;
}

/* the wrapper is a plain Div: it takes only its control's width (the R3 rule
   zz_new_content.css:5181 stretches :is(#style-marker-size-wrap, #editor-style-marker-size-wrap) to 100% for the
   old stacked look group — 2 ids here, so this wins) */
:is(#new-content-shell, #editor-workspace-root) :is(#config-card, #editor-tools) .sp-studio-card--finetuning .sp-ft-row--gated > [id] {
  display: flex;
  justify-content: flex-end;
  flex: 0 0 auto;
  width: auto;
  min-width: 0;
}

/* Line glow: the head row (label + DS toggle) over the slider; the slider dims
   while the glow is off (DS §4 "PRO sekce: zamčeno = ztlumit") */
:is(#new-content-shell, #editor-workspace-root) .sp-studio-card--finetuning .sp-ft-row--line-glow:has(.sp-studio-toggle .mantine-Switch-input:not(:checked)) .sp-studio-row-label {
  color: var(--bc-faint);
}

:is(#new-content-shell, #editor-workspace-root) .sp-studio-card--finetuning .sp-ft-row--line-glow:has(.sp-studio-toggle .mantine-Switch-input:not(:checked)) .sp-ft-slider {
  opacity: 0.55;
}

/* the DS §4 slider skin on the SAME dmc.Slider (Mantine Slider vars): track
   #2A2C33, bar + thumb #FF6B2C, marks + thumb label in mono */
:is(#new-content-shell, #editor-workspace-root) :is(#config-card, #editor-tools) .sp-studio-card--finetuning .sp-ft-slider.mantine-Slider-root {
  --slider-size: 4px;
  --slider-thumb-size: 16px;
  --slider-color: var(--bc-accent);
  --slider-track-bg: var(--bc-border);
  --slider-radius: 999px;
  width: 100% !important;
  min-width: 0;
  max-width: none;
  margin: 6px 0 18px;
  padding: 0 4px;
  box-sizing: border-box;
}

:is(#new-content-shell, #editor-workspace-root) :is(#config-card, #editor-tools) .sp-studio-card--finetuning .sp-ft-slider .mantine-Slider-track,
:is(#new-content-shell, #editor-workspace-root) :is(#config-card, #editor-tools) .sp-studio-card--finetuning .sp-ft-slider .mantine-Slider-track::before {
  background-color: var(--bc-border) !important;
  --slider-track-bg: var(--bc-border);
}

:is(#new-content-shell, #editor-workspace-root) :is(#config-card, #editor-tools) .sp-studio-card--finetuning .sp-ft-slider .mantine-Slider-bar {
  background-color: var(--bc-accent) !important;
}

:is(#new-content-shell, #editor-workspace-root) :is(#config-card, #editor-tools) .sp-studio-card--finetuning .sp-ft-slider .mantine-Slider-thumb {
  width: 16px;
  height: 16px;
  border: 2px solid var(--bc-accent) !important;
  background: var(--bc-accent) !important;
  box-shadow: none;
}

:is(#new-content-shell, #editor-workspace-root) :is(#config-card, #editor-tools) .sp-studio-card--finetuning .sp-ft-slider .mantine-Slider-mark {
  border-color: var(--bc-border);
  background: var(--bc-border);
}

:is(#new-content-shell, #editor-workspace-root) :is(#config-card, #editor-tools) .sp-studio-card--finetuning .sp-ft-slider .mantine-Slider-markFilled {
  border-color: var(--bc-accent);
  background: var(--bc-accent);
}

:is(#new-content-shell, #editor-workspace-root) :is(#config-card, #editor-tools) .sp-studio-card--finetuning .sp-ft-slider .mantine-Slider-markLabel {
  margin-top: 6px;
  font-family: var(--st-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--bc-faint);
}

:is(#new-content-shell, #editor-workspace-root) :is(#config-card, #editor-tools) .sp-studio-card--finetuning .sp-ft-slider .mantine-Slider-label {
  font-family: var(--st-mono);
  font-size: 10px;
  font-weight: 700;
  color: var(--bc-accent);
  background: var(--st-ft-neutral);
  border-radius: 6px;
}

/* Fill between lines: label over the segments (five values do not fit beside it) */
:is(#new-content-shell, #editor-workspace-root) .sp-studio-card--finetuning .sp-ft-row--segments {
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
}

/* the DS segment skin on the SAME SegmentedControl (the C-2 / C-4 skin
   restated under this card's scope; the R3 bands size every segmented
   control at 1 id + classes — these chains carry 2 ids) */
:is(#new-content-shell, #editor-workspace-root) :is(#config-card, #editor-tools) .sp-studio-card--finetuning .sp-ft-segments.mantine-SegmentedControl-root {
  width: 100% !important;
  min-width: 0;
  padding: 3px !important;
  border: 1px solid var(--bc-border) !important;
  border-radius: 999px !important;
  background: var(--st-ft-neutral) !important;
  box-shadow: none !important;
}

:is(#new-content-shell, #editor-workspace-root) :is(#config-card, #editor-tools) .sp-studio-card--finetuning .sp-ft-segments .mantine-SegmentedControl-indicator {
  border-radius: 999px !important;
  background: var(--bc-lime, #b4ff3a) !important;
  box-shadow: none !important;
}

:is(#new-content-shell, #editor-workspace-root) :is(#config-card, #editor-tools) .sp-studio-card--finetuning .sp-ft-segments .mantine-SegmentedControl-control {
  min-width: 0;
}

:is(#new-content-shell, #editor-workspace-root) :is(#config-card, #editor-tools) .sp-studio-card--finetuning .sp-ft-segments .mantine-SegmentedControl-label {
  box-sizing: border-box;
  min-height: 28px !important;
  padding: 4px 6px !important;
  border-radius: 999px !important;
  font-family: var(--st-ui);
  font-size: 12px !important;
  font-weight: 600 !important;
  line-height: 1.2;
  color: var(--bc-text2) !important;
  white-space: nowrap;
}

:is(#new-content-shell, #editor-workspace-root) :is(#config-card, #editor-tools) .sp-studio-card--finetuning .sp-ft-segments .mantine-SegmentedControl-label[data-active],
:is(#new-content-shell, #editor-workspace-root) :is(#config-card, #editor-tools) .sp-studio-card--finetuning .sp-ft-segments .mantine-SegmentedControl-control[data-active] .mantine-SegmentedControl-label {
  color: var(--bc-accent-ink, var(--sp-bg)) !important;
}

/* the FT-5 "Detail" block: an id-less subsection under a hairline + mono
   eyebrow (the FT-1 / FT-4 pattern); inside it the logo gap, initials
   fallback, look colors and the nested "Bar chart" subsection keep the
   inspector's dense grammar */
:is(#new-content-shell, #editor-workspace-root) :is(#config-card, #editor-tools) .sp-studio-card--finetuning .sp-ft-chart-detail {
  margin-top: 4px;
  padding: 10px 0 0;
  border-top: 1px solid var(--bc-border-soft);
  min-width: 0;
}

:is(#new-content-shell, #editor-workspace-root) :is(#config-card, #editor-tools) .sp-studio-card--finetuning .sp-ft-chart-detail::before {
  content: "Detail";
  display: block;
  margin-bottom: 8px;
  font-family: var(--st-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  line-height: 1;
  color: var(--bc-faint);
}

/* the nested "Bar chart" subsection hides with its two bar-gated wrappers (both
   carry display:none on line / scatter charts — CSS only, the gating is untouched) */
:is(#new-content-shell, #editor-workspace-root) :is(#config-card, #editor-tools) .sp-studio-card--finetuning .sp-ft-bar-chart:has(:is(#bar-label-section, #editor-bar-label-section)[style*="display: none"]):has(:is(#bar-layout-section, #editor-bar-layout-section)[style*="display: none"]),
:is(#new-content-shell, #editor-workspace-root) :is(#config-card, #editor-tools) .sp-studio-card--finetuning .sp-ft-bar-chart:has(:is(#bar-label-section, #editor-bar-label-section)[style*="display:none"]):has(:is(#bar-layout-section, #editor-bar-layout-section)[style*="display:none"]) {
  display: none;
}

/* the nested "Bar chart" subsection: mono CAPS title over a hairline; the two
   bar-gated wrappers keep their Dividers, their Papers lose the card chrome */
:is(#new-content-shell, #editor-workspace-root) :is(#config-card, #editor-tools) .sp-studio-card--finetuning .sp-ft-chart-detail .sp-ft-bar-chart {
  padding: 8px 0 0;
  border-top: 1px solid var(--bc-border-soft);
  min-width: 0;
}

:is(#new-content-shell, #editor-workspace-root) :is(#config-card, #editor-tools) .sp-studio-card--finetuning .sp-ft-chart-detail .sp-ft-bar-chart > .sp-inspector-subsection-header {
  margin: 4px 0 2px;
}

:is(#new-content-shell, #editor-workspace-root) :is(#config-card, #editor-tools) .sp-studio-card--finetuning .sp-ft-bar-chart .sp-inspector-subsection-title,
:is(#new-content-shell, #editor-workspace-root) :is(#config-card, #editor-tools) .sp-studio-card--finetuning .sp-ft-advanced-group > .sp-inspector-subsection-header .sp-inspector-subsection-title {
  font-family: var(--st-mono) !important;
  font-size: 10px !important;
  font-weight: 700 !important;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  line-height: 1;
  color: var(--bc-faint) !important;
}

:is(#new-content-shell, #editor-workspace-root) :is(#config-card, #editor-tools) .sp-studio-card--finetuning .sp-ft-bar-chart .mantine-Paper-root,
:is(#new-content-shell, #editor-workspace-root) :is(#config-card, #editor-tools) .sp-studio-card--finetuning .sp-ft-advanced-group--entities > .sp-inspector-subsection-body > .mantine-Paper-root {
  border: 0 !important;
  border-left: 0 !important;
  box-shadow: none !important;
  background: transparent !important;
  padding: 0 !important;
  margin: 0 !important;
}

/* the entity card's own "Entity labels / All charts" header duplicates the
   "Entities" sub-heading — presentational chrome, hidden */
:is(#new-content-shell, #editor-workspace-root) :is(#config-card, #editor-tools) .sp-studio-card--finetuning .sp-ft-advanced-group--entities > .sp-inspector-subsection-body > .mantine-Paper-root > .mantine-Group-root:first-child {
  display: none;
}

/* ---- FT-6: Advanced (the Pro long tail, dense inspector grammar) ---------- */
:is(#new-content-shell, #editor-workspace-root) :is(#config-card, #editor-tools) .sp-studio-card--finetuning .sp-ft-advanced-section {
  padding: 0;
  border-top: 0;
  min-width: 0;
}

:is(#new-content-shell, #editor-workspace-root) :is(#config-card, #editor-tools) .sp-studio-card--finetuning .sp-ft-advanced-section > .sp-inspector-subsection-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

/* sub-headings: mono CAPS 10px #6E6A63 over a hairline (the first one flush) */
:is(#new-content-shell, #editor-workspace-root) :is(#config-card, #editor-tools) .sp-studio-card--finetuning .sp-ft-advanced-group {
  padding: 10px 0 0;
  border-top: 1px solid var(--bc-border-soft);
  min-width: 0;
}

:is(#new-content-shell, #editor-workspace-root) :is(#config-card, #editor-tools) .sp-studio-card--finetuning .sp-ft-advanced-section > .sp-inspector-subsection-body > .sp-step4-axis-layout > .sp-ft-advanced-group:first-child {
  padding-top: 0;
  border-top: 0;
}

:is(#new-content-shell, #editor-workspace-root) :is(#config-card, #editor-tools) .sp-studio-card--finetuning .sp-ft-advanced-group > .sp-inspector-subsection-header {
  margin: 0 0 6px;
}

/* Retire (map B2 "Dead frame controls"): the four CSS-dead frame controls stay
   mounted and hidden — the id-keyed zz_new_content.css:2656–2659 rules still
   apply, but a Stage-C exception (:5579) un-hides the layout-output-preset
   card inside the SETUP panel (it was the Setup "Format" surface before the
   C-2 OUTPUT card). The card now sits in the Setup panel, so re-hide it here
   at higher specificity (3 classes vs. 1 class + 1 attribute). */
:is(#new-content-shell, #editor-workspace-root) :is(#config-card, #editor-tools) .sp-studio-card--finetuning .sp-ft-item--advanced .sp-step4-field-card:has(:is(#layout-output-preset, #editor-layout-output-preset)),
:is(#new-content-shell, #editor-workspace-root) :is(#config-card, #editor-tools) .sp-studio-card--finetuning .sp-ft-item--advanced .sp-step4-field-card:has(:is(#display-target-legacy, #editor-display-target-legacy)),
:is(#new-content-shell, #editor-workspace-root) :is(#config-card, #editor-tools) .sp-studio-card--finetuning .sp-ft-item--advanced .sp-step4-field-card:has(:is(#layout-canvas-width, #editor-layout-canvas-width)),
:is(#new-content-shell, #editor-workspace-root) :is(#config-card, #editor-tools) .sp-studio-card--finetuning .sp-ft-item--advanced .sp-step4-field-card:has(:is(#layout-canvas-height, #editor-layout-canvas-height)) {
  display: none !important;
}

/* the "Scatter" group hides together with its chart-type-gated panel */
:is(#new-content-shell, #editor-workspace-root) :is(#config-card, #editor-tools) .sp-studio-card--finetuning .sp-ft-advanced-group--scatter:has(:is(#scatter-settings-panel, #editor-scatter-settings-panel)[style*="display: none"]),
:is(#new-content-shell, #editor-workspace-root) :is(#config-card, #editor-tools) .sp-studio-card--finetuning .sp-ft-advanced-group--scatter:has(:is(#scatter-settings-panel, #editor-scatter-settings-panel)[style*="display:none"]) {
  display: none;
}

/* nothing inside FT-6 may widen the card; the scatter quadrants DataTable
   scrolls horizontally inside its own container (the FT-2 pattern) */
:is(#new-content-shell, #editor-workspace-root) :is(#config-card, #editor-tools) .sp-studio-card--finetuning .sp-ft-item--advanced .mantine-Paper-root,
:is(#new-content-shell, #editor-workspace-root) :is(#config-card, #editor-tools) .sp-studio-card--finetuning .sp-ft-item--advanced .mantine-Accordion-item,
:is(#new-content-shell, #editor-workspace-root) :is(#config-card, #editor-tools) .sp-studio-card--finetuning .sp-ft-item--advanced .mantine-Accordion-panel,
:is(#new-content-shell, #editor-workspace-root) :is(#config-card, #editor-tools) .sp-studio-card--finetuning .sp-ft-item--advanced .mantine-Accordion-content,
:is(#new-content-shell, #editor-workspace-root) :is(#config-card, #editor-tools) .sp-studio-card--finetuning .sp-ft-item--advanced .sp-step4-axis-layout,
:is(#new-content-shell, #editor-workspace-root) :is(#config-card, #editor-tools) .sp-studio-card--finetuning .sp-ft-item--advanced .sp-step4-top-grid {
  min-width: 0;
  max-width: 100%;
}

:is(#new-content-shell, #editor-workspace-root) :is(#config-card, #editor-tools) .sp-studio-card--finetuning .sp-ft-item--advanced .dash-table-container,
:is(#new-content-shell, #editor-workspace-root) :is(#config-card, #editor-tools) .sp-studio-card--finetuning .sp-ft-item--advanced .dash-spreadsheet-container {
  max-width: 100%;
  overflow-x: auto;
}

/* ---- FT-6: "Elements & layers" (C-6c-i, the former Element tab) ---------- */
/* the first sub-heading of the section is flush (it precedes the styles.css
   .sp-step4-axis-layout grid), so the grid's first group takes the hairline
   the :first-child rule above removed — same specificity, later rule wins */
:is(#new-content-shell, #editor-workspace-root) :is(#config-card, #editor-tools) .sp-studio-card--finetuning .sp-ft-advanced-section > .sp-inspector-subsection-body > .sp-ft-elements-section {
  padding-top: 0;
  border-top: 0;
}

:is(#new-content-shell, #editor-workspace-root) :is(#config-card, #editor-tools) .sp-studio-card--finetuning .sp-ft-advanced-section > .sp-inspector-subsection-body > .sp-ft-elements-section ~ .sp-step4-axis-layout > .sp-ft-advanced-group:first-child {
  padding-top: 10px;
  border-top: 1px solid var(--bc-border-soft);
}

:is(#new-content-shell, #editor-workspace-root) :is(#config-card, #editor-tools) .sp-studio-card--finetuning .sp-ft-elements-section > .sp-inspector-subsection-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

/* the two moved Papers lose their card chrome (the zz_new_content.css:741
   :is(#config-card, #editor-tools) .mantine-Paper-root band and the :2462 padding are !important
   -> 3 ids here); `display` is NEVER set on the callback-gated wrappers */
:is(#new-content-shell, #editor-workspace-root) :is(#config-card, #editor-tools) .sp-studio-card--finetuning .sp-ft-elements-section > .sp-inspector-subsection-body > :is(#workspace-selection-controls-wrap, #editor-workspace-selection-controls-wrap),
:is(#new-content-shell, #editor-workspace-root) :is(#config-card, #editor-tools) .sp-studio-card--finetuning .sp-ft-elements-section > .sp-inspector-subsection-body > :is(#section-text-cards-wrap, #editor-section-text-cards-wrap).sp-workspace-section-text-cards {
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  padding: 0 !important;
  min-width: 0;
  max-width: 100%;
}

/* the Layers panel: the R3 flat look stays; only its inner padding tightens
   to the sub-heading's edge */
:is(#new-content-shell, #editor-workspace-root) :is(#config-card, #editor-tools) .sp-studio-card--finetuning .sp-ft-elements-section .sp-workspace-section-layout-shell {
  padding: 0;
}

/* the empty state reads as the dense-grammar helper line */
:is(#new-content-shell, #editor-workspace-root) :is(#config-card, #editor-tools) .sp-studio-card--finetuning .sp-ft-elements-section .sp-workspace-selection-empty-state .mantine-Text-root {
  font-size: 12px !important;
}

/* the contextual panel's own title / helper: the same mono CAPS grammar as the
   nested "Bar chart" title (C-5c) — it names the selected element */
:is(#new-content-shell, #editor-workspace-root) :is(#config-card, #editor-tools) .sp-studio-card--finetuning .sp-ft-elements-section :is(#workspace-selection-panel-title, #editor-workspace-selection-panel-title) {
  font-family: var(--bc-font-mono, ui-monospace, "JetBrains Mono", monospace) !important;
  font-size: 10px !important;
  font-weight: 700 !important;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--bc-text) !important;
}

:is(#new-content-shell, #editor-workspace-root) :is(#config-card, #editor-tools) .sp-studio-card--finetuning .sp-ft-elements-section :is(#layout-section-helper, #editor-layout-section-helper) {
  font-size: 11px !important;
}

/* ---- mobile ≤640 (the Setup sheet; DS §3.1 touch ladder) ---------------- */
@media (max-width: 640px) {
  :is(#new-content-shell, #editor-workspace-root) .sp-studio-card--finetuning {
    --st-input-h: 42px;
    --st-unlock-h: 42px;
    --st-ft-control-h: 44px;
  }

  :is(#new-content-shell, #editor-workspace-root) .sp-studio-card--finetuning .sp-ft-unlock {
    font-size: 14px;
  }

  :is(#new-content-shell, #editor-workspace-root) :is(#config-card, #editor-tools) .sp-studio-card--finetuning .sp-ft-item .sp-ft-control,
  :is(#new-content-shell, #editor-workspace-root) :is(#config-card, #editor-tools) .sp-studio-card--finetuning .sp-ft-item .sp-ft-control .mantine-Accordion-label {
    font-size: 14px !important;
  }

  :is(#new-content-shell, #editor-workspace-root) :is(#config-card, #editor-tools) .sp-studio-card--finetuning .sp-ft-number-input.mantine-NumberInput-root,
  :is(#new-content-shell, #editor-workspace-root) :is(#config-card, #editor-tools) .sp-studio-card--finetuning .sp-ft-number-input .mantine-Input-wrapper {
    width: 108px !important;
    max-width: 108px !important;
  }

  /* DS §3.1 touch ladder: inputs 42–46px */
  :is(#new-content-shell, #editor-workspace-root) :is(#config-card, #editor-tools) .sp-studio-card--finetuning .sp-ft-number-input .mantine-NumberInput-input,
  :is(#new-content-shell, #editor-workspace-root) :is(#config-card, #editor-tools) .sp-studio-card--finetuning .sp-ft-number-input .mantine-Input-input {
    min-height: 42px !important;
    height: 42px !important;
    font-size: 14px !important;
  }

  :is(#new-content-shell, #editor-workspace-root) :is(#config-card, #editor-tools) .sp-studio-card--finetuning .sp-ft-number-input .mantine-NumberInput-control {
    min-height: 17px !important;
    height: 17px !important;
  }

  :is(#new-content-shell, #editor-workspace-root) :is(#config-card, #editor-tools) .sp-studio-card--finetuning .sp-ft-text-input .mantine-Input-input {
    padding: 0 12px !important;
    font-size: 14px !important;
  }

  :is(#new-content-shell, #editor-workspace-root) :is(#config-card, #editor-tools) .sp-studio-card--finetuning .sp-ft-select .mantine-Select-input,
  :is(#new-content-shell, #editor-workspace-root) :is(#config-card, #editor-tools) .sp-studio-card--finetuning .sp-ft-select .mantine-Input-input {
    padding: 0 34px 0 12px !important;
    font-size: 14px !important;
  }

  /* 82px = the R3 band's floor, kept on mobile on purpose (the C-3 note: the
     sheet is closed at load, so Mantine's autosize measures the textarea while
     hidden and keeps the min-rows height until the next edit) */
  :is(#new-content-shell, #editor-workspace-root) :is(#config-card, #editor-tools) .sp-studio-card--finetuning .sp-ft-textarea .mantine-Textarea-input,
  :is(#new-content-shell, #editor-workspace-root) :is(#config-card, #editor-tools) .sp-studio-card--finetuning .sp-ft-textarea .mantine-Input-input {
    min-height: 82px !important;
    padding: 10px 12px !important;
    font-size: 14px !important;
  }

  /* FT-5 / FT-6 on the touch ladder */
  :is(#new-content-shell, #editor-workspace-root) :is(#config-card, #editor-tools) .sp-studio-card--finetuning .sp-ft-slider.mantine-Slider-root {
    --slider-thumb-size: 20px;
    margin: 8px 0 20px;
  }

  :is(#new-content-shell, #editor-workspace-root) :is(#config-card, #editor-tools) .sp-studio-card--finetuning .sp-ft-slider .mantine-Slider-thumb {
    width: 20px;
    height: 20px;
  }

  :is(#new-content-shell, #editor-workspace-root) :is(#config-card, #editor-tools) .sp-studio-card--finetuning .sp-ft-segments .mantine-SegmentedControl-label {
    min-height: 36px !important;
    font-size: 13px !important;
  }

  /* FT-6 "Elements & layers": the layer buttons reach the 42px touch floor;
     the Layers list keeps scrolling inside its own box (zz_new_content.css
     :1293 max-height) so the sheet never grows past the viewport */
  :is(#new-content-shell, #editor-workspace-root) :is(#config-card, #editor-tools) .sp-studio-card--finetuning .sp-ft-elements-section .sp-preview-layer-item {
    min-height: 42px;
  }
}

/* ---- C2 prototype: FINE-TUNING as tabs (SP_STUDIO_FT_TABS) ------------------
   The card can be rendered as `dmc.Tabs(keepMounted=False)` instead of a `dmc.Accordion`
   (pages/new_content/layout.py::_finetuning_tabs_variant, docs/new_content/perf_graph_load_options.md
   option C2): a section that is not open is then not rendered at all, which is where the win comes from
   (the card is 1,000 of the editor body's 1,242 components and 49 % of the page's DOM).
   The rules below give the tab strip and the panel the geometry the accordion rules gave the items —
   without them the panel renders at width 0, i.e. the section opens but stays invisible. Everything here
   is inert while the flag is off (no `.sp-ft-tabs` in the shipped tree). */
:is(#new-content-shell, #editor-workspace-root) :is(#config-card, #editor-tools) .sp-studio-card--finetuning .sp-ft-tabs {
  width: 100%;
  min-width: 0;
  display: block;
}

:is(#new-content-shell, #editor-workspace-root) :is(#config-card, #editor-tools) .sp-studio-card--finetuning .sp-ft-tabs-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  border: 0 !important;
  margin-bottom: 8px;
}

:is(#new-content-shell, #editor-workspace-root) :is(#config-card, #editor-tools) .sp-studio-card--finetuning .sp-ft-tab {
  flex: 0 0 auto;
  width: auto !important;
  min-width: 0;
  padding: 6px 10px !important;
  border: 1px solid var(--bc-border-soft) !important;
  border-radius: 999px !important;
  background: var(--st-ft-inset) !important;
  color: var(--bc-text2) !important;
  font-family: var(--sh-ui, inherit);
  font-size: 12px !important;
  font-weight: 600 !important;
  line-height: 1.2;
}

:is(#new-content-shell, #editor-workspace-root) :is(#config-card, #editor-tools) .sp-studio-card--finetuning .sp-ft-tab[data-active] {
  border-color: var(--bc-accent) !important;
  color: var(--bc-text) !important;
}

:is(#new-content-shell, #editor-workspace-root) :is(#config-card, #editor-tools) .sp-studio-card--finetuning .sp-ft-tabs-panel {
  width: 100%;
  min-width: 0;
  display: block;
}

:is(#new-content-shell, #editor-workspace-root) :is(#config-card, #editor-tools) .sp-studio-card--finetuning .sp-ft-tabs-panel > .sp-ft-panel {
  width: 100%;
  min-width: 0;
}
