/* AROLT v2 - личный кабинет (демо): кнопка в шапке, окно входа, сердце избранного, экран кабинета.
   Разметку рисует assets/v2/account.js, описание - docs/ACCOUNT.md. Токены и компоненты - из
   foundation.css (docs/DESIGN-V2.md): белые карточки с --shadow, радиус 20, капсулы, Onest 400/500. */

/* ==========================================================================
   1. Шапка: круг «Личный кабинет» рядом с корзиной (после входа - инициалы)
   ========================================================================== */
#v2 .hd-header .hd-account,
#v2 .hd-mobile-account {
  position: relative; display: inline-grid; place-items: center; flex: none;
  width: var(--circ); height: var(--circ); padding: 0;
  border: 0; border-radius: var(--r-pill);
  background: var(--field); color: var(--ink); text-decoration: none;
  transition: background-color var(--speed) var(--ease), color var(--speed) var(--ease);
}
#v2 .hd-header .hd-account:hover,
#v2 .hd-mobile-account:hover { background: var(--hairline); color: var(--ink); }
#v2 :is(.hd-account, .hd-mobile-account) svg {
  width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round;
}
#v2 :is(.hd-account, .hd-mobile-account).is-signed-in { background: var(--brand-tint); color: var(--brand-hover); }
#v2 :is(.hd-account, .hd-mobile-account).is-signed-in:hover { background: var(--brand-tint-2); }
#v2 :is(.hd-account, .hd-mobile-account).is-signed-in svg { display: none; }
#v2 .hd-account__initials { font: 500 14px/1 var(--font); letter-spacing: 0; white-space: nowrap; }
#v2 .hd-account__initials[hidden] { display: none; }
#v2 :is(.hd-account, .hd-mobile-account):focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
/* Боевой домен: account.js прячет входы (hidden) - правила display выше не должны их вернуть */
#v2 [data-account-entry][hidden], #v2 .hd-header .hd-account[hidden] { display: none; }
/* Узкий планшет (761-860): в первой строке шапки нет места на ещё один круг (поиск ушёл бы на
   третью строку) - кабинет стоит справа во второй строке, рядом с меню */
@media (min-width: 761px) and (max-width: 860px) {
  #v2 .hd-nav { flex: 1 1 calc(100% - 64px); width: auto; min-width: 0; }
  #v2 .hd-header .hd-account { order: 6; width: var(--circ-sm); height: var(--circ-sm); margin: 0 0 10px auto; }
}
/* Мобильный круг живёт в .hd-mobile-actions (видна только ≤ 760) */
#v2 .hd-mobile-account { width: var(--circ-sm); height: var(--circ-sm); }
@media (max-width: 760px) {
  #v2 .hd-header .hd-account { display: none; }
  #v2 .hd-mobile-account .hd-account__initials { font-size: 13px; }
}

/* ==========================================================================
   2. Окно входа - оболочка .quote-popup (5.11), своя ширина
   ========================================================================== */
#v2 .account-login .quote-popup__panel { width: min(440px, 100%); }
#v2 .account-login .quote-popup__head { padding-bottom: 4px; }
#v2 .account-login .quote-popup__form { gap: 16px; }
#v2 .account-login .quote-popup__actions { padding-top: 4px; }
#v2 .account-login .quote-popup__actions .btn { width: 100%; justify-self: stretch; }
#v2 body.has-account-login { overflow: hidden; }

/* ==========================================================================
   3. Сердце избранного: на фото карточки товара и на главном фото товара
   ========================================================================== */
