/* /assets/css/custom-print.css
   Стили страницы кастомных принтов (/custom-print).
   Только этот файл: assets/css/main.css не трогаем. Цвета и шрифты — из :root main.css
   (--ink, --acid, --coral, --paper, --white, --line, --muted), Manrope + DM Mono. */

.custom-page {
    padding: 26px 0 64px;
}

.custom-page [hidden] {
    display: none !important;
}

.custom-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin: 14px 0 26px;
}

.custom-heading h1 {
    margin: 0;
    font-size: clamp(26px, 3.4vw, 44px);
    font-weight: 800;
    letter-spacing: -.075em;
    line-height: .95;
}

.custom-heading__lead {
    max-width: 520px;
    margin: 12px 0 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.5;
}

/* ---------- Шапка страницы ---------- */

.custom-hero {
    display: grid;
    grid-template-columns: 1.25fr .75fr;
    gap: 24px;
    margin: 14px 0 26px;
}

.custom-hero__copy {
    padding: 30px 32px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--acid);
}

.custom-hero__copy .eyebrow {
    color: #555a16;
}

.custom-hero__copy h1 {
    margin: 0;
    font-size: clamp(28px, 3.8vw, 52px);
    font-weight: 800;
    letter-spacing: -.08em;
    line-height: .9;
}

.custom-hero__copy h1 span {
    font-style: italic;
}

.custom-hero__lead {
    max-width: 560px;
    margin: 16px 0 0;
    font-size: 14px;
    line-height: 1.5;
}

.custom-hero__facts {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 20px 0 0;
    padding: 0;
    list-style: none;
}

.custom-hero__facts li {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 132px;
    padding: 10px 14px;
    border: 1px solid rgba(24, 24, 24, .16);
    border-radius: 14px;
    background: rgba(255, 254, 250, .55);
}

.custom-hero__facts b {
    font-size: 16px;
    letter-spacing: -.03em;
}

.custom-hero__facts span {
    color: #4b5020;
    font-family: "DM Mono", monospace;
    font-size: 10px;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.custom-hero__art {
    position: relative;
    min-height: 230px;
    overflow: hidden;
    border-radius: var(--radius-lg);
    background: var(--coral);
}

.custom-hero__sheet {
    position: absolute;
    top: 24px;
    left: 50%;
    display: flex;
    width: 168px;
    height: 196px;
    flex-direction: column;
    justify-content: center;
    padding: 18px;
    border: 3px solid var(--ink);
    background: var(--white);
    box-shadow: 8px 9px 0 var(--ink);
    transform: translateX(-50%) rotate(-7deg);
}

.custom-hero__sheet span {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -.09em;
    line-height: .86;
}

.custom-hero__sheet i {
    position: absolute;
    top: 18px;
    right: 16px;
    color: var(--coral);
    font-size: 30px;
    font-style: normal;
}

.custom-hero__sheet b {
    position: absolute;
    right: 15px;
    bottom: 18px;
    padding: 4px 7px;
    border: 2px solid var(--ink);
    border-radius: 50%;
    background: var(--acid);
    font-family: "DM Mono", monospace;
    font-size: 8px;
    transform: rotate(-12deg);
}

.custom-hero__badge {
    position: absolute;
    bottom: 20px;
    left: 20px;
    padding: 8px 11px;
    border: 2px solid var(--ink);
    background: var(--yellow);
    font-family: "DM Mono", monospace;
    font-size: 9px;
    line-height: 1.15;
    transform: rotate(-6deg);
}

/* ---------- Каркас приложения ---------- */

.custom-app {
    display: block;
}

.custom-hello {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin: 0 0 16px;
    padding: 12px 16px;
    border: 1px dashed var(--line);
    border-radius: var(--radius-md);
    background: var(--white);
    font-size: 14px;
}

.custom-hello__mark {
    display: grid;
    width: 28px;
    height: 28px;
    place-items: center;
    border: 2px solid var(--ink);
    border-radius: 10px;
    background: var(--acid);
    font-family: "DM Mono", monospace;
    font-size: 12px;
    transform: rotate(-6deg);
}

.custom-hello a {
    margin-left: auto;
    border-bottom: 1px solid var(--ink);
    font-weight: 700;
    font-size: 13px;
}

/* ---------- Индикатор шагов ---------- */

.custom-steps {
    display: flex;
    align-items: stretch;
    gap: 8px;
    margin: 0 0 18px;
    padding: 0;
    list-style: none;
}

.custom-steps__item {
    display: flex;
    flex: 1 1 0;
    min-width: 0;
    align-items: center;
    gap: 9px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--white);
    color: var(--muted);
    cursor: default;
}

