/* One labelled-row rhythm across setup, object tools and content libraries. */
@media (min-width: 901px) {
  body.editor-studio #editor-side-panel { --sidebar-label-width: 192px; }
  body.editor-studio #editor-side-panel :is(.editor-step-body, .studio-content-panel) .form-grid { grid-template-columns: minmax(0,1fr); }
  body.editor-studio #editor-side-panel :is(.editor-step-body, .studio-content-panel) .field:not([hidden]):not(.field-check):not(.editor-check) {
    display: grid; grid-template-columns: var(--sidebar-label-width) minmax(0,1fr);
    align-items: center; gap: 8px 12px; margin: 0 0 10px; padding: 0;
  }
  body.editor-studio #editor-side-panel :is(.field-label, .editor-check > span) { font: 400 13px/1.45 "IBM Plex Sans", sans-serif; }
  body.editor-studio #editor-side-panel .field > :is(.field-hint, .hint, .field-entry-guidance, .inline-status) { grid-column: 1 / -1; }
  body.editor-studio #editor-side-panel .field > :is(input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]):not([type=file]), select, textarea),
  body.editor-studio #editor-side-panel .field > :is(.pf-qty, .editor-field-row) > :is(input, select) {
    box-sizing: border-box; width: 100%; min-width: 0; min-height: 38px; border-radius: 6px;
    padding: 7px 9px; font: 400 13px/1.45 "IBM Plex Sans", sans-serif;
  }
  body.editor-studio #editor-side-panel .field > .pf-qty { display: grid; grid-template-columns: minmax(0,1fr) 94px; gap: 6px; }
  body.editor-studio #editor-side-panel .field > .pf-qty select { min-width: 0; }
  body.editor-studio #editor-side-panel :is(.sidebar-section-title, .editor-setup-section-title) { font: 600 14px/1.4 "IBM Plex Sans", sans-serif; color: var(--editor-dark-text); }
  body.editor-studio #editor-side-panel .sidebar-section-title { margin: 24px 0 14px; }
  body.editor-studio #editor-side-panel .field-required { color: inherit; font: inherit; }
  .editor-studio #product-classification-label { font: 600 14px/1.4 "IBM Plex Sans", sans-serif; }
  body.editor-studio #editor-side-panel [data-pd-asked] > .pd-heading { display: none; }
  body.editor-studio #editor-side-panel [data-sidebar-grouped] { border: 0; padding-top: 0; margin-top: 0; }
  body.editor-studio #editor-side-panel [data-sidebar-grouped]:not([data-ls-optional]) > .editor-check:has([data-ls-pp]:checked) { display: none; }
  body.editor-studio #editor-side-panel [data-sidebar-grouped] .product-fact-storage > legend { display: none; }
  body.editor-studio #editor-side-panel .product-storage-presets > .editor-check { display: grid; grid-template-columns: var(--sidebar-label-width) minmax(0,1fr); align-items: center; gap: 12px; min-height: 32px; margin: 0; }
  body.editor-studio #editor-side-panel .product-storage-presets > .editor-check > span { grid-row: 1; grid-column: 1; }
  body.editor-studio #editor-side-panel .product-storage-presets > .editor-check > input { grid-row: 1; grid-column: 2; justify-self: start; width: 16px; height: 16px; }
  body.editor-studio #editor-side-panel .product-contact-editor { gap: 0; }
  body.editor-studio #editor-side-panel .product-contact-editor > .sidebar-section-title { margin-top: 24px; }
  body.editor-studio #editor-side-panel .product-contact-editor > label[hidden] { display: none; }
  body.editor-studio #editor-side-panel .product-contact-editor .field-hint:empty { display: none; }
  body.editor-studio #editor-side-panel .product-storage-temperatures { grid-template-columns: minmax(0,1fr); gap: 0; }
  body.editor-studio #editor-side-panel .product-storage-presets .field-label { font-weight: 400; }
  body.editor-studio #editor-side-panel .field > .product-bilingual-fields { grid-column: 1 / -1; }
}
@media (min-width: 901px) and (max-width: 1180px) {
  body.editor-studio #editor-side-panel { --sidebar-label-width: 192px; }
}
@media (min-width: 901px) and (pointer: coarse) {
  body.editor-studio #editor-side-panel .field > :is(input, select, textarea),
  body.editor-studio #editor-side-panel .field > .pf-qty > :is(input, select) { min-height: 44px; }
}