#v2 .fav-toggle {
  position: absolute; z-index: 2; top: 8px; right: 8px;
  display: inline-grid; place-items: center;
  width: 36px; height: 36px; min-height: 0; padding: 0;
  border: 0; border-radius: var(--r-pill);
  background: rgb(255 255 255 / .92); color: var(--ink);
  box-shadow: 0 0 0 1px rgb(22 30 23 / .05), 0 2px 6px -2px rgb(22 30 23 / .12);
  cursor: pointer;
  transition: background-color var(--speed) var(--ease), color var(--speed) var(--ease);
}
#v2 .fav-toggle svg {
  width: 18px; height: 18px; fill: transparent; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round;
  transition: fill var(--speed) var(--ease);
}
#v2 .fav-toggle:hover { background: #fff; color: var(--brand); }
#v2 .fav-toggle[aria-pressed="true"] { color: var(--brand); }
#v2 .fav-toggle[aria-pressed="true"] svg { fill: currentColor; }
#v2 .fav-toggle:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
#v2 .fav-toggle.is-bump svg { animation: account-fav-bump .32s var(--ease); }
@keyframes account-fav-bump { 0% { transform: scale(1); } 45% { transform: scale(1.22); } 100% { transform: scale(1); } }
/* Главное фото товара - белое окно: сердце на светлой подложке, крупнее */
#v2 .main-photo > .fav-toggle--photo {
  top: 16px; right: 16px; width: var(--circ); height: var(--circ);
  background: var(--field); box-shadow: none;
}
#v2 .main-photo > .fav-toggle--photo:hover { background: var(--hairline); }
#v2 .main-photo > .fav-toggle--photo svg { width: 20px; height: 20px; }
@media (max-width: 760px) {
  #v2 .fav-toggle { top: 6px; right: 6px; width: 32px; height: 32px; }
  #v2 .fav-toggle svg { width: 16px; height: 16px; }
  /* Зона нажатия - 44px, сам круг прежний */
  #v2 .fav-toggle::after { content: ""; position: absolute; inset: -6px; border-radius: var(--r-pill); }
  #v2 .main-photo > .fav-toggle--photo { top: 12px; right: 12px; width: var(--circ-sm); height: var(--circ-sm); }
}
/* Каталог списком: окно фото 112px (телефон 88px) - сердце меньше, чтобы не закрывало товар */
#v2 #view-category .product-grid--list .fav-toggle { top: 4px; right: 4px; width: 28px; height: 28px; }
#v2 #view-category .product-grid--list .fav-toggle svg { width: 15px; height: 15px; }
/* Телефон: зона нажатия (::after, -6px) целиком внутри окна фото (каталог списком 88px, строка
   поиска 72px - размер сердца там задаёт catalog.css), иначе край срезан */
@media (max-width: 760px) {
  #v2 #view-category .product-grid--list .fav-toggle,
  #v2 #view-search .result-item__media > .fav-toggle { top: 6px; right: 6px; }
}
@media (prefers-reduced-motion: reduce) {
  #v2 .fav-toggle.is-bump svg { animation: none; }
}

/* ==========================================================================
   4. Экран кабинета: боковая панель разделов + содержимое
   ========================================================================== */
#v2 .account {
  display: grid; align-items: start;
  grid-template-columns: 280px minmax(0, 1fr);
  grid-template-areas: "side head" "side main";
  column-gap: clamp(24px, 3vw, 48px);
}
#v2 .account-head { grid-area: head; margin-bottom: clamp(24px, 2.6vw, 36px); }
#v2 .account-side { grid-area: side; }
#v2 .account-main { grid-area: main; min-width: 0; }
#v2 .account-head__row { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px 24px; }
#v2 .account-head__text { min-width: 0; }
#v2 .account-head h1 { margin: 0; font-size: var(--fs-h1); font-weight: 500; line-height: 1.06; letter-spacing: -0.03em; }
#v2 .account-head h1:focus { outline: 0; }
#v2 .account-head__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: 14px 0 0; color: var(--muted); font-size: 15px; }
#v2 .account-head__logout { display: none; }
#v2 .account-back {
  display: inline-flex; align-items: center; gap: 8px; margin-bottom: 16px;
  color: var(--brand); font-size: 15px; font-weight: 500; text-decoration: none;
}
#v2 .account-back svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; transition: transform var(--speed) var(--ease); }
#v2 .account-back:hover { color: var(--brand-hover); }
#v2 .account-back:hover svg { transform: translateX(-3px); }

