/* Design editor in the Tools panel (owner session only), js/elbuz_editor.js.
   Colours follow the preset (--et-* roles), but sizes, radii, fonts and spacing are fixed:
   the editor must stay readable with any preset (base 22px, radius 0, underline buttons, serif caps…).
   Own prefix .et-ed-*, no storefront classes. */

/* The owner's panel is the editor: a column with fixed head and foot, a scrolling body */
.et-tools__panel.et-ed-docked {
  padding-top: 0.75rem;
  padding-bottom: 0;
  flex-direction: column;
  overflow: hidden;
}
.et-tools__panel.et-ed-docked.is-open { display: flex; }

/* Hybrid panel (A6). Wide screens (≥ 1280 px): an open panel is a side column, the site moves aside and stays whole.
   1280 is the smallest width where the site keeps ≥ 900 px next to the column — still its desktop layout (≥ 768 px
   tablet steps, ≥ 880 px for four product cards in a row); narrower screens get the panel over the page, as before.
   html.et-ed-side: set by header.twig before the first paint, kept in sync by js/elbuz_editor.js. Fixed parts of the site
   (cookie banner, sticky bars, cart / filter panels, toasts, scroll-to-top) are moved so none of them slides under it. */
@media (min-width: 1280px) {
  html.et-ed-side { --et-ed-w: clamp(360px, 28vw, 440px); }
  html.et-ed-side body { margin-right: var(--et-ed-w); }
  html.et-ed-side .et-tools__panel.is-open { width: var(--et-ed-w); min-width: 0; box-shadow: none; animation: none; }
  html.et-ed-side .et-tools-trigger { display: none; }
  html.et-ed-side :is(.et-consent--bar, .et-consent--modal, .et-sticky-bar, .et-mobile-buybar, .et-mobile-checkout-bar, .et-modal, .et-listing__overlay, dialog.et-search-overlay, .et-sheet--right, .et-sheet--bottom) { right: var(--et-ed-w); }
  html.et-ed-side :is(dialog.et-search-overlay, .et-sheet--bottom) { width: auto; }
  html.et-ed-side .et-listing--right .et-listing__filters { inset-inline: auto var(--et-ed-w); }
  html.et-ed-side .et-scroll-top { right: calc(var(--et-ed-w) + 1.5rem); }
  html.et-ed-side .et-toast-container { right: calc(var(--et-ed-w) + 1rem); }
  html.et-ed-side .et-hero-sidebar__flyout { width: calc(100vw - var(--et-ed-w) - 280px - 4rem); }
}
/* Reopened after an editor reload: no slide-in */
.et-tools__panel.is-open.et-ed-restore { animation: none; }
/* Opened before the first paint after an editor reload, shown once the editor has drawn itself (no spinner → body blink) */
.et-tools__panel.et-ed-boot { visibility: hidden; }
/* Home section whose editor panel is open (et:section:select): outlined on the page */
.et-section.et-ed-selected { outline: 2px solid var(--et-accent); outline-offset: -2px; scroll-margin-top: 5rem; }
/* Section being re-rendered after a change: dims, a thin bar runs along its top; the new rendering fades in */
.et-section.et-ed-updating { position: relative; pointer-events: none; }
.et-section.et-ed-updating > * { opacity: 0.45; filter: saturate(0.6); transition: opacity 0.2s ease, filter 0.2s ease; }
.et-section.et-ed-updating::after {
  content: ''; position: absolute; z-index: 5; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, transparent, var(--et-accent), transparent) 0 0 / 40% 100% no-repeat;
  animation: et-ed-bar 0.9s ease-in-out infinite;
}
@keyframes et-ed-bar { from { background-position: -40% 0; } to { background-position: 140% 0; } }
.et-section.et-ed-updated { animation: et-ed-in 0.3s ease-out; }
@keyframes et-ed-in { from { opacity: 0.45; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .et-section.et-ed-updating::after { animation: none; background: var(--et-accent); opacity: 0.6; }
  .et-section.et-ed-updated { animation: none; }
}


.et-ed,
.et-ed-dialog {
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  font-size: 14px;
  font-style: normal;
  line-height: 1.4;
  letter-spacing: normal;
  text-transform: none;
  color: var(--et-text);
}
#etEditor { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.et-ed { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; }
.et-ed.is-busy .et-ed-head { cursor: progress; }
.et-ed *, .et-ed-dialog * { box-sizing: border-box; letter-spacing: normal; text-transform: none; }

.et-ed-head { display: grid; gap: 8px; padding-bottom: 10px; border-bottom: 1px solid var(--et-border); }
.et-ed-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

.et-ed-tip--block { display: flex; min-width: 0; }
.et-ed-tip--block > .et-ed-tip__target { flex: 1 1 auto; min-width: 0; }
/* Mini page of a design (colours of the design itself, set inline as --l-*) */
.et-ed-look {
  position: relative; display: block; height: 64px; overflow: hidden; border-radius: 5px;
  background: var(--l-bg, #fff); border: 1px solid rgba(0, 0, 0, 0.08);
}
.et-ed-look__bar { position: absolute; inset: 0 0 auto; height: 6px; background: var(--l-bar, var(--l-text, #222)); }
.et-ed-look__head { position: absolute; inset: 6px 0 auto; height: 12px; background: var(--l-head, var(--l-surface, #f4f4f4)); border-bottom: 1px solid rgba(0, 0, 0, 0.06); }
.et-ed-look__title { position: absolute; left: 8px; top: 21px; font-size: 20px; font-weight: 700; line-height: 1; color: var(--l-text, #222); }
.et-ed-look__line { position: absolute; left: 8px; right: 30px; top: 45px; height: 4px; border-radius: 2px; background: var(--l-text, #222); opacity: 0.25; }
.et-ed-look__btn { position: absolute; right: 8px; bottom: 8px; width: 30px; height: 14px; border-radius: min(var(--l-radius, 6px), 7px); background: var(--l-accent, #2563eb); }

/* Body: "Page sections" and "Site style" */
.et-ed-area { display: grid; gap: 0; padding-top: 10px; }
.et-ed-area[hidden] { display: none; }
.et-ed-area__title { margin: 0 0 4px; padding: 0 4px; font-family: inherit; font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--et-text-muted); }
.et-ed-group--flat { border-bottom: 0; }
.et-ed-group--flat > .et-ed-group__body { padding: 6px 0 10px; }
.et-ed-group--flat .et-ed-field--order-list > .et-ed-field__head { display: none; }
.et-ed-group--chrome { border: 1px solid var(--et-border); border-radius: 6px; margin: 4px 0; background: var(--et-surface); }
.et-ed-group--chrome > .et-ed-group__head { padding: 8px 10px; font-size: 13px; }
.et-ed-group--chrome > .et-ed-group__body { padding: 2px 10px 12px; }
.et-ed-row > .et-ed-select { flex: 1 1 auto; width: auto; }
.et-ed-row--end { justify-content: flex-end; margin-top: 12px; }

/* Buttons */
.et-ed-btn,
.et-ed-icon-btn,
.et-ed-seg > button,
.et-ed-cards > button {
  font: inherit;
  margin: 0;
  color: var(--et-text);
  background: var(--et-surface);
  border: 1px solid var(--et-border-strong, var(--et-border));
  border-radius: 6px;
  box-shadow: none;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s;
}
.et-ed-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 6px 12px; }
.et-ed-btn:hover, .et-ed-icon-btn:hover:not(:disabled), .et-ed-seg > button:hover { border-color: var(--et-accent); }
.et-ed-btn--primary { background: var(--et-accent); border-color: var(--et-accent); color: var(--et-accent-contrast, #fff); }
.et-ed-btn--primary:hover { background: var(--et-accent-hover, var(--et-accent)); }
.et-ed-btn--link { border-color: transparent; background: none; color: var(--et-text-secondary); text-decoration: underline; }
.et-ed-btn:disabled, .et-ed-icon-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.et-ed-btn[hidden] { display: none; }
.et-ed-icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; padding: 0; }
.et-ed-icon-btn[hidden] { display: none; }
.et-ed-field__reset { width: 26px; height: 26px; font-size: 11px; margin-left: auto; }
.et-ed :focus-visible, .et-ed-dialog :focus-visible { outline: 2px solid var(--et-accent); outline-offset: 2px; }

/* Inputs */
.et-ed-input,
.et-ed-select {
  font: inherit;
  width: 100%;
  min-height: 34px;
  padding: 6px 10px;
  color: var(--et-text);
  background: var(--et-bg);
  border: 1px solid var(--et-border-strong, var(--et-border));
  border-radius: 6px;
}
.et-ed-input[aria-invalid="true"] { border-color: var(--et-danger); }

/* Segmented (also the Simple / Advanced switch) */
.et-ed-seg { display: inline-flex; flex-wrap: wrap; gap: 0; border-radius: 6px; }
.et-ed-seg > button { padding: 6px 10px; min-height: 32px; border-radius: 0; margin-left: -1px; }
.et-ed-seg > button:first-child { border-radius: 6px 0 0 6px; margin-left: 0; }
.et-ed-seg > button:last-child { border-radius: 0 6px 6px 0; }
.et-ed-seg > button.is-on { background: var(--et-accent); border-color: var(--et-accent); color: var(--et-accent-contrast, #fff); position: relative; }
.et-ed-level { margin-left: auto; }

/* Body: accordion of groups */
.et-ed-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; padding: 4px 2px 12px; overscroll-behavior: contain; }
.et-ed-group { border-bottom: 1px solid var(--et-border); }
.et-ed-group[hidden] { display: none; }
.et-ed-group__head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 4px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  list-style: none;
}
.et-ed-group__head::-webkit-details-marker { display: none; }
.et-ed-group__head::after { content: '+'; margin-left: auto; color: var(--et-text-muted); font-weight: 400; font-size: 18px; line-height: 1; }
.et-ed-group[open] > .et-ed-group__head::after { content: '−'; }
.et-ed-group__head i { width: 18px; text-align: center; color: var(--et-accent); }
.et-ed-group__body { display: grid; gap: 14px; padding: 2px 4px 14px; }

.et-ed-field[hidden] { display: none; }
/* Folding field (block variants, section lists): a sub-level of the group, same +/− */
.et-ed-fold { border: 1px solid var(--et-border); border-radius: 0; }
.et-ed-fold__head { display: flex; align-items: center; gap: 8px; padding: 8px 10px; cursor: pointer; list-style: none; }
.et-ed-fold__head::-webkit-details-marker { display: none; }
.et-ed-fold__head::after { content: '+'; color: var(--et-text-muted); font-size: 16px; line-height: 1; }
.et-ed-fold[open] > .et-ed-fold__head::after { content: '−'; }
.et-ed-fold__value { margin-left: auto; font-size: 12px; color: var(--et-text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 55%; }
.et-ed-fold__body { padding: 0 10px 10px; }
.et-ed-fold__help { margin: 0 0 8px; font-size: 12px; color: var(--et-text-secondary); }
.et-ed-field__head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 6px; }
.et-ed-field__label { font-size: 13px; font-weight: 600; color: var(--et-text); margin: 0; }
.et-ed-field__lang { margin-left: 6px; padding: 0 5px; border: 1px solid var(--et-border); border-radius: var(--et-radius-xs); font-size: 10px; font-weight: 600; letter-spacing: 0.04em; color: var(--et-text-muted); vertical-align: 1px; }
.et-ed-dialog .et-ed-field__label { display: block; margin: 10px 0 4px; }
.et-ed-badge { font-size: 11px; color: var(--et-text-muted); border: 1px solid var(--et-border); border-radius: 999px; padding: 1px 6px; }
.et-ed-help { display: contents; }
.et-ed-help > summary { list-style: none; cursor: pointer; color: var(--et-text-muted); font-size: 13px; }
.et-ed-help > summary::-webkit-details-marker { display: none; }
.et-ed-help > p { flex: 1 0 100%; margin: 2px 0 0; font-size: 12px; color: var(--et-text-secondary); }
.et-ed-field--toggle { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.et-ed-field--toggle .et-ed-field__head { margin: 0; flex: 1 1 0; }

/* Toggle */
.et-ed-switch {
  position: relative;
  width: 42px;
  height: 24px;
  padding: 0;
  margin: 0;
  border: 0;
  border-radius: 12px;
  background: var(--et-border-strong, var(--et-border));
  cursor: pointer;
  flex: 0 0 auto;
}
.et-ed-switch::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  transition: transform 0.15s;
}
.et-ed-switch[aria-checked="true"] { background: var(--et-accent); }
.et-ed-switch[aria-checked="true"]::after { transform: translateX(18px); }

/* Range */
.et-ed-range { display: flex; align-items: center; gap: 10px; }
.et-ed-range__input { flex: 1 1 auto; accent-color: var(--et-accent); margin: 0; }
.et-ed-range__val { min-width: 52px; text-align: right; font-variant-numeric: tabular-nums; font-size: 13px; color: var(--et-text-secondary); }

/* Colour */
.et-ed-color { display: flex; gap: 8px; align-items: center; }
.et-ed-color__pick { width: 44px; height: 34px; padding: 2px; border: 1px solid var(--et-border); border-radius: 6px; background: var(--et-bg); cursor: pointer; }
.et-ed-color__hex { max-width: 120px; font-family: ui-monospace, Consolas, monospace; text-transform: uppercase; }
/* color-map: role → colour rows (own colours of single parts); one grid, so the columns line up */
.et-ed-colormap { display: grid; grid-template-columns: minmax(0, 1fr) 44px 7em 30px; align-items: center; gap: 6px; }
.et-ed-colormap__row { display: contents; }
.et-ed-colormap__name { font-size: 13px; color: var(--et-text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin: 0; min-width: 0; }
.et-ed-colormap__row.is-own .et-ed-colormap__name { color: var(--et-text); font-weight: 600; }
.et-ed-colormap__row:not(.is-own) .et-ed-color__pick { opacity: .55; }
.et-ed-colormap .et-ed-color__hex { max-width: none; min-width: 0; }
.et-ed-colormap .et-ed-color__hex::placeholder { text-transform: none; font-family: system-ui, sans-serif; font-size: 12px; }
.et-ed-colormap__reset { width: 30px; height: 30px; font-size: 12px; }
.et-ed-colormap__reset.is-off { visibility: hidden; }

/* Cards: block variants, font pairs */
.et-ed-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.et-ed-cards > button { display: flex; flex-direction: column; align-items: stretch; gap: 4px; padding: 8px; text-align: left; }
.et-ed-cards > button.is-on { border-color: var(--et-accent); box-shadow: inset 0 0 0 1px var(--et-accent); }
.et-ed-cards--fonts { grid-template-columns: 1fr 1fr; }
.et-ed-cards--cursor { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
.et-ed-cursor { display: grid; gap: 10px; }
.et-ed-cursor__opts { display: grid; gap: 6px; }
.et-ed-cursor__opts[hidden] { display: none; }
/* Page background (decor.backdrop, R43): mode buttons, colour blends, picture tiles */
.et-ed-backdrop { display: grid; gap: 10px; }
.et-ed-backdrop__modes { width: 100%; }
.et-ed-backdrop__body { display: grid; gap: 10px; }
.et-ed-backdrop__row { display: grid; gap: 4px; }
.et-ed-backdrop__row--inline { grid-template-columns: 1fr auto; align-items: center; }
.et-ed-backdrop__caption { margin: 0; font-size: 12px; font-weight: 600; color: var(--et-text-secondary); }
.et-ed-backdrop__note { margin: 0; font-size: 12px; color: var(--et-text-secondary); }
.et-ed-backdrop__swatches { display: flex; flex-wrap: wrap; gap: 6px; }
.et-ed-backdrop__swatch { width: 36px; height: 36px; padding: 0; border: 1px solid var(--et-border-strong, var(--et-border)); border-radius: 50%; cursor: pointer; }
.et-ed-backdrop__swatch[aria-pressed="true"] { outline: 2px solid var(--et-accent); outline-offset: 2px; }
.et-ed-backdrop__tiles { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); max-height: 420px; overflow-y: auto; padding: 2px; }
.et-ed-backdrop__tiles > button { padding: 6px; }
.et-ed-backdrop__tiles > button[aria-pressed="true"] { border-color: var(--et-accent); box-shadow: inset 0 0 0 1px var(--et-accent); }
.et-ed-backdrop__own { display: grid; gap: 6px; padding-top: 6px; border-top: 1px solid var(--et-border); }
.et-ed-backdrop__more > summary { cursor: pointer; font-size: 13px; }
.et-ed-backdrop__more[open] { display: grid; gap: 8px; }
.et-ed-backdrop .et-ed-color { flex-wrap: nowrap; }
.et-ed-cursor__img { width: 40px; height: 40px; display: grid; place-items: center; font-size: 22px; line-height: 1; color: var(--et-text-secondary); }
.et-ed-card__img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 4px; background: var(--et-surface-2, var(--et-bg)); }
.et-ed-card__name { font-weight: 600; font-size: 13px; }
.et-ed-card__desc { font-size: 12px; color: var(--et-text-secondary); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.et-ed-font__sample { font-size: 22px; line-height: 1.2; color: var(--et-text); }

/* Section list of the page: grip + name (opens the settings) + eye + arrows + bin. Only the grip and the name start a drag */
.et-ed-order { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; } /* long one-line rows must not widen the panel */
.et-ed-order__item { padding: 3px; background: var(--et-bg); border: 1px solid var(--et-border); border-radius: 6px; }
.et-ed-order__item.is-open { border-color: var(--et-accent); }
.et-ed-order__row { display: flex; align-items: center; gap: 4px; }
.et-ed-order__settings { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; padding: 10px 6px 8px; border-top: 1px solid var(--et-border); margin-top: 3px; }
.et-ed-order__settings[hidden] { display: none; }
.et-ed-order__item.is-off .et-ed-order__open { opacity: 0.5; text-decoration: line-through; }
.et-ed-order__item.is-drag { opacity: 0.4; border-style: dashed; }
.et-ed-order__grip { flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 32px; color: var(--et-text-muted); cursor: grab; touch-action: none; }
.et-ed-order__open {
  flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: 6px; min-height: 32px; padding: 4px 6px;
  font: inherit; font-size: 13px; font-weight: 600; text-align: left; color: var(--et-text); background: none; border: 0; border-radius: 4px; cursor: pointer;
}
.et-ed-order__open:hover { background: var(--et-surface-2, var(--et-surface)); }
.et-ed-order__open > i { margin-left: auto; font-size: 11px; color: var(--et-text-muted); transition: transform 0.15s; }
.et-ed-order__open[aria-expanded="true"] > i { transform: rotate(180deg); }
.et-ed-order__name { min-width: 0; overflow-wrap: anywhere; }
.et-ed-order .et-ed-icon-btn { width: 28px; height: 28px; font-size: 12px; flex: 0 0 auto; }
.et-ed-order .et-ed-eye[aria-pressed="true"] { color: var(--et-text-muted); border-style: dashed; }
.et-ed-order__empty { padding: 8px; font-size: 13px; color: var(--et-text-secondary); list-style: none; }
.et-ed-order .et-ed-del:hover:not(:disabled) { border-color: var(--et-danger); color: var(--et-danger); }
.et-ed-sections { display: grid; gap: 8px; }
.et-ed-btn--add { width: 100%; justify-content: center; border-style: dashed; }
/* "Add section": section types as cards; ready-made combinations as chips under their type */
.et-ed-addlist { display: grid; gap: 6px; margin-top: 6px; }
.et-ed-addlist[hidden] { display: none; }
.et-ed-addlist__item { display: grid; gap: 4px; }
.et-ed-addlist__type {
  display: grid; gap: 2px; width: 100%; padding: 8px 10px; font: inherit; text-align: left; color: var(--et-text);
  background: var(--et-surface); border: 1px solid var(--et-border); border-radius: 6px; cursor: pointer;
}
.et-ed-addlist__type:hover:not(:disabled) { border-color: var(--et-accent); }
.et-ed-addlist__type:disabled { opacity: 0.5; cursor: not-allowed; }
.et-ed-addlist__name { font-weight: 600; font-size: 13px; }
.et-ed-addlist__desc { font-size: 12px; color: var(--et-text-secondary); }
.et-ed-addlist__presets { display: flex; flex-wrap: wrap; gap: 4px; padding-left: 10px; }
.et-ed-chip { font: inherit; font-size: 12px; padding: 3px 10px; color: var(--et-text); background: var(--et-bg); border: 1px solid var(--et-border); border-radius: 999px; cursor: pointer; }
.et-ed-chip:hover { border-color: var(--et-accent); }
.et-ed-select[hidden] { display: none; }

/* Icon picker: a grid of pictograms */
.et-ed-icons { display: grid; grid-template-columns: repeat(auto-fill, minmax(38px, 1fr)); gap: 4px; }
.et-ed-icons > button { display: inline-flex; align-items: center; justify-content: center; min-height: 36px; padding: 4px; font: inherit; font-size: 15px; color: var(--et-text); background: var(--et-bg); border: 1px solid var(--et-border); border-radius: 6px; cursor: pointer; }
.et-ed-icons > button:first-child { grid-column: span 2; font-size: 12px; }
.et-ed-icons > button.is-on { border-color: var(--et-accent); box-shadow: inset 0 0 0 1px var(--et-accent); color: var(--et-accent); }
.et-ed-sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Textarea controls (text, lines) */
.et-ed-textarea { min-height: 84px; resize: vertical; line-height: 1.4; }

/* Blocks list (primitives of a section; a group nests one more list) */
.et-ed-blocks { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; }
.et-ed-blocks__list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; }
.et-ed-blocks__item { padding: 3px; background: var(--et-surface); border: 1px solid var(--et-border); border-radius: 6px; }
.et-ed-blocks--nested .et-ed-blocks__item { background: var(--et-bg); }
.et-ed-blocks__row { display: flex; align-items: center; gap: 4px; }
.et-ed-blocks__toggle {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 28px;
  padding: 2px 6px;
  font: inherit;
  font-size: 13px;
  text-align: left;
  color: var(--et-text);
  background: none;
  border: 0;
  border-radius: 4px;
  cursor: pointer;
}
.et-ed-blocks__toggle:hover:not(:disabled) { background: var(--et-surface-2, var(--et-bg)); }
.et-ed-blocks__toggle[aria-expanded="true"] { color: var(--et-accent); }
.et-ed-blocks__toggle:disabled { color: var(--et-text-muted); cursor: default; }
.et-ed-blocks__toggle > i { width: 16px; text-align: center; color: var(--et-text-muted); }
.et-ed-blocks__name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.et-ed-blocks__row .et-ed-icon-btn { width: 26px; height: 26px; font-size: 11px; }
.et-ed-blocks__row .et-ed-del:hover:not(:disabled) { border-color: var(--et-danger); color: var(--et-danger); }
.et-ed-blocks__fields { display: grid; gap: 10px; padding: 8px 4px 6px 8px; border-left: 2px solid var(--et-border); margin: 4px 0 2px 10px; }
.et-ed-blocks__fields[hidden] { display: none; }
.et-ed-blocks__empty { padding: 6px; font-size: 12px; color: var(--et-text-secondary); }
.et-ed-blocks__add { display: flex; gap: 6px; }
.et-ed-blocks__add .et-ed-select { flex: 1 1 auto; min-width: 0; }

/* Pickers: category (search + tree select), category-multi (ordered list + picker), image (preview + path + gallery) */
.et-ed-cat { display: grid; gap: 4px; }
.et-ed-cats { display: grid; gap: 6px; }
.et-ed-cats .et-ed-hint:empty { display: none; }
.et-ed-cats__name { flex: 1 1 auto; padding: 0 6px; font-size: 13px; }
/* Image: the preview is also where a file can be dropped */
.et-ed-image { display: flex; gap: 10px; align-items: flex-start; padding: 6px; border: 1px dashed transparent; border-radius: 8px; transition: border-color 0.15s, background-color 0.15s; }
.et-ed-image.is-drop { border-color: var(--et-accent); background: var(--et-accent-light, var(--et-surface-2)); }
.et-ed-image.is-busy { cursor: progress; }
.et-ed-image.is-busy .et-ed-image__thumb { opacity: 0.5; }
.et-ed-image__thumb {
  flex: 0 0 auto;
  min-width: 84px;
  max-width: 168px;
  height: 84px;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px dashed var(--et-border-strong, var(--et-border));
  border-radius: 6px;
  background: var(--et-surface-2, var(--et-bg));
  color: var(--et-text-muted);
}
.et-ed-image__thumb:has(img) {
  background-color: var(--et-surface-2, var(--et-bg));
  background-image: conic-gradient(rgba(128, 128, 128, 0.22) 25%, transparent 0 50%, rgba(128, 128, 128, 0.22) 0 75%, transparent 0);
  background-size: 12px 12px;
}
.et-ed-image__thumb img { display: block; width: auto; height: auto; max-width: 158px; max-height: 74px; object-fit: contain; }
.et-ed-image__none { display: grid; justify-items: center; gap: 4px; padding: 4px; font-size: 11px; line-height: 1.2; text-align: center; }
.et-ed-image__none i { font-size: 18px; }
.et-ed-image__status { margin: 0; font-size: 12px; color: var(--et-text-secondary); }
.et-ed-image__status:empty { display: none; }
.et-ed-image__link > summary { cursor: pointer; font-size: 12px; color: var(--et-text-secondary); list-style: none; }
.et-ed-image__link > summary::-webkit-details-marker { display: none; }
.et-ed-image__link[open] > summary { margin-bottom: 4px; }
.et-ed-image__side { flex: 1 1 auto; min-width: 0; display: grid; gap: 6px; }

/* Gallery dialog (native <dialog>; full screen on phones) */
.et-ed-picker { width: min(720px, calc(100vw - 32px)); max-height: calc(100vh - 48px); display: none; flex-direction: column; gap: 8px; }
.et-ed-picker[open] { display: flex; }
.et-ed-picker__head { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.et-ed-picker__nav { flex-wrap: nowrap; }
.et-ed-picker__where { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: ui-monospace, Consolas, monospace; font-size: 12px; color: var(--et-text-secondary); }
.et-ed-picker__grid {
  list-style: none;
  margin: 0;
  padding: 2px;
  flex: 1 1 auto;
  min-height: 120px;
  overflow-y: auto;
  overscroll-behavior: contain;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 8px;
  align-content: start;
}
.et-ed-picker__item {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
  padding: 6px;
  font: inherit;
  font-size: 12px;
  color: var(--et-text);
  background: var(--et-bg);
  border: 1px solid var(--et-border);
  border-radius: 6px;
  cursor: pointer;
}
.et-ed-picker__item:hover { border-color: var(--et-accent); }
.et-ed-picker__item[aria-current="true"] { border-color: var(--et-accent); box-shadow: inset 0 0 0 1px var(--et-accent); }
.et-ed-picker__item img, .et-ed-picker__item > i { width: 100%; aspect-ratio: 1; object-fit: contain; border-radius: 4px; background: var(--et-surface-2, var(--et-surface)); }
.et-ed-picker__item > i { display: flex; align-items: center; justify-content: center; font-size: 32px; color: var(--et-accent); }
.et-ed-picker__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: center; }

/* Hints of the head / foot controls: tooltip on keyboard focus or after "?" (touch); mouse — the native title */
.et-ed-tip { position: relative; display: inline-flex; align-items: center; gap: 2px; }
.et-ed-tip[hidden] { display: none; }
.et-ed-tip__q { display: none; width: 28px; height: 28px; padding: 0; font: inherit; color: var(--et-text-muted); background: none; border: 0; cursor: pointer; }
.et-ed-tip__text {
  display: none;
  position: absolute;
  bottom: calc(100% + 6px);
  left: 0;
  z-index: 5;
  width: max-content;
  max-width: 260px;
  padding: 6px 8px;
  font-size: 12px;
  line-height: 1.35;
  font-weight: 400;
  color: var(--et-bg);
  background: var(--et-text);
  border-radius: 6px;
  pointer-events: none;
}
.et-ed-head .et-ed-tip__text { bottom: auto; top: calc(100% + 6px); }
.et-ed-level .et-ed-tip__text { left: auto; right: 0; }
.et-ed-tip--grow { flex: 1 1 auto; min-width: 0; }
.et-ed-tip--grow > .et-ed-tip__target { flex: 1 1 auto; width: auto; min-width: 0; }
.et-ed-tip__target:focus-visible ~ .et-ed-tip__text,
.et-ed-tip__target:has(:focus-visible) ~ .et-ed-tip__text,
.et-ed-tip.is-open > .et-ed-tip__text { display: block; }
@media (hover: none) { .et-ed-tip__q { display: inline-flex; align-items: center; justify-content: center; } }

/* Notes, warnings, status */
.et-ed-notes:empty { display: none; }
.et-ed-notes { display: grid; gap: 6px; padding-top: 8px; }
.et-ed-note { padding: 8px 10px; border-radius: 6px; font-size: 13px; border: 1px solid var(--et-border); background: var(--et-surface-2, var(--et-bg)); }
.et-ed-note--warn { border-color: var(--et-warning); }
.et-ed-note ul { margin: 4px 0 0; padding-left: 18px; }
.et-ed-demo-note { margin: 0; padding: 6px 10px; border-radius: 6px; font-size: 12px; background: var(--et-accent-light); color: var(--et-text); } /* demo shop: "this copy is yours only" */
.et-ed-status { margin: 0; font-size: 12px; color: var(--et-text-secondary); min-height: 0; }
.et-ed-status:empty { display: none; }
.et-ed-error { margin: 6px 0 0; font-size: 13px; color: var(--et-danger); }
.et-ed-error:empty { display: none; }
.et-ed-empty { color: var(--et-text-muted); padding: 12px 4px; margin: 0; }
.et-ed-empty[hidden] { display: none; }
.et-ed-hint { font-size: 12px; color: var(--et-text-muted); margin: 4px 0 0; }

.et-ed-state { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 13px; color: var(--et-text-secondary); }
.et-ed-state::before { content: ''; flex: 0 0 auto; width: 8px; height: 8px; border-radius: 50%; background: var(--et-success, var(--et-accent)); }
.et-ed-state.is-changed { color: var(--et-text); }
.et-ed-state.is-changed::before { background: var(--et-warning); }
.et-ed-btn--publish { justify-content: center; min-height: 44px; font-weight: 600; font-size: 15px; }

/* "⋯" menu of the foot: native <details>, the list opens upwards */
.et-ed-menu { position: relative; flex: 0 0 auto; }
.et-ed-menu__toggle { list-style: none; width: 44px; height: 44px; }
.et-ed-menu__toggle::-webkit-details-marker { display: none; }
.et-ed-menu[open] > .et-ed-menu__toggle { border-color: var(--et-accent); }
.et-ed-menu__list {
  position: absolute;
  right: 0;
  top: calc(100% + 6px); /* the button sits at the top of the panel: the list goes down */
  z-index: 6;
  display: grid;
  min-width: 240px;
  max-width: calc(100vw - 24px);
  max-height: min(70vh, calc(100dvh - 90px));
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 4px;
  background: var(--et-surface);
  border: 1px solid var(--et-border);
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
}
.et-ed-menu__item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  font: inherit;
  text-align: left;
  color: var(--et-text);
  background: none;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
}
.et-ed-menu__item:hover:not(:disabled) { background: var(--et-surface-2, var(--et-bg)); }
.et-ed-menu__item:disabled { opacity: 0.45; cursor: not-allowed; }
.et-ed-menu__item i { width: 16px; text-align: center; color: var(--et-text-secondary); }

/* Save-as dialog (native <dialog>, top layer) */
.et-ed-dialog {
  width: min(420px, calc(100vw - 32px));
  padding: 20px;
  background: var(--et-surface);
  border: 1px solid var(--et-border);
  border-radius: 10px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
}
.et-ed-dialog::backdrop { background: rgba(0, 0, 0, 0.45); }
.et-ed-dialog__title { margin: 0 0 4px; font-family: inherit; font-size: 17px; font-weight: 700; line-height: 1.3; color: var(--et-text); }

/* Phone: bottom sheet over the page */
@media (max-width: 640px) {
  .et-ed-picker { width: 100vw; max-width: none; height: 100dvh; max-height: none; margin: 0; border: 0; border-radius: 0; padding: 12px 16px; }
  .et-ed-picker__grid { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }
}

/* Palette tiles: a mini page in the palette's colours (inline --p-*) */
.et-ed-palettes { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 6px; }
.et-ed-palettes > button { display: grid; gap: 3px; padding: 4px; font: inherit; text-align: left; color: var(--et-text); background: var(--et-surface); border: 1px solid var(--et-border); border-radius: 6px; cursor: pointer; }
.et-ed-palettes > button:hover { border-color: var(--et-accent); }
.et-ed-palettes > button.is-on { border-color: var(--et-accent); box-shadow: inset 0 0 0 1px var(--et-accent); }
.et-ed-pal { display: grid; grid-template-rows: 12px 22px; overflow: hidden; border-radius: 4px; border: 1px solid rgba(0, 0, 0, 0.08); }
.et-ed-pal__head { position: relative; background: var(--p-head, var(--et-header-bg, var(--et-surface))); }
.et-ed-pal__dot { position: absolute; right: 4px; top: 3px; width: 6px; height: 6px; border-radius: 50%; background: var(--p-head-text, var(--et-text)); }
.et-ed-pal__body { position: relative; background: var(--p-bg, var(--et-bg)); }
.et-ed-pal__line { position: absolute; left: 4px; top: 6px; width: 45%; height: 3px; border-radius: 2px; background: var(--p-text, var(--et-text)); opacity: 0.6; box-shadow: 0 7px 0 var(--p-accent, var(--et-accent)); }
.et-ed-pal.is-own { background: repeating-linear-gradient(45deg, var(--et-surface), var(--et-surface) 4px, var(--et-bg) 4px, var(--et-bg) 8px); }
.et-ed-pal__name { font-size: 11px; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Single font picker: rows with the sample in the font, class headings, "show all" */
.et-ed-fontpick { display: grid; gap: 4px; }
.et-ed-fonts { display: grid; gap: 3px; max-height: 420px; overflow-y: auto; overscroll-behavior: contain; padding: 2px; }
.et-ed-fonts__class { margin: 8px 2px 0; font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--et-text-muted); }
.et-ed-font { display: grid; gap: 2px; padding: 6px 8px; font: inherit; text-align: left; color: var(--et-text); background: var(--et-bg); border: 1px solid var(--et-border); border-radius: 6px; cursor: pointer; }
.et-ed-font:hover { border-color: var(--et-accent); }
.et-ed-font.is-on { border-color: var(--et-accent); box-shadow: inset 0 0 0 1px var(--et-accent); }
.et-ed-font__name { font-size: 12px; font-weight: 600; }
.et-ed-font__desc { font-weight: 400; color: var(--et-text-secondary); }
.et-ed-font__row-sample { font-size: 19px; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.et-ed-fonts__more { justify-self: start; }
.et-ed-fonts__more[hidden] { display: none; }

/* Store data pickers: products by search, tags, specification values */
.et-ed-pick__thumb { flex: 0 0 auto; width: 28px; height: 28px; object-fit: contain; border-radius: 4px; background: #fff; }
.et-ed-pick__results { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; max-height: 260px; overflow-y: auto; }
.et-ed-pick__results:empty { display: none; }
.et-ed-pick__result { display: flex; align-items: center; gap: 8px; width: 100%; padding: 4px 6px; font: inherit; font-size: 13px; text-align: left; color: var(--et-text); background: var(--et-surface); border: 1px solid var(--et-border); border-radius: 6px; cursor: pointer; }
.et-ed-pick__result:hover { border-color: var(--et-accent); }
.et-ed-pick__meta { margin-left: auto; font-size: 11px; color: var(--et-text-muted); }
.et-ed-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.et-ed-chip.is-static { display: inline-flex; align-items: center; gap: 4px; cursor: default; }
.et-ed-chip__x { display: inline-flex; padding: 0 2px; font: inherit; font-size: 11px; color: var(--et-text-muted); background: none; border: 0; cursor: pointer; }
.et-ed-chip__x:hover { color: var(--et-danger); }
.et-ed-attr .et-ed-select { flex: 1 1 120px; min-width: 0; }

/* Words per profile option, rule conditions (answers instead of codes) */
.et-ed-wordmap, .et-ed-match { display: grid; gap: 4px; }
.et-ed-wordmap__row, .et-ed-match__row { display: flex; align-items: center; gap: 6px; }
.et-ed-wordmap__row > .et-ed-input, .et-ed-match__row > .et-ed-select { flex: 1 1 0; min-width: 0; }
.et-ed-wordmap__label { flex: 0 0 38%; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.et-ed-match__eq { color: var(--et-text-muted); }
.et-ed-wordmap > .et-ed-btn, .et-ed-match > .et-ed-btn { justify-self: start; }

/* "Set separately": per-element rows under a common scale (radius, border, shadow) */
.et-ed-split { margin-top: 6px; }
.et-ed-split[hidden] { display: none; }
.et-ed-split > summary { cursor: pointer; font-size: 12px; color: var(--et-text-secondary); list-style: none; }
.et-ed-split > summary::-webkit-details-marker { display: none; }
.et-ed-split > summary::before { content: '+ '; }
.et-ed-split[open] > summary::before { content: '− '; }
.et-ed-split__rows { display: grid; gap: 6px; margin-top: 6px; padding-left: 8px; border-left: 2px solid var(--et-border); }
.et-ed-split__row { display: grid; grid-template-columns: minmax(0, 8.5em) minmax(0, 1fr) 26px; align-items: center; gap: 6px; }
.et-ed-split__row > * { min-width: 0; }
.et-ed-split__row .et-ed-range__val { min-width: 2.2em; }
.et-ed-split__row .et-ed-seg { flex-wrap: wrap; }
.et-ed-split__name { font-size: 12px; color: var(--et-text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.et-ed-split__name i { width: 16px; text-align: center; color: var(--et-text-muted); }
.et-ed-split__row.is-own .et-ed-split__name { color: var(--et-text); font-weight: 600; }
.et-ed-split__row .et-ed-icon-btn { width: 26px; height: 26px; font-size: 11px; }
.et-ed-split__row .et-ed-icon-btn[hidden] { visibility: hidden; display: inline-flex; }
.et-ed-split__row .et-ed-seg > button { padding: 3px 6px; min-height: 26px; font-size: 12px; }

/* "More settings: N" at the end of a group / "More settings: groups…" at the end of Site style */
.et-ed-more { justify-self: start; display: inline-flex; align-items: center; gap: 6px; padding: 4px 0; font: inherit; font-size: 13px; color: var(--et-accent-text, var(--et-accent)); background: none; border: 0; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.et-ed-more::after { content: '→'; text-decoration: none; }
.et-ed-more[hidden] { display: none; }
.et-ed-more--area { margin: 10px 4px 0; text-align: left; }

/* Link: kind of target + the target picker; multi-choice chips */
.et-ed-link { display: grid; gap: 4px; }
.et-ed-chip[aria-pressed="true"] { border-color: var(--et-accent); background: var(--et-accent); color: var(--et-accent-contrast, #fff); }

/* Design gallery marks: "For your niche", "Your design" */
.et-ed-design__badge { display: inline-block; margin-top: 2px; padding: 1px 6px; font-size: 10px; font-weight: 600; line-height: 1.5; border-radius: 999px; background: var(--et-success, var(--et-accent)); color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }

/* "My store" under the design gallery; niche content marks; a section hidden for lack of niche content */
.et-ed-badge--pack { border-color: var(--et-accent); color: var(--et-accent-text, var(--et-accent)); }
.et-ed-order__note { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 2px 6px 4px 28px; font-size: 12px; color: var(--et-text-secondary); }

/* ===== Layout of the panel (Shopify-like): a thin fixed head — page, undo / redo, publish, tabs — and one scrolling body
   with the Sections / Design panes, a section's settings and the gallery as screens of their own ===== */
.et-ed-head { gap: 6px; padding-bottom: 0; border-bottom: 1px solid var(--et-border); }
.et-ed-headbar { flex-wrap: nowrap; gap: 4px; }
.et-ed-headbar .et-ed-page { flex: 1 1 auto; min-width: 0; }
.et-ed-headbar .et-ed-select { min-height: 32px; padding: 4px 8px; font-weight: 600; }
.et-ed-headbar .et-ed-icon-btn, .et-ed-headbar .et-ed-menu__toggle { width: 32px; height: 32px; }
.et-ed-headbar .et-ed-btn--publish { min-height: 32px; padding: 4px 10px; font-size: 13px; white-space: nowrap; }
.et-ed-headbar .et-ed-tip { flex: 0 0 auto; }
.et-ed-headbar .et-ed-tip--grow { flex: 1 1 auto; }
.et-ed-state { position: relative; display: inline-block; flex: 0 0 auto; width: 8px; height: 8px; margin: 0 2px; overflow: hidden; font-size: 0; color: transparent; border-radius: 50%; background: var(--et-success, var(--et-accent)); }
.et-ed-state::before { content: none; }
.et-ed-state.is-changed { background: var(--et-warning); }
.et-ed-tabs { display: flex; gap: 0; margin: 0 -2px; }
.et-ed-tab { flex: 1 1 0; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 36px; padding: 6px 8px; font: inherit; font-size: 13px; font-weight: 600; color: var(--et-text-secondary); background: none; border: 0; border-bottom: 2px solid transparent; cursor: pointer; }
.et-ed-tab:hover { color: var(--et-text); }
.et-ed-tab.is-on { color: var(--et-accent-text, var(--et-accent)); border-bottom-color: var(--et-accent); }
.et-ed-pane[hidden] { display: none; }
.et-ed-pane { display: grid; gap: 10px; padding-top: 8px; }
.et-ed-pane__title { margin: 0; font-family: inherit; font-size: 15px; font-weight: 700; color: var(--et-text); }
.et-ed-back { justify-self: start; display: inline-flex; align-items: center; gap: 6px; padding: 4px 2px; font: inherit; font-size: 13px; font-weight: 600; color: var(--et-accent-text, var(--et-accent)); background: none; border: 0; cursor: pointer; }
.et-ed-tools { flex-wrap: nowrap; }
.et-ed-tools .et-ed-search { flex: 1 1 auto; min-width: 0; }
.et-ed-tools .et-ed-level { margin-left: 0; }
/* The current design: its snapshot (or mini page), name, "Change design" */
.et-ed-current__shot { flex: 0 0 112px; cursor: pointer; }
.et-ed-current__shot .et-ed-shot { display: block; width: 100%; height: auto; aspect-ratio: 8 / 5; object-fit: cover; object-position: top; border-radius: 5px; border: 1px solid var(--et-border); }
.et-ed-current { display: flex; gap: 10px; align-items: center; padding: 8px; border: 1px solid var(--et-border); border-radius: 8px; background: var(--et-surface); }
.et-ed-current:empty { display: none; }
.et-ed-current__text { display: grid; gap: 4px; min-width: 0; }
.et-ed-current__name { font-size: 14px; font-weight: 700; }
.et-ed-current__text .et-ed-btn { justify-self: start; }
/* A section with its settings open: its own screen ("← Sections"), the rest of the list hidden */
.et-ed-sections__back { display: none; }
.et-ed-sections.is-focus > .et-ed-sections__back { display: inline-flex; }
.et-ed-sections.is-focus .et-ed-order__item:not(.is-open), .et-ed-sections.is-focus > .et-ed-sections__add { display: none; }
.et-ed-sections.is-focus .et-ed-order__item.is-open { border-color: var(--et-border); }
.et-ed-group--flat > .et-ed-group__body { padding-top: 0; }
.et-ed-head { grid-template-columns: minmax(0, 1fr); }
.et-ed, .et-ed-body { min-width: 0; }
.et-ed-tools .et-ed-seg { flex-wrap: nowrap; }
.et-ed-tools .et-ed-seg > button { white-space: nowrap; padding: 6px 8px; }
.et-ed-headbar > .et-ed-icon-btn, .et-ed-headbar > .et-ed-menu, .et-ed-headbar > .et-ed-state { flex: 0 0 auto; }
.et-ed-tabbar { flex-wrap: nowrap; gap: 2px; }
.et-ed-tabbar > .et-ed-tabs { flex: 1 1 auto; min-width: 0; margin: 0; }
.et-ed-tabbar > .et-ed-icon-btn { flex: 0 0 auto; width: 30px; height: 30px; border-color: transparent; background: none; }

/* Help: "?" where an article exists; the article window (native <dialog>; full screen on phones) */
.et-ed-field__help { display: contents; }
.et-ed-helpbtn { color: var(--et-text-muted); }
.et-ed-helpbtn[hidden] { display: none; }
.et-ed-order__item:not(.is-open) .et-ed-helpbtn--section { display: none; }
.et-ed-scenes { display: grid; gap: 6px; }
.et-ed-scenes__grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 6px; }
.et-ed-scenes__grid img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 4px; }
.et-ed-applying { position: fixed; inset: 0; z-index: 2147483000; display: grid; place-items: center; background: rgba(0, 0, 0, 0.45); cursor: progress; }
.et-ed-applying__box { display: flex; align-items: center; gap: 10px; padding: 12px 18px; border-radius: 10px; background: var(--et-surface); color: var(--et-text); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25); font: 600 14px/1.3 system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif; }
.et-ed-applying__spin { width: 18px; height: 18px; border: 2px solid var(--et-border); border-top-color: var(--et-accent); border-radius: 50%; animation: et-ed-spin 0.8s linear infinite; }
@keyframes et-ed-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .et-ed-applying__spin { animation: none; border-color: var(--et-accent); } }
.et-ed-helpbtn--group { width: 28px; height: 28px; margin-left: auto; }
.et-ed-helpdlg { width: min(680px, calc(100vw - 32px)); max-height: calc(100vh - 48px); display: none; flex-direction: column; gap: 8px; }
.et-ed-helpdlg[open] { display: flex; }
.et-ed-helpdlg .et-ed-dialog__title { outline: none; }
.et-ed-helpdlg__nav { flex-wrap: wrap; gap: 6px; }
.et-ed-helpdlg__nav [hidden] { display: none; }
.et-ed-helpdlg__body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding-right: 4px; font-size: 15px; line-height: 1.55; overflow-wrap: anywhere; }
.et-ed-helpdlg__body > :first-child { margin-top: 0; }
.et-ed-helpdlg__body h2 { margin: 20px 0 6px; font-family: inherit; font-size: 17px; font-weight: 700; line-height: 1.3; color: var(--et-text); }
.et-ed-helpdlg__body h3 { margin: 16px 0 4px; font-family: inherit; font-size: 15px; font-weight: 700; line-height: 1.3; color: var(--et-text); }
.et-ed-helpdlg__body p, .et-ed-helpdlg__body ul, .et-ed-helpdlg__body ol { margin: 0 0 10px; }
.et-ed-helpdlg__body ul, .et-ed-helpdlg__body ol { padding-left: 22px; }
.et-ed-helpdlg__body li { margin: 3px 0; }
.et-ed-helpdlg__body a { color: var(--et-accent-text, var(--et-accent)); text-decoration: underline; text-underline-offset: 2px; }
.et-ed-helpdlg__list { list-style: none; padding-left: 0 !important; }
.et-ed-help__tip { margin: 12px 0; padding: 10px 12px; border-left: 3px solid var(--et-accent); border-radius: 6px; background: var(--et-surface-2, var(--et-bg)); }
.et-ed-help__tip p { margin: 0; }
.et-ed-helpdlg__body code { padding: 1px 5px; border-radius: 4px; background: var(--et-surface-2, var(--et-bg)); font-family: ui-monospace, Consolas, monospace; font-size: 0.9em; }
.et-ed-help__shot { margin: 12px 0; }
.et-ed-help__shot img { display: block; max-width: 100%; height: auto; border: 1px solid var(--et-border); border-radius: 8px; }
.et-ed-help__shot figcaption { margin-top: 4px; font-size: 12px; color: var(--et-text-secondary); }
@media (max-width: 640px) {
  .et-ed-helpdlg { width: 100vw; max-width: none; height: 100dvh; max-height: none; margin: 0; border: 0; border-radius: 0; padding: 12px 16px; }
}

/* Preview on a device (js/elbuz_editor.js setDevice): the page in a frame of the phone / tablet width over the site;
   inside the frame (html.et-ed-frame) there is no panel */
.et-ed-device { position: fixed; inset: 0; right: var(--et-ed-w, 0px); z-index: 9998; display: flex; justify-content: center; padding: 16px; background: var(--et-surface); }
.et-ed-device__frame { max-width: 100%; height: 100%; border: 1px solid var(--et-border); border-radius: 16px; background: var(--et-bg); }
html.et-ed-frame :is(.et-tools, .et-tools-trigger) { display: none !important; }
.et-ed-tabbar > .et-ed-devices { flex: none; }
.et-ed-devices > button { padding: 4px 7px; min-height: 30px; }

/* A section with nothing to show visitors (no own slides / tiles, demo deleted): the owner sees a note in its place */
.et-ed-empty-section { margin: 16px 0; padding: 24px 16px; border: 2px dashed var(--et-border); border-radius: 8px; color: var(--et-text-secondary); text-align: center; }

/* ===== Design gallery window (docs/17 R49): the whole screen over the editor and the page; 5 cards in a row on 1440,
   2 on a tablet, 1 on a phone. The design being tried: a bar over the page ("Back to the gallery" / "Apply") ===== */
.et-ed-gal { width: 100vw; max-width: none; height: 100dvh; max-height: none; margin: 0; padding: 0; border: 0; border-radius: 0; box-shadow: none; background: var(--et-bg); display: none; flex-direction: column; }
.et-ed-gal[open] { display: flex; }
.et-ed-gal__head { display: flex; align-items: flex-start; gap: 8px; padding: 16px 24px 8px; }
.et-ed-gal__titles { flex: 1 1 auto; min-width: 0; }
.et-ed-gal__titles .et-ed-dialog__title { font-size: 20px; }
.et-ed-gal__titles .et-ed-hint { margin: 0; }
.et-ed-gal__filters { display: grid; gap: 8px; padding: 0 24px 12px; border-bottom: 1px solid var(--et-border); }
.et-ed-gal__find .et-ed-gal__search { flex: 1 1 260px; width: auto; min-width: 0; }
.et-ed-gal__find .et-ed-gal__niche { flex: 0 1 240px; width: auto; min-width: 0; }
.et-ed-gal__count { font-size: 13px; color: var(--et-text-secondary); white-space: nowrap; }
.et-ed-gal__chips { align-items: center; flex-wrap: nowrap; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.et-ed-gal__chips .et-ed-chip { flex: 0 0 auto; min-height: 32px; font-size: 13px; }
.et-ed-gal__label { flex: 0 0 auto; min-width: 112px; font-size: 12px; font-weight: 600; color: var(--et-text-secondary); }
.et-ed-gal__body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 16px 24px 32px; }
.et-ed-gal__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 20px; margin: 0; padding: 0; list-style: none; }
.et-ed-gal__card { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 8px; color: var(--et-text); background: var(--et-surface); border: 1px solid var(--et-border); border-radius: 10px; transition: border-color 0.15s, box-shadow 0.15s; }
.et-ed-gal__card[hidden] { display: none; }
.et-ed-gal__card:hover { border-color: var(--et-accent); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12); }
.et-ed-gal__card.is-current { border-color: var(--et-accent); box-shadow: inset 0 0 0 1px var(--et-accent); }
.et-ed-gal__shot { display: block; aspect-ratio: 8 / 5; overflow: hidden; border-radius: 6px; background: var(--et-surface-2, var(--et-bg)); }
.et-ed-gal__shot .et-ed-shot { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top; }
.et-ed-gal__shot .et-ed-look { height: 100%; border-radius: 0; }
.et-ed-gal__modes { position: absolute; z-index: 1; top: 14px; right: 14px; display: inline-flex; padding: 2px; border-radius: 999px; background: rgba(0, 0, 0, 0.55); }
.et-ed-gal__mode { display: inline-grid; place-items: center; width: 30px; height: 30px; padding: 0; font-size: 13px; color: #fff; background: none; border: 0; border-radius: 50%; cursor: pointer; }
.et-ed-gal__mode[aria-pressed="true"] { color: #111; background: #fff; }
.et-ed-gal__name { margin: 2px 0 0; font-family: inherit; font-size: 15px; font-weight: 700; line-height: 1.3; }
.et-ed-gal__pick { font: inherit; color: inherit; text-align: left; padding: 0; background: none; border: 0; cursor: pointer; }
.et-ed-gal__pick::after { content: ''; position: absolute; inset: 0; border-radius: 10px; }   /* the whole card is the button */
.et-ed-gal__pick:focus-visible { outline: none; }
.et-ed-gal__pick:focus-visible::after { outline: 2px solid var(--et-accent); outline-offset: 2px; }
.et-ed-gal__badges { display: flex; flex-wrap: wrap; gap: 4px; margin: 0; }
.et-ed-gal__badges .et-ed-design__badge { margin: 0; }
.et-ed-gal__now { background: var(--et-accent); color: var(--et-accent-contrast, #fff); }
.et-ed-gal__desc { margin: 0; font-size: 13px; color: var(--et-text-secondary); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.et-ed-gal__marks { display: flex; flex-wrap: wrap; gap: 4px; margin: auto 0 0; padding: 0; list-style: none; }
.et-ed-gal__marks li { padding: 1px 7px; font-size: 11px; line-height: 1.6; color: var(--et-text-secondary); background: var(--et-bg); border: 1px solid var(--et-border); border-radius: 999px; }
.et-ed-gal__empty { padding: 40px 0; text-align: center; font-size: 14px; }
@media (pointer: coarse) { .et-ed-gal__mode { width: 40px; height: 40px; } .et-ed-gal__chips .et-ed-chip { min-height: 40px; } }
@media (max-width: 640px) {
  .et-ed-gal__head { padding: 12px 16px 6px; }
  .et-ed-gal__filters { padding: 0 16px 10px; }
  .et-ed-gal__body { padding: 12px 16px 24px; }
  .et-ed-gal__grid { grid-template-columns: 1fr; gap: 14px; }
  .et-ed-gal__find .et-ed-gal__niche { flex: 1 1 100%; }
  .et-ed-gal__label { min-width: 0; }
}
.et-ed-galbar {
  position: fixed; z-index: 9999; left: 16px; right: calc(var(--et-ed-w, 0px) + 16px); bottom: 16px; width: max-content; max-width: calc(100vw - var(--et-ed-w, 0px) - 32px); margin: 0 auto;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; padding: 10px 12px;
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif; font-size: 14px; line-height: 1.4; letter-spacing: normal; text-transform: none;
  color: var(--et-text); background: var(--et-surface); border: 1px solid var(--et-border); border-radius: 12px; box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25);
}
.et-ed-galbar * { box-sizing: border-box; }
.et-ed-galbar__text { font-weight: 600; }
.et-ed-galbar .et-ed-btn:focus-visible { outline: 2px solid var(--et-accent); outline-offset: 2px; }
