/* spot_aisell.css — волна 9-I: «Подача по фото» (доски AiSell, AiSellPhotos). Подключается только на странице подачи и только при включённом
   выключателе spot_ai_sell_vision (head.tpl). Телефон первичен: зоны касания ≥ 44px, без hover-зависимостей, безопасные зоны экрана.
   Экран «Фото» — шторка .spot-sheet (spot_overlays.css/js: ловушка фокуса, Esc, блокировка прокрутки); на телефоне — на весь экран, на десктопе — окно. */

/* ---------- вход на шаге «Категория» ---------- */
.spot-aisell-entry {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    min-height: 68px;
    margin: 12px 0 0;
    padding: 12px 14px;
    border: 1px solid var(--spot-line);
    border-radius: var(--spot-radius-l);
    background: var(--spot-field);
    color: var(--spot-ink);
    font-family: var(--spot-font);
    text-align: right;
    cursor: pointer;
}

.spot-aisell-entry:active {
    background: var(--spot-line);
}

.spot-aisell-entry:focus-visible {
    outline: 2px solid var(--spot-focus);
    outline-offset: 2px;
}

.spot-aisell-entry-ic {
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 22px;
    background: var(--spot-surface);
    color: var(--spot-ink);
}

.spot-aisell-entry-tx {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.spot-aisell-entry-tx b {
    font-size: 15px;
    line-height: 20px;
    font-weight: 700;
}

.spot-aisell-entry-tx > span {
    font-size: 13px;
    line-height: 18px;
    color: var(--spot-mut);
}

.spot-aisell-entry-ch {
    flex: 0 0 auto;
    color: var(--spot-mut);
}

/* ---------- экран «Фото» ---------- */
.spot-aisell .spot-sheet-panel {
    height: 100%;
    max-height: 100%;
    border-radius: 0;
    background: var(--spot-surface);
}

.spot-aisell .spot-sheet-grab {
    display: none;
}

.spot-aisell .spot-sheet-head {
    min-height: calc(56px + var(--spot-safe-top, 0px));
    padding-top: calc(4px + var(--spot-safe-top, 0px));
    border-bottom: 1px solid var(--spot-line);
    touch-action: auto;
}

.spot-aisell .spot-sheet-back {
    display: inline-flex;
}

.spot-aisell-body {
    padding: 0;
    background: var(--spot-bg);
}

.spot-aisell-sec {
    margin: 0 0 8px;
    padding: 20px var(--spot-gutter);
    background: var(--spot-surface);
}

.spot-aisell-sec-last {
    margin: 0;
    padding-top: 8px;
    padding-bottom: 16px;
}

.spot-aisell-h {
    margin: 0 0 6px;
    font-size: 22px;
    line-height: 27px;
    font-weight: 800;
    letter-spacing: -0.3px;
}

.spot-aisell-h2 {
    margin: 0 0 8px;
    font-size: 18px;
    line-height: 24px;
    font-weight: 800;
    letter-spacing: -0.2px;
}

.spot-aisell-lead {
    margin: 0 0 14px;
    font-size: 15px;
    line-height: 21px;
    color: var(--spot-ink-2);
}

.spot-aisell-drop {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 132px;
    box-sizing: border-box;
    margin: 0;
    padding: 16px;
    border: 1.5px dashed var(--spot-field-border);
    border-radius: var(--spot-radius-l);
    background: var(--spot-bg);
    text-align: center;
    cursor: pointer;
}

.spot-aisell-drop:focus-within {
    outline: 2px solid var(--spot-focus);
    outline-offset: 2px;
}

.spot-aisell-file {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    border: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
}

.spot-aisell-drop-ic {
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 26px;
    background: var(--spot-surface);
    color: var(--spot-ink);
}

.spot-aisell-drop-t {
    font-size: 16px;
    line-height: 20px;
    font-weight: 700;
}

.spot-aisell-drop-s {
    font-size: 13px;
    line-height: 18px;
    color: var(--spot-mut);
}

.spot-aisell-count {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 14px 0 8px;
    font-size: 15px;
    font-weight: 700;
}

.spot-aisell-count-n {
    font-size: 13px;
    font-weight: 500;
    color: var(--spot-mut);
    white-space: nowrap;
}

.spot-aisell-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
}

.spot-aisell-grid:empty {
    display: none;
}

.spot-aisell-tile {
    position: relative;
    height: 84px;
    border-radius: 10px;
    overflow: hidden;
    background: var(--spot-field);
}

