/* Панель управления (/admin): лёгкий светлый десктопный стиль. */

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #f4f5f7; color: #1c1e21; line-height: 1.5;
}
a { color: #2264ab; text-decoration: none; }

.layout { display: flex; min-height: 100vh; }
.sidebar {
    width: 220px; flex-shrink: 0; background: #1f2633; color: #dfe4ea;
    display: flex; flex-direction: column; padding: 18px 14px;
}
.sidebar__brand { font-weight: 800; font-size: 1.05rem; margin-bottom: 22px; }
.sidebar__brand small { font-weight: 400; color: #8b94a3; }
.sidebar__nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.sidebar__nav a {
    color: #dfe4ea; padding: 9px 10px; border-radius: 8px; font-size: 0.95rem;
}
.sidebar__nav a:hover { background: rgba(255, 255, 255, 0.08); }
.sidebar__nav a.is-active { background: #2264ab; color: #fff; }
.sidebar__logout {
    margin-top: 16px; background: none; border: 1px solid #414b5c;
    color: #8b94a3; border-radius: 8px; padding: 8px; cursor: pointer; font: inherit;
}

.content { flex: 1; padding: 26px 30px; max-width: 1080px; }
.content h1 { font-size: 1.5rem; margin-bottom: 8px; }
.content h2 { font-size: 1.15rem; margin: 22px 0 10px; }
.content h3 { font-size: 0.98rem; margin: 14px 0 4px; }
.muted { color: #6a7280; font-size: 0.92rem; }
.warn { color: #c0392b; }

.btn {
    font: inherit; padding: 9px 16px; border: 1px solid #cfd4dc;
    border-radius: 8px; background: #fff; cursor: pointer;
}
.btn--primary { background: #2264ab; border-color: #2264ab; color: #fff; }
.btn:disabled { opacity: 0.5; cursor: default; }
.link { background: none; border: none; color: #2264ab; cursor: pointer;
    font: inherit; font-size: 0.9rem; padding: 0; }
.input {
    font: inherit; padding: 9px 12px; border: 1px solid #cfd4dc;
    border-radius: 8px; background: #fff; width: 100%; max-width: 420px;
}
textarea.input { max-width: 640px; }
.form-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
    margin-top: 10px; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px; margin: 16px 0; }
.card { background: #fff; border-radius: 12px; padding: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06); color: #6a7280; }
.card__num { font-size: 1.6rem; font-weight: 800; color: #1c1e21; }

.table { border-collapse: collapse; margin-top: 10px; background: #fff;
    border-radius: 10px; overflow: hidden; width: 100%; max-width: 720px; }
.table td, .table th { padding: 10px 14px; border-bottom: 1px solid #eef0f3;
    text-align: left; font-size: 0.94rem; }

.panel { background: #fff; border-radius: 12px; padding: 16px 18px;
    margin-top: 14px; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06); }
.panel .row { display: flex; justify-content: space-between; gap: 10px;
    align-items: center; padding: 3px 0; }
.panel .child { margin: 8px 0 0 16px; padding-left: 12px;
    border-left: 2px solid #eef0f3; }
.popbox { border: 2px solid #2264ab; }
.picklist { display: flex; flex-direction: column; gap: 6px; margin-top: 8px;
    max-height: 300px; overflow-y: auto; }
.picklist button { text-align: left; font: inherit; background: #f4f5f7;
    border: none; border-radius: 8px; padding: 9px 12px; cursor: pointer; }
.picklist button.is-active { background: #2264ab; color: #fff; }
.picklist button small { display: block; opacity: 0.7; }

/* Референсы */
.tagbar { display: flex; gap: 8px; flex-wrap: wrap; margin: 14px 0; }
.tag { background: #fff; border-radius: 999px; padding: 5px 12px;
    font-size: 0.88rem; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06); }
.tag.is-active { background: #2264ab; color: #fff; }
.refgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 14px; margin-top: 8px; }
.ref { position: relative; background: #fff; border-radius: 12px;
    overflow: hidden; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06); color: inherit; }
.ref__img { width: 100%; aspect-ratio: 3/4; object-fit: cover; display: block; }
.ref__badge { position: absolute; top: 8px; left: 8px; background: rgba(0,0,0,0.65);
    color: #fff; font-size: 0.72rem; border-radius: 999px; padding: 2px 9px; }
.ref__badge--fail { background: #c0392b; }
.ref__body { display: block; padding: 8px 10px 10px; }
.ref__tags i { font-style: normal; font-size: 0.76rem; background: #eef0f3;
    border-radius: 999px; padding: 1px 8px; margin-right: 4px; }
.ref__palette { display: flex; gap: 4px; margin-top: 6px; }
.ref__palette b { width: 18px; height: 18px; border-radius: 4px; display: block;
    border: 1px solid rgba(0, 0, 0, 0.08); }

.refdetail { display: grid; grid-template-columns: 340px 1fr; gap: 24px;
    margin-top: 14px; }
.refdetail__img { width: 100%; border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1); }
.palette-row { display: flex; flex-direction: column; gap: 4px; }
.swatch b { width: 16px; height: 16px; display: inline-block; border-radius: 4px;
    vertical-align: -2px; margin-right: 4px; border: 1px solid rgba(0,0,0,0.1); }
.promptbox { background: #fff; border-radius: 10px; padding: 12px;
    font-size: 0.82rem; white-space: pre-wrap; word-break: break-word;
    max-width: 640px; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06); }

/* Логин */
.login-body { display: flex; align-items: center; justify-content: center;
    min-height: 100vh; }
.login-card { background: #fff; border-radius: 14px; padding: 34px 38px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1); width: 340px; text-align: center; }
.login-card h1 { font-size: 1.3rem; }
.login-card form { display: flex; flex-direction: column; gap: 10px;
    margin-top: 18px; }
.error { color: #c0392b; font-size: 0.9rem; }

@media (max-width: 760px) {
    .layout { flex-direction: column; }
    .sidebar { width: 100%; flex-direction: row; align-items: center;
        overflow-x: auto; }
    .sidebar__nav { flex-direction: row; }
    .sidebar__brand { margin: 0 14px 0 0; white-space: nowrap; }
    .refdetail { grid-template-columns: 1fr; }
}

.ref__subject { display: block; font-weight: 700; font-size: 0.85rem;
    margin-bottom: 4px; }

/* Конструктор воронки */
.prodpick { display: flex; flex-direction: column; gap: 10px; margin-top: 12px;
    max-width: 720px; }
.prodpick__item { display: flex; align-items: center; gap: 14px; background: #fff;
    border-radius: 12px; padding: 10px 14px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06); }
.prodpick__item img { width: 56px; height: 56px; object-fit: cover;
    border-radius: 8px; flex-shrink: 0; }
.prodpick__nophoto { width: 56px; height: 56px; border-radius: 8px;
    background: #eef0f3; color: #6a7280; font-size: 0.7rem; display: flex;
    align-items: center; justify-content: center; text-align: center;
    flex-shrink: 0; }
.prodpick__meta { flex: 1; display: flex; flex-direction: column;
    font-size: 0.92rem; }
.thumb { width: 44px; height: 44px; object-fit: cover; border-radius: 6px;
    display: block; }
/* Массовые действия в «Генерации» */
.batch { max-width: 720px; margin-top: 12px; }
.bsel { width: 18px; height: 18px; flex-shrink: 0; cursor: pointer; }
.prodpick__item.is-selected { outline: 2px solid #2f6fed; }
[data-role="batch-state"] { font-size: 12px; min-height: 0; }
[data-role="batch-state"]:empty { display: none; }
.bstate--done { color: #1e7f3a; }
.bstate--failed { color: #b42318; }
.bstate--skipped, .bstate--queued { color: #6a7280; }
.bstate--running { color: #2f6fed; }

/* Слайды: компактные карточки слева направо (как в конструкторах воронок) */
.slides { display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 14px; margin-top: 18px; align-items: start; }
.slide { background: #fff; border-radius: 12px; padding: 12px 14px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06); }
.slide--main { outline: 2px solid #2264ab; }
.slide__head { display: flex; justify-content: space-between;
    align-items: center; }
.slide__preview { position: relative; margin-top: 8px; }
.slide__result { width: 100%; aspect-ratio: 3/4; object-fit: cover;
    border-radius: 10px; display: block; background: #f4f5f7; }
.slide__pip { position: absolute; left: 8px; bottom: 8px; width: 64px;
    aspect-ratio: 1/1; object-fit: cover; border-radius: 8px;
    border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3); }
.slide__empty { width: 100%; aspect-ratio: 3/4; border-radius: 10px;
    background: #f4f5f7; border: 1px dashed #cfd4dc; color: #6a7280;
    font-size: 0.82rem; display: flex; align-items: center;
    justify-content: center; text-align: center; padding: 10px; }
.slide__fields { display: flex; flex-direction: column; gap: 6px;
    margin-top: 10px; }
.slide__fields .input, .slide__fields textarea { max-width: none;
    font-size: 0.88rem; padding: 7px 10px; }
.slide__fields label.muted { font-size: 0.78rem; margin-top: 2px; }
[data-role="slide-offers"] { display: flex; flex-direction: column; gap: 6px; }
.form-row--tight { gap: 6px; margin-top: 8px; }
.btn--sm { padding: 6px 10px; font-size: 0.85rem; }
.qty { display: inline-flex; align-items: center; gap: 2px;
    border: 1px solid #cfd4dc; border-radius: 8px; background: #fff; }
.qty button { font: inherit; border: none; background: none; cursor: pointer;
    padding: 5px 9px; font-size: 0.95rem; color: #2264ab; }
.qty b { min-width: 16px; text-align: center; font-size: 0.9rem; }
.advice { background: #fff8e6; border: 1px solid #f0dfae; border-radius: 10px;
    padding: 8px 10px; margin-top: 8px; font-size: 0.85rem; }
.advice__actions { display: flex; gap: 12px; margin-top: 6px; }

.progressbox { background: #fff; border-radius: 12px; padding: 14px 18px;
    margin-top: 16px; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06); }
.progressbox__label { font-size: 0.92rem; }
.progressbar { height: 10px; background: #eef0f3; border-radius: 999px;
    margin-top: 10px; overflow: hidden; }
.progressbar__fill { height: 100%; background: #2264ab; border-radius: 999px;
    width: 0; transition: width 0.6s ease; }
.progressbox__status { margin-top: 6px; font-size: 0.85rem; }

.slide__badge { position: absolute; top: 8px; right: 8px;
    background: rgba(34, 100, 171, 0.9); color: #fff; font-size: 0.72rem;
    border-radius: 999px; padding: 3px 9px; }
.slide__pick { display: flex; align-items: center; gap: 6px; margin-top: 8px;
    font-size: 0.88rem; cursor: pointer; }
.exportbar { background: #eef4fa; border-radius: 10px; padding: 10px 14px; }

.mainrefs { margin-top: 10px; font-size: 0.85rem; }
.mainrefs__row { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.mainrefs__row img { width: 52px; height: 52px; object-fit: cover;
    border-radius: 8px; cursor: pointer; opacity: 0.45;
    border: 2px solid transparent; }
.mainrefs__row img.is-on { opacity: 1; border-color: #2264ab; }

.photodl { display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px; margin-top: 14px; }
.photodl__item { display: block; background: #fff; border-radius: 10px;
    overflow: hidden; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    cursor: pointer; }
.photodl__item img { width: 100%; aspect-ratio: 1/1; object-fit: cover;
    display: block; }
.photodl__meta { display: flex; align-items: center; gap: 6px;
    padding: 7px 9px; font-size: 0.85rem; }

.toggle { font: inherit; font-size: 0.8rem; font-weight: 700;
    border: 1px solid #cfd4dc; border-radius: 999px; padding: 5px 14px;
    background: #eef0f3; color: #6a7280; cursor: pointer; min-width: 64px; }
.toggle--on { background: #1e7e34; border-color: #1e7e34; color: #fff; }

.refpick__current { display: flex; align-items: center; gap: 10px;
    font-size: 0.9rem; }
.refpick__current img { width: 48px; height: 64px; object-fit: cover;
    border-radius: 8px; }
.refpick__list { display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 8px; margin-top: 10px; }
.refpick__item { display: flex; gap: 10px; align-items: center;
    text-align: left; font: inherit; background: #f4f5f7; border: none;
    border-radius: 10px; padding: 8px 10px; cursor: pointer; }
.refpick__item:hover { background: #e8ecf1; }
.refpick__item img { width: 44px; height: 58px; object-fit: cover;
    border-radius: 6px; flex-shrink: 0; }
.refpick__item small { display: block; color: #6a7280; }

.framegrid { display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 8px; margin-top: 8px; }
.framegrid img { width: 100%; aspect-ratio: 1/1; object-fit: cover;
    border-radius: 8px; cursor: pointer; }
.framegrid img.is-used { outline: 3px solid #2264ab; opacity: 0.55; }

.okbadge { font-size: 0.8rem; background: #e6f4ea; color: #1e7e34;
    border-radius: 999px; padding: 3px 10px; margin-left: 8px;
    font-weight: 400; vertical-align: 2px; }
.history { margin-top: 10px; font-size: 0.85rem; }
.history__row { display: flex; gap: 8px; margin-top: 6px; flex-wrap: wrap; }
.history__row img { width: 64px; aspect-ratio: 3/4; object-fit: cover;
    border-radius: 8px; cursor: pointer; border: 2px solid transparent; }
.history__row img:hover { border-color: #2264ab; }
.slide__imgs img { aspect-ratio: auto; max-height: 340px; object-fit: contain;
    background: #f4f5f7; }

/* Поддержка */
.unreadpill { background: #c0392b; color: #fff; border-radius: 999px;
    font-size: 0.72rem; padding: 1px 7px; margin-left: 6px; }
.athread { display: flex; flex-direction: column; gap: 8px; max-width: 640px;
    margin-top: 12px; }
.amsg { background: #fff; border-radius: 10px; padding: 9px 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06); align-self: flex-start;
    max-width: 90%; font-size: 0.92rem; }
.amsg--out { background: #2264ab; color: #fff; align-self: flex-end; }
.amsg__meta { font-size: 0.72rem; opacity: 0.65; margin-top: 4px; }

/* Карточки генераций главного кадра: снапшот условий + статус/результат */
.runs { grid-column: 1 / -1; margin-top: 8px; }
.run { display: flex; align-items: center; gap: 10px; padding: 6px 0;
    border-top: 1px dashed var(--border, #e2e2e6); }
.run__img, .run__ph { width: 72px; height: 96px; object-fit: cover;
    border-radius: 8px; flex: none; }
.run__ph { display: flex; flex-direction: column; align-items: center;
    justify-content: center; background: var(--panel2, #f2f2f5);
    font-size: 20px; text-align: center; }
.run__meta { display: flex; flex-direction: column; gap: 2px;
    align-items: flex-start; }

/* Полноразмерная карточка генерации в сетке слайдов (рядом с черновиком) */
.slide--run { outline: 2px dashed var(--accent, #2481cc); outline-offset: -2px; }
.slide--run .slide__head small { max-width: 100%; white-space: normal; }

/* Живой индикатор на карточке генерации */
.runbar { width: 80%; height: 6px; margin: 0 auto 10px; border-radius: 4px;
    background: var(--panel2, #e8e8ee); overflow: hidden; }
.runbar__fill { width: 40%; height: 100%; border-radius: 4px;
    background: var(--accent, #2481cc); animation: runslide 1.4s ease-in-out infinite; }
@keyframes runslide {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(250%); }
}

/* Герой-ряд: черновик слева, колонка генераций справа (как у Convertis) */
.herowrap { grid-column: 1 / -1; display: grid;
    grid-template-columns: minmax(320px, 440px) 1fr;
    gap: 16px; align-items: start; }
.herowrap__draft .slide { width: 100%; }
/* Автозаполняющаяся сетка: колонок столько, сколько помещается по
   ширине (minmax 240px), лишние карточки переносятся на новую строку —
   при изменении окна пересчитывается само (repeat(auto-fill, …)). */
.herowrap__gens { display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 12px; align-content: start; }
.herowrap__genshead { grid-column: 1 / -1; }
.herowrap__genshead small { display: block; margin-top: 2px; }
.herowrap__gens > p { grid-column: 1 / -1; }
.herowrap__gens .slide--run { width: auto; margin: 0; }
@media (max-width: 900px) {
    .herowrap { grid-template-columns: 1fr; }
}

/* Страница воронки использует всю ширину окна: общий потолок 1080px
   оставляет место двум колонкам генераций даже на широком мониторе
   (скрин Романа 2026-09-15). :has() — современные браузеры, админка. */
.content:has(.herowrap) { max-width: 1700px; }

/* Карточка товара из редактора воронки */
.cardform { display: flex; flex-direction: column; gap: 8px; max-width: 900px; }
.cardform label { display: flex; flex-direction: column; gap: 3px; font-size: 0.85rem;
    color: #4a5260; flex: 1; min-width: 180px; position: relative; }
.cardform__row { display: flex; gap: 10px; flex-wrap: wrap; }
.cardform__dims { display: flex; gap: 4px; }
.cardform__dims .input { width: 80px; }
#card-box [data-role="subject-hits"] { position: absolute; top: 100%; left: 0; right: 0;
    z-index: 5; background: #fff; max-height: 260px; overflow: auto; }

/* Массовая правка бренда */
.brandgrp { border-bottom: 1px solid #eef0f3; padding: 6px 0; }
.brandgrp summary { cursor: pointer; }
.brandgrp__list { display: flex; flex-direction: column; gap: 2px; padding: 6px 0 4px 24px; font-size: 0.9rem; }
.catcode { width: 48px; text-transform: uppercase; text-align: center; padding: 4px; }

/* Логотипы брендов на слайдах */
.logo-lib { display: flex; gap: 8px; flex-wrap: wrap; margin: 6px 0; }
.logo-pick { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px;
    border: 2px solid #e3e6ea; border-radius: 8px; background: #fafbfc; cursor: pointer; width: 96px; }
.logo-pick img { max-width: 80px; max-height: 48px; object-fit: contain; }
.logo-pick.is-on { border-color: #2264ab; }

/* Раскадровка */
.sbtable { width: 100%; table-layout: auto; }
.sbtable td { vertical-align: top; }
.sbtable textarea, .sbtable input { width: 100%; min-width: 120px; font-size: 0.85rem; box-sizing: border-box; }
.sbtable textarea { overflow-y: hidden; resize: vertical; min-height: 2.6em; }
.sbtable td:nth-child(3) textarea, .sbtable td:nth-child(4) textarea { min-width: 200px; }
.sbtable .sb-check { margin-top: 6px; white-space: nowrap; }
.sbtable td:nth-child(5) textarea, .sbtable td:nth-child(6) textarea { min-width: 180px; }

/* Правка выводов анализа лидеров */
.brief-edit__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.brief-edit__grid label { display: flex; flex-direction: column; gap: 3px; font-size: 0.85rem; color: #4a5260; }
.brief-edit textarea { font-size: 0.85rem; }

/* Выбор фото миниатюрами (раскадровка) */
.photopick { position: relative; }
.photopick__cur { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 3px;
    border: 1px solid #d6dbe1; border-radius: 8px; background: #fff; cursor: pointer; min-width: 64px; }
.photopick__cur img { width: 60px; height: 60px; object-fit: cover; border-radius: 6px; }
.photopick__cur small { font-size: 11px; color: #6a7280; text-align: center; }
.photopick__grid { position: absolute; z-index: 10; top: 100%; left: 0; margin-top: 4px; padding: 6px;
    display: grid; grid-template-columns: repeat(4, 72px); gap: 6px; background: #fff;
    border: 1px solid #d6dbe1; border-radius: 10px; box-shadow: 0 6px 18px rgba(0,0,0,.12); }
.photopick__grid[hidden] { display: none; }   /* display:grid иначе перебивает hidden */
.photopick__opt { padding: 0; border: 2px solid transparent; border-radius: 8px; background: none; cursor: pointer; }
.photopick__opt img { width: 68px; height: 68px; object-fit: cover; border-radius: 6px; display: block; }
.photopick__opt.is-on { border-color: #2264ab; }

/* Фото товара */
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 12px; }
.media-card.is-primary { outline: 2px solid #2264ab; }
.media-card__head { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.media-card__pair { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.media-card__pair figure { margin: 0; }
.media-card__pair img { width: 100%; aspect-ratio: 1; object-fit: contain; background: #f3f5f7; border-radius: 8px; }
.media-card__none { aspect-ratio: 1; display: flex; align-items: center; justify-content: center;
    background: #f3f5f7; border-radius: 8px; color: #6a7280; font-size: 0.85rem; }
.media-card__actions { margin-top: 8px; flex-wrap: wrap; }
.media-card__versions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.media-card__versions figure { margin: 0; width: 96px; text-align: center; font-size: 11px; }
.media-card__versions img { width: 96px; height: 96px; object-fit: contain; background: #f3f5f7; border-radius: 6px; }
.media-strip { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.media-strip img { width: 56px; height: 56px; object-fit: cover; border-radius: 6px; }
.media-strip .st { font-size: 11px; display: block; text-align: center; }

/* --- Воронка: путь из пяти шагов и мастер-кадр (Роман 19.10) --- */
.stepper { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 8px 0 4px; }
.stepper__item { display: inline-flex; gap: 6px; align-items: center; padding: 6px 12px;
    border: 1px solid #d0d7de; border-radius: 999px; text-decoration: none; color: inherit;
    background: #fff; font-size: 0.9rem; }
.stepper__item b { display: inline-grid; place-items: center; width: 22px; height: 22px;
    border-radius: 50%; background: #eef1f4; font-size: 0.8rem; }
.stepper__item.is-done { border-color: #2e7d4f; }
.stepper__item.is-done b { background: #2e7d4f; color: #fff; }
.stepper__item.is-current { border-color: #2264ab; box-shadow: 0 0 0 2px rgba(34, 100, 171, .18); font-weight: 600; }
.stepper__item.is-current b { background: #2264ab; color: #fff; }
.stepper__arrow { color: #9aa4ae; }
.stepinfo { background: #f6f8fa; border-left: 3px solid #9fb6cf; padding: 6px 10px;
    border-radius: 4px; font-size: 0.85rem; color: #444; margin: 4px 0 10px; }
.step { margin: 14px 0; }

.herowrap { grid-template-columns: minmax(360px, 520px) 1fr; }
.herowrap__gens { grid-template-columns: 1fr; }
.master__overlay { position: absolute; left: 0; right: 0; bottom: 0; padding: 8px;
    background: rgba(0, 0, 0, .55); color: #fff; font-size: 0.85rem; text-align: center; }
.slide--main .slide__result { cursor: zoom-in; }
.slide--main .slide__pip { cursor: zoom-in; }

.mframes { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.mframe { position: relative; border: 2px solid transparent; border-radius: 10px; padding: 4px;
    background: #fafbfc; }
.mframe img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 8px; cursor: zoom-in; display: block; }
.mframe.is-src { border-color: #e0a800; background: #fff8e1; }
.mframe.is-ref { border-color: #2264ab; background: #eef5fc; }
.mframe__tag { position: absolute; top: 8px; left: 8px; background: #e0a800; color: #fff;
    font-size: 0.75rem; padding: 2px 6px; border-radius: 6px; }
.mframe__tag--ref { background: #2264ab; }
.mframe__btns { display: flex; gap: 4px; margin-top: 4px; }
.mframe__btns .btn { flex: 1; padding: 3px 4px; font-size: 0.75rem; }
.mframe__btns .btn.is-on { background: #2264ab; color: #fff; border-color: #2264ab; }

.variants { grid-column: 1 / -1; margin: 12px 0; border: 1px solid #d0d7de; border-radius: 10px;
    padding: 8px 12px; background: #fff; }
.variants > summary { cursor: pointer; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.variants__stack { display: inline-flex; }
.variants__stack img { width: 44px; height: 58px; object-fit: cover; border-radius: 6px;
    border: 2px solid #fff; margin-left: -18px; opacity: .55; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.variants__stack img:first-child { margin-left: 0; }
.carousel { position: relative; margin-top: 10px; }
.carousel__track { display: flex; gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory;
    padding: 4px 36px 10px; scroll-behavior: smooth; }
.carousel__nav { position: absolute; top: 40%; z-index: 2; width: 34px; height: 54px; border: 0;
    border-radius: 8px; background: rgba(0, 0, 0, .45); color: #fff; font-size: 1.6rem; cursor: pointer; }
.carousel__nav--prev { left: 0; }
.carousel__nav--next { right: 0; }
.vcard { flex: 0 0 min(380px, 80vw); scroll-snap-align: start; border: 2px solid #e1e5ea;
    border-radius: 12px; padding: 8px; background: #fff; transition: opacity .2s; }
.vcard__img { position: relative; }
.vcard__img img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 8px; cursor: zoom-in; display: block; }
.vcard__img .slide__empty { aspect-ratio: 3 / 4; }
.vcard__label { display: block; margin: 6px 0 4px; }
.vcard.is-master { border-color: #e0a800; box-shadow: 0 0 0 3px rgba(224, 168, 0, .25); }
.vcard.is-dim { opacity: .5; }
.vcard.is-dim:hover { opacity: 1; }
.vcard.slide--run { outline: none; }

.lightbox { position: fixed; inset: 0; z-index: 1000; background: rgba(0, 0, 0, .85);
    display: grid; place-items: center; cursor: zoom-out; }
.lightbox img { max-width: 94vw; max-height: 94vh; border-radius: 6px; }
.slides > .step, .slides > .variants { grid-column: 1 / -1; }

/* Галерея референсов (задача 39) */
.refgal__tabs, .refgal__chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 4px 0; }
.chip { border: 1px solid #d0d7de; background: #fff; border-radius: 999px; padding: 3px 10px;
    font-size: 0.8rem; cursor: pointer; }
.chip.is-on { background: #2264ab; color: #fff; border-color: #2264ab; }
.refgal__count { font-size: 0.8rem; margin: 4px 0; }
.refgal__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px;
    max-height: 520px; overflow-y: auto; margin-bottom: 6px; }
.refpick__list > * { grid-column: 1 / -1; }

/* Карточки для анализа (задача 42) */
.mcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; margin: 8px 0; }
.mcard { position: relative; margin: 0; padding: 6px; border: 2px solid #e1e5ea; border-radius: 10px;
    background: #fff; font-size: 0.75rem; line-height: 1.25; }
.mcard img, .mcard .slide__empty { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 6px; display: block; }
.mcard figcaption { margin: 4px 0 2px; color: #444; }
.mcard__tag { position: absolute; top: 10px; left: 10px; background: #2e7d4f; color: #fff;
    border-radius: 6px; padding: 1px 6px; font-size: 0.7rem; }
.mcard__tag--new { background: #2264ab; }
.mcard__tag--out { background: #6a7280; }
.mcard.is-new { border-color: #2264ab; border-style: dashed; }
.mcard.is-out { opacity: .45; filter: grayscale(1); }
.mcard.is-out:hover { opacity: .8; }

/* Выводы по лидерам: четыре равные колонки, на ноутбуке — две, на телефоне — одна (22.10) */
.briefgrid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px 20px; align-items: start; }
.briefgrid > div { min-width: 0; }
@media (max-width: 1400px) { .briefgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 700px) { .briefgrid { grid-template-columns: 1fr; } }
.checklist { margin: 4px 0 0; padding: 0; list-style: none; }
.checklist li { margin: 3px 0; }
.checklist label { display: flex; gap: 6px; align-items: flex-start; cursor: pointer; }
.checklist input { margin-top: 3px; flex-shrink: 0; }
.prephead { margin: 18px 0 6px; }
.prephead .muted { font-weight: normal; font-size: 0.9rem; }

/* Бейджи «в WB» и «остатки → WB» (задача 46) */
.wbbadges { display: inline-flex; flex-wrap: wrap; gap: 4px; vertical-align: middle; }
.wbbadge { display: inline-block; font-size: 0.75rem; padding: 1px 8px; border-radius: 999px;
    background: #f1e8fb; color: #6b2fa3; text-decoration: none; white-space: nowrap; }
.wbbadge--on { background: #e3f4ea; color: #1f6b41; }
.wbbadge--off { background: #f0f1f3; color: #6a7280; }
.wbbadge--wait { background: #fff4dc; color: #8a5a00; }
.prodpick__meta .wbbadge { display: inline-block; margin-top: 2px; }

/* Возможности системы (задача 50) */
.capgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.capcard { margin: 0; }

/* Импорт карточек WB списком (задача 57) */
.wbimp__list { max-height: 520px; overflow-y: auto; margin-top: 6px; }
.wbimp__row { display: grid; grid-template-columns: 22px 48px 1fr auto; gap: 8px; align-items: center;
              padding: 4px 0; border-bottom: 1px solid rgba(127,127,127,.15); font-size: 13px; }
.wbimp__row img, .wbimp__nophoto { width: 48px; height: 64px; object-fit: cover; border-radius: 4px; background: rgba(127,127,127,.15); }
/* Импорт карточек шагами (задача 60) */
.srctiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px; margin-bottom: 6px; }
.srctile { display: flex; flex-direction: column; gap: 2px; text-align: left; padding: 10px 12px; border-radius: 10px;
           border: 1px solid rgba(127,127,127,.3); background: transparent; color: inherit; cursor: pointer; font: inherit; }
.srctile:hover { border-color: #3a6fd8; }
.srctile--on { border: 2px solid #3a6fd8; background: rgba(58,111,216,.08); }
.srctile__ok { color: #1f6b41; }

/* «👥 Люди» (задача 62): две колонки галочек — панель и Хаб */
.people-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; margin-top: 10px; }
.people-cols fieldset { border: 1px solid #d0d7de; border-radius: 8px; padding: 8px 12px; margin: 0; }
.people-chk { display: block; padding: 3px 0; }
.people-out { margin-top: 10px; padding: 10px; background: #f6f8fa; border-radius: 8px; word-break: break-all; }