@media (min-width: 901px) {
  body.editor-studio.editor-submenus #editor-side-panel #editor-step-step1 [data-sidebar-grouped] { display: block; }
  body.editor-studio.editor-submenus #editor-side-panel #editor-step-step1 [data-sidebar-grouped] > .sidebar-section-title { margin: 24px 0 14px; }
  body.editor-studio.editor-submenus #editor-side-panel #editor-step-step1 [data-sidebar-grouped]:not([data-ls-optional]) > .label-strategy-disclosure > summary { display: none; }
  body.editor-studio.editor-submenus #editor-side-panel #editor-step-step1 [data-pd-asked] > .pd-heading { display: none; }
  body.editor-studio.editor-submenus #editor-side-panel #editor-step-step1 [data-sidebar-grouped]:not([data-ls-optional]) > .editor-check:has([data-ls-pp]:checked) { display: none; }
  body.editor-studio #editor-side-panel #editor-step-step1 .field > .field-label { font-weight: 400; }
  body.editor-studio #editor-side-panel #product-classification-label { font: 600 14px/1.4 "IBM Plex Sans", sans-serif; }
  body.editor-studio #editor-side-panel #product-classification-text { font: 400 14px/1.5 "IBM Plex Sans", sans-serif; }
}

@media (min-width: 901px) {
  body.editor-studio #editor-side-panel #editor-step-step1 [data-pd-form] > .pd-heading:has(+ [data-pd-asked]) { display: none; }
}

/* A section title starts at the pane edge; its editable rows sit one indent in. */
@media (min-width: 901px) {
  body.editor-studio #editor-side-panel { --sidebar-section-indent: 16px; }
  body.editor-studio #editor-side-panel :is(.sidebar-section-title, .pd-heading, .editor-setup-section-title, .studio-section-title, #product-classification-label) {
    font: 600 14px/1.4 "IBM Plex Sans", sans-serif; color: var(--editor-dark-text);
  }
  body.editor-studio #editor-side-panel #product-classification-fields { margin: 14px 0 0 var(--sidebar-section-indent); }
  body.editor-studio #editor-side-panel [data-sidebar-grouped]:not([data-ls-item="licenceHolderContact"]) > .label-strategy-disclosure { padding-left: var(--sidebar-section-indent); }
  body.editor-studio #editor-side-panel .product-contact-editor > :is(.field, .field-hint, .button) { margin-left: var(--sidebar-section-indent); }
  body.editor-studio #editor-side-panel .product-contact-editor > .product-contact-fields { margin-left: var(--sidebar-section-indent); }
  body.editor-studio #editor-side-panel .product-contact-editor .field-label { white-space: nowrap; }
  body.editor-studio #editor-side-panel :is(#editor-step-step2, #editor-step-step3, #editor-step-step4, #editor-step-step5) .editor-dimension-group-body { padding-left: var(--sidebar-section-indent); }
  body.editor-studio #editor-side-panel .studio-content-panel > :is(.field, .form-grid, .product-bilingual-fields) { margin-left: var(--sidebar-section-indent); }
  body.editor-studio #editor-side-panel #editor-step-step1 :is(.sidebar-section-title, .pd-heading, #product-classification-label) { font: 600 14px/1.4 "IBM Plex Sans", sans-serif; }
}

@media (min-width: 901px) {
  body.editor-studio #editor-side-panel #editor-step-step1 .product-contact-editor > .field { margin-left: var(--sidebar-section-indent); }
  body.editor-studio #editor-side-panel .studio-content-panel > .field:not([hidden]):not(.field-check):not(.editor-check) { margin-left: var(--sidebar-section-indent); }
}