.spot-aisell-tile img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.spot-aisell-tile.is-busy img {
    opacity: .5;
}

.spot-aisell-tile.is-bad {
    outline: 2px solid var(--spot-red);
    outline-offset: -2px;
}

.spot-aisell-main {
    position: absolute;
    right: 4px;
    bottom: 4px;
    display: flex;
    align-items: center;
    height: 20px;
    padding: 0 6px;
    border-radius: 5px;
    background: var(--spot-red);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
}

.spot-aisell-tilemsg {
    position: absolute;
    right: 0;
    left: 0;
    bottom: 0;
    padding: 2px 4px;
    background: rgba(216, 35, 42, 0.92);
    color: #fff;
    font-size: 11px;
    line-height: 14px;
    font-weight: 600;
    text-align: center;
}

.spot-aisell-spin {
    position: absolute;
    right: 50%;
    top: 50%;
    width: 22px;
    height: 22px;
    margin: -11px -11px 0 0;
    border: 2px solid var(--spot-line);
    border-top-color: var(--spot-ink);
    border-radius: 50%;
    animation: spot-aisell-rot .8s linear infinite;
}

@keyframes spot-aisell-rot {
    to { transform: rotate(-360deg); }
}

.spot-aisell-x {
    position: absolute;
    left: 0;
    top: 0;
    width: 44px;
    height: 44px;
    padding: 4px;
    border: 0;
    background: transparent;
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    cursor: pointer;
}

.spot-aisell-x > span {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: rgba(27, 29, 33, 0.72);
    color: #fff;
}

.spot-aisell-x:focus-visible {
    outline: 2px solid var(--spot-focus);
    outline-offset: -2px;
}

.spot-aisell-note {
    margin: 12px 0 0;
    font-size: 13px;
    line-height: 18px;
    color: var(--spot-mut);
}

.spot-aisell-note[hidden] {
    display: none;
}

.spot-aisell-tips {
    margin: 0;
    padding: 0;
    list-style: none;
}

.spot-aisell-tips li {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 28px;
    font-size: 15px;
    line-height: 20px;
}

.spot-aisell-tips li::before {
    content: "";
    flex: 0 0 6px;
    width: 6px;
    height: 6px;
    border-radius: 3px;
    background: var(--spot-mut);
}

.spot-aisell-manual {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    min-height: 52px;
    margin: 0;
    padding: 0;
    border: 0;
    background: none;
    color: var(--spot-ink);
    font-family: var(--spot-font);
    text-align: right;
    cursor: pointer;
}

.spot-aisell-manual > span {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.spot-aisell-manual b {
    font-size: 15px;
    font-weight: 700;
}

.spot-aisell-manual > span > span {
    font-size: 13px;
    color: var(--spot-mut);
}

.spot-aisell-manual svg {
    flex: 0 0 auto;
    color: #8A9099;
}

.spot-aisell-manual:focus-visible {
    outline: 2px solid var(--spot-focus);
    outline-offset: 2px;
}

/* нижняя панель: уведомление и кнопки всегда на виду */
.spot-aisell-foot {
    flex: 0 0 auto;
    padding: 10px var(--spot-gutter) calc(12px + var(--spot-safe-bottom, 0px));
    border-top: 1px solid var(--spot-line);
    background: var(--spot-surface);
}

.spot-aisell-err {
    margin: 0 0 8px;
    padding: 10px 12px;
    border-radius: var(--spot-radius);
    background: var(--spot-red-soft);
    color: var(--spot-red-dark-fg);
    font-size: 14px;
    line-height: 19px;
    font-weight: 600;
}

.spot-aisell-err[hidden] {
    display: none;
}

.spot-aisell-err-manual {
    display: block;
    min-height: 44px;
    margin: 2px 0 -8px;
    padding: 0;
    border: 0;
    background: none;
    color: var(--spot-red-dark-fg);
    font: inherit;
    font-weight: 700;
    text-align: right;
    text-decoration: underline;
    cursor: pointer;
}

.spot-aisell-notice {
    margin: 0 0 8px;
    font-size: 13px;
    line-height: 18px;
    color: var(--spot-ink-2);
    text-align: center;
}

.spot-aisell-bar {
    display: flex;
    gap: 8px;
}

.spot-aisell-back,
.spot-aisell-go {
    box-sizing: border-box;
    height: var(--spot-control-h-l);
    border-radius: 14px;
    font-family: var(--spot-font);
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
}

.spot-aisell-back {
    flex: 0 0 112px;
    border: 1px solid var(--spot-field-border);
    background: var(--spot-surface);
    color: var(--spot-ink);
}

.spot-aisell-go {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 16px;
    border: 0;
    background: var(--spot-red);
    color: #fff;
}

.spot-aisell-go:active {
    background: var(--spot-red-dark);
}

.spot-aisell-go:disabled {
    opacity: .5;
    cursor: default;
}

.spot-aisell-go.is-busy {
    opacity: 1;
    background: var(--spot-red-dark);
}

.spot-aisell-go.is-busy::before {
    content: "";
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, .45);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spot-aisell-rot .8s linear infinite;
}

