/* CPM Tracker — «Ink & Signal»: тёплая бумага, чернильный чёрный, сигнальный зелёный из логотипа. Без градиентов. */
/* Атрибут hidden всегда сильнее display из классов (.btn, .row и т.п.) */
[hidden] { display: none !important; }
:root {
  --bg: #F3F2EE;
  --surface: #FFFFFF;
  --surface-2: #EBEAE4;
  --elevated: #FFFFFF;
  --label: #141414;
  --label-2: rgba(20, 20, 20, .56);
  --label-3: rgba(20, 20, 20, .3);
  --sep: rgba(20, 20, 20, .09);
  --fill: rgba(20, 20, 20, .055);
  --fill-2: rgba(20, 20, 20, .12);
  --ink: #141414;
  --on-ink: #FFFFFF;
  --signal: #22C55E;
  --accent: #0E8A43;
  --accent-tint: rgba(34, 197, 94, .14);
  --green: #0E8A43;
  --green-solid: #22C55E;
  --red: #E5484D;
  --orange: #F08C00;
  --star: #F5A524;
  --bar: rgba(255, 255, 255, .86);
  --scrim: rgba(10, 10, 10, .38);
  --shadow: 0 10px 34px rgba(20, 20, 20, .09), 0 1px 2px rgba(20, 20, 20, .05);

  --r-xs: 8px; --r-s: 12px; --r-m: 18px; --r-l: 24px; --r-xl: 30px;
  --ease: cubic-bezier(.32, .72, 0, 1);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", Roboto, system-ui, sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", "Segoe UI", Roboto, system-ui, sans-serif;
  --safe-top: max(env(safe-area-inset-top), var(--tg-safe-area-inset-top, 0px));
  --safe-bottom: max(env(safe-area-inset-bottom), var(--tg-safe-area-inset-bottom, 0px));
  --content-top: var(--tg-content-safe-area-inset-top, 0px);
  --tabbar-h: 56px;
}
[data-theme="dark"] {
  --bg: #0C0D0F;
  --surface: #17181B;
  --surface-2: #222327;
  --elevated: #1D1E22;
  --label: #F2F1EC;
  --label-2: rgba(242, 241, 236, .58);
  --label-3: rgba(242, 241, 236, .28);
  --sep: rgba(242, 241, 236, .08);
  --fill: rgba(242, 241, 236, .07);
  --fill-2: rgba(242, 241, 236, .14);
  --ink: #F2F1EC;
  --on-ink: #111111;
  --accent: #3DDC7A;
  --accent-tint: rgba(61, 220, 122, .14);
  --green: #3DDC7A;
  --green-solid: #2FCF6B;
  --red: #FF6369;
  --orange: #FFA94D;
  --bar: rgba(23, 24, 27, .86);
  --scrim: rgba(0, 0, 0, .6);
  --shadow: 0 10px 34px rgba(0, 0, 0, .5), 0 0 0 .5px rgba(255, 255, 255, .06);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg); color: var(--label);
  font: 400 17px/1.35 var(--font); letter-spacing: -.01em;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  overscroll-behavior: none; overflow: hidden;
  font-variant-numeric: tabular-nums;
}
button, input, textarea, select { font: inherit; color: inherit; letter-spacing: inherit; }
button { border: 0; background: none; padding: 0; cursor: pointer; }
a { color: var(--accent); text-decoration: none; }
img { display: block; max-width: 100%; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.icon { display: inline-flex; width: 24px; height: 24px; flex: none; }
.icon svg { width: 100%; height: 100%; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ——— Загрузочный экран ——— */
.splash {
  position: fixed; inset: 0; z-index: 100; background: var(--bg);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0;
  transition: opacity .45s var(--ease), transform .45s var(--ease);
}
.splash.out { opacity: 0; transform: scale(1.04); pointer-events: none; }
.splash-logo { width: 96px; height: 96px; display: block; }
.splash-logo .sq { fill: #141414; transform-origin: center; animation: sq-in .7s var(--ease) both; }
.splash-logo .tri {
  fill: transparent; stroke: #fff; stroke-width: 72; stroke-linejoin: round;
  stroke-dasharray: 1400; stroke-dashoffset: 1400;
  animation: tri-draw .9s .25s var(--ease) forwards, tri-fill .3s 1s ease forwards;
}
.splash-logo .dot { fill: #22C55E; transform-origin: 770px 270px; transform: scale(0); animation: dot-pop .5s 1.05s var(--ease) forwards; }
[data-theme="dark"] .splash-logo .sq { fill: #222327; }
.splash-word { margin-top: 22px; font: 700 24px/1 var(--font-display); letter-spacing: -.02em; opacity: 0; animation: rise .6s .55s var(--ease) forwards; }
.splash-sub { margin-top: 8px; font-size: 15px; color: var(--label-2); opacity: 0; animation: rise .6s .7s var(--ease) forwards; }
.splash-bar { margin-top: 36px; width: 120px; height: 3px; border-radius: 2px; background: var(--fill); overflow: hidden; opacity: 0; animation: rise .4s .9s ease forwards; }
.splash-bar i { display: block; height: 100%; width: 40%; border-radius: 2px; background: var(--label); animation: bar 1.1s ease-in-out infinite; }
@keyframes sq-in { from { transform: scale(.7); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes tri-draw { to { stroke-dashoffset: 0; } }
@keyframes tri-fill { to { fill: #fff; } }
@keyframes dot-pop { 60% { transform: scale(1.25); } to { transform: scale(1); } }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes bar { 0% { transform: translateX(-100%); } 100% { transform: translateX(260%); } }
.splash-error { margin-top: 28px; max-width: 280px; text-align: center; color: var(--label-2); font-size: 15px; }

/* ——— Каркас ——— */
#app { position: fixed; inset: 0; }
.tabs-layer { position: absolute; inset: 0; }
.tab { position: absolute; inset: 0; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch;
  padding-bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 24px); display: none; }
.tab.on { display: block; }
.page {
  position: absolute; inset: 0; z-index: 20; background: var(--bg); overflow-y: auto; overflow-x: hidden;
  padding-bottom: calc(var(--safe-bottom) + 96px);
  animation: page-in .42s var(--ease);
  box-shadow: -20px 0 40px rgba(0,0,0,.08);
}
.page.leaving { animation: page-out .32s var(--ease) forwards; }
@keyframes page-in { from { transform: translateX(100%); } to { transform: none; } }
@keyframes page-out { to { transform: translateX(100%); } }

/* Навбар */
.navbar {
  position: sticky; top: 0; z-index: 10; height: calc(44px + var(--safe-top) + var(--content-top));
  padding: calc(var(--safe-top) + var(--content-top)) 8px 0;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  background: transparent; transition: background .2s, border-color .2s; border-bottom: .5px solid transparent;
}
.navbar.solid { background: var(--bar); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px); border-bottom-color: var(--sep); }
.navbar .nav-title { font-weight: 600; font-size: 17px; opacity: 0; transition: opacity .2s; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 60vw; }
.navbar.solid .nav-title { opacity: 1; }
.navbar .left { justify-self: start; display: flex; gap: 4px; }
.navbar .right { justify-self: end; display: flex; gap: 4px; }
.nav-btn { height: 36px; min-width: 36px; padding: 0 8px; border-radius: 18px; display: inline-flex; align-items: center; justify-content: center; gap: 4px; color: var(--accent); font-size: 17px; }
.nav-btn:active { opacity: .5; }
.large-title { padding: 2px 20px 10px; font: 700 34px/1.12 var(--font-display); letter-spacing: -.025em; margin: 0; }
.large-sub { padding: 0 20px 12px; margin-top: -6px; color: var(--label-2); font-size: 15px; }

/* Таббар */
.tabbar {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 15;
  height: calc(var(--tabbar-h) + var(--safe-bottom)); padding-bottom: var(--safe-bottom);
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: var(--bar); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  border-top: .5px solid var(--sep);
}
.tabbar button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--label-3); font-size: 10px; font-weight: 500; position: relative; }
[data-theme="dark"] .tabbar button { color: rgba(235,235,245,.45); }
.tabbar button.on { color: var(--accent); }
.tabbar .icon { width: 26px; height: 26px; }
.tabbar .badge { position: absolute; top: 5px; left: calc(50% + 6px); }

/* ——— Компоненты ——— */
.section { margin: 0 16px 28px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; padding: 0 4px 8px; }
.section-title { font: 700 22px/1.2 var(--font-display); letter-spacing: -.02em; margin: 0; }
.section-link { color: var(--accent); font-size: 17px; }
.caption { padding: 0 16px 6px; color: var(--label-2); font-size: 13px; }
.footnote { padding: 8px 16px 0; color: var(--label-2); font-size: 13px; line-height: 1.4; }

.group { background: var(--surface); border-radius: var(--r-m); overflow: hidden; }
.row {
  display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 10px 16px; position: relative;
  width: 100%; text-align: left; background: var(--surface);
}
button.row:active, a.row:active, .row.tap:active { background: var(--fill); }
.row + .row::before { content: ""; position: absolute; top: 0; right: 0; left: var(--inset, 16px); border-top: .5px solid var(--sep); }
.row .grow { flex: 1; min-width: 0; }
.row .title { font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .sub { font-size: 13px; color: var(--label-2); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .value { color: var(--label-2); font-size: 17px; white-space: nowrap; }
.row .chev { color: var(--label-3); width: 18px; height: 18px; }
.row.danger .title { color: var(--red); }
.row.accent .title { color: var(--accent); }
.row-icon { width: 30px; height: 30px; border-radius: 7px; display: grid; place-items: center; color: #fff; flex: none; }
.row-icon .icon { width: 19px; height: 19px; }

.btn {
  height: 50px; padding: 0 20px; border-radius: var(--r-m); display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-weight: 600; font-size: 17px; background: var(--accent); color: #fff; width: 100%; transition: opacity .15s, transform .15s;
}
.btn:active { opacity: .75; transform: scale(.985); }
.btn:disabled { opacity: .4; }
.btn.secondary { background: var(--accent-tint); color: var(--accent); }
.btn.plain { background: var(--fill); color: var(--label); }
.btn.danger { background: rgba(255,59,48,.12); color: var(--red); }
.btn.small { height: 34px; width: auto; padding: 0 14px; border-radius: 17px; font-size: 15px; }
.btn.pill { height: 30px; width: auto; padding: 0 16px; border-radius: 15px; font-size: 15px; font-weight: 700; }
.btn-row { display: flex; gap: 10px; }

.badge { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--red); color: #fff; font-size: 12px; font-weight: 600; display: inline-grid; place-items: center; line-height: 1; }
.tag { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: 6px; font-size: 12px; font-weight: 600; background: var(--fill); color: var(--label-2); white-space: nowrap; }
.tag.new { background: var(--accent-tint); color: var(--accent); }
.tag.ok { background: rgba(52,199,89,.14); color: var(--green); }
.tag.warn { background: rgba(255,149,0,.14); color: var(--orange); }
.tag.bad { background: rgba(255,59,48,.12); color: var(--red); }
.tag .icon { width: 13px; height: 13px; }

/* Поиск */
.search { position: relative; margin: 0 16px 12px; }
.search input { width: 100%; height: 36px; border: 0; border-radius: var(--r-s); background: var(--fill); padding: 0 12px 0 34px; font-size: 17px; outline: none; }
.search input::placeholder { color: var(--label-2); }
.search .icon { position: absolute; left: 8px; top: 8px; width: 20px; height: 20px; color: var(--label-2); }

/* Сегментированный контрол */
.segmented { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--fill); border-radius: 9px; padding: 2px; position: relative; height: 32px; }
.segmented button { position: relative; z-index: 1; font-size: 13px; font-weight: 500; border-radius: 7px; white-space: nowrap; padding: 0 6px; }
.segmented button.on { font-weight: 600; }
.segmented .thumb { position: absolute; top: 2px; bottom: 2px; left: 2px; border-radius: 7px; background: var(--surface); box-shadow: 0 3px 8px rgba(0,0,0,.12), 0 1px 1px rgba(0,0,0,.04); transition: transform .3s var(--ease); }
[data-theme="dark"] .segmented .thumb { background: #636366; }

/* Чипы платформ */
.chips { display: flex; gap: 8px; padding: 0 16px; overflow-x: auto; scrollbar-width: none; margin-bottom: 18px; }
.chips::-webkit-scrollbar { display: none; }
.chip { height: 34px; padding: 0 14px; border-radius: 17px; background: var(--surface); display: inline-flex; align-items: center; gap: 6px; font-size: 15px; font-weight: 500; white-space: nowrap; flex: none; border: .5px solid var(--sep); }
.chip .icon { width: 17px; height: 17px; }
.chip.on { background: var(--label); color: var(--bg); border-color: var(--label); }

/* Логотип оффера */
.logo { width: 52px; height: 52px; border-radius: 12px; flex: none; display: grid; place-items: center; overflow: hidden; color: #fff; font: 700 22px/1 var(--font-display); border: .5px solid var(--sep); }
.logo img { width: 100%; height: 100%; object-fit: cover; }
.logo.l { width: 96px; height: 96px; border-radius: 22px; font-size: 40px; }
.logo.s { width: 36px; height: 36px; border-radius: 9px; font-size: 15px; }
.logo.light { color: #1C1C1E; }

/* Подборка */
.featured { display: flex; gap: 12px; overflow-x: auto; padding: 0 16px 4px; scroll-snap-type: x mandatory; scrollbar-width: none; margin-bottom: 28px; }
.featured::-webkit-scrollbar { display: none; }
.feat {
  flex: none; width: min(84vw, 340px); height: 196px; border-radius: var(--r-l); padding: 18px; scroll-snap-align: start; scroll-margin: 16px;
  display: flex; flex-direction: column; justify-content: space-between; color: #fff; text-align: left; position: relative; overflow: hidden;
  transition: transform .2s var(--ease);
}
.feat:active { transform: scale(.98); }
.feat.light { color: #1C1C1E; }
.feat .eyebrow { font-size: 13px; font-weight: 600; opacity: .72; }
.feat .ft { font: 700 22px/1.15 var(--font-display); letter-spacing: -.02em; margin-top: 4px; max-width: 85%; }
.feat .fb { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; }
.feat .rate { font: 700 28px/1 var(--font-display); letter-spacing: -.02em; }
.feat .rate small { font-size: 13px; font-weight: 600; opacity: .72; margin-left: 4px; letter-spacing: 0; }
.feat .plats { display: flex; gap: 6px; opacity: .9; }
.feat .plats .icon { width: 18px; height: 18px; }
.feat .mark { position: absolute; right: 18px; top: 18px; width: 44px; height: 44px; border-radius: 11px; display: grid; place-items: center; font: 700 19px var(--font-display); background: rgba(255,255,255,.16); overflow: hidden; }
.feat.light .mark { background: rgba(0,0,0,.08); }
.feat .mark img { width: 100%; height: 100%; object-fit: cover; }

/* Карточка в списке */
.offer-row { display: flex; gap: 12px; align-items: center; padding: 12px 16px; position: relative; width: 100%; text-align: left; background: var(--surface); }
.offer-row:active { background: var(--fill); }
.offer-row + .offer-row::before { content: ""; position: absolute; top: 0; right: 0; left: 80px; border-top: .5px solid var(--sep); }
.offer-row .info { flex: 1; min-width: 0; }
.offer-row .t { font-size: 17px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 6px; }
.offer-row .t .verified { color: var(--accent); width: 16px; height: 16px; }
.offer-row .s { font-size: 13px; color: var(--label-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
.offer-row .meta { display: flex; align-items: center; gap: 8px; margin-top: 5px; font-size: 13px; color: var(--label-2); }
.offer-row .meta .plats { display: inline-flex; gap: 5px; }
.offer-row .meta .plats .icon { width: 15px; height: 15px; color: var(--label-2); }
.offer-row .price { text-align: right; flex: none; }
.offer-row .price b { display: block; font: 700 19px/1.1 var(--font-display); letter-spacing: -.02em; color: var(--green); }
.offer-row .price span { font-size: 12px; color: var(--label-2); }
.dotsep { width: 3px; height: 3px; border-radius: 50%; background: var(--label-3); }

/* Звёзды */
.stars { position: relative; display: inline-flex; line-height: 0; color: var(--fill-2); }
.stars .fill { position: absolute; inset: 0 auto 0 0; overflow: hidden; color: var(--star); display: inline-flex; white-space: nowrap; }
.stars .icon { width: 12px; height: 12px; }
.stars.m .icon { width: 16px; height: 16px; }
.stars.l .icon { width: 34px; height: 34px; margin: 0 3px; }
.rating-inline { display: inline-flex; align-items: center; gap: 4px; }
.rating-inline b { font-weight: 600; color: var(--label); }

/* Экран оффера */
.hero { display: flex; gap: 16px; padding: 4px 20px 20px; align-items: flex-start; }
.hero .ht { font: 700 24px/1.15 var(--font-display); letter-spacing: -.02em; margin: 0; }
.hero .hs { color: var(--label-2); font-size: 15px; margin-top: 4px; }
.hero .hactions { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
.icon-btn { flex: none; width: 34px; height: 34px; border-radius: 17px; background: var(--fill); display: grid; place-items: center; color: var(--accent); }
.icon-btn .icon { width: 19px; height: 19px; }
.icon-btn.on { color: var(--red); }
.facts { display: flex; overflow-x: auto; scrollbar-width: none; padding: 0 4px; margin: 0 0 24px; border-top: .5px solid var(--sep); border-bottom: .5px solid var(--sep); }
.facts::-webkit-scrollbar { display: none; }
.fact { flex: none; min-width: 104px; padding: 12px 14px; text-align: center; position: relative; }
.fact + .fact::before { content: ""; position: absolute; left: 0; top: 22px; bottom: 22px; border-left: .5px solid var(--sep); }
.fact .k { font-size: 12px; color: var(--label-2); font-weight: 500; }
.fact .v { font: 700 20px/1.25 var(--font-display); color: var(--label-2); margin-top: 3px; letter-spacing: -.01em; }
.fact .v.money { color: var(--green); }
.fact .d { font-size: 12px; color: var(--label-2); margin-top: 1px; }
.prose { font-size: 16px; line-height: 1.45; white-space: pre-line; color: var(--label); }
.reqs { list-style: none; margin: 0; padding: 0; }
.reqs li { display: flex; gap: 10px; padding: 10px 16px; position: relative; font-size: 16px; }
.reqs li + li::before { content: ""; position: absolute; top: 0; right: 0; left: 46px; border-top: .5px solid var(--sep); }
.reqs .icon { width: 20px; height: 20px; color: var(--green-solid); margin-top: 1px; }

.assets-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 12px; }
.asset { aspect-ratio: 9/16; border-radius: var(--r-s); overflow: hidden; background: var(--fill); position: relative; border: .5px solid var(--sep); }
.asset img, .asset video { width: 100%; height: 100%; object-fit: cover; }
.asset .cap { position: absolute; left: 6px; right: 6px; bottom: 6px; font-size: 11px; font-weight: 600; color: #fff; background: rgba(0,0,0,.5); border-radius: 6px; padding: 3px 6px; -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Отзывы */
.rating-summary { display: flex; gap: 20px; align-items: center; }
.rating-big { text-align: center; flex: none; }
.rating-big b { display: block; font: 700 56px/1 var(--font-display); letter-spacing: -.03em; }
.rating-big span { font-size: 13px; color: var(--label-2); font-weight: 600; }
.dist { flex: 1; display: grid; gap: 3px; }
.dist-row { display: grid; grid-template-columns: 44px 1fr; align-items: center; gap: 8px; }
.dist-row .stars .icon { width: 8px; height: 8px; }
.dist-row .stars { color: var(--label-2); justify-self: end; }
.dist-bar { height: 4px; border-radius: 2px; background: var(--fill); overflow: hidden; }
.dist-bar i { display: block; height: 100%; background: var(--label-2); border-radius: 2px; }
.dist-count { text-align: right; font-size: 13px; color: var(--label-2); margin-top: 4px; }
.review { background: var(--surface); border-radius: var(--r-m); padding: 14px 16px; }
.review + .review { margin-top: 10px; }
.review .rh { display: flex; align-items: center; gap: 10px; }
.review .ava { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-weight: 600; font-size: 14px; color: #fff; flex: none; }
.review .who { font-weight: 600; font-size: 15px; }
.blur { filter: blur(4px); user-select: none; -webkit-user-select: none; }
.review .when { font-size: 13px; color: var(--label-2); }
.review .rt { margin-top: 10px; font-size: 15px; line-height: 1.42; white-space: pre-line; overflow-wrap: anywhere; }
.review .mine { margin-left: auto; }

.disclaimer { margin: 0 16px 24px; padding: 14px 16px; border-radius: var(--r-m); background: var(--surface); color: var(--label-2); font-size: 13px; line-height: 1.45; display: flex; gap: 12px; }
.disclaimer .icon { width: 20px; height: 20px; color: var(--label-2); }

/* Пустое состояние / скелетоны */
.empty { text-align: center; padding: 56px 32px; color: var(--label-2); }
.empty .icon { width: 48px; height: 48px; color: var(--label-3); margin-bottom: 12px; }
.empty h3 { margin: 0 0 6px; color: var(--label); font-size: 20px; font-weight: 600; }
.empty p { margin: 0 0 18px; font-size: 15px; }
.skel { background: var(--fill); border-radius: 8px; animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .45; } }

/* Шторка */
.sheet-scrim { position: fixed; inset: 0; z-index: 60; background: var(--scrim); animation: fade .3s ease; }
.sheet-scrim.out { animation: fade .25s ease reverse forwards; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 61; max-height: 92vh; overflow-y: auto;
  background: var(--bg); border-radius: 14px 14px 0 0; padding: 8px 16px calc(var(--safe-bottom) + 20px);
  animation: sheet-in .45s var(--ease); max-width: 640px; margin: 0 auto;
}
.sheet.out { animation: sheet-out .3s var(--ease) forwards; }
.sheet .grabber { width: 36px; height: 5px; border-radius: 3px; background: var(--fill-2); margin: 0 auto 10px; }
.sheet .sheet-head { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; margin-bottom: 16px; min-height: 36px; }
.sheet .sheet-head h3 { margin: 0; font-size: 17px; font-weight: 600; text-align: center; }
.sheet .sheet-head .l { justify-self: start; } .sheet .sheet-head .r { justify-self: end; }
@keyframes sheet-in { from { transform: translateY(100%); } }
@keyframes sheet-out { to { transform: translateY(100%); } }
@keyframes fade { from { opacity: 0; } }

/* Формы */
.field { display: block; background: var(--surface); padding: 11px 16px; position: relative; }
.field + .field::before { content: ""; position: absolute; top: 0; left: 16px; right: 0; border-top: .5px solid var(--sep); }
.field > span { display: block; font-size: 13px; color: var(--label-2); margin-bottom: 3px; }
.field input, .field textarea, .field select { width: 100%; border: 0; outline: none; background: transparent; font-size: 17px; padding: 0; resize: none; }
.field textarea { min-height: 88px; line-height: 1.4; }
.field select { appearance: none; }
.field-inline { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.field-inline > span { margin: 0; color: var(--label); font-size: 17px; }
.field-inline input { text-align: right; max-width: 55%; }
.counter { font-size: 12px; color: var(--label-3); text-align: right; margin-top: 4px; }
.switch { position: relative; width: 51px; height: 31px; flex: none; }
.switch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch i { position: absolute; inset: 0; border-radius: 16px; background: var(--fill-2); transition: background .25s; }
.switch i::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 3px 8px rgba(0,0,0,.15), 0 1px 1px rgba(0,0,0,.16); transition: transform .3s var(--ease); }
.switch input:checked + i { background: var(--green-solid); }
.switch input:checked + i::after { transform: translateX(20px); }
.check-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.check-chip { height: 34px; padding: 0 12px; border-radius: 17px; display: inline-flex; align-items: center; gap: 6px; background: var(--fill); font-size: 15px; font-weight: 500; }
.check-chip .icon { width: 17px; height: 17px; }
.check-chip.on { background: var(--accent); color: #fff; }
.colors { display: flex; gap: 10px; flex-wrap: wrap; }
.color { width: 30px; height: 30px; border-radius: 50%; border: 2px solid transparent; box-shadow: inset 0 0 0 .5px rgba(0,0,0,.2); }
.color.on { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Тост */
.toast {
  position: fixed; left: 50%; top: calc(var(--safe-top) + var(--content-top) + 12px); z-index: 90; transform: translateX(-50%);
  background: var(--elevated); color: var(--label); padding: 10px 16px; border-radius: 22px; box-shadow: var(--shadow);
  font-size: 15px; font-weight: 500; display: flex; align-items: center; gap: 8px; max-width: calc(100vw - 32px);
  animation: toast-in .4s var(--ease); border: .5px solid var(--sep);
}
.toast .icon { width: 20px; height: 20px; }
.toast.ok .icon { color: var(--green-solid); }
.toast.err .icon { color: var(--red); }
.toast.out { animation: toast-out .3s ease forwards; }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, -16px) scale(.96); } }
@keyframes toast-out { to { opacity: 0; transform: translate(-50%, -10px); } }

/* Онбординг / соглашение */
.onboard { position: fixed; inset: 0; z-index: 70; background: var(--bg); overflow-y: auto; display: flex; flex-direction: column; padding: calc(var(--safe-top) + var(--content-top) + 48px) 28px calc(var(--safe-bottom) + 20px); animation: fade .3s ease; }
.onboard h1 { font: 700 32px/1.15 var(--font-display); letter-spacing: -.025em; text-align: center; margin: 18px 0 32px; }
.onboard .ob-logo { width: 72px; height: 72px; margin: 0 auto; }
.ob-item { display: flex; gap: 16px; margin-bottom: 26px; align-items: flex-start; }
.ob-item .icon { width: 34px; height: 34px; color: var(--accent); flex: none; }
.ob-item b { display: block; font-size: 16px; font-weight: 600; margin-bottom: 2px; }
.ob-item p { margin: 0; color: var(--label-2); font-size: 15px; line-height: 1.38; }
.onboard .spacer { flex: 1; min-height: 16px; }
.onboard .legal-note { font-size: 13px; color: var(--label-2); text-align: center; margin-bottom: 14px; line-height: 1.4; }

/* Юридические тексты */
.legal { padding: 0 20px; }
.legal h2 { font-size: 20px; font-weight: 600; margin: 26px 0 8px; letter-spacing: -.01em; }
.legal p, .legal li { font-size: 15px; line-height: 1.5; color: var(--label); }
.legal ol, .legal ul { padding-left: 20px; }
.legal .updated { color: var(--label-2); font-size: 13px; }

/* Чат поддержки */
.chat { display: flex; flex-direction: column; gap: 4px; padding: 8px 12px 16px; }
.chat-day { text-align: center; font-size: 12px; color: var(--label-2); margin: 12px 0 6px; font-weight: 500; }
.bubble { max-width: 78%; padding: 8px 12px; border-radius: 18px; font-size: 16px; line-height: 1.35; white-space: pre-line; overflow-wrap: anywhere; position: relative; }
.bubble .tm { font-size: 11px; opacity: .6; margin-left: 8px; float: right; margin-top: 6px; }
.bubble.me { align-self: flex-end; background: var(--accent); color: #fff; border-bottom-right-radius: 6px; }
.bubble.them { align-self: flex-start; background: var(--surface); border-bottom-left-radius: 6px; }
.bubble.them .from { display: block; font-size: 13px; font-weight: 600; color: var(--accent); margin-bottom: 2px; }
.composer {
  position: fixed; left: 0; right: 0; bottom: calc(var(--tabbar-h) + var(--safe-bottom)); z-index: 14;
  display: flex; gap: 8px; align-items: flex-end; padding: 8px 12px;
  background: var(--bar); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px); border-top: .5px solid var(--sep);
}
.composer.in-page { bottom: 0; padding-bottom: calc(var(--safe-bottom) + 8px); }
.composer textarea { flex: 1; min-height: 36px; max-height: 140px; border-radius: 18px; border: .5px solid var(--sep); background: var(--surface); padding: 7px 14px; outline: none; resize: none; font-size: 16px; line-height: 1.35; }
.send { width: 36px; height: 36px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; flex: none; }
.send:disabled { background: var(--fill-2); }
.send .icon { width: 20px; height: 20px; }
.chat-intro { text-align: center; padding: 8px 32px 4px; color: var(--label-2); font-size: 13px; line-height: 1.4; }

/* Профиль */
.profile-head { text-align: center; padding: 8px 20px 24px; }
.avatar { width: 84px; height: 84px; border-radius: 50%; margin: 0 auto 12px; display: grid; place-items: center; font: 600 34px var(--font-display); color: #fff; background: #8E8E93; }
.profile-head h2 { margin: 0; font: 700 24px/1.2 var(--font-display); letter-spacing: -.02em; }
.profile-head p { margin: 4px 0 0; color: var(--label-2); font-size: 15px; }
.stats-row { display: grid; grid-template-columns: repeat(3, 1fr); background: var(--surface); border-radius: var(--r-m); margin: 0 16px 28px; }
.stats-row div { text-align: center; padding: 14px 4px; position: relative; }
.stats-row div + div::before { content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; border-left: .5px solid var(--sep); }
.stats-row b { display: block; font: 700 22px var(--font-display); }
.stats-row span { font-size: 12px; color: var(--label-2); }
.version { text-align: center; color: var(--label-3); font-size: 12px; padding: 8px 0 24px; }

/* Просмотр материала */
.viewer { position: fixed; inset: 0; z-index: 80; background: #000; display: flex; flex-direction: column; animation: fade .25s ease; }
.viewer .vtop { display: flex; justify-content: space-between; align-items: center; padding: calc(var(--safe-top) + var(--content-top) + 8px) 12px 8px; color: #fff; }
.viewer .vbody { flex: 1; display: grid; place-items: center; padding: 8px; min-height: 0; }
.viewer .vbody img, .viewer .vbody video { max-width: 100%; max-height: 100%; border-radius: 12px; }
.viewer .vbottom { padding: 12px 16px calc(var(--safe-bottom) + 16px); }
.viewer .nav-btn { color: #fff; }

/* ——— Админка ——— */
.admin { position: absolute; inset: 0; z-index: 30; background: var(--bg); display: flex; animation: fade .2s ease; }
.drawer-scrim { position: fixed; inset: 0; z-index: 40; background: var(--scrim); opacity: 0; pointer-events: none; transition: opacity .3s; }
.drawer {
  position: fixed; top: 0; bottom: 0; left: 0; z-index: 41; width: min(300px, 84vw); background: var(--surface);
  transform: translateX(-102%); transition: transform .42s var(--ease); display: flex; flex-direction: column;
  padding: calc(var(--safe-top) + var(--content-top) + 12px) 10px calc(var(--safe-bottom) + 12px); border-right: .5px solid var(--sep);
}
.admin.drawer-open .drawer { transform: none; box-shadow: var(--shadow); }
.admin.drawer-open .drawer-scrim { opacity: 1; pointer-events: auto; }
.drawer-brand { display: flex; align-items: center; gap: 10px; padding: 6px 10px 18px; }
.drawer-brand img { width: 34px; height: 34px; border-radius: 8px; }
.drawer-brand b { font-size: 17px; font-weight: 700; display: block; }
.drawer-brand span { font-size: 12px; color: var(--label-2); }
.drawer nav { flex: 1; overflow-y: auto; }
.drawer .group-label { font-size: 12px; color: var(--label-2); padding: 16px 12px 6px; font-weight: 500; }
.nav-item { display: flex; align-items: center; gap: 12px; width: 100%; height: 42px; padding: 0 12px; border-radius: var(--r-s); font-size: 16px; text-align: left; }
.nav-item .icon { width: 21px; height: 21px; color: var(--label-2); }
.nav-item .badge { margin-left: auto; }
.nav-item:active { background: var(--fill); }
.nav-item.on { background: var(--accent-tint); color: var(--accent); font-weight: 600; }
.nav-item.on .icon { color: var(--accent); }
.admin-main { flex: 1; min-width: 0; overflow-y: auto; padding-bottom: calc(var(--safe-bottom) + 40px); }
@media (min-width: 960px) {
  .drawer { position: sticky; transform: none; height: 100vh; flex: none; }
  .drawer-scrim, .menu-btn { display: none !important; }
  .admin-main .navbar { grid-template-columns: 0 auto 1fr; }
}

.kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 0 16px 24px; }
@media (min-width: 700px) { .kpis { grid-template-columns: repeat(4, 1fr); } }
.kpi { background: var(--surface); border-radius: var(--r-m); padding: 14px; }
.kpi .k { font-size: 13px; color: var(--label-2); font-weight: 500; }
.kpi .v { font: 700 28px/1.15 var(--font-display); letter-spacing: -.02em; margin-top: 4px; }
.kpi .d { font-size: 13px; font-weight: 600; margin-top: 2px; color: var(--label-2); }
.kpi .d.up { color: var(--green); } .kpi .d.down { color: var(--red); }
.card { background: var(--surface); border-radius: var(--r-m); padding: 16px; }
.card + .card { margin-top: 12px; }
.card-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; gap: 12px; }
.card-title h4 { margin: 0; font-size: 17px; font-weight: 600; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; color: var(--label-2); }
.legend i { display: inline-block; width: 10px; height: 3px; border-radius: 2px; margin-right: 6px; vertical-align: middle; }

.chart { position: relative; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .grid line { stroke: var(--sep); stroke-width: 1; }
.chart .axis text { fill: var(--label-2); font-size: 11px; font-family: var(--font); }
.chart .tip { position: absolute; top: 0; pointer-events: none; background: var(--elevated); border: .5px solid var(--sep); box-shadow: var(--shadow); border-radius: 10px; padding: 8px 10px; font-size: 12px; white-space: nowrap; transform: translateX(-50%); z-index: 2; }
.chart .tip b { display: block; font-size: 12px; color: var(--label-2); font-weight: 500; margin-bottom: 3px; }
.chart .tip div { display: flex; align-items: center; gap: 6px; }
.chart .tip i { width: 8px; height: 8px; border-radius: 2px; }

.bars { display: grid; gap: 10px; }
.bar-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; font-size: 15px; }
.bar-row .bn { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-row .bv { color: var(--label-2); font-size: 13px; }
.bar-row .bt { grid-column: 1 / -1; height: 6px; background: var(--fill); border-radius: 3px; overflow: hidden; }
.bar-row .bt i { display: block; height: 100%; border-radius: 3px; background: var(--accent); }

.funnel { display: grid; gap: 8px; }
.funnel-step { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; }
.funnel-step .fl { font-size: 15px; }
.funnel-step .fv { font-weight: 600; }
.funnel-step .fv small { color: var(--label-2); font-weight: 500; margin-left: 6px; }
.funnel-step .bt { grid-column: 1 / -1; height: 28px; background: var(--fill); border-radius: 7px; overflow: hidden; }
.funnel-step .bt i { display: block; height: 100%; background: var(--accent); border-radius: 7px; opacity: .85; }

.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-weight: 500; color: var(--label-2); font-size: 12px; padding: 0 8px 8px 0; }
.table td { padding: 10px 8px 10px 0; border-top: .5px solid var(--sep); }
.table .num { text-align: right; }
.copy-field { display: flex; align-items: center; gap: 8px; background: var(--fill); border-radius: var(--r-s); padding: 10px 12px; font-size: 14px; }
.copy-field code { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 13px; }
.copy-field button { color: var(--accent); }
.copy-field .icon { width: 19px; height: 19px; }
.progress { height: 6px; background: var(--fill); border-radius: 3px; overflow: hidden; margin-top: 8px; }
.progress i { display: block; height: 100%; background: var(--green-solid); transition: width .4s; }
.toolbar { display: flex; gap: 10px; align-items: center; margin: 0 16px 14px; }
.toolbar .segmented { flex: 1; }
.upload-tile { aspect-ratio: 9/16; border-radius: var(--r-s); border: 1.5px dashed var(--fill-2); display: grid; place-items: center; color: var(--accent); text-align: center; font-size: 13px; font-weight: 500; }
.upload-tile .icon { width: 26px; height: 26px; margin: 0 auto 4px; display: flex; }
.asset .del { position: absolute; top: 6px; right: 6px; width: 26px; height: 26px; border-radius: 13px; background: rgba(0,0,0,.55); color: #fff; display: grid; place-items: center; }
.asset .del .icon { width: 15px; height: 15px; }
.logo-pick { display: flex; align-items: center; gap: 14px; }
.mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 13px; }
.muted { color: var(--label-2); }
.mt8 { margin-top: 8px; } .mt12 { margin-top: 12px; } .mt16 { margin-top: 16px; } .mt24 { margin-top: 24px; }
.pad { padding: 0 16px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .splash-logo .tri { stroke-dashoffset: 0; fill: #fff; }
  .splash-logo .dot { transform: none; }
}
.composer.in-page { z-index: 35; }

/* ═════════ Ink & Signal: собственный стиль поверх базовой сетки ═════════ */
body { letter-spacing: -.005em; }
a { color: var(--accent); }

/* Кнопки: основная — чернильная, а не системно-синяя */
.btn { background: var(--ink); color: var(--on-ink); border-radius: 16px; font-weight: 650; }
.btn.secondary { background: var(--accent-tint); color: var(--accent); }
.btn.plain { background: var(--fill); color: var(--label); }
.btn.pill { border-radius: 12px; height: 34px; padding: 0 16px; }
.nav-btn { color: var(--label); }
.send { background: var(--ink); color: var(--on-ink); }
.bubble.me { background: var(--ink); color: var(--on-ink); }
.bubble.them .from { color: var(--accent); }

/* Сегменты: плоские, с чернильным бегунком */
.segmented { background: transparent; box-shadow: inset 0 0 0 1px var(--sep); border-radius: 12px; padding: 3px; height: 36px; }
.segmented .thumb, [data-theme="dark"] .segmented .thumb { top: 3px; bottom: 3px; left: 3px; border-radius: 9px; background: var(--ink); box-shadow: none; }
.segmented button { transition: color .25s; color: var(--label-2); }
.segmented button.on { color: var(--on-ink); }

/* Чипы: «таблетки» с мягким прямоугольником вместо капсул */
.chip { border-radius: 12px; height: 36px; background: var(--surface); border: 0; box-shadow: inset 0 0 0 1px var(--sep); font-weight: 550; }
.chip.on { background: var(--ink); color: var(--on-ink); box-shadow: none; }
.chip .count { font-size: 12px; opacity: .55; font-weight: 600; }
.check-chip { border-radius: 12px; }
.check-chip.on { background: var(--ink); color: var(--on-ink); }

/* Шапка с брендом вместо огромного заголовка iOS */
.large-title { font-size: 30px; font-weight: 760; letter-spacing: -.03em; padding: 0 20px 12px; }
.brandbar { display: flex; align-items: center; gap: 10px; padding: calc(var(--safe-top) + var(--content-top) + 14px) 20px 6px; }
.brandbar img { width: 30px; height: 30px; border-radius: 8px; }
.brandbar .bn { font-weight: 750; font-size: 17px; letter-spacing: -.02em; }
.brandbar .bs { font-size: 12px; color: var(--label-2); margin-top: -1px; }
.brandbar .right { margin-left: auto; display: flex; gap: 6px; }
.round-btn { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--surface); box-shadow: inset 0 0 0 1px var(--sep); color: var(--label); }
.round-btn .icon { width: 20px; height: 20px; }
.round-btn:active { transform: scale(.95); }
.board-hero { padding: 14px 20px 18px; }
.board-hero h1 { margin: 0; font-size: 30px; line-height: 1.08; font-weight: 780; letter-spacing: -.035em; }
.board-hero h1 em { font-style: normal; color: var(--accent); }
.board-hero p { margin: 8px 0 0; color: var(--label-2); font-size: 15px; }
.live-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--signal); margin-right: 6px; vertical-align: 1px; box-shadow: 0 0 0 4px var(--accent-tint); }

/* Поиск + кнопка сортировки в одну строку */
.search-row { display: flex; gap: 8px; margin: 0 16px 12px; }
.search-row .search { margin: 0; flex: 1; }
.search input { height: 42px; border-radius: 14px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--sep); padding-left: 38px; }
.search .icon { top: 11px; left: 12px; }
.sort-btn { height: 42px; padding: 0 12px; border-radius: 14px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--sep); display: inline-flex; align-items: center; gap: 6px; font-size: 15px; font-weight: 550; white-space: nowrap; }
.sort-btn .icon { width: 18px; height: 18px; }
.filter-label { padding: 4px 20px 8px; font-size: 13px; font-weight: 600; color: var(--label-2); display: flex; justify-content: space-between; }
.filter-label button { color: var(--accent); font-weight: 600; font-size: 13px; }

/* Карточки офферов вместо сгруппированного списка */
.cards { display: grid; gap: 10px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 720px) { .cards { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.ocard { background: var(--surface); border-radius: var(--r-m); padding: 14px; text-align: left; width: 100%; display: block; box-shadow: inset 0 0 0 1px var(--sep); transition: transform .2s var(--ease); }
.ocard:active { transform: scale(.985); }
.ocard .top { display: flex; gap: 12px; align-items: center; }
.ocard .info { flex: 1; min-width: 0; }
.ocard .t { font-size: 16px; font-weight: 650; display: flex; align-items: center; gap: 5px; letter-spacing: -.01em; }
.ocard .t span { overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.2; }
.ocard .t .verified { width: 16px; height: 16px; color: var(--accent); flex: none; }
.ocard .s { font-size: 13px; color: var(--label-2); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ocard .bottom { display: flex; align-items: center; gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--sep); }
.ocard .plats { display: inline-flex; gap: 6px; color: var(--label-2); }
.ocard .plats .icon { width: 16px; height: 16px; }
.ocard .topics-line { font-size: 12px; color: var(--label-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; min-width: 0; }
.rate-pill { margin-left: auto; text-align: right; flex: none; }
.rate-pill b { display: block; font-size: 19px; font-weight: 760; letter-spacing: -.025em; color: var(--green); line-height: 1.1; }
.rate-pill span { font-size: 11px; color: var(--label-2); font-weight: 500; }
.score { display: inline-flex; align-items: center; gap: 3px; height: 24px; padding: 0 8px; border-radius: 8px; background: var(--fill); font-size: 13px; font-weight: 650; flex: none; }
.score .icon { width: 13px; height: 13px; color: var(--star); }
.score.empty { color: var(--label-2); font-weight: 500; }
.logo { border-radius: 14px; border: 0; box-shadow: inset 0 0 0 1px rgba(0,0,0,.06); }
.logo.l { border-radius: 26px; }
.tag { border-radius: 7px; }
.tag.new { background: var(--accent-tint); color: var(--accent); }

/* Подборка */
.feat { border-radius: var(--r-l); }
.feat .mark { border-radius: 13px; }

/* Плавающее нижнее меню в духе Telegram */
.tabbar {
  left: 12px; right: 12px; bottom: calc(var(--safe-bottom) + 10px); height: 62px; padding: 6px;
  border-radius: 22px; border-top: 0; box-shadow: var(--shadow); gap: 4px;
  background: var(--bar);
}
.tabbar button { border-radius: 16px; color: var(--label-2); font-size: 10.5px; font-weight: 600; transition: background .25s, color .25s; }
[data-theme="dark"] .tabbar button { color: var(--label-2); }
.tabbar button.on { background: var(--fill); color: var(--label); }
.tabbar button.on .icon { color: var(--label); }
.tabbar .icon { width: 24px; height: 24px; }
.tabbar .badge { top: 4px; }
.tab { padding-bottom: calc(var(--safe-bottom) + 96px); }
.composer { bottom: calc(var(--safe-bottom) + 80px); left: 12px; right: 12px; border-radius: 22px; border: 0; box-shadow: var(--shadow); }
.composer.in-page { left: 0; right: 0; border-radius: 0; bottom: 0; }

/* Экран оффера: полоса фирменного цвета */
.o-band { height: calc(132px + var(--safe-top) + var(--content-top)); position: relative; }
.o-band .band-btns { position: absolute; top: calc(var(--safe-top) + var(--content-top) + 10px); left: 12px; right: 12px; display: flex; justify-content: space-between; }
.o-band .band-btns button { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: rgba(0,0,0,.28); color: #fff; -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
.o-band.light .band-btns button { background: rgba(255,255,255,.55); color: #141414; }
.o-band .band-btns .icon { width: 20px; height: 20px; }
.o-head { padding: 0 20px 18px; margin-top: -48px; position: relative; }
.o-head .logo.l { box-shadow: 0 0 0 4px var(--bg); }
.o-head h1 { margin: 14px 0 0; font-size: 26px; line-height: 1.12; font-weight: 760; letter-spacing: -.03em; }
.o-head .hs { color: var(--label-2); font-size: 15px; margin-top: 4px; }
.o-head .hactions { display: flex; gap: 8px; align-items: center; margin-top: 14px; flex-wrap: wrap; }
.icon-btn { border-radius: 12px; width: 38px; height: 38px; color: var(--label); background: var(--surface); box-shadow: inset 0 0 0 1px var(--sep); }
.icon-btn.on { color: var(--red); }

.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0 16px 26px; }
.stat { background: var(--surface); border-radius: 16px; padding: 12px 14px; box-shadow: inset 0 0 0 1px var(--sep); }
.stat .k { font-size: 12px; color: var(--label-2); font-weight: 550; }
.stat .v { font-size: 19px; font-weight: 740; letter-spacing: -.02em; margin-top: 3px; }
.stat .v.money { color: var(--green); }
.stat .d { font-size: 12px; color: var(--label-2); margin-top: 1px; }
.stat.wide { grid-column: 1 / -1; }

.rates { background: var(--surface); border-radius: var(--r-m); overflow: hidden; box-shadow: inset 0 0 0 1px var(--sep); }
.rate-row { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 4px 12px; padding: 12px 14px; position: relative; }
.rate-row + .rate-row { border-top: 1px solid var(--sep); }
.rate-row .rn { font-size: 15px; font-weight: 550; }
.rate-row .rv { font-size: 16px; font-weight: 720; color: var(--green); letter-spacing: -.01em; }
.rate-row .rv small { font-size: 11px; color: var(--label-2); font-weight: 500; margin-left: 3px; }
.rate-row .rb { grid-column: 1 / -1; height: 4px; border-radius: 2px; background: var(--fill); overflow: hidden; }
.rate-row .rb i { display: block; height: 100%; border-radius: 2px; background: var(--signal); }
.rate-row.mine { background: var(--accent-tint); }

.group, .card, .review, .kpi, .stats-row, .disclaimer { box-shadow: inset 0 0 0 1px var(--sep); }
.group { border-radius: var(--r-m); }
.card, .kpi, .review { border-radius: var(--r-m); }
.section-title { font-size: 20px; font-weight: 740; letter-spacing: -.025em; }
.rating-big b { font-weight: 760; }
.dist-bar i { background: var(--ink); }
.review .ava { border-radius: 12px; }
.avatar { border-radius: 28px; background: var(--ink); color: var(--on-ink); }

/* Онбординг */
.ob-item .icon { color: var(--label); background: var(--surface); box-shadow: inset 0 0 0 1px var(--sep); border-radius: 12px; padding: 7px; width: 40px; height: 40px; }
.onboard h1 { font-weight: 780; letter-spacing: -.035em; }

/* Админка */
.nav-item.on { background: var(--ink); color: var(--on-ink); }
.nav-item.on .icon { color: var(--on-ink); }
.drawer { background: var(--bg); }
.copy-field button { color: var(--label); }
.bar-row .bt i, .funnel-step .bt i { background: var(--ink); }
.funnel-step .bt i { opacity: 1; }
.progress i { background: var(--signal); }
.topic-edit { display: grid; grid-template-columns: 1fr 110px 34px; gap: 8px; align-items: center; padding: 8px 12px; }
.topic-edit + .topic-edit { border-top: 1px solid var(--sep); }
.topic-edit select, .topic-edit input { height: 38px; border-radius: 10px; border: 0; background: var(--fill); padding: 0 10px; font-size: 15px; outline: none; width: 100%; }
.topic-edit input { text-align: right; }
.topic-edit button { color: var(--red); display: grid; place-items: center; }

/* Выбор в шторке */
.pick-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 14px 16px; text-align: left; font-size: 16px; }
.pick-row + .pick-row { border-top: 1px solid var(--sep); }
.pick-row .icon { width: 20px; height: 20px; color: var(--label-2); }
.pick-row .grow { flex: 1; }
.pick-row .ok { color: var(--accent); visibility: hidden; }
.pick-row.on .ok { visibility: visible; }
.pick-row.on { font-weight: 650; }

/* ——— Баннеры главной ——— */
.promo { padding: 4px 0 2px; }
.promo-track { display: flex; gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 0 16px; scroll-padding: 0 16px; scrollbar-width: none; overscroll-behavior-x: contain; }
.promo-track::-webkit-scrollbar { display: none; }
.promo-slide { flex: none; width: 100%; aspect-ratio: 2 / 1; border-radius: 22px; overflow: hidden; scroll-snap-align: start; background: var(--fill); padding: 0; position: relative; transition: transform .2s var(--ease); }
.promo-slide:not(.static):active { transform: scale(.985); }
.promo-slide.static { cursor: default; }
.promo-slide img { width: 100%; height: 100%; object-fit: cover; display: block; -webkit-user-drag: none; user-select: none; }
.promo-slide::after { content: ''; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px rgba(0,0,0,.06); pointer-events: none; }
.promo-dots { display: flex; justify-content: center; gap: 6px; padding: 10px 0 2px; }
.promo-dots .dot { width: 6px; height: 6px; border-radius: 3px; padding: 0; background: var(--label-3); opacity: .5; transition: width .25s var(--ease), opacity .25s; }
.promo-dots .dot.on { width: 18px; opacity: 1; background: var(--label); }

/* ——— Обложки офферов ——— */
.feat.has-cover { height: 272px; padding-top: 146px; }
.feat .cover { position: absolute; left: 0; top: 0; width: 100%; height: 128px; object-fit: cover; }
.feat.has-cover .mark { top: 104px; left: 18px; right: auto; width: 52px; height: 52px; border-radius: 15px; background: inherit; box-shadow: 0 4px 14px rgba(0,0,0,.22); }
.feat.has-cover .fhead { padding-left: 64px; margin-top: -6px; min-height: 40px; }
.feat .ft { overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.feat.has-cover .ft { font-size: 19px; max-width: 100%; }
.o-band.has-cover { height: auto; aspect-ratio: 2 / 1; min-height: calc(150px + var(--safe-top) + var(--content-top)); overflow: hidden; }
.o-band .band-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

/* ——— Админка: баннеры и обложки ——— */
.bn-list { display: grid; gap: 14px; }
.bn-card { background: var(--surface); border-radius: 20px; overflow: hidden; }
.bn-card.off .bn-img img { opacity: .4; filter: grayscale(1); }
.bn-img { display: block; width: 100%; aspect-ratio: 2 / 1; padding: 0; background: var(--fill); }
.bn-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.bn-meta { display: flex; align-items: center; gap: 12px; padding: 12px 14px 4px; }
.bn-meta .title { font-weight: 650; font-size: 16px; }
.bn-meta .sub { color: var(--label-2); font-size: 13px; margin-top: 2px; overflow-wrap: anywhere; }
.bn-stats { display: flex; gap: 14px; margin-top: 8px; font-size: 13px; color: var(--label-2); font-variant-numeric: tabular-nums; }
.bn-stats span { display: inline-flex; align-items: center; gap: 4px; }
.bn-stats .icon { width: 15px; height: 15px; }
.bn-actions { display: flex; align-items: center; gap: 8px; padding: 8px 14px 14px; }
.bn-actions .btn { margin-left: auto; }
.bn-actions .icon-btn:disabled { opacity: .3; }
.bn-pick { display: block; width: 100%; aspect-ratio: 2 / 1; border-radius: 18px; overflow: hidden; background: var(--fill); padding: 0; cursor: pointer; border: 1.5px dashed var(--sep); }
.bn-pick:has(img) { border: 0; }
.bn-pick img { width: 100%; height: 100%; object-fit: cover; display: block; }
.bn-empty { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; color: var(--label-2); font-size: 14px; font-weight: 550; }
.bn-empty .icon { width: 28px; height: 28px; }
.cover-foot { display: flex; align-items: center; gap: 10px; justify-content: space-between; margin-top: 8px; }
.cover-foot .btn { flex: none; white-space: nowrap; }
.cover-foot .btn[hidden] { display: none; }
.pad0 { padding: 0; }

/* ═════════ Движение в духе Telegram ═════════
   Короткие, упругие, без «плавающих» эффектов. Всё отключается при prefers-reduced-motion. */
:root {
  --tg-ease: cubic-bezier(.22, .9, .28, 1);     /* быстрый старт, мягкая посадка */
  --tg-spring: cubic-bezier(.34, 1.45, .5, 1);  /* лёгкий перелёт — для «поп»-эффектов */
  --tg-sheet: cubic-bezier(.32, .72, 0, 1);
}

/* Стек экранов: новый въезжает справа, нижний уходит на четверть влево и притемняется */
.tabs-layer, .tabbar, .page { transition: transform .4s var(--tg-ease), filter .4s var(--tg-ease); }
.page { animation: page-in .4s var(--tg-ease); box-shadow: -1px 0 0 var(--sep), -24px 0 48px rgba(0,0,0,.10); }
.page.leaving { animation: page-out .3s var(--tg-ease) forwards; pointer-events: none; }
#app.pushed .tabs-layer, #app.pushed > .tabbar, .page.covered { transform: translateX(-24%); filter: brightness(.9); }
[data-theme="dark"] #app.pushed .tabs-layer, [data-theme="dark"] .page.covered { filter: brightness(.6); }
.admin { animation: admin-in .32s var(--tg-ease); }
@keyframes admin-in { from { opacity: 0; transform: scale(.985); } }

/* Смена вкладки */
.tab.enter { animation: tab-in .26s var(--tg-ease); }
@keyframes tab-in { from { opacity: 0; transform: translateY(6px); } }
.tabbar button .icon { transition: transform .2s var(--tg-ease); }
.tabbar button:active .icon { transform: scale(.86); }
.icon.pop { animation: icon-pop .5s var(--tg-spring); }
@keyframes icon-pop { 0% { transform: scale(.72); } 55% { transform: scale(1.14); } 100% { transform: scale(1); } }
.icon-btn.on .icon.pop { animation: heart-pop .55s var(--tg-spring); color: var(--red); }
.icon-btn.on .icon { color: var(--red); }
@keyframes heart-pop { 0% { transform: scale(.5); } 50% { transform: scale(1.28); } 100% { transform: scale(1); } }

/* Нажатия: мгновенная подсветка, плавное затухание */
.btn { transition: transform .18s var(--tg-ease), opacity .15s; }
.btn:active { transform: scale(.97); opacity: .85; }
.chip { transition: background .2s, color .2s, box-shadow .2s, transform .18s var(--tg-ease); }
.chip:active, .sort-btn:active, .round-btn:active, .icon-btn:active { transform: scale(.94); }
.sort-btn, .round-btn, .icon-btn { transition: transform .18s var(--tg-ease), background .2s; }
button.row, .pick-row, .nav-item { transition: background .35s ease; }
button.row:active, .pick-row:active, .nav-item:active { background: var(--fill); transition: none; }
.segmented .thumb { transition: transform .38s var(--tg-spring); }

/* Появление контента */
.cards > * { animation: card-in .42s var(--tg-ease) both; }
.cards > :nth-child(2) { animation-delay: .03s; }
.cards > :nth-child(3) { animation-delay: .06s; }
.cards > :nth-child(4) { animation-delay: .09s; }
.cards > :nth-child(5) { animation-delay: .12s; }
.cards > :nth-child(6) { animation-delay: .15s; }
.cards > :nth-child(n+7) { animation-delay: .18s; }
@keyframes card-in { from { opacity: 0; transform: translateY(12px) scale(.985); } }
.featured > * { animation: feat-in .5s var(--tg-ease) both; }
.featured > :nth-child(2) { animation-delay: .06s; }
.featured > :nth-child(n+3) { animation-delay: .12s; }
@keyframes feat-in { from { opacity: 0; transform: translateX(28px); } }
.promo:not([hidden]) { animation: fade-up .45s var(--tg-ease); }
@keyframes fade-up { from { opacity: 0; transform: translateY(8px); } }
.bn-card { animation: card-in .4s var(--tg-ease) both; }

/* Полоски заполняются слева направо */
.rate-row .rb i, .dist-bar i, .bar-row .bt i, .progress i { transform-origin: left; animation: bar-grow .7s .1s var(--tg-ease) both; }
@keyframes bar-grow { from { transform: scaleX(0); } }

/* Графики «прорисовываются» */
.chart .ln { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 1s var(--tg-ease) forwards; }
.chart .ln-tail { opacity: 0; animation: fade-in .3s .9s forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes fade-in { to { opacity: 1; } }

/* Чат: новое сообщение вылетает из своего угла, как пузырь в Telegram */
.bubble.fresh { animation: bubble-in .34s var(--tg-spring) both; }
.bubble.fresh.me { transform-origin: 100% 100%; }
.bubble.fresh.them { transform-origin: 0 100%; }
@keyframes bubble-in { from { opacity: 0; transform: scale(.55) translateY(10px); } }

/* Шторка и счётчики */
.sheet { animation: sheet-in .5s var(--tg-sheet); }
.sheet.out { animation: sheet-out .26s cubic-bezier(.4, 0, 1, 1) forwards; }
.badge { animation: badge-pop .4s var(--tg-spring); }
@keyframes badge-pop { from { transform: scale(0); } }
.live-dot { animation: live 2.4s ease-out infinite; }
@keyframes live { 0% { box-shadow: 0 0 0 0 var(--accent-tint); } 70%, 100% { box-shadow: 0 0 0 7px transparent; } }

/* Онбординг собирается по очереди */
.onboard > * { animation: rise .5s .1s var(--tg-ease) both; }
.onboard > :nth-child(2) { animation-delay: .16s; }
.onboard > :nth-child(3) { animation-delay: .22s; }
.onboard > :nth-child(4) { animation-delay: .28s; }
.onboard > :nth-child(5) { animation-delay: .34s; }
.onboard > :nth-child(n+6) { animation-delay: .4s; }

/* ——— Дефекты: маленькие зоны нажатия расширены невидимой рамкой ——— */
.promo-dots .dot, .section-link, .disclaimer a, .topic-edit button, .asset .del, .copy-field button { position: relative; }
.promo-dots .dot::after, .section-link::after, .disclaimer a::after, .topic-edit button::after, .asset .del::after, .copy-field button::after {
  content: ''; position: absolute; inset: -10px;
}
.promo-dots .dot::after { inset: -12px -4px; }
.onboard { animation: none; }

/* ═════════ Карточка оффера 2.0 и фишки клиппинг-площадок ═════════ */
.ocard .t { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.22; }
.ocard .t .verified { display: inline-block; vertical-align: -3px; width: 17px; height: 17px; margin-left: 4px; color: var(--accent); }
.ocard.dim .top, .ocard.dim .budget, .ocard.dim .topics-line { opacity: .55; }
.ocard .topics-line { display: flex; align-items: center; gap: 5px; margin-top: 10px; font-size: 12.5px; flex: none; }
.ocard .topics-line .icon { width: 14px; height: 14px; flex: none; }
.ocard .bottom { gap: 6px; }
.ocard .bottom .grow { flex: 1; }
.plat-chips { display: inline-flex; gap: 4px; }
.plat-chips .pc { width: 24px; height: 24px; border-radius: 7px; display: grid; place-items: center; background: var(--fill); color: var(--label); }
.plat-chips .pc .icon { width: 14px; height: 14px; }
.people { display: inline-flex; align-items: center; gap: 3px; height: 24px; padding: 0 7px; border-radius: 8px; background: var(--fill); font-size: 12.5px; font-weight: 600; color: var(--label-2); font-variant-numeric: tabular-nums; }
.people .icon { width: 14px; height: 14px; }
.score .muted { font-weight: 500; color: var(--label-2); }
.tag .icon { width: 12px; height: 12px; }

/* Бюджет */
.budget { margin-top: 12px; }
.budget .bl { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 12.5px; color: var(--label-2); }
.budget .bl b { color: var(--label); font-weight: 650; }
.budget .bp { font-weight: 650; color: var(--label); font-variant-numeric: tabular-nums; }
.bbar { height: 5px; border-radius: 3px; background: var(--fill); margin-top: 6px; overflow: hidden; }
.bbar i { display: block; height: 100%; border-radius: 3px; background: var(--signal); transform-origin: left; animation: bar-grow .8s .1s var(--tg-ease) both; }
.budget.low .bbar i { background: var(--orange); }
.budget.low .bp { color: var(--orange); }
.budget.big { margin-top: 0; }
.budget.big .bl { font-size: 14px; }
.budget.big .bbar { height: 8px; border-radius: 4px; margin-top: 10px; }

/* Сводка кампании на странице оффера */
.card.camp { padding: 16px; }
.camp-nobudget { font-size: 14px; color: var(--label-2); }
.camp-meta { display: grid; gap: 8px; margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--sep); font-size: 14px; }
.camp-meta span { display: flex; align-items: center; gap: 8px; }
.camp-meta .icon { width: 17px; height: 17px; color: var(--label-2); flex: none; }
.notice { display: flex; gap: 10px; margin: 0 16px 16px; padding: 12px 14px; border-radius: 14px; background: rgba(255,149,0,.12); color: var(--label); font-size: 14px; line-height: 1.4; }
.notice .icon { width: 18px; height: 18px; color: var(--orange); flex: none; margin-top: 1px; }

/* Калькулятор */
.card.calc { padding: 16px; }
.calc-top { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; }
.calc-label { font-size: 13px; color: var(--label-2); }
.calc-views { font-size: 15px; margin-top: 2px; }
.calc-views b { font-size: 20px; font-weight: 720; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.calc-out { font-size: 30px; font-weight: 780; letter-spacing: -.03em; color: var(--green); font-variant-numeric: tabular-nums; line-height: 1; }
.calc-range { position: relative; height: 32px; margin-top: 14px; --p: 50%; }
.calc-range::before { content: ''; position: absolute; left: 0; right: 0; top: 13px; height: 6px; border-radius: 3px; background: var(--fill); }
.calc-range .fill { position: absolute; left: 0; top: 13px; height: 6px; width: var(--p); border-radius: 3px; background: var(--ink); }
.calc-range input { position: absolute; inset: 0; width: 100%; margin: 0; background: transparent; -webkit-appearance: none; appearance: none; cursor: pointer; }
.calc-range input::-webkit-slider-runnable-track { height: 32px; background: transparent; }
.calc-range input::-moz-range-track { height: 32px; background: transparent; }
.calc-range input::-webkit-slider-thumb { -webkit-appearance: none; width: 26px; height: 26px; margin-top: 3px; border-radius: 50%; background: #fff; box-shadow: 0 2px 8px rgba(0,0,0,.22), 0 0 0 .5px rgba(0,0,0,.08); transition: transform .15s var(--tg-ease); }
.calc-range input:active::-webkit-slider-thumb { transform: scale(1.12); }
.calc-range input::-moz-range-thumb { width: 26px; height: 26px; border: 0; border-radius: 50%; background: #fff; box-shadow: 0 2px 8px rgba(0,0,0,.22); }
.calc-scale { display: flex; justify-content: space-between; font-size: 11px; color: var(--label-3); margin-top: 2px; }
.calc-hint { font-size: 13px; color: var(--label-2); margin-top: 10px; }
.calc-cap { display: flex; align-items: center; gap: 6px; margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--sep); font-size: 13px; }
.calc-cap .icon { width: 15px; height: 15px; color: var(--label-2); flex: none; }

/* Доска: сводка и фильтры */
.paid-strip { display: inline-flex; align-items: center; gap: 8px; margin-top: 10px; padding: 7px 12px; border-radius: 12px; background: var(--accent-tint); font-size: 13.5px; color: var(--label); }
.paid-strip .icon { width: 16px; height: 16px; color: var(--accent); }
.paid-strip b { color: var(--accent); }
.sort-btn .fcount { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--ink); color: var(--on-ink); font-size: 11.5px; font-weight: 700; display: inline-grid; place-items: center; }
.sort-btn .fcount[hidden] { display: none; }
.chips.wrap { flex-wrap: wrap; overflow: visible; padding: 0; }
.logo-wrap { position: relative; flex: none; }
.vbadge { position: absolute; right: -5px; bottom: -5px; width: 22px; height: 22px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; }
.vbadge .icon { width: 18px; height: 18px; color: var(--accent); }
.calc-tl { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; padding-bottom: 12px; border-bottom: 1px dashed var(--sep); font-size: 13px; color: var(--label-2); }
.calc-topic { font: inherit; font-size: 14px; font-weight: 600; color: var(--label); background: var(--fill); border: 0; border-radius: 10px; padding: 7px 10px; max-width: 62%; }

/* Ссылки проекта */
.link-edit { display: grid; grid-template-columns: 1fr 34px; gap: 8px; align-items: center; padding: 10px 12px; }
.link-edit + .link-edit { border-top: 1px solid var(--sep); }
.le-fields { display: grid; gap: 6px; }
.link-edit input { height: 38px; border-radius: 10px; border: 0; background: var(--fill); padding: 0 10px; font-size: 15px; outline: none; width: 100%; color: var(--label); }
.link-edit button { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; color: var(--red); position: relative; }
.link-edit button::after { content: ''; position: absolute; inset: -6px; }
.link-edit button .icon { width: 18px; height: 18px; }
.plinks .row-icon { color: #fff; }
.plinks .host { color: var(--label-2); font-size: 13px; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plinks .grow { min-width: 0; }
.plinks .go { width: 18px; height: 18px; color: var(--label-3); flex: none; }
