/* Multilang library */
.ml-set-page {
  --ml-border: #363a3e;
  --ml-muted: #afb7bf;
  --ml-set-row-height: clamp(42px, 7.4vh, 62px);
  min-width: 0;
}
.ml-set-page .page-heading { align-items: center; flex-wrap: nowrap; gap: 8px; margin-bottom: 10px; }
.ml-set-page .page-heading h1 { margin: 0; font-size: clamp(21px,2vw,30px); }
.ml-set-page .heading-actions { flex-wrap: nowrap; gap: 8px; }
.ml-set-page .heading-actions .btn { min-height: 34px; padding: 6px 12px; font-size: 13px; }
.ml-set-page .heading-actions .btn-primary { background: #0c83f1; border-color: #1689fa; }
.ml-set-filters { display: flex; align-items: center; gap: 12px; margin: 0 0 clamp(12px,2vh,19px); }
.ml-set-search { position: relative; display: block; width: min(235px,58%); min-width: 0; }
.ml-set-search svg { position: absolute; left: 10px; top: 50%; width: 14px; height: 14px; transform: translateY(-50%); color: var(--ml-muted); pointer-events: none; }
.ml-set-search input, .ml-set-filters select {
  min-width: 0; height: 31px; padding: 4px 10px; border: 1px solid var(--ml-border);
  border-radius: 6px; background: #1b1d1f; color: #e3e6e9; font-size: 12px;
}
.ml-set-search input { width: 100%; padding-left: 32px; }
.ml-set-filters select { width: min(178px,40%); }
.ml-set-table-wrap { min-width: 0; border: 1px solid var(--ml-border); border-radius: 8px; background: #202123; }
.ml-set-table { width: 100%; table-layout: fixed; border-spacing: 0; border-collapse: separate; font-size: clamp(11px,1vw,14px); }
.ml-set-table th, .ml-set-table td { padding: 4px clamp(5px,1.2vw,17px); text-align: left; vertical-align: middle; }
.ml-set-table thead th {
  height: clamp(35px,5.9vh,46px); background: #242628; color: #eef0f2;
  font-size: clamp(10px,.95vw,13px); font-weight: 500; line-height: 1.25;
}
.ml-set-table thead th:first-child { width: 24%; border-top-left-radius: 8px; }
.ml-set-table thead th[colspan="2"] { width: 18%; }
.ml-set-table thead th:nth-last-child(3) { width: 14%; }
.ml-set-table thead th:last-child { width: 24%; border-top-right-radius: 8px; }
.ml-set-table tbody tr { height: var(--ml-set-row-height); }
.ml-set-table tbody td { border-top: 1px solid var(--ml-border); color: #e5e8eb; }
.ml-set-table tbody tr:hover { background: rgba(150,163,173,.035); }
.ml-set-table .ml-set-identity { display: flex; align-items: center; gap: clamp(5px,1vw,15px); min-width: 0; }
.ml-set-thumb {
  display: grid; flex: none; place-items: center; width: calc(var(--ml-set-row-height) - 12px); height: calc(var(--ml-set-row-height) - 12px);
  border-radius: 6px; object-fit: cover; overflow: hidden; background: #282c30; color: #929ba4;
}
.ml-set-thumb svg { width: 16px; height: 16px; }
.ml-set-name-text, .ml-set-brand, .ml-set-price { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ml-set-name-text { min-width: 0; color: #f1f3f4; }
.ml-set-table .ml-set-media { position: relative; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ml-set-media svg { width: 15px; height: 15px; margin-right: 8px; color: #c0c5cb; vertical-align: -.17em; }
.ml-set-videos::before { position: absolute; left: 0; top: 50%; width: 1px; height: 18px; background: #414448; content: ""; transform: translateY(-50%); }
.ml-set-state { display: inline-flex; max-width: 100%; align-items: center; gap: 6px; line-height: 1.2; }
.ml-set-state::before, .ml-editor-state::before { content: ""; width: 7px; height: 7px; flex: none; border-radius: 50%; background: #a9b2bd; }
.ml-set-state[data-state=ready]::before, .ml-editor-state.is-ready::before { background: #23ce8c; }
.ml-set-state[data-state=draft]::before { background: #d7a55f; }
.ml-set-action-group { display: flex; align-items: center; gap: clamp(3px,.65vw,10px); min-width: 0; }
.ml-set-action-group button {
  display: inline-flex; align-items: center; justify-content: center; gap: 5px; min-width: 0;
  padding: 4px 1px; border: 0; border-radius: 3px; min-height: 28px; background: transparent;
  color: #e5e7e9; font-size: clamp(10px,.95vw,13px); font-weight: 400; white-space: nowrap;
}
.ml-set-action-group button:hover:not(:disabled) { color: #95d0ff; background: transparent; }
.ml-set-action-group .ml-set-delete { color: #f3a2a2; }
.ml-set-action-group .ml-set-delete:hover:not(:disabled) { color: #ffb5b5; }
.ml-set-action-group button + button { position: relative; margin-left: 2px; padding-left: clamp(5px,.8vw,12px); }
.ml-set-action-group button + button::before { position: absolute; left: 0; top: 22%; bottom: 22%; border-left: 1px solid #42464a; content: ""; }
.ml-set-action-group svg { width: 14px; height: 14px; flex: none; }
.ml-set-pagination { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin-top: 6px; color: var(--ml-muted); font-size: 12px; }
.ml-set-pagination[hidden] { display: none; }
.ml-set-pagination button { min-height: 28px; padding: 2px 8px; }
@media (min-width:821px) and (max-width:1120px) {
  .ml-set-table th, .ml-set-table td { padding-inline: 6px; }
  .ml-set-action-group button { font-size: 11px; }
}
@media (max-width:660px), (min-width:821px) and (max-width:899px) {
  .ml-set-page { --ml-set-row-height: 76px; }
  .ml-set-table, .ml-set-table tbody { display: block; }
  .ml-set-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .ml-set-table colgroup { display: none; }
  .ml-set-table tbody tr {
    display: grid; grid-template-columns: minmax(0,1fr) minmax(0,.85fr) auto auto;
    grid-template-areas: "name name status actions" "brand price images videos"; align-items: center;
    gap: 2px 8px; padding: 5px 8px; border-top: 1px solid var(--ml-border);
  }
  .ml-set-table tbody tr:first-child { border-top: 0; }
  .ml-set-table tbody td { display: block; min-width: 0; border: 0; padding: 0; font-size: 12px; }
  .ml-set-table .ml-set-name { grid-area: name; }
  .ml-set-table .ml-set-brand { grid-area: brand; }
  .ml-set-table .ml-set-price { grid-area: price; }
  .ml-set-table .ml-set-status { grid-area: status; }
  .ml-set-table .ml-set-actions { grid-area: actions; }
  .ml-set-table .ml-set-images { grid-area: images; }
  .ml-set-table .ml-set-videos { grid-area: videos; }
  .ml-set-table .ml-set-brand, .ml-set-table .ml-set-price { color: var(--ml-muted); }
  .ml-set-table td[colspan] { grid-column: 1/-1; }
  .ml-set-thumb { width: 30px; height: 30px; }
  .ml-set-media svg { width: 13px; height: 13px; margin-right: 4px; }
  .ml-set-videos::before { display: none; }
  .ml-set-action-group { justify-content: end; gap: 2px; }
  .ml-set-action-group button, .ml-set-action-group button + button { width: 27px; height: 29px; margin: 0; padding: 4px; }
  .ml-set-action-group button + button::before { content: none; }
  .ml-set-action-group button > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .ml-set-search { flex: 1; }
}
@media (max-width:550px) {
  .ml-set-page .page-heading { gap: 6px; }
  .ml-set-page .page-heading h1 { font-size: clamp(18px,5vw,23px); }
  .ml-set-page .heading-actions { gap: 4px; }
  .ml-set-page .heading-actions .btn { min-height: 30px; padding: 4px 8px; font-size: 11px; }
  .ml-set-page .heading-actions .btn-ghost > .button-label { display: none; }
  .ml-set-page .heading-actions .btn-primary > .button-label { display: inline; }
  .ml-set-filters { gap: 6px; }
}
@media (max-height:480px) {
  .ml-set-page .page-heading { margin: 0 0 4px; }
  .ml-set-filters { margin-bottom: 6px; }
}

/* The editor's product fields stay above the three language workspace columns. */
.ml-editor.ad-set-dialog {
  --ml-gap: clamp(6px,1.5vh,13px);
  --ml-x: clamp(12px,1.5vw,22px);
  --ml-line: #373b40;
  width: min(1400px,calc(100vw - clamp(24px,50vw - 385px,20vw)));
  height: clamp(520px,82.5vh,820px); max-height: calc(100vh - 20px); max-height: calc(100dvh - 20px);
  border: 1px solid #4a4f55; border-radius: 11px; color: #ecedf0; background: #202327;
}
.ml-editor::backdrop { background: rgba(8,10,12,.68); backdrop-filter: blur(3px); }
.ml-editor > .ad-set-form {
  display: flex; flex-direction: column; width: 100%; height: 100%; max-height: none; min-height: 0;
}
.ml-editor .dialog-header { flex: none; align-items: center; padding: clamp(7px,1.4vh,13px) var(--ml-x); }
.ml-editor .dialog-header h2 { font-size: clamp(15px,1.4vw,20px); font-weight: 600; }
.ml-editor .dialog-header button { min-width: 28px; min-height: 26px; padding: 3px; border-color: transparent; background: transparent; }
.ml-editor .dialog-header button:hover { background: #373c42; }
.ml-editor .dialog-header button svg { width: 17px; height: 17px; }
.ml-editor .ad-set-dialog-body {
  display: flex; flex: 1; flex-direction: column; align-items: stretch; align-content: normal; min-height: 0; min-width: 0;
  padding: 0; gap: 0; overflow: visible;
}
.ml-editor .ml-editor-product {
  display: grid; grid-template-columns: minmax(180px,2.1fr) minmax(115px,1.1fr) minmax(70px,.7fr) minmax(78px,.75fr);
  flex: none; align-items: end; gap: var(--ml-gap) var(--ml-x); padding: clamp(7px,1.9vh,16px) var(--ml-x);
  border: 0; border-radius: 0; border-bottom: 1px solid var(--ml-line); background: transparent;
}
.ml-editor .field { min-width: 0; gap: 4px; margin: 0; }
.ml-editor .field-label { letter-spacing: 0; font-size: 12px; line-height: 1.2; font-weight: 500; color: #d8dadd; }
.ml-editor .field input,.ml-editor .field select,.ml-editor textarea,.ml-editor-panes select,.ml-editor select.ml-slot-picker {
  width: 100%; min-width: 0; min-height: 0; height: clamp(27px,4.6vh,38px);
  border: 1px solid #44484e; border-radius: 6px; padding: 4px 10px; background: #1c1f22; color: #f2f4f5;
  font-size: clamp(12px,1vw,14px); line-height: 1.35;
}
.ml-editor .ad-set-builder {
  flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0,1.08fr) minmax(0,1fr) minmax(0,1fr);
  align-items: stretch; gap: 0;
}
.ml-editor .ad-set-builder > * {
  display: flex; flex-direction: column; min-width: 0; min-height: 0; gap: var(--ml-gap);
  padding: var(--ml-gap) var(--ml-x); border-left: 1px solid var(--ml-line);
}
.ml-editor .ad-set-builder > :first-child { padding-inline: clamp(9px,1.1vw,16px); border-left: 0; }
.ml-editor .ad-set-builder-heading { display: flex; flex: none; gap: 8px; align-items: center; min-height: 23px; }
.ml-editor .ad-set-builder-heading h3, .ml-editor .ad-set-builder h3 { margin: 0; font-weight: 600; font-size: clamp(12px,1.1vw,16px); line-height: 1.2; }
.ml-editor .ad-set-builder-heading small { margin-left: auto; font-size: 11px; }
.ml-editor .ad-set-batch-pick { min-height: 27px; padding: 4px 8px; border: 1px solid #3e444b; border-radius: 5px; font-size: 12px; background: transparent; }
.ml-editor .ad-set-batch-pick svg { width: 14px; height: 14px; }
.ml-editor .ad-set-slots {
  flex: 1; align-content: start; min-height: 0; display: grid;
  grid-template-rows: repeat(7,minmax(0,1fr)); gap: clamp(2px,.55vh,5px);
}
.ml-editor .ad-set-slot {
  position: relative; display: flex; min-height: 0; min-width: 0; gap: 5px; align-items: center; justify-content: space-between;
  padding: 1px 5px; border: 1px solid #363b40; border-radius: 6px; background: #1c1f22;
}
.ml-editor .ad-set-slot.is-active { border-color: #268bd2; background: #1b2d3b; }
.ml-editor .ad-set-slot-edit {
  flex: 1; min-width: 0; min-height: 0; height: 100%; display: flex; gap: 8px; align-items: center;
  padding: 2px; border: 0; border-radius: 4px; color: inherit; background: transparent; text-align: left;
}
.ml-editor .ad-set-slot-preview {
  display: grid; place-items: center; height: clamp(24px,5vh,44px); max-height: 100%; max-width: 44px;
  width: clamp(24px,5vh,44px); min-width: 0; aspect-ratio: 1/1; flex: none; border: 0; border-radius: 4px;
}
.ml-editor .ad-set-slot-preview .ad-set-preview { width: 100%; height: 100%; }
.ml-editor .ad-set-slot-preview .ad-set-preview > span { padding: 0; font-size: 9px; }
.ml-editor .ad-set-slot-preview svg { width: 15px; height: 15px; }
.ml-editor .ad-set-slot-fields { display: flex; flex: 1; flex-direction: column; align-items: stretch; min-width: 0; gap: 1px; }
.ml-editor .ad-set-slot-locale,.ml-editor .ad-set-slot-filename { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ml-editor .ad-set-slot-locale { color: #e5e8ec; font-size: clamp(11px,1vw,14px); font-weight: 500; line-height: 1.2; }
.ml-editor .ad-set-slot-filename { font-size: clamp(10px,.85vw,12px); line-height: 1.15; }
.ml-editor .ad-set-slot-pair { display: inline-flex; align-items: center; flex: none; gap: 3px; line-height: 1; }
.ml-editor .ad-set-slot-pair svg { width: 13px; height: 13px; }
.ml-editor .ml-slot-actions { flex: none; }
.ml-editor .ad-set-file-choose {
  display: inline-grid; place-items: center; min-height: 23px; width: 25px; padding: 2px;
  border: 1px solid transparent; border-radius: 4px; color: #d2d8df; font-size: 12px; line-height: 1; background: #292d32;
}
.ml-editor .ml-slot-menu {
  position: absolute; z-index: 2; max-width: calc(100% - 12px); width: max-content; padding: 4px;
  border: 1px solid #49515a; border-radius: 6px; background: #25292e; box-shadow: 0 6px 22px #0006;
}
.ml-editor .ml-slot-menu button { display: flex; width: 100%; min-height: 27px; justify-content: flex-start; padding: 4px 9px; border: 0; background: transparent; font-size: 12px; }
.ml-editor .ml-slot-menu button:hover { background: #343c45; }
.ml-editor .ml-video-note { flex: none; margin: 0; color: #aeb6bd; font-size: 11px; line-height: 1.25; }
.ml-editor .ad-set-language-panes, .ml-editor .ad-set-language-texts { display: grid; align-content: start; gap: var(--ml-gap); min-height: 0; min-width: 0; }
.ml-editor .ad-set-builder-source > .field + .field, .ml-editor .ad-set-language-texts { margin: 0; }
.ml-editor .ad-set-builder-source textarea,.ml-editor .ad-set-language-texts textarea {
  margin: 0; height: clamp(37px,8vh,83px); min-height: 0; padding: 6px 9px;
  line-height: 1.35; font-family: inherit; font-weight: 400; resize: none; scrollbar-width: none;
}
.ml-editor textarea::-webkit-scrollbar { width: 0; height: 0; }
.ml-editor textarea[name=primary],.ml-editor textarea[name=sourcePrimary] { height: clamp(48px,11.4vh,119px); min-height: 0; }
.ml-editor textarea[name=headline],.ml-editor textarea[name=sourceHeadline] { height: clamp(27px,4.6vh,38px); min-height: 0; }
.ml-editor .ad-set-language-panes textarea[readonly] { background: #1c1f22; color: #e2e5e8; }
.ml-editor .ad-set-translation-feedback { flex: none; min-height: 0; line-height: 1.25; font-size: 11px; }
.ml-editor .ad-set-translation-feedback .btn { min-height: 24px; padding: 2px 6px; font-size: inherit; }
.ml-editor .ad-set-footer {
  flex: none; align-items: center; gap: 8px; padding: var(--ml-gap) var(--ml-x); border-top: 1px solid var(--ml-line); background: transparent;
}
.ml-editor .ml-editor-state { display: inline-flex; flex: none; align-items: center; gap: 6px; color: #cbd1d6; font-size: 12px; }
.ml-editor .ad-set-footer .btn { min-height: clamp(27px,4.6vh,36px); padding: 4px 11px; font-size: 12px; }
.ml-editor .ad-set-message { margin: 0; font-size: 11px; line-height: 1.25; }
.ml-editor .ml-editor-panes,.ml-editor .ml-slot-picker { display: none; }
.ml-video-preview { width: min(600px,calc(100vw - 20px)); max-width: none; max-height: calc(100vh - 12px); overflow: hidden; }
.ml-video-preview header { display: flex; justify-content: space-between; align-items: center; padding: 7px 12px; border-bottom: 1px solid #40464d; }
.ml-video-preview h3 { margin: 0; font-size: 15px; }
.ml-video-preview .ad-set-pair-frame video,.ml-video-preview .ad-set-preview { display:block; width: 100%; height: min(55vh,520px); max-height: none; background: #15181b; border: 0; object-fit: contain; }

.ml-set-page [hidden] { display: none !important; }
.ml-set-readonly .ml-set-table thead th:last-child { width: 15%; }
.ml-set-page .ml-set-empty td { color: var(--ml-muted); padding: 12px; text-align: center; }
.ml-editor .ad-set-builder-media.is-dragover { background: #21303a; outline: 1px dashed #5cabe5; outline-offset: -4px; }
.ml-editor .ad-set-slot-pair {
  padding: 2px; border: 0; border-radius: 3px; background: transparent; color: #a3b0bd; cursor: pointer;
}
.ml-editor .ad-set-slot-pair.is-ready { color: #d8e6ed; }
.ml-editor .ad-set-slot-pair[disabled] { cursor: default; color: #67737b; }
.ml-editor .ml-slot-menu select { width: 100%; max-width: 100%; min-width: 0; }
.ml-editor .ad-set-file-choose svg { width: 15px; height: 15px; }
.ml-editor .ad-set-guide { margin: 0; padding: 5px var(--ml-x); border: 0; border-radius: 0; font-size: 11px; }
@media (min-width:741px) and (min-height:651px) {
  .ml-editor .ad-set-builder-source,.ml-editor .ad-set-builder-translation { padding-top: 16px; gap: 0; }
  .ml-editor .ad-set-builder-source > h3,.ml-editor .ad-set-builder-translation > h3 { margin-bottom: clamp(14px,2.6vh,23px); }
  .ml-editor .ad-set-language-texts { gap: clamp(12px,2.3vh,20px); }
  .ml-editor .ad-set-language-texts .field { gap: 6px; }
  .ml-editor .ad-set-translation-feedback { margin-top: 5px; }
}
@media (min-width:741px) and (max-height:650px) {
  .ml-editor { --ml-gap: 6px; }
  .ml-editor .ad-set-builder > * { padding-block: 8px; }
  .ml-editor .ad-set-slot-preview { max-height: 34px; max-width: 34px; }
  .ml-editor .ad-set-slot-edit { gap: 6px; }
  .ml-editor .ad-set-slot-locale { font-size: 12px; }
  .ml-editor .ad-set-slot-pair svg { width: 12px; height: 12px; }
}
@media (max-width:740px), (max-height:510px) {
  .ml-editor.ad-set-dialog {
    --ml-gap: clamp(5px,1.35vh,10px); --ml-x: clamp(10px,2vw,16px);
    width: min(590px,calc(100vw - 12px)); height: min(670px,calc(100vh - 12px)); height: min(670px,calc(100dvh - 12px));
    max-height: calc(100vh - 12px); max-height: calc(100dvh - 12px);
  }
  .ml-editor .ml-editor-panes { display: flex; align-items: center; padding: 6px var(--ml-x); border-bottom: 1px solid var(--ml-line); }
  .ml-editor .ml-editor-panes select { width: 100%; }
  .ml-editor .ad-set-dialog-body { min-height: 0; }
  .ml-editor .ml-editor-product { display: none; }
  .ml-editor[data-editor-pane=product] .ml-editor-product {
    display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); align-content: start; gap: 10px; border-bottom: 0;
  }
  .ml-editor[data-editor-pane=product] .ad-set-builder { display: none; }
  .ml-editor .ad-set-builder { display: flex; flex-direction: column; min-height: 0; }
  .ml-editor .ad-set-builder > * { display: none; flex: 1; padding: var(--ml-gap) var(--ml-x); border: 0; }
  .ml-editor[data-editor-pane=media] .ad-set-builder-media,
  .ml-editor[data-editor-pane=source] .ad-set-builder-source,
  .ml-editor[data-editor-pane=translation] .ad-set-builder-translation { display: flex; }
  .ml-editor .ad-set-builder-source > h3, .ml-editor .ad-set-builder-translation > h3 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .ml-editor .ad-set-slots { grid-template-rows: repeat(7,minmax(0,55px)); }
  .ml-editor .ad-set-footer { justify-content: flex-end; padding: var(--ml-gap) var(--ml-x); gap: 6px; }
  .ml-editor .ml-editor-state { margin-right: auto; }
  .ml-editor .ad-set-message:empty { display: none; }
  .ml-editor .ad-set-message:not(:empty) { flex: 1 1 100%; order: -1; }
  .ml-editor:not([data-editor-pane=product]) .ad-set-guide { display: none; }
}
@media (max-height:480px) {
  .ml-editor .ml-slot-picker { display: block; width: 100%; height: 28px; font-size: 12px; }
  .ml-editor .ad-set-slots { flex: none; grid-template-rows: 42px; }
  .ml-editor .ad-set-slot[data-short-inactive=true] { display: none; }
  .ml-editor .dialog-header { padding-block: 4px; }
  .ml-editor .ml-editor-panes { padding-block: 3px; }
  .ml-editor .ad-set-footer { flex-wrap: wrap; padding-block: 4px; }
  .ml-editor .ml-editor-product > .field { gap: 2px; }
  .ml-editor .ad-set-language-texts { gap: 3px; }
  .ml-editor .ad-set-language-texts .field { gap: 1px; }
  .ml-editor .ad-set-language-texts textarea { height: clamp(30px,8vh,42px); }
  .ml-editor .ad-set-language-texts textarea[name=sourcePrimary],.ml-editor .ad-set-language-texts textarea[name=primary] { height: clamp(34px,9.5vh,49px); }
  .ml-editor .ad-set-language-texts textarea[name=sourceHeadline],.ml-editor .ad-set-language-texts textarea[name=headline] { height: 26px; }
}
@media (max-width:430px) and (min-height:511px) {
  .ml-editor[data-editor-pane=product] .ml-editor-product > .field:nth-child(-n+2) { grid-column: 1/-1; }
}