/* Ingredients are direct editable rows; the existing scalar supplies artwork commas. */
.ingredient-rows { min-width: 0; }
.ingredient-row-list { display: grid; gap: 10px; }
.ingredient-row { display: grid; grid-template-columns: minmax(0,1fr) 30px; gap: 8px; position: relative; min-width: 0; }
.ingredient-language-fields { display: grid; gap: 8px; min-width: 0; }
.ingredient-row-field { display: grid; gap: 5px; margin: 0; min-width: 0; }
body.editor-studio #editor-side-panel .ingredient-row-input { box-sizing: border-box; width: 100%; min-width: 0; min-height: 38px; padding: 7px 9px; border-radius: 6px; font: 400 13px/1.45 "IBM Plex Sans", sans-serif; }
.ingredient-row-handle { align-self: start; display: grid; place-items: center; width: 30px; min-height: 38px; padding: 5px; border: 0; border-radius: 6px; color: var(--editor-dark-muted); background: transparent; cursor: grab; touch-action: none; }
.ingredient-row-handle svg { width: 20px; height: 20px; }
.ingredient-row-handle:hover, .ingredient-row-handle:focus-visible { color: var(--editor-dark-text); background: var(--editor-dark-hover); }
.ingredient-row-handle:focus-visible { outline: 2px solid #f0744f; outline-offset: -2px; }
.ingredient-row-handle:disabled { opacity: .3; cursor: default; }
.ingredient-row.is-dragging { opacity: .65; }
.ingredient-row.is-dragging .ingredient-row-handle { cursor: grabbing; }
.ingredient-row-options { position: absolute; z-index: 5; top: 100%; left: 0; right: 38px; max-height: 180px; overflow-y: auto; background: var(--editor-dark-panel); border: 1px solid var(--editor-dark-line-strong); border-radius: 6px; padding: 4px; }
.ingredient-options-above .ingredient-row-options { top: auto; bottom: 100%; }
.ingredient-row-options[hidden], .ingredient-row-status:empty { display: none; }
.ingredient-row-option { display: block; width: 100%; min-height: 36px; padding: 8px; border: 0; border-radius: 4px; background: transparent; color: var(--editor-dark-text); text-align: left; white-space: normal; font: 400 13px/1.4 "IBM Plex Sans", sans-serif; }
.ingredient-row-option:hover, .ingredient-row-option[aria-selected="true"] { background: var(--editor-dark-hover); }
@media (pointer: coarse) { .ingredient-row-handle { min-height: 44px; } }

/* Keep required guidance beside the current pane title and brand's real control. */
.studio-pane-head .studio-required-key { margin-left: auto; flex: none; font: 400 13px/1.45 "IBM Plex Sans", sans-serif; color: var(--editor-dark-muted); white-space: nowrap; }
.studio-required-key[hidden] { display: none; }
body.editor-studio #editor-side-panel [data-brand-picker] .editor-custom-select { position: relative; inset: auto; grid-column: 2; width: 100%; min-width: 0; min-height: 38px; }
body.editor-studio #editor-side-panel [data-brand-picker] .editor-custom-select-button { min-height: 38px; padding: 7px 28px 7px 9px; border: 1px solid var(--editor-dark-line-strong); border-radius: 6px; background: var(--editor-dark-raised); font: 400 13px/1.45 "IBM Plex Sans", sans-serif; }

/* Keep captions and their required suffix together, with translation status below. */
body.editor-studio #editor-side-panel .field-label { display: block; }
.product-translation-tools:has(.translation-status:empty) { display: none; }
body.editor-studio #editor-side-panel .field > .product-translation-tools { grid-column: 1 / -1; margin-left: 0; }
body.editor-studio.editor-submenus #editor-side-panel #editor-step-step1 [data-value-driven] > label,
body.editor-studio.editor-submenus #editor-side-panel #editor-step-step1 [data-value-driven] > details > summary { display: none; }

@media (min-width: 901px) {
  body.editor-studio.editor-submenus #editor-side-panel #editor-step-step1 [data-sidebar-grouped]:not([data-ls-optional]) > .label-strategy-disclosure > summary { display: none; }
  body.editor-studio.editor-submenus #editor-side-panel #editor-step-step1 [data-pd-lot-date-rows] > [data-ls-item] { display: block; padding: 0; border: 0; }
  body.editor-studio.editor-submenus #editor-side-panel #editor-step-step1 [data-pd-lot-date-rows] > [data-ls-item] > label,
  body.editor-studio.editor-submenus #editor-side-panel #editor-step-step1 [data-pd-lot-date-rows] > [data-ls-item] > details > summary { display: none; }
  body.editor-studio #editor-side-panel .pd-section-body .label-strategy-item-data { padding: 0; }
  body.editor-studio #editor-side-panel #editor-step-step1 .label-strategy-dm { display: grid; grid-template-columns: var(--sidebar-label-width) minmax(0,1fr); gap: 12px; align-items: center; margin: 0 0 0 var(--sidebar-section-indent); padding: 0; }
  body.editor-studio #editor-side-panel #editor-step-step1 .label-strategy-dm > span { grid-column: 1; grid-row: 1; font: 400 13px/1.45 "IBM Plex Sans", sans-serif; }
  body.editor-studio #editor-side-panel #editor-step-step1 .label-strategy-dm > input { grid-column: 2; grid-row: 1; justify-self: start; }
}

/* Optional artwork wording keeps an ordinary label-and-checkbox row, not the old
   narrow checklist marker column. The inclusion choice still owns its value. */
@media (min-width: 901px) {
  body.editor-studio #editor-side-panel [data-sidebar-grouped][data-ls-optional] > .label-strategy-item-check {
    display: grid; grid-template-columns: var(--sidebar-label-width) minmax(0,1fr);
    align-items: center; gap: 12px; width: auto; min-height: 38px;
    margin: 0 0 10px var(--sidebar-section-indent); padding: 0; border: 0; background: none;
  }
  body.editor-studio #editor-side-panel [data-sidebar-grouped][data-ls-optional] > .label-strategy-item-check > span { grid-column: 1; grid-row: 1; }
  body.editor-studio #editor-side-panel [data-sidebar-grouped][data-ls-optional] > .label-strategy-item-check > input { grid-column: 2; grid-row: 1; justify-self: start; margin: 0; }
}

