/* /assets/css/account.css
 *
 * Кабинет покупателя. Требование владельца (2026-10-26): «Делай
 * полнофункциональный кабинет покупателя… Максимально продумано и удобно.»
 *
 * Стили живут ОТДЕЛЬНЫМ файлом и не трогают main.css: витрина общая, и любая
 * правка в main.css поехала бы по всем страницам. Здесь только кабинет,
 * на тех же токенах, что и витрина (--ink, --acid, --coral, --paper, --white,
 * --line), чтобы кабинет не выглядел чужим куском.
 */

.account-page {
    padding: 40px 0 72px;
}

.account-eyebrow {
    display: inline-block;
    font-family: "DM Mono", monospace;
    font-size: 11px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #6f6a60;
}

/* ─────────────────────────── Экран «Войдите» ─────────────────────────── */

.account-guest {
    display: flex;
    justify-content: center;
    padding: 24px 0;
}

.account-guest__card {
    width: 100%;
    max-width: 560px;
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: 24px;
    padding: 40px 36px;
    box-shadow: 0 20px 60px rgba(24, 24, 24, 0.06);
}

.account-guest__title {
    margin: 12px 0 14px;
    font-size: clamp(24px, 4vw, 32px);
    line-height: 1.15;
    letter-spacing: -0.02em;
}

.account-guest__text {
    margin: 0 0 24px;
    color: #55514a;
    line-height: 1.55;
}

.account-guest__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 24px;
}

.account-guest__points {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 10px;
    font-size: 14px;
    color: #55514a;
}

.account-guest__points li {
    position: relative;
    padding-left: 24px;
}

.account-guest__points li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 6px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--acid);
    border: 1px solid var(--ink);
}

/* ─────────────────────────── Кнопки ─────────────────────────── */

.account-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 20px;
    border-radius: 999px;
    border: 1px solid var(--ink);
    font-family: "DM Mono", monospace;
    font-size: 12px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
    background: transparent;
    color: var(--ink);
}

.account-button:hover {
    /* Правило владельца: при наведении объект не смещается и не растёт.
       Отклик даём цветом (см. :active для нажатия). */
    background-color: rgba(24, 24, 24, .06);
}

.account-button:active {
    transform: translateY(0);
}

.account-button:focus-visible {
    outline: 3px solid var(--coral);
    outline-offset: 2px;
}

.account-button--dark {
    background: var(--ink);
    color: var(--white);
}

.account-button--dark:hover {
    background: #000;
}

.account-button--ghost {
    background: transparent;
    color: var(--ink);
}

.account-button--ghost:hover {
    background: var(--paper);
}

.account-button--acid {
    background: var(--acid);
    color: var(--ink);
}

.account-button--small {
    min-height: 36px;
    padding: 0 14px;
    font-size: 11px;
}

.account-button[disabled] {
    opacity: 0.55;
    cursor: progress;
    transform: none;
}

/* ─────────────────────────── Шапка кабинета ─────────────────────────── */

.account-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 28px;
}

.account-head__title {
    margin: 6px 0 0;
    font-size: clamp(28px, 5vw, 44px);
    line-height: 1.05;
    letter-spacing: -0.03em;
}

/* ─────────────────────────── Раскладка и навигация ─────────────────────────── */

.account-layout {
    display: grid;
    grid-template-columns: 232px minmax(0, 1fr);
    gap: 32px;
    align-items: start;
}

.account-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
    position: sticky;
    top: 24px;
}

.account-nav__item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid transparent;
    color: var(--ink);
    text-decoration: none;
    font-size: 15px;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.account-nav__item:hover {
    background: var(--white);
    border-color: var(--line);
}

.account-nav__item:focus-visible {
    outline: 3px solid var(--coral);
    outline-offset: 2px;
}

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

.account-nav__icon {
    display: inline-flex;
    width: 20px;
    height: 20px;
    flex: 0 0 20px;
}

.account-nav__icon svg {
    width: 20px;
    height: 20px;
}

.account-nav__label {
    font-weight: 600;
}

/* ─────────────────────────── Панели ─────────────────────────── */

.account-content {
    min-width: 0;
}

.account-panel {
    display: none;
}

.account-panel.is-active {
    display: block;
    animation: account-fade 0.22s ease;
}

@keyframes account-fade {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
    .account-panel.is-active { animation: none; }
    .account-button { transition: none; }
}

