/* Полноэкранный редактор /editor/ (ADR 0011, вид и устройство панели — ADR 0021).
   Вид: светлый и лёгкий. Белые поверхности, нейтральная гамма, тонкие линии вместо рамок-коробок.
   Цвет несёт смысл: красный бренда — только главная кнопка Download, синий — только выбор (строка на
   превью, выбранный чип, фокус); всё нажатое в панели — чернила. Правила — docs/ux/editor-redesign.md. */

.e-page {
  /* гамма */
  --e-bg: #f7f7f5;        /* фон вокруг листа и под сегментами */
  --e-surface: #ffffff;   /* панель, шапка, плитки */
  --e-ink: #0d0d12;       /* текст и нажатое состояние */
  --e-ink-2: #44444d;     /* подписи ползунков */
  --e-muted: #8b8b94;     /* единицы, подсказки, заголовки групп */
  --e-hair: #ececea;      /* разделители */
  --e-line: #e0e0dd;      /* контур полей и плиток */
  --e-fill: #f3f3f1;      /* подложка сегментов, чипов, чисел */
  --e-sel: #2f5bea;       /* выбор и фокус */
  --e-sel-soft: #eaf0ff;
  /* шаг 4 px: 4 / 8 / 12 / 16 / 20 / 24 */
  --e-pad: 20px;
  /* радиусы: 8 — поля и кнопки, 12 — плитки и карточки, 20 — лист на телефоне, 999 — чипы */
  --e-r1: 8px; --e-r2: 12px; --e-r3: 20px;
  /* движение: короткое и мягкое; наведение и нажатие — 140 мс, раскрытие — 220 мс */
  --e-fast: 140ms cubic-bezier(0.2, 0, 0, 1);
  --e-slow: 220ms cubic-bezier(0.2, 0.8, 0.2, 1);
  --e-shadow: 0 1px 2px rgba(13, 13, 18, 0.06), 0 8px 24px rgba(13, 13, 18, 0.08);
  overflow: hidden; background: var(--e-bg); color: var(--e-ink);
  font: 400 14px/1.4 var(--text); -webkit-font-smoothing: antialiased;
}
.e-app { height: 100dvh; display: grid; grid-template-rows: auto minmax(0, 1fr); }
.e-app [hidden] { display: none !important; }
.e-app :is(button, a, .e-arrow) svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.e-app button { -webkit-tap-highlight-color: transparent; }
.e-app :focus-visible { outline: 2px solid var(--e-sel); outline-offset: 2px; }