.spot-aisell-go:focus-visible,
.spot-aisell-back:focus-visible {
    outline: 2px solid var(--spot-focus);
    outline-offset: 2px;
}

/* ---------- карточка «Подсказки по фото» и значки на строках шагов ---------- */
.spot-aisell-badge {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    height: 22px;
    padding: 0 8px;
    box-sizing: border-box;
    border-radius: 6px;
    background: var(--spot-amber-soft);
    color: var(--spot-amber);
    font-size: 12px;
    line-height: 16px;
    font-weight: 700;
    white-space: nowrap;
}

.spot-aisell-ctxbadge {
    margin: -4px 0 12px;
}

.spot-edit .filter_item_results.spot-aisell-row {
    flex-wrap: wrap;
    row-gap: 4px;
}

.spot-edit .filter_item_results.spot-aisell-row .spot-aisell-badge {
    order: 3;
    flex: 0 0 auto;
}

.spot-aisell-card {
    margin: 0 0 12px;
    padding: 14px var(--spot-gutter);
    border: 1px solid var(--spot-line);
    border-radius: var(--spot-radius-l);
    background: var(--spot-surface);
}

.spot-aisell-card-h {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.spot-aisell-card-h b {
    font-size: 16px;
    line-height: 22px;
    font-weight: 800;
}

.spot-aisell-card-h b:focus {
    outline: none;
}

.spot-aisell-card-n {
    margin: 4px 0 8px;
    font-size: 13px;
    line-height: 18px;
    color: var(--spot-mut);
}

.spot-aisell-card-l {
    margin: 0;
    padding: 0;
    list-style: none;
}

.spot-aisell-card-l li {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    column-gap: 10px;
    row-gap: 0;
    min-height: 56px;
    padding: 6px 0;
    border-top: 1px solid var(--spot-line);
    font-size: 15px;
}

.spot-aisell-card-k {
    grid-column: 1;
    color: var(--spot-mut);
    font-size: 12px;
    line-height: 16px;
}

.spot-aisell-card-v {
    grid-column: 1;
    min-width: 0;
    font-weight: 700;
    line-height: 20px;
    overflow-wrap: break-word;
}

.spot-aisell-card-w {
    grid-column: 1 / -1;
    margin: 2px 0 0;
    font-size: 12px;
    color: var(--spot-mut);
}

.spot-aisell-undo {
    min-height: 44px;
    margin: 0 0 0 -8px;
    padding: 0 8px;
    border: 0;
    background: none;
    color: var(--spot-focus);
    font-family: var(--spot-font);
    font-size: 13px;
    font-weight: 700;
    grid-column: 2;
    grid-row: 1 / span 2;
    text-align: left;
    cursor: pointer;
}

.spot-aisell-undo:focus-visible {
    outline: 2px solid var(--spot-focus);
    outline-offset: 2px;
}

.spot-aisell-card-y {
    margin: 8px 0 0;
    padding: 8px 10px;
    border-radius: var(--spot-radius);
    background: var(--spot-bg);
    font-size: 13px;
    line-height: 18px;
    color: var(--spot-ink-2);
}

/* ---------- десктоп: окно по центру ---------- */
@media (min-width: 992px) {
    .spot-aisell .spot-sheet-panel {
        width: 560px;
        height: min(820px, calc(100vh - 80px));
        max-height: calc(100vh - 80px);
        border-radius: var(--spot-radius-l);
        overflow: hidden;
    }

    .spot-aisell .spot-sheet-head {
        min-height: 60px;
        padding-top: 4px;
    }

    .spot-aisell-grid {
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }
}

@media (prefers-reduced-motion: reduce) {
    .spot-aisell-spin,
    .spot-aisell-go.is-busy::before {
        animation: none;
    }
}