.account-panel__title {
    margin: 0 0 20px;
    font-size: 22px;
    letter-spacing: -0.01em;
}

/* ─────────────────────────── Skeleton-загрузка ─────────────────────────── */

.account-skeleton {
    display: grid;
    gap: 14px;
}

.account-skeleton[hidden] {
    display: none;
}

.account-skeleton__row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 14px;
}

.account-skeleton__box,
.account-skeleton__card,
.account-skeleton__line {
    display: block;
    border-radius: 16px;
    background: linear-gradient(90deg, #eceae4 25%, #f4f2ec 37%, #eceae4 63%);
    background-size: 400% 100%;
    animation: account-shimmer 1.4s ease infinite;
}

.account-skeleton__box { height: 92px; }
.account-skeleton__card { height: 120px; }
.account-skeleton__line { height: 16px; border-radius: 8px; }
.account-skeleton__line--short { width: 55%; }

@keyframes account-shimmer {
    from { background-position: 100% 0; }
    to { background-position: 0 0; }
}

@media (prefers-reduced-motion: reduce) {
    .account-skeleton__box,
    .account-skeleton__card,
    .account-skeleton__line { animation: none; }
}

/* ─────────────────────────── Счётчики (обзор) ─────────────────────────── */

.account-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 14px;
    margin-bottom: 28px;
}

.account-stat {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 18px;
    display: grid;
    gap: 6px;
}

.account-stat--accent {
    background: var(--acid);
    border-color: var(--ink);
}

.account-stat__value {
    font-size: 30px;
    line-height: 1;
    letter-spacing: -0.02em;
    font-weight: 700;
}

.account-stat__label {
    font-size: 13px;
    color: #55514a;
}

.account-stat--accent .account-stat__label {
    color: #3d3a34;
}

/* ─────────────────────────── Блоки обзора ─────────────────────────── */

.account-section-title {
    margin: 0 0 12px;
    font-size: 15px;
    font-family: "DM Mono", monospace;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #6f6a60;
}

.account-last {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: 20px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
    margin-bottom: 28px;
}

.account-last__main {
    flex: 1 1 240px;
    min-width: 0;
}

.account-last__number {
    font-family: "DM Mono", monospace;
    font-size: 13px;
    color: #6f6a60;
}

.account-last__meta {
    margin-top: 4px;
    font-size: 15px;
    color: #55514a;
}

.account-quick {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

/* ─────────────────────────── Бейджи статусов ─────────────────────────── */

.account-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--paper);
    font-family: "DM Mono", monospace;
    font-size: 11px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    white-space: nowrap;
}

.account-badge--shipped {
    background: var(--acid);
    border-color: var(--ink);
}

.account-badge--delivered {
    background: #e8f6e4;
    border-color: #b6d9ac;
}

.account-badge--awaiting_payment,
.account-badge--paid,
.account-badge--assembling {
    background: #fff6d9;
    border-color: #e8d8a0;
}

.account-badge--cancelled,
.account-badge--refunded {
    background: #fbe9e6;
    border-color: #eec4bc;
    color: #8d3a2b;
}

/* ─────────────────────────── Панель инструментов заказов ─────────────────────────── */

.account-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.account-filters {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.account-chip {
    padding: 9px 16px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--white);
    color: var(--ink);
    font-size: 13px;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.account-chip:hover {
    border-color: var(--ink);
}

.account-chip:focus-visible {
    outline: 3px solid var(--coral);
    outline-offset: 2px;
}

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

.account-search {
    position: relative;
    flex: 1 1 260px;
    max-width: 380px;
}

.account-search input {
    width: 100%;
    min-height: 44px;
    padding: 0 40px 0 16px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--white);
    color: var(--ink);
    font-family: inherit;
    font-size: 14px;
}

.account-search input:focus-visible {
    outline: 3px solid var(--coral);
    outline-offset: 1px;
    border-color: var(--ink);
}

.account-search__hint {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-family: "DM Mono", monospace;
    font-size: 12px;
    color: #a9a49a;
    pointer-events: none;
}

/* ─────────────────────────── Карточки заказов ─────────────────────────── */

.account-orders {
    display: grid;
    gap: 12px;
}

