/* ==========================================================================
   Профиль «как приложение» — страница /account («Объявления»), 29.09.2026.
   Подключается из pages/account/index и notifications (обёртка .acc2), из
   layouts/account на странице сообщений (корень .account-chats) и из обеих
   страниц избранного (корень .fav-page). Область действия —
   .account:has(.acc2, .account-chats, .fav-page), поэтому остальные
   страницы кабинета (у них тот же layout и боковое меню) не меняются. Логика не тронута: вкладки ?status=, .post-item-*, .stock-button,
   .item-restore-btn, .item-promote-btn, data-popup-trigger — как были.
   ПК — макет «Профиль — ПК (новая шапка)»; телефон — экран профиля
   приложения (lib/features/account/screens/account_screen.dart).
   Шрифт — сайта (Inter пока только на главной, решение Амира 29.09).
   ========================================================================== */

/* Подложка под кнопки шапки профиля: violet 14 % (_HeaderButton). Старым
   браузерам без color-mix — ближайший токен. */
.acc2-hbtn {
	background: var(--card-lilac);
	background: color-mix(in srgb, var(--accent) 14%, transparent);
}

/* Заголовок layout «Объявления» остаётся в <title>, на экране — свой. */
.account:has(.acc2, .account-chats, .fav-page) .account-content > .title {
	display: none;
}

.acc2-title {
	margin: 0;
	color: var(--black);
}

.acc2-sub {
	color: var(--gray);
}

/* Вкладки-чипы (оба размера): подчёркивание прежнего вида убрано */
.account:has(.acc2, .account-chats, .fav-page) .item-tabs a:after {
	display: none;
}

.account:has(.acc2, .account-chats, .fav-page) .item-tabs a {
	display: flex;
	align-items: center;
	white-space: nowrap;
	background: var(--light);
	color: var(--black);
	transition: background 0.2s ease, color 0.2s ease;
}

.account:has(.acc2, .account-chats, .fav-page) .item-tabs a.active {
	background: var(--accent);
	color: var(--white);
}

/* Карточка своего объявления: название → город → цена (как в приложении),
   ниже ID и кнопки. Порядок — через order, разметка общей карточки
   components/main/item.blade.php не менялась. */
.acc2 .post-item {
	display: flex;
	flex-direction: column;
	min-width: 0;
}

.acc2 .post-item-image {
	aspect-ratio: 164 / 182;
	border-radius: 24px;
	margin-bottom: 0;
}

.acc2 .post-item-image img {
	aspect-ratio: auto;
}

.acc2 .post-item-title {
	order: 1;
	padding: 0;
}

.acc2 .post-item-location {
	order: 2;
	padding: 0;
	overflow: hidden;
	white-space: nowrap;
	text-overflow: ellipsis;
}

.acc2 .post-item-pair {
	order: 3;
	padding: 0;
}

.acc2 .post-item-id {
	order: 4;
}

.acc2 .item-restore-btn,
.acc2 .item-promote-btn,
.acc2 .item-promo-progress {
	order: 5;
}

/* «Продвинуть» — лиловая кнопка приложения вместо градиента */
.acc2 .item-promote-btn:not(.item-promote-btn--pending) {
	background-image: none;
	background: var(--card-lilac);
	background: color-mix(in srgb, var(--accent) 10%, transparent);
	color: var(--accent);
	font-weight: 700;
}

.acc2 .item-promote-btn:not(.item-promote-btn--pending):hover {
	opacity: 1;
	background: var(--card-lilac);
}

/* Переключатель наличия (магазин) — как _StockToggle 36×20 */
.acc2 .stock-button {
	width: 36px;
	border-radius: 666px;
}

.acc2 .stock-button.active span {
	transform: translateX(16px);
}

.acc2 .post-item--archived .item-restore-btn {
	background: var(--accent);
	font-weight: 600;
}

/* ==========================================================================
   ПК (≥769) — макет «Профиль — ПК»
   ========================================================================== */
