/* TRK-1003: custom sections in the page editor: the code dialog and a section's settings (custom-section-editor.js) */
dialog.funnel-custom-box { width: min(760px, calc(100vw - 32px)); max-height: min(90vh, 1000px); overflow: auto; }
.funnel-custom-form { display: grid; gap: 12px; min-width: 0; }
.funnel-custom-form > .sub { margin: 0; font-size: 12px; }
.funnel-custom-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 200px); gap: 10px; }
.funnel-custom-form textarea.funnel-code { min-height: 120px; }
.funnel-setting-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.funnel-setting-row { display: grid; gap: 8px; padding: 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--sunken); min-width: 0; }
.funnel-setting-main { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 120px) 32px; gap: 6px; align-items: center; }
.funnel-setting-main > input, .funnel-setting-main > select, .funnel-setting-main > select:not([data-measuring]) { min-width: 0; width: 100%; } /* not the select's measured width (styles.css) */
.funnel-setting-main > button { width: 32px; height: 32px; padding: 0; font-size: 18px; line-height: 1; }
input.funnel-code-key { font: 12px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; }
.funnel-setting-extra { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; min-width: 0; }
.funnel-setting-extra > .sub { flex-basis: 100%; margin: 0; font-size: 12px; overflow-wrap: anywhere; }
.funnel-setting-extra > .funnel-field { flex-basis: 100%; }
.funnel-inline { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }
.funnel-inline > input:not([type="checkbox"]) { width: 140px; }
.funnel-inline > .funnel-color-pair { width: 180px; }
input.funnel-small-number { width: 80px; }
.funnel-custom-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.funnel-custom-actions > .danger { margin-right: auto; order: -1; }
dialog.confirm-box .funnel-error { margin: 0; padding: 8px 10px; border-radius: 8px; font-size: 13px; color: var(--danger); background: color-mix(in srgb, var(--danger) 10%, transparent); overflow-wrap: anywhere; }
.funnel-custom-versions { border-top: 1px solid var(--border); padding-top: 10px; font-size: 13px; }
.funnel-custom-versions .funnel-version-list { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 4px; max-height: 180px; overflow: auto; }
.funnel-custom-versions .funnel-version-list li { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; }
.funnel-custom-versions .funnel-version-list li > span:first-child { min-width: 0; overflow-wrap: anywhere; }
.funnel-custom-settings { display: grid; gap: 10px; min-width: 0; }
.funnel-custom-settings > button { justify-self: start; }
.funnel-color-pair { display: flex; align-items: center; gap: 6px; }
.funnel-color-pair > input[type="color"] { width: 36px; height: 32px; padding: 2px; flex-shrink: 0; }
.funnel-color-pair > input:not([type="color"]) { flex: 1 1 auto; min-width: 0; }
.funnel-field-problem { color: var(--danger); font-size: 12px; }
.funnel-field-problem:empty { display: none; }
@media (max-width: 560px) {
  .funnel-custom-head { grid-template-columns: 1fr; }
  .funnel-setting-main { grid-template-columns: minmax(0, 1fr) 32px; }
  .funnel-setting-main > input:nth-child(2), .funnel-setting-main > select { grid-column: 1; }
}
/* TRK-1007: the code in the shared code editor, with the section drawn beside it */
dialog.funnel-custom-box.has-preview { width: min(1240px, calc(100vw - 32px)); }
.custom-code-side { display: grid; grid-template-rows: auto minmax(0, 1fr); gap: 4px; min-width: 0; }
.custom-code-side-head { margin: 0; font-size: 12px; }
.custom-code-preview { width: 100%; height: 100%; min-height: 320px; border: 1px solid var(--border); border-radius: 8px; background: #fff; }