/* Боковая панель */
#v2 .account-side {
  display: grid; gap: 4px;
  padding: var(--inset); border-radius: var(--r);
  background: var(--surface); box-shadow: var(--shadow);
}
#v2 .account-user {
  display: grid; grid-template-columns: 48px minmax(0, 1fr); align-items: center; gap: 12px;
  margin-bottom: 4px; padding: 14px 12px 16px;
  border-bottom: 1px solid var(--hairline);
}
#v2 .account-user__avatar {
  display: grid; place-items: center; width: 48px; height: 48px; border-radius: var(--r-pill);
  background: var(--brand-tint); color: var(--brand-hover); font: 500 16px/1 var(--font);
}
#v2 .account-user__text { display: grid; gap: 2px; min-width: 0; }
#v2 .account-user__text strong { overflow: hidden; color: var(--ink); font-size: 16px; font-weight: 500; line-height: 1.3; text-overflow: ellipsis; white-space: nowrap; }
#v2 .account-user__text span { overflow: hidden; color: var(--muted); font-size: 14px; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
#v2 .account-nav { display: grid; gap: 2px; }
#v2 :is(.account-nav__link, .account-nav__logout) {
  display: flex; align-items: center; gap: 12px;
  width: 100%; min-height: 48px; padding: 0 14px;
  border: 0; border-radius: var(--r-in);
  background: transparent; color: var(--ink);
  font: 400 15px/1.2 var(--font); text-align: left; text-decoration: none; cursor: pointer;
  transition: background-color var(--speed) var(--ease), color var(--speed) var(--ease);
}
#v2 :is(.account-nav__link, .account-nav__logout) svg {
  flex: none; width: 20px; height: 20px; fill: none; stroke: var(--muted); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round;
  transition: stroke var(--speed) var(--ease);
}
#v2 :is(.account-nav__link, .account-nav__logout):hover { background: var(--field); }
#v2 .account-nav__link[aria-current="page"] { background: var(--field); color: var(--brand); font-weight: 500; }
#v2 .account-nav__link[aria-current="page"] svg { stroke: var(--brand); }
#v2 :is(.account-nav__link, .account-nav__logout):focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }
#v2 .account-nav__count {
  display: inline-grid; place-items: center; min-width: 26px; height: 24px; margin-left: auto; padding: 0 8px;
  border-radius: var(--r-pill); background: var(--field); color: var(--muted);
  font-size: 13px; font-weight: 500; line-height: 1;
}
#v2 .account-nav__link[aria-current="page"] .account-nav__count { background: var(--brand-tint); color: var(--brand-hover); }
#v2 .account-nav__logout { margin-top: 4px; color: var(--muted); border-top: 1px solid var(--hairline); border-radius: 0 0 var(--r-in) var(--r-in); }
#v2 .account-nav__logout:hover { color: var(--ink); }

/* Белая карточка раздела */
#v2 .account-panel {
  padding: clamp(20px, 2.4vw, 32px); border-radius: var(--r);
  background: var(--surface); box-shadow: var(--shadow);
}
#v2 .account-section h2 { margin: 0 0 18px; font-size: var(--fs-h3); font-weight: 500; line-height: 1.25; letter-spacing: -0.015em; }
#v2 .account-muted { margin: 0; color: var(--muted); }

/* Вход не выполнен */
#v2 .account-guest { display: grid; justify-items: start; gap: 0; padding-bottom: 8px; }
#v2 .account-guest h1 { margin: 0 0 clamp(24px, 2.6vw, 36px); font-size: var(--fs-h1); font-weight: 500; line-height: 1.06; letter-spacing: -0.03em; }
#v2 .account-guest h1:focus { outline: 0; }
#v2 .account-guest__form { display: grid; gap: 24px; justify-self: stretch; }

/* Пустое избранное и заказы */
#v2 .account-empty { display: grid; justify-items: start; gap: 20px; }
#v2 .account-empty h2 { margin: 0; font-size: var(--fs-h3); font-weight: 500; line-height: 1.25; }
#v2 .account-empty .btn svg { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