@media (min-width: 769px) {
	.acc2-head,
	.acc2-help-m {
		display: none;
	}

	/* Серый фон сразу под шапкой: у .header--v2 margin-bottom 32 px */
	main.content:has(.acc2, .account-chats, .fav-page) {
		background: var(--light);
		margin-top: -32px;
		padding: 32px 0 80px;
	}

	/* серый фон — вплотную к подвалу (у .footer margin-top 100 px) */
	body:has(.acc2, .account-chats, .fav-page) .footer {
		margin-top: 0;
	}

	.account:has(.acc2, .account-chats, .fav-page) .account-grid {
		grid-template-columns: 290px minmax(0, 1fr);
		gap: 24px;
	}

	/* --- Левая колонка: три белые карточки --- */
	.account:has(.acc2, .account-chats, .fav-page) .sidebar {
		display: flex;
		flex-direction: column;
		gap: 12px;
		padding: 0;
		background: none;
		border-radius: 0;
	}

	.account:has(.acc2, .account-chats, .fav-page) .sidebar-account-info {
		background: var(--white);
		border-radius: 24px;
		padding: 20px;
		margin: 0;
		border: 0;
		gap: 14px;
	}

	.account:has(.acc2, .account-chats, .fav-page) .sidebar-avatar {
		background: var(--card-lilac);
	}

	.account:has(.acc2, .account-chats, .fav-page) .account-name {
		font-size: 19px;
		font-weight: 700;
		line-height: 24px;
		margin-bottom: 4px;
	}

	.account:has(.acc2, .account-chats, .fav-page) .account-id {
		line-height: 18px;
	}

	.account:has(.acc2, .account-chats, .fav-page) .sidebar-menu {
		background: var(--white);
		border-radius: 24px;
		padding: 8px;
	}

	.account:has(.acc2, .account-chats, .fav-page) .sidebar-menu ul {
		display: flex;
		flex-direction: column;
		gap: 2px;
	}

	.account:has(.acc2, .account-chats, .fav-page) .sidebar-menu li {
		margin: 0;
	}

	.account:has(.acc2, .account-chats, .fav-page) .sidebar-menu li:last-child {
		margin-top: 6px;
		padding-top: 6px;
		border-top: 1px solid var(--light);
	}

	.account:has(.acc2, .account-chats, .fav-page) .sidebar-menu a {
		height: 48px;
		gap: 12px;
		padding: 0 14px;
		border-radius: 14px;
		font-size: 16px;
		font-weight: 500;
		color: var(--black);
		transition: background 0.2s ease, color 0.2s ease;
	}

	.account:has(.acc2, .account-chats, .fav-page) .sidebar-menu a svg {
		width: 22px;
		height: 22px;
		color: var(--label-gray);
	}

	.account:has(.acc2, .account-chats, .fav-page) .sidebar-menu a:hover {
		background: var(--light);
		color: var(--black);
	}

	.account:has(.acc2, .account-chats, .fav-page) .sidebar-menu a.active {
		background: var(--card-lilac);
		color: var(--accent-alternate);
	}

	.account:has(.acc2, .account-chats, .fav-page) .sidebar-menu a.active svg {
		color: var(--accent);
	}

	.account:has(.acc2, .account-chats, .fav-page) .sidebar-menu li:last-child a {
		color: var(--gray);
		font-size: 15px;
	}

	.account:has(.acc2, .account-chats, .fav-page) .sidebar-menu li:last-child a:hover {
		color: var(--red);
		opacity: 1;
	}

	.account:has(.acc2, .account-chats, .fav-page) .sidebar-menu .account-sidebar-count {
		background: var(--card-lilac);
		color: var(--accent-alternate);
		border-radius: 8px;
		font-size: 13px;
	}

	.account:has(.acc2, .account-chats, .fav-page) .sidebar-menu a.active .account-sidebar-count {
		background: var(--white);
	}

	.account:has(.acc2, .account-chats, .fav-page) .sidebar-menu .account-sidebar-count--red {
		background: var(--badge-red);
		color: var(--white);
		border-radius: 10px;
		font-size: 12px;
		font-weight: 700;
	}

	/* у активного пункта белая подложка выше перебивала красную — цифра
	   белым по белому (29.09.2026, «Техподдержка»/«Сообщения») */
	.account:has(.acc2, .account-chats, .fav-page) .sidebar-menu a.active .account-sidebar-count--red {
		background: var(--badge-red);
	}

	/* --- «Нужна помощь?» --- */
	.acc2-help {
		position: relative;
		overflow: hidden;
		background: var(--white);
		border-radius: 24px;
		padding: 20px 20px 8px;
	}

	.acc2-help__robot {
		position: absolute;
		right: -14px;
		top: 4px;
		width: 132px;
		height: auto;
		pointer-events: none;
	}

	.acc2-help__title {
		position: relative;
		max-width: 150px;
		font-size: 18px;
		font-weight: 700;
		line-height: 22px;
		color: var(--black);
	}

	.acc2-help__text {
		position: relative;
		max-width: 140px;
		margin-top: 6px;
		font-size: 13px;
		line-height: 18px;
		color: var(--gray);
	}

	.acc2-help__btn {
		position: relative;
		margin-top: 14px;
		height: 40px;
		border-radius: 12px;
		background: var(--black);
		color: var(--white);
		font-size: 14px;
		font-weight: 600;
		display: flex;
		align-items: center;
		justify-content: center;
		transition: background 0.2s ease;
	}

	.acc2-help__btn:hover {
		background: var(--accent);
		color: var(--white);
	}

	.acc2-help__links {
		margin-top: 12px;
	}

	.acc2-help__links a {
		height: 44px;
		display: flex;
		align-items: center;
		justify-content: space-between;
		gap: 8px;
		border-top: 1px solid var(--light);
		font-size: 15px;
		color: var(--black);
		transition: color 0.2s ease;
	}

	.acc2-help__links a span {
		color: var(--label-gray);
	}

	.acc2-help__links a:hover {
		color: var(--accent);
	}

	/* --- Правая часть: белая карточка «Мои объявления» --- */
	.account:has(.acc2, .account-chats, .fav-page) .account-content {
		background: var(--white);
		border-radius: 24px;
		padding: 32px;
		min-height: 600px;
	}

	.acc2-top {
		display: flex;
		justify-content: space-between;
		align-items: flex-start;
		gap: 16px;
		margin-bottom: 22px;
	}

	.acc2-title {
		font-size: 34px;
		font-weight: 700;
		line-height: 1.15;
		letter-spacing: -0.6px;
	}

	.acc2-sub {
		margin-top: 6px;
		font-size: 15px;
	}

	.acc2-sharebtn {
		flex-shrink: 0;
		height: 44px;
		border: 0;
		border-radius: 14px;
		background: var(--card-lilac);
		color: var(--accent-alternate);
		display: flex;
		align-items: center;
		gap: 8px;
		padding: 0 14px;
		font: inherit;
		font-size: 14px;
		font-weight: 600;
		cursor: pointer;
		transition: background 0.2s ease;
	}

	.acc2-sharebtn:hover {
		background: var(--light-gray);
	}

	.account:has(.acc2, .account-chats, .fav-page) .item-tabs {
		gap: 8px;
		margin: 0 0 22px;
	}

	.account:has(.acc2, .account-chats, .fav-page) .item-tabs a {
		height: 40px;
		padding: 0 16px;
		border-radius: 12px;
		font-size: 15px;
		font-weight: 500;
	}

	.account:has(.acc2, .account-chats, .fav-page) .item-tabs a:not(.active):hover {
		background: var(--card-lilac);
		color: var(--black);
	}

	.acc2 .posts-grid {
		grid-template-columns: repeat(4, minmax(0, 1fr));
		gap: 28px 20px;
	}

	.acc2 .post-item-title {
		margin-top: 12px;
		font-size: 16px;
		font-weight: 500;
		line-height: 20px;
	}

	.acc2 .post-item-location {
		margin-top: 2px;
		font-size: 13px;
		color: var(--label-gray);
	}

	.acc2 .post-item-pair {
		margin-top: 4px;
	}

	.acc2 .post-item-price {
		font-size: 20px;
	}

	.acc2 .item-promote-btn,
	.acc2 .item-restore-btn {
		height: 42px;
		border-radius: 12px;
	}
}

