/*
 * Экраны гостя второго ряда как в приложении: «Профиль» (mobile-app/src/screens/ProfileScreen.tsx) и общая рама
 * страниц акций и отзывов. Токены --a-* — css/app-shell.css. Слой подключается последним на этих страницах.
 */
body.page-profile { background: var(--a-bg) !important; color: var(--a-ink); font-family: var(--a-font) !important; }
/* Колонка экрана: на телефоне и узком ПК — одна (720), на ПК от 1024 — «я» и меню слева, содержимое справа. */
body.page-profile main.ap-main { width: min(720px, calc(100% - 32px)); max-width: none; margin: 28px auto 64px; padding: 0; flex: 1; display: flex; flex-direction: column; gap: 14px; }
body.page-profile .ap-content { min-width: 0; display: flex; flex-direction: column; gap: 14px; }
@media (min-width: 1024px) {
  body.page-profile main.ap-main:not(.ap-main--guest) { width: min(1240px, calc(100% - 48px)); display: grid; grid-template-columns: minmax(320px, 380px) minmax(0, 1fr);
    gap: 32px; align-items: start; }
  body.page-profile main.ap-main:not(.ap-main--guest) > .ap { position: sticky; top: 100px; }
  body.page-profile main.ap-main:not(.ap-main--guest) .ap-content { padding-top: 61px; }
}

/* Шапка ПК — как у каталога: логотип, «Все рестораны», справа Вкусняшки и общая корзина. */
body.page-profile > header.ap-bar { background: color-mix(in srgb, var(--a-bg) 92%, transparent) !important; border-bottom: 1px solid var(--a-line) !important;
  box-shadow: none !important; -webkit-backdrop-filter: saturate(1.3) blur(12px); backdrop-filter: saturate(1.3) blur(12px); }
.ap-bar .header-inner { width: min(1240px, calc(100% - 48px)); margin: 0 auto; min-height: 76px; column-gap: 16px; }
.ap-bar-logo { display: block; }
.ap-bar .vk-logo { height: 60px; transform: translateY(-8%); }
.ap-bar-nav a { display: inline-flex; align-items: center; gap: 6px; height: 44px; padding: 0 16px 0 10px; border-radius: 16px; color: var(--a-ink);
  font: 700 15px/1 var(--a-font); text-decoration: none; transition: background .15s ease; }
.ap-bar-nav a:hover { background: var(--a-soft); }
.ap-bar-nav svg { width: 20px; height: 20px; }
.ap-bar-end { justify-self: end; display: flex; align-items: center; gap: 10px; }
.ap-bar .vk-account { gap: 10px; }
.ap-bar #profileBlock { display: none !important; }
.ap-bar .vk-account .oki-btn { min-height: 46px; border-radius: 16px !important; border: 1px solid var(--a-line) !important; background: var(--a-surface) !important;
  color: var(--a-ink) !important; font-weight: 750; box-shadow: none !important; }
