/* Радар объявлений — Telegram Mini App.
   Тема (светлая/тёмная) ставится атрибутом data-theme на <html>: из Telegram или из системы.
   Шрифты: Onest (текст), Unbounded (заголовки и цифры). */

@property --p { syntax: "<number>"; inherits: true; initial-value: 0; }
@property --angle { syntax: "<angle>"; inherits: false; initial-value: 0deg; }

:root {
  --bg: #f3f5fb;
  --surface: #ffffff;
  --surface-2: #f4f6fb;
  --surface-3: #e9edf5;
  --glass: rgba(255, 255, 255, 0.74);
  --glass-line: rgba(13, 19, 33, 0.08);
  --text: #0d1321;
  --text-2: #364055;
  --hint: #5b667a;
  --line: #e4e8f0;
  --accent: #4a4fe0;
  --accent-text: #3a3fd0;
  --accent-soft: rgba(74, 79, 224, 0.1);
  --on-accent: #ffffff;
  --grad: linear-gradient(135deg, #5b5cf6 0%, #7c4dff 50%, #0e7c86 115%);
  --good: #0f7a4a;
  --good-bg: #e3f6ec;
  --good-fill: #22c55e;
  --warn: #945300;
  --warn-bg: #fdf0da;
  --warn-fill: #f59e0b;
  --bad: #b3232f;
  --bad-bg: #fde7e9;
  --bad-fill: #f43f5e;
  --neutral-fill: #94a3b8;
  --ring-track: rgba(13, 19, 33, 0.09);
  --shadow-card: 0 1px 2px rgba(13, 19, 33, 0.04), 0 8px 24px -12px rgba(13, 19, 33, 0.2);
  --shadow-float: 0 16px 40px -16px rgba(13, 19, 33, 0.45);
  --scrim: rgba(8, 12, 22, 0.5);
  --skeleton: #e6eaf2;
  --glow-1: rgba(99, 102, 241, 0.18);
  --glow-2: rgba(20, 184, 166, 0.14);

  --font: "Onest", -apple-system, BlinkMacSystemFont, "SF Pro Text", Roboto, "Segoe UI", sans-serif;
  --font-display: "Unbounded", "Onest", -apple-system, BlinkMacSystemFont, sans-serif;

  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 24px; --sp-6: 32px;
  --r-sm: 10px; --r-md: 14px; --r-lg: 20px; --r-xl: 26px; --r-pill: 999px;

  --dur-fast: 140ms;
  --dur: 220ms;
  --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
  --ease-spring: cubic-bezier(0.32, 0.72, 0, 1);
  --ease-in: cubic-bezier(0.4, 0, 1, 1);

  --safe-top: var(--tg-content-safe-area-inset-top, 0px);
  --safe-bottom: max(var(--tg-safe-area-inset-bottom, 0px), env(safe-area-inset-bottom, 0px));
  --tabbar-h: 64px;
  --tabbar-gap: 10px;
  --mainbtn-h: 0px;

  --z-tabbar: 20; --z-mainbtn: 30; --z-sheet: 40; --z-toast: 50;
}

:root[data-theme="dark"] {
  --bg: #070b14;
  --surface: #0f1522;
  --surface-2: #151d2d;
  --surface-3: #1c2638;
  --glass: rgba(15, 21, 34, 0.74);
  --glass-line: rgba(255, 255, 255, 0.08);
  --text: #edf1f9;
  --text-2: #c3cad8;
  --hint: #8d99b0;
  --line: #1f293b;
  --accent: #4f55e6;
  --accent-text: #a8aeff;
  --accent-soft: rgba(124, 132, 255, 0.14);
  --good: #4ade80;
  --good-bg: rgba(74, 222, 128, 0.12);
  --warn: #fbbf24;
  --warn-bg: rgba(251, 191, 36, 0.12);
  --bad: #fb7185;
  --bad-bg: rgba(251, 113, 133, 0.12);
  --neutral-fill: #64748b;
  --ring-track: rgba(255, 255, 255, 0.1);
  --shadow-card: 0 0 0 1px rgba(255, 255, 255, 0.04), 0 10px 28px -14px rgba(0, 0, 0, 0.7);
  --shadow-float: 0 16px 40px -12px rgba(0, 0, 0, 0.75);
  --scrim: rgba(0, 0, 0, 0.62);
  --skeleton: #172033;
  --glow-1: rgba(99, 102, 241, 0.22);
  --glow-2: rgba(20, 184, 166, 0.14);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); }

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}

.bg-glow {
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(60% 40% at 100% 0%, var(--glow-1), transparent 70%),
    radial-gradient(50% 35% at 0% 20%, var(--glow-2), transparent 70%);
}

button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; touch-action: manipulation; }
svg { flex-shrink: 0; }

:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 2px; border-radius: var(--r-sm); }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}
.skip-link {
  position: absolute; left: var(--sp-2); top: -60px; z-index: 100;
  padding: var(--sp-2) var(--sp-3); background: var(--accent); color: var(--on-accent);
  border-radius: var(--r-sm); text-decoration: none;
}
.skip-link:focus { top: var(--sp-2); }
.tabular { font-variant-numeric: tabular-nums; }

/* ---------- Каркас ---------- */

.app {
  position: relative; z-index: 1;
  max-width: 640px; margin: 0 auto;
  padding: calc(var(--safe-top) + var(--sp-4)) var(--sp-4)
           calc(var(--tabbar-h) + var(--tabbar-gap) * 2 + var(--mainbtn-h) + var(--safe-bottom) + var(--sp-4));
}
.screen[hidden] { display: none; }
.screen { animation: screen-in 320ms var(--ease-out); }
@keyframes screen-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.screen-title {
  margin: 0; font-family: var(--font-display); font-weight: 600;
  font-size: 28px; line-height: 1.15; letter-spacing: -0.02em; text-wrap: balance;
}
.screen-title:focus { outline: none; }
.screen-sub { margin: 6px 0 0; color: var(--hint); font-size: 15px; }
.screen-head { margin-bottom: var(--sp-4); }