/* ---- Профиль ---- */
#v2 .account-profile { display: grid; gap: 24px; }
#v2 .account-profile__payer { display: grid; gap: 10px; min-width: 0; margin: 0; padding: 0; border: 0; }
#v2 .account-profile__payer legend { margin-bottom: 10px; padding: 0 0 0 4px; }
/* Сегменты «Физлицо / Юрлицо» (как .v2-seg, но на радиокнопках) */
#v2 .account-seg { display: inline-flex; justify-self: start; gap: 0; padding: 4px; border-radius: var(--r-pill); background: var(--field); }
#v2 .account-seg label { position: relative; display: flex; cursor: pointer; }
#v2 .account-seg input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
#v2 .account-seg span {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 0 22px; border-radius: var(--r-pill);
  color: var(--muted); font: 400 15px/1 var(--font); white-space: nowrap;
  transition: background-color var(--speed) var(--ease), color var(--speed) var(--ease);
}
#v2 .account-seg label:hover span { color: var(--ink); }
#v2 .account-seg input:checked + span { background: var(--brand); color: #fff; }
#v2 .account-seg input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }
#v2 .account-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
#v2 .account-fields .field { display: grid; }
#v2 .account-fields .field[hidden] { display: none; }
#v2 .account-fields .field--full { grid-column: 1 / -1; }
#v2 .account-profile__actions { display: flex; }
#v2 .account-profile__actions .btn { min-width: 200px; }

/* ---- Избранное: та же карточка товара ---- */
#v2 .account-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gap); }

/* ---- Заказы: строки-ссылки ---- */
#v2 .account-orders { padding: var(--inset); }
#v2 .account-orders__head,
#v2 .account-order-row {
  display: grid; align-items: center; column-gap: 16px;
  grid-template-columns: minmax(120px, 1.1fr) minmax(96px, .8fr) minmax(120px, .9fr) minmax(140px, 1.1fr) minmax(120px, .9fr) 24px;
  padding: 0 16px;
}
#v2 .account-orders__head { min-height: 44px; color: var(--muted); font-size: 13px; }
#v2 .account-orders__head span:nth-child(5) { text-align: right; }
#v2 .account-orders__list { display: grid; margin: 0; padding: 0; list-style: none; }
#v2 .account-orders__list li + li .account-order-row::before {
  content: ""; position: absolute; top: 0; left: 16px; right: 16px; height: 1px; background: var(--hairline);
}
#v2 .account-order-row {
  position: relative; min-height: 76px; border-radius: var(--r-in);
  color: var(--ink); text-decoration: none;
  transition: background-color var(--speed) var(--ease);
}
#v2 .account-order-row:hover, #v2 .account-order-row:focus-visible { background: var(--field); }
#v2 .account-order-row:hover::before, #v2 li:hover + li .account-order-row::before { opacity: 0; }
#v2 .account-order-row:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }
#v2 .account-order-row__num { font-size: 16px; font-weight: 500; white-space: nowrap; }
#v2 .account-order-row__date, #v2 .account-order-row__lines { color: var(--muted); font-size: 15px; }
#v2 .account-order-row__total { font-size: 17px; font-weight: 500; letter-spacing: -0.02em; text-align: right; white-space: nowrap; }
#v2 .account-order-row__go { display: grid; place-items: center; color: var(--muted); transition: color var(--speed) var(--ease), transform var(--speed) var(--ease); }
#v2 .account-order-row__go svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
#v2 .account-order-row:hover .account-order-row__go { color: var(--brand); transform: translateX(3px); }

/* Статус заказа - бейдж с точкой (5.7) */
#v2 .account-status {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 28px; padding: 0 12px; border-radius: var(--r-pill);
  background: var(--field); color: var(--ink);
  font-size: 13px; font-weight: 500; line-height: 1.2; white-space: nowrap;
}
#v2 .account-status::before { content: ""; flex: none; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
#v2 .account-status--work { background: var(--warn-bg); color: var(--warn); }
#v2 .account-status--shipped { background: var(--brand-tint); color: var(--brand-hover); }
#v2 .account-status--delivered { background: var(--brand); color: #fff; }

/* ---- Карточка заказа ---- */
#v2 .account-order { display: grid; grid-template-columns: minmax(0, 1fr) 340px; align-items: start; gap: var(--gap); }
/* Колонка - minmax(0, 1fr): длинное имя файла или слово не раздвигает её за край */
#v2 .account-order__main, #v2 .account-order__aside { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--gap); min-width: 0; }