.ap-bar .bamboo-counter-btn { height: 46px; min-height: 46px; border-radius: 16px; }
.ap-bar .bk-open { min-height: 46px; padding: 0 16px 0 14px; border-radius: 16px; background: var(--a-wash); color: var(--a-green-strong); font-family: var(--a-font); }
.ap-bar .bk-open.has-items { background: var(--a-green); color: #fff; }
.ap-bar :focus-visible { outline: 3px solid var(--a-green); outline-offset: 2px; }
body.page-profile .contact-fab-wrap { display: none !important; }

/* ── Профиль ──
 * Слева (на телефоне — сверху): «я», Вкусняшки и разделы профиля. Справа — сами разделы в порядке экрана приложения:
 * адреса, аллергии, как работают Вкусняшки, «Приведи друга» (свёрнут), заказы (история свёрнута), затем «Ещё».
 * Все цвета — токены --a-*: тёмная тема (theme-dark.css) меняет только их. */
.ap { display: flex; flex-direction: column; gap: 12px; }
.ap-title { margin: 0 0 4px; color: var(--a-ink); font: 800 clamp(30px, 4vw, 40px)/1.12 var(--a-font); letter-spacing: -.6px; }
.ap-login { display: flex; flex-direction: column; align-items: center; padding: 24px; border-radius: var(--a-r-lg); background: var(--a-wash); text-align: center; }
.ap-login img { width: 170px; height: auto; }
.ap-login h2 { margin: 10px 0 0; color: var(--a-ink); font: 800 20px/25px var(--a-font); letter-spacing: -.3px; }
.ap-login p { margin: 6px 0 0; max-width: 34ch; color: var(--a-muted); font-size: 14.5px; line-height: 1.4; }
.ap-btn { align-self: stretch; min-height: 52px; margin-top: 16px; display: flex; align-items: center; justify-content: center; gap: 8px; border: 0;
  border-radius: var(--a-r-md); background: var(--a-green); color: #fff; font: 800 16px/1 var(--a-font); text-decoration: none; cursor: pointer;
  transition: background .15s ease, transform .12s ease; }
.ap-btn:hover { background: color-mix(in srgb, var(--a-green) 84%, #000); }
.ap-btn:active { transform: scale(.98); }
.ap-btn svg { width: 20px; height: 20px; }
.ap-btn--compact { align-self: center; min-height: 46px; margin-top: 12px; padding: 0 22px; font-size: 15px; }
.ap-btn--compact svg { width: 18px; height: 18px; }

.ap-me { display: flex; align-items: center; gap: 14px; width: 100%; padding: 16px; border: 0; border-radius: var(--a-r-lg); background: var(--a-surface);
  color: var(--a-ink); font: inherit; text-align: left; cursor: pointer; transition: transform .12s ease, box-shadow .2s ease; }
.ap-me:hover { box-shadow: var(--a-shadow-1); }
.ap-me:active { transform: scale(.98); }
.ap-avatar { flex: none; width: 60px; height: 60px; display: grid; place-items: center; border-radius: 22px; background: var(--a-green); color: #fff; font: 900 26px/1 var(--a-font); }
.ap-me-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ap-me-text b { font: 800 20px/1.2 var(--a-font); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ap-me-text span { color: var(--a-muted); font-size: 14.5px; font-variant-numeric: tabular-nums; }
.ap-pencil { flex: none; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 13px; background: var(--a-wash); color: var(--a-green-strong); }
.ap-pencil svg { width: 17px; height: 17px; }
.ap-me[aria-expanded='true'] .ap-pencil { background: var(--a-green); color: #fff; }

/* Вкусняшки — янтарная карточка, как PointsCard приложения: единственное яркое пятно экрана. */
.ap-points { position: relative; display: flex; align-items: center; gap: 12px; width: 100%; padding: 16px; border: 0; border-radius: var(--a-r-lg);
  background: linear-gradient(135deg, #FFD06A 0%, #F49B2C 100%); color: #3B2104; font: inherit; text-align: left; cursor: pointer; overflow: hidden;
  transition: transform .12s ease, box-shadow .2s ease; }
.ap-points:hover { box-shadow: 0 10px 24px rgba(240, 150, 26, .28); }
.ap-points:active { transform: scale(.98); }
.ap-points img { flex: none; width: 52px; height: 52px; transform: rotate(-10deg); filter: drop-shadow(0 6px 8px rgba(118, 76, 14, .25)); }
.ap-points-text { display: flex; flex-direction: column; }
.ap-points-text small { font: 700 13px/1.2 var(--a-font); opacity: .85; }
.ap-points-text b { font: 900 30px/1.1 var(--a-font); font-variant-numeric: tabular-nums; }
.ap-points-more { position: absolute; top: 14px; right: 16px; display: inline-flex; align-items: center; gap: 2px; font: 800 13px/1 var(--a-font); }
.ap-points-more svg { width: 16px; height: 16px; }

/* Разделы профиля слева — только на компьютере. */
.ap-nav { display: none; flex-direction: column; padding: 6px; border-radius: var(--a-r-lg); background: var(--a-surface); }
.ap-nav-link { min-height: 52px; display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: var(--a-r-md); color: var(--a-ink);
  text-decoration: none; transition: background .15s ease; }
.ap-nav-link[hidden] { display: none; }
.ap-nav-link:hover { background: var(--a-field); }
.ap-nav-link b { flex: 1; min-width: 0; font: 650 15px/1.25 var(--a-font); }
.ap-nav-link small { flex: none; max-width: 42%; overflow: hidden; color: var(--a-muted); font: 600 13px/1.2 var(--a-font); text-overflow: ellipsis; white-space: nowrap;
  font-variant-numeric: tabular-nums; }
.ap-row-ico { flex: none; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 12px; background: var(--a-wash); color: var(--a-green-strong); }
.ap-row-ico svg { width: 20px; height: 20px; }
.ap-row-ico--points { background: var(--a-points-soft); color: var(--a-points-strong); }

/* Столбец разделов. */
.ap-stack { display: flex; flex-direction: column; gap: 16px; }
.ap-panel { display: flex; flex-direction: column; gap: 16px; padding: 18px; border-radius: var(--a-r-lg); background: var(--a-surface); color: var(--a-ink);
  scroll-margin-top: 96px; }
.ap-panel[hidden] { display: none; }
.ap-panel-head { display: flex; align-items: center; gap: 12px; min-width: 0; }
.ap-panel-ico { flex: none; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 14px; background: var(--a-wash); color: var(--a-green-strong); }
.ap-panel-ico svg { width: 22px; height: 22px; }
.ap-panel-ico--points { background: var(--a-points-soft); color: var(--a-points-strong); }
/* Утверждённый логотип Вкусняшек — в шапке раздела; на телефоне — своей строкой над заголовком. */
.ap-howto .ap-panel-head { flex-wrap: wrap; row-gap: 8px; }
.ap-howto-logo { flex: none; display: block; width: auto; height: 52px; }
@media (max-width: 639px) { .ap-howto-logo { height: 48px; margin-right: 100%; } }
.ap-panel-titles { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; text-align: left; }
.ap-panel-titles small { color: var(--a-muted); font: 500 13.5px/1.3 var(--a-font); }
.ap-h2 { margin: 0; color: var(--a-ink); font: 800 20px/1.2 var(--a-font); letter-spacing: -.3px; }
.ap-head-btn { flex: none; min-height: 40px; display: inline-flex; align-items: center; gap: 6px; padding: 0 14px 0 11px; border: 0; border-radius: 20px;
  background: var(--a-wash); color: var(--a-green-strong); font: 800 14px/1 var(--a-font); cursor: pointer; transition: background .15s ease; }
.ap-head-btn[hidden] { display: none; }
.ap-head-btn:hover { background: color-mix(in srgb, var(--a-green) 18%, var(--a-wash)); }
.ap-head-btn svg { width: 17px; height: 17px; }
.ap-muted { margin: 0; color: var(--a-muted); font-size: 14.5px; }

/* Ваши адреса: строка — «доставлять сюда», рядом «изменить» и «удалить». */
.ap-addr-list { display: flex; flex-direction: column; gap: 8px; }
.ap-addr { display: flex; align-items: center; gap: 4px; min-height: 64px; padding: 4px 6px 4px 4px; border: 1px solid var(--a-line); border-radius: var(--a-r-md);
  background: var(--a-field); transition: border-color .15s ease, background .15s ease; }
.ap-addr.is-current { border-color: color-mix(in srgb, var(--a-green) 55%, transparent); background: var(--a-wash); }
.ap-addr-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; padding: 8px; border: 0; border-radius: 12px; background: none; color: var(--a-ink);
  font: inherit; text-align: left; cursor: pointer; }
.ap-addr.is-current .ap-addr-main { cursor: default; }
.ap-addr-ico { flex: none; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; background: var(--a-surface); color: var(--a-muted); }
.ap-addr-ico svg { width: 19px; height: 19px; }
.ap-addr.is-current .ap-addr-ico { background: var(--a-green); color: #fff; }
.ap-addr-text { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ap-addr-text b { font: 700 15.5px/1.3 var(--a-font); overflow-wrap: anywhere; }
.ap-addr-text small { color: var(--a-muted); font-size: 13px; line-height: 1.35; overflow-wrap: anywhere; }
.ap-addr-text em { align-self: flex-start; margin-top: 3px; color: var(--a-green-strong); font: 800 12.5px/1.2 var(--a-font); font-style: normal; }
.ap-addr-acts { flex: none; display: flex; gap: 2px; }
.ap-addr-act { width: 44px; height: 44px; display: grid; place-items: center; border: 0; border-radius: 12px; background: none; color: var(--a-muted); cursor: pointer;
  transition: background .15s ease, color .15s ease; }
.ap-addr-act svg { width: 19px; height: 19px; }
.ap-addr-act:hover { background: var(--a-surface); color: var(--a-ink); }
.ap-addr-act--del:hover { color: var(--a-danger); }
.ap-addr.is-confirm { background: var(--a-field); flex-wrap: wrap; gap: 8px; padding: 10px 10px 10px 16px; border-color: color-mix(in srgb, var(--a-danger) 40%, transparent); }
.ap-addr-confirm { flex: 1 1 180px; min-width: 0; color: var(--a-ink); font: 700 14.5px/1.3 var(--a-font); overflow-wrap: anywhere; }
.ap-addr-no, .ap-addr-yes { min-height: 44px; padding: 0 16px; border: 0; border-radius: 12px; font: 800 14px/1 var(--a-font); cursor: pointer; }
.ap-addr-no { background: var(--a-soft); color: var(--a-ink); }
.ap-addr-yes { background: var(--a-danger); color: #fff; }
html[data-theme='dark'] .ap-addr-yes { color: #2A1210; }
.ap-addr-empty { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 20px 16px; border: 1.5px dashed var(--a-line-strong);
  border-radius: var(--a-r-md); text-align: center; }
.ap-addr-empty > span:not(.ap-addr-empty-ico) { display: flex; flex-direction: column; gap: 4px; }
.ap-addr-empty b { font: 800 16px/1.25 var(--a-font); }
.ap-addr-empty small { max-width: 40ch; color: var(--a-muted); font-size: 14px; line-height: 1.4; }
.ap-addr-empty-ico { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 50%; background: var(--a-wash); color: var(--a-green-strong); }
.ap-addr-empty-ico svg { width: 24px; height: 24px; }
.ap-addr-status { margin: -6px 0 0; color: var(--a-muted); font-size: 13.5px; }
.ap-addr-status:empty { display: none; }

/* Как работают Вкусняшки: четыре правила плиткой. */
.ap-rules { display: grid; grid-template-columns: 1fr; gap: 10px; margin: 0; padding: 0; list-style: none; }
.ap-rules li { display: grid; grid-template-columns: 40px minmax(0, 1fr); column-gap: 12px; row-gap: 2px; align-items: start; padding: 14px;
  border-radius: var(--a-r-md); background: var(--a-field); }
.ap-rule-ico { grid-row: span 2; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; background: var(--a-points-soft); color: var(--a-points-strong); }
.ap-rule-ico svg { width: 21px; height: 21px; }
.ap-rules b { color: var(--a-ink); font: 800 15px/1.3 var(--a-font); }
.ap-rules li > span:last-child { color: var(--a-muted); font-size: 14px; line-height: 1.45; }

/* Раскрывающийся раздел: шапка — кнопка, тело — плавно по высоте (grid 0fr → 1fr), свёрнутое недоступно с клавиатуры (inert). */
.ap-fold-h { margin: 0; font: inherit; }
.ap-fold-btn { width: 100%; display: flex; align-items: center; gap: 12px; padding: 0; border: 0; background: none; color: var(--a-ink); font: inherit;
  text-align: left; cursor: pointer; }
.ap-fold-chev { flex: none; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; background: var(--a-soft); color: var(--a-ink);
  transition: transform .3s var(--a-ease), background .15s ease; }
.ap-fold-chev svg { width: 20px; height: 20px; }
.ap-fold-btn:hover .ap-fold-chev { background: color-mix(in srgb, var(--a-ink) 10%, var(--a-soft)); }
.ap-fold.is-open > .ap-fold-btn .ap-fold-chev, .ap-fold.is-open > .ap-fold-h .ap-fold-chev { transform: rotate(180deg); }
.ap-fold-body { display: grid; grid-template-rows: 0fr; margin-top: -16px; transition: grid-template-rows .32s var(--a-ease), margin-top .32s var(--a-ease); }
.ap-fold.is-open > .ap-fold-body { grid-template-rows: 1fr; margin-top: 0; }
.ap-fold-inner { min-height: 0; overflow: hidden; display: flex; flex-direction: column; gap: 12px; }
.ap-fold-label { flex: none; color: var(--a-green-strong); font: 800 14px/1 var(--a-font); }
/* «История заказов» — строкой внутри раздела «Заказы». */
.ap-fold--inner { display: flex; flex-direction: column; gap: 12px; }
.ap-fold--inner[hidden] { display: none; }
.ap-fold-btn--history { min-height: 64px; padding: 10px 10px 10px 16px; border-radius: var(--a-r-md); background: var(--a-field); border: 1px solid var(--a-line);
  transition: border-color .15s ease; }
.ap-fold-btn--history:hover { border-color: var(--a-line-strong); }
.ap-fold-btn--history .ap-panel-titles b { font: 800 16px/1.25 var(--a-font); }
.ap-fold-btn--history .ap-fold-chev { width: 36px; height: 36px; background: var(--a-surface); }
.ap-fold--inner .ap-fold-body { margin-top: -12px; }
.ap-fold--inner.is-open .ap-fold-body { margin-top: 0; }
.ap-fold :focus-visible, .ap-panel :focus-visible, .ap :focus-visible, .ap-more :focus-visible { outline: 3px solid var(--a-green); outline-offset: 2px; }

/* «Изменить профиль» — поля как Field приложения. */
.ap-card { display: flex; flex-direction: column; gap: 16px; padding: 20px; border-radius: var(--a-r-lg); background: var(--a-surface); color: var(--a-ink); scroll-margin-top: 96px; }
.ap-card[hidden] { display: none; }
.ap-card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ap-x { flex: none; width: 44px; height: 44px; display: grid; place-items: center; border: 0; border-radius: 14px; background: var(--a-soft); color: var(--a-ink); cursor: pointer; }
.ap-x svg { width: 20px; height: 20px; }
.ap-fields { display: grid; gap: 14px; }
.ap-field { display: flex; flex-direction: column; gap: 6px; }
.ap-field > span { color: var(--a-muted); font: 700 13px/1.2 var(--a-font); }
.ap-field small { color: var(--a-muted); font-size: 12.5px; line-height: 1.35; }
.ap-card :is(input, select) { width: 100%; height: 52px; padding: 0 14px; border: 1px solid var(--a-line); border-radius: var(--a-r-sm); background: var(--a-field);
  color: var(--a-ink); font: 600 16px/1 var(--a-font); outline: 0; transition: border-color .15s ease, box-shadow .15s ease; }
.ap-card :is(input, select):focus { border-color: var(--a-green); box-shadow: 0 0 0 4px rgba(45, 128, 58, .14); }
.ap-card input:disabled { color: var(--a-muted); background: var(--a-soft); }
.ap-birth-row { display: grid; grid-template-columns: 96px minmax(0, 1fr) auto; gap: 8px; }
.ap-locked { height: 52px; display: flex; align-items: center; gap: 10px; padding: 0 14px; border-radius: var(--a-r-sm); background: var(--a-soft); }
.ap-locked svg { width: 18px; height: 18px; color: var(--a-muted); }
.ap-locked b { font: 700 16px/1 var(--a-font); }
.ap-card .ap-btn { margin-top: 0; }
.ap-btn--soft { align-self: auto; min-height: 52px; padding: 0 18px; background: var(--a-wash); color: var(--a-green-strong); }
.ap-btn--soft:hover { background: color-mix(in srgb, var(--a-green) 18%, var(--a-wash)); }
.ap-row { min-height: 60px; display: flex; align-items: center; gap: 12px; padding: 10px 2px; border-bottom: 1px solid var(--a-line); color: var(--a-ink); text-decoration: none; }
.ap-row:last-child { border-bottom: 0; }
.ap-row-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ap-row-text b { font: 600 15.5px/1.25 var(--a-font); }
.ap-row-text span { color: var(--a-muted); font-size: 13px; }
.ap-row-go { flex: none; width: 18px; height: 18px; color: var(--a-muted); }
.ap-row:hover .ap-row-go { color: var(--a-ink); }
.ap-row--danger { border: 0; padding-bottom: 0; }
.ap-row--danger .ap-row-ico { background: var(--a-danger-soft, #FBE9EA); color: var(--a-danger); }
.ap-row--danger b { color: var(--a-danger); }

/* Заказы — OrdersScreen приложения. */
.ap-orders { display: flex; flex-direction: column; gap: 8px; }
.ap-orders[hidden] { display: none; }
.ap-order { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--a-r-md); background: var(--a-field); color: var(--a-ink);
  text-decoration: none; transition: box-shadow .2s ease, transform .12s ease; }
a.ap-order:hover { box-shadow: var(--a-shadow-1); }
a.ap-order:active { transform: scale(.985); }
.ap-order--now { padding: 16px; background: var(--a-wash); }
.ap-seal { flex: none; width: 46px; height: 46px; display: grid; place-items: center; overflow: hidden; border: 2px solid var(--a-green); border-radius: 50%;
  background: #fff; color: var(--a-green); font: 900 18px/1 var(--a-font); }
.ap-seal img { width: 100%; height: 100%; object-fit: cover; }
.ap-order--now .ap-seal { width: 56px; height: 56px; }
.ap-order-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ap-order-text b { font: 800 16px/1.25 var(--a-font); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ap-order-text > span { color: var(--a-muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.ap-order-text small { color: var(--a-green-strong); font: 700 12.5px/1.2 var(--a-font); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ap-order--now .ap-order-text b { font-size: 19px; font-weight: 900; }
.ap-order-text em { margin-top: 2px; color: var(--a-green-strong); font: 800 13.5px/1.2 var(--a-font); font-style: normal; }
.ap-order-text em.is-done { color: var(--a-green); }
html[data-theme='dark'] .ap-order-text em.is-done { color: var(--a-green-text); }
.ap-order-text em:is(.is-cancelled, .is-problem) { color: var(--a-danger); }
.ap-order-text em.is-payment { color: var(--a-warning); }
.ap-order-warn { margin-top: 6px; align-self: flex-start; padding: 6px 10px; border-radius: 10px; background: var(--a-danger-soft, #FBE9EA); color: var(--a-danger); font-size: 13px; font-weight: 700; }
.ap-order-sum { flex: none; display: flex; align-items: center; gap: 4px; font: 900 16px/1 var(--a-font); font-variant-numeric: tabular-nums; }
.ap-order .ap-row-go { color: var(--a-faint); }
.ap-skel { height: 78px; border-radius: var(--a-r-md); background: linear-gradient(90deg, var(--a-soft) 25%, #f6f1e8 50%, var(--a-soft) 75%) 0 0 / 200% 100%;
  animation: ap-shimmer 1.2s linear infinite; }
.ap-skel--row { height: 64px; }
@keyframes ap-shimmer { to { background-position: -200% 0; } }
.ap-empty { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 8px 16px 4px; text-align: center; }
.ap-empty img { width: 132px; height: auto; }
.ap-empty b { font: 800 18px/1.25 var(--a-font); }
.ap-empty span { color: var(--a-muted); font-size: 14.5px; }

/* «Пригласи друга» — экран InviteScreen приложения: карточки на поле раздела, код на зелёной подложке. */
body.page-profile .ref { margin: 0; max-width: none; }
body.page-profile .ref-card { gap: 12px; padding: 18px; border: 0; border-radius: var(--a-r-md); background: var(--a-field); }
body.page-profile .ref-card--ok { background: var(--a-wash); }
body.page-profile .ref-title { color: var(--a-ink); font: 800 19px/1.3 var(--a-font); }
body.page-profile :is(.ref-subtitle, .ref-text, .ref-step) { color: var(--a-ink); }
body.page-profile .ref-muted { color: var(--a-muted); }
body.page-profile .ref-code { border: 1.5px dashed var(--a-green) !important; border-radius: var(--a-r-md) !important; background: var(--a-wash) !important; }
body.page-profile .ref-code-text { color: var(--a-ink); font-family: var(--a-font); }
body.page-profile .ref-copy { color: var(--a-green-strong); }
body.page-profile :is(.ref-primary, .ref-secondary) { min-height: 52px; border-radius: var(--a-r-md); font-family: var(--a-font); font-weight: 800; }
body.page-profile .ref-primary { background: var(--a-green); color: #fff; }
body.page-profile .ref-primary:hover { background: color-mix(in srgb, var(--a-green) 84%, #000); }
body.page-profile .ref-secondary { background: var(--a-wash); color: var(--a-green-strong); }
body.page-profile .ref-stats { gap: 8px; }
body.page-profile .ref-stat { border: 0; border-radius: var(--a-r-md); background: var(--a-field); padding: 14px 8px; }
body.page-profile .ref-stat-value { color: var(--a-ink); font: 900 24px/1.1 var(--a-font); font-variant-numeric: tabular-nums; }
body.page-profile .ref-stat-label { color: var(--a-muted); font-size: 12.5px; }
body.page-profile .ref-step-num { background: var(--a-wash) !important; color: var(--a-green-strong) !important; }
body.page-profile .ref-input { border-color: var(--a-line) !important; border-radius: var(--a-r-sm) !important; background: var(--a-surface) !important; color: var(--a-ink); }
/* Окно «Пригласи друга» с главной: шапки раздела нет, содержимое сразу раскрыто. */
html.referral-embed #referralCard { padding: 0; background: none; }
html.referral-embed #referralCard .ap-fold-h { display: none; }
html.referral-embed #referralCard .ap-fold-body { margin-top: 0; grid-template-rows: 1fr; }

/* Ещё: поддержка, о сервисе, тема, выход. */
.ap-more { display: flex; flex-direction: column; gap: 12px; margin-top: 8px; }
.ap-group { display: flex; flex-direction: column; padding: 4px 16px; border-radius: var(--a-r-lg); background: var(--a-surface); }
.ap-theme { display: grid; gap: 8px; padding: 14px 0 12px; }
.ap-theme-label { color: var(--a-muted); font-size: 13.5px; font-weight: 700; }
.ap-logout { min-height: 52px; display: flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--a-line); border-radius: var(--a-r-md);
  color: var(--a-ink); font: 700 15px/1 var(--a-font); text-decoration: none; transition: background .15s ease; }
.ap-logout:hover { background: var(--a-surface); }
.ap-logout svg { width: 19px; height: 19px; color: var(--a-muted); }

/* Документы (#offer, #privacy) — на тех же поверхностях. */
body.page-profile .profile-card { border: 0 !important; border-radius: var(--a-r-lg) !important; background: var(--a-surface) !important; box-shadow: none !important; }

@media (min-width: 640px) {
  .ap-rules { grid-template-columns: 1fr 1fr; }
  .ap-panel { padding: 22px; }
}
@media (min-width: 1024px) {
  .ap-fields { grid-template-columns: 1fr 1fr; }
  .ap-card { padding: 24px; }
  .ap-panel { padding: 24px; gap: 18px; }
  .ap-stack { gap: 20px; }
  .ap-nav { display: flex; }
}
@media (max-width: 768px) {
  body.page-profile > header { display: none !important; }
  body.page-profile main.ap-main { width: auto; margin: 0 !important; padding: calc(12px + env(safe-area-inset-top)) 16px 24px !important; }
  .ap-birth-row { grid-template-columns: 84px minmax(0, 1fr); }
  .ap-birth-row .ap-btn--soft { grid-column: 1 / -1; }
  body.page-profile { padding-bottom: calc(var(--a-tabs-h) + env(safe-area-inset-bottom)); }
  .ap-title { font-size: 30px; line-height: 34px; }
  .ap-panel { padding: 16px; gap: 14px; }
  .ap-addr-act { width: 42px; height: 42px; }
  .ap-fold-body { margin-top: -14px; }
  .ap-fold-label { display: none; }
}
@media (max-width: 380px) {
  .ap-addr-ico { display: none; }
  .ap-head-btn { padding: 0 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .ap-fold-body, .ap-fold-chev { transition: none; }
  .ap-skel { animation: none; }
}

/* ── Оформление заказа (checkout.html) — экран «Оформление» приложения: белые секции, поля, зелёная кнопка внизу ── */
body.page-checkout { background: var(--a-bg) !important; color: var(--a-ink); font-family: var(--a-font); }
body.page-checkout .co-card { border-radius: var(--a-r-md); box-shadow: none; }
body.page-checkout .co-card :is(input[type=text], input[type=tel], input[type=search], input:not([type]), textarea, select) {
  min-height: 52px; border: 1px solid var(--a-line) !important; border-radius: var(--a-r-sm) !important; background: var(--a-field) !important;
  color: var(--a-ink) !important; font-family: var(--a-font) !important; font-size: 16px !important; box-shadow: none !important; }
body.page-checkout .co-card :is(input, textarea, select):focus { border-color: var(--a-green) !important; outline: 0; }
body.page-checkout #placeOrderBtn { min-height: 56px !important; border-radius: var(--a-r-md) !important; font-family: var(--a-font) !important; font-size: 16px !important; }
@media (max-width: 768px) {
  body.page-checkout .co-num { display: none; }
  body.page-checkout .mm-page-header { background: var(--a-bg) !important; border-bottom: 1px solid var(--a-line) !important; box-shadow: none !important; }
  body.page-checkout .mm-back-btn { width: 42px; height: 42px; display: grid; place-items: center; border: 1px solid var(--a-line) !important; border-radius: 14px !important;
    background: var(--a-surface) !important; color: var(--a-ink) !important; }
  body.page-checkout .co-paybar { background: var(--a-surface); box-shadow: none; }
}
@media (max-width: 768px) {
  body.page-checkout .co-apphead { position: sticky; top: 0; z-index: 40; display: flex !important; align-items: center; gap: 10px; min-height: 0;
    padding: calc(6px + env(safe-area-inset-top)) 12px 10px !important; }
  body.page-checkout .co-apphead .mm-back-btn { flex: none; margin: 0; padding: 0; }
  body.page-checkout .co-apphead .mm-back-btn svg { width: 21px; height: 21px; }
  body.page-checkout .co-apphead-title { flex: 1; min-width: 0; text-align: center; color: var(--a-ink); font: 800 17px/1.2 var(--a-font); letter-spacing: -.2px; }
  body.page-checkout .co-apphead-gap { flex: none; width: 42px; }
  body.page-checkout .co-head .co-back { display: none; }
  body.page-checkout .co-head h1 { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
  body.page-checkout .co-page { padding-top: 12px; }
}

/* ── Акции, акция, отзывы — экраны поверх вкладок: на телефоне без шапки сайта, «назад» — первой строкой страницы ── */
:is(body.page-posts, body.page-post, body.page-reviews) { background: var(--a-bg) !important; font-family: var(--a-font); }
@media (max-width: 768px) {
  :is(body.page-posts, body.page-post, body.page-reviews) > header { display: none !important; }
  :is(body.page-posts, body.page-post, body.page-reviews) main { padding-top: calc(10px + env(safe-area-inset-top)) !important; margin-top: 0 !important; }
  :is(body.page-posts, body.page-post, body.page-reviews) { padding-bottom: calc(var(--a-tabs-h) + env(safe-area-inset-bottom)); }
}
@media (max-width: 768px) { body.page-checkout .co-head { margin: 0 !important; padding: 0 !important; min-height: 0 !important; } }
@media (min-width: 769px) {
  :is(body.page-profile, body.page-posts, body.page-post, body.page-reviews, body.page-checkout) > header .header-inner { max-width: min(1240px, calc(100% - 48px)) !important;
    padding-left: 0 !important; padding-right: 0 !important; }
}