.custom-steps__item.is-clickable {
    cursor: pointer;
}

.custom-steps__item.is-clickable:hover {
    border-color: var(--ink);
}

.custom-steps__num {
    display: grid;
    width: 26px;
    height: 26px;
    flex: 0 0 auto;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 50%;
    font-family: "DM Mono", monospace;
    font-size: 12px;
}

.custom-steps__label {
    overflow: hidden;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: -.02em;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.custom-steps__item.is-active {
    border-color: var(--ink);
    background: var(--ink);
    color: var(--white);
}

.custom-steps__item.is-active .custom-steps__num {
    border-color: var(--acid);
    background: var(--acid);
    color: var(--ink);
}

.custom-steps__item.is-done {
    border-color: var(--ink);
    color: var(--ink);
}

.custom-steps__item.is-done .custom-steps__num {
    border-color: var(--ink);
    background: var(--acid);
    color: var(--ink);
}

/* ---------- Экран «нужен аккаунт» ---------- */

.custom-auth {
    display: grid;
    grid-template-columns: .8fr 1.2fr;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--white);
    box-shadow: var(--shadow);
}

.custom-auth__art {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 250px;
    background: var(--blue);
}

.custom-auth__lock {
    display: grid;
    width: 96px;
    height: 96px;
    place-items: center;
    border: 3px solid var(--ink);
    border-radius: 28px;
    background: var(--white);
    box-shadow: 7px 8px 0 var(--ink);
    font-family: "DM Mono", monospace;
    font-size: 26px;
    transform: rotate(-7deg);
}

.custom-auth__note {
    position: absolute;
    right: 22px;
    bottom: 24px;
    padding: 8px 11px;
    border: 2px solid var(--ink);
    background: var(--yellow);
    font-family: "DM Mono", monospace;
    font-size: 9px;
    line-height: 1.15;
    transform: rotate(6deg);
}

.custom-auth__body {
    padding: 28px 32px;
}

.custom-auth__body h2 {
    margin: 0;
    font-size: clamp(21px, 2.4vw, 32px);
    font-weight: 800;
    letter-spacing: -.07em;
}

.custom-auth__lead {
    max-width: 560px;
    margin: 14px 0 0;
    font-size: 14px;
    line-height: 1.5;
}

.custom-auth__list {
    margin: 16px 0 0;
    padding: 0;
    list-style: none;
}

.custom-auth__list li {
    position: relative;
    margin: 7px 0;
    padding-left: 24px;
    font-size: 13px;
}

.custom-auth__list li::before {
    position: absolute;
    top: 0;
    left: 0;
    color: var(--coral);
    content: "✦";
}

.custom-auth__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 20px 0 0;
}

/* ---------- Панели визарда ---------- */

.custom-wizard {
    display: block;
}

.custom-panels {
    margin: 0;
    padding: 0;
    list-style: none;
}

.custom-step {
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--white);
    box-shadow: var(--shadow);
}

.custom-step__head {
    margin-bottom: 20px;
}

.custom-step__index {
    margin: 0 0 8px;
    color: var(--muted);
    font-family: "DM Mono", monospace;
    font-size: 11px;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.custom-step__head h2 {
    margin: 0;
    font-size: clamp(20px, 2.2vw, 30px);
    font-weight: 800;
    letter-spacing: -.07em;
}

.custom-step__hint {
    max-width: 640px;
    margin: 10px 0 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.5;
}

.custom-step__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 22px;
    align-items: start;
}

/* ---------- Загрузка фото ---------- */

.custom-drop {
    display: block;
}

.custom-drop__zone {
    display: flex;
    min-height: 236px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 24px;
    border: 2px dashed var(--line);
    border-radius: var(--radius-md);
    background: var(--paper);
    cursor: pointer;
    text-align: center;
    transition: border-color .15s, background .15s;
}

.custom-drop__zone:hover,
.custom-drop.is-dragging .custom-drop__zone {
    border-color: var(--ink);
    background: #f2f7d9;
}

.custom-drop__icon {
    display: grid;
    width: 46px;
    height: 46px;
    place-items: center;
    border: 2px solid var(--ink);
    border-radius: 16px;
    background: var(--acid);
    font-size: 20px;
    transform: rotate(-5deg);
}