@media (min-width: 769px) and (max-width: 1200px) {
	.acc2 .posts-grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

@media (min-width: 769px) and (max-width: 992px) {
	.account:has(.acc2, .account-chats, .fav-page) .account-grid {
		grid-template-columns: 240px minmax(0, 1fr);
	}

	.acc2 .posts-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.account:has(.acc2, .account-chats, .fav-page) .account-content {
		padding: 24px;
	}

	.acc2-top {
		flex-direction: column;
	}

	.account:has(.acc2, .account-chats, .fav-page) .account-id {
		font-size: 13px;
		white-space: nowrap;
	}
}

/* ==========================================================================
   ТЕЛЕФОН (≤768) — экран профиля приложения (account_screen.dart)
   ========================================================================== */
@media (max-width: 768px) {
	.acc2-help,
	.acc2-sub,
	.acc2-sharebtn {
		display: none;
	}

	/* Поля 20 (ListView padding 20/24/20) */
	.account:has(.acc2, .account-chats, .fav-page) .container {
		padding-left: max(20px, env(safe-area-inset-left));
		padding-right: max(20px, env(safe-area-inset-right));
	}

	.account:has(.acc2, .account-chats, .fav-page) .account-content {
		padding-top: 24px;
	}

	/* «Профиль» в нижнем меню ведёт на /account?dashboard — раньше там было
	   только меню кабинета; теперь — этот экран, как в приложении. */
	.account.dashboard-mode:has(.acc2, .account-chats, .fav-page) .sidebar {
		display: none;
	}

	.account.dashboard-mode:has(.acc2, .account-chats, .fav-page) .account-content {
		display: block;
	}

	/* --- Шапка профиля --- */
	.acc2-head {
		display: flex;
		align-items: center;
	}

	.acc2-head__avatar {
		width: 52px;
		height: 52px;
		flex-shrink: 0;
		border-radius: 50%;
		overflow: hidden;
		background: var(--light);
		display: flex;
		align-items: center;
		justify-content: center;
	}

	.acc2-head__avatar img {
		width: 100%;
		height: 100%;
		object-fit: cover;
	}

	.acc2-head__avatar svg {
		width: 24px;
		height: 24px;
		color: var(--black);
		opacity: 0.3;
	}

	.acc2-head__text {
		flex: 1;
		min-width: 0;
		margin-left: 12px;
		display: flex;
		flex-direction: column;
	}

	.acc2-head__name {
		font-size: 18px;
		font-weight: 600;
		line-height: 24px;
		color: var(--black);
		overflow: hidden;
		white-space: nowrap;
		text-overflow: ellipsis;
	}

	.acc2-head__role {
		font-size: 13px;
		line-height: 16px;
		color: var(--label-gray);
	}

	.acc2-head__btns {
		display: flex;
		gap: 6px;
		margin-left: 16px;
		flex-shrink: 0;
	}

	.acc2-hbtn {
		width: 40px;
		height: 40px;
		border: 0;
		border-radius: 14px;
		padding: 0;
		display: flex;
		align-items: center;
		justify-content: center;
		cursor: pointer;
	}

	.acc2-hbtn img {
		display: block;
	}

	/* --- «Мои объявления» + чипы --- */
	.acc2-top {
		margin-top: 24px;
	}

	.acc2-title {
		font-size: 20px;
		font-weight: 600;
		line-height: 1;
		text-align: left;
	}

	.account:has(.acc2, .account-chats, .fav-page) .item-tabs {
		flex-wrap: nowrap;
		justify-content: flex-start;
		gap: 6px;
		margin: 16px -20px 0;
		padding: 0 20px;
		overflow-x: auto;
		scrollbar-width: none;
	}

	.account:has(.acc2, .account-chats, .fav-page) .item-tabs::-webkit-scrollbar {
		display: none;
	}

	.account:has(.acc2, .account-chats, .fav-page) .item-tabs a {
		flex-shrink: 0;
		height: 32px;
		padding: 0 10px;
		border-radius: 10px;
		font-size: 12px;
		font-weight: 600;
		line-height: 20px;
		color: rgb(22 14 24 / 60%); /* black 60 % — AppColors.black.withValues(alpha: 0.6) */
	}

	.account:has(.acc2, .account-chats, .fav-page) .item-tabs a.active {
		background: var(--accent);
		color: var(--white);
	}

	.acc2 .items-empty-alert {
		padding: 40px 0;
		font-size: 16px;
		font-weight: 500;
		color: rgb(22 14 24 / 40%); /* black 40 % — _emptyItems */
	}

	/* --- Сетка 2 колонки, 8/20 --- */
	.acc2 .posts-grid {
		margin-top: 20px;
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 20px 8px;
	}

	.acc2 .post-item-title {
		margin-top: 8px;
		font-size: 12px;
		font-weight: 500;
		line-height: 16px;
	}

	.acc2 .post-item-location {
		margin-top: 4px;
		font-size: 11px;
		font-weight: 500;
		line-height: 16px;
		color: rgb(22 14 24 / 40%); /* black 40 % */
	}

	.acc2 .post-item-pair {
		margin-top: 8px;
	}

	.acc2 .post-item-price {
		padding: 0;
		font-size: 18px;
		line-height: 16px;
	}

	.acc2 .post-item-id {
		font-size: 11px;
	}

	.acc2 .item-promote-btn,
	.acc2 .item-restore-btn {
		margin-top: 8px;
		height: 32px;
		border-radius: 12px;
		font-size: 12px;
	}

	.acc2 .post-item--archived .item-restore-btn {
		padding: 0 8px;
	}

	/* --- Блок помощи --- */
	.acc2-help-m {
		margin-top: 24px;
	}

	.acc2-arrow {
		display: block;
		width: 32px;
		height: 16px;
	}

	.acc2-helpcard {
		position: relative;
		height: 74px;
		overflow: hidden;
		border-radius: 18px;
		background: var(--light);
		padding: 14px 16px;
		display: flex;
		flex-direction: column;
		justify-content: space-between;
		color: var(--black);
	}

	.acc2-helpcard__title {
		position: relative;
		z-index: 1;
		font-size: 16px;
		font-weight: 600;
		line-height: 18px;
	}

	.acc2-helpcard .acc2-arrow {
		position: relative;
		z-index: 1;
	}

	.acc2-helpcard__robot {
		position: absolute;
		right: -10px;
		top: -12px;
		height: 98px;
		width: auto;
		pointer-events: none;
	}

	.acc2-tiles {
		margin-top: 12px;
		display: grid;
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 8px;
	}

	.acc2-tile {
		height: 94px;
		padding: 16px;
		border-radius: 18px;
		background: var(--light);
		display: flex;
		flex-direction: column;
		justify-content: space-between;
		font-size: 14px;
		font-weight: 600;
		line-height: 16px;
		color: var(--black);
	}

	/* --- Админпанель / Выйти --- */
	.acc2-more {
		margin-top: 12px;
		display: flex;
		flex-direction: column;
		gap: 8px;
	}

	.acc2-more__link {
		height: 48px;
		border-radius: 14px;
		background: var(--light);
		display: flex;
		align-items: center;
		justify-content: center;
		gap: 8px;
		font-size: 15px;
		font-weight: 600;
		color: var(--black);
	}

	.acc2-more__link svg {
		width: 20px;
		height: 20px;
	}

	.acc2-more__link--out {
		color: var(--red);
	}
}

/* Широкий телефон / планшет в портрете: 3 колонки, как было на сайте
   (телефон ≤576 — 2, как в приложении). Стоит после блока ≤768 — перекрывает. */
@media (min-width: 577px) and (max-width: 768px) {
	.acc2 .posts-grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

/* «Перейти на бизнес» (29.09.2026): ПК — ссылка под именем в карточке
   профиля (макет), телефон — строка над «Админпанель»/«Выйти» */
.acc2-biz {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin-top: 8px;
	font-size: 14px;
	font-weight: 500;
	line-height: 18px;
	color: var(--accent);
	transition: color 0.2s ease;
}

.acc2-biz:hover {
	color: var(--accent-alternate);
}

.acc2-biz--pending {
	color: var(--gray);
}

.acc2-more__link--biz {
	color: var(--accent);
}

/* Телефон: ссылки помощи — строки как «Админпанель»/«Выйти». */
@media (max-width: 768px) {
	.acc2-help-m .acc2-helpcard,
	.acc2-help-m .acc2-tile {
		min-height: 48px;
		height: 48px;
		padding: 0 16px;
		border-radius: 14px;
		flex-direction: row;
		align-items: center;
		justify-content: space-between;
		gap: 12px;
		font-size: 15px;
		font-weight: 600;
		line-height: 20px;
	}

	.acc2-help-m .acc2-helpcard__title {
		font-size: 15px;
		line-height: 20px;
	}

	.acc2-help-m .acc2-tiles {
		grid-template-columns: minmax(0, 1fr);
		gap: 8px;
	}

	.acc2-help-m .acc2-arrow {
		width: 20px;
		height: 20px;
		flex-shrink: 0;
		color: var(--gray);
	}
}

/* Телефон: действия кабинета выровнены с остальными строками. */
@media (max-width: 768px) {
	.acc2-help-m .acc2-more__link {
		justify-content: flex-start;
		padding: 0 16px;
		text-align: left;
	}

	.acc2-help-m .acc2-more__link svg {
		order: 1;
		margin-left: auto;
		flex-shrink: 0;
	}
}

/* Телефон: одинаковые 8 px между всеми строками от поддержки до выхода. */
@media (max-width: 768px) {
	.acc2-help-m .acc2-tiles,
	.acc2-help-m .acc2-more {
		margin-top: 8px;
		gap: 8px;
	}
}

/* ID мобильного профиля: типографика как в боковой карточке ПК. */
@media (max-width: 768px) {
	.acc2-head__id {
		font-size: 14px;
		line-height: 18px;
		color: var(--gray);
	}
}