.sec-head {
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3);
  margin: var(--sp-5) 2px var(--sp-3);
}
.sec-title { margin: 0; font-family: var(--font-display); font-size: 17px; font-weight: 600; letter-spacing: -0.01em; }
.sec-aside { color: var(--hint); font-size: 13px; }
.section-note { margin: var(--sp-3) 4px 0; font-size: 13px; color: var(--hint); }

.stagger > * { animation: rise 520ms var(--ease-out) both; animation-delay: calc(var(--i, 0) * 45ms); }
@keyframes rise { from { opacity: 0; transform: translateY(14px) scale(0.98); } to { opacity: 1; transform: none; } }

/* ---------- Шапка с приветствием ---------- */

.topbar { display: flex; align-items: center; gap: var(--sp-3); margin-bottom: var(--sp-4); }
.avatar {
  width: 44px; height: 44px; border-radius: 50%; flex-shrink: 0;
  display: grid; place-items: center; overflow: hidden;
  background: var(--grad); color: #fff;
  font-family: var(--font-display); font-size: 17px; font-weight: 600;
  box-shadow: 0 6px 16px -6px rgba(91, 92, 246, 0.6);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.greet { flex: 1; min-width: 0; }
.greet-hi { display: block; font-size: 13px; color: var(--hint); }
.greet-name { display: block; font-size: 17px; font-weight: 700; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pill-btn {
  display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px 0 10px;
  border: 1px solid var(--glass-line); border-radius: var(--r-pill);
  background: var(--surface); color: var(--text); font-size: 14px; font-weight: 700;
  box-shadow: var(--shadow-card);
  position: relative;
}
.pill-btn::after { content: ""; position: absolute; inset: -4px; }
.pill-btn svg { width: 16px; height: 16px; color: var(--accent-text); }
.demo-pill {
  display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px;
  border-radius: var(--r-pill); background: var(--warn-bg); color: var(--warn);
  font-size: 12px; font-weight: 700; vertical-align: 2px; margin-left: 6px;
}

/* ---------- Радар (главный экран) ---------- */

.hero {
  position: relative; overflow: hidden; isolation: isolate;
  border-radius: var(--r-xl); padding: 18px;
  color: #eef2ff;
  background:
    radial-gradient(110% 90% at 0% 0%, #26308a 0%, transparent 55%),
    radial-gradient(90% 80% at 100% 110%, #0b4f4b 0%, transparent 60%),
    #0a1020;
  box-shadow: 0 20px 40px -24px rgba(24, 32, 110, 0.9);
}
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image: radial-gradient(rgba(255, 255, 255, 0.07) 1px, transparent 1px);
  background-size: 16px 16px;
  -webkit-mask-image: linear-gradient(120deg, #000 10%, transparent 70%);
  mask-image: linear-gradient(120deg, #000 10%, transparent 70%);
}
.hero-top { display: flex; align-items: center; gap: 18px; }

.radar {
  position: relative; flex-shrink: 0; width: 128px; aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle, rgba(45, 212, 191, 0.14) 0%, rgba(45, 212, 191, 0.03) 62%, transparent 71%);
  overflow: hidden;
}
.radar-rings {
  position: absolute; inset: 0; border-radius: 50%;
  border: 1px solid rgba(125, 211, 252, 0.4);
  background:
    repeating-radial-gradient(circle, transparent 0 15px, rgba(125, 211, 252, 0.16) 15px 16px),
    linear-gradient(90deg, transparent calc(50% - 0.5px), rgba(125, 211, 252, 0.16) calc(50% - 0.5px) calc(50% + 0.5px), transparent calc(50% + 0.5px)),
    linear-gradient(0deg, transparent calc(50% - 0.5px), rgba(125, 211, 252, 0.16) calc(50% - 0.5px) calc(50% + 0.5px), transparent calc(50% + 0.5px));
}
.radar-sweep {
  position: absolute; inset: 0; border-radius: 50%;
  background: conic-gradient(from 0deg, rgba(45, 212, 191, 0) 0deg, rgba(45, 212, 191, 0) 280deg, rgba(45, 212, 191, 0.45) 356deg, rgba(153, 246, 228, 0.95) 360deg);
  animation: sweep 4s linear infinite;
}
.hero.is-scanning .radar-sweep { animation-duration: 1.1s; }
@keyframes sweep { to { transform: rotate(360deg); } }
.radar-core {
  position: absolute; left: 50%; top: 50%; width: 8px; height: 8px; margin: -4px;
  border-radius: 50%; background: #99f6e4; box-shadow: 0 0 12px 3px rgba(94, 234, 212, 0.8);
}
.blip {
  position: absolute; left: calc(50% + var(--x)); top: calc(50% + var(--y));
  width: 7px; height: 7px; margin: -3.5px; border-radius: 50%;
  background: #5eead4; box-shadow: 0 0 10px 2px rgba(94, 234, 212, 0.75);
  opacity: 0.3; animation: blip 4s linear infinite; animation-delay: var(--d);
}
.blip.is-new { width: 9px; height: 9px; margin: -4.5px; background: #fde047; box-shadow: 0 0 12px 3px rgba(253, 224, 71, 0.8); }
.hero.is-scanning .blip { animation-duration: 1.1s; }
@keyframes blip {
  0% { opacity: 1; transform: scale(1.6); }
  30% { opacity: 0.35; transform: scale(1); }
  100% { opacity: 0.3; transform: scale(1); }
}

.hero-info { min-width: 0; }
.hero-kicker {
  display: flex; align-items: center; gap: 8px; margin: 0;
  font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: #a5f3e4;
}
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: #2dd4bf; animation: live 1.8s ease-out infinite; }
.live-dot.off { background: #94a3b8; animation: none; }
@keyframes live { 0% { box-shadow: 0 0 0 0 rgba(45, 212, 191, 0.6); } 100% { box-shadow: 0 0 0 10px rgba(45, 212, 191, 0); } }
.hero-big { margin: 6px 0 2px; display: flex; align-items: baseline; gap: 8px; }
.hero-big b { font-family: var(--font-display); font-size: 44px; font-weight: 600; line-height: 1; letter-spacing: -0.03em; }
.hero-big span { font-size: 16px; font-weight: 600; color: #dbe3ff; }
.hero-sub { margin: 0; font-size: 14px; color: #c7d0ea; }
.hero-sub b { color: #fff; font-variant-numeric: tabular-nums; }
.scan-text { display: none; }
.hero.is-scanning .scan-text { display: inline; }
.hero.is-scanning .wait-text { display: none; }

.hero-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 16px; }
.hero-stat {
  padding: 10px 12px; border-radius: 16px; min-width: 0;
  background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.09);
}
.hero-stat b { display: block; font-family: var(--font-display); font-size: 17px; font-weight: 600; line-height: 1.2; color: #fff; white-space: nowrap; }
.hero-stat span { display: block; margin-top: 2px; font-size: 12px; color: #c1cae4; }

/* ---------- Чипы ---------- */

.chips { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.chips.scroll {
  flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none;
  margin: 0 calc(var(--sp-4) * -1); padding: 4px var(--sp-4);
  scroll-padding-inline: var(--sp-4);
}
.chips.scroll::-webkit-scrollbar { display: none; }
.chip {
  position: relative; display: inline-flex; align-items: center; gap: 6px;
  min-height: 38px; padding: 0 14px; border-radius: var(--r-pill);
  border: 1px solid var(--line); background: var(--surface); color: var(--text);
  font-size: 14px; font-weight: 600; white-space: nowrap;
  transition: background-color var(--dur-fast) ease, border-color var(--dur-fast) ease, color var(--dur-fast) ease, transform var(--dur-fast) ease;
}
.chip::after { content: ""; position: absolute; inset: -4px 0; }
.chip:active { transform: scale(0.96); }
.chip svg { width: 16px; height: 16px; }
.chip[aria-pressed="true"], .chip[aria-checked="true"] { background: var(--text); border-color: var(--text); color: var(--surface); }
.chip[aria-disabled="true"] { opacity: 0.45; cursor: not-allowed; }
.chip .count { opacity: 0.6; font-variant-numeric: tabular-nums; }
.chip .pdot { width: 8px; height: 8px; border-radius: 50%; background: var(--c, var(--hint)); }
.chip-x { transform: rotate(45deg); }

.toggle {
  display: inline-grid; grid-auto-flow: column; gap: 2px; padding: 3px;
  border-radius: var(--r-pill); background: var(--surface-3);
}
.toggle button {
  min-height: 32px; padding: 0 12px; border: 0; border-radius: var(--r-pill); background: none;
  font-size: 13px; font-weight: 600; color: var(--hint); position: relative;
  transition: background-color var(--dur-fast) ease, color var(--dur-fast) ease;
}
.toggle button::after { content: ""; position: absolute; inset: -6px -2px; }
.toggle button[aria-checked="true"] { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12); }

/* ---------- Обложки (вместо фото в демо) ---------- */

.cover {
  position: relative; overflow: hidden; isolation: isolate;
  display: grid; place-items: center; color: #fff;
  background: var(--cover, linear-gradient(135deg, #5b5cf6, #1fb5b8));
}
.cover::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(60% 60% at 18% 12%, rgba(255, 255, 255, 0.38), transparent 60%),
    radial-gradient(70% 70% at 100% 100%, rgba(0, 0, 0, 0.28), transparent 60%);
}
.cover::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background-image: radial-gradient(rgba(255, 255, 255, 0.22) 1px, transparent 1px);
  background-size: 12px 12px;
  -webkit-mask-image: linear-gradient(200deg, #000, transparent 65%);
  mask-image: linear-gradient(200deg, #000, transparent 65%);
}
.cover > svg { width: 38%; height: auto; stroke-width: 1.5; filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.28)); }
.cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

.glass-chip {
  position: absolute; display: inline-flex; align-items: center; gap: 6px;
  height: 28px; padding: 0 10px; border-radius: var(--r-pill);
  background: rgba(8, 12, 22, 0.5); color: #fff; font-size: 12px; font-weight: 700;
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.14);
}
.glass-chip .pdot { width: 8px; height: 8px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.25); }
.new-chip {
  position: absolute; display: inline-flex; align-items: center; height: 24px; padding: 0 9px;
  border-radius: var(--r-pill); background: #fde047; color: #3b2f00; font-size: 12px; font-weight: 800;
  box-shadow: 0 4px 12px -4px rgba(253, 224, 71, 0.8);
}

/* ---------- Кольцо «Выгодности» ---------- */

.ring {
  --size: 40px; --t: 4px; --ring-c: var(--neutral-fill); --ring-bg: var(--surface);
  position: relative; width: var(--size); height: var(--size); border-radius: 50%; flex-shrink: 0;
  display: grid; place-items: center;
  background: conic-gradient(var(--ring-c) calc(var(--p) * 1%), var(--ring-track) 0);
}
.ring::before { content: ""; position: absolute; inset: var(--t); border-radius: 50%; background: var(--ring-bg); }
.ring > b { position: relative; font-family: var(--font-display); font-size: calc(var(--size) * 0.32); font-weight: 600; line-height: 1; font-variant-numeric: tabular-nums; }
.ring.tone-good { --ring-c: var(--good-fill); }
.ring.tone-warn { --ring-c: var(--warn-fill); }
.ring.tone-bad { --ring-c: var(--bad-fill); }
.ring.on-cover { --ring-bg: rgba(8, 12, 22, 0.62); --ring-track: rgba(255, 255, 255, 0.2); color: #fff; box-shadow: 0 4px 14px -4px rgba(0, 0, 0, 0.5); }
.ring.animate { animation: ring-fill 1100ms var(--ease-out) both; }
@keyframes ring-fill { from { --p: 0; } }

/* ---------- Лучшая находка ---------- */

.featured {
  display: block; width: 100%; padding: 0; border: 0; text-align: left;
  background: var(--surface); border-radius: var(--r-xl); overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: transform var(--dur-fast) ease;
}
.featured:active { transform: scale(0.985); }
.featured .cover { aspect-ratio: 16 / 9; }
.featured .cover > svg { width: 26%; }
.featured .glass-chip { top: 12px; left: 12px; }
.featured .ring { position: absolute; top: 10px; right: 10px; --size: 52px; --t: 5px; }
.featured .new-chip { left: 12px; bottom: 12px; }
.featured-body { display: grid; gap: 6px; padding: 14px 16px 16px; }
.featured-price { font-family: var(--font-display); font-size: 24px; font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.featured-title { font-size: 16px; font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }

/* ---------- Карточка объявления ---------- */

.feed { display: grid; gap: var(--sp-3); }
.listing {
  display: grid; grid-template-columns: 96px 1fr; gap: var(--sp-3);
  width: 100%; padding: 10px; border: 0; text-align: left;
  background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-card);
  transition: transform var(--dur-fast) ease;
}
.listing:active { transform: scale(0.985); }
.listing.drop-in { animation: drop-in 900ms var(--ease-spring) both; }
@keyframes drop-in {
  0% { opacity: 0; transform: translateY(-18px) scale(0.96); box-shadow: 0 0 0 0 rgba(253, 224, 71, 0); }
  50% { opacity: 1; transform: none; box-shadow: 0 0 0 3px rgba(253, 224, 71, 0.75); }
  100% { box-shadow: var(--shadow-card); }
}
.thumb { position: relative; width: 96px; aspect-ratio: 1; border-radius: var(--r-md); }
.thumb .ring { position: absolute; right: 6px; bottom: 6px; --size: 32px; --t: 3px; }
.thumb .new-chip { left: 6px; top: 6px; height: 20px; padding: 0 7px; font-size: 12px; }
.listing-body { min-width: 0; display: flex; flex-direction: column; gap: 3px; padding: 2px 2px 2px 0; }
.listing-title {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  font-size: 15px; font-weight: 600; line-height: 1.3; overflow-wrap: anywhere;
}
.listing-price { display: block; font-family: var(--font-display); font-size: 17px; font-weight: 600; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.old-price { margin-left: 6px; font-family: var(--font); font-size: 13px; font-weight: 500; color: var(--hint); }
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; color: var(--hint); font-size: 13px; }
.meta .pdot { width: 7px; height: 7px; border-radius: 50%; background: var(--c); display: inline-block; margin-right: 5px; }
.meta > span { display: inline-flex; align-items: center; }
.meta > span + span::before { content: "·"; margin-right: 8px; }
.tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: auto; padding-top: 4px; }

.tag {
  display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 8px;
  border-radius: 8px; font-size: 12px; font-weight: 700; white-space: nowrap;
  background: var(--surface-3); color: var(--text-2);
}
.tag svg { width: 13px; height: 13px; }
.tag.good { background: var(--good-bg); color: var(--good); }
.tag.warn { background: var(--warn-bg); color: var(--warn); }
.tag.bad { background: var(--bad-bg); color: var(--bad); }
.tag.accent { background: var(--accent-soft); color: var(--accent-text); }

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

.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 18px; border: 0; border-radius: var(--r-md);
  font-size: 15px; font-weight: 700;
  transition: transform var(--dur-fast) ease, opacity var(--dur-fast) ease, background-color var(--dur-fast) ease;
}
.btn:active { transform: scale(0.97); }
.btn svg { width: 18px; height: 18px; }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-gradient { background: var(--grad); color: #fff; box-shadow: 0 10px 24px -12px rgba(91, 92, 246, 0.9); overflow: hidden; }
.btn-gradient.shine::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, 0.35) 50%, transparent 70%);
  transform: translateX(-120%); animation: shine 3.2s ease-in-out infinite;
}
@keyframes shine { 0%, 55% { transform: translateX(-120%); } 85%, 100% { transform: translateX(120%); } }
.btn-soft { background: var(--accent-soft); color: var(--accent-text); }
.btn-plain { background: var(--surface-3); color: var(--text); }
.btn-danger { background: var(--bad-bg); color: var(--bad); }
.btn-block { width: 100%; }
.btn-lg { min-height: 52px; font-size: 16px; border-radius: 16px; }
.btn-icon { width: 46px; padding: 0; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn-grow { flex: 1; min-width: 0; justify-content: space-between; }
.btn-grow .tabular { margin-left: auto; opacity: 0.7; }

.fav-btn[aria-pressed="true"] { color: #f5a524; }
.fav-btn.pop svg { animation: pop 420ms var(--ease-spring); }
@keyframes pop { 0% { transform: scale(1); } 40% { transform: scale(1.45) rotate(-12deg); } 100% { transform: scale(1); } }

/* Переключатель */
.switch { position: relative; flex-shrink: 0; width: 52px; height: 32px; }
.switch input { position: absolute; inset: -6px; width: calc(100% + 12px); height: calc(100% + 12px); margin: 0; opacity: 0; cursor: pointer; z-index: 1; }
.switch-track { position: absolute; inset: 0; border-radius: var(--r-pill); background: var(--surface-3); transition: background-color var(--dur) ease; }
.switch-track::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%;
  background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25); transition: transform 280ms var(--ease-spring);
}
.switch input:checked + .switch-track { background: var(--good-fill); }
.switch input:checked + .switch-track::after { transform: translateX(20px); }
.switch input:focus-visible + .switch-track { outline: 2px solid var(--accent-text); outline-offset: 2px; }

/* ---------- Поиски ---------- */

.bento { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: var(--sp-4); }
.tile {
  position: relative; overflow: hidden; min-width: 0;
  padding: 12px; border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-card);
}
.tile-ic { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; color: #fff; background: var(--grad); margin-bottom: 10px; }
.tile-ic svg { width: 18px; height: 18px; }
.tile b { display: block; font-family: var(--font-display); font-size: 19px; font-weight: 600; line-height: 1.15; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tile span { display: block; margin-top: 2px; font-size: 12px; color: var(--hint); }

.s-card {
  background: var(--surface); border-radius: var(--r-xl); padding: 16px;
  box-shadow: var(--shadow-card); display: grid; gap: 14px;
}
.s-card + .s-card { margin-top: var(--sp-3); }
.s-head { display: grid; grid-template-columns: 48px 1fr auto; gap: 12px; align-items: start; }
.s-icon { width: 48px; height: 48px; border-radius: 15px; }
.s-icon > svg { width: 24px; }
.s-card.is-paused .s-icon { filter: grayscale(1); opacity: 0.55; }
.s-card.is-paused .s-title, .s-card.is-paused .s-meta { opacity: 0.6; }
.s-title { margin: 0; font-size: 17px; font-weight: 700; line-height: 1.25; overflow-wrap: anywhere; }
.s-meta { margin: 4px 0 0; display: grid; gap: 2px; font-size: 13px; color: var(--hint); }
.s-meta span { display: flex; align-items: center; gap: 6px; min-width: 0; overflow-wrap: anywhere; }
.s-meta svg { width: 14px; height: 14px; }
.s-meta .pdot { width: 8px; height: 8px; border-radius: 50%; background: var(--c); margin: 0 3px; flex-shrink: 0; }

.s-stats { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.s-stats-left { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.spark { display: flex; align-items: flex-end; gap: 4px; height: 34px; }
.spark i {
  display: block; width: 8px; min-height: 3px; border-radius: 3px;
  background: color-mix(in srgb, var(--accent-text) 28%, transparent); height: calc(var(--h) * 1%);
  transform-origin: bottom;
}
.spark.anim i { animation: bar-grow 700ms var(--ease-out) both; animation-delay: calc(var(--i) * 50ms); }
.spark i.today { background: var(--grad); }
@keyframes bar-grow { from { transform: scaleY(0); } }
.spark-wrap { display: grid; justify-items: end; gap: 4px; }
.spark-wrap small { font-size: 12px; color: var(--hint); }
.s-actions { display: flex; gap: var(--sp-2); }

/* ---------- Редактор ---------- */

.step { display: flex; align-items: center; gap: 10px; margin: var(--sp-5) 2px var(--sp-3); }
.step-n {
  width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  background: var(--grad); color: #fff; font-family: var(--font-display); font-size: 13px; font-weight: 600;
}
.step-t { margin: 0; font-family: var(--font-display); font-size: 17px; font-weight: 600; }

.form-card { background: var(--surface); border-radius: var(--r-xl); padding: 16px; box-shadow: var(--shadow-card); }
.form-card + .form-card { margin-top: var(--sp-3); }
.field { display: grid; gap: var(--sp-2); }
.field + .field { margin-top: 18px; }
.field-label { font-size: 15px; font-weight: 700; }
.field-label .muted { font-weight: 500; color: var(--hint); margin-left: 4px; }
.field-help { margin: 0; font-size: 13px; color: var(--hint); }
.field-error { margin: 0; font-size: 13px; color: var(--bad); font-weight: 600; }
.field-error:empty { display: none; }

.cat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.cat-tile {
  position: relative; display: grid; justify-items: center; gap: 8px;
  padding: 12px 6px 10px; border-radius: 18px; border: 2px solid transparent;
  background: var(--surface-2); font-size: 13px; font-weight: 700; color: var(--text);
  transition: border-color var(--dur-fast) ease, transform var(--dur-fast) ease, background-color var(--dur-fast) ease;
}
.cat-tile:active { transform: scale(0.96); }
.cat-tile .cover { width: 44px; height: 44px; border-radius: 14px; }
.cat-tile .cover > svg { width: 22px; }
.cat-tile[aria-checked="true"] { border-color: var(--accent-text); background: var(--accent-soft); }
.cat-check {
  position: absolute; top: 6px; right: 6px; width: 20px; height: 20px; border-radius: 50%;
  display: none; place-items: center; background: var(--accent); color: #fff;
}
.cat-check svg { width: 12px; height: 12px; stroke-width: 3; }
.cat-tile[aria-checked="true"] .cat-check { display: grid; animation: pop 360ms var(--ease-spring); }

.input, .select {
  width: 100%; min-height: 50px; padding: 0 14px; border-radius: var(--r-md);
  border: 1.5px solid var(--line); background: var(--surface-2); font-size: 16px;
  transition: border-color var(--dur-fast) ease, box-shadow var(--dur-fast) ease, background-color var(--dur-fast) ease;
}
.input::placeholder { color: var(--hint); opacity: 0.85; }
.input:focus, .select:focus { outline: none; border-color: var(--accent-text); background: var(--surface); box-shadow: 0 0 0 4px var(--accent-soft); }
.input[aria-invalid="true"] { border-color: var(--bad); }
.select { appearance: none; padding-right: 40px; }
.select:disabled { opacity: 0.5; }
.select-wrap { position: relative; }
.select-wrap svg { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--hint); pointer-events: none; }
.range { display: grid; grid-template-columns: 1fr auto 1fr; gap: var(--sp-2); align-items: center; }
.range-dash { color: var(--hint); }

.segmented { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 2px; padding: 3px; border-radius: var(--r-md); background: var(--surface-3); }
.segmented button {
  min-height: 40px; border: 0; border-radius: 11px; background: none;
  font-size: 14px; font-weight: 600; color: var(--hint);
  transition: background-color var(--dur-fast) ease, color var(--dur-fast) ease;
}
.segmented button[aria-checked="true"] { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12); }

.limit-note { display: flex; gap: var(--sp-2); align-items: flex-start; margin: 0; font-size: 13px; color: var(--hint); }
.limit-note svg { width: 16px; height: 16px; margin-top: 1px; }

.preview {
  margin-top: var(--sp-5); padding: 14px; border-radius: var(--r-xl);
  border: 1.5px dashed var(--line); display: grid; gap: 10px;
}
.preview-k { font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--hint); }

.back-btn { display: inline-flex; align-items: center; gap: 4px; margin-bottom: var(--sp-3); padding: 0 14px 0 8px; min-height: 40px; border: 0; border-radius: var(--r-pill); background: var(--surface); box-shadow: var(--shadow-card); font-size: 15px; font-weight: 600; }
.back-btn svg { width: 20px; height: 20px; transform: rotate(180deg); }

/* ---------- Тариф ---------- */

.plan-hero {
  position: relative; overflow: hidden; isolation: isolate;
  padding: 20px; border-radius: var(--r-xl); color: #fff;
  background: linear-gradient(135deg, #3b3fd8 0%, #6d3ff0 55%, #0e7c86 120%);
  box-shadow: 0 20px 40px -22px rgba(79, 70, 229, 0.9);
}
.plan-hero::after {
  content: ""; position: absolute; inset: -40% -20% auto auto; width: 70%; aspect-ratio: 1; z-index: -1;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.28), transparent 65%);
}
.plan-hero-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.plan-hero-k { margin: 0; font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: rgba(255, 255, 255, 0.85); }
.plan-hero-name { margin: 4px 0 2px; font-family: var(--font-display); font-size: 34px; font-weight: 600; line-height: 1.05; letter-spacing: -0.02em; }
.plan-hero-until { margin: 0; font-size: 14px; color: rgba(255, 255, 255, 0.9); }
.plan-hero .ring { --size: 76px; --t: 6px; --ring-c: #fff; --ring-track: rgba(255, 255, 255, 0.22); color: #fff; }
.plan-hero .ring::before { background: #5a3fe8; }
.ring-lbl { position: relative; display: grid; justify-items: center; line-height: 1; }
.ring-lbl b { font-family: var(--font-display); font-size: 22px; font-weight: 600; }
.ring-lbl small { font-size: 12px; margin-top: 2px; opacity: 0.9; }
.plan-hero-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 18px; }
.plan-hero-grid div { padding: 10px 12px; border-radius: 14px; background: rgba(255, 255, 255, 0.12); border: 1px solid rgba(255, 255, 255, 0.16); min-width: 0; }
.plan-hero-grid b { display: block; font-family: var(--font-display); font-size: 16px; font-weight: 600; white-space: nowrap; }
.plan-hero-grid span { display: block; font-size: 12px; color: rgba(255, 255, 255, 0.88); }

.periods { position: relative; display: grid; grid-template-columns: 1fr 1fr; padding: 4px; border-radius: var(--r-pill); background: var(--surface-3); }
.periods-thumb {
  position: absolute; top: 4px; bottom: 4px; left: 4px; width: calc(50% - 4px);
  border-radius: var(--r-pill); background: var(--surface); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  transition: transform 360ms var(--ease-spring);
}
.periods[data-p="90"] .periods-thumb { transform: translateX(100%); }
.periods button { position: relative; min-height: 42px; border: 0; background: none; border-radius: var(--r-pill); font-size: 14px; font-weight: 700; color: var(--hint); }
.periods button[aria-checked="true"] { color: var(--text); }
.periods .save { display: inline-block; margin-left: 6px; padding: 1px 6px; border-radius: 6px; background: var(--good-bg); color: var(--good); font-size: 12px; }

.plans { display: grid; gap: 16px; margin-top: 20px; }
.plan {
  position: relative; padding: 18px; border-radius: var(--r-xl);
  background: var(--surface); box-shadow: var(--shadow-card); display: grid; gap: 14px;
}
.plan.is-featured {
  border: 2px solid transparent;
  background:
    linear-gradient(var(--surface), var(--surface)) padding-box,
    conic-gradient(from var(--angle), #6366f1, #22d3ee, #a855f7, #f472b6, #6366f1) border-box;
  animation: spin-border 6s linear infinite;
}
@keyframes spin-border { to { --angle: 360deg; } }
.plan.is-free { background: transparent; box-shadow: none; border: 1.5px dashed var(--line); }
.plan-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.plan-title { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-family: var(--font-display); font-size: 20px; font-weight: 600; }
.plan-price { text-align: right; white-space: nowrap; }
.plan-price b { font-family: var(--font-display); font-size: 24px; font-weight: 600; font-variant-numeric: tabular-nums; }
.plan-price small { display: block; font-size: 12px; color: var(--hint); }
.star-ic { width: 20px; height: 20px; color: #f5a524; vertical-align: -3px; margin-left: 2px; }
.plan-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; font-size: 15px; }
.plan-list li { display: flex; gap: 10px; align-items: center; }
.plan-list .li-ic { width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); flex-shrink: 0; }
.plan-list .li-ic svg { width: 15px; height: 15px; }
.plan-ribbon {
  position: absolute; top: -12px; right: 18px; padding: 4px 10px; border-radius: var(--r-pill);
  background: var(--grad); color: #fff; font-size: 12px; font-weight: 800; letter-spacing: 0.02em;
  box-shadow: 0 6px 16px -6px rgba(91, 92, 246, 0.8);
}

.group { background: var(--surface); border-radius: var(--r-xl); overflow: hidden; box-shadow: var(--shadow-card); }
.row { position: relative; display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; padding: 10px 16px; border: 0; background: none; text-align: left; }
.row + .row::before { content: ""; position: absolute; top: 0; right: 0; left: 60px; border-top: 1px solid var(--line); }
button.row:active { background: var(--surface-2); }
.row-main { flex: 1; min-width: 0; font-size: 16px; font-weight: 600; }
.row-icon { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); }
.row-icon svg { width: 18px; height: 18px; }
.row-chevron { width: 18px; height: 18px; color: var(--hint); }

/* ---------- Нижнее меню (плавающее стекло) ---------- */

.tabbar {
  position: fixed; z-index: var(--z-tabbar);
  left: 12px; right: 12px; bottom: calc(var(--safe-bottom) + var(--tabbar-gap));
  display: flex; justify-content: center; pointer-events: none;
}
.tabbar-inner {
  position: relative; pointer-events: auto;
  display: grid; grid-template-columns: repeat(4, 1fr); width: 100%; max-width: 480px;
  padding: 6px; border-radius: 24px;
  background: var(--glass); border: 1px solid var(--glass-line);
  -webkit-backdrop-filter: blur(22px) saturate(1.6); backdrop-filter: blur(22px) saturate(1.6);
  box-shadow: var(--shadow-float);
}
.tab-ind {
  position: absolute; top: 6px; bottom: 6px; left: 6px; width: calc((100% - 12px) / 4);
  border-radius: 18px; background: var(--accent-soft);
  transform: translateX(calc(var(--ti, 0) * 100%));
  transition: transform 420ms var(--ease-spring);
}
.tab {
  position: relative; min-height: 52px; border: 0; background: none;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  color: var(--hint); font-size: 12px; font-weight: 700;
  transition: color var(--dur) ease;
}
.tab svg { width: 24px; height: 24px; transition: transform 300ms var(--ease-spring); }
.tab[aria-current="page"] { color: var(--accent-text); }
.tab[aria-current="page"] svg { transform: translateY(-1px) scale(1.08); }
.tab-icon { position: relative; display: flex; }
.tab .badge {
  position: absolute; top: -6px; left: 14px; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: var(--r-pill); background: #e11d48; color: #fff; border: 2px solid var(--surface);
  font-size: 11px; font-weight: 800; line-height: 18px; text-align: center;
}
.tab .badge.bump { animation: pop 420ms var(--ease-spring); }

/* ---------- Лист (bottom sheet) ---------- */

.sheet { position: fixed; inset: 0; z-index: var(--z-sheet); display: flex; align-items: flex-end; justify-content: center; visibility: hidden; pointer-events: none; }
.sheet.is-open { visibility: visible; pointer-events: auto; }
.sheet-scrim { position: absolute; inset: 0; background: var(--scrim); opacity: 0; transition: opacity 300ms ease; }
.sheet.is-open .sheet-scrim { opacity: 1; }
.sheet-panel {
  position: relative; width: 100%; max-width: 640px; max-height: 94dvh;
  overflow-y: auto; overscroll-behavior: contain;
  background: var(--surface); border-radius: 28px 28px 0 0;
  padding: 0 var(--sp-4) calc(var(--safe-bottom) + var(--sp-4));
  transform: translateY(100%); transition: transform 460ms var(--ease-spring);
}
.sheet-panel:focus { outline: none; }
.sheet.is-open .sheet-panel { transform: none; }
.sheet.is-closing .sheet-panel { transition: transform 220ms var(--ease-in); }
.sheet-grip { position: absolute; top: 8px; left: 50%; z-index: 2; width: 40px; height: 5px; margin-left: -20px; border-radius: var(--r-pill); background: rgba(255, 255, 255, 0.7); }
.sheet-close {
  position: absolute; top: 12px; right: 12px; z-index: 2; width: 40px; height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.2); border-radius: 50%;
  background: rgba(8, 12, 22, 0.45); color: #fff; display: grid; place-items: center;
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.sheet-close::after { content: ""; position: absolute; inset: -4px; }
.sheet-close svg { width: 20px; height: 20px; }

.sheet-cover { margin: 0 calc(var(--sp-4) * -1); aspect-ratio: 16 / 10; border-radius: 28px 28px 0 0; }
.sheet-cover > svg { width: 24%; }
.sheet-cover .glass-chip { left: 16px; bottom: 16px; }
.sheet-cover .new-chip { right: 16px; bottom: 18px; }

.d-head { padding-top: 18px; }
.d-title { margin: 0 0 6px; font-size: 20px; font-weight: 700; line-height: 1.3; overflow-wrap: anywhere; }
.d-price-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 10px; }
.d-price { font-family: var(--font-display); font-size: 30px; font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.d-note { display: flex; align-items: center; gap: 6px; margin: 10px 0 0; font-size: 13px; color: var(--hint); }
.d-note svg { width: 15px; height: 15px; }

.deal { margin-top: 18px; padding: 16px; border-radius: var(--r-lg); display: grid; grid-template-columns: auto 1fr; gap: 16px; align-items: center; }
.deal.good { background: var(--good-bg); }
.deal.warn { background: var(--warn-bg); }
.deal.bad { background: var(--bad-bg); }
.deal.neutral { background: var(--surface-2); }
.deal.empty-deal { grid-template-columns: 1fr; }
.deal .ring { --size: 84px; --t: 7px; --ring-bg: var(--surface); }
.deal .ring > b { font-size: 26px; }
.deal-k { margin: 0; font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--hint); }
.deal-v { margin: 2px 0 4px; font-size: 18px; font-weight: 800; }
.deal.good .deal-v { color: var(--good); }
.deal.warn .deal-v { color: var(--warn); }
.deal.bad .deal-v { color: var(--bad); }
.deal-text { margin: 0; font-size: 14px; color: var(--text-2); }
.deal-warns { grid-column: 1 / -1; display: grid; gap: 6px; }
.deal-warn { margin: 0; display: flex; gap: 8px; align-items: flex-start; padding: 10px 12px; border-radius: 12px; background: var(--surface); color: var(--warn); font-size: 14px; font-weight: 700; }
.deal-warn svg { width: 16px; height: 16px; margin-top: 2px; }

.market { margin-top: 20px; }
.market-bar {
  position: relative; height: 12px; margin: 46px 0 8px; border-radius: var(--r-pill);
  background: linear-gradient(90deg, var(--good-fill) 0%, var(--neutral-fill) 50%, var(--bad-fill) 100%);
}
.market-median { position: absolute; left: 50%; top: -6px; bottom: -6px; width: 2px; margin-left: -1px; border-radius: 2px; background: var(--text); opacity: 0.5; }
.market-pin { position: absolute; top: 50%; left: var(--pos); width: 22px; height: 22px; margin: -11px 0 0 -11px; border-radius: 50%; background: var(--surface); border: 4px solid var(--text); box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25); animation: pin-in 900ms var(--ease-spring) both; }
@keyframes pin-in { from { left: 50%; transform: scale(0.4); } }
.market-bubble {
  position: absolute; bottom: calc(100% + 12px); left: var(--pos); transform: translateX(-50%);
  padding: 3px 8px; border-radius: 8px; background: var(--text); color: var(--surface);
  font-size: 12px; font-weight: 800; white-space: nowrap; animation: fade-up 500ms 400ms var(--ease-out) both;
}
@keyframes fade-up { from { opacity: 0; transform: translate(-50%, 6px); } }
.market-scale { display: flex; justify-content: space-between; font-size: 12px; color: var(--hint); }
.market-scale span:nth-child(2) { font-weight: 700; color: var(--text-2); }

.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 20px; }
.fact { padding: 12px; border-radius: var(--r-md); background: var(--surface-2); min-width: 0; }
.fact span { display: block; font-size: 12px; color: var(--hint); }
.fact b { display: block; margin-top: 2px; font-size: 15px; font-weight: 700; overflow-wrap: anywhere; }
.attrs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }

.history { margin-top: 20px; padding: 14px; border-radius: var(--r-lg); background: var(--surface-2); }
.history-sum { margin: 0 0 8px; display: flex; gap: 8px; align-items: center; font-size: 15px; font-weight: 700; }
.history-sum svg { width: 18px; height: 18px; color: var(--accent-text); }
.history-chart { width: 100%; height: 88px; display: block; overflow: visible; }
.history-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 3px; font-size: 13px; }
.history-list li { display: flex; justify-content: space-between; color: var(--hint); }
.history-list b { color: var(--text); }

.sheet-actions {
  position: sticky; bottom: calc(var(--sp-4) * -1 - var(--safe-bottom)); z-index: 1;
  display: grid; grid-template-columns: 1fr 52px; gap: 10px;
  margin: 20px calc(var(--sp-4) * -1) 0; padding: 14px var(--sp-4) calc(var(--safe-bottom) + var(--sp-4));
  background: linear-gradient(to bottom, transparent, var(--surface) 28%);
}
.sheet-actions .btn { min-height: 52px; }

/* ---------- Кнопка-заменитель MainButton (вне Telegram) ---------- */

.main-fallback {
  position: fixed; left: 0; right: 0; z-index: var(--z-mainbtn);
  bottom: calc(var(--tabbar-h) + var(--tabbar-gap) * 2 + var(--safe-bottom));
  padding: 0 var(--sp-4); display: flex; justify-content: center; pointer-events: none;
}
.main-fallback[hidden] { display: none; }
.main-fallback .btn { pointer-events: auto; width: 100%; max-width: 608px; background: var(--grad); color: #fff; box-shadow: 0 12px 28px -12px rgba(91, 92, 246, 0.9); }
body.has-main-fallback { --mainbtn-h: 62px; }
body.no-tabbar .tabbar { display: none; }
body.no-tabbar { --tabbar-h: 0px; --tabbar-gap: 6px; }

/* ---------- Состояния ---------- */

.empty {
  display: grid; justify-items: center; gap: 8px; padding: 36px 20px; text-align: center;
  background: var(--surface); border-radius: var(--r-xl); box-shadow: var(--shadow-card);
}
.empty-ic { width: 64px; height: 64px; border-radius: 20px; display: grid; place-items: center; background: var(--grad); color: #fff; margin-bottom: 4px; box-shadow: 0 12px 24px -12px rgba(91, 92, 246, 0.9); }
.empty-ic svg { width: 30px; height: 30px; }
.empty h3 { margin: 0; font-family: var(--font-display); font-size: 18px; font-weight: 600; }
.empty p { margin: 0 0 8px; color: var(--hint); font-size: 15px; max-width: 30ch; }

.skeleton { background: var(--skeleton); position: relative; overflow: hidden; }
.skeleton::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--surface) 60%, transparent), transparent);
  transform: translateX(-100%); animation: shimmer 1.2s infinite;
}
@keyframes shimmer { to { transform: translateX(100%); } }
.sk-top { height: 44px; border-radius: 22px; width: 60%; margin-bottom: 16px; }
.sk-hero { height: 214px; border-radius: var(--r-xl); margin-bottom: 24px; }
.sk-card { display: grid; grid-template-columns: 96px 1fr; gap: 12px; padding: 10px; background: var(--surface); border-radius: var(--r-lg); }
.sk-thumb { width: 96px; aspect-ratio: 1; border-radius: var(--r-md); }
.sk-lines { display: grid; gap: 8px; align-content: start; padding-top: 4px; }
.sk-line { height: 12px; border-radius: 6px; }