.account-order {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: 18px;
    overflow: hidden;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.account-order:hover {
    border-color: #c9c4b9;
}

.account-order.is-open {
    border-color: var(--ink);
    box-shadow: 0 12px 32px rgba(24, 24, 24, 0.08);
}

.account-order__head {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 18px;
    width: 100%;
    background: transparent;
    border: 0;
    text-align: left;
    cursor: pointer;
    font: inherit;
    color: inherit;
}

.account-order__head:focus-visible {
    outline: 3px solid var(--coral);
    outline-offset: -3px;
}

.account-order__thumb {
    width: 52px;
    height: 52px;
    flex: 0 0 52px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: var(--paper) center / cover no-repeat;
    overflow: hidden;
}

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

.account-order__info {
    flex: 1 1 auto;
    min-width: 0;
    display: grid;
    gap: 4px;
}

.account-order__number {
    font-family: "DM Mono", monospace;
    font-size: 13px;
    letter-spacing: 0.02em;
}

.account-order__meta {
    font-size: 13px;
    color: #6f6a60;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.account-order__right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 0 0 auto;
}

.account-order__total {
    font-weight: 700;
    font-size: 15px;
    white-space: nowrap;
}

.account-order__chevron {
    width: 20px;
    height: 20px;
    flex: 0 0 20px;
    transition: transform 0.18s ease;
    color: #6f6a60;
}

.account-order.is-open .account-order__chevron {
    transform: rotate(180deg);
}

.account-order__body {
    border-top: 1px solid var(--line);
    padding: 18px;
    display: grid;
    gap: 20px;
    background: #fdfcf9;
}

.account-order__body[hidden] {
    display: none;
}

.account-order__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 18px;
}

.account-detail {
    display: grid;
    gap: 4px;
}

.account-detail__label {
    font-family: "DM Mono", monospace;
    font-size: 11px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #8d887e;
}

.account-detail__value {
    font-size: 14px;
    line-height: 1.45;
    word-break: break-word;
}

/* Позиции заказа */

.account-items {
    display: grid;
    gap: 10px;
}

.account-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: 12px;
}

.account-item__thumb {
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    border-radius: 8px;
    border: 1px solid var(--line);
    object-fit: cover;
    background: var(--paper);
}

.account-item__title {
    flex: 1 1 auto;
    font-size: 14px;
    min-width: 0;
}

.account-item__price {
    font-family: "DM Mono", monospace;
    font-size: 13px;
    white-space: nowrap;
}

.account-item__tag {
    font-family: "DM Mono", monospace;
    font-size: 10px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 3px 8px;
    border-radius: 999px;
    background: var(--acid);
    border: 1px solid var(--ink);
    white-space: nowrap;
}

/* История статусов */

.account-timeline {
    display: grid;
    gap: 0;
    margin: 0;
    padding: 0;
    list-style: none;
}

.account-timeline__item {
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr);
    gap: 12px;
    padding-bottom: 16px;
    position: relative;
}

.account-timeline__item:not(:last-child)::before {
    content: "";
    position: absolute;
    left: 8px;
    top: 18px;
    bottom: 0;
    width: 1px;
    background: var(--line);
}

.account-timeline__dot {
    width: 10px;
    height: 10px;
    margin-top: 6px;
    margin-left: 3px;
    border-radius: 50%;
    background: var(--white);
    border: 2px solid #c9c4b9;
}

.account-timeline__item.is-last .account-timeline__dot {
    background: var(--acid);
    border-color: var(--ink);
}

.account-timeline__title {
    font-size: 14px;
    font-weight: 600;
}

.account-timeline__meta {
    font-size: 12px;
    color: #6f6a60;
    margin-top: 2px;
}

.account-timeline__comment {
    font-size: 13px;
    color: #55514a;
    margin-top: 4px;
}

/* Трек-код */

.account-track {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    padding: 10px 14px;
    border-radius: 12px;
    background: var(--paper);
    border: 1px dashed #c9c4b9;
}

.account-track__code {
    font-family: "DM Mono", monospace;
    font-size: 14px;
    letter-spacing: 0.06em;
}