#v2 .account-items { display: grid; margin: 0; padding: 0; list-style: none; }
/* Количество и цена - под названием, сумма справа: в четыре колонки название сжималось до 60 px */
#v2 .account-item {
  display: grid; grid-template-columns: 72px minmax(0, 1fr) auto;
  grid-template-areas: "media body sum" "media qty sum";
  align-items: center; gap: 4px 20px;
  padding: 14px 0;
}
#v2 .account-item + .account-item { border-top: 1px solid var(--hairline); }
#v2 .account-item:first-child { padding-top: 0; }
#v2 .account-item:last-child { padding-bottom: 0; }
#v2 .account-item__media {
  grid-area: media; display: grid; place-items: center; width: 72px; height: 72px; overflow: hidden;
  border-radius: var(--r-in); background: var(--field);
}
#v2 .account-item__media img { width: 84%; height: 84%; object-fit: contain; mix-blend-mode: multiply; }
#v2 .account-item__noimg { width: 100%; height: 100%; }
#v2 .account-item__body { grid-area: body; display: grid; gap: 4px; min-width: 0; }
#v2 .account-item__title { color: var(--ink); font-size: 16px; font-weight: 500; line-height: 1.35; text-decoration: none; }
#v2 a.account-item__title:hover { color: var(--brand); }
#v2 .account-item__config { color: var(--ink-2); font-size: 14px; line-height: 1.4; }
#v2 .account-item__sku { color: var(--muted); font-size: 13px; line-height: 1.4; }
#v2 .account-item__qty { grid-area: qty; color: var(--muted); font-size: 14px; white-space: nowrap; }
#v2 .account-item__sum { grid-area: sum; font-size: 17px; font-weight: 500; letter-spacing: -0.02em; text-align: right; white-space: nowrap; }

#v2 .account-dl { display: grid; gap: 0; margin: 0; }
#v2 .account-dl > div { display: grid; grid-template-columns: minmax(140px, 200px) minmax(0, 1fr); gap: 4px 16px; padding: 10px 0; }
#v2 .account-dl > div + div { border-top: 1px solid var(--hairline); }
#v2 .account-dl > div:first-child { padding-top: 0; }
#v2 .account-dl > div:last-child { padding-bottom: 0; }
#v2 .account-dl dt { color: var(--muted); font-size: 15px; line-height: 1.45; }
#v2 .account-dl dd { margin: 0; color: var(--ink); font-size: 15px; line-height: 1.45; overflow-wrap: anywhere; }

#v2 .account-comment { margin: 0; color: var(--ink-2); font-size: 16px; line-height: 1.6; white-space: pre-line; overflow-wrap: anywhere; }
#v2 .account-files { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 0; padding: 0; list-style: none; }
#v2 .account-comment:empty + .account-files { margin-top: 0; }
#v2 .account-files li {
  display: inline-flex; align-items: center; gap: 8px; min-width: 0; min-height: 40px; max-width: 100%; padding: 0 14px;
  border-radius: var(--r-pill); background: var(--field); color: var(--ink); font-size: 14px;
}
#v2 .account-files li span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#v2 .account-files svg { flex: none; width: 16px; height: 16px; fill: none; stroke: var(--muted); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

/* Сумма */
#v2 .account-summary { display: grid; gap: 12px; }
#v2 .account-summary__line { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; color: var(--muted); font-size: 15px; }
#v2 .account-summary__line strong { color: var(--ink); font-weight: 500; text-align: right; }
#v2 .account-summary__total { display: grid; gap: 6px; margin-top: 4px; padding-top: 16px; border-top: 1px solid var(--hairline); }
#v2 .account-summary__total > span:first-child { color: var(--muted); font-size: 15px; }
#v2 .account-summary__total strong { font-size: clamp(28px, 2.4vw, 34px); font-weight: 500; line-height: 1.05; letter-spacing: -0.03em; }
#v2 .account-summary__total strong.is-pending { font-size: 22px; line-height: 1.2; letter-spacing: -0.02em; }
#v2 .account-summary__vat { color: var(--muted); font-size: 13px; line-height: 1.4; }
#v2 .account-summary .btn { width: 100%; margin-top: 8px; }
#v2 .account-summary .btn svg { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