.custom-drop__title {
    font-size: 16px;
    font-weight: 800;
    letter-spacing: -.03em;
}

.custom-drop__sub {
    max-width: 300px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.45;
}

.custom-drop__preview {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--paper);
}

.custom-drop__shot {
    display: block;
    width: 108px;
    height: 108px;
    flex: 0 0 auto;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--white);
}

.custom-drop__shot img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.custom-drop__meta {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 4px;
}

.custom-drop__meta strong {
    overflow: hidden;
    font-size: 14px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.custom-drop__meta span {
    color: var(--muted);
    font-family: "DM Mono", monospace;
    font-size: 11px;
}

.custom-link {
    align-self: flex-start;
    padding: 0;
    border: 0;
    background: none;
    color: var(--ink);
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 4px;
}

.custom-drop .custom-link {
    margin-top: 4px;
}

.custom-drop__zone[hidden] + .custom-drop__preview {
    margin-top: 0;
}

/* ---------- Форматы и пожелание ---------- */

.custom-controls {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.custom-formats {
    margin: 0;
    padding: 0;
    border: 0;
}

.custom-formats legend {
    margin-bottom: 10px;
    padding: 0;
    color: var(--muted);
    font-family: "DM Mono", monospace;
    font-size: 11px;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.custom-formats__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.custom-format {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 13px 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--paper);
    cursor: pointer;
    transition: border-color .15s, background .15s, transform .15s;
}

.custom-format:hover {
    border-color: var(--ink);
}

.custom-format__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.custom-format__code {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -.08em;
}

.custom-format__check {
    display: grid;
    width: 20px;
    height: 20px;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: var(--white);
    color: transparent;
    font-size: 11px;
}

.custom-format__size,
.custom-format__caption {
    color: var(--muted);
    font-family: "DM Mono", monospace;
    font-size: 10px;
    letter-spacing: .03em;
}

.custom-format__caption {
    text-transform: uppercase;
}

.custom-format__price {
    margin-top: 4px;
    font-size: 14px;
    font-weight: 700;
}

.custom-format.is-selected,
.custom-format:has(input:checked) {
    border-color: var(--ink);
    background: var(--acid);
    transform: translateY(-2px);
}

.custom-format.is-selected .custom-format__check,
.custom-format:has(input:checked) .custom-format__check {
    border-color: var(--ink);
    background: var(--ink);
    color: var(--acid);
}

.custom-format.is-selected .custom-format__size,
.custom-format.is-selected .custom-format__caption,
.custom-format:has(input:checked) .custom-format__size,
.custom-format:has(input:checked) .custom-format__caption {
    color: #4b5020;
}

.custom-format.is-pending {
    border-style: dashed;
    cursor: progress;
}

.custom-format.is-disabled {
    opacity: .5;
    cursor: not-allowed;
}

.custom-format.is-disabled .custom-format__price {
    color: var(--coral);
    font-size: 12px;
    font-weight: 700;
}

/* ---------- Цвет ткани ---------- */

.custom-garment {
    margin: 0;
    padding: 0;
    border: 0;
}

.custom-garment legend {
    margin-bottom: 10px;
    padding: 0;
    color: var(--muted);
    font-family: "DM Mono", monospace;
    font-size: 11px;
    letter-spacing: .06em;
    text-transform: uppercase;
}

/* Блок информирования: требование владельца — покупатель обязан понимать,
   зачем это поле. Не пугаем, но объясняем последствие ошибки прямо. */
.custom-garment__info {
    display: flex;
    gap: 11px;
    margin: 0 0 12px;
    padding: 13px 15px;
    border: 2px solid var(--ink);
    border-radius: var(--radius-md);
    background: var(--yellow);
}

.custom-garment__icon {
    display: grid;
    width: 24px;
    height: 24px;
    flex: 0 0 auto;
    place-items: center;
    border: 2px solid var(--ink);
    border-radius: 50%;
    background: var(--white);
    font-family: "DM Mono", monospace;
    font-size: 13px;
    font-weight: 700;
}

.custom-garment__info p {
    margin: 0;
    font-size: 12.5px;
    line-height: 1.5;
}

.custom-garment__grid {
    display: grid;
    gap: 9px;
}

.custom-garment-card {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 13px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--paper);
    cursor: pointer;
    transition: border-color .15s, background .15s;
}

.custom-garment-card:hover {
    border-color: var(--ink);
}

.custom-garment-card__swatch {
    display: block;
    width: 34px;
    height: 34px;
    flex: 0 0 auto;
    border: 2px solid var(--ink);
    border-radius: 11px;
}

.custom-garment-card__swatch--light {
    background: linear-gradient(135deg, #fffefa 0 50%, #efe9dc 50% 100%);
}

.custom-garment-card__swatch--dark {
    background: linear-gradient(135deg, #2b2b2b 0 50%, #181818 50% 100%);
}

.custom-garment-card__swatch--auto {
    background:
        linear-gradient(135deg, #fffefa 0 25%, #181818 25% 50%, #fffefa 50% 75%, #181818 75% 100%);
}

.custom-garment-card__body {
    display: flex;
    min-width: 0;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 2px;
}

.custom-garment-card__title {
    font-size: 13.5px;
    font-weight: 800;
    letter-spacing: -.02em;
}

.custom-garment-card__hint {
    color: var(--muted);
    font-family: "DM Mono", monospace;
    font-size: 10px;
    line-height: 1.35;
}

.custom-garment-card__check {
    display: grid;
    width: 20px;
    height: 20px;
    flex: 0 0 auto;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: var(--white);
    color: transparent;
    font-size: 11px;
}

.custom-garment-card.is-selected,
.custom-garment-card:has(input:checked) {
    border-color: var(--ink);
    background: var(--acid);
}

.custom-garment-card.is-selected .custom-garment-card__check,
.custom-garment-card:has(input:checked) .custom-garment-card__check {
    border-color: var(--ink);
    background: var(--ink);
    color: var(--acid);
}

.custom-garment-card.is-selected .custom-garment-card__hint,
.custom-garment-card:has(input:checked) .custom-garment-card__hint {
    color: #4b5020;
}

.custom-garment__hint {
    margin: 10px 0 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.45;
}

.custom-garment__hint strong {
    color: var(--ink);
}

/* Что учтено на шагах 2+: строка в карточке прогресса */
.custom-progress-garment {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 6px;
    margin: 14px 0 0;
    padding: 10px 13px;
    border: 1px dashed var(--line);
    border-radius: 12px;
    background: var(--white);
    font-size: 12px;
}

.custom-progress-garment b {
    font-weight: 800;
}

.custom-progress-garment span {
    color: var(--muted);
    font-family: "DM Mono", monospace;
    font-size: 10px;
    letter-spacing: .04em;
}

/* Печать перезапускается — честное предупреждение, не ошибка */
.custom-retry-note {
    margin: 14px 0 0;
    padding: 12px 14px;
    border: 2px dashed var(--coral);
    border-radius: var(--radius-md);
    background: #fff2ef;
    font-size: 12.5px;
    line-height: 1.5;
}

.custom-field {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.custom-field > span {
    color: var(--muted);
    font-family: "DM Mono", monospace;
    font-size: 11px;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.custom-field > span small {
    color: var(--line);
    text-transform: none;
}

.custom-field textarea {
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--paper);
    color: var(--ink);
    font: inherit;
    line-height: 1.45;
    resize: vertical;
}

.custom-field textarea:focus {
    border-color: var(--ink);
    background: var(--white);
    outline: 2px solid var(--acid);
    outline-offset: 1px;
}

.custom-field__counter {
    align-self: flex-end;
    color: var(--muted);
    font-family: "DM Mono", monospace;
    font-size: 10px;
    font-style: normal;
}

/* ---------- Кнопки, статусы, подсказки ---------- */

.custom-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px;
    margin-top: 20px;
}

.custom-actions--center {
    justify-content: center;
}

.custom-submit[disabled],
.custom-send[disabled],
.custom-actions button[disabled] {
    opacity: .45;
    cursor: not-allowed;
}

.custom-status {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.45;
}

.custom-status.is-error {
    color: #b3261e;
    font-weight: 700;
}

.custom-status.is-success {
    color: #1f6b3a;
    font-weight: 700;
}

.custom-status.is-busy::after {
    display: inline-block;
    width: 12px;
    margin-left: 6px;
    content: "···";
    letter-spacing: .1em;
    animation: custom-blink 1.1s steps(4, end) infinite;
}

.cprint-note {
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.45;
}

.cprint-note--error {
    color: #b3261e;
    font-weight: 700;
}

.custom-link--muted {
    color: var(--muted);
}

/* ---------- Шаг 2: прогресс ---------- */

.custom-progress-card {
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--paper);
}

.custom-progress-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 12px;
}

.custom-progress-percent {
    font-size: 34px;
    font-weight: 800;
    letter-spacing: -.08em;
}

.custom-progress-percent i {
    margin-left: 2px;
    color: var(--muted);
    font-size: 16px;
    font-style: normal;
}

.custom-progress-stage {
    color: var(--muted);
    font-family: "DM Mono", monospace;
    font-size: 11px;
    letter-spacing: .04em;
    text-align: right;
    text-transform: uppercase;
}

.custom-progress {
    position: relative;
    height: 14px;
    overflow: hidden;
    border: 1px solid var(--ink);
    border-radius: 999px;
    background: var(--white);
}

.custom-progress__fill {
    display: block;
    width: 0;
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--acid), #b6e02a);
    transition: width .4s ease;
}

.custom-progress-log {
    margin: 16px 0 0;
    padding: 0;
    list-style: none;
}

.custom-progress-log li {
    position: relative;
    margin: 7px 0;
    padding-left: 22px;
    color: var(--muted);
    font-size: 12px;
}

.custom-progress-log li::before {
    position: absolute;
    top: 3px;
    left: 2px;
    width: 8px;
    height: 8px;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: var(--white);
    content: "";
}

.custom-progress-log li.is-done {
    color: var(--ink);
    font-weight: 700;
}

.custom-progress-log li.is-done::before {
    border-color: var(--ink);
    background: var(--acid);
}

.custom-loader {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 16px;
    color: var(--muted);
    font-size: 12px;
}

.custom-loader i {
    display: block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--ink);
    animation: custom-pulse 1s ease-in-out infinite;
}