.account-track__link {
    font-size: 13px;
    color: var(--ink);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.account-track__link:focus-visible {
    outline: 3px solid var(--coral);
    outline-offset: 2px;
}

/* ─────────────────────────── Принты ─────────────────────────── */

.account-prints {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 16px;
}

.account-print {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: 18px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.account-print__media {
    aspect-ratio: 4 / 3;
    background: var(--paper) center / cover no-repeat;
    border-bottom: 1px solid var(--line);
    position: relative;
}

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

.account-print__placeholder {
    width: 100%;
    height: 100%;
    display: grid;
    place-items: center;
    font-family: "DM Mono", monospace;
    font-size: 12px;
    color: #a9a49a;
}

.account-print__format {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 4px 10px;
    border-radius: 999px;
    background: var(--ink);
    color: var(--white);
    font-family: "DM Mono", monospace;
    font-size: 11px;
}

.account-print__body {
    padding: 14px;
    display: grid;
    gap: 8px;
    flex: 1 1 auto;
    align-content: start;
}

.account-print__status {
    font-size: 13px;
    font-weight: 600;
}

.account-print__meta {
    font-size: 12px;
    color: #6f6a60;
}

.account-print__actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 4px;
}

/* ─────────────────────────── Профиль ─────────────────────────── */

.account-profile {
    display: grid;
    gap: 20px;
    max-width: 560px;
}

.account-card {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: 20px;
    padding: 22px;
    display: grid;
    gap: 14px;
}

.account-field {
    display: grid;
    gap: 6px;
}

.account-field__label {
    font-family: "DM Mono", monospace;
    font-size: 11px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #8d887e;
}

.account-field input {
    min-height: 44px;
    padding: 0 14px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: var(--white);
    font-family: inherit;
    font-size: 14px;
    color: var(--ink);
}

.account-field input:focus-visible {
    outline: 3px solid var(--coral);
    outline-offset: 1px;
    border-color: var(--ink);
}

.account-field input[readonly] {
    background: var(--paper);
    color: #6f6a60;
    cursor: not-allowed;
}

.account-field__hint {
    font-size: 12px;
    color: #8d887e;
}

.account-field__error {
    font-size: 12px;
    color: #b03a25;
}

.account-profile__actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

/* ─────────────────────────── Сообщения ─────────────────────────── */

.account-notice {
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 14px;
    border: 1px solid var(--line);
    background: var(--paper);
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.account-notice--ok {
    background: #e8f6e4;
    border-color: #b6d9ac;
}

.account-notice--error {
    background: #fbe9e6;
    border-color: #eec4bc;
    color: #8d3a2b;
}

/* ─────────────────────────── Пустые состояния и ошибки ─────────────────────────── */

.account-empty {
    border: 1px dashed #c9c4b9;
    border-radius: 18px;
    padding: 40px 24px;
    text-align: center;
    background: var(--white);
    display: grid;
    gap: 12px;
    justify-items: center;
}

.account-empty__title {
    font-size: 17px;
    font-weight: 600;
}

.account-empty__text {
    font-size: 14px;
    color: #6f6a60;
    max-width: 420px;
    line-height: 1.5;
}

/* ─────────────────────────── Пагинация ─────────────────────────── */

.account-pager {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 20px;
}

.account-pager[hidden] {
    display: none;
}

.account-pager__info {
    font-family: "DM Mono", monospace;
    font-size: 12px;
    color: #6f6a60;
}

/* ─────────────────────────── Мобильный 390px ─────────────────────────── */

@media (max-width: 860px) {
    .account-layout {
        grid-template-columns: minmax(0, 1fr);
        gap: 20px;
    }

    /* Сайдбар превращается в горизонтальную ленту табов: вертикальный
       список на телефоне съедал бы пол-экрана до контента. */
    .account-nav {
        position: static;
        flex-direction: row;
        overflow-x: auto;
        gap: 8px;
        padding-bottom: 4px;
        scrollbar-width: thin;
        -webkit-overflow-scrolling: touch;
    }

    .account-nav__item {
        flex: 0 0 auto;
        padding: 10px 16px;
        border-color: var(--line);
        background: var(--white);
    }

    .account-nav__icon {
        display: none;
    }

    .account-order__head {
        flex-wrap: wrap;
        gap: 12px;
    }

    .account-order__right {
        width: 100%;
        justify-content: space-between;
    }

    .account-toolbar {
        align-items: stretch;
    }

    .account-search {
        max-width: none;
    }
}

@media (max-width: 480px) {
    .account-page {
        padding: 24px 0 56px;
    }

    .account-guest__card {
        padding: 26px 20px;
        border-radius: 18px;
    }

    .account-guest__actions {
        flex-direction: column;
    }

    .account-guest__actions .account-button {
        width: 100%;
    }

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

    .account-stat {
        padding: 14px;
    }

    .account-stat__value {
        font-size: 24px;
    }

    .account-prints {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 12px;
    }

    .account-order__head {
        padding: 14px;
    }

    .account-order__body {
        padding: 14px;
    }

    .account-card {
        padding: 16px;
        border-radius: 16px;
    }

    .account-profile__actions .account-button {
        width: 100%;
    }

    .account-last {
        padding: 16px;
    }
}
/* ═══ СООБЩЕНИЯ: список чатов и переписка ══════════════════════════════════
 *
 * Требование владельца (2026-10-26): «Проработай UI чатов и механику
 * максимально качественно (AJAX на 100%) и скрупулезно.»
 *
 * Таб «Сообщения» держит ДВА экрана в одном месте: список тредов и открытую
 * переписку. Переключение — классом/атрибутом hidden, без перезагрузки:
 * поэтому список остаётся в DOM и возврат к нему мгновенный.
 */

.account-chat-list {
    display: grid;
    gap: 8px;
}

.account-chat-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    width: 100%;
    padding: 13px 14px;
    border: 1px solid var(--line, #dedbd3);
    border-radius: 14px;
    background: var(--white, #fffefa);
    color: var(--ink, #181818);
    font-family: inherit;
    text-align: left;
    cursor: pointer;
    transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}

.account-chat-item:hover {
    border-color: var(--ink, #181818);
    box-shadow: 0 6px 20px rgba(24, 24, 24, .07);
}

.account-chat-item:focus-visible {
    outline: 2px solid var(--ink, #181818);
    outline-offset: 2px;
}

/* Непрочитанное видно сразу: слева акцентная полоса. */
.account-chat-item.is-unread {
    border-left: 3px solid var(--acid, #d7ff36);
    background: #fdfff4;
}

.account-chat-item.is-closed {
    opacity: .72;
}

.account-chat-item__thumb {
    flex: 0 0 auto;
    width: 46px;
    height: 46px;
    border: 1px solid var(--line, #dedbd3);
    border-radius: 10px;
    background: var(--paper, #f6f4ef);
    object-fit: cover;
}

.account-chat-item__thumb--empty {
    display: grid;
    place-items: center;
    color: var(--muted, #706d66);
    font-size: 18px;
}

.account-chat-item__main {
    display: grid;
    min-width: 0;
    flex: 1 1 auto;
    gap: 2px;
}

.account-chat-item__top {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
}

.account-chat-item__title {
    overflow: hidden;
    font-size: 13px;
    font-weight: 800;
    line-height: 1.3;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.account-chat-item__time {
    flex: 0 0 auto;
    color: var(--muted, #706d66);
    font-family: 'DM Mono', monospace;
    font-size: 10px;
}

.account-chat-item__store {
    overflow: hidden;
    color: var(--muted, #706d66);
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.account-chat-item__preview {
    display: -webkit-box;
    overflow: hidden;
    color: var(--muted, #706d66);
    font-size: 11.5px;
    line-height: 1.4;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 1;
}

.account-chat-item__badge {
    flex: 0 0 auto;
    display: grid;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    place-items: center;
    border-radius: 11px;
    background: var(--coral, #ff715f);
    color: var(--white, #fffefa);
    font-family: 'DM Mono', monospace;
    font-size: 11px;
    font-weight: 700;
}

/* ─── Открытая переписка ─────────────────────────────────────────────────── */

.account-chat {
    display: flex;
    flex-direction: column;
    min-height: 380px;
    border: 1px solid var(--line, #dedbd3);
    border-radius: 16px;
    background: var(--white, #fffefa);
    overflow: hidden;
}

/* [hidden] должен побеждать display: flex — иначе атрибут hidden не работает
   и переписка висела открытой вместе со списком (проверено живьём). */
.account-chat[hidden] {
    display: none;
}

.account-chat__head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--line, #dedbd3);
    background: var(--paper, #f6f4ef);
}

.account-chat__back {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 10px 6px 6px;
    border: 1px solid var(--line, #dedbd3);
    border-radius: 10px;
    background: var(--white, #fffefa);
    color: var(--ink, #181818);
    font-family: inherit;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
}

.account-chat__back svg {
    width: 15px;
    height: 15px;
}

.account-chat__back:hover {
    border-color: var(--ink, #181818);
}

.account-chat__who {
    display: grid;
    min-width: 0;
    flex: 1 1 auto;
}

.account-chat__eyebrow {
    color: var(--muted, #706d66);
    font-family: 'DM Mono', monospace;
    font-size: 9.5px;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.account-chat__title {
    overflow: hidden;
    font-size: 13px;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.account-chat__close-thread {
    flex: 0 0 auto;
    padding: 8px 12px;
    border: 1px solid var(--line, #dedbd3);
    border-radius: 10px;
    background: var(--white, #fffefa);
    color: var(--ink, #181818);
    font-family: inherit;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
}

.account-chat__close-thread:hover:not(:disabled) {
    border-color: var(--coral, #ff715f);
    color: #b3341f;
}

.account-chat__close-thread:disabled {
    opacity: .55;
    cursor: default;
}

.account-chat__thread {
    padding: 10px 14px 0;
}

.account-chat-product {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 11px;
    border: 1px dashed var(--line, #dedbd3);
    border-radius: 12px;
    color: var(--ink, #181818);
    text-decoration: none;
}

.account-chat-product:hover {
    border-color: var(--ink, #181818);
}

.account-chat-product__thumb {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    object-fit: cover;
}

.account-chat-product__title {
    display: -webkit-box;
    min-width: 0;
    flex: 1 1 auto;
    overflow: hidden;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.35;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.account-chat-product__go {
    flex: 0 0 auto;
    color: var(--muted, #706d66);
    font-size: 11px;
    font-weight: 700;
}

.account-chat__body {
    flex: 1 1 auto;
    max-height: 420px;
    overflow-y: auto;
    padding: 14px;
    overscroll-behavior: contain;
}

.account-msg {
    display: flex;
    margin-bottom: 10px;
}

.account-msg.is-mine {
    justify-content: flex-end;
}

.account-msg__bubble {
    max-width: 78%;
    padding: 9px 12px;
    border: 1px solid var(--line, #dedbd3);
    border-radius: 14px 14px 14px 4px;
    background: var(--paper, #f6f4ef);
    font-size: 13px;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.account-msg.is-mine .account-msg__bubble {
    border-color: var(--ink, #181818);
    border-radius: 14px 14px 4px 14px;
    background: var(--ink, #181818);
    color: var(--white, #fffefa);
}

.account-msg__author {
    display: block;
    margin-bottom: 3px;
    color: var(--muted, #706d66);
    font-size: 10px;
    font-weight: 700;
}

.account-msg__text {
    display: block;
    white-space: pre-wrap;
}

.account-msg__meta {
    display: flex;
    gap: 6px;
    margin-top: 5px;
    font-family: 'DM Mono', monospace;
    font-size: 9.5px;
    opacity: .72;
}

.account-msg.is-mine .account-msg__meta {
    justify-content: flex-end;
}

.account-chat__compose {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    padding: 12px 14px;
    border-top: 1px solid var(--line, #dedbd3);
}

.account-chat__input {
    flex: 1 1 auto;
    min-height: 42px;
    max-height: 128px;
    padding: 10px 12px;
    border: 1px solid var(--line, #dedbd3);
    border-radius: 12px;
    background: var(--paper, #f6f4ef);
    color: var(--ink, #181818);
    font-family: inherit;
    font-size: 13px;
    line-height: 1.4;
    resize: none;
}

.account-chat__input:focus {
    border-color: var(--ink, #181818);
    background: var(--white, #fffefa);
    outline: none;
}

.account-chat__send {
    flex: 0 0 auto;
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    border: 1px solid var(--ink, #181818);
    border-radius: 12px;
    background: var(--ink, #181818);
    color: var(--white, #fffefa);
    cursor: pointer;
}

.account-chat__send:hover:not(:disabled) {
    background: #2f2f2f;
}

.account-chat__send:disabled {
    opacity: .5;
    cursor: default;
}

.account-chat__send svg {
    width: 18px;
    height: 18px;
}

.account-chat__hint {
    margin: 0;
    padding: 0 14px 12px;
    color: var(--muted, #706d66);
    font-family: 'DM Mono', monospace;
    font-size: 9.5px;
}

/* ─── Мобильный 390px: чат занимает экран, ничего не разъезжается ────────── */

@media (max-width: 640px) {
    .account-chat__head {
        flex-wrap: wrap;
        gap: 8px;
    }

    .account-chat__who {
        order: 3;
        flex-basis: 100%;
    }

    .account-chat__body {
        max-height: none;
        min-height: 300px;
    }

    .account-msg__bubble {
        max-width: 88%;
        font-size: 14px;
    }

    .account-chat__input {
        font-size: 16px; /* iOS не приближает страницу при фокусе */
    }

    .account-chat-item__title {
        white-space: normal;
    }
}