/* editor.css — the photo editor (/edit/<id>/), Canva-style. Everything is
   scoped under .ed and built on the site's colour tokens: dark and light
   follow the site theme. The fonts below are self-hosted (latin subset) for
   the text tool; a browser downloads one only when a text uses it. */

@font-face { font-family: 'Abril Fatface'; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/editor/abril-fatface-normal-400.87dbd6249876.woff2") format('woff2'); }
@font-face { font-family: 'Anton'; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/editor/anton-normal-400.912c3c9f2621.woff2") format('woff2'); }
@font-face { font-family: 'Archivo Black'; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/editor/archivo-black-normal-400.4b6914a69e6a.woff2") format('woff2'); }
@font-face { font-family: 'Bebas Neue'; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/editor/bebas-neue-normal-400.5853435d21b1.woff2") format('woff2'); }
@font-face { font-family: 'Caveat'; font-style: normal; font-weight: 400 700; font-display: swap; src: url("../fonts/editor/caveat-normal-400_700.2d9de14f93a2.woff2") format('woff2'); }
@font-face { font-family: 'DM Serif Display'; font-style: italic; font-weight: 400; font-display: swap; src: url("../fonts/editor/dm-serif-display-italic-400.581414e1e577.woff2") format('woff2'); }
@font-face { font-family: 'DM Serif Display'; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/editor/dm-serif-display-normal-400.c27d5a47c09e.woff2") format('woff2'); }
@font-face { font-family: 'Dancing Script'; font-style: normal; font-weight: 400 700; font-display: swap; src: url("../fonts/editor/dancing-script-normal-400_700.513b7c2b78b7.woff2") format('woff2'); }
@font-face { font-family: 'Lobster'; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/editor/lobster-normal-400.9b5d1dc4d335.woff2") format('woff2'); }
@font-face { font-family: 'Lora'; font-style: italic; font-weight: 400 700; font-display: swap; src: url("../fonts/editor/lora-italic-400_700.1640b0b69ef0.woff2") format('woff2'); }
@font-face { font-family: 'Lora'; font-style: normal; font-weight: 400 700; font-display: swap; src: url("../fonts/editor/lora-normal-400_700.9577af3ccda5.woff2") format('woff2'); }
@font-face { font-family: 'Montserrat'; font-style: italic; font-weight: 400 800; font-display: swap; src: url("../fonts/editor/montserrat-italic-400_800.7921052ef928.woff2") format('woff2'); }
@font-face { font-family: 'Montserrat'; font-style: normal; font-weight: 400 800; font-display: swap; src: url("../fonts/editor/montserrat-normal-400_800.311d352d9323.woff2") format('woff2'); }
@font-face { font-family: 'Oswald'; font-style: normal; font-weight: 300 700; font-display: swap; src: url("../fonts/editor/oswald-normal-300_700.22c3b00d2e65.woff2") format('woff2'); }
@font-face { font-family: 'Pacifico'; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/editor/pacifico-normal-400.d150e652cabc.woff2") format('woff2'); }
@font-face { font-family: 'Playfair Display'; font-style: italic; font-weight: 400 900; font-display: swap; src: url("../fonts/editor/playfair-display-italic-400_900.2175449f9d44.woff2") format('woff2'); }
@font-face { font-family: 'Playfair Display'; font-style: normal; font-weight: 400 900; font-display: swap; src: url("../fonts/editor/playfair-display-normal-400_900.ef05b30d6e5c.woff2") format('woff2'); }
@font-face { font-family: 'Poppins'; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/editor/poppins-normal-400.9212f6f9860f.woff2") format('woff2'); }
@font-face { font-family: 'Poppins'; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/editor/poppins-normal-700.25b0e113ca7c.woff2") format('woff2'); }
@font-face { font-family: 'Roboto Slab'; font-style: normal; font-weight: 300 800; font-display: swap; src: url("../fonts/editor/roboto-slab-normal-300_800.fee1dc1edf94.woff2") format('woff2'); }
@font-face { font-family: 'Space Mono'; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/editor/space-mono-normal-400.049dfc5919c2.woff2") format('woff2'); }
@font-face { font-family: 'Space Mono'; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/editor/space-mono-normal-700.e5e908997a45.woff2") format('woff2'); }

[data-page="editor"] #main-content { padding: 0; }
html:has(body[data-page="editor"]) { overflow: hidden; scrollbar-gutter: auto; }
body[data-page="editor"] { overflow: hidden; }

.ed {
  --ed-rail-w: 76px;
  --ed-panel-w: 336px;
  --ed-top-h: 56px;
  --ed-line: rgba(255, 255, 255, .1);
  --ed-soft: rgba(255, 255, 255, .045);
  --ed-hover: rgba(255, 255, 255, .07);
  --ed-track: rgba(255, 255, 255, .16);
  --ed-stage: #0b0b11;
  --ed-accent: var(--color-primary, #8b5cf6);
  --ed-accent-soft: rgba(139, 92, 246, .17);
  --ed-shadow: 0 10px 30px rgba(0, 0, 0, .45);
  --ed-pop-shadow: 0 18px 50px rgba(0, 0, 0, .55);
  --ed-canvas-shadow: 0 18px 50px rgba(0, 0, 0, .55);
  position: fixed;
  inset: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-sans);
}
[data-theme="light"] .ed {
  --ed-line: rgba(0, 0, 0, .1);
  --ed-soft: rgba(0, 0, 0, .035);
  --ed-hover: rgba(0, 0, 0, .055);
  --ed-track: rgba(0, 0, 0, .13);
  --ed-stage: #ebecf0;
  --ed-accent-soft: rgba(124, 58, 237, .1);
  --ed-shadow: 0 8px 24px rgba(20, 20, 40, .12);
  --ed-pop-shadow: 0 16px 44px rgba(20, 20, 40, .2);
  --ed-canvas-shadow: 0 10px 34px rgba(20, 20, 40, .2);
}
.ed button { font-family: inherit; }
.ed button:focus-visible, .ed a:focus-visible, .ed input:focus-visible, .ed textarea:focus-visible {
  outline: 2px solid var(--ed-accent);
  outline-offset: 2px;
}

/* ── Top bar ──────────────────────────────────────────────────────────── */
.ed__top {
  position: relative;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 8px;
  height: var(--ed-top-h);
  padding: 0 12px 0 14px;
  flex-shrink: 0;
  background: var(--color-surface);
  border-bottom: 1px solid var(--ed-line);
}
.ed__logo { display: block; flex-shrink: 0; }
.ed__logo img { display: block; border-radius: 7px; }
.ed__back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 34px;
  padding: 0 12px 0 8px;
  border-radius: 9px;
  color: var(--color-text);
  font-size: .86rem;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}
.ed__back:hover { background: var(--ed-hover); }
.ed__title {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-left: 4px;
  padding-left: 14px;
  border-left: 1px solid var(--ed-line);
}
.ed__title-main { font-size: .95rem; font-weight: 650; white-space: nowrap; }
.ed__title-size {
  overflow: hidden;
  font-size: .78rem;
  font-variant-numeric: tabular-nums;
  color: var(--color-text-muted);
  white-space: nowrap;
  text-overflow: ellipsis;
}
.ed__top-actions { display: flex; align-items: center; gap: 2px; }
.ed__dl-open { margin-left: 8px; }

/* ── Buttons ──────────────────────────────────────────────────────────── */
.ed__iconbtn {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--color-text);
  cursor: pointer;
}
.ed__iconbtn:hover:not(:disabled) { background: var(--ed-hover); }
.ed__iconbtn:disabled { opacity: .32; cursor: default; }
.ed__iconbtn.is-active { background: var(--ed-accent-soft); color: var(--ed-accent); }
.ed__iconbtn--sm { width: 28px; height: 28px; border-radius: 7px; }
.ed__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 38px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 10px;
  font-size: .86rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}
.ed__btn--primary { background: var(--ed-accent); color: #fff; }
.ed__btn--primary:hover:not(:disabled) { background: var(--color-primary-hover, var(--ed-accent)); }
.ed__btn--ghost { border-color: var(--ed-line); background: transparent; color: var(--color-text); }
.ed__btn--ghost:hover:not(:disabled) { background: var(--ed-hover); }
.ed__btn--soft { background: var(--ed-accent-soft); color: var(--ed-accent); }
.ed__btn--soft:hover { border-color: var(--ed-accent); }
.ed__btn--block { width: 100%; }
.ed__btn:disabled { opacity: .45; cursor: default; }
.ed__btn--tile {
  flex-direction: column;
  gap: 6px;
  height: auto;
  min-height: 64px;
  padding: 10px 4px;
  border-color: var(--ed-line);
  background: var(--ed-soft);
  color: var(--color-text);
  font-size: .7rem;
  font-weight: 500;
  white-space: normal;
  line-height: 1.2;
}
.ed__btn--tile:hover { border-color: var(--ed-accent); }
.ed__linkbtn {
  margin-top: 10px;
  padding: 6px 0;
  border: 0;
  background: none;
  color: var(--ed-accent);
  font-size: .82rem;
  font-weight: 600;
  cursor: pointer;
}
.ed__danger:hover { color: var(--color-error, #ef4444) !important; }

/* ── Body: rail · panel · stage ───────────────────────────────────────── */
.ed__body { flex: 1; min-height: 0; display: flex; }
.ed__rail {
  width: var(--ed-rail-w);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 6px;
  overflow-y: auto;
  background: var(--color-surface);
  border-right: 1px solid var(--ed-line);
  scrollbar-width: none;
}
.ed__tool {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 2px 8px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--color-text-muted);
  font-size: .68rem;
  font-weight: 600;
  cursor: pointer;
  transition: color .15s, background .15s;
}
.ed__tool:hover { background: var(--ed-hover); color: var(--color-text); }
.ed__tool.is-active { background: var(--ed-accent-soft); color: var(--ed-accent); }
.ed__panel {
  display: none;
  width: var(--ed-panel-w);
  flex-shrink: 0;
  min-height: 0;
  background: var(--color-surface);
  border-right: 1px solid var(--ed-line);
}
.ed.has-panel .ed__panel { display: flex; }
.ed__pane { display: flex; flex-direction: column; width: 100%; min-height: 0; }
.ed__pane[hidden] { display: none; }
.ed__pane-head {
  display: flex;
  align-items: center;
  gap: 2px;
  height: 54px;
  padding: 0 8px 0 18px;
  flex-shrink: 0;
}
.ed__pane-head h2 { flex: 1; margin: 0; font-size: 1rem; font-weight: 700; }
.ed__pane-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 2px 18px 20px;
  scrollbar-width: thin;
}
.ed__pane-foot { flex-shrink: 0; padding: 12px 18px 14px; border-top: 1px solid var(--ed-line); }
.ed__pane-foot--split { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ed__h3 {
  margin: 20px 0 10px;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .01em;
  color: var(--color-text);
}
.ed__pane-body > .ed__h3:first-child, .ed__fam:first-child .ed__h3 { margin-top: 6px; }
.ed__help { margin: 10px 0 0; font-size: .78rem; line-height: 1.45; color: var(--color-text-muted); }

/* ── Sliders ──────────────────────────────────────────────────────────── */
.ed__slider {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 2px 10px;
  margin: 0 0 12px;
}
.ed__slider-label { font-size: .82rem; color: var(--color-text); }
.ed__num {
  width: 56px;
  height: 30px;
  padding: 0 4px;
  border: 1px solid var(--ed-line);
  border-radius: 8px;
  background: transparent;
  color: var(--color-text);
  font: inherit;
  font-size: .8rem;
  font-variant-numeric: tabular-nums;
  text-align: center;
  -moz-appearance: textfield;
  appearance: textfield;
}
.ed__num::-webkit-inner-spin-button, .ed__num::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.ed__range {
  --lo: 0%;
  --hi: 0%;
  grid-column: 1 / -1;
  width: 100%;
  height: 22px;
  margin: 0;
  background: transparent;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}
.ed__range::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 4px;
  background: linear-gradient(to right, var(--ed-track) 0 var(--lo), var(--ed-accent) var(--lo) var(--hi), var(--ed-track) var(--hi) 100%);
}
.ed__range::-moz-range-track {
  height: 4px;
  border-radius: 4px;
  background: linear-gradient(to right, var(--ed-track) 0 var(--lo), var(--ed-accent) var(--lo) var(--hi), var(--ed-track) var(--hi) 100%);
}
.ed__range::-webkit-slider-thumb {
  width: 16px;
  height: 16px;
  margin-top: -6px;
  border: 1px solid rgba(0, 0, 0, .15);
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .35);
  -webkit-appearance: none;
}
.ed__range::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border: 1px solid rgba(0, 0, 0, .15);
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .35);
}
.ed__range:focus-visible { outline: none; }
.ed__range:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 4px var(--ed-accent-soft), 0 1px 4px rgba(0, 0, 0, .35); }
.ed__range:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 4px var(--ed-accent-soft), 0 1px 4px rgba(0, 0, 0, .35); }
.ed__switchrow { display: flex; align-items: center; justify-content: space-between; margin: 2px 0 12px; font-size: .82rem; }
.ed__switch {
  position: relative;
  width: 36px;
  height: 20px;
  padding: 0;
  border: 0;
  border-radius: 20px;
  background: var(--ed-track);
  cursor: pointer;
  transition: background .15s;
}
.ed__switch span {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .3);
  transition: transform .15s;
}
.ed__switch[aria-checked="true"] { background: var(--ed-accent); }
.ed__switch[aria-checked="true"] span { transform: translateX(16px); }

/* ── Filters ──────────────────────────────────────────────────────────── */
.ed__fgrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 10px; }
.ed__ftile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--color-text);
  font-size: .74rem;
  cursor: pointer;
}
.ed__ftile-img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  border-radius: 10px;
  background: var(--ed-soft);
  outline: 2px solid transparent;
  outline-offset: 2px;
  transition: outline-color .15s, transform .15s;
}
.ed__ftile:hover .ed__ftile-img { transform: translateY(-1px); }
.ed__ftile.is-active .ed__ftile-img { outline-color: var(--ed-accent); }
.ed__ftile.is-active { color: var(--ed-accent); font-weight: 600; }
.ed__ftile-name { max-width: 100%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.ed__intensity { grid-column: 1 / -1; padding: 2px 2px 4px; }
.ed__intensity .ed__slider { margin-bottom: 6px; }
.ed__duo { display: flex; flex-wrap: wrap; gap: 8px; }
.ed__duo[hidden] { display: none; }

/* ── Crop ─────────────────────────────────────────────────────────────── */
.ed__ratios { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.ed__ratio {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 0;
  padding: 10px 2px 8px;
  border: 1px solid var(--ed-line);
  border-radius: 10px;
  background: transparent;
  color: var(--color-text);
  font-size: .68rem;
  font-weight: 600;
  cursor: pointer;
}
.ed__ratio:hover { background: var(--ed-hover); }
.ed__ratio.is-active { border-color: var(--ed-accent); background: var(--ed-accent-soft); color: var(--ed-accent); }
.ed__ratio-shape { display: grid; place-items: center; width: 30px; height: 30px; }
.ed__ratio-shape i { display: block; border: 2px solid currentColor; border-radius: 3px; }
.ed__ratio-shape i.is-dashed { border-style: dashed; }
.ed__ratio-name { max-width: 100%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.ed__btngrid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }

/* ── Text ─────────────────────────────────────────────────────────────── */
.ed__addtext {
  display: block;
  width: 100%;
  margin: 0 0 8px;
  padding: 12px 14px;
  border: 1px solid var(--ed-line);
  border-radius: 10px;
  background: var(--ed-soft);
  color: var(--color-text);
  font-family: Montserrat, var(--font-sans);
  text-align: left;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.ed__addtext:hover { border-color: var(--ed-accent); background: var(--ed-hover); }
.ed__addtext--heading { font-size: 1.45rem; font-weight: 800; letter-spacing: -.01em; }
.ed__addtext--subheading { font-size: 1.05rem; font-weight: 700; }
.ed__addtext--body { font-family: var(--font-sans); font-size: .84rem; }
.ed__effects, .ed__shapes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 10px; }
.ed__fx {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--color-text);
  font-size: .74rem;
  cursor: pointer;
}
.ed__fx-prev {
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 1.3;
  border: 1px solid var(--ed-line);
  border-radius: 10px;
  background: var(--ed-soft);
  color: var(--color-text);
  font: 800 1.55rem/1 Montserrat, var(--font-sans);
  transition: border-color .15s;
}
.ed__fx:hover .ed__fx-prev { border-color: var(--ed-accent); }
.ed__fx.is-active .ed__fx-prev { border-color: var(--ed-accent); box-shadow: 0 0 0 1px var(--ed-accent); }
.ed__fx.is-active { color: var(--ed-accent); font-weight: 600; }
.ed__fx-prev--shadow { text-shadow: 3px 3px 0 rgba(0, 0, 0, .45); }
.ed__fx-prev--lift { text-shadow: 0 5px 10px rgba(0, 0, 0, .55); }
.ed__fx-prev--hollow { color: transparent; -webkit-text-stroke: 1.5px var(--color-text); }
.ed__fx-prev--splice { color: transparent; -webkit-text-stroke: 1.5px var(--color-text); text-shadow: 3px 3px 0 var(--ed-accent); }
.ed__fx-prev--outline { color: #fff; text-shadow: -1.5px -1.5px 0 #111, 1.5px -1.5px 0 #111, -1.5px 1.5px 0 #111, 1.5px 1.5px 0 #111; }
.ed__fx-prev--echo { text-shadow: 3px 3px 0 rgba(139, 92, 246, .55), 6px 6px 0 rgba(139, 92, 246, .28); }
.ed__fx-prev--glitch { text-shadow: -2px 0 #00e5ff, 2px 0 #ff2bd6; }
.ed__fx-prev--neon { color: #ffe4fb; text-shadow: 0 0 3px #ff4fd8, 0 0 9px #ff4fd8, 0 0 16px #ff4fd8; }
.ed__fx-prev--background {
  color: #fff;
  background-image: linear-gradient(var(--ed-accent), var(--ed-accent));
  background-position: center;
  background-repeat: no-repeat;
  background-size: 64% 48%;
}
.ed__fx-prev--curve svg { display: block; color: var(--color-text); }
.ed__effect-params { margin-top: 14px; }
.ed__effect-params .ed__colorbtn { margin: 0 8px 12px 0; }
.ed__layers { display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 0; list-style: none; }
.ed__layer {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 3px 4px 3px 3px;
  border: 1px solid var(--ed-line);
  border-radius: 10px;
}
.ed__layer.is-active { border-color: var(--ed-accent); background: var(--ed-accent-soft); }
.ed__layer-name {
  flex: 1;
  min-width: 0;
  padding: 7px 8px;
  overflow: hidden;
  border: 0;
  border-radius: 7px;
  background: none;
  color: var(--color-text);
  font-size: .86rem;
  font-weight: 600;
  white-space: nowrap;
  text-overflow: ellipsis;
  text-align: left;
  cursor: pointer;
}

/* ── Resize ───────────────────────────────────────────────────────────── */
.ed__custom { display: flex; align-items: flex-end; gap: 8px; }
.ed__field { display: flex; flex: 1; flex-direction: column; gap: 4px; min-width: 0; font-size: .74rem; color: var(--color-text-muted); }
.ed__field input {
  width: 100%;
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--ed-line);
  border-radius: 9px;
  background: transparent;
  color: var(--color-text);
  font: inherit;
  font-size: .88rem;
  font-variant-numeric: tabular-nums;
}
.ed__x, .ed__unit { padding-bottom: 9px; font-size: .85rem; color: var(--color-text-muted); }
.ed__formats { display: flex; flex-direction: column; gap: 2px; }
.ed__fmt {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 7px 10px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: none;
  color: var(--color-text);
  text-align: left;
  cursor: pointer;
}
.ed__fmt:hover { background: var(--ed-hover); }
.ed__fmt.is-active { border-color: var(--ed-accent); background: var(--ed-accent-soft); }
.ed__fmt-shape { display: grid; place-items: center; flex-shrink: 0; width: 34px; height: 34px; }
.ed__fmt-shape i { display: block; border: 2px solid currentColor; border-radius: 3px; opacity: .8; }
.ed__fmt-text { display: flex; flex-direction: column; min-width: 0; }
.ed__fmt-name { font-size: .86rem; font-weight: 600; }
.ed__fmt-dims { font-size: .74rem; font-variant-numeric: tabular-nums; color: var(--color-text-muted); }
.ed__seg {
  display: grid;
  grid-auto-columns: 1fr;
  grid-auto-flow: column;
  gap: 4px;
  padding: 3px;
  border: 1px solid var(--ed-line);
  border-radius: 11px;
  background: var(--ed-soft);
}
.ed__seg-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 34px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--color-text-muted);
  font-size: .84rem;
  font-weight: 600;
  cursor: pointer;
}
.ed__seg-btn small { font-size: .68rem; font-weight: 500; opacity: .8; }
.ed__seg-btn:hover:not(:disabled) { color: var(--color-text); }
.ed__seg-btn.is-active { background: var(--color-surface); color: var(--color-text); box-shadow: 0 1px 3px rgba(0, 0, 0, .25); }
.ed__seg-btn:disabled { opacity: .4; cursor: not-allowed; }
.ed__colorbtn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 12px 0 6px;
  border: 1px solid var(--ed-line);
  border-radius: 9px;
  background: transparent;
  color: var(--color-text);
  font-size: .82rem;
  cursor: pointer;
}
.ed__colorbtn:hover { border-color: var(--ed-accent); }
.ed__colorbtn--row { width: 100%; margin-top: 12px; }
.ed__colorbtn-swatch {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border: 1px solid rgba(127, 127, 127, .45);
  border-radius: 6px;
  background: #fff;
}
.ed__colorbtn-swatch.is-transparent, .ed__swatch--transparent {
  background: repeating-conic-gradient(#c8c8d0 0 25%, #fff 0 50%) 0 0 / 10px 10px;
}

/* ── Templates ────────────────────────────────────────────────────────── */
.ed__templates { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 12px; margin: 12px 0 4px; }
.ed__tpl {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--color-text);
  font-size: .76rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}