/* История статусов */
#v2 .account-timeline { display: grid; margin: 0; padding: 0; list-style: none; }
#v2 .account-timeline__step { position: relative; display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 14px; padding-bottom: 20px; }
#v2 .account-timeline__step:last-child { padding-bottom: 0; }
#v2 .account-timeline__step:not(:last-child)::before {
  content: ""; position: absolute; top: 28px; bottom: 4px; left: 11px; width: 2px; border-radius: 2px; background: var(--hairline);
}
#v2 .account-timeline__step.is-done:not(.is-current):not(:last-child)::before { background: var(--brand-tint-2); }
#v2 .account-timeline__dot {
  display: grid; place-items: center; width: 24px; height: 24px; border-radius: var(--r-pill);
  background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--line-strong); color: #fff;
}
#v2 .account-timeline__step.is-done .account-timeline__dot { background: var(--brand); box-shadow: none; }
#v2 .account-timeline__dot svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
#v2 .account-timeline__text { display: grid; gap: 2px; padding-top: 1px; }
#v2 .account-timeline__text strong { color: var(--ink); font-size: 15px; font-weight: 500; line-height: 1.4; }
#v2 .account-timeline__step:not(.is-done) .account-timeline__text strong { color: var(--hint); font-weight: 400; }
#v2 .account-timeline__date { color: var(--muted); font-size: 13px; line-height: 1.4; }
#v2 .account-timeline__note { color: var(--ink-2); font-size: 14px; line-height: 1.45; }

/* ==========================================================================
   5. Сетки по ширинам
   ========================================================================== */
/* Две колонки заказа (от 1241 и 901-1099): сумма и статус липнут под шапкой, как итог заявки;
   выше окна - липнут нижним краем (--aside-h ставит account.js) */
@media (min-width: 1241px), (min-width: 901px) and (max-width: 1099px) {
  #v2 .account-order__aside {
    position: sticky;
    top: min(calc(var(--hd-h, 80px) + 16px), calc(100vh - var(--aside-h, 0px) - 16px));
  }
}
/* Одна колонка (до 900 и 1100-1240, где рядом панель разделов 280 px): сумма и «Повторить
   заказ» - первыми, история статусов - последней */
@media (max-width: 900px), (min-width: 1100px) and (max-width: 1240px) {
  #v2 .account-order { grid-template-columns: minmax(0, 1fr); }
  #v2 .account-order__aside { display: contents; }
  #v2 .account-summary { order: -1; }
}
/* Там же, когда сумма шире 600 px: строки слева, итог и кнопка справа (как итог заявки на планшете) */
@media (min-width: 601px) and (max-width: 900px), (min-width: 1100px) and (max-width: 1240px) {
  #v2 .account-summary { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: clamp(32px, 5vw, 64px); align-content: start; }
  #v2 .account-summary__line { grid-column: 1; }
  #v2 .account-summary__total { grid-column: 2; grid-row: 1 / span 3; margin-top: 0; padding-top: 0; border-top: 0; }
  #v2 .account-summary .btn { grid-column: 2; margin-top: 4px; }
}

@media (max-width: 1240px) {
  #v2 .account-orders__head,
  #v2 .account-order-row { grid-template-columns: minmax(110px, 1fr) minmax(90px, .8fr) minmax(110px, .9fr) minmax(120px, 1fr) minmax(110px, .9fr) 20px; column-gap: 12px; }
}