@media (min-width: 901px) {
  body.editor-studio #editor-side-panel .product-facts-other-body > [data-extra-grouped] { margin-left: var(--sidebar-section-indent); }
  body.editor-studio #editor-side-panel #pd-markets > legend { font: 600 14px/1.4 "IBM Plex Sans", sans-serif; }
  body.editor-studio #editor-side-panel #pd-markets-options { display: grid; gap: 6px; padding: 12px 0 0 var(--sidebar-section-indent); }
  body.editor-studio #editor-side-panel #pd-markets-options > label { font: 400 13px/1.45 "IBM Plex Sans", sans-serif; }
  body.editor-studio.editor-submenus #editor-side-panel #editor-step-step1 [data-static-fact] { display: grid; grid-template-columns: var(--sidebar-label-width) minmax(0,1fr); gap: 12px; }
}

/* All remaining Product details fields share the same inset and control column. */
@media (min-width: 901px) {
  body.editor-studio #editor-side-panel #editor-step-step1 .product-facts-other-body > .field[data-extra-grouped]:not([hidden]):not(.field-check):not(.editor-check) { margin-left: var(--sidebar-section-indent); }
  body.editor-studio #editor-side-panel #editor-step-step1 .product-bilingual-fields { grid-template-columns: minmax(0,1fr); }
  body.editor-studio #editor-side-panel #editor-step-step1 .source-intake-body { padding-left: var(--sidebar-section-indent); }
  body.editor-studio #editor-side-panel #editor-step-step1 .source-intake-field > :is(input,textarea,select) { background-color: var(--editor-dark-raised); color: var(--editor-dark-text); min-height: 38px; border-radius: 6px; padding: 7px 9px; font: 400 13px/1.45 "IBM Plex Sans", sans-serif; }
  body.editor-studio #editor-side-panel #editor-step-step1 .source-intake-action { margin-left: calc(var(--sidebar-label-width) + 12px); min-height: 38px; padding: 7px 9px; font: 400 13px/1.45 "IBM Plex Sans", sans-serif; }
  body.editor-studio #editor-side-panel #editor-step-step1 .source-intake-add { width: calc(100% - var(--sidebar-label-width) - 12px); }
  body.editor-studio #editor-side-panel #editor-step-step1 .source-intake-checklist > label { display: grid; grid-template-columns: var(--sidebar-label-width) minmax(0,1fr); gap: 12px; }
  body.editor-studio #editor-side-panel #editor-step-step1 .source-intake-checklist label > span { grid-column: 1; grid-row: 1; }
  body.editor-studio #editor-side-panel #editor-step-step1 .source-intake-checklist input { grid-column: 2; grid-row: 1; justify-self: start; }
}
.source-intake-subtitle, .source-intake-checklist > legend { margin: 20px 0 12px; font: 600 14px/1.4 "IBM Plex Sans", sans-serif; }
.source-intake-view { border: 0; margin: 0 0 20px; padding: 0; }
.product-allergen-controls .product-allergen-section { padding: 0; }
.product-allergen-section > legend { padding: 0; margin-bottom: 8px; font: 400 13px/1.45 "IBM Plex Sans", sans-serif; }
@media (pointer: coarse) { body.editor-studio #editor-side-panel #editor-step-step1 .source-intake-field > :is(input,textarea,select) { min-height: 44px; } }

#pd-markets-status:empty { display: none; }
#pd-markets-options .field-label small { font: inherit; }
@media (min-width: 901px) {
  body.editor-studio #editor-side-panel #pd-markets-options .market-choice-row { margin-bottom: 4px; }
  body.editor-studio #editor-side-panel #editor-step-step1 .source-material-row { margin-bottom: 8px; }
}

/* Match the existing THC/CBD hairline; outer wrappers must not draw another line. */
body.editor-studio #editor-step-step1 details.editor-dimension-group::after { background: var(--editor-dark-line); }
body.editor-studio #editor-step-step1 #step1-variable-info-group::after { display: none; }
body.editor-studio #editor-step-step1 .product-facts-other > summary { border-top-color: var(--editor-dark-line); }