.custom-loader i:nth-child(2) {
    animation-delay: .15s;
}

.custom-loader i:nth-child(3) {
    animation-delay: .3s;
}

.custom-loader span {
    margin-left: 6px;
    font-family: "DM Mono", monospace;
    font-size: 10px;
    letter-spacing: .05em;
    text-transform: uppercase;
}

@keyframes custom-pulse {
    0%, 100% { opacity: .25; transform: translateY(0); }
    50% { opacity: 1; transform: translateY(-3px); }
}

@keyframes custom-blink {
    0% { opacity: .2; }
    100% { opacity: 1; }
}

.custom-callout {
    margin-top: 18px;
    padding: 16px 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--white);
}

.custom-callout strong {
    display: block;
    font-size: 15px;
    letter-spacing: -.02em;
}

.custom-callout p {
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.45;
}

.custom-callout--error {
    border-color: var(--coral);
    background: #fff2ef;
}

.custom-callout--info {
    border-color: var(--blue);
    background: #f1f6ff;
}

.custom-callout__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 14px;
}

/* ---------- Шаг 3: варианты ---------- */

.custom-variants {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.custom-variant {
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow: hidden;
    border: 2px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--paper);
    cursor: pointer;
    text-align: left;
    transition: border-color .15s, transform .15s;
}

