/* Cramb Resale — стили Mini App по макету Claude Design («Cramb Resale Prototype»).
   Монохромная палитра: светлая или тёмная по colorScheme Telegram (data-scheme ставит app.js),
   вне Telegram — по prefers-color-scheme. */
:root {
  --bg: #ffffff;              /* фон ленты */
  --grouped: #f2f2f2;         /* фон слежек и профиля */
  --card: #ffffff;
  --sheet: #ffffff;
  --ink: #000000;             /* текст и акцент */
  --ink-inv: #ffffff;
  --hint: #6e6e6e;
  --hint2: #b0b0b0;           /* шевроны, иконки подсказок */
  --sep: #e5e5e5;
  --line: #e0e0e0;            /* обводка чипсов и тегов */
  --dash: #cfcfcf;
  --fill: rgba(0, 0, 0, .06);
  --grip: #d4d4d4;
  --kv: #f2f2f2;
  --destructive: #ff3b30;
  --knob-on: #ffffff;
  --round-btn: rgba(255, 255, 255, .92);
  --ph-icon: rgba(0, 0, 0, .2);
  --ph0: #ededed; --ph1: #e4e4e4; --ph2: #f1f1f1; --ph3: #e8e8e8; --ph4: #e6e6e6; --ph5: #efefef; --ph6: #e3e3e3;
  /* Liquid Glass нижней панели */
  --glass: rgba(255, 255, 255, .5);
  --glass-hi: rgba(255, 255, 255, .9);
  --glass-lo: rgba(0, 0, 0, .04);
  --glass-edge: rgba(0, 0, 0, .08);
  --lens: rgba(0, 0, 0, .075);
  --lens-hi: rgba(255, 255, 255, .95);
  --lens-edge: rgba(0, 0, 0, .05);
  --badge-ring: rgba(255, 255, 255, .95);

  --sat: 0px; --sab: 0px; --sal: 0px; --sar: 0px;   /* ставит app.js из safeAreaInset + contentSafeAreaInset */
  --safe-top: max(var(--sat), env(safe-area-inset-top, 0px));
  --safe-bottom: max(var(--sab), env(safe-area-inset-bottom, 0px));
  --app-h: 100vh;
  --tabbar-h: 60px;
  --tab-w: 92px;

  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --ease-sheet: cubic-bezier(.2, .85, .25, 1);
  --ease-spring: cubic-bezier(.34, 1.45, .5, 1);
  color-scheme: light;
}
:root[data-scheme="dark"] {
  --bg: #000000; --grouped: #000000; --card: #161616; --sheet: #161616;
  --ink: #ffffff; --ink-inv: #000000; --hint: #8f8f8f; --hint2: #5a5a5a;
  --sep: #262626; --line: #2e2e2e; --dash: #3a3a3a; --fill: rgba(255, 255, 255, .1); --grip: #3a3a3a; --kv: #222222;
  --destructive: #ff453a; --knob-on: #000000; --round-btn: rgba(0, 0, 0, .55); --ph-icon: rgba(255, 255, 255, .22);
  --ph0: #1c1c1c; --ph1: #232323; --ph2: #181818; --ph3: #202020; --ph4: #222222; --ph5: #1a1a1a; --ph6: #242424;
  --glass: rgba(38, 38, 38, .46); --glass-hi: rgba(255, 255, 255, .16); --glass-lo: rgba(255, 255, 255, .04); --glass-edge: rgba(255, 255, 255, .12);
  --lens: rgba(255, 255, 255, .16); --lens-hi: rgba(255, 255, 255, .24); --lens-edge: rgba(255, 255, 255, .1);
  --badge-ring: rgba(44, 44, 44, .95);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-scheme="light"]) {
    --bg: #000000; --grouped: #000000; --card: #161616; --sheet: #161616;
    --ink: #ffffff; --ink-inv: #000000; --hint: #8f8f8f; --hint2: #5a5a5a;
    --sep: #262626; --line: #2e2e2e; --dash: #3a3a3a; --fill: rgba(255, 255, 255, .1); --grip: #3a3a3a; --kv: #222222;
    --destructive: #ff453a; --knob-on: #000000; --round-btn: rgba(0, 0, 0, .55); --ph-icon: rgba(255, 255, 255, .22);
    --ph0: #1c1c1c; --ph1: #232323; --ph2: #181818; --ph3: #202020; --ph4: #222222; --ph5: #1a1a1a; --ph6: #242424;
    --glass: rgba(38, 38, 38, .46); --glass-hi: rgba(255, 255, 255, .16); --glass-lo: rgba(255, 255, 255, .04); --glass-edge: rgba(255, 255, 255, .12);
    --lens: rgba(255, 255, 255, .16); --lens-hi: rgba(255, 255, 255, .24); --lens-edge: rgba(255, 255, 255, .1);
    --badge-ring: rgba(44, 44, 44, .95);
    color-scheme: dark;
  }
}