.ed__tpl-img {
  display: block;
  width: 100%;
  height: auto;
  min-height: 60px;
  border-radius: 10px;
  background: var(--ed-soft);
  outline: 2px solid transparent;
  outline-offset: 2px;
  transition: outline-color .15s;
}
.ed__tpl:hover .ed__tpl-img { outline-color: var(--ed-accent); }
.ed__chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.ed__chip {
  height: 30px;
  padding: 0 12px;
  border: 1px solid var(--ed-line);
  border-radius: 30px;
  background: transparent;
  color: var(--color-text);
  font-size: .78rem;
  cursor: pointer;
}
.ed__chip.is-active { border-color: var(--ed-accent); background: var(--ed-accent-soft); color: var(--ed-accent); }

/* ── Stage ────────────────────────────────────────────────────────────── */
.ed__stage {
  position: relative;
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--ed-stage);
}
.ed__ctx {
  position: absolute;
  top: 12px;
  left: 50%;
  z-index: 6;
  display: flex;
  align-items: center;
  gap: 2px;
  max-width: calc(100% - 24px);
  height: 48px;
  padding: 0 6px;
  overflow-x: auto;
  transform: translateX(-50%);
  background: var(--color-surface);
  border: 1px solid var(--ed-line);
  border-radius: 12px;
  box-shadow: var(--ed-shadow);
  scrollbar-width: none;
}
.ed__ctx::-webkit-scrollbar { display: none; }
.ed__ctx[hidden] { display: none; }
.ed__ctxbtn {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--color-text);
  font-size: .84rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}
.ed__ctxbtn:hover { background: var(--ed-hover); }
.ed__ctxbtn[aria-pressed="true"], .ed__ctxbtn[aria-expanded="true"] { background: var(--ed-accent-soft); color: var(--ed-accent); }
.ed__ctxbtn--icon { justify-content: center; width: 34px; padding: 0; }
.ed__ctxsep { flex-shrink: 0; width: 1px; height: 22px; margin: 0 4px; background: var(--ed-line); }
.ed__fontbtn { justify-content: space-between; min-width: 136px; border: 1px solid var(--ed-line); font-weight: 500; }
.ed__fontbtn span { max-width: 112px; overflow: hidden; text-overflow: ellipsis; }
.ed__size { display: flex; flex-shrink: 0; align-items: center; margin: 0 4px; border: 1px solid var(--ed-line); border-radius: 8px; }
.ed__size .ed__ctxbtn--icon { width: 28px; height: 32px; font-size: 1.05rem; }
.ed__size-input {
  width: 46px;
  height: 32px;
  border: 0;
  border-right: 1px solid var(--ed-line);
  border-left: 1px solid var(--ed-line);
  background: transparent;
  color: var(--color-text);
  font: inherit;
  font-size: .84rem;
  font-variant-numeric: tabular-nums;
  text-align: center;
  -moz-appearance: textfield;
  appearance: textfield;
}
.ed__size-input::-webkit-inner-spin-button, .ed__size-input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.ed__textcolor { flex-direction: column; gap: 1px; }
.ed__textcolor-a { font-size: .95rem; font-weight: 700; line-height: 1; }
.ed__textcolor-bar { width: 18px; height: 4px; border: 1px solid rgba(127, 127, 127, .55); border-radius: 2px; background: #fff; }
.ed__aa { font-size: .82rem; font-weight: 700; }
.ed__align-ico { display: none; }
.ed__alignbtn[data-align="left"] .ed__align-ico--left,
.ed__alignbtn[data-align="center"] .ed__align-ico--center,
.ed__alignbtn[data-align="right"] .ed__align-ico--right { display: block; }

.ed__wrap {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.ed__wrap.is-over-text { cursor: move; }
.ed.is-cropping .ed__wrap { cursor: move; }
.ed__canvas { position: absolute; top: 0; left: 0; display: block; }
.ed__frame { position: absolute; background: transparent; box-shadow: var(--ed-canvas-shadow); pointer-events: none; }
.ed__frame[hidden] { display: none; }
.ed__frame.is-transparent { background: repeating-conic-gradient(#d5d5dc 0 25%, #fff 0 50%) 0 0 / 16px 16px; }
.ed__guide { position: absolute; z-index: 3; background: #ff3d9a; pointer-events: none; }
.ed__guide--v { width: 1px; transform: translateX(-.5px); }
.ed__guide--h { height: 1px; transform: translateY(-.5px); }
.ed__guide[hidden] { display: none; }
.ed__sel {
  position: absolute;
  z-index: 3;
  border: 1.5px solid var(--ed-accent);
  border-radius: 3px;
  cursor: move;
  transform-origin: center center;
}
.ed__sel[hidden] { display: none; }
.ed__sel.is-editing { border-style: dashed; }
.ed__sel.is-editing .ed__h, .ed__sel.is-editing .ed__rot { display: none; }
.ed__h {
  position: absolute;
  width: 12px;
  height: 12px;
  border: 1px solid rgba(0, 0, 0, .2);
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .45);
}
.ed__h--nw { top: -7px; left: -7px; cursor: nwse-resize; }
.ed__h--ne { top: -7px; right: -7px; cursor: nesw-resize; }
.ed__h--sw { bottom: -7px; left: -7px; cursor: nesw-resize; }
.ed__h--se { right: -7px; bottom: -7px; cursor: nwse-resize; }
.ed__h--w, .ed__h--e { top: 50%; width: 8px; height: 22px; margin-top: -11px; border-radius: 6px; cursor: ew-resize; }
.ed__h--w { left: -5px; }
.ed__h--e { right: -5px; }
.ed__rot {
  position: absolute;
  bottom: -42px;
  left: 50%;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  margin-left: -14px;
  border-radius: 50%;
  background: #fff;
  color: #333;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .45);
  cursor: grab;
}
.ed__sel.rot-top .ed__rot { top: -42px; bottom: auto; }
.ed__sel.rot-side .ed__rot { top: 50%; right: -44px; bottom: auto; left: auto; margin: -14px 0 0; }
.ed__crop { position: absolute; z-index: 3; pointer-events: none; }
.ed__crop[hidden] { display: none; }
.ed__ch { position: absolute; width: 22px; height: 22px; pointer-events: auto; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .55)); }
.ed__ch--nw { top: -4px; left: -4px; border-top: 4px solid #fff; border-left: 4px solid #fff; cursor: nwse-resize; }
.ed__ch--ne { top: -4px; right: -4px; border-top: 4px solid #fff; border-right: 4px solid #fff; cursor: nesw-resize; }
.ed__ch--sw { bottom: -4px; left: -4px; border-bottom: 4px solid #fff; border-left: 4px solid #fff; cursor: nesw-resize; }
.ed__ch--se { right: -4px; bottom: -4px; border-right: 4px solid #fff; border-bottom: 4px solid #fff; cursor: nwse-resize; }
.ed__ch--n, .ed__ch--s, .ed__ch--w, .ed__ch--e { display: none; border-radius: 3px; background: #fff; }
.ed__crop.is-free .ed__ch--n, .ed__crop.is-free .ed__ch--s, .ed__crop.is-free .ed__ch--w, .ed__crop.is-free .ed__ch--e { display: block; }
.ed__ch--n, .ed__ch--s { left: 50%; width: 28px; height: 5px; margin-left: -14px; cursor: ns-resize; }
.ed__ch--n { top: -3px; }
.ed__ch--s { bottom: -3px; }
.ed__ch--w, .ed__ch--e { top: 50%; width: 5px; height: 28px; margin-top: -14px; cursor: ew-resize; }
.ed__ch--w { left: -3px; }
.ed__ch--e { right: -3px; }
@media (pointer: coarse) {
  .ed__h::after, .ed__ch::after, .ed__rot::after { content: ""; position: absolute; inset: -12px; }
}
.ed__inline {
  position: absolute;
  z-index: 4;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  outline: none;
  background: transparent;
  white-space: pre-wrap;
  overflow-wrap: break-word;
  resize: none;
  caret-color: var(--ed-accent);
  transform-origin: center center;
}
.ed__inline[hidden] { display: none; }
.ed__inline::selection { background: rgba(139, 92, 246, .38); }
.ed__loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 24px;
  color: var(--color-text-muted);
  font-size: .9rem;
  text-align: center;
}
.ed__loading[hidden] { display: none; }
.ed__spinner {
  width: 18px;
  height: 18px;
  border: 2px solid var(--ed-track);
  border-top-color: var(--ed-accent);
  border-radius: 50%;
  animation: ed-spin .8s linear infinite;
}
@keyframes ed-spin { to { transform: rotate(360deg); } }
.ed__foot {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 44px;
  padding: 6px 14px;
}
.ed__credit {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  font-size: .76rem;
  color: var(--color-text-muted);
  white-space: nowrap;
  text-overflow: ellipsis;
}
.ed__compare-btn {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 12px;
  border: 1px solid var(--ed-line);
  border-radius: 30px;
  background: var(--color-surface);
  color: var(--color-text);
  font-size: .76rem;
  font-weight: 600;
  cursor: pointer;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.ed__compare-btn.is-active { border-color: transparent; background: var(--ed-accent); color: #fff; }
.ed:not(.is-ready) .ed__compare-btn, .ed.is-cropping .ed__compare-btn { visibility: hidden; }

/* ── Popovers ─────────────────────────────────────────────────────────── */
.ed__pop {
  position: absolute;
  z-index: 30;
  min-width: 240px;
  max-width: min(340px, calc(100vw - 16px));
  padding: 14px;
  background: var(--color-surface);
  border: 1px solid var(--ed-line);
  border-radius: 14px;
  box-shadow: var(--ed-pop-shadow);
}
.ed__pop[hidden] { display: none; }
.ed__pop .ed__slider:last-child { margin-bottom: 0; }
.ed__pop > .ed__h3:first-child { margin-top: 0; }
.ed__pop-title { margin: 0 0 4px; font-size: 1rem; font-weight: 700; }
.ed__dl { width: 300px; }
.ed__dl .ed__btn--primary { margin-top: 14px; }
.ed__dl .ed__btn--ghost { margin-top: 8px; }
.ed__dl-dims { margin: 8px 0 12px; font-size: .78rem; font-variant-numeric: tabular-nums; color: var(--color-text-muted); }
.ed__menu { min-width: 200px; padding: 6px; }
.ed__menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  height: 38px;
  padding: 0 10px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--color-text);
  font-size: .86rem;
  text-align: left;
  cursor: pointer;
}
.ed__menu-item:hover { background: var(--ed-hover); }
.ed__borderstyles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin-bottom: 12px; }
.ed__bstyle {
  display: grid;
  place-items: center;
  height: 38px;
  border: 1px solid var(--ed-line);
  border-radius: 9px;
  background: none;
  color: var(--color-text);
  cursor: pointer;
}
.ed__bstyle.is-active { border-color: var(--ed-accent); background: var(--ed-accent-soft); color: var(--ed-accent); }
.ed__fontpop { width: 248px; padding: 6px; }
.ed__fontlist { display: flex; flex-direction: column; max-height: min(560px, 68vh); overflow-y: auto; }
.ed__font {
  display: block;
  width: 100%;
  padding: 9px 12px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--color-text);
  font-size: 1.05rem;
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
}
.ed__font:hover { background: var(--ed-hover); }
.ed__font[aria-selected="true"] { background: var(--ed-accent-soft); color: var(--ed-accent); }
.ed__colorpop { width: 280px; }
.ed__swatches { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 6px; }
#edTransparentRow { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
#edTransparentRow[hidden] { display: none; }
#edTransparentRow .ed__help { margin: 0; }
.ed__swatch {
  width: 100%;
  padding: 0;
  aspect-ratio: 1;
  border: 1px solid rgba(127, 127, 127, .4);
  border-radius: 7px;
  cursor: pointer;
  transition: transform .1s;
}
.ed__swatch--transparent { width: 26px; height: 26px; }
.ed__swatch:hover { transform: scale(1.1); }
.ed__colorcustom { display: flex; align-items: center; gap: 8px; margin-top: 14px; }
.ed__colorcustom input[type="color"] {
  width: 40px;
  height: 34px;
  padding: 0;
  border: 1px solid var(--ed-line);
  border-radius: 8px;
  background: none;
  cursor: pointer;
}
.ed__colorcustom input[type="text"] {
  flex: 1;
  min-width: 0;
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--ed-line);
  border-radius: 8px;
  background: transparent;
  color: var(--color-text);
  font: .84rem ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* ── Toast ────────────────────────────────────────────────────────────── */
.ed__toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: calc(100vw - 24px);
  padding: 11px 16px;
  transform: translateX(-50%);
  border-radius: 12px;
  background: #1d1d27;
  color: #fff;
  font-size: .85rem;
  box-shadow: var(--ed-pop-shadow);
}
.ed__toast[hidden] { display: none; }
.ed__toast-action { padding: 0; border: 0; background: none; color: #c4b5fd; font-weight: 700; white-space: nowrap; cursor: pointer; }

/* ── Elements panel ───────────────────────────────────────────────────── */
.ed__pane-search {
  position: relative;
  display: flex;
  align-items: center;
  flex-shrink: 0;
  margin: 0 18px 8px;
  color: var(--color-text-muted);
}
.ed__pane-search svg { position: absolute; left: 12px; pointer-events: none; }
.ed__search {
  width: 100%;
  height: 40px;
  padding: 0 12px 0 36px;
  border: 1px solid var(--ed-line);
  border-radius: 10px;
  background: var(--ed-soft);
  color: var(--color-text);
  font: inherit;
  font-size: .88rem;
}
.ed__search:focus { border-color: var(--ed-accent); outline: none; }
.ed__elsec { margin-bottom: 6px; }
.ed__elhead { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ed__elhead .ed__h3 { display: flex; align-items: center; gap: 8px; }
.ed__seeall { margin: 12px 0 0; font-size: .78rem; }
.ed__h4 { margin: 16px 0 8px; font-size: .74rem; font-weight: 700; color: var(--color-text-muted); text-transform: uppercase; letter-spacing: .05em; }
.ed__subhead { display: flex; align-items: center; gap: 6px; margin: 2px 0 4px; }
.ed__subhead .ed__h3 { margin: 0; }
.ed__elgrid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.ed__elgrid--lines { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ed__elgrid--emoji { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.ed__elgrid--stickers, .ed__elgrid--gradients, .ed__elgrid--frames { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ed__eltile {
  display: grid;
  place-items: center;
  min-width: 0;
  aspect-ratio: 1;
  padding: 6px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: var(--ed-soft);
  cursor: pointer;
  transition: border-color .15s, transform .15s, background .15s;
}
.ed__eltile--line { aspect-ratio: 2; }
.ed__eltile:hover { border-color: var(--ed-accent); background: var(--ed-hover); transform: translateY(-1px); }
.ed__eltile-img { display: block; width: 100%; height: 100%; object-fit: contain; }
.ed__eltile-emoji { font-size: 1.7rem; line-height: 1; font-family: 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', sans-serif; }

/* ── Effects panel ────────────────────────────────────────────────────── */
.ed__aibox {
  margin: 4px 0 14px;
  padding: 12px 14px 14px;
  border: 1px solid var(--ed-line);
  border-radius: 12px;
  background: linear-gradient(160deg, var(--ed-accent-soft), transparent 70%);
}
.ed__aibox-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ed__aibox-head .ed__h3 { margin: 0; }
.ed__aibox .ed__help { margin: 6px 0 12px; }
.ed__aistatus {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 10px 0 0;
  font-size: .8rem;
  color: var(--color-text-muted);
}
.ed.is-ai-busy .ed__aistatus::before {
  content: "";
  flex-shrink: 0;
  width: 14px;
  height: 14px;
  border: 2px solid var(--ed-track);
  border-top-color: var(--ed-accent);
  border-radius: 50%;
  animation: ed-spin .8s linear infinite;
}
.ed__seg--wrap { grid-auto-flow: row; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ed__btnrow2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ed__btn--tile[aria-pressed="true"], .ed__btn--soft[aria-pressed="true"] { border-color: var(--ed-accent); background: var(--ed-accent); color: #fff; }
.ed__colorbtn--tight { margin: 0 0 12px; }
.ed__frames { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.ed__frametile {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  padding: 3px;
  border: 1px solid var(--ed-line);
  border-radius: 9px;
  background: var(--ed-soft);
  cursor: pointer;
}
.ed__frametile-img { display: block; width: 100%; height: 100%; }
.ed__frametile:hover { border-color: var(--ed-accent); }
.ed__frametile.is-active { border-color: var(--ed-accent); box-shadow: 0 0 0 1px var(--ed-accent); }

/* ── Draw & uploads ───────────────────────────────────────────────────── */
.ed__pens { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.ed__pen {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 2px 8px;
  border: 1px solid var(--ed-line);
  border-radius: 10px;
  background: transparent;
  color: var(--color-text);
  font-size: .64rem;
  font-weight: 600;
  cursor: pointer;
}
.ed__pen:hover { background: var(--ed-hover); }
.ed__pen.is-active { border-color: var(--ed-accent); background: var(--ed-accent-soft); color: var(--ed-accent); }
.ed__swatch.is-active { box-shadow: 0 0 0 2px var(--color-surface), 0 0 0 4px var(--ed-accent); }
.ed__uploads { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
.ed__upload {
  display: grid;
  place-items: center;
  min-height: 80px;
  padding: 6px;
  border: 1px solid var(--ed-line);
  border-radius: 10px;
  background: repeating-conic-gradient(rgba(127, 127, 127, .14) 0 25%, transparent 0 50%) 0 0 / 14px 14px;
  cursor: pointer;
}
.ed__upload:hover { border-color: var(--ed-accent); }
.ed__upload-img { display: block; max-width: 100%; height: auto; border-radius: 4px; }

/* ── Stage additions ──────────────────────────────────────────────────── */
.ed__brush {
  position: absolute;
  z-index: 5;
  border: 1.5px solid #fff;
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .55), inset 0 0 0 1px rgba(0, 0, 0, .3);
  pointer-events: none;
}
.ed__brush[hidden] { display: none; }
.ed.is-brushing .ed__wrap { cursor: crosshair; }
.ed__drop {
  position: absolute;
  inset: 12px;
  z-index: 6;
  display: none;
  align-items: center;
  justify-content: center;
  border: 2px dashed var(--ed-accent);
  border-radius: 16px;
  background: rgba(139, 92, 246, .14);
  color: var(--color-text);
  font-weight: 700;
  pointer-events: none;
}
.ed.is-dropping .ed__drop { display: flex; }
.ed__frame.is-framed { box-shadow: none; }
.ed__h--n, .ed__h--s { left: 50%; width: 22px; height: 8px; margin-left: -11px; border-radius: 6px; cursor: ns-resize; display: none; }
.ed__h--n { top: -5px; }
.ed__h--s { bottom: -5px; }
.ed__sel.is-stretch .ed__h--n, .ed__sel.is-stretch .ed__h--s { display: block; }
.ed__sel.is-uniform .ed__h--w, .ed__sel.is-uniform .ed__h--e { display: none; }
.ed__sel.is-line .ed__h--nw, .ed__sel.is-line .ed__h--ne, .ed__sel.is-line .ed__h--sw, .ed__sel.is-line .ed__h--se { display: none; }

/* ── Element popovers ─────────────────────────────────────────────────── */
.ed__borderstyles--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ed__field--wide { margin-bottom: 10px; }
.ed__badgerow { display: flex; gap: 8px; }
.ed__badgerow .ed__colorbtn { flex: 1; }
.ed__select {
  flex: 1;
  min-width: 0;
  height: 36px;
  padding: 0 8px;
  border: 1px solid var(--ed-line);
  border-radius: 9px;
  background: var(--color-surface);
  color: var(--color-text);
  font: inherit;
  font-size: .84rem;
}
.ed__pospop { width: 300px; }
.ed__posgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.ed__posgrid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ed__posbtn {
  height: 34px;
  border: 1px solid var(--ed-line);
  border-radius: 8px;
  background: transparent;
  color: var(--color-text);
  font-size: .8rem;
  font-weight: 600;
  cursor: pointer;
}
.ed__posbtn:hover { background: var(--ed-hover); border-color: var(--ed-accent); }
.ed__layerlist { display: flex; flex-direction: column; gap: 4px; max-height: 220px; overflow-y: auto; }
.ed__layerlist .ed__layer {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 7px 8px;
  border: 1px solid var(--ed-line);
  border-radius: 8px;
  background: transparent;
  color: var(--color-text);
  text-align: left;
  cursor: pointer;
}
.ed__layerlist .ed__layer:hover { border-color: var(--ed-accent); }
.ed__layerlist .ed__layer.is-active { border-color: var(--ed-accent); background: var(--ed-accent-soft); }
.ed__layer-kind {
  flex-shrink: 0;
  padding: 1px 6px;
  border-radius: 5px;
  background: var(--ed-soft);
  color: var(--color-text-muted);
  font-size: .62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.ed__layerlist .ed__layer-name { overflow: hidden; font-size: .84rem; font-weight: 600; white-space: nowrap; text-overflow: ellipsis; }

/* ── Tools panel ──────────────────────────────────────────────────────── */
.ed__toolgrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 4px 0 14px; }
.ed__toolbtn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 12px 4px 10px;
  border: 1px solid var(--ed-line);
  border-radius: 12px;
  background: var(--ed-soft);
  color: var(--color-text);
  font-size: .72rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.ed__toolbtn[hidden] { display: none; }
.ed__toolbtn:hover { border-color: var(--ed-accent); }
.ed__toolbtn.is-active { border-color: var(--ed-accent); background: var(--ed-accent); color: #fff; }
.ed__elgrid--tool { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 10px; }
.ed__eltile.is-active { border-color: var(--ed-accent); box-shadow: 0 0 0 1px var(--ed-accent); }
.ed.is-tooling .ed__wrap { cursor: crosshair; }
.ed__chips--scroll { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.ed__chips--scroll::-webkit-scrollbar { display: none; }
.ed__chips--scroll .ed__chip { flex-shrink: 0; }

/* ── Contextual additions ─────────────────────────────────────────────── */
.ed__ctxcolors { display: inline-flex; gap: 2px; }
.ed__ctxcolors[hidden] { display: none; }
.ed__ctxbtn--accent { background: var(--ed-accent-soft); color: var(--ed-accent); }
.ed__ctxbtn[hidden] { display: none; }
.ed__sel.is-multi { border-style: dashed; cursor: move; }
.ed__sel.is-multi.is-group { border-style: solid; }
.ed__sel.is-multi .ed__h--w, .ed__sel.is-multi .ed__h--e, .ed__sel.is-multi .ed__h--n, .ed__sel.is-multi .ed__h--s,
.ed__sel.is-multi .ed__rot, .ed__sel.is-line .ed__rot { display: none; }
.ed__sel.is-line .ed__h--w, .ed__sel.is-line .ed__h--e { width: 14px; height: 14px; margin-top: -7px; border-radius: 50%; cursor: crosshair; }
.ed__sel.is-line .ed__h--w { left: -7px; }
.ed__sel.is-line .ed__h--e { right: -7px; }
.ed.is-own-photo .ed__credit { visibility: hidden; }

/* ── Text: font list & combinations ───────────────────────────────────── */
.ed__search--font { margin: 4px 4px 8px; width: calc(100% - 8px); padding-left: 12px; height: 36px; }
.ed__fontcat { padding: 10px 12px 4px; font-size: .68rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--color-text-muted); }
.ed__fontcat[hidden], .ed__font[hidden] { display: none; }
.ed__combos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 10px 0 6px; }
.ed__combo {
  display: block;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--ed-line);
  border-radius: 12px;
  background: linear-gradient(135deg, #2c2c3a, #4a3f63 55%, #6b5f8a);
  cursor: pointer;
  transition: border-color .15s, transform .15s;
}
[data-theme="light"] .ed__combo { background: linear-gradient(135deg, #f1f0f7, #e2ddf1 55%, #d2c9ec); }
.ed__combo[hidden] { display: none; }
.ed__combo:hover { border-color: var(--ed-accent); transform: translateY(-1px); }
.ed__combo-img { display: block; width: 100%; height: auto; }

/* ── Photos (Pexafy search) ───────────────────────────────────────────── */
.ed__photosearch { margin: 4px 0 10px; }
.ed__photogrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 10px; min-height: 40px; }
.ed__photogrid--root { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ed__photogrid[aria-busy="true"] { background: repeating-linear-gradient(90deg, var(--ed-soft) 0 40%, var(--ed-hover) 50%, var(--ed-soft) 60% 100%); background-size: 200% 100%; animation: ed-shimmer 1.2s linear infinite; border-radius: 10px; }
@keyframes ed-shimmer { to { background-position: -200% 0; } }
.ed__phototile { position: relative; overflow: hidden; border-radius: 10px; background: var(--ed-soft); aspect-ratio: 4 / 3; }
.ed__phototile img { display: block; width: 100%; height: 100%; object-fit: cover; }
.ed__phototile-add { position: absolute; inset: 0; border: 0; background: transparent; cursor: pointer; }
.ed__phototile-add:hover { background: rgba(139, 92, 246, .18); }
.ed__phototile-bg, .ed__upload-act {
  position: absolute;
  left: 6px;
  bottom: 6px;
  padding: 3px 8px;
  border: 0;
  border-radius: 20px;
  background: rgba(15, 15, 22, .78);
  color: #fff;
  font-size: .64rem;
  font-weight: 700;
  cursor: pointer;
  opacity: 0;
  transition: opacity .15s;
}
.ed__phototile:hover .ed__phototile-bg, .ed__upload:hover .ed__upload-act, .ed__upload:focus-within .ed__upload-act, .ed__phototile:focus-within .ed__phototile-bg { opacity: 1; }
@media (hover: none) { .ed__phototile-bg, .ed__upload-act, .ed__upload-del { opacity: 1; } }

/* ── Uploads & projects ───────────────────────────────────────────────── */
.ed__upload { position: relative; overflow: hidden; }
.ed__upload-img { display: block; width: 100%; height: auto; max-height: 160px; object-fit: contain; }
.ed__upload-add { position: absolute; inset: 0; border: 0; background: transparent; cursor: pointer; }
.ed__upload-add:hover { background: rgba(139, 92, 246, .14); }
.ed__upload-del {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 50%;
  background: rgba(15, 15, 22, .72);
  color: #fff;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transition: opacity .15s;
}
.ed__upload:hover .ed__upload-del { opacity: 1; }
.ed__banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 10px 0 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--ed-accent-soft);
  color: var(--color-text);
  font-size: .8rem;
}
.ed__banner[hidden] { display: none; }
.ed__banner .ed__linkbtn { margin: 0; }
#edUsePexafy { margin-top: 10px; }
#edUsePexafy[hidden] { display: none; }
.ed.is-anon .ed__user-only, .ed:not(.is-anon) .ed__anon-only { display: none; }
.ed__projects { display: flex; flex-direction: column; gap: 8px; }
.ed__project { display: flex; align-items: center; gap: 6px; padding: 6px; border: 1px solid var(--ed-line); border-radius: 12px; }
.ed__project.is-active { border-color: var(--ed-accent); background: var(--ed-accent-soft); }
.ed__project-open { display: flex; flex: 1; min-width: 0; align-items: center; gap: 10px; padding: 0; border: 0; background: none; color: var(--color-text); text-align: left; cursor: pointer; }
.ed__project-open img { flex-shrink: 0; width: 64px; height: 48px; border-radius: 8px; object-fit: cover; background: var(--ed-soft); }
.ed__project-meta { display: flex; flex-direction: column; min-width: 0; }
.ed__project-title { overflow: hidden; font-size: .86rem; font-weight: 600; white-space: nowrap; text-overflow: ellipsis; }
.ed__project-date { font-size: .7rem; color: var(--color-text-muted); }
.ed__pane-search--inline { margin: 4px 0 10px; }

/* ── Phones & narrow windows: stage on top, sheet, bottom tab bar ─────── */
/* Photo grids */
.ed__gridlayouts { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; max-height: 236px; overflow-y: auto; padding: 2px; }
.ed__gridlayout { display: grid; place-items: center; padding: 3px; border-radius: 8px; border: 1px solid transparent; background: var(--ed-soft, rgba(127,127,127,.08)); cursor: pointer; }
.ed__gridlayout:hover { border-color: var(--ed-line, rgba(127,127,127,.35)); }
.ed__gridlayout.is-active { border-color: var(--ed-accent, #8b5cf6); box-shadow: 0 0 0 1px var(--ed-accent, #8b5cf6) inset; }
.ed__gridlayout canvas { width: 48px; height: 48px; display: block; }
#edPopGrid { width: 300px; }
#edPopCell { width: 300px; }
.ed__cellacts { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 10px; }
.ed__cellacts .ed__btn { min-height: 34px; font-size: 13px; }

/* Locked elements: no handles, a lock badge; the toolbar button shows the state */
.ed__lockbtn .ed__lock-on { display: none; }
.ed__lockbtn[aria-pressed="true"] .ed__lock-on { display: block; }
.ed__lockbtn[aria-pressed="true"] .ed__lock-off { display: none; }
.ed__sel.is-locked { cursor: default; }
.ed__sel.is-locked .ed__h, .ed__sel.is-locked .ed__rot { display: none; }
.ed__sel.is-locked::after {
  content: ""; position: absolute; top: -11px; right: -11px; width: 22px; height: 22px; border-radius: 50%;
  background: var(--ed-accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='5' y='11' width='14' height='10' rx='2'/%3E%3Cpath d='M8 11V7a4 4 0 0 1 8 0v4'/%3E%3C/svg%3E") center / 13px no-repeat;
  box-shadow: 0 2px 6px rgba(0,0,0,.3);
}

/* Elements › Browse categories */
.ed__browse { margin-bottom: 10px; }
.ed__browse-wrap { position: relative; }
.ed__browse-nav {
  position: absolute; top: 50%; z-index: 2; width: 30px; height: 30px; margin-top: -19px; display: grid; place-items: center;
  border: 1px solid var(--ed-line); border-radius: 50%; background: var(--color-surface, #1c1c24); color: var(--color-text);
  box-shadow: var(--ed-shadow); cursor: pointer;
}
.ed__browse-nav[hidden] { display: none; }
.ed__browse-nav.is-prev { left: -4px; }
.ed__browse-nav.is-next { right: -4px; }
.ed__browse-row {
  display: grid; grid-auto-flow: column; grid-template-rows: repeat(2, auto); grid-auto-columns: 68px;
  gap: 10px 6px; overflow-x: auto; padding: 2px 2px 8px; scrollbar-width: thin; overscroll-behavior-x: contain;
}
.ed__browse-btn { display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 0; border: 0; background: none; color: inherit; cursor: pointer; }
.ed__browse-ic { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; overflow: hidden; transition: transform .15s ease, box-shadow .15s ease; }
.ed__browse-btn:hover .ed__browse-ic, .ed__browse-btn:focus-visible .ed__browse-ic { transform: translateY(-1px); box-shadow: 0 0 0 2px var(--ed-accent); }
.ed__browse-img { width: 40px; height: 40px; display: block; }
.ed__browse-label { font-size: .68rem; line-height: 1.15; text-align: center; color: var(--color-text-muted); max-width: 68px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }

/* Top bar: state of the saved project */
.ed__cloud { display: inline-flex; align-items: center; gap: 6px; margin-left: 4px; padding: 5px 10px; border: 0; border-radius: 20px;
  background: var(--ed-soft); color: var(--color-text-muted); font-size: .76rem; cursor: pointer; }
.ed__cloud[hidden] { display: none; }
.ed__cloud:hover { background: var(--ed-hover); color: var(--color-text); }
.ed__cloud[data-state="saving"] svg { animation: ed-cloud 1.2s ease-in-out infinite; }
.ed__cloud[data-state="error"] { color: #ef4444; }
@keyframes ed-cloud { 50% { opacity: .35; } }

/* Adjust / Filters panels editing a placed image */
.ed__pane-target { padding: 0 16px; }
.ed__pane-target .ed__banner { margin: 0 0 4px; }
.ed__banner--target { margin-bottom: 12px; }

/* Reframing a placed image: only the zoom and Done stay in its toolbar */
.ed__cropgroup { display: none; align-items: center; gap: 8px; padding: 0 4px; }
.ed__ctx.is-imgcrop > :not(.ed__cropgroup) { display: none !important; }
.ed__ctx.is-imgcrop > .ed__cropgroup { display: inline-flex; }
.ed__ctxlabel { font-size: .8rem; color: var(--color-text-muted); }
.ed__range--inline { width: 140px; }
.ed__num--inline { width: 56px; }
.ed__sel.is-imgcrop { border-style: dashed; cursor: grab; }
.ed__sel.is-imgcrop .ed__rot { display: none; }

/* Elements › collections (Canva-like cards: 3 × 2 preview, name, count) */
.ed__collgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 10px; }
.ed__coll { display: flex; flex-direction: column; gap: 3px; min-width: 0; padding: 0; border: 0; background: none; color: inherit; text-align: left; cursor: pointer; }
.ed__coll-cover {
  display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(2, 1fr); gap: 4px; aspect-ratio: 3 / 2;
  padding: 8px; border-radius: 10px; background: #f2f2f5; overflow: hidden; transition: box-shadow .15s ease;
}
.ed__coll-cover.is-lazy { background: linear-gradient(90deg, #ececf0 25%, #f6f6f9 50%, #ececf0 75%) 0 0 / 200% 100%; animation: ed-shimmer 1.2s linear infinite; }
.ed__coll:hover .ed__coll-cover, .ed__coll:focus-visible .ed__coll-cover { box-shadow: 0 0 0 2px var(--ed-accent); }
.ed__coll-cell { display: grid; place-items: center; min-width: 0; min-height: 0; }
.ed__coll-cell img, .ed__coll-img { width: 100%; height: 100%; object-fit: contain; display: block; }
.ed__coll-emoji { font-size: 1.3rem; line-height: 1; }
.ed__coll-sprite { grid-column: 1 / -1; grid-row: 1 / -1; width: 100%; height: 100%; object-fit: contain; }
.ed__coll-name { margin-top: 2px; font-size: .82rem; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ed__coll-count { font-size: .72rem; color: var(--color-text-muted); }
.ed__eltile--pack, .ed__eltile--pack:hover, .ed__eltile--pack:focus-visible { background: #f2f2f5; }
.ed__eltile--pack:hover, .ed__eltile--pack:focus-visible { box-shadow: 0 0 0 2px var(--ed-accent) inset; }
.ed__eltile--pack .ed__packimg { width: 100%; height: 100%; object-fit: contain; padding: 10%; display: block; }
.ed__eltile--bg .ed__packimg { padding: 0; object-fit: cover; border-radius: 8px; }
.ed__elgrid--bg { grid-template-columns: repeat(3, 1fr); }
.ed__libgroup { margin-top: 4px; }

/* Create a design */
.ed__tool--create svg { color: var(--ed-accent); }
.ed__sizeform { display: flex; align-items: flex-end; gap: 8px; margin-bottom: 12px; }
.ed__sizefield { display: flex; flex-direction: column; gap: 4px; flex: 1; font-size: .74rem; color: var(--color-text-muted); }
.ed__sizefield input { width: 100%; height: 38px; padding: 0 10px; border: 1px solid var(--ed-line); border-radius: 8px; background: var(--ed-soft); color: var(--color-text); font-size: .9rem; }
.ed__sizex, .ed__sizeunit { padding-bottom: 10px; color: var(--color-text-muted); font-size: .85rem; }
.ed__sizes { display: grid; grid-template-columns: 1fr; gap: 6px; }
.ed__size { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border: 1px solid transparent; border-radius: 10px; background: var(--ed-soft); color: inherit; text-align: left; cursor: pointer; }
.ed__size:hover, .ed__size:focus-visible { border-color: var(--ed-accent); }
.ed__size-frame { display: grid; place-items: center; width: 44px; height: 44px; flex: none; }
.ed__size-pv { display: block; border: 2px solid var(--ed-accent); border-radius: 3px; background: var(--ed-accent-soft); }
.ed__size-text { display: flex; flex-direction: column; min-width: 0; }
.ed__size-name { font-size: .84rem; font-weight: 600; }
.ed__size-dims { font-size: .72rem; color: var(--color-text-muted); }
/* A design without a photo: photo tools wait for an image */
.ed__nophoto { display: none; margin: 0 0 12px; padding: 10px 12px; border-radius: 10px; background: var(--ed-soft); color: var(--color-text-muted); font-size: .82rem; line-height: 1.45; }
.ed.is-no-photo:not(.has-target) .ed__nophoto, .ed.is-no-photo #edPane-effects .ed__nophoto { display: block; }
.ed.is-no-photo:not(.has-target) #edPane-adjust .ed__pane-body > :not(.ed__nophoto),
.ed.is-no-photo:not(.has-target) #edPane-adjust .ed__pane-foot,
.ed.is-no-photo:not(.has-target) #edFilterList,
.ed.is-no-photo:not(.has-target) #edPane-filters .ed__pane-foot,
.ed.is-no-photo #edPane-effects .ed__pane-body > :not(.ed__nophoto),
.ed.is-no-photo #edPane-effects .ed__pane-foot { display: none !important; }
.ed.is-no-photo #edTool-crop, .ed.is-no-photo .ed__compare-btn, .ed.is-no-photo [data-compare] { display: none !important; }
.ed.is-no-photo #edCtxPhoto > :not(#edCtxBg):not(#edMockColor):not(#edMockRemove) { display: none !important; }

/* Font picker previews from sprites (dark ink; inverted on the dark theme) */
.ed__font-pv { display: block; width: 100%; background-repeat: no-repeat; }
:root:not([data-theme="light"]) .ed__font-pv { filter: invert(.92); }

.ed__chip--fit::before { content: "⤢"; margin-right: 4px; }
.ed__tpl-more { grid-column: 1 / -1; }

.ed__combo-more { grid-column: 1 / -1; }
.ed__combo { aspect-ratio: 280 / 200; }   /* the tile keeps its size before its canvas is painted */

/* Open designs as tabs */
.ed__tabs { display: flex; align-items: center; gap: 6px; height: 44px; padding: 0 10px; flex-shrink: 0; background: var(--color-surface); border-bottom: 1px solid var(--ed-line); }
.ed__tabs[hidden] { display: none; }
.ed__tabs-list { display: flex; align-items: center; gap: 4px; flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.ed__tabs-list::-webkit-scrollbar { display: none; }
.ed__tab { display: flex; align-items: center; flex-shrink: 0; max-width: 220px; border-radius: 9px; border: 1px solid transparent; background: var(--ed-soft); }
.ed__tab:hover { background: var(--ed-hover); }
.ed__tab.is-active { border-color: var(--ed-accent); background: var(--ed-accent-soft); }
.ed__tab-open { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 5px 4px 5px 6px; border: 0; background: none; color: inherit; cursor: pointer; }
.ed__tab-img { width: 26px; height: 26px; border-radius: 5px; object-fit: cover; flex-shrink: 0; display: block; }
.ed__tab-img--empty { background: var(--ed-hover); }
.ed__tab-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .78rem; max-width: 150px; }
.ed__tab-close { width: 24px; height: 24px; margin-right: 4px; border: 0; border-radius: 6px; background: none; color: var(--color-text-muted); font-size: 1.05rem; line-height: 1; cursor: pointer; flex-shrink: 0; }
.ed__tab-close:hover { background: var(--ed-hover); color: var(--color-text); }
.ed__tabs-add, .ed__tabs-dl { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px; border: 1px solid var(--ed-line); border-radius: 9px; background: none; color: inherit; font-size: .8rem; cursor: pointer; flex-shrink: 0; }
.ed__tabs-add { width: 32px; padding: 0; justify-content: center; }
.ed__tabs-add:hover, .ed__tabs-dl:hover { border-color: var(--ed-accent); }
.ed__bulk { width: 340px; }
.ed__bulk-list { display: flex; flex-direction: column; gap: 4px; max-height: 260px; overflow-y: auto; margin-bottom: 8px; }
.ed__bulk-row { display: flex; align-items: center; gap: 6px; padding: 4px 6px; border-radius: 8px; background: var(--ed-soft); }
.ed__bulk-label { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; cursor: pointer; }
.ed__bulk-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .82rem; }
.ed__exportframe { position: fixed; left: -12000px; top: 0; width: 1280px; height: 800px; border: 0; opacity: 0; pointer-events: none; }
.ed.is-embed .ed__tabs { display: none; }

/* Stacked full-width buttons never touch */
.ed__pane-body .ed__btn--block + .ed__btn--block,
.ed__pane-body .ed__btn--block + input[type="file"] + .ed__btn--block,
.ed__pane-body input[type="file"] + .ed__btn--block { margin-top: 10px; }
/* Create a design: more air around the form, the sections and the sizes */
#edPane-create .ed__pane-body { padding: 6px 22px 24px; }
#edPane-create .ed__h3 { margin: 22px 0 10px; }
#edPane-create .ed__h3:first-child { margin-top: 8px; }
#edPane-create .ed__sizeform { margin-bottom: 14px; }
#edPane-create .ed__help { margin: 10px 2px 0; }
#edPane-create .ed__sizes { gap: 8px; }
#edPane-create .ed__size { padding: 10px 12px; }
/* Uploads › Add from Pexafy: a search and a waterfall of photos (1 or 2 columns as room allows) */
.ed__pexafy { margin-top: 12px; padding: 12px; border: 1px solid var(--ed-line); border-radius: 12px; background: var(--ed-soft); }
.ed__pexafy[hidden] { display: none; }
.ed__pexafy-head { display: flex; align-items: center; gap: 8px; }
.ed__pexafy-head .ed__search { flex: 1; min-width: 0; }
.ed__pexafy-hint { margin: 8px 0 10px; }
.ed__waterfall { columns: 2 128px; column-gap: 8px; }
.ed__waterfall[aria-busy="true"] { min-height: 120px; }
.ed__wf-tile { position: relative; display: block; width: 100%; margin: 0 0 8px; padding: 0; border: 0; border-radius: 9px; overflow: hidden; break-inside: avoid; background: var(--ed-hover); cursor: pointer; }
.ed__wf-tile img { display: block; width: 100%; height: auto; }
.ed__wf-tile:hover, .ed__wf-tile:focus-visible { outline: 2px solid var(--ed-accent); outline-offset: -2px; }
.ed__wf-tile.is-busy { opacity: .55; }
.ed__wf-bg { position: absolute; left: 6px; bottom: 6px; padding: 3px 8px; border: 0; border-radius: 7px; background: rgba(0, 0, 0, .62); color: #fff; font-size: .7rem; cursor: pointer; opacity: 0; transition: opacity .15s; }
.ed__wf-tile:hover .ed__wf-bg, .ed__wf-tile:focus-within .ed__wf-bg { opacity: 1; }
@media (hover: none) { .ed__wf-bg { opacity: 1; } }

@media (max-width: 860px) {
  .ed { --ed-top-h: 52px; }
  .ed__top { gap: 4px; padding: 0 8px; }
  .ed__back { padding: 0 8px 0 4px; }
  .ed__back-label, .ed__title-main { display: none; }
  .ed__title { margin-left: 0; padding-left: 4px; border-left: 0; }
  .ed__body { flex-direction: column; }
  .ed__stage { order: 1; }
  .ed__panel {
    order: 2;
    width: auto;
    max-height: 46vh;
    max-height: 46dvh;
    border-top: 1px solid var(--ed-line);
    border-right: 0;
  }
  .ed__rail {
    order: 3;
    flex-direction: row;
    justify-content: space-around;
    width: auto;
    padding: 4px 4px calc(4px + env(safe-area-inset-bottom));
    overflow-x: auto;
    border-top: 1px solid var(--ed-line);
    border-right: 0;
  }
  .ed__rail { justify-content: flex-start; scrollbar-width: none; }
  .ed__rail::-webkit-scrollbar { display: none; }
  .ed__tool { flex: 0 0 auto; min-width: 62px; padding: 6px 4px; font-size: .64rem; }
  .ed__elgrid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .ed__elgrid--emoji { grid-template-columns: repeat(7, minmax(0, 1fr)); }
  .ed__pane-head { height: 44px; padding-left: 14px; }
  .ed__pane-body { padding: 0 14px 14px; }
  .ed__pane-foot { padding: 10px 14px; }
  .ed__ctx { top: 8px; right: 8px; left: 8px; justify-content: flex-start; max-width: none; transform: none; }
  .ed__foot { min-height: 34px; padding: 2px 10px; }
  .ed__compare-btn span { display: none; }
  .ed__compare-btn { width: 30px; padding: 0; justify-content: center; }
  .ed__templates { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 480px) {
  .ed__dl-label { display: none; }
  .ed__dl-open { width: 40px; margin-left: 4px; padding: 0; }
  .ed__iconbtn { width: 34px; }
  .ed__ratios { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
}
@media (prefers-reduced-motion: reduce) {
  .ed *, .ed *::before, .ed *::after { transition: none !important; animation-duration: .01ms !important; }
}

/* Narrow screens: the save state keeps its icon only */
@media (max-width: 640px) { #edCloudText { display: none; } .ed__cloud { padding: 6px; } }

/* Phones: toasts drop from the top bar, clear of the tool sheet */
@media (max-width: 860px) { .ed__toast { top: calc(var(--ed-top-h) + 8px); bottom: auto; } }

/* Phones: tabs show their thumbnails only */
@media (max-width: 860px) { .ed__tab-title { display: none; } .ed__tabs-dl span { display: none; } .ed__tabs { padding: 0 6px; } }