.custom-variant:hover {
    border-color: var(--ink);
}

.custom-variant.is-selected {
    border-color: var(--ink);
    background: var(--acid);
    transform: translateY(-3px);
}

.custom-variant__shot {
    display: block;
    aspect-ratio: 3 / 4;
    overflow: hidden;
    background: var(--white);
}

.custom-variant__shot img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.custom-variant__bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 11px 13px;
}

.custom-variant__label {
    font-size: 13px;
    font-weight: 800;
    letter-spacing: -.02em;
}

.custom-variant__check {
    display: grid;
    width: 22px;
    height: 22px;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: var(--white);
    color: transparent;
    font-size: 12px;
}

.custom-variant.is-selected .custom-variant__check {
    border-color: var(--ink);
    background: var(--ink);
    color: var(--acid);
}

/* ---------- Шаг 2: скелетоны вариантов ---------- */

/* Пока генерация идёт, на месте будущих вариантов стоят пустые слоты.
   Сетка та же, что у готовых карточек (см. .custom-variants): когда слот
   заменяется настоящей карточкой, ничего не сдвигается и не «прыгает».
   Скелетоны живут на шаге 2 и убираются, когда набор собран. */
.custom-variants--pending {
    margin-top: 18px;
}

.custom-variants--pending[hidden] {
    display: none;
}

.custom-variant--skeleton {
    /* Не кнопка: слот не кликабельный, курсор не должен обещать действие. */
    cursor: default;
    border-style: dashed;
    border-color: var(--line);
    background: var(--paper);
}