[hidden] { display: none !important; }
* { box-sizing: border-box; }
html, body {
  margin: 0; height: 100%;
  background: var(--bg); color: var(--ink);
  font: 17px/1.3 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", "Segoe UI", Roboto, system-ui, sans-serif;
  letter-spacing: -.2px;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}
body { overflow: hidden; -webkit-user-select: none; user-select: none; }
input { -webkit-user-select: text; user-select: text; }
button { font: inherit; color: inherit; letter-spacing: inherit; cursor: pointer; }
code { font-size: .9em; padding: 1px 5px; border-radius: 6px; background: var(--fill); }
*::-webkit-scrollbar { display: none; }
* { scrollbar-width: none; }

.app {
  position: fixed; inset: 0 0 auto 0; height: var(--app-h);
  display: flex; flex-direction: column;
  padding-left: var(--sal); padding-right: var(--sar);
  background: var(--grouped); transition: background-color .3s;
}
.app[data-view="feed"] { background: var(--bg); }

/* общие svg-иконки */
.ic { display: inline-grid; place-items: center; flex: none; }
.ic svg, .icon-btn svg, .gate svg {
  fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round;
}

/* ---------- верхняя панель ---------- */
.topbar {
  flex: none; display: flex; align-items: flex-end; gap: 12px;
  padding: calc(var(--safe-top) + 10px) 16px 4px;
}
.topbar__text { flex: 1; min-width: 0; }
.topbar__title { margin: 0; display: flex; align-items: center; gap: 8px; font-size: 34px; line-height: 41px; font-weight: 700; letter-spacing: -.6px; }
#title { display: inline-block; }
#title.swap { animation: titleSwap .38s var(--ease-out); }
.topbar__sub {
  min-height: 18px; display: flex; align-items: center; gap: 6px;
  font-size: 13px; line-height: 18px; color: var(--hint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
@keyframes titleSwap { from { opacity: 0; transform: translateY(6px); } }

.icon-btn {
  flex: none; width: 36px; height: 36px; margin-bottom: 20px; border: 0; border-radius: 18px; padding: 0;
  display: grid; place-items: center; background: var(--fill); color: var(--ink);
  transition: transform .2s var(--ease-spring), opacity .2s, visibility .2s, background-color .25s, color .25s;
}
.icon-btn[data-icon="plus"] { background: var(--ink); color: var(--ink-inv); }
.icon-btn:active { transform: scale(.88); opacity: .7; }
.icon-btn.is-hidden { opacity: 0; visibility: hidden; transform: scale(.6); }
.icon-btn.is-spinning svg { animation: spin .7s linear infinite; }
.icon-btn svg { width: 18px; height: 18px; stroke-width: 2.6; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- экраны-вкладки ---------- */
.screens { position: relative; flex: 1; min-height: 0; overflow: hidden; }
.screen {
  position: absolute; inset: 0; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain;
  padding: 2px 16px calc(var(--tabbar-h) + var(--safe-bottom) + 48px);
  opacity: 0; visibility: hidden; transform: translate3d(var(--from, 28px), 0, 0);
  transition: opacity .26s var(--ease-out), transform .38s var(--ease-out), visibility 0s linear .38s;
}
.screen.is-active {
  opacity: 1; visibility: visible; transform: none;
  transition: opacity .26s var(--ease-out), transform .38s var(--ease-out), visibility 0s;
}

/* ---------- нижние вкладки: Liquid Glass ---------- */
.tabbar {
  position: absolute; z-index: 10; left: 0; right: 0; bottom: calc(var(--safe-bottom) + 8px);
  width: max-content; margin: 0 auto;
  display: flex; gap: 2px; padding: 4px; border-radius: 30px;
  background: var(--glass);
  -webkit-backdrop-filter: blur(22px) saturate(1.9) brightness(1.05); backdrop-filter: blur(22px) saturate(1.9) brightness(1.05);
  box-shadow: inset 0 1px 0 var(--glass-hi), inset 0 -1px 0 var(--glass-lo), 0 0 0 .5px var(--glass-edge), 0 14px 36px -12px rgba(0, 0, 0, .35);
  letter-spacing: -.1px;
}
.tabbar__pill {
  position: absolute; left: 4px; top: 4px; width: var(--tab-w); height: 52px; border-radius: 26px; pointer-events: none;
  background: var(--lens);
  box-shadow: inset 0 1px 0 var(--lens-hi), inset 0 0 0 .5px var(--lens-edge), 0 3px 12px -3px rgba(0, 0, 0, .14);
  transform: translateX(calc(var(--tab-i, 0) * (var(--tab-w) + 2px)));
  transition: transform .55s var(--ease-spring);
}
/* «линза» сплющивается в движении, как в iOS 26 / Telegram */
.tabbar__pill.is-moving { animation: lens .56s ease-out; }
@keyframes lens { 30% { scale: 1.2 .88; } 65% { scale: .97 1.04; } 100% { scale: 1 1; } }
.tab {
  position: relative; z-index: 1; width: var(--tab-w); height: 52px; padding: 0; border: 0; border-radius: 26px; background: none;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  font-size: 11px; font-weight: 600; color: var(--hint); transition: color .3s, transform .2s;
}
.tab:active { transform: scale(.92); }
.tab.is-active { color: var(--ink); }
.tab svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.tab .tab__on { display: none; fill: currentColor; stroke: none; }
.tab .tab__on--stroke { fill: none; stroke: currentColor; stroke-width: 2.6; }
.tab .tab__on--stroke .fill { fill: currentColor; stroke: none; }
.tab.is-active .tab__on { display: block; animation: iconIn .35s var(--ease-spring); }
.tab.is-active .tab__off { display: none; }
@keyframes iconIn { from { transform: scale(.8); } }
.badge {
  position: absolute; top: 4px; left: 52px;
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  background: var(--ink); color: var(--ink-inv); font-size: 11px; font-weight: 700; letter-spacing: 0;
  box-shadow: 0 0 0 2px var(--badge-ring);
  animation: pop .4s var(--ease-spring);
}
@keyframes pop { from { transform: scale(0); } }

/* ---------- общие элементы ---------- */
.list { display: flex; flex-direction: column; gap: 12px; padding-top: 12px; }
.chip {
  display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 11px;
  font-size: 12px; font-weight: 600; letter-spacing: 0; white-space: nowrap;
  background: var(--ink); color: var(--ink-inv);
}
.chip--muted { background: var(--fill); color: var(--hint); }
.banner {
  display: flex; align-items: center; gap: 10px; margin: 8px 0 4px; padding: 10px 14px 10px 8px; border-radius: 16px;
  border: 1px dashed var(--dash); font-size: 13px; line-height: 18px; color: var(--hint);
}
.hint { color: var(--hint); font-size: 13px; line-height: 18px; }
.appear { animation: rise .5s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 40ms); }
@keyframes rise { from { opacity: 0; transform: translate3d(0, 14px, 0) scale(.98); } }
tgs-sticker { display: inline-block; flex: none; line-height: 0; }

/* фильтр-чипсы ленты */
.chips-bar { display: flex; gap: 8px; margin: 10px -16px 0; padding: 0 16px; overflow-x: auto; }
.fchip {
  flex: none; display: flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px; border: 0; border-radius: 17px;
  background: var(--fill); color: var(--ink); font-size: 15px; font-weight: 500;
  transition: background-color .2s, color .2s, transform .18s var(--ease-spring);
}
.fchip:active { transform: scale(.94); }
.fchip span { color: var(--hint); }
.fchip.is-on { background: var(--ink); color: var(--ink-inv); font-weight: 600; }
.fchip.is-on span { color: inherit; opacity: .55; }
.fchip svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linejoin: round; }

/* лента: секции «Новые» / «Ранее» и сетка 2 колонки (макет 1a) */
.feed-head { display: flex; align-items: baseline; gap: 6px; padding: 22px 0 12px; }
.feed-head b { font-size: 20px; font-weight: 700; letter-spacing: -.4px; }
.feed-head span { font-size: 17px; color: var(--hint); }
.feed-head + .grid { margin-bottom: 4px; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px 10px; }

.card { position: relative; display: flex; flex-direction: column; min-width: 0; outline: none; text-align: left; transition: transform .2s var(--ease-out); }
.card:active { transform: scale(.97); }
.card:focus-visible .thumb { box-shadow: 0 0 0 2px var(--ink); }
.thumb {
  position: relative; aspect-ratio: 1 / 1; border-radius: 14px; overflow: hidden;
  display: grid; place-items: center; background: var(--ph0); color: var(--ph-icon);
}
.thumb > svg, .detail__media > svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.thumb img, .detail__media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.tone-0 { background: var(--ph0); } .tone-1 { background: var(--ph1); } .tone-2 { background: var(--ph2); } .tone-3 { background: var(--ph3); }
.tone-4 { background: var(--ph4); } .tone-5 { background: var(--ph5); } .tone-6 { background: var(--ph6); }
/* .dot — метка «Новое» (класс из контракта: is-off гасит её после просмотра) */
.dot {
  position: absolute; z-index: 1; left: 8px; top: 8px; height: 22px; padding: 0 8px; border-radius: 11px;
  display: flex; align-items: center; background: var(--ink); color: var(--ink-inv); font-size: 12px; font-weight: 600; letter-spacing: 0;
  transition: transform .35s var(--ease-spring), opacity .3s;
}
.dot.is-off { transform: scale(0); opacity: 0; }
.fav-btn, .round-btn {
  position: absolute; z-index: 1; right: 8px; top: 8px; width: 30px; height: 30px; padding: 0; border: 0; border-radius: 15px;
  display: grid; place-items: center; background: var(--round-btn); color: var(--ink);
  transition: transform .2s var(--ease-spring);
}
.fav-btn:active, .round-btn:active { transform: scale(.85); }
.fav-btn svg, .round-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.fav-btn.is-on svg, .round-btn.is-on svg { fill: currentColor; }
.fav-btn.is-on svg { animation: pop .35s var(--ease-spring); }
.card__price { margin-top: 8px; font-size: 17px; line-height: 22px; font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.card__title { margin-top: 2px; font-size: 14px; line-height: 18px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card__meta { margin-top: 4px; font-size: 12px; line-height: 16px; color: var(--hint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card__tags { margin-top: 6px; display: flex; min-width: 0; }
.tag {
  display: inline-flex; align-items: center; gap: 4px; min-width: 0; max-width: 100%; height: 20px; padding: 0 7px; border-radius: 6px;
  border: 1px solid var(--line); font-size: 12px; line-height: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tag svg { flex: none; width: 11px; height: 11px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; }
.fresh { animation: fresh .9s var(--ease-out) both; }
@keyframes fresh { 0% { opacity: 0; transform: translate3d(0, -16px, 0) scale(.94); } 60% { opacity: 1; transform: none; } }

/* скелетоны */
.skeleton { pointer-events: none; }
.skeleton .thumb, .skeleton .line, .skeleton .avatar {
  background: linear-gradient(90deg, var(--fill) 25%, transparent 50%, var(--fill) 75%);
  background-size: 200% 100%; animation: shimmer 1.3s linear infinite;
}
.line { height: 12px; border-radius: 6px; margin: 8px 0 0; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* пустые состояния (макет 1d) */
.empty { display: flex; flex-direction: column; align-items: center; padding: 64px 16px 12px; text-align: center; }
.empty h2 { margin: 16px 0 0; font-size: 22px; line-height: 28px; font-weight: 700; letter-spacing: -.4px; }
.empty p { margin: 6px 0 0; max-width: 270px; font-size: 15px; line-height: 20px; color: var(--hint); text-wrap: balance; }
.empty .btn { width: auto; margin-top: 24px; padding: 0 26px; }
.empty--small { padding-top: 40px; }
.empty--small p { margin-top: 12px; }
.examples { margin-top: 40px; font-size: 13px; color: var(--hint); }
.examples .chips { justify-content: center; max-width: 330px; margin: 10px auto 0; }

/* слежки (макет 1g) */
.watch { position: relative; padding: 14px 16px; border-radius: 16px; background: var(--card); }
.watch__main { outline: none; cursor: pointer; transition: transform .2s var(--ease-out); }
.watch__main:active { transform: scale(.985); }
.watch__q { padding-right: 63px; font-size: 17px; line-height: 22px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: color .25s; }
.watch__f { display: flex; align-items: center; gap: 5px; font-size: 15px; line-height: 20px; color: var(--hint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.watch__f svg, .city-ic { flex: none; width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.2; }
.watch__hr { height: .5px; margin: 12px 0; background: var(--sep); }
.watch__s { display: flex; align-items: center; gap: 6px; min-height: 40px; transition: opacity .3s; }
.watch__s .mini { width: 40px; height: 40px; border-radius: 9px; overflow: hidden; display: grid; place-items: center; font-size: 13px; font-weight: 600; }
.watch__s .mini img { width: 100%; height: 100%; object-fit: cover; }
.watch__s .mini--more { background: var(--fill); }
.watch__s .spacer { flex: 1; }
.watch__found { font-size: 15px; color: var(--hint); white-space: nowrap; }
.watch__new { height: 20px; padding: 0 7px; border-radius: 10px; display: flex; align-items: center; background: var(--ink); color: var(--ink-inv); font-size: 12px; font-weight: 600; letter-spacing: 0; }
.watch > .switch { position: absolute; top: 10px; right: 16px; }
.watch.is-paused .watch__q { color: var(--hint); }
.watch.is-paused .watch__s { opacity: .5; }
.watch.is-paused .watch__found { color: var(--ink); }
.limit {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 16px; border: 1px dashed var(--dash);
}
.limit__text { flex: 1; min-width: 0; }
.limit__text b { display: block; font-size: 17px; line-height: 22px; font-weight: 600; }
.limit__text span { display: block; font-size: 15px; line-height: 20px; color: var(--hint); }
.pill-btn {
  flex: none; height: 34px; padding: 0 14px; border: 0; border-radius: 17px; display: flex; align-items: center; gap: 5px;
  background: var(--ink); color: var(--ink-inv); font-size: 15px; font-weight: 600; transition: opacity .2s;
}
.pill-btn:active { opacity: .7; }
.pill-btn svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; }

/* переключатель */
.switch {
  position: relative; flex: none; width: 51px; height: 31px; border: 0; border-radius: 16px; padding: 0;
  background: var(--sep); transition: background-color .25s;
}
:root[data-scheme="dark"] .switch:not([aria-checked="true"]) { background: #2e2e2e; }
.switch::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 14px;
  background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .2);
  transition: transform .25s cubic-bezier(.3, .7, .4, 1), background-color .25s, width .2s var(--ease-out);
}
.switch:active::after { width: 31px; }
.switch[aria-checked="true"] { background: var(--ink); }
.switch[aria-checked="true"]::after { transform: translateX(20px); background: var(--knob-on); }
.switch[aria-checked="true"]:active::after { transform: translateX(16px); }
.switch:disabled { opacity: .7; }

/* профиль (макет 1h) */
.hero { display: flex; flex-direction: column; align-items: center; padding: 12px 0 0; text-align: center; }
.hero__ava { display: grid; }
.hero__ava > * { grid-area: 1 / 1; }
.hero__ava tgs-sticker { z-index: 1; align-self: end; justify-self: end; transform: translate(18px, 12px); } /* z-index у grid-элемента работает без position */
.avatar {
  position: relative; width: 88px; height: 88px; border-radius: 44px; overflow: hidden;
  display: grid; place-items: center; background: var(--ink); color: var(--ink-inv);
  font-size: 32px; font-weight: 600; letter-spacing: -.5px;
}
.avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.avatar.appear { animation: avatarIn .7s var(--ease-spring) both; }
@keyframes avatarIn { from { opacity: 0; transform: scale(.6); } }
.hero__name { margin-top: 12px; display: flex; align-items: center; gap: 8px; font-size: 24px; line-height: 30px; font-weight: 700; letter-spacing: -.5px; }
.hero__name .ic { height: 22px; padding: 0 8px; border-radius: 11px; gap: 4px; background: var(--ink); color: var(--ink-inv); }
.hero__name .ic svg { width: 11px; height: 11px; fill: currentColor; stroke: none; }
.hero__user { margin-top: 2px; font-size: 15px; line-height: 20px; color: var(--hint); }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 22px; }
.stat { padding: 12px 12px 11px; border-radius: 14px; background: var(--card); text-align: left; }
.stat[role="button"] { cursor: pointer; transition: transform .2s var(--ease-out); }
.stat[role="button"]:active { transform: scale(.96); }
.stat b { display: flex; align-items: center; gap: 6px; font-size: 24px; line-height: 29px; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat span { font-size: 13px; line-height: 18px; color: var(--hint); }
.section-title { padding: 22px 16px 7px; font-size: 13px; line-height: 18px; text-transform: uppercase; letter-spacing: .2px; color: var(--hint); }
.section-foot { padding: 8px 16px 0; font-size: 13px; line-height: 18px; color: var(--hint); }
.section { border-radius: 12px; overflow: hidden; background: var(--card); }
.section-title + .section, .stats + .section { margin-top: 0; }
.section--single { margin-top: 20px; }
.row {
  position: relative; width: 100%; min-height: 48px; padding: 8px 16px; border: 0; background: none;
  display: flex; align-items: center; gap: 12px; text-align: left; transition: background-color .2s;
}
.row + .row::before, .row + .reveal::before, .reveal + .row::before {
  content: ""; position: absolute; top: 0; left: 16px; right: 0; height: .5px; background: var(--sep);
}
.row--btn:active { background: var(--fill); }
.row__text { flex: 1; min-width: 0; }
.row__label { font-size: 17px; line-height: 22px; }
.row--btn .row__label { font-weight: 500; }
.row__hint { margin-top: 1px; font-size: 13px; line-height: 18px; color: var(--hint); }
.row__chev { flex: none; display: flex; color: var(--hint2); }
.row__chev svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.reveal { position: relative; display: grid; grid-template-rows: 0fr; transition: grid-template-rows .34s var(--ease-out); }
.reveal.is-open { grid-template-rows: 1fr; }
.reveal > div { overflow: hidden; }
.hours { display: flex; align-items: center; gap: 8px; min-height: 52px; padding: 0 16px; font-size: 17px; }
.hours__label { flex: 1; }
.hours__dash { color: var(--hint); }
.select {
  appearance: none; -webkit-appearance: none; height: 34px; padding: 0 11px; border: 0; border-radius: 8px;
  background: var(--fill); color: var(--ink); font: inherit; font-size: 17px; font-variant-numeric: tabular-nums; text-align: center;
}
.footer { margin: 22px 0 6px; text-align: center; font-size: 12px; color: var(--hint); }

/* ---------- шторка ---------- */
.backdrop {
  position: absolute; inset: 0; z-index: 20; background: rgba(0, 0, 0, .4);
  opacity: 0; pointer-events: none; transition: opacity .3s var(--ease-out);
}
.backdrop.is-open { opacity: 1; pointer-events: auto; }
.sheet {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 21;
  max-height: calc(var(--app-h) - var(--safe-top) - 16px);
  display: flex; flex-direction: column;
  padding-bottom: var(--safe-bottom);
  background: var(--sheet); border-radius: 16px 16px 0 0;
  box-shadow: 0 -10px 40px rgba(0, 0, 0, .14);
  transform: translate3d(0, 105%, 0); visibility: hidden;
  transition: transform .42s var(--ease-sheet), visibility 0s linear .42s;
  will-change: transform;
}
.sheet.is-open { transform: translate3d(0, var(--drag, 0px), 0); visibility: visible; transition: transform .42s var(--ease-sheet), visibility 0s; }
.sheet.is-dragging { transition: none; }
.sheet__grip { flex: none; display: flex; justify-content: center; padding: 6px 0 0; touch-action: none; cursor: grab; }
.sheet__grip span { width: 36px; height: 5px; border-radius: 3px; background: var(--grip); }
.sheet__body { overflow-y: auto; overscroll-behavior: contain; padding: 0 16px 16px; }
.sheet__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0 14px; touch-action: none; }
.sheet__head h2 { margin: 0; font-size: 20px; line-height: 25px; font-weight: 700; letter-spacing: -.4px; }
.sheet__x {
  flex: none; width: 30px; height: 30px; padding: 0; border: 0; border-radius: 15px; display: grid; place-items: center;
  background: var(--fill); color: var(--hint);
}
.sheet__x svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; }
.sheet__lead { margin: -6px 0 16px; color: var(--hint); font-size: 15px; line-height: 20px; }
.sheet__actions { flex: none; display: flex; flex-direction: column; gap: 8px; padding: 0 16px 12px; }
.sheet__actions:empty { display: none; }
/* объявление открывается на весь экран (макет 1l) */
.sheet.sheet--full { top: 0; max-height: none; border-radius: 0; box-shadow: none; }
.sheet.sheet--full .sheet__grip { display: none; }
.sheet.sheet--full .sheet__body { flex: 1; padding: 0 0 16px; }
.sheet.sheet--full .sheet__actions { padding-top: 8px; }

/* форма */
.field { margin-bottom: 14px; }
.field > label { display: block; padding: 0 0 8px; font-size: 13px; line-height: 18px; color: var(--hint); }
.input {
  width: 100%; height: 50px; padding: 0 14px; border: 0; border-radius: 12px; outline: none;
  background: var(--fill); color: var(--ink); font: inherit; font-size: 17px; letter-spacing: -.2px;
  transition: box-shadow .15s;
}
.input::placeholder { color: var(--hint2); }
.input:focus { box-shadow: inset 0 0 0 1.5px var(--ink); }
.field.is-error .input { box-shadow: inset 0 0 0 1.5px var(--destructive); }
.field__err { margin: 6px 4px 0; font-size: 13px; color: var(--destructive); }
.field__err:empty { display: none; }
.shake { animation: shake .42s var(--ease-out); }
@keyframes shake { 20% { transform: translateX(-7px); } 40% { transform: translateX(6px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(2px); } }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.chip-btn {
  position: relative; height: 34px; padding: 0 14px; border: 1px solid var(--line); border-radius: 17px;
  background: transparent; color: var(--ink); font-size: 15px; font-weight: 400;
  transition: background-color .2s, color .2s, border-color .2s, transform .18s var(--ease-spring);
}
.chip-btn:active { transform: scale(.94); }
.chip-btn.is-on { background: var(--ink); border-color: transparent; color: var(--ink-inv); font-weight: 600; }

/* кнопки */
.btn {
  width: 100%; height: 52px; padding: 0 16px; border: 0; border-radius: 14px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-size: 17px; font-weight: 600; transition: transform .16s var(--ease-out), opacity .2s;
}
.btn:active { transform: scale(.975); opacity: .75; }
.btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; }
.btn--primary { height: 50px; background: var(--ink); color: var(--ink-inv); }
.btn--secondary { position: relative; background: var(--fill); color: var(--ink); }
.btn--danger { height: 44px; background: none; color: var(--destructive); }

/* объявление */
.detail__media {
  position: relative; height: min(420px, 52vh); display: grid; place-items: center; touch-action: none;
  background: var(--ph0); color: var(--ph-icon); animation: mediaIn .5s var(--ease-out) both;
}
.detail__media > svg { width: 36px; height: 36px; stroke-width: 1.3; }
@keyframes mediaIn { from { opacity: .4; } }
.detail__acts { position: absolute; z-index: 1; right: 16px; bottom: 12px; display: flex; gap: 8px; }
.detail__acts .round-btn { position: static; width: 36px; height: 36px; border-radius: 18px; }
.detail__acts .round-btn svg { width: 18px; height: 18px; stroke-width: 2.1; }
.detail__new {
  position: absolute; z-index: 1; left: 16px; bottom: 14px; height: 26px; padding: 0 10px; border-radius: 13px;
  display: flex; align-items: center; background: var(--ink); color: var(--ink-inv); font-size: 13px; font-weight: 600; letter-spacing: 0;
}
.detail__info { padding: 16px 16px 0; }
.detail__price { font-size: 30px; line-height: 36px; font-weight: 700; letter-spacing: -.7px; font-variant-numeric: tabular-nums; }
.detail__title { margin-top: 4px; font-size: 17px; line-height: 22px; }
.detail__meta { margin-top: 6px; font-size: 15px; line-height: 20px; color: var(--hint); }
.detail__tags { margin-top: 12px; display: flex; gap: 6px; }
.detail__tags .tag { height: 26px; padding: 0 9px; border-radius: 8px; font-size: 13px; line-height: 18px; }
.detail__tags .tag svg { width: 12px; height: 12px; }
.kv { margin-top: 16px; border-radius: 12px; overflow: hidden; background: var(--kv); }
.kv div { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; padding: 0 14px; font-size: 15px; }
.kv div + div::before { content: ""; position: absolute; top: 0; left: 14px; right: 0; height: .5px; background: var(--line); }
.kv span { color: var(--hint); }
.kv b { font-weight: 400; text-align: right; }
.detail__info .hint { margin: 12px 0 0; }

/* Premium (макеты 1n, 1q, 1i, 1h) */
.prem { padding: calc(var(--safe-top) + 20px) 16px 8px; }
.prem__head { display: flex; flex-direction: column; align-items: center; text-align: center; }
.prem__head h2 { margin: 6px 0 0; font-size: 34px; line-height: 41px; font-weight: 700; letter-spacing: -.8px; }
.prem__head p { margin: 6px 0 0; font-size: 17px; line-height: 22px; color: var(--hint); }
.prem__table { margin-top: 26px; border-radius: 16px; overflow: hidden; border: 1px solid var(--sep); }
.prem__row { display: grid; grid-template-columns: 1fr 84px 96px; align-items: center; height: 46px; font-size: 15px; }
.prem__row + .prem__row { border-top: .5px solid var(--sep); }
.prem__row > span:first-child { padding-left: 14px; }
.prem__row > span:nth-child(2) { text-align: center; color: var(--hint); }
.prem__col { height: 100%; display: grid; place-items: center; background: var(--ink); color: var(--ink-inv); font-weight: 600; }
.prem__row--head { height: 40px; font-size: 13px; text-transform: uppercase; letter-spacing: .2px; color: var(--hint); }
.prem__sub { margin-top: 20px; }
.plans { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 20px; }
.plan {
  position: relative; display: flex; flex-direction: column; align-items: flex-start; padding: 14px; border: 0; border-radius: 16px;
  background: none; text-align: left; box-shadow: inset 0 0 0 1px var(--line); transition: box-shadow .2s, transform .18s var(--ease-spring);
}
.plan:active { transform: scale(.97); }
.plan.is-on { box-shadow: inset 0 0 0 2px var(--ink); }
.plan__name { font-size: 15px; line-height: 20px; color: var(--hint); }
.plan__price { margin-top: 2px; display: flex; align-items: center; gap: 5px; font-size: 22px; line-height: 28px; font-weight: 700; font-variant-numeric: tabular-nums; }
.plan__price svg { width: 16px; height: 16px; fill: currentColor; stroke: none; }
.pill-btn--star svg { fill: currentColor; stroke: none; }
.plan__off {
  position: absolute; top: 12px; right: 12px; height: 22px; padding: 0 7px; border-radius: 11px; display: flex; align-items: center;
  background: var(--ink); color: var(--ink-inv); font-size: 12px; font-weight: 700; font-style: normal; letter-spacing: 0;
}
.prem__note { margin: 16px 0 0; text-align: center; font-size: 13px; line-height: 18px; color: var(--hint); }
.prem__terms { display: block; margin: 10px auto 0; padding: 6px; border: 0; background: none; font-size: 13px; color: var(--hint); text-decoration: underline; text-underline-offset: 3px; }
.paid { min-height: calc(var(--app-h) - 160px); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: calc(var(--safe-top) + 20px) 32px 0; text-align: center; }
.paid h2 { margin: 18px 0 0; font-size: 28px; line-height: 34px; font-weight: 700; letter-spacing: -.6px; }
.paid p { margin: 6px 0 0; font-size: 17px; line-height: 22px; color: var(--hint); }
.prem-card {
  display: block; width: 100%; margin-top: 16px; padding: 16px; border: 0; border-radius: 18px;
  background: var(--ink); color: var(--ink-inv); text-align: left; cursor: pointer; transition: transform .2s var(--ease-out);
}
.prem-card:active { transform: scale(.985); }
.prem-card__top { display: flex; align-items: center; gap: 12px; }
.prem-card__text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.prem-card__text b { font-size: 17px; line-height: 22px; font-weight: 700; }
.prem-card__text span { font-size: 15px; line-height: 20px; opacity: .7; }
.prem-card__btn {
  width: 100%; height: 44px; margin-top: 14px; border: 0; border-radius: 12px;
  background: var(--ink-inv); color: var(--ink); font-size: 17px; font-weight: 600; transition: opacity .2s;
}
.prem-card__btn:active { opacity: .75; }
.prem-card--on { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 8px 16px; border-radius: 12px; background: var(--card); color: var(--ink); }
.prem-card--on .prem-card__text { flex-direction: row; align-items: center; gap: 8px; }
.prem-card--on .prem-card__text b { flex: 1; font-weight: 400; }
.prem-card--on .prem-card__text span { opacity: 1; color: var(--hint); font-size: 17px; }
.hero__badge { height: 22px; padding: 0 8px; border-radius: 11px; display: inline-flex; align-items: center; background: var(--ink); color: var(--ink-inv); font-size: 12px; font-weight: 600; letter-spacing: 0; }

/* доступ: подписка на канал + друзья */
.lock {
  position: absolute; inset: 0; z-index: 30; overflow-y: auto; background: var(--bg);
  padding: calc(var(--safe-top) + 24px) 16px calc(var(--safe-bottom) + 24px);
  animation: rise .45s var(--ease-out) both;
}
.lock__inner { display: flex; flex-direction: column; align-items: center; max-width: 420px; margin: 0 auto; text-align: center; }
.lock h2 { margin: 14px 0 0; font-size: 28px; line-height: 34px; font-weight: 700; letter-spacing: -.6px; }
.lock__lead { margin: 6px 0 0; font-size: 17px; line-height: 22px; color: var(--hint); }
.lock__steps { width: 100%; margin-top: 24px; display: flex; flex-direction: column; gap: 10px; }
.lock__step {
  display: flex; align-items: center; gap: 12px; padding: 14px 14px 14px 12px; border-radius: 16px;
  background: var(--grouped); text-align: left; transition: opacity .3s;
}
:root[data-scheme="dark"] .lock__step { background: var(--card); }
.lock__num {
  flex: none; width: 32px; height: 32px; border-radius: 16px; display: grid; place-items: center;
  background: var(--ink); color: var(--ink-inv); font-size: 15px; font-weight: 700;
}
.lock__step.is-done .lock__num { background: #34c759; color: #fff; }
.lock__text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.lock__text b { font-size: 17px; line-height: 22px; font-weight: 600; }
.lock__text > span { display: flex; align-items: center; gap: 2px; font-size: 14px; line-height: 19px; color: var(--hint); }
.lock__dots { display: inline-flex; gap: 4px; margin-right: 4px; }
.lock__dots i { width: 10px; height: 10px; border-radius: 5px; background: var(--sep); transition: background-color .3s; }
.lock__dots i.is-on { background: #34c759; }
.lock__link { margin-top: 16px; padding: 10px 14px; border: 0; border-radius: 12px; background: none; color: var(--ink); font-size: 15px; font-weight: 500; }
.lock__link:active { background: var(--fill); }
.lock__note { margin: 8px 0 0; max-width: 300px; font-size: 13px; line-height: 18px; color: var(--hint); }

/* на ПК окно Mini App бывает широким — держим ширину телефона */
@media (min-width: 640px) {
  html, body { background: var(--grouped); }
  .app { left: calc(50% - 280px); right: auto; width: 560px; box-shadow: 0 0 0 1px var(--sep); }
}

/* тост (макет 1p): чёрная плашка со стикером */
.toast {
  position: absolute; z-index: 40; top: calc(var(--safe-top) + 6px); left: 16px; right: 16px;
  display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 6px 16px; border-radius: 16px;
  background: var(--ink); color: var(--ink-inv);
  box-shadow: 0 10px 24px -10px rgba(0, 0, 0, .35);
  opacity: 0; transform: translateY(-14px) scale(.96); pointer-events: none;
  transition: opacity .25s var(--ease-out), transform .34s cubic-bezier(.2, .9, .3, 1.15);
}
.toast.has-sticker { padding-left: 8px; }
.toast.is-on { opacity: 1; transform: none; }
.toast.is-error { background: var(--destructive); color: #fff; }
.toast__text { flex: 1; min-width: 0; }
.toast__title { font-size: 15px; line-height: 20px; font-weight: 600; }
.toast__sub { font-size: 13px; line-height: 18px; opacity: .65; }
.toast__act { flex: none; padding: 8px 0 8px 8px; border: 0; background: none; color: inherit; font-size: 15px; font-weight: 600; opacity: .65; }
.toast.is-on .toast__act { pointer-events: auto; }

/* экран «откройте в Telegram» */
.gate {
  position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px; padding: 32px; text-align: center; background: var(--bg);
}
.gate h1 { margin: 16px 0 2px; font-size: 22px; line-height: 28px; letter-spacing: -.4px; }
.gate p { margin: 0 0 20px; max-width: 280px; font-size: 15px; line-height: 20px; color: var(--hint); }
.gate .btn { width: auto; padding: 0 26px; }

/* .tabbar, .sheet и .toast уже absolute. position: relative — только у классов из контракта */
.card, .watch, .stat, .section, .banner, .icon-btn, .chip-btn, .btn--secondary { position: relative; }

/* если стекло не поддерживается или пользователь просит меньше прозрачности */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .tabbar { background: var(--card); }
}
@media (prefers-reduced-transparency: reduce) {
  .tabbar { background: var(--card); -webkit-backdrop-filter: none; backdrop-filter: none; }
  .fav-btn, .round-btn { background: var(--card); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