/* ---------- шапка ---------- */
.e-top { display: flex; align-items: center; gap: 12px; height: 56px; padding: 0 16px; background: var(--e-surface); border-bottom: 1px solid var(--e-hair); }
.e-top .logo { gap: 10px; }
.e-top .logo-mark { font-size: 1.5rem; }
.e-top .logo-name { font-size: 0.72rem; padding-left: 10px; }
.e-back, .e-history button { display: grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: var(--e-r1); background: transparent; color: var(--e-ink); transition: background var(--e-fast), opacity var(--e-fast); }
.e-back:hover, .e-history button:hover:not(:disabled) { background: var(--e-fill); }
.e-history { display: flex; gap: 2px; margin-inline: auto; }
.e-history button:disabled { opacity: 0.28; cursor: default; }
.e-download { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 16px; border: 0; border-radius: 999px; background: var(--accent); color: #fff; font: 600 13px var(--text); transition: background var(--e-fast), transform var(--e-fast); }
.e-download:hover { background: var(--accent-dark); }
.e-download:active { transform: scale(0.97); }
.e-download:disabled { opacity: 0.6; cursor: progress; }
.e-ghost { height: 36px; padding: 0 14px; border: 1px solid var(--e-line); border-radius: 999px; background: var(--e-surface); font: 500 13px var(--text); white-space: nowrap; transition: background var(--e-fast); }
.e-ghost:hover { background: var(--e-fill); }

/* ---------- превью ---------- */
.e-main { display: grid; grid-template-columns: minmax(0, 1fr) 376px; grid-template-rows: minmax(0, 1fr); min-height: 0; }
.e-main > .e-stage { position: relative; min-height: 0; min-width: 0; margin: 0; } /* у разделов обычных страниц есть нижний отступ (site.css) */
.e-stage canvas { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }
.e-stage:focus { outline: none; }
.e-stage:focus-visible { outline: 2px solid var(--e-sel); outline-offset: -2px; }
.e-bgs { position: absolute; z-index: 1; left: 50%; bottom: 16px; transform: translateX(-50%); display: flex; gap: 8px; padding: 8px 10px; border-radius: 999px; background: rgba(255, 255, 255, 0.86); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); box-shadow: var(--e-shadow); }
.e-bgs .swatch { width: 24px; height: 24px; border-radius: 50%; border: 1px solid rgba(13, 13, 18, 0.14); padding: 0; transition: transform var(--e-fast), box-shadow var(--e-fast); }
.e-bgs .swatch:hover { transform: scale(1.12); }
.e-bgs .swatch[aria-pressed="true"] { box-shadow: 0 0 0 2px #fff, 0 0 0 3.5px var(--e-ink); }
.swatch-none { background: linear-gradient(135deg, #fff 45%, #e5484d 45% 55%, #fff 55%); }
.swatch-custom { position: relative; cursor: pointer; background: conic-gradient(#e5484d, #f1a33c, #f4d06f, #3c9a5f, #2f7fd0, #7b4fc0, #e5484d); box-shadow: inset 0 0 0 4px #fff, inset 0 0 0 30px var(--custom, transparent); }
.e-bgs .swatch-custom[aria-pressed="true"] { box-shadow: inset 0 0 0 4px #fff, inset 0 0 0 30px var(--custom), 0 0 0 2px #fff, 0 0 0 3.5px var(--e-ink); }
.swatch-custom input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; border: 0; padding: 0; }
.swatch-glow { background: radial-gradient(circle, #fff 30%, #c98bb6); }
.swatch-stars { background: radial-gradient(circle at 30% 35%, #fff 0 1.5px, transparent 2px), radial-gradient(circle at 65% 60%, #fff 0 1px, transparent 1.5px), radial-gradient(circle at 45% 75%, #fff 0 1px, transparent 1.5px), #0b0a1c; }
.e-bg-toggle { display: none; } /* кнопка фона — только на телефоне */

/* рамка и ручки выбранной строки (SVG поверх холста) */
.ed-overlay { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; overflow: visible; }
.ed-overlay[data-cursor="move"] { cursor: move; }
.ed-overlay[data-cursor="warp"], .ed-overlay[data-cursor="bend"] { cursor: crosshair; }
.ed-overlay[data-cursor="rot"] { cursor: grab; }
.ed-overlay[data-cursor="side"] { cursor: ew-resize; }
.ov-frame { fill: none; stroke: var(--e-sel); stroke-width: 1; stroke-dasharray: 4 3; opacity: 0.75; }
.ov-also { stroke-width: 1.5; opacity: 1; } /* рамка другой выбранной строки (Shift-клик) */
.ov-guide { fill: none; stroke: var(--e-sel); stroke-width: 1; opacity: 0.45; }
.ov-curve { fill: none; stroke: var(--e-sel); stroke-width: 1.5; }
.ov-corner { fill: #fff; stroke: var(--e-sel); stroke-width: 1.5; }
.ov-mid { fill: var(--e-sel); stroke: #fff; stroke-width: 1.5; }
.ov-sel { fill: var(--e-sel); stroke: var(--e-sel); stroke-width: 6; stroke-opacity: 0.3; paint-order: stroke; }
.ov-rot circle { fill: #fff; stroke: rgba(13, 13, 18, 0.1); stroke-width: 1; filter: drop-shadow(0 2px 4px rgba(13, 13, 18, 0.16)); }
.ov-rot path { fill: none; stroke: var(--e-ink); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
/* кнопки у выбранной строки на превью: копия, слои, удаление */
.e-linebar { position: absolute; z-index: 2; left: 0; top: 0; display: flex; gap: 2px; padding: 4px; border-radius: 10px; background: var(--e-surface); box-shadow: var(--e-shadow); }
.e-linebar button { display: grid; place-items: center; width: 34px; height: 34px; padding: 0; border: 0; border-radius: var(--e-r1); background: transparent; color: var(--e-ink); transition: background var(--e-fast); }
.e-linebar button:hover:not(:disabled) { background: var(--e-fill); }
.e-linebar button:disabled { opacity: 0.28; cursor: default; }

/* ---------- панель ---------- */
.e-panel { display: flex; flex-direction: column; min-height: 0; min-width: 0; background: var(--e-surface); border-left: 1px solid var(--e-hair); }
/* вкладки — сегменты: одна вкладка на экране и на компьютере, и на телефоне */
.e-tabs { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 2px; margin: 12px var(--e-pad) 0; padding: 3px; border-radius: 10px; background: var(--e-fill); }
.e-tabs button { height: 30px; border: 0; border-radius: 7px; background: transparent; color: var(--e-muted); font: 500 13px var(--text); transition: color var(--e-fast), background var(--e-fast), box-shadow var(--e-fast); }
.e-tabs button:hover { color: var(--e-ink); }
.e-tabs button[aria-selected="true"] { background: var(--e-surface); color: var(--e-ink); font-weight: 600; box-shadow: 0 1px 2px rgba(13, 13, 18, 0.1); }
/* что правим: вся надпись или строка */
.e-lines { display: flex; gap: 6px; padding: 12px var(--e-pad) 0; overflow-x: auto; scrollbar-width: none; }
.e-lines::-webkit-scrollbar, .e-fcats::-webkit-scrollbar { display: none; }
.e-chip { flex: none; max-width: 11em; height: 28px; padding: 0 11px; border: 1px solid var(--e-line); border-radius: 999px; background: var(--e-surface); color: var(--e-ink-2); font: 500 12.5px var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: border-color var(--e-fast), background var(--e-fast), color var(--e-fast); }
.e-chip:hover { border-color: #c4c4c0; }
.e-chip[aria-pressed="true"] { border-color: var(--e-sel); background: var(--e-sel-soft); color: var(--e-sel); font-weight: 600; }
.e-fcats .e-chip[aria-pressed="true"] { border-color: var(--e-ink); background: var(--e-ink); color: #fff; }

.e-body { flex: 1; min-height: 0; overflow-y: auto; padding: 16px var(--e-pad) 28px; scrollbar-width: thin; scrollbar-color: #d8d8d4 transparent; }
.e-sec { display: none; gap: 14px; align-content: start; }
.e-sec.is-tab { display: grid; animation: e-in var(--e-slow); }
@keyframes e-in { from { opacity: 0; transform: translateY(4px); } }
.e-head { display: flex; align-items: center; gap: 8px; margin-top: 6px; font: 600 11px var(--text); letter-spacing: 0.06em; text-transform: uppercase; color: var(--e-muted); }
.e-head:first-child { margin-top: 0; }
.e-label { font: 500 13px var(--text); color: var(--e-ink-2); }
.e-tag { padding: 1px 7px; border-radius: 999px; background: var(--e-fill); color: var(--e-muted); font: 500 10.5px/1.5 var(--text); letter-spacing: 0; text-transform: none; white-space: nowrap; }
.e-hint { margin: -4px 0 0; color: var(--e-muted); font-size: 12.5px; }

/* слова */
.e-words { position: relative; }
.e-words textarea { display: block; width: 100%; resize: none; padding: 10px 12px 10px 16px; border: 1px solid var(--e-line); border-radius: var(--e-r2); background: var(--e-surface); font: 500 15px/26px var(--text); color: var(--e-ink); white-space: pre; overflow: auto; scrollbar-width: none; transition: border-color var(--e-fast), box-shadow var(--e-fast); }
.e-words textarea:hover { border-color: #c4c4c0; }
.e-words textarea:focus { outline: none; border-color: var(--e-sel); box-shadow: 0 0 0 3px var(--e-sel-soft); }
/* метки выбранных строк у левого края поля */
.e-words-marks { position: absolute; inset: 0; overflow: hidden; pointer-events: none; border-radius: var(--e-r2); }
.e-words-marks i { position: absolute; left: 6px; width: 3px; border-radius: 2px; background: var(--e-sel); transform: scaleY(0.62); }

/* ползунок: подпись · дорожка · число с единицей */
.e-row { display: grid; grid-template-columns: 112px minmax(0, 1fr) 68px; align-items: center; gap: 12px; min-height: 32px; position: relative; }
.e-row label { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; font: 500 13px/1.25 var(--text); color: var(--e-ink-2); padding-right: 18px; }
.e-reset { position: absolute; left: 92px; top: 50%; translate: 0 -50%; display: grid; place-items: center; width: 22px; height: 22px; padding: 0; border: 0; border-radius: 6px; background: transparent; color: var(--e-muted); transition: background var(--e-fast), color var(--e-fast); }
.e-reset:hover { background: var(--e-fill); color: var(--e-ink); }
.e-app .e-reset svg { width: 13px; height: 13px; }
.e-row input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 24px; margin: 0; background: transparent; cursor: pointer; --p: 50%; }
.e-row input[type="range"]::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: linear-gradient(to right, var(--e-ink) var(--p), var(--e-line) var(--p)); }
.e-row input[type="range"]::-moz-range-track { height: 4px; border-radius: 2px; background: linear-gradient(to right, var(--e-ink) var(--p), var(--e-line) var(--p)); }
.e-row input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; margin-top: -6px; border-radius: 50%; background: #fff; border: 1px solid rgba(13, 13, 18, 0.16); box-shadow: 0 1px 3px rgba(13, 13, 18, 0.22); transition: transform var(--e-fast), box-shadow var(--e-fast); }
.e-row input[type="range"]::-moz-range-thumb { width: 16px; height: 16px; border-radius: 50%; background: #fff; border: 1px solid rgba(13, 13, 18, 0.16); box-shadow: 0 1px 3px rgba(13, 13, 18, 0.22); }
.e-row input[type="range"]:hover::-webkit-slider-thumb { transform: scale(1.12); }
.e-row input[type="range"]:active::-webkit-slider-thumb { transform: scale(1.2); box-shadow: 0 0 0 5px rgba(13, 13, 18, 0.08), 0 1px 3px rgba(13, 13, 18, 0.22); }
.e-num { display: flex; align-items: center; height: 30px; padding: 0 8px; border-radius: var(--e-r1); background: var(--e-fill); border: 1px solid transparent; transition: border-color var(--e-fast), background var(--e-fast); }
.e-num:focus-within { background: var(--e-surface); border-color: var(--e-sel); }
.e-num-in { width: 100%; min-width: 0; padding: 0; border: 0; background: transparent; font: 500 13px var(--text); font-variant-numeric: tabular-nums; text-align: right; -moz-appearance: textfield; appearance: textfield; }
.e-num-in:focus { outline: none; }
.e-num-in::-webkit-inner-spin-button, .e-num-in::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.e-unit { margin-left: 2px; color: var(--e-muted); font-size: 12px; }
.e-arrow { display: grid; place-items: center; color: var(--e-ink-2); rotate: var(--a, 0deg); }
.e-app .e-arrow svg { width: 13px; height: 13px; }

/* выбор из нескольких */
.e-field { display: grid; grid-template-columns: 112px minmax(0, 1fr); align-items: center; gap: 12px; }
.e-seg { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 2px; padding: 3px; border-radius: var(--e-r1); background: var(--e-fill); }
.e-seg button { height: 26px; padding: 0 6px; border: 0; border-radius: 6px; background: transparent; color: var(--e-ink-2); font: 500 12.5px var(--text); white-space: nowrap; transition: background var(--e-fast), color var(--e-fast), box-shadow var(--e-fast); }
.e-seg button:hover:not(:disabled) { color: var(--e-ink); background: rgba(255, 255, 255, 0.6); }
.e-seg button[aria-pressed="true"] { background: var(--e-surface); color: var(--e-ink); font-weight: 600; box-shadow: 0 1px 2px rgba(13, 13, 18, 0.1); }
.e-seg button:disabled { opacity: 0.35; cursor: default; }

/* действия со строкой */
.e-actions { display: flex; flex-wrap: wrap; gap: 6px; padding-top: 14px; border-top: 1px solid var(--e-hair); }
.e-btn { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px 0 10px; border: 1px solid var(--e-line); border-radius: var(--e-r1); background: var(--e-surface); color: var(--e-ink); font: 500 12.5px var(--text); transition: background var(--e-fast), border-color var(--e-fast), transform var(--e-fast); }
.e-btn:hover:not(:disabled) { background: var(--e-fill); border-color: #c4c4c0; }
.e-btn:active:not(:disabled) { transform: scale(0.97); }
.e-btn:disabled { opacity: 0.35; cursor: default; }
.e-app .e-btn svg { width: 15px; height: 15px; }

/* шрифт */
.e-font { display: grid; gap: 8px; }
.e-font-row { display: grid; grid-template-columns: 36px minmax(0, 1fr) 36px; gap: 6px; }
.e-font-row > button { display: grid; place-items: center; height: 52px; padding: 0; border: 1px solid var(--e-line); border-radius: var(--e-r2); background: var(--e-surface); color: var(--e-ink-2); transition: border-color var(--e-fast), background var(--e-fast); }
.e-font-row > button:hover { border-color: #c4c4c0; background: #fcfcfb; }
.e-font-cur { position: relative; }
.e-font-cur canvas { width: calc(100% - 36px); height: 44px; margin-right: 20px; }
.e-font-cur svg { position: absolute; right: 10px; top: 50%; translate: 0 -50%; color: var(--e-muted); transition: rotate var(--e-slow); }
.e-font-cur[aria-expanded="true"] svg { rotate: 180deg; }
.e-fonts { display: grid; gap: 8px; animation: e-in var(--e-slow); }
.e-fonts-head { display: none; }
/* компьютер: список шрифтов — своя колонка между превью и панелью */
.e-app.fonts-open .e-main { grid-template-columns: minmax(0, 1fr) 340px 376px; }
.e-main > .e-fonts { grid-template-rows: auto auto minmax(0, 1fr); align-content: start; min-height: 0; padding: 12px var(--e-pad) 0; background: var(--e-surface); border-left: 1px solid var(--e-hair); }
.e-main > .e-fonts .e-fonts-head { display: flex; justify-content: space-between; align-items: center; font: 600 15px var(--text); }
.e-fonts-head button { display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: var(--e-r1); background: transparent; color: var(--e-ink); }
.e-fonts-head button:hover { background: var(--e-fill); }
.e-main > .e-fonts .e-fcats { flex-wrap: wrap; }
.e-main > .e-fonts .e-font-grid { max-height: none; min-height: 0; padding-bottom: 20px; }
.e-fcats { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.e-font-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 6px; max-height: 312px; overflow-y: auto; padding: 1px; scrollbar-width: thin; scrollbar-color: #d8d8d4 transparent; }
.e-font-grid button { display: block; width: 100%; padding: 4px; border: 1px solid var(--e-line); border-radius: var(--e-r1); background: var(--e-surface); transition: border-color var(--e-fast); }
.e-font-grid button:hover { border-color: #c4c4c0; }
.e-font-grid button[aria-pressed="true"] { border-color: var(--e-ink); box-shadow: inset 0 0 0 1px var(--e-ink); }
.e-font-grid canvas { display: block; width: 100%; aspect-ratio: 2 / 1; }

/* стили и формы — плитки */
.e-style-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.style-btn { display: grid; gap: 5px; padding: 0 0 7px; border: 1px solid var(--e-line); border-radius: var(--e-r2); background: var(--e-surface); overflow: hidden; color: var(--e-ink-2); font: 500 11.5px var(--text); transition: border-color var(--e-fast), transform var(--e-fast); }
.style-btn canvas { display: block; width: 100%; aspect-ratio: 4 / 3; height: auto; border-radius: 8px; }
.style-btn span { padding: 0 4px; font-size: 0.78rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.style-btn:hover, .shape-btn:hover { border-color: #c4c4c0; }
.style-btn:active, .shape-btn:active { transform: scale(0.97); }
.style-btn[aria-pressed="true"], .shape-btn[aria-pressed="true"] { border-color: var(--e-ink); box-shadow: inset 0 0 0 1px var(--e-ink); color: var(--e-ink); font-weight: 600; }
.e-shape-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.shape-btn { display: grid; justify-items: center; gap: 4px; padding: 9px 2px 7px; border: 1px solid var(--e-line); border-radius: var(--e-r2); background: var(--e-surface); color: var(--e-ink-2); font: 500 11px/1.2 var(--text); transition: border-color var(--e-fast), transform var(--e-fast); }
.e-app .shape-btn svg { width: 36px; height: 22px; stroke-width: 1.5; }

/* цвета */
.e-colors { display: flex; flex-wrap: wrap; gap: 10px 12px; }
.e-color { display: grid; justify-items: center; gap: 5px; width: 48px; color: var(--e-ink-2); font-size: 11px; line-height: 1.2; text-align: center; cursor: pointer; }
.e-color input { -webkit-appearance: none; appearance: none; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 50%; background: none; cursor: pointer; box-shadow: 0 0 0 1px rgba(13, 13, 18, 0.14); transition: transform var(--e-fast), box-shadow var(--e-fast); }
.e-color input:hover { transform: scale(1.08); }
/* кружок палитры: открывает инструмент цвета; фон — сам цвет или градиент */
.e-color-swatch { width: 36px; height: 36px; padding: 0; border: 0; border-radius: 50%; cursor: pointer; box-shadow: 0 0 0 1px rgba(13, 13, 18, 0.14); transition: transform var(--e-fast); }
.e-color-swatch:hover { transform: scale(1.08); }
/* инструмент цвета: Solid / Linear / Radial, полоса с точками градиента */
.e-paint { position: fixed; z-index: 30; width: 300px; display: grid; gap: 12px; padding: 14px; border-radius: var(--e-r2); background: var(--e-surface); box-shadow: var(--e-shadow), 0 0 0 1px var(--e-hair); font: 400 13px/1.3 var(--text); color: var(--e-ink); }
.e-paint[hidden] { display: none; }
.e-paint-type { display: grid; grid-template-columns: repeat(3, 1fr); }
.e-paint-row { display: flex; align-items: center; gap: 8px; }
.e-paint-color { -webkit-appearance: none; appearance: none; width: 36px; height: 36px; padding: 0; border: 0; border-radius: var(--e-r1); background: none; cursor: pointer; box-shadow: 0 0 0 1px rgba(13, 13, 18, 0.14); }
.e-paint-color::-webkit-color-swatch-wrapper { padding: 0; }
.e-paint-color::-webkit-color-swatch { border: 0; border-radius: var(--e-r1); }
.e-paint-color::-moz-color-swatch { border: 0; border-radius: var(--e-r1); }
.e-paint-hex { width: 92px; height: 34px; padding: 0 10px; border: 1px solid var(--e-line); border-radius: var(--e-r1); font: 500 13px var(--text); text-transform: uppercase; }
.e-paint-hex:focus { outline: none; border-color: var(--e-sel); }
.e-paint-del { margin-left: auto; }
/* готовые градиенты: ряд кружков, клик ставит точки */
.e-paint-presets { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.e-paint-preset { aspect-ratio: 1; padding: 0; border: 0; border-radius: 50%; cursor: pointer; box-shadow: 0 0 0 1px rgba(13, 13, 18, 0.14); transition: transform var(--e-fast); }
.e-paint-preset:hover { transform: scale(1.1); }
.e-paint-gbar { position: relative; padding: 0 9px; }
.e-paint-bar { height: 24px; border-radius: 6px; cursor: copy; box-shadow: inset 0 0 0 1px rgba(13, 13, 18, 0.12); }
.e-paint-stops { position: absolute; inset: 0 9px; pointer-events: none; }
.e-paint-stop { position: absolute; top: 50%; width: 18px; height: 18px; translate: -50% -50%; padding: 0; border: 3px solid #fff; border-radius: 50%; box-shadow: 0 0 0 1px rgba(13, 13, 18, 0.3), 0 1px 3px rgba(13, 13, 18, 0.3); cursor: grab; pointer-events: auto; touch-action: none; }
.e-paint-stop[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--e-ink), 0 1px 3px rgba(13, 13, 18, 0.3); }
.e-paint-label { color: var(--e-ink-2); }
.e-paint-row .e-num-in { width: 64px; height: 34px; padding: 0 8px; border: 1px solid var(--e-line); border-radius: var(--e-r1); font: 500 13px var(--text); }
.e-paint-unit { color: var(--e-muted); margin-right: auto; }
.e-color input::-webkit-color-swatch-wrapper { padding: 0; }
.e-color input::-webkit-color-swatch { border: 0; border-radius: 50%; }
.e-color input::-moz-color-swatch { border: 0; border-radius: 50%; }

/* эффекты — карточки с выключателем */
.e-fx-list { display: grid; gap: 8px; }
.e-fx { border: 1px solid var(--e-line); border-radius: var(--e-r2); background: var(--e-surface); transition: border-color var(--e-fast), box-shadow var(--e-fast); }
.e-fx.is-on { border-color: var(--e-ink); }
.e-fx-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; border: 0; border-radius: var(--e-r2); background: transparent; text-align: left; }
.e-app .e-fx-head > svg { width: 22px; height: 22px; color: var(--e-ink-2); }
.e-fx-name { display: grid; gap: 1px; }
.e-fx-name strong { font: 600 13.5px var(--text); }
.e-fx-name small { color: var(--e-muted); font-size: 12px; line-height: 1.3; }
.e-switch { position: relative; width: 34px; height: 20px; border-radius: 999px; background: #d9d9d5; transition: background var(--e-slow); }
.e-switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(13, 13, 18, 0.25); transition: translate var(--e-slow); }
.e-fx-head[aria-pressed="true"] .e-switch { background: var(--e-ink); }
.e-fx-head[aria-pressed="true"] .e-switch::after { translate: 14px 0; }
.e-fx-body { display: none; gap: 10px; padding: 2px 14px 14px; }
.e-fx.is-on .e-fx-body { display: grid; animation: e-in var(--e-slow); }
.e-fx-body .e-row { grid-template-columns: 96px minmax(0, 1fr) 68px; }
.e-fx-body .e-reset { left: 76px; }

/* окно названия образца */
.e-dialog { width: min(400px, calc(100vw - 32px)); padding: 24px; border: 0; border-radius: var(--e-r3); background: var(--e-surface); color: var(--e-ink); box-shadow: 0 24px 60px rgba(13, 13, 18, 0.22); }
.e-dialog::backdrop { background: rgba(13, 13, 18, 0.3); }
.e-dialog h2 { margin: 0 0 4px; font: 600 17px var(--text); }
.e-dialog p { margin: 0 0 14px; color: var(--e-muted); font-size: 13px; }
.e-dialog input { width: 100%; height: 40px; padding: 0 12px; border: 1px solid var(--e-line); border-radius: var(--e-r1); font: 500 15px var(--text); }
.e-dialog input:focus { outline: none; border-color: var(--e-sel); box-shadow: 0 0 0 3px var(--e-sel-soft); }
.e-dialog-btns { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.e-dialog-btns button { height: 36px; padding: 0 16px; border: 1px solid var(--e-line); border-radius: 999px; background: var(--e-surface); font: 500 13px var(--text); }
.e-dialog-btns .e-dialog-ok { border-color: var(--e-ink); background: var(--e-ink); color: #fff; }

/* ---------- телефон: превью сверху, панель — лист снизу, вкладки у большого пальца ---------- */
@media (max-width: 860px) {
  .e-page { --e-pad: 16px; }
  .e-top { height: 56px; padding: 0 8px; gap: 4px; }
  /* Под палец (владелец 18 ноября: «кнопки и элементы мелкие для пальца»): всё, что нажимают, — не меньше 44×44 px
     (Apple HIG 44 pt, WCAG 2.5.5 — 44 CSS px; Material — 48 dp). Где кнопка видом меньше (сброс ползунка), её
     поле касания расширено невидимым ::after, чтобы не раздувать панель */
  .e-back, .e-history button { width: 44px; height: 44px; }
  .e-download { height: 44px; padding: 0 16px; }
  /* кнопки образцов (только у владельца) — значками в той же строке (владелец 18 ноября: «пространство
     эффективнее»). Подписи в кнопках остаются для экранного диктора, видно только значок. Подтверждение удаления —
     красный фон, «сохранено» — зелёный (data-flash ставит flash в editor-page.js) */
  .e-top .e-ghost { width: 44px; height: 44px; padding: 0; font-size: 0; color: transparent; position: relative; flex: none; }
  .e-top .e-ghost::before { content: ""; position: absolute; inset: 0; margin: auto; width: 18px; height: 18px; background: var(--e-ink); -webkit-mask: var(--ic) center / contain no-repeat; mask: var(--ic) center / contain no-repeat; }
  #ed-sample { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 3h11l3 3v15H5z'/%3E%3Cpath d='M8 3v6h8V3M8 21v-7h8v7'/%3E%3C/svg%3E"); }
  #ed-sample-del { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 7h16M10 11v6M14 11v6M6 7l1 13h10l1-13M9 7V4h6v3'/%3E%3C/svg%3E"); }
  #ed-sample-del[data-confirm="1"] { background: #e5484d; border-color: #e5484d; }
  #ed-sample-del[data-confirm="1"]::before, .e-top .e-ghost[data-flash]::before { background: #fff; }
  .e-top .e-ghost[data-flash] { background: #2f9e44; border-color: #2f9e44; }
  .e-top .logo { display: none; }
  .e-ghost { padding: 0 10px; font-size: 12px; }
  .e-main { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; }
  /* Фон — за кнопкой-кружком в правом нижнем углу превью (bgToggle в editor-page.js), ряд кружков открывается
     над ней сеткой по 6. Кружки 36 px с промежутком 8: вместе с промежутком палец попадает в квадрат 44 px */
  /* кружок — текущий фон в радужном кольце: кольцо видно и на фоне того же цвета, что и превью */
  .e-bg-toggle { display: block; position: absolute; z-index: 1; right: 12px; bottom: 28px; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; box-shadow: var(--e-shadow); background: conic-gradient(#e5484d, #f1a33c, #f4d06f, #3c9a5f, #2f7fd0, #7b4fc0, #e5484d); }
  .e-bg-toggle::after { content: ""; position: absolute; inset: 5px; border: 3px solid #fff; border-radius: 50%; background: var(--fill, #fff); }
  .e-bg-toggle.swatch-none { --fill: linear-gradient(135deg, #fff 45%, #e5484d 45% 55%, #fff 55%); }
  .e-bgs { display: none; left: auto; right: 12px; bottom: 82px; transform: none; grid-template-columns: repeat(6, 36px); gap: 8px; padding: 10px; border-radius: 22px; }
  .bgs-open .e-bgs { display: grid; }
  .e-bgs .swatch { width: 36px; height: 36px; }
  .e-panel { position: relative; z-index: 2; margin-top: -16px; border: 0; border-radius: var(--e-r3) var(--e-r3) 0 0; box-shadow: 0 -1px 0 var(--e-hair), 0 -12px 32px rgba(13, 13, 18, 0.07); height: 46dvh; }
  .e-lines { order: 1; padding-top: 14px; }
  .e-body { order: 2; padding: 12px var(--e-pad) 16px; }
  .e-tabs { order: 3; margin: 0; padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); border-radius: 0; background: var(--e-surface); border-top: 1px solid var(--e-hair); }
  .e-tabs button { height: 48px; border-radius: 12px; font-size: 14px; }
  .e-tabs button[aria-selected="true"] { background: var(--e-fill); box-shadow: none; }
  .e-chip { height: 40px; padding: 0 16px; font-size: 14px; }
  /* Ползунок на телефоне: подпись, сброс и число — строкой сверху, дорожка — на всю ширину под ними (владелец
     18 ноября: дорожку съедали подпись и поле числа). Тянется он только жестом вбок из любой точки строки
     (touchSlide в editor-page.js): касание дорожки не прыгает к пальцу, движение вверх-вниз листает панель */
  .e-row { grid-template-columns: minmax(0, 1fr) auto auto; grid-template-areas: "label reset num" "range range range"; row-gap: 0; column-gap: 6px; min-height: 0; touch-action: pan-y; }
  .e-row > label { grid-area: label; padding-right: 0; }
  .e-row > .e-reset { grid-area: reset; position: relative; left: auto; top: auto; translate: none; }
  .e-reset::after { content: ""; position: absolute; inset: -9px; }
  .e-row > input[type="range"] { grid-area: range; pointer-events: none; }
  .e-row > .e-num { grid-area: num; height: 44px; min-width: 64px; padding: 0 6px; background: transparent; }
  .e-num-in { height: 100%; }
  .e-row.is-sliding input[type="range"]::-webkit-slider-thumb { transform: scale(1.2); box-shadow: 0 0 0 6px rgba(13, 13, 18, 0.08), 0 1px 3px rgba(13, 13, 18, 0.22); }
  /* пояснения эффектов — только у включённых: у выключенных карточка в одну строку */
  .e-fx:not(.is-on) .e-fx-name small { display: none; }
  .e-fx-head { padding: 10px 14px; }
  .e-row input[type="range"] { height: 36px; }
  .e-row input[type="range"]::-webkit-slider-thumb { width: 22px; height: 22px; margin-top: -9px; }
  .e-row input[type="range"]::-moz-range-thumb { width: 22px; height: 22px; }
  .e-reset { width: 26px; height: 26px; }
  .e-num-in { font-size: 16px; } /* мельче 16 px — iOS приближает страницу при вводе */
  .e-words textarea { font-size: 16px; }
  .e-field { grid-template-columns: 96px minmax(0, 1fr); }
  .e-seg button { height: 40px; font-size: 14px; }
  .e-btn { height: 44px; }
  .e-color-swatch { width: 44px; height: 44px; }
  .e-fx-head { min-height: 52px; }
  /* шрифты и стили — ленты под пальцем: список шрифтов открыт всегда, стрелки и кнопка раскрытия не нужны */
  .e-font-row { display: none; }
  .e-app .e-fonts[hidden] { display: grid !important; }
  .e-font-grid { display: flex; max-height: none; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; margin-inline: calc(-1 * var(--e-pad)); padding-inline: var(--e-pad); }
  .e-font-grid li { flex: 0 0 116px; }
  .e-style-grid { display: flex; overflow-x: auto; scrollbar-width: none; margin-inline: calc(-1 * var(--e-pad)); padding-inline: var(--e-pad); }
  .style-btn { flex: 0 0 104px; }
  .e-shape-grid { display: flex; overflow-x: auto; scrollbar-width: none; margin-inline: calc(-1 * var(--e-pad)); padding-inline: var(--e-pad); }
  .shape-btn { flex: 0 0 68px; }
}