/* Наведение не двигает и не подсвечивает слот: он не интерактивный.
   Правило владельца «при наведении объект не смещается и не растёт». */
.custom-variant--skeleton:hover {
    border-color: var(--line);
}

.custom-variant__shot--skeleton {
    position: relative;
    display: grid;
    place-items: center;
    background: linear-gradient(180deg, #f4f1ea 0%, #ece8df 100%);
}

/* Бегущий блик: единственный признак «здесь скоро будет картинка». */
.custom-skeleton__shimmer {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        100deg,
        rgba(255, 255, 255, 0) 20%,
        rgba(255, 255, 255, .75) 50%,
        rgba(255, 255, 255, 0) 80%
    );
    background-size: 220% 100%;
    animation: custom-skeleton-shimmer 1.5s ease-in-out infinite;
}

@keyframes custom-skeleton-shimmer {
    from { background-position: 140% 0; }
    to { background-position: -60% 0; }
}

.custom-skeleton__spinner {
    position: relative;
    z-index: 1;
    width: 30px;
    height: 30px;
    border: 3px solid rgba(24, 24, 24, .18);
    border-top-color: var(--ink);
    border-radius: 50%;
    animation: custom-skeleton-spin .9s linear infinite;
}

@keyframes custom-skeleton-spin {
    to { transform: rotate(360deg); }
}

/* Задача ещё в очереди (воркер не успел её взять): честная подпись и
   спокойный спиннер — иначе «Рисуем…» висело бы без объяснений. */
.custom-variant--skeleton.is-waiting .custom-skeleton__spinner {
    animation-duration: 2.2s;
    opacity: .55;
}

/* Слот, который генератор не осилил: серый, с крестиком вместо спиннера. */
.custom-variant--skeleton.is-failed {
    border-style: solid;
    border-color: rgba(24, 24, 24, .2);
    background: #f2f0eb;
}

.custom-variant--skeleton.is-failed .custom-variant__shot--skeleton {
    background: #f2f0eb;
}

.custom-variant--skeleton.is-failed .custom-skeleton__shimmer {
    display: none;
}

.custom-variant--skeleton.is-failed .custom-variant__shot--skeleton::after {
    content: "×";
    position: relative;
    z-index: 1;
    color: rgba(24, 24, 24, .35);
    font-family: "DM Mono", monospace;
    font-size: 34px;
    line-height: 1;
}

.custom-variant--skeleton.is-failed .custom-variant__label {
    color: var(--muted);
    font-weight: 600;
}

/* Готовая картинка проявляется: слот уже занимал это место, и резкая
   подмена кадра читалась бы как «моргание». */
.custom-variant__shot img {
    opacity: 0;
    transition: opacity .25s ease;
}

.custom-variant__shot img.is-loaded,
.custom-variant__shot img:not([data-variant-img]) {
    opacity: 1;
}

/* Картинка варианта не открылась (файл пропал, битая ссылка): вместо
   пустой белой плитки — заглушка. Вариант остаётся выбираемым: он есть
   в базе, и продавец сможет разобраться по номеру. */
.custom-variant.is-broken .custom-variant__shot {
    display: grid;
    place-items: center;
    background: #f2f0eb;
}

.custom-variant.is-broken .custom-variant__shot::after {
    content: "Картинка не открылась";
    padding: 0 14px;
    color: var(--muted);
    font-family: "DM Mono", monospace;
    font-size: 11px;
    text-align: center;
}

/* Карточка, пришедшая на место скелетона, появляется так же плавно. */
.custom-variant.is-hydrated {
    animation: custom-variant-appear .25s ease both;
}

@keyframes custom-variant-appear {
    from { opacity: 0; }
    to { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
    .custom-skeleton__shimmer,
    .custom-skeleton__spinner {
        animation: none;
    }

    .custom-skeleton__shimmer {
        display: none;
    }

    .custom-variant__shot img {
        transition: none;
    }

    .custom-variant.is-hydrated {
        animation: none;
    }
}

/* ---------- Шаг 4: утверждение и успех ---------- */

.custom-approve-card {
    display: grid;
    grid-template-columns: .8fr 1.2fr;
    gap: 22px;
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--paper);
}

.custom-approve-card__shot {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--white);
}

.custom-approve-card__shot img {
    display: block;
    width: 100%;
    height: 100%;
    max-height: 380px;
    object-fit: contain;
}