.toast {
  position: fixed; z-index: var(--z-toast); left: var(--sp-4); right: var(--sp-4); margin: 0 auto;
  bottom: calc(var(--tabbar-h) + var(--tabbar-gap) * 2 + var(--mainbtn-h) + var(--safe-bottom) + 8px);
  width: fit-content; max-width: 520px;
  display: flex; align-items: center; gap: 10px; padding: 12px 16px;
  border-radius: 16px; background: rgba(13, 19, 33, 0.94); color: #fff;
  font-size: 14px; font-weight: 600; box-shadow: var(--shadow-float);
  opacity: 0; transform: translateY(16px) scale(0.96); pointer-events: none;
  transition: opacity var(--dur) ease, transform 380ms var(--ease-spring);
}
.toast svg { width: 18px; height: 18px; color: #5eead4; }
.toast.is-shown { opacity: 1; transform: none; }

@media (min-width: 600px) {
  .listing { grid-template-columns: 120px 1fr; }
  .thumb, .sk-thumb { width: 120px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important; animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .radar-sweep { display: none; }
  .blip { opacity: 0.8; }
}
.tile .tile-ic { color: #fff; margin-top: 0; font-size: inherit; }

/* Заблокированные поля у готового поиска */
.is-locked .cat-tile[aria-disabled="true"]:not([aria-checked="true"]),
.chip[aria-disabled="true"]:not([aria-checked="true"]),
.segmented button[aria-disabled="true"]:not([aria-checked="true"]) { opacity: 0.4; cursor: not-allowed; }
.lock-note { margin: 0 2px var(--sp-2); padding: 12px 14px; border-radius: var(--r-md); background: var(--accent-soft); color: var(--text-2); }
.lock-note svg { color: var(--accent-text); }
.sites-line { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 4px; }
.sites-line .pdot, .s-meta .pdot { width: 8px; height: 8px; border-radius: 50%; background: var(--c); display: inline-block; margin: 0 3px; }
.chip[aria-disabled="true"][aria-checked="true"] { opacity: 1; cursor: default; }
