/* Quick Markup (draw_on_photo). Цвета сняты пипеткой с макета владельца (2026-10-10).
   Токены — локальные, на корне инструмента; сайтовые не трогаем. */
.dop {
    --dop-ink: #1a263c;
    --dop-muted: #6b7280;
    --dop-line: #e7e9ee;
    --dop-soft: #f7f9fa;
    --dop-soft-2: #f0f1f6;
    --dop-accent: #f80102;
    --dop-accent-bg: #fee0e0;
    --dop-blue: #1764fc;
    --dop-blue-hover: #0f55e0;
    --dop-size-on: #e0e3e7;
    --dop-radius: 16px;
    --dop-btn-h: 44px;
    --dop-tool: 46px;
    --dop-swatch: 28px;
    --dop-gap: 14px;
    max-width: 1080px;
    margin-inline: auto;
    color: var(--dop-ink);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

.dop__card {
    background: #fff;
    border: 1px solid var(--dop-line);
    border-radius: var(--dop-radius);
    box-shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 6px 24px rgba(16, 24, 40, .05);
    padding: 16px 18px 14px;
}

.dop__ico { width: 22px; height: 22px; display: block; flex: none; }

/* ---------------- панель ----------------
   Десктоп: ряд с переносом. Слева блок "инструменты + ползунок толщины прямо под ними" (владелец
   2026-10-10), дальше цвета и действия. Не влезают (узкое окно, раскрыто "Ещё") — цвета и действия
   переносятся вторым рядом, а не наезжают на инструменты. Мобайл — колонка в порядке разметки (ниже). */
.dop__bar {
    display: flex; flex-wrap: wrap; align-items: flex-start;
    gap: 10px var(--dop-gap);
}
.dop__left { display: flex; flex-direction: column; flex: none; min-width: 240px; }  /* на под-странице видно 1-2 инструмента — ползунку всё равно нужна длина */
/* правый блок уже ряда действий (~390 px) — целиком уходит под инструменты */
.dop__right {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
    gap: 4px 10px; flex: 1 1 390px; min-width: 0;
}
.dop__group { display: flex; align-items: center; }
.dop__tools { gap: 4px; }
.dop__style {
    gap: 8px;
    padding-left: var(--dop-gap);
    border-left: 1px solid var(--dop-line);
    height: var(--dop-tool);
}
.dop__actions { gap: 5px; margin-left: auto; height: var(--dop-tool); }
/* цвета ушли под инструменты (флаг ставит JS): разделитель слева от них ни к чему */
.dop.is-bar-wrapped .dop__style { border-left: 0; padding-left: 0; }

.dop button { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }

.dop__tool {
    display: flex; flex-direction: column; align-items: center; gap: 4px;
    min-width: 50px; padding: 0; border: 0; background: none; color: var(--dop-ink); cursor: pointer;
}
.dop__tool-ico {
    display: flex; align-items: center; justify-content: center;
    width: var(--dop-tool); height: var(--dop-tool); border-radius: 50%;
    background: var(--dop-soft); border: 1px solid var(--dop-line);
    transition: background-color .12s, border-color .12s, color .12s;
}
.dop__tool-lbl { font-size: 12px; line-height: 1.1; color: var(--dop-muted); white-space: nowrap; }
.dop__tool:hover .dop__tool-ico { border-color: #d3d7de; }
.dop__tool.is-active .dop__tool-ico { background: var(--dop-accent-bg); border-color: var(--dop-accent-bg); color: var(--dop-accent); }
.dop__tool.is-active .dop__tool-lbl { color: var(--dop-accent); font-weight: 600; }

/* "Ещё ›": инструменты сверх видимых спрятаны и выезжают справа по нажатию. Выбранный из них
   остаётся на виду и после "Свернуть". */
.dop__tool--extra { display: none; }
.dop__tool--extra.is-active,
.dop.is-more-open .dop__tool--extra { display: flex; }
.dop.is-more-open .dop__tool--extra:not(.is-active) {
    animation: dop-slide-in .22s ease-out both;
    animation-delay: calc(var(--i, 0) * 35ms);
}
@keyframes dop-slide-in { from { opacity: 0; transform: translateX(-14px); } to { opacity: 1; transform: none; } }
.dop__more { order: 99; min-width: 40px; }          /* всегда последней: справа от всех инструментов */
.dop__more .dop__tool-ico { width: 34px; height: 34px; margin: calc((var(--dop-tool) - 34px) / 2) 0; color: var(--dop-muted); }
.dop__more .dop__ico { transition: transform .2s; }
.dop.is-more-open .dop__more .dop__ico { transform: rotate(180deg); }
@media (prefers-reduced-motion: reduce) {
    .dop.is-more-open .dop__tool--extra:not(.is-active) { animation: none; }
}

/* чипы-ссылки на под-страницы под инструментом (как "Готовые настройки" у tone_generator) */
.dop-subnav { margin: 14px 0 0; }
.dop-subnav__title { margin: 0 0 6px; font-size: 13px; color: var(--dop-muted, #666971); }
.dop-subnav__list { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.dop-subnav__item {
    display: inline-block; padding: 5px 10px; font-size: 13px; line-height: 1.2;
    color: #666971; text-decoration: none; background: transparent;
    border: 1px solid #e3e6eb; border-radius: 7px;
}
a.dop-subnav__item:hover { color: #1d1e22; background: #f4f6f9; }
.dop-subnav__item.is-current { color: #1d1e22; background: #eef1f5; border-color: #d6dbe2; font-weight: 600; }

.dop__colors { display: flex; align-items: center; gap: 6px; }

.dop__swatch {
    width: var(--dop-swatch); height: var(--dop-swatch); border-radius: 50%;
    background: var(--sw); border: 0; padding: 0; cursor: pointer;
    box-shadow: inset 0 0 0 1px rgba(16, 24, 40, .12);
    margin: 2px;
}
.dop__swatch.is-active {
    /* выделение формой (кольцо с просветом), а не только цветом */
    box-shadow: inset 0 0 0 1px rgba(16, 24, 40, .12), 0 0 0 3px #fff, 0 0 0 5px var(--sw);
}
.dop__swatch[data-color="#FFFFFF"].is-active,
.dop__swatch[data-color="#ffffff"].is-active {
    box-shadow: inset 0 0 0 1px #c9ced6, 0 0 0 3px #fff, 0 0 0 5px #9aa3b0;
}
.dop__swatch[data-color="#FFFFFF"], .dop__swatch[data-color="#ffffff"] { box-shadow: inset 0 0 0 1px #c9ced6; }

/* свой цвет: значок палитры; выбран — залит этим цветом и обведён кольцом, как обычный кружок */
.dop__swatch--custom {
    position: relative; display: inline-flex; align-items: center; justify-content: center;
    background: #fff; color: var(--dop-ink); box-shadow: inset 0 0 0 1px #c9ced6;
}
.dop__swatch--custom .dop__ico { width: 70%; height: 70%; stroke-width: 1.7; }
.dop__swatch--custom.is-active { background: var(--sw); color: #fff; }
.dop__swatch--custom.is-active.is-light { color: var(--dop-ink); }
.dop__custom-input {
    position: absolute; inset: 0; width: 100%; height: 100%;
    opacity: 0; border: 0; padding: 0; cursor: pointer;
}

/* толщина линии (или размер текста) — ползунок с образцом в текущем цвете */
.dop__thick {
    display: flex; align-items: center; gap: 10px;
    margin: 0; cursor: pointer;
}
.dop__sample {
    display: inline-flex; align-items: center; justify-content: center; flex: none;
    width: 30px; height: 22px; border-radius: 6px;
}
.dop__thick.is-light .dop__sample { background: #4b5563; }
.dop__sample-dot { display: block; border-radius: 50%; }
.dop__sample-aa { display: none; font-weight: 700; line-height: 1; letter-spacing: -.01em; }
.dop[data-tool="text"] .dop__sample-dot { display: none; }
.dop[data-tool="text"] .dop__sample-aa { display: inline; }
.dop__range { flex: 1 1 auto; min-width: 0; height: 22px; }
/* без браузерного/бутстраповского кольца фокуса вокруг бегунка (правило сайта, владелец 2026-10-10) */
.dop__range:focus, .dop__range:focus-visible { outline: none; box-shadow: none; }
.dop__range:focus::-webkit-slider-thumb { box-shadow: none; }
.dop__range:focus::-moz-range-thumb { box-shadow: none; }
.dop__custom-input:focus, .dop__custom-input:focus-visible { outline: none; box-shadow: none; }

/* Пустая область: главная кнопка — выбор файла (синяя), вставка из буфера — второстепенная ссылка
   (владелец 2026-10-10: серая кнопка "Вставить" выглядела главной, на неё хотелось нажать) */
.dop__btn.dop__choose {
    margin-top: 12px; height: 46px; padding: 0 22px; font-size: 16px;
    background: var(--dop-blue); border-color: var(--dop-blue); color: #fff;
}
.dop__drop:hover .dop__btn.dop__choose { background: var(--dop-blue-hover); border-color: var(--dop-blue-hover); }
.dop__paste {
    display: inline-flex; align-items: center; gap: 6px; margin-top: 4px; padding: 6px 10px;
    border: 0; border-radius: 8px; background: none; color: var(--dop-muted);
    font-size: 14px; font-weight: 500; cursor: pointer;
}
.dop__paste:hover { color: var(--dop-ink); background: rgba(16, 24, 40, .05); }
.dop__paste .dop__ico { width: 17px; height: 17px; }
.dop__paste-key { opacity: .75; }
.dop__paste-key::before { content: "· "; }
.dop__thick { gap: 6px; padding-top: 2px; }

/* кнопки действий */
.dop__btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    height: var(--dop-btn-h); padding: 0 16px; border-radius: 12px;
    border: 1px solid var(--dop-line); background: #fff; color: var(--dop-ink);
    font-size: 15px; font-weight: 600; line-height: 1; white-space: nowrap; cursor: pointer;
}
.dop__btn .dop__ico { width: 20px; height: 20px; }
.dop__btn:hover:not(:disabled) { border-color: #d3d7de; background: #fbfbfc; }
.dop__btn:disabled { opacity: .45; cursor: default; }
.dop__btn--icon { width: var(--dop-btn-h); padding: 0; }
/* десктоп: «Копировать» — значком с подсказкой, иначе панель не влезает в одну строку;
   на мобайле подпись возвращается (правило «подпись действия на телефоне не прятать») */
.dop__btn--copy { width: var(--dop-btn-h); padding: 0; }
.dop__btn--copy .dop__btn-lbl { display: none; }
.dop__actions .dop__btn--undo { padding: 0 12px; }
.dop__btn--dl { background: var(--dop-blue); border-color: var(--dop-blue); color: #fff; padding: 0 16px; }
.dop__btn--dl:hover:not(:disabled) { background: var(--dop-blue-hover); border-color: var(--dop-blue-hover); }
.dop__btn--soft { background: var(--dop-soft-2); border-color: var(--dop-soft-2); }
.dop__btn--soft:hover:not(:disabled) { background: #e6e8ef; border-color: #e6e8ef; }

.dop__only-mobile { display: none; }

/* ---------------- сцена ---------------- */
.dop__stage { position: relative; margin-top: 8px; }

.dop__drop {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
    min-height: 380px; margin: 0; padding: 24px;
    border: 2px dashed #d5d9e0; border-radius: 14px; background: #fafbfc;
    text-align: center; cursor: pointer; transition: border-color .12s, background-color .12s;
}
.dop__drop:hover, .dop.is-dragover .dop__drop { border-color: var(--dop-blue); background: #f2f6ff; }
.dop__drop-ico .dop__ico { width: 48px; height: 48px; color: #9aa3b0; stroke-width: 1.5; }
.dop__drop-main { font-size: 19px; font-weight: 700; margin-top: 6px; }
.dop__drop-sub { font-size: 15px; color: var(--dop-blue); font-weight: 600; }
.dop__drop-hint { font-size: 13px; color: var(--dop-muted); margin-top: 8px; }

.dop__wrap {
    position: relative; margin: 0 auto; display: none;
    /* лёгкая рамка: белое фото на белой карточке иначе без границ (тенью — не меняет размер) */
    border-radius: 10px; box-shadow: 0 0 0 1px rgba(15, 23, 42, .16);
    user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
}
.dop[data-state="edit"] .dop__wrap { display: block; }
.dop[data-state="edit"] .dop__drop { display: none; }
.dop.is-dragover .dop__wrap { outline: 3px dashed var(--dop-blue); outline-offset: 4px; }

.dop__layer {
    position: absolute; inset: 0; width: 100%; height: 100%;
    border-radius: 10px; display: block;
}
.dop__layer:first-child { background: #eef0f3; }
.dop__layer--live { touch-action: none; cursor: crosshair; }
.dop[data-tool="text"] .dop__layer--live { cursor: text; }

.dop__busy {
    position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
    background: rgba(255, 255, 255, .45); border-radius: 12px; color: var(--dop-blue); z-index: 6;
}
.dop__busy[hidden] { display: none; }

/* ---------------- редактор надписи — поверх фото, в масштабе экрана ----------------
   Ручки — кружки, центр ровно на углу области: ↖ сдвинуть, ↗ отмена, ↘ готово; слева — кружок
   цвета с палитрой; над областью — мини-панель: размер и стиль "Aa" (обычный / обводка / подложка).
   Стили повторяют то, что рисует холст (drawText): обводка — 0.12em наружу, подложка — 0.2em. */
.dop__ted { position: absolute; z-index: 5; --ted-gap: 4px; --ted-h: 30px; --ted-min-h: var(--ted-h); }
.dop__ted[hidden] { display: none; }
.dop__ted-input {
    display: inline-block; vertical-align: top; margin: 0; padding: 0; border: 0; background: transparent;
    outline: 1.5px dashed rgba(23, 100, 252, .95); outline-offset: var(--ted-gap);
    white-space: pre; caret-color: currentColor; cursor: text;
    min-width: calc(var(--ted-h) * 2.2);   /* ручки ↖ и ↗ не наезжают друг на друга и на мелкий текст */
    user-select: text; -webkit-user-select: text;   /* у сцены выделение выключено, в поле — нужно */
}
.dop__ted.is-area .dop__ted-input { display: block; white-space: pre-wrap; overflow-wrap: anywhere; }
.dop__ted-input:focus { outline: 1.5px dashed rgba(23, 100, 252, .95); box-shadow: none; }
.dop__ted-input:empty::before { content: attr(data-placeholder); opacity: .45; font-style: italic; pointer-events: none; }
.dop__ted.is-light[data-st="plain"] .dop__ted-input { text-shadow: 0 0 2px rgba(0, 0, 0, .35); }
.dop__ted[data-st="outline"] .dop__ted-input {
    text-shadow: .12em 0 0 var(--ted-ol), -.12em 0 0 var(--ted-ol), 0 .12em 0 var(--ted-ol), 0 -.12em 0 var(--ted-ol),
                 .085em .085em 0 var(--ted-ol), -.085em .085em 0 var(--ted-ol), .085em -.085em 0 var(--ted-ol), -.085em -.085em 0 var(--ted-ol);
}
.dop__ted[data-st="plate"] .dop__ted-input {
    background: var(--ted-plate); box-shadow: 0 0 0 .2em var(--ted-plate); border-radius: .1em;
}

.dop__ted-h {
    position: absolute; z-index: 2; width: var(--ted-h); height: var(--ted-h); padding: 0;
    transform: translate(-50%, -50%); border-radius: 50%;
    border: 1px solid var(--dop-line); background: #fff; color: var(--dop-ink);
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 2px 8px rgba(16, 24, 40, .18); cursor: pointer;
}
.dop__ted-h .dop__ico { width: 16px; height: 16px; }
.dop__ted-move { left: calc(-1 * var(--ted-gap)); top: calc(-1 * var(--ted-gap)); cursor: move; touch-action: none; }
.dop__ted-x { left: calc(100% + var(--ted-gap)); top: calc(-1 * var(--ted-gap)); }
/* "штучки" для растягивания: справа посередине (ширина), снизу посередине (высота), в углу ↘ (оба).
   Видимая часть маленькая, зона нажатия — больше (::before), чтобы попадать пальцем. */
.dop__ted-rs {
    position: absolute; z-index: 2; transform: translate(-50%, -50%);
    background: #fff; border: 1.5px solid var(--dop-blue); border-radius: 4px;
    box-shadow: 0 1px 4px rgba(16, 24, 40, .25); touch-action: none;
}
.dop__ted-rs::before { content: ""; position: absolute; inset: -10px; }
.dop__ted-rs--r  { left: calc(100% + var(--ted-gap)); top: 50%; width: 8px; height: 22px; cursor: ew-resize; }
.dop__ted-rs--b  { left: 50%; top: calc(100% + var(--ted-gap)); width: 22px; height: 8px; cursor: ns-resize; }
.dop__ted-rs--rb { left: calc(100% + var(--ted-gap)); top: calc(100% + var(--ted-gap)); width: 12px; height: 12px; cursor: nwse-resize; }
/* кружок цвета — слева от области, залит цветом надписи */
.dop__ted-color { left: calc(-1 * var(--ted-gap) - var(--ted-h) - 6px); top: 50%; }
.dop__ted-color-dot {
    width: 62%; height: 62%; border-radius: 50%; background: var(--sw, #f00);
    box-shadow: inset 0 0 0 1px rgba(16, 24, 40, .15);
}
.dop__ted-pal {
    position: absolute; z-index: 3; top: calc(50% + var(--ted-h) / 2 + 6px);
    left: calc(-1 * var(--ted-gap) - var(--ted-h) * 1.5 - 6px); transform: translateX(var(--dx, 0px));
    display: flex; gap: 6px; padding: 8px; background: #fff; border-radius: 14px;
    box-shadow: 0 6px 24px rgba(16, 24, 40, .2); border: 1px solid var(--dop-line);
}
.dop__ted-pal[hidden] { display: none; }
/* область у левого края экрана: кружок цвета — на свободном углу ↙, палитра — под ним */
.dop__ted.is-color-corner .dop__ted-color { left: calc(-1 * var(--ted-gap)); top: calc(100% + var(--ted-gap)); }
.dop__ted.is-color-corner .dop__ted-pal { left: calc(-1 * var(--ted-gap) - var(--ted-h) / 2); top: calc(100% + var(--ted-gap) + var(--ted-h) / 2 + 6px); }
.dop__ted-sw {
    position: relative; width: 28px; height: 28px; border-radius: 50%; border: 0; padding: 0; cursor: pointer;
    background: var(--sw); box-shadow: inset 0 0 0 1px rgba(16, 24, 40, .15);
    display: inline-flex; align-items: center; justify-content: center; flex: none;
}
.dop__ted-sw--custom { background: #fff; box-shadow: inset 0 0 0 1px #c9ced6; color: var(--dop-ink); }
.dop__ted-sw--custom .dop__ico { width: 70%; height: 70%; stroke-width: 1.7; }

/* мини-панель над областью: A ──○── A  и кнопка стиля */
.dop__ted-tools {
    position: absolute; z-index: 2; left: calc(-1 * var(--ted-gap) - var(--ted-h) / 2);
    bottom: calc(100% + var(--ted-gap) + var(--ted-h) / 2 + 8px); transform: translateX(var(--dx, 0px));
    display: flex; align-items: center; gap: 8px; padding: 5px 6px 5px 12px; white-space: nowrap;
    background: #fff; border-radius: 999px; border: 1px solid var(--dop-line);
    box-shadow: 0 4px 16px rgba(16, 24, 40, .16); color: var(--dop-ink);
}
.dop__ted.is-tools-below .dop__ted-tools { bottom: auto; top: calc(100% + var(--ted-gap) + var(--ted-h) / 2 + 8px); }
.dop__ted-a { font-weight: 700; line-height: 1; color: var(--dop-muted); }
.dop__ted-a--s { font-size: 11px; }
.dop__ted-a--l { font-size: 18px; }
.dop__ted-size { width: 120px; height: 20px; }
.dop__ted-size:focus, .dop__ted-size:focus-visible { outline: none; box-shadow: none; }
.dop__ted-size:focus::-webkit-slider-thumb { box-shadow: none; }
.dop__ted-style {
    width: 34px; height: 34px; border-radius: 50%; padding: 0; cursor: pointer;
    border: 1px solid var(--dop-line); background: var(--dop-soft);
    display: inline-flex; align-items: center; justify-content: center;
    font: 700 14px/1 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; color: var(--dop-ink);
}
/* кнопка показывает текущий стиль */
.dop__ted[data-st="outline"] .dop__ted-style span {
    color: #fff; text-shadow: 1px 0 0 #1a263c, -1px 0 0 #1a263c, 0 1px 0 #1a263c, 0 -1px 0 #1a263c;
}
.dop__ted[data-st="plate"] .dop__ted-style { background: #1a263c; border-color: #1a263c; color: #fff; }

/* ---------------- низ ---------------- */
.dop__foot { display: flex; align-items: center; gap: 14px; margin-top: 14px; min-height: 44px; }
.dop[data-state="empty"] .dop__foot .dop__btn { display: none; }
.dop[data-state="empty"] .dop__foot { min-height: 0; margin-top: 0; }
.dop[data-state="empty"] .dop__msg:not(:empty) { margin-top: 12px; }
.dop__msg { margin: 0; font-size: 14px; color: var(--dop-muted); }
.dop__msg.is-error { color: #c62828; }

.dop__diag {
    margin: 12px 0 0; padding: 10px; max-height: 260px; overflow: auto;
    background: #0f172a; color: #cbd5e1; font-size: 12px; border-radius: 8px; white-space: pre-wrap;
}

/* ---------------- мобайл: фото сверху, органы управления под ним ---------------- */
@media (max-width: 767.98px) {
    .dop { --dop-tool: 48px; --dop-swatch: 34px; --dop-btn-h: 48px; }
    .dop__card {
        display: flex; flex-direction: column;
        padding: 10px 10px calc(12px + env(safe-area-inset-bottom, 0px));
        border-radius: 14px;
    }
    .dop__stage { order: 1; margin-top: 0; }
    .dop__bar { order: 2; display: flex; flex-direction: column; flex-wrap: nowrap; align-items: stretch; gap: 12px; margin-top: 14px; min-width: 0; }
    .dop__foot { order: 3; margin-top: 8px; min-height: 0; flex-wrap: wrap; row-gap: 6px; }
    .dop__msg { flex: 1 1 100%; }   /* подсказка — своей строкой, а не узкой колонкой рядом с кнопкой */
    .dop__diag { order: 4; }

    .dop__drop { min-height: 300px; }
    .dop__drop-hint { display: none; }

    /* ряд инструментов: делят ширину поровну; после "Ещё ›" не влезают — ряд прокручивается вбок */
    .dop__tools {
        justify-content: flex-start; overflow-x: auto; overscroll-behavior-x: contain; min-width: 0; gap: 0;
        scrollbar-width: none; -webkit-overflow-scrolling: touch;
    }
    .dop__tools::-webkit-scrollbar { display: none; }
    .dop__left, .dop__right { display: contents; }
    .dop__style, .dop__actions { height: auto; }
    /* свёрнуто — равные ячейки, подпись может свеситься за края поровну; раскрыто "Ещё" — ячейки по подписи, ряд прокручивается */
    .dop__tool, .dop__more { flex: 1 1 0; min-width: 46px; max-width: 64px; padding: 0; }
    .dop.is-more-open .dop__tool { flex: 0 0 auto; padding: 0 4px; }
    .dop__more .dop__tool-ico { width: var(--dop-tool); height: var(--dop-tool); margin: 0; }
    .dop__tool-lbl { font-size: 12px; }

    .dop__style {
        justify-content: space-between; padding: 12px 0 0; border-left: 0;
        border-top: 1px solid var(--dop-line);
    }
    /* цвета — своей строкой: кружки крупнее, ползунок толщины — прямо под инструментами */
    .dop__colors { width: 100%; justify-content: space-between; gap: 0; }
    .dop__thick { padding: 0 4px; }
    .dop__bar { gap: 8px; }

    .dop__actions {
        margin-left: 0; padding-top: 12px; border-top: 1px solid var(--dop-line);
        display: grid; gap: 8px;
        grid-template-columns: auto var(--dop-btn-h) minmax(0, 1fr);
        grid-template-areas: "undo redo another" "copy dl dl";
    }
    .dop__btn { font-size: 15px; padding: 0 10px; gap: 6px; }
    /* у "Другое фото" на телефоне только подпись: значок съедал место, и длинная подпись (RU) обрезалась */
    .dop__btn--another .dop__ico { display: none; }
    .dop__btn--undo { grid-area: undo; }
    .dop__btn--icon { grid-area: redo; }
    .dop__btn--another { grid-area: another; }
    .dop__btn--copy { grid-area: copy; width: auto; padding: 0 12px; }
    .dop__btn--copy .dop__btn-lbl { display: inline; }
    .dop__btn--dl { grid-area: dl; }
    .dop__btn-lbl { overflow: hidden; text-overflow: ellipsis; }
    .dop__only-mobile { display: inline-flex; }
    .dop__only-desktop { display: none !important; }
    .dop__msg:empty { display: none; }

    /* редактор надписи под палец: ручки крупнее, Ctrl+V на телефоне ни к чему */
    .dop__ted { --ted-h: 36px; }
    .dop__ted-h .dop__ico { width: 18px; height: 18px; }
    .dop__ted-size { width: 100px; }
    .dop__ted-style { width: 36px; height: 36px; }
    .dop__ted-sw { width: 32px; height: 32px; }
    .dop__paste-key { display: none; }
}

@media (max-width: 374.98px) {
    .dop { --dop-swatch: 32px; }
    .dop__card { padding-left: 8px; padding-right: 8px; }
    .dop__tool-lbl { font-size: 10.5px !important; }  /* ES "Marcador" и "Recuadro" на 360 px; с кнопкой "Ещё" ячейка 44 px */
    .dop__btn { font-size: 14px; padding: 0 8px; gap: 6px; }
}

/* телефоны до 420 px: шесть инструментов + "Ещё" в один ряд без прокрутки */
@media (max-width: 419.98px) {
    .dop { --dop-tool: 44px; }
    .dop__tool, .dop__more { min-width: 44px; }
    .dop__tool-lbl { font-size: 11px; letter-spacing: -.01em; }
}