.custom-approve-card__body h3 {
    margin: 10px 0 0;
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -.04em;
}

.custom-badge {
    display: inline-block;
    padding: 5px 9px;
    border: 1px solid var(--ink);
    border-radius: 999px;
    background: var(--white);
    font-family: "DM Mono", monospace;
    font-size: 10px;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.custom-badge--acid {
    background: var(--acid);
}

.custom-badge--coral {
    background: var(--coral);
}

.custom-badge--muted {
    border-color: var(--line);
    background: var(--paper);
    color: var(--muted);
}

.custom-badge--blue {
    background: var(--blue);
}

.custom-badge--mint {
    background: var(--mint);
}

.custom-dl {
    margin: 16px 0 0;
}

.custom-dl > div {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 14px;
    padding: 8px 0;
    border-bottom: 1px dashed var(--line);
}

.custom-dl dt {
    color: var(--muted);
    font-family: "DM Mono", monospace;
    font-size: 10px;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.custom-dl dd {
    margin: 0;
    font-size: 13px;
    font-weight: 700;
    text-align: right;
    word-break: break-word;
}

.custom-dl dd a {
    border-bottom: 1px solid var(--ink);
}

.custom-send {
    margin-top: 18px;
}

.custom-approve-card__body .custom-link {
    margin-top: 14px;
}

.custom-success {
    margin-top: 18px;
    padding: 26px;
    border: 2px solid var(--ink);
    border-radius: var(--radius-lg);
    background: var(--acid);
}

/* Отмена — не успех: нейтральный фон вместо кислотного, чтобы не читалось
   как «всё хорошо, заказ пошёл». */
.custom-success.is-cancelled {
    background: var(--paper);
    border-style: dashed;
}

.custom-success h3 {
    margin: 6px 0 0;
    font-size: clamp(20px, 2.4vw, 30px);
    font-weight: 800;
    letter-spacing: -.06em;
}

/* Номер заказа — моноширинным, заголовок («Заказ» / «Принт ушёл в работу») — обычным. */
.custom-success__number {
    display: inline-block;
    margin-left: 8px;
    font-family: "DM Mono", monospace;
    font-size: .82em;
    letter-spacing: -.02em;
}

.custom-success p {
    max-width: 560px;
    margin: 12px 0 0;
    font-size: 14px;
    line-height: 1.5;
}

.custom-success__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 20px;
}

.custom-success .button-outline {
    border-color: var(--ink);
    background: var(--white);
}

/* ---------- История генераций ---------- */

.custom-history {
    margin-top: 34px;
}

.custom-history--full {
    margin-top: 10px;
}

.custom-history__head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 16px;
}

.custom-history__head h2 {
    margin: 0;
    font-size: clamp(20px, 2.2vw, 28px);
    font-weight: 800;
    letter-spacing: -.06em;
}

.custom-history__grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.custom-history__grid:empty {
    display: none;
}

.custom-history-card {
    display: flex;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--white);
}

.custom-history-card__thumb {
    display: block;
    width: 74px;
    height: 96px;
    flex: 0 0 auto;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--paper);
}

.custom-history-card__thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.custom-history-card__body {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 6px;
}

.custom-history-card__body h3 {
    margin: 0;
    overflow: hidden;
    font-size: 14px;
    font-weight: 800;
    letter-spacing: -.02em;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.custom-history-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin: 0;
    color: var(--muted);
    font-family: "DM Mono", monospace;
    font-size: 10px;
}

.custom-history-card__order {
    margin: 0;
    font-family: "DM Mono", monospace;
    font-size: 11px;
    font-weight: 700;
}

.custom-history__state {
    margin: 14px 0 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.5;
}

.custom-history__state.is-error {
    color: #b3261e;
    font-weight: 700;
}

.custom-history__state[hidden] {
    display: none !important;
}

/* Скелетон загрузки истории */
.custom-history-card.is-skeleton {
    align-items: center;
}