/* До 1099: панель разделов - вкладки под заголовком, «Выйти» - у заголовка */
@media (max-width: 1099px) {
  #v2 .account { grid-template-columns: minmax(0, 1fr); grid-template-areas: "head" "side" "main"; }
  #v2 .account-head { margin-bottom: 20px; }
  #v2 .account-head__logout { display: inline-flex; flex: none; min-height: var(--btn-h-sm); padding: 0 18px; font-size: 15px; }
  #v2 .account-head__logout svg { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
  #v2 .account-side { display: block; margin-bottom: 20px; padding: 0; border-radius: 0; background: transparent; box-shadow: none; }
  #v2 .account-user, #v2 .account-nav__logout { display: none; }
  #v2 .account-nav {
    display: inline-flex; gap: 0; padding: 4px; border-radius: var(--r-pill); background: var(--field);
  }
  #v2 .account-nav__link {
    justify-content: center; gap: 8px; width: auto; min-height: 44px; padding: 0 20px;
    border-radius: var(--r-pill); color: var(--muted); white-space: nowrap;
  }
  #v2 .account-nav__link svg { display: none; }
  #v2 .account-nav__link:hover { background: transparent; color: var(--ink); }
  #v2 .account-nav__link[aria-current="page"] { background: var(--brand); color: #fff; font-weight: 400; }
  #v2 .account-nav__count { min-width: 22px; height: 22px; margin-left: 0; padding: 0 7px; background: var(--surface); }
  #v2 .account-nav__link[aria-current="page"] .account-nav__count { background: rgb(255 255 255 / .2); color: #fff; }
}

@media (max-width: 900px) {
  #v2 .account-orders__head { display: none; }
  #v2 .account-order-row {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "num status" "date total" "lines total";
    row-gap: 4px; min-height: 0; padding: 16px;
  }
  #v2 .account-order-row__num { grid-area: num; }
  #v2 .account-order-row__status { grid-area: status; justify-self: end; }
  #v2 .account-order-row__date { grid-area: date; font-size: 14px; }
  #v2 .account-order-row__lines { grid-area: lines; font-size: 14px; }
  #v2 .account-order-row__total { grid-area: total; align-self: end; }
  #v2 .account-order-row__go { display: none; }
}

@media (max-width: 760px) {
  #v2 .account-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #v2 .account-head__row { align-items: flex-start; }
  /* Зона нажатия 40 px, как у хлебных крошек товара; текст на прежнем месте */
  #v2 .account-back { min-height: 40px; margin: -8px 0 8px; }
  #v2 .account-head__logout { margin-top: 2px; padding: 0 16px; }
  #v2 .account-side { margin-bottom: 16px; }
  #v2 .account-nav { display: flex; }
  #v2 .account-nav__link { flex: 1 1 auto; min-width: 0; padding: 0 12px; }
  #v2 .account-panel { padding: 20px 16px; }
  #v2 .account-orders { padding: 6px; }
  #v2 .account-order-row { padding: 14px 12px; }
  #v2 .account-fields { grid-template-columns: minmax(0, 1fr); }
  #v2 .account-seg { display: flex; justify-self: stretch; }
  #v2 .account-seg label { flex: 1 1 0; min-width: 0; }
  #v2 .account-seg span { width: 100%; padding: 0 10px; }
  #v2 .account-profile__actions .btn { width: 100%; }
  #v2 .account-grid { gap: 10px; }
  #v2 .account-item { grid-template-columns: 64px minmax(0, 1fr); grid-template-areas: "media body" "media qty" ". sum"; align-items: start; column-gap: 14px; row-gap: 6px; }
  #v2 .account-item__media { grid-area: media; width: 64px; height: 64px; }
  #v2 .account-item__body { grid-area: body; }
  #v2 .account-item__qty { grid-area: qty; font-size: 14px; }
  #v2 .account-item__sum { grid-area: sum; min-width: 0; text-align: left; font-size: 16px; }
  #v2 .account-dl > div { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  #v2 .account-dl dt { font-size: 14px; }
  #v2 .account-empty .btn { width: 100%; }
}

@media (max-width: 400px) {
  /* «Юридическое лицо» не помещается в половину строки - подпись в две строки, а не за край */
  #v2 .account-seg span { min-height: 44px; padding: 6px 8px; white-space: normal; text-align: center; line-height: 1.15; }
}
@media (max-width: 359px) {
  #v2 .account-nav__link { padding: 0 8px; font-size: 14px; gap: 6px; }
}

@media (prefers-reduced-motion: reduce) {
  #v2 .account-order-row__go, #v2 .account-back svg { transition: none; }
  #v2 .account-order-row:hover .account-order-row__go, #v2 .account-back:hover svg { transform: none; }
}
