.editor-route-pending {
  display: flex;
  min-height: 100svh;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--muted);
}

.editor-v2 {
  --editor-panel: #202020;
  --editor-bg: #292929;
  --editor-line: rgba(255, 255, 255, .09);
  --editor-muted: rgba(255, 255, 255, .52);
  display: grid;
  min-width: 0;
  min-height: 100svh;
  grid-template-columns: 66px minmax(0, 1fr) 320px;
  color: rgba(255, 255, 255, .88);
  background: #171717;
}

.editor-v2 .editor-toolbar {
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  padding: 14px 10px;
  background: var(--editor-panel);
  border-right: 1px solid var(--editor-line);
}

/* Кнопка левой панели оболочки (30×30, top: 22px) висит над рабочей областью
   и в свёрнутом виде стоит на left: 8px — ровно на первом инструменте, кисти.
   Остальные экраны начинаются с полей, и кнопка ложится в пустоту; панель
   редактора — единственная, что стоит вплотную к верхнему левому углу
   (Лена, 11.09: «кнопку кисти закрывает кнопка развернуть левую панель»).
   Раскрытая панель кладёт кнопку на свою границу, на 15 px внутрь панели
   инструментов, — поэтому отступ нужен в обоих состояниях. no-context
   переключается оболочкой строго вместе с видимостью кнопки. */
@media (min-width: 761px) {
  .workbench:not(.no-context) .editor-v2 .editor-toolbar {
    padding-top: 60px;
  }
}

/* На 721–760 px панель инструментов уже строка, а кнопка ещё видна (прячется
   она с 720 px) — уводим первый инструмент вправо, а не вниз. */
@media (min-width: 721px) and (max-width: 760px) {
  .workbench:not(.no-context) .editor-v2 .editor-toolbar {
    padding-left: 46px;
  }
}

.editor-v2 .editor-tool {
  display: grid;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  place-items: center;
  color: var(--editor-muted);
  background: transparent;
  border: 0;
  border-radius: var(--radius-12);
}

.editor-v2 .editor-tool:hover,
.editor-v2 .editor-tool.active {
  color: var(--on-dark);
  background: rgba(255, 255, 255, .09);
}

.editor-v2 .editor-tool.active {
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12);
}

.editor-v2 .editor-tool:disabled {
  opacity: .24;
  cursor: default;
}

.editor-v2 .editor-divider {
  width: 28px;
  height: 1px;
  flex: 0 0 auto;
  margin: 5px 0;
  background: rgba(255, 255, 255, .1);
}

.editor-v2 .editor-canvas {
  position: relative;
  display: grid;
  min-width: 0;
  min-height: 580px;
  place-items: stretch;
  overflow: hidden;
  background-color: var(--editor-bg);
  background-image:
    linear-gradient(45deg, rgba(255, 255, 255, .035) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(255, 255, 255, .035) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(255, 255, 255, .035) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(255, 255, 255, .035) 75%);
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
  background-size: 16px 16px;
}

/* Курсор кисти — её настоящий диаметр. Системная стрелка на холсте скрыта:
   она не говорила о размере мазка ничего, а от инструмента рамки на ней
   залипал курсор «перемещение» из четырёх стрелок. */
.editor-v2 .editor-brush-cursor {
  position: absolute;
  z-index: 6;
  top: 0;
  left: 0;
  border: 1px solid rgba(255, 255, 255, .92);
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .55);
  pointer-events: none;
}

.editor-v2 .editor-brush-cursor.is-erase {
  border-style: dashed;
}

.editor-v2 .editor-brush-cursor.hidden {
  display: none;
}

.editor-v2 .editor-canvas.dragover {
  box-shadow: inset 0 0 0 3px #d7ff43;
}

.editor-v2 .editor-canvas > canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  touch-action: none;
}

.editor-v2 .editor-empty {
  position: absolute;
  z-index: 2;
  top: 50%;
  left: 50%;
  width: min(430px, calc(100% - 44px));
  padding: 34px;
  color: rgba(255, 255, 255, .82);
  text-align: center;
  background: rgba(29, 29, 29, .88);
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: var(--radius-24);
  backdrop-filter: blur(16px);
  transform: translate(-50%, -50%);
}

/* Загрузка и каталог — не кнопки, а ЗОНЫ: на плитку с пунктиром файл можно
   бросить, и она об этом прямо говорит. Язык тот же, что у пустого чата
   генерации, только на тёмном холсте редактора. */
.editor-v2 .editor-empty .start-slots {
  display: grid;
  margin-top: 18px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.editor-v2 .editor-empty .start-slot {
  display: grid;
  min-height: 118px;
  align-content: center;
  justify-items: center;
  gap: 5px;
  padding: 16px 12px;
  color: rgba(255, 255, 255, .82);
  background: rgba(255, 255, 255, .04);
  border: 1px dashed rgba(255, 255, 255, .22);
  border-radius: var(--radius-16);
  cursor: pointer;
  transition: background 150ms ease, border-color 150ms ease, transform 150ms ease;
}

.editor-v2 .editor-empty .start-slot:hover,
.editor-v2 .editor-empty .start-slot:focus-visible {
  background: rgba(255, 255, 255, .08);
  border-color: #d7ff43;
  transform: translateY(-1px);
}

.editor-v2 .editor-empty .start-slot.is-drop {
  background: rgba(215, 255, 67, .12);
  border-color: #d7ff43;
  border-style: solid;
}

.editor-v2 .editor-empty .start-slot:disabled {
  opacity: .4;
  cursor: default;
  transform: none;
}

.editor-v2 .editor-empty .start-slot .icon {
  width: 20px;
  height: 20px;
  color: #d7ff43;
}

.editor-v2 .editor-empty .start-slot strong { font-size: 12px; font-weight: 640; }
.editor-v2 .editor-empty .start-slot small { color: rgba(255, 255, 255, .5); font-size: 11px; }

@media (max-width: 620px) {
  .editor-v2 .editor-empty .start-slots { grid-template-columns: 1fr; }
}

.editor-v2 .editor-empty.hidden {
  display: none;
}

.editor-v2 .editor-empty-icon {
  display: grid;
  width: 58px;
  height: 58px;
  margin: 0 auto 18px;
  place-items: center;
  color: #d7ff43;
  background: rgba(215, 255, 67, .1);
  border-radius: var(--radius-16);
}

.editor-v2 .editor-empty-icon .icon {
  width: 26px;
  height: 26px;
}

.editor-v2 .editor-empty h2 {
  margin: 0;
  font-size: 22px;
}

.editor-v2 .editor-empty p {
  max-width: 340px;
  margin: 10px auto 22px;
  color: rgba(255, 255, 255, .5);
  font-size: 13px;
  line-height: 1.55;
}

.editor-v2 .editor-empty > div:last-child {
  display: flex;
  justify-content: center;
  gap: 8px;
}

.editor-v2 .editor-empty .btn.ghost {
  color: rgba(255, 255, 255, .86);
  border-color: rgba(255, 255, 255, .18);
}

.editor-v2 .editor-empty .btn.ghost:hover,
.editor-v2 .editor-empty .btn.ghost:focus-visible {
  color: var(--on-dark);
  background: rgba(255, 255, 255, .08);
  border-color: rgba(255, 255, 255, .3);
}

.editor-v2 .editor-loading {
  position: absolute;
  z-index: 7;
  top: 50%;
  left: 50%;
  display: grid;
  min-width: 210px;
  max-width: min(360px, 82vw);   /* строка фактов длиннее заголовка — переносим */
  padding: 18px 22px;
  grid-template-columns: 24px 1fr;
  gap: 2px 12px;
  color: var(--on-dark);
  background: rgba(25, 25, 25, .86);
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: var(--radius-16);
  backdrop-filter: blur(12px);
  transform: translate(-50%, -50%);
}

.editor-v2 .editor-loading.hidden {
  display: none;
}

.editor-v2 .editor-loading .spinner {
  grid-row: 1 / span 2;
}

.editor-v2 .editor-loading strong {
  font-size: 12px;
}

.editor-v2 .editor-loading small {
  color: rgba(255, 255, 255, .5);
  font-size: 10px;
}

/* Шкала ожидания. Заполнение ставит JS покадрово и асимптотически — до конца
   она не доходит намеренно (см. startBusyTicker). Блик размечен в ДОРОЖКЕ, а
   не внутри заполнения: раньше он жил в растущей полосе, его система координат
   ехала вместе с ней, и на каждом шаге ширины он сбивался. */
.editor-v2 .editor-loading .editor-progress {
  position: relative;
  overflow: hidden;
  height: 3px;
  margin: 9px 0 6px;
  background: rgba(255, 255, 255, .12);
  border-radius: var(--radius-pill);
  grid-column: 1 / -1;
}

.editor-v2 .editor-loading .editor-progress.hidden {
  display: none;
}

.editor-v2 .editor-progress i {
  display: block;
  width: 0;
  height: 100%;
  background: #d7ff43;
  border-radius: inherit;
}

.editor-v2 .editor-progress::after {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 34%;
  content: "";
  background: linear-gradient(90deg,
    rgba(255, 255, 255, 0), rgba(255, 255, 255, .38), rgba(255, 255, 255, 0));
  animation: editor-progress-sheen 2.4s linear infinite;
  pointer-events: none;
}

/* Ход блика без «отскока»: он уезжает за правый край и появляется слева,
   пройдя всю дорожку ровно один раз за цикл. */
@keyframes editor-progress-sheen {
  from { transform: translateX(-100%); }
  to { transform: translateX(340%); }
}

@media (prefers-reduced-motion: reduce) {
  .editor-v2 .editor-progress::after { animation: none; opacity: 0; }
}

.editor-v2 .editor-loading .editor-facts {
  color: rgba(255, 255, 255, .62);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  line-height: 1.5;
  grid-column: 1 / -1;
}

.editor-v2 .editor-loading .editor-facts.hidden {
  display: none;
}

.editor-v2 .canvas-zoom {
  position: absolute;
  z-index: 3;
  right: 18px;
  bottom: 18px;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px;
  background: rgba(25, 25, 25, .76);
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: var(--radius-12);
  backdrop-filter: blur(10px);
}

.editor-v2 .canvas-zoom .icon-btn {
  width: 32px;
  height: 32px;
  color: rgba(255, 255, 255, .65);
}

.editor-v2 .canvas-zoom span {
  min-width: 48px;
  color: rgba(255, 255, 255, .6);
  font-size: 10px;
  text-align: center;
}

/* Правая кнопка на холсте открывает саму кисть: размер И растушёвка. Раньше
   здесь жил один размер, а растушёвка оставалась в правой панели — но она
   свойство мазка, и менять её надо там же, где ведут руку (Эдвард, 08.09). */
.editor-v2 .editor-brush-popup {
  position: absolute;
  z-index: 8;
  display: grid;
  width: min(268px, calc(100% - 16px));
  grid-template-columns: auto minmax(0, 1fr) 30px 28px 28px;
  align-items: center;
  gap: 4px 6px;
  padding: 7px 8px;
  color: rgba(255, 255, 255, .82);
  background: rgba(25, 25, 25, .92);
  border: 1px solid rgba(255, 255, 255, .13);
  border-radius: var(--radius-12);
  backdrop-filter: blur(12px);
}

.editor-v2 .editor-brush-popup.hidden {
  display: none;
}

.editor-v2 .editor-brush-popup-name {
  font-size: 10px;
  letter-spacing: .01em;
  white-space: nowrap;
}

.editor-v2 .editor-brush-popup button {
  display: grid;
  width: 28px;
  height: 26px;
  padding: 0;
  place-items: center;
  color: rgba(255, 255, 255, .64);
  background: transparent;
  border: 0;
  border-radius: var(--radius-8);
}

.editor-v2 .editor-brush-popup button:hover {
  color: var(--on-dark);
  background: rgba(255, 255, 255, .08);
}

.editor-v2 .editor-brush-popup button .icon {
  width: 15px;
  height: 15px;
}

.editor-v2 .editor-brush-popup input {
  width: 100%;
  min-width: 0;
  accent-color: #d7ff43;
}

.editor-v2 .editor-brush-popup b {
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.editor-v2 .editor-iterations {
  position: absolute;
  z-index: 3;
  bottom: 18px;
  left: 18px;
  display: flex;
  max-width: calc(100% - 250px);
  gap: 6px;
  padding: 6px;
  overflow-x: auto;
  background: rgba(25, 25, 25, .78);
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: var(--radius-12);
  backdrop-filter: blur(10px);
}

.editor-v2 .editor-iterations.hidden {
  display: none;
}

.editor-v2 .editor-iteration {
  position: relative;
  width: 52px;
  height: 52px;
  flex: 0 0 auto;
  padding: 0;
  overflow: hidden;
  background: #161616;
  border: 2px solid transparent;
  border-radius: var(--radius-8);
}

.editor-v2 .editor-iteration.current {
  border-color: #d7ff43;
}

.editor-v2 .editor-iteration img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.editor-v2 .editor-iteration > span {
  position: absolute;
  bottom: 3px;
  left: 3px;
  min-width: 16px;
  padding: 2px 4px;
  color: #fff;
  font-size: 8px;
  background: rgba(0, 0, 0, .68);
  border-radius: var(--radius-4);
}

.editor-v2 .editor-iteration > b {
  position: absolute;
  top: 3px;
  right: 3px;
  display: grid;
  width: 17px;
  height: 17px;
  place-items: center;
  color: #171717;
  background: #d7ff43;
  border-radius: 50%;
}

.editor-v2 .editor-iteration > b .icon {
  width: 10px;
  height: 10px;
}

.editor-v2 .editor-canvas-chip {
  position: absolute;
  z-index: 3;
  top: 18px;
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  gap: 7px;
  padding: 0 11px;
  color: rgba(255, 255, 255, .8);
  background: rgba(25, 25, 25, .78);
  border: 1px solid rgba(255, 255, 255, .11);
  border-radius: var(--radius-8);
  backdrop-filter: blur(10px);
}

.editor-v2 .editor-canvas-chip.hidden {
  display: none;
}

.editor-v2 .editor-canvas-chip.compare {
  left: 18px;
}

.editor-v2 .editor-canvas-chip.lucky {
  right: 18px;
}

.editor-v2 .editor-canvas-chip.active {
  color: #171717;
  background: #d7ff43;
  border-color: #d7ff43;
}

.editor-v2 .editor-debug-strip {
  position: absolute;
  z-index: 6;
  top: 64px;
  left: 18px;
  display: flex;
  max-width: calc(100% - 36px);
  gap: 8px;
  padding: 8px;
  overflow-x: auto;
  background: rgba(20, 20, 20, .9);
  border: 1px solid rgba(215, 255, 67, .26);
  border-radius: var(--radius-12);
  backdrop-filter: blur(12px);
}

.editor-v2 .editor-debug-strip.hidden {
  display: none;
}

.editor-v2 .editor-debug-strip > button:not(.icon-btn) {
  position: relative;
  width: 116px;
  height: 78px;
  flex: 0 0 auto;
  padding: 0;
  overflow: hidden;
  background: #111;
  border-radius: var(--radius-8);
}

.editor-v2 .editor-debug-strip img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.editor-v2 .editor-debug-strip span {
  position: absolute;
  right: 3px;
  bottom: 3px;
  left: 3px;
  padding: 3px;
  color: #fff;
  font-size: 8px;
  background: rgba(0, 0, 0, .7);
  border-radius: var(--radius-4);
}

.editor-v2 .editor-debug-strip > .icon-btn {
  flex: 0 0 auto;
  color: rgba(255, 255, 255, .68);
}

.editor-v2 .editor-inspector {
  min-width: 0;
  padding: 22px 20px;
  overflow-y: auto;
  background: var(--editor-panel);
  border-left: 1px solid var(--editor-line);
}

.editor-v2 .editor-inspector > .eyebrow {
  color: rgba(255, 255, 255, .4);
}

.editor-v2 .editor-inspector h2 {
  margin: 3px 0 0;
  font-size: 18px;
}

.editor-v2 .editor-inspector > p {
  min-height: 36px;
  margin: 8px 0 14px;
  color: rgba(255, 255, 255, .5);
  font-size: 12px;
  line-height: 1.45;
}

.editor-v2 .dark-field {
  width: 100%;
  min-height: 128px;
  padding: 14px;
  color: var(--on-dark);
  resize: vertical;
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: var(--radius-12);
  outline: 0;
}

.editor-v2 .dark-field:focus {
  border-color: rgba(255, 255, 255, .3);
}

.editor-v2 .dark-select {
  width: 160px;
  height: 40px;
  padding: 0 11px;
  color: var(--on-dark);
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: var(--radius-8);
}

.editor-v2 .setting-row {
  display: flex;
  min-height: 56px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  color: rgba(255, 255, 255, .6);
  font-size: 11px;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.editor-v2 .setting-row b {
  color: rgba(255, 255, 255, .38);
  font-size: 9px;
  font-weight: 500;
}

.editor-v2 .range {
  width: 132px;
  accent-color: #d7ff43;
}

.editor-v2 .editor-model-hint {
  display: block;
  padding: 9px 0 3px;
  color: rgba(255, 255, 255, .4);
  font-size: 10px;
  line-height: 1.45;
}

.editor-v2 .editor-debug-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 0;
  color: rgba(255, 255, 255, .5);
  font-size: 10px;
}

.editor-v2 .editor-debug-toggle input {
  accent-color: #d7ff43;
}

.editor-v2 .editor-info {
  min-height: 31px;
  padding: 10px 0 5px;
  color: rgba(255, 255, 255, .4);
  font-size: 10px;
  line-height: 1.45;
}

.editor-v2 .editor-overflow {
  margin: 0 0 6px;
  padding: 8px 10px;
  color: rgba(255, 214, 130, .92);
  font-size: 10px;
  line-height: 1.5;
  background: rgba(255, 176, 46, .1);
  border: 1px solid rgba(255, 176, 46, .28);
  border-radius: var(--radius-8);
}

.editor-v2 .editor-error {
  margin: 8px 0;
  padding: 9px 10px;
  color: #ffb5a8;
  font-size: 10px;
  line-height: 1.4;
  background: rgba(232, 79, 53, .1);
  border: 1px solid rgba(232, 79, 53, .22);
  border-radius: var(--radius-8);
}

.editor-v2 .editor-error.hidden {
  display: none;
}

.editor-v2 .editor-send {
  width: 100%;
  margin-top: 12px;
}

.editor-v2 .editor-iteration-actions {
  display: flex;
  justify-content: center;
  gap: 5px;
  margin-top: 12px;
  padding: 8px;
  border-top: 1px solid rgba(255, 255, 255, .08);
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.editor-v2 .editor-iteration-actions .icon-btn {
  color: rgba(255, 255, 255, .58);
}

.editor-v2 .editor-iteration-actions .icon-btn.active {
  color: #171717;
  background: #d7ff43;
}

.editor-v2 .editor-close {
  width: 100%;
  margin-top: 10px;
  color: rgba(255, 255, 255, .66);
  border-color: rgba(255, 255, 255, .12);
}

.editor-compare {
  width: min(900px, calc(100vw - 34px));
}

.editor-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 16px;
}

.editor-modal-head h2 {
  margin: 3px 0 0;
}

.editor-modal-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
}

.editor-modal-actions > span {
  margin-right: auto;
  color: var(--muted);
  font-size: 11px;
}

.editor-v2 .editor-workflow {
  margin-top: 12px;
  overflow: hidden;
  color: rgba(255, 255, 255, .76);
  background: rgba(255, 255, 255, .045);
  border: 1px solid rgba(255, 255, 255, .11);
  border-radius: var(--radius-16);
  animation: editor-workflow-enter 160ms ease-out both;
}

.editor-v2 .editor-workflow[hidden] {
  display: none;
}

@keyframes editor-workflow-enter {
  from {
    opacity: 0;
    transform: translateY(5px);
  }
}

.editor-gallery-panel {
  padding: 14px;
}

.editor-inline-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.editor-inline-head h3 {
  margin: 3px 0 0;
  color: var(--on-dark);
  font-size: 14px;
}

.editor-inline-head .icon-btn {
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  color: rgba(255, 255, 255, .56);
}

.editor-gallery-panel > p {
  margin: 0 0 10px;
  color: rgba(255, 255, 255, .46);
  font-size: 10px;
  line-height: 1.45;
}

.editor-gallery-search {
  margin-bottom: 10px;
}

.editor-v2 .editor-gallery-search {
  min-height: 36px;
  color: rgba(255, 255, 255, .45);
  background: rgba(255, 255, 255, .05);
  border-color: rgba(255, 255, 255, .1);
}

.editor-v2 .editor-gallery-search input {
  color: var(--on-dark);
  background: transparent;
}

.editor-v2 .editor-gallery-search input::placeholder {
  color: rgba(255, 255, 255, .34);
}

.editor-gallery-dishes {
  display: grid;
  min-height: 116px;
  max-height: min(32vh, 260px);
  grid-template-columns: minmax(0, 1fr);
  gap: 7px;
  overflow: auto;
}

.editor-gallery-dishes > button {
  display: grid;
  min-width: 0;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  padding: 11px 12px;
  color: rgba(255, 255, 255, .82);
  background: rgba(255, 255, 255, .04);
  border: 1px solid rgba(255, 255, 255, .09);
  border-radius: var(--radius-12);
  text-align: left;
}

.editor-gallery-dishes > button:hover,
.editor-gallery-dishes > button.selected {
  background: rgba(255, 255, 255, .075);
  border-color: rgba(255, 255, 255, .2);
}

.editor-gallery-dishes > button.selected .status-dot {
  background: var(--accent);
}

.editor-gallery-dishes > button > span:nth-child(2),
.editor-gallery-dishes > button strong,
.editor-gallery-dishes > button small {
  display: block;
  min-width: 0;
}

.editor-gallery-dishes > button strong {
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.editor-gallery-dishes > button small {
  margin-top: 2px;
  overflow: hidden;
  color: rgba(255, 255, 255, .38);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.editor-gallery-dishes > button > svg {
  width: 15px;
  opacity: 0;
}

.editor-gallery-dishes > button.selected > svg {
  color: var(--accent);
  opacity: 1;
}

.editor-gallery-loading,
.editor-gallery-empty {
  display: flex;
  grid-column: 1 / -1;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 112px;
  color: rgba(255, 255, 255, .42);
  font-size: 10px;
}

.editor-gallery-empty.error {
  flex-wrap: wrap;
  color: var(--accent);
}

.editor-gallery-description {
  display: grid;
  gap: 6px;
  margin-top: 10px;
  color: rgba(255, 255, 255, .46);
  font-size: 10px;
}

.editor-gallery-description textarea {
  width: 100%;
  min-height: 68px;
  padding: 10px;
  resize: vertical;
  color: var(--on-dark);
  background: rgba(255, 255, 255, .05);
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: var(--radius-12);
}

.editor-gallery-panel .editor-modal-actions {
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.editor-gallery-panel .editor-modal-actions .btn {
  min-height: 34px;
  padding-inline: 10px;
}

.editor-gallery-panel .editor-modal-actions .btn.ghost {
  color: rgba(255, 255, 255, .68);
  border-color: rgba(255, 255, 255, .12);
}

.editor-gallery-panel .editor-modal-actions > span {
  color: rgba(255, 255, 255, .4);
}

.editor-compare {
  width: min(1080px, calc(100vw - 34px));
}

.editor-compare-stage {
  position: relative;
  height: min(70vh, 720px);
  overflow: hidden;
  background: #222;
  border-radius: var(--radius-12);
}

.editor-compare-stage > img,
.editor-compare-before img {
  position: absolute;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.editor-compare-before {
  position: absolute;
  inset: 0 auto 0 0;
  overflow: hidden;
}

.editor-compare-before img {
  width: min(1080px, calc(100vw - 34px));
  max-width: none;
}

.editor-compare-stage > span {
  position: absolute;
  z-index: 2;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #fff;
  transform: translateX(-1px);
}

.editor-compare-stage > input {
  position: absolute;
  z-index: 3;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: ew-resize;
}

@media (max-width: 1120px) {
  .editor-v2 {
    grid-template-columns: 58px minmax(0, 1fr) 292px;
  }

  .editor-v2 .editor-toolbar {
    padding-inline: 7px;
  }

  .editor-v2 .editor-inspector {
    padding-inline: 16px;
  }

  .editor-v2 .dark-select {
    width: 146px;
  }
}

@media (max-width: 760px) {
  .editor-v2 {
    display: block;
    padding-bottom: 76px;
  }

  .editor-v2 .editor-toolbar {
    position: sticky;
    z-index: 8;
    top: 0;
    flex-direction: row;
    padding: 8px 10px;
    overflow-x: auto;
    background: var(--editor-panel);
    border-right: 0;
    border-bottom: 1px solid var(--editor-line);
  }

  .editor-v2 .editor-divider {
    width: 1px;
    height: 28px;
    margin: 0 5px;
  }

  .editor-v2 .editor-canvas {
    min-height: 64svh;
  }

  .editor-v2 .editor-iterations {
    right: 12px;
    bottom: 66px;
    left: 12px;
    max-width: none;
  }

  .editor-v2 .canvas-zoom {
    right: 12px;
    bottom: 14px;
  }

  .editor-v2 .editor-canvas-chip {
    top: 12px;
  }

  .editor-v2 .editor-canvas-chip.compare {
    left: 12px;
  }

  .editor-v2 .editor-canvas-chip.lucky {
    right: 12px;
  }

  .editor-v2 .editor-inspector {
    padding: 22px 18px 110px;
    overflow: visible;
    border-top: 1px solid var(--editor-line);
    border-left: 0;
  }

  .editor-v2 .editor-empty {
    padding: 26px 20px;
  }
}

@media (max-width: 720px) {
  .editor-v2 .editor-toolbar {
    top: calc(58px + env(safe-area-inset-top));
  }
}

@media (max-width: 430px) {
  .editor-gallery-dishes {
    grid-template-columns: 1fr;
  }

  .editor-gallery-panel .editor-modal-actions {
    flex-wrap: wrap;
  }

  .editor-v2 .editor-tool {
    width: 40px;
    height: 40px;
  }

  .editor-v2 .editor-canvas {
    min-height: 58svh;
  }

  .editor-v2 .editor-canvas-chip {
    font-size: 9px;
  }

  .editor-v2 .editor-empty > div:last-child {
    flex-direction: column;
  }

  .editor-v2 .setting-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
  }

  .editor-v2 .dark-select,
  .editor-v2 .range {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .editor-v2 .editor-workflow {
    animation: none;
  }
}