.custom-history-card.is-skeleton .custom-history-card__thumb,
.custom-history-card.is-skeleton .custom-skeleton-line {
    background: linear-gradient(90deg, var(--paper), #ece8de, var(--paper));
    background-size: 200% 100%;
    animation: custom-shimmer 1.4s ease-in-out infinite;
}

.custom-skeleton-line {
    display: block;
    height: 11px;
    border-radius: 999px;
}

.custom-skeleton-line:nth-child(1) { width: 64px; }
.custom-skeleton-line:nth-child(2) { width: 120px; }
.custom-skeleton-line:nth-child(3) { width: 84px; }

@keyframes custom-shimmer {
    0% { background-position: 0 0; }
    100% { background-position: -200% 0; }
}

/* ---------- Шаг оплаты (заказ не уходит продавцу до оплаты) ---------- */

.custom-pay {
    margin-top: 18px;
    padding: 24px;
    border: 2px solid var(--ink);
    border-radius: var(--radius-lg);
    background: var(--white);
}

.custom-pay__head h3 {
    margin: 6px 0 0;
    font-size: clamp(20px, 2.4vw, 30px);
    font-weight: 800;
    letter-spacing: -.06em;
}

.custom-pay__lead {
    max-width: 620px;
    margin: 10px 0 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.5;
}

.custom-pay__grid {
    display: grid;
    grid-template-columns: 1.15fr .85fr;
    gap: 20px;
    align-items: start;
    margin: 20px 0 0;
}

.custom-dl--pay {
    margin: 0;
}

.custom-pay__sum {
    padding: 18px;
    border: 1px solid var(--ink);
    border-radius: var(--radius-md);
    background: var(--acid);
}

.custom-pay__label {
    display: block;
    font-family: "DM Mono", monospace;
    font-size: 10px;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.custom-pay__amount {
    display: block;
    margin: 8px 0 0;
    font-size: clamp(28px, 3.4vw, 40px);
    font-weight: 800;
    letter-spacing: -.06em;
    line-height: 1;
}

.custom-pay__stub {
    margin: 12px 0 0;
    padding: 10px 12px;
    border: 2px dashed var(--coral);
    border-radius: 12px;
    background: #fff2ef;
    font-size: 11px;
    line-height: 1.45;
}

/* ---------- Адаптив ---------- */

@media (max-width: 1180px) {
    .custom-history__grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 1020px) {
    .custom-hero {
        grid-template-columns: 1fr;
    }

    .custom-hero__art {
        min-height: 200px;
    }

    .custom-step__grid,
    .custom-auth,
    .custom-approve-card {
        grid-template-columns: 1fr;
    }

    .custom-auth__art {
        min-height: 170px;
    }

    .custom-variants {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .custom-steps {
        flex-wrap: wrap;
    }

    .custom-steps__item {
        flex: 1 1 calc(50% - 8px);
    }
}

@media (max-width: 1020px) {
    .custom-pay__grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    .custom-page {
        padding: 18px 0 48px;
    }

    .custom-heading {
        flex-direction: column;
        align-items: flex-start;
    }

    .custom-hero__copy {
        padding: 22px 20px;
    }

    .custom-hero__facts li {
        min-width: 0;
        flex: 1 1 calc(50% - 5px);
    }

    .custom-hello {
        font-size: 13px;
    }

    .custom-hello a {
        margin-left: 0;
    }

    .custom-steps {
        gap: 6px;
    }

    .custom-steps__item {
        flex: 1 1 calc(50% - 6px);
        padding: 10px 11px;
    }

    .custom-steps__label {
        font-size: 12px;
    }

    .custom-step {
        padding: 18px 16px;
        border-radius: var(--radius-md);
    }

    .custom-auth__body {
        padding: 22px 18px;
    }

    .custom-auth__actions .button,
    .custom-actions .button,
    .custom-success__actions .button {
        width: 100%;
    }

    .custom-progress-head {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }

    .custom-progress-stage {
        text-align: left;
    }

    .custom-history__head {
        flex-direction: column;
        align-items: flex-start;
    }

    .custom-history__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 520px) {
    .custom-hero__sheet {
        width: 150px;
        height: 176px;
    }

    .custom-formats__grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .custom-variants {
        grid-template-columns: minmax(0, 1fr);
    }

    .custom-history__grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .custom-steps__item {
        flex: 1 1 100%;
    }

    .custom-drop__zone {
        min-height: 190px;
    }

    .custom-drop__preview {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 520px) {
    .custom-garment__info {
        padding: 11px 12px;
    }

    .custom-garment__info p {
        font-size: 12px;
    }

    .custom-garment-card {
        padding: 10px 11px;
    }

    .custom-garment-card__swatch {
        width: 28px;
        height: 28px;
    }
}

@media (max-width: 390px) {
    .custom-step,
    .custom-progress-card,
    .custom-callout {
        padding: 14px 12px;
    }

    .custom-drop__shot {
        width: 100%;
        height: 160px;
    }
}