/* ============================================================
   «куда идём?» — Telegram Mini App.
   Референс-дизайн: светлый графитово-белый минимализм 2026,
   белые карточки r32 с градиентными обводками по категориям,
   плавающий белый таб-бар, ч/б палитра + синий значок галочки.
   ============================================================ */

:root {
  --bg: #E9E9EC;            /* фон экрана */
  --card: #FFFFFF;          /* карточки/панели */
  --ink: #1A1A1A;           /* основной текст */
  --ink-2: #8A8A90;         /* второстепенный текст */
  --ink-3: #B8B8BE;         /* неактивные подписи */
  --line: #E4E4EA;          /* тонкие линии */
  --line-2: #F1F1F5;
  --soft: #F4F4F6;          /* вложенные плашки */
  --blue: #1D9BF0;          /* галочка «ок» */
  --match: #2A2A2E;         /* плашка мэтча */
  --r-card: 32px;
  --r-sheet: 28px;
  --tab-h: 62px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --shadow-card: 0 30px 56px -20px rgba(25, 25, 40, .26);
  --shadow-soft: 0 10px 26px -12px rgba(25, 25, 40, .20);
}

/* градиенты обводок по категориям (тонкая радужная рамка карточки) */
.g-sunset { --gb: linear-gradient(135deg, #FF9A62, #FF2D78, #B44DFF); --gd: linear-gradient(135deg, rgba(255,138,92,.14), rgba(255,45,120,.14)); }
.g-amber  { --gb: linear-gradient(135deg, #FFD24D, #FF8A3D, #FF5C7A); --gd: linear-gradient(135deg, rgba(255,210,77,.16), rgba(255,138,61,.14)); }
.g-mint   { --gb: linear-gradient(135deg, #3EEC9E, #19C8A8, #2BC8FF); --gd: linear-gradient(135deg, rgba(62,236,158,.15), rgba(11,163,96,.13)); }
.g-violet { --gb: linear-gradient(135deg, #B44DFF, #6A5CFF, #3D7BFF); --gd: linear-gradient(135deg, rgba(154,77,255,.14), rgba(74,0,224,.13)); }
.g-ocean  { --gb: linear-gradient(135deg, #2BC8FF, #2B6BFF, #6A5CFF); --gd: linear-gradient(135deg, rgba(43,200,255,.15), rgba(0,91,234,.13)); }
.g-rose   { --gb: linear-gradient(135deg, #F857A6, #B44DFF, #FF5858); --gd: linear-gradient(135deg, rgba(248,87,166,.15), rgba(255,88,88,.13)); }
.g-aqua   { --gb: linear-gradient(135deg, #00F5A0, #00D9F5, #4D9CFF); --gd: linear-gradient(135deg, rgba(0,245,160,.15), rgba(0,217,245,.14)); }
.g-mono   { --gb: linear-gradient(135deg, #C6C6CE, #9E9EA8, #C6C6CE); --gd: linear-gradient(135deg, rgba(198,198,206,.2), rgba(142,142,152,.16)); }

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px; line-height: 1.45;
  overscroll-behavior-y: none;
  -webkit-font-smoothing: antialiased;
  user-select: none;
  display: flex; flex-direction: column;
  height: 100vh; height: 100dvh;
  overflow: hidden;
}
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
img { display: block; max-width: 100%; }
.hidden { display: none !important; }

/* ---------- экраны загрузки/логина ---------- */
.screen { position: fixed; inset: 0; z-index: 60; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; background: var(--bg); padding: 24px; }
.boot-stack, .login-stack { position: relative; width: 84px; height: 96px; margin-bottom: 10px; }
.bs-card { position: absolute; left: 50%; top: 50%; width: 62px; height: 82px; border-radius: 14px; background: var(--card); border: 1px solid #E0E0E6; box-shadow: 0 14px 30px -14px rgba(25,25,40,.22); }
.bs-1 { transform: translate(-50%,-50%) rotate(-9deg) translate(-9px, 7px); }
.bs-2 { transform: translate(-50%,-50%) rotate(8deg) translate(10px, 9px); }
.bs-3 { transform: translate(-50%,-50%); animation: bs-pulse 1.7s ease-in-out infinite; }
@keyframes bs-pulse { 0%,100% { transform: translate(-50%,-50%) scale(1); } 50% { transform: translate(-50%,-50%) scale(.94); opacity: .8; } }
.boot-title { font-size: 30px; font-weight: 800; letter-spacing: -.02em; }
.boot-sub { color: var(--ink-2); font-size: 13px; }

.login-box { width: min(88vw, 340px); background: var(--card); border-radius: var(--r-sheet); padding: 30px 24px 24px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 12px; box-shadow: var(--shadow-card); }
.login-stack { margin-bottom: 2px; }
.login-box h2 { margin: 0; font-size: 24px; font-weight: 800; letter-spacing: -.02em; }
.login-box p { margin: 0; color: var(--ink-2); font-size: 14px; line-height: 1.5; }

/* ---------- шапка ---------- */
#topbar {
  flex: none;
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(var(--safe-t) + 14px) 20px 8px;
}
.h-title { font-size: 31px; font-weight: 800; letter-spacing: -.03em; line-height: 1.1; }
.h-actions { display: flex; align-items: center; gap: 10px; }
.h-btn {
  position: relative;
  width: 40px; height: 40px; border-radius: 99px; display: grid; place-items: center;
  background: var(--card); color: var(--ink);
  box-shadow: var(--shadow-soft);
  transition: transform .15s ease;
}
.h-btn:active { transform: scale(.9); }
.h-btn svg { width: 19px; height: 19px; }
.hbadge {
  position: absolute; top: -3px; right: -3px;
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px;
  background: #FF2D78; color: #fff; font-size: 10.5px; font-weight: 800; font-style: normal;
  display: grid; place-items: center; border: 2px solid var(--bg);
}
.h-ava { width: 40px; height: 40px; border-radius: 99px; overflow: hidden; box-shadow: var(--shadow-soft); transition: transform .15s ease; }
.h-ava:active { transform: scale(.9); }
.h-ava img { width: 100%; height: 100%; object-fit: cover; }
.h-ava .h-ava-fb { width: 100%; height: 100%; display: grid; place-items: center; background: #1A1A1A; color: #fff; font-size: 15px; font-weight: 800; }

/* ---------- каркас ---------- */
#views { flex: 1; min-height: 0; position: relative; }
.view { position: absolute; inset: 0; display: flex; flex-direction: column; padding-bottom: calc(var(--tab-h) + 26px + var(--safe-b)); animation: viewin .28s ease both; }
@keyframes viewin { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.scroll-y { overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 10px 20px 26px; height: 100%; }

/* ---------- верх колоды: чипы ---------- */
.feed-top { flex: none; padding: 8px 20px 4px; }
.chips { display: flex; gap: 10px; }
.chipbtn {
  height: 44px; padding: 0 15px; border-radius: 99px;
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--card); color: var(--ink);
  font-size: 14px; font-weight: 600;
  box-shadow: var(--shadow-soft);
  transition: all .18s ease; white-space: nowrap;
}
.chipbtn:active { transform: scale(.95); }
.chipbtn svg { width: 17px; height: 17px; color: var(--ink-2); flex: none; }
.chipbtn .chev { width: 13px; height: 13px; color: var(--ink-3); }
.chipbtn.active { background: var(--ink); color: #fff; }
.chipbtn.active svg { color: rgba(255,255,255,.85); }
.chipbtn.round { width: 44px; padding: 0; justify-content: center; }

/* ---------- колода и свайп ---------- */
.deck { position: relative; flex: 1; min-height: 0; margin-top: 10px; touch-action: none; }
.sw-card {
  position: absolute; left: 50%; top: 0;
  width: min(calc(100% - 56px), 368px);
  height: 100%;
  margin-left: calc(min(calc(100% - 56px), 368px) / -2);
  border-radius: var(--r-card);
  background:
    linear-gradient(var(--card), var(--card)) padding-box,
    var(--gb) border-box;
  border: 3px solid transparent;
  box-shadow: var(--shadow-card);
  color: var(--ink);
  overflow: hidden;
  will-change: transform;
  display: flex; flex-direction: column;
  animation: cardin .32s cubic-bezier(.2, .9, .3, 1.15) both;
  z-index: 2;
}
.sw-card.below {
  z-index: 1;
  transform: rotate(-7deg) translate(-13px, 14px) scale(.99);
  opacity: 1; pointer-events: none;
  box-shadow: 0 16px 34px -14px rgba(25,25,40,.28);
  animation: none;
}
.sw-card.below2 {
  z-index: 0;
  transform: rotate(6deg) translate(13px, 9px) scale(.985);
  opacity: 1; pointer-events: none;
  box-shadow: 0 14px 30px -14px rgba(25,25,40,.24);
  animation: none;
}
@keyframes cardin { from { opacity: 0; transform: translateY(16px) scale(.97); } to { opacity: 1; } }

/* обложка карточки — резиновая: забирает свободную высоту, как в референсе (~45%) */
.sw-cover { position: relative; flex: 1 1 auto; min-height: 140px; max-height: 262px; background: var(--gd); overflow: hidden; }
.sw-cover img { width: 100%; height: 100%; object-fit: cover; }
.sw-cover .cover-fallback { position: absolute; inset: 0; display: grid; place-items: center; }
.sw-cover .cover-fallback svg { width: 54px; height: 54px; opacity: .45; }
.time-pill {
  position: absolute; left: 14px; top: 14px;
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(16, 16, 20, .74); color: #fff;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  font-size: 13px; font-weight: 650;
  padding: 8px 13px; border-radius: 99px;
}
.time-pill svg { width: 14px; height: 14px; }
.quick-like {
  position: absolute; right: 16px; top: 16px;
  width: 44px; height: 44px; border-radius: 99px;
  display: grid; place-items: center;
  background: rgba(16, 16, 20, .38); color: #fff;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  transition: transform .15s ease;
}
.quick-like:active { transform: scale(.84); }
.quick-like svg { width: 22px; height: 22px; }

/* тело карточки — компактное, своей высоты; при нехватке места плавно сжимается */
.sw-body { flex: 0 1 auto; min-height: 0; padding: 16px 19px 15px; display: flex; flex-direction: column; gap: 8px; overflow: hidden; }
.sw-title { margin: 0; flex: none; font-size: 27px; font-weight: 800; letter-spacing: -.025em; line-height: 1.13; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sw-locrow { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex: none; }
.sw-locrow .loc { display: inline-flex; align-items: center; gap: 6px; font-size: 14.5px; font-weight: 550; color: var(--ink); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sw-locrow .loc svg { width: 16px; height: 16px; color: var(--ink-2); flex: none; }
.sw-locrow .wc { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 750; color: var(--ink); flex: none; }
.sw-locrow .wc svg { width: 17px; height: 17px; color: var(--ink-2); }
.sw-desc {
  margin: 0; flex: 1 1 auto; min-height: 0;
  color: var(--ink-2); font-size: 13.5px; line-height: 1.48;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.sw-owner {
  flex: none; margin-top: auto;
  display: flex; align-items: center; gap: 12px;
  background: var(--soft); border-radius: 20px; padding: 10px 13px;
}
.sw-owner .ava { flex: none; }
.sw-owner img.ava { width: 42px; height: 42px; border-radius: 99px; object-fit: cover; }
.ava-black {
  width: 42px; height: 42px; border-radius: 99px; flex: none;
  display: grid; place-items: center; background: #1A1A1A; color: #fff;
  font-size: 14px; font-weight: 800; letter-spacing: .02em;
}
.own-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.own-label { font-size: 11.5px; color: var(--ink-3); font-weight: 600; }
.own-name { font-size: 15px; font-weight: 700; color: var(--ink); display: flex; align-items: center; gap: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.own-name .vcheck { width: 15px; height: 15px; color: var(--blue); flex: none; }

/* штампы при свайпе */
.stamp {
  position: absolute; top: 16%; padding: 7px 13px;
  font-size: 24px; font-weight: 900; letter-spacing: .08em;
  color: var(--ink); border: 3.5px solid var(--ink); border-radius: 12px;
  opacity: 0; pointer-events: none; z-index: 5;
  background: rgba(255,255,255,.82);
  transform: rotate(-12deg);
}
.stamp-want { left: 16px; }
.stamp-nope { right: 16px; transform: rotate(12deg); }

/* кнопки под колодой */
.deck-actions { flex: none; height: 96px; display: flex; align-items: center; justify-content: center; gap: 30px; padding: 4px 0 2px; }
.act { border-radius: 99px; display: grid; place-items: center; transition: transform .15s ease; }
.act:active { transform: scale(.86); }
.act svg { pointer-events: none; }
.act-no {
  width: 62px; height: 62px;
  background: var(--card); color: var(--ink);
  box-shadow: 0 18px 36px -12px rgba(25,25,40,.30);
}
.act-no svg { width: 26px; height: 26px; }
.act-want {
  width: 74px; height: 74px;
  background: var(--ink); color: #fff;
  box-shadow: 0 18px 38px -12px rgba(0,0,0,.42);
}
.act-want svg { width: 32px; height: 32px; }
.dots { display: flex; align-items: center; gap: 6px; min-width: 66px; justify-content: center; }
.dot { width: 7px; height: 7px; border-radius: 99px; background: #C5C5CA; transition: all .2s ease; }
.dot.on { width: 8px; height: 8px; background: var(--ink); }

/* ---------- плашка «У вас мэтч!» ---------- */
.match-banner {
  flex: none; display: flex; align-items: center; gap: 12px;
  margin: 0 20px 12px; padding: 11px 16px 11px 12px;
  border-radius: 99px; background: var(--match); color: #fff;
  text-align: left; box-shadow: 0 18px 40px -14px rgba(20,20,26,.5);
  transition: transform .15s ease;
  animation: bannerin .35s cubic-bezier(.2,.9,.3,1.2) both;
}
@keyframes bannerin { from { opacity: 0; transform: translateY(14px) scale(.97); } }
.match-banner:active { transform: scale(.97); }
.mb-avas { display: flex; align-items: center; flex: none; }
.mb-avas img, .mb-avas .mb-ava-fb {
  width: 46px; height: 46px; border-radius: 99px; object-fit: cover;
  border: 2.5px solid #fff; background: #1A1A1A; box-shadow: 0 4px 14px rgba(0,0,0,.3);
}
.mb-avas img + img, .mb-avas .mb-ava-fb + img, .mb-avas img + .mb-ava-fb { margin-left: -13px; }
.mb-ava-fb { display: grid; place-items: center; font-size: 15px; font-weight: 800; color: #fff; }
.mb-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.mb-title { display: flex; align-items: center; gap: 6px; font-size: 15px; font-weight: 750; white-space: nowrap; }
.mb-title svg { width: 15px; height: 15px; color: #FF5C8A; flex: none; }
.mb-sub { font-size: 11.5px; color: #9A9AA0; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mb-chev { width: 18px; height: 18px; color: #9A9AA0; flex: none; }

/* ---------- пустые состояния и скелетоны ---------- */
.empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 10px; padding: 24px 28px; }
.empty svg { width: 96px; height: 96px; }
.empty h3 { margin: 0; font-size: 19px; font-weight: 800; }
.empty p { margin: 0; color: var(--ink-2); font-size: 13.5px; max-width: 300px; line-height: 1.5; }
.empty .btn-primary { margin-top: 10px; }

.sk-card { border: 1.5px solid #E3E3E9; background: var(--card); animation: none; }
.sk-cover { flex: 1 1 auto; min-height: 140px; max-height: 262px; }
.sk-line { height: 13px; border-radius: 99px; margin: 12px 20px 0; background: #EFEFF4; }
.sk-line.w70 { width: 70%; }
.sk-line.w40 { width: 40%; margin-bottom: 18px; }
.shimmer, .sk-cover { background: linear-gradient(100deg, #EFEFF4 40%, #F8F8FB 50%, #EFEFF4 60%); background-size: 200% 100%; animation: shimmer 1.3s infinite linear; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- кнопки ---------- */
.btn-primary {
  background: var(--ink); color: #fff; font-weight: 750; font-size: 14.5px;
  padding: 14px 22px; border-radius: 18px; letter-spacing: -.01em;
  box-shadow: 0 14px 30px -12px rgba(0,0,0,.4);
  transition: transform .16s ease, box-shadow .16s;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.btn-primary:active { transform: scale(.95); }
.btn-ghost {
  background: var(--card); border: 1.5px solid var(--line);
  color: var(--ink); font-weight: 700; font-size: 14px;
  padding: 12px 18px; border-radius: 16px; transition: transform .16s ease;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.btn-ghost:active { transform: scale(.95); }
.btn-ghost.danger { color: #E5484D; border-color: rgba(229,72,77,.35); }
.btn-tg {
  display: inline-flex; align-items: center; gap: 8px; justify-content: center;
  background: linear-gradient(135deg, #2AABEE, #229ED9); color: #fff;
  font-weight: 800; font-size: 14px; padding: 12px 20px; border-radius: 16px;
  box-shadow: 0 12px 26px -12px rgba(42,171,238,.6); transition: transform .16s ease;
}
.btn-tg:active { transform: scale(.95); }
.btn-tg svg { width: 18px; height: 18px; }
.btn-block { width: 100%; }

/* ---------- секции в скролле ---------- */
.sec-title { display: flex; align-items: baseline; justify-content: space-between; margin: 10px 2px 12px; }
.sec-title h2 { margin: 0; font-size: 26px; font-weight: 800; letter-spacing: -.02em; }
.sec-title .cnt { color: var(--ink-3); font-size: 13px; font-weight: 650; }
.hint { color: var(--ink-2); font-size: 12.5px; line-height: 1.5; margin: 6px 2px 0; }

/* строка-карточка в списках (Мои/Лайки) */
.row-card {
  border-radius: 24px;
  background: var(--card); padding: 14px; margin-bottom: 12px;
  display: flex; gap: 12px; align-items: center;
  box-shadow: var(--shadow-soft);
  transition: transform .15s ease;
  width: 100%; text-align: left;
}
.row-card:active { transform: scale(.985); }
.row-card .rc-thumb {
  width: 58px; height: 58px; border-radius: 18px; flex: none; position: relative; overflow: hidden;
  border: 2px solid transparent;
  background: var(--gd);
  background-image: linear-gradient(var(--card), var(--card)) padding-box, var(--gb) border-box;
}
.row-card .rc-thumb img { width: 100%; height: 100%; object-fit: cover; }
.row-card .rc-thumb .rc-cat { position: absolute; left: 7px; bottom: 6px; width: 9px; height: 9px; border-radius: 99px; background-image: var(--gb); border: 2px solid var(--card); box-sizing: content-box; margin: 0 0 -2px -2px; }
.rc-main { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 4px; }
.rc-title { font-weight: 750; font-size: 15px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rc-sub { color: var(--ink-2); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rc-side { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }

/* лайкеры под карточкой в «Мои» */
.likers-wrap { margin: -2px 2px 16px; }
.liker-chip {
  display: inline-flex; align-items: center; gap: 9px;
  background: var(--card); box-shadow: var(--shadow-soft);
  padding: 6px 13px 6px 7px; border-radius: 99px; margin: 0 8px 8px 0;
  transition: transform .15s ease;
}
.liker-chip:active { transform: scale(.94); }
.liker-chip img, .liker-chip .avatar-fallback { width: 32px; height: 32px; margin: 0; }
.avatar-fallback { width: 32px; height: 32px; border-radius: 99px; flex: none; display: grid; place-items: center; background: #1A1A1A; color: #fff; font-size: 12px; font-weight: 800; }
.avatar-img { width: 32px; height: 32px; border-radius: 99px; object-fit: cover; background: var(--soft); }
.liker-chip .lc-name { font-size: 12.5px; font-weight: 700; color: var(--ink); max-width: 140px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.liker-chip .lc-when { font-size: 10.5px; color: var(--ink-3); }

/* ---------- нижняя навигация ---------- */
#tabbar {
  position: fixed; z-index: 45;
  left: 12px; right: 12px; bottom: calc(8px + var(--safe-b));
  height: var(--tab-h);
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: rgba(255,255,255,.95);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border-radius: 26px;
  box-shadow: 0 20px 48px -14px rgba(25,25,40,.26);
  padding: 0 4px;
}
.tab { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: var(--ink-3); transition: color .18s ease; }
.tab svg { width: 23px; height: 23px; }
.tab span { font-size: 10.5px; font-weight: 650; letter-spacing: .01em; }
.tab.active { color: var(--ink); }
.tab.active svg { stroke-width: 2.3; }
.tab:active svg { transform: scale(.86); transition: transform .12s; }
.tab-badge {
  position: absolute; top: 2px; left: calc(50% + 12px);
  min-width: 17px; height: 17px; padding: 0 5px; border-radius: 99px;
  background: #FF2D78; color: #fff; font-size: 10px; font-weight: 800; font-style: normal;
  display: grid; place-items: center; border: 2px solid var(--card); box-sizing: content-box;
}

/* ---------- шит (bottom sheet) ---------- */
.sheet { position: fixed; inset: 0; z-index: 70; }
.sheet-back { position: absolute; inset: 0; background: rgba(24, 24, 30, .44); backdrop-filter: blur(3px); animation: fadein .22s ease both; }
@keyframes fadein { from { opacity: 0; } }
.sheet-panel {
  position: absolute; left: 0; right: 0; bottom: 0;
  max-height: 92%; overflow: hidden;
  background: var(--card); border-radius: var(--r-sheet) var(--r-sheet) 0 0;
  display: flex; flex-direction: column;
  animation: sheetup .3s cubic-bezier(.2, .9, .3, 1) both;
  box-shadow: 0 -24px 60px rgba(25,25,40,.28);
}
@keyframes sheetup { from { transform: translateY(40%); opacity: .6; } }
.sheet-close {
  position: absolute; top: 14px; right: 14px; z-index: 5;
  width: 38px; height: 38px; border-radius: 99px;
  background: var(--soft); color: var(--ink);
  display: grid; place-items: center;
}
.sheet-close svg { width: 17px; height: 17px; }
.sheet-body { overflow-y: auto; -webkit-overflow-scrolling: touch; padding-bottom: calc(22px + var(--safe-b)); }

/* детальная карточка в шите */
.dt-cover { position: relative; aspect-ratio: 16/10; background: var(--gd); overflow: hidden; }
.dt-cover img { width: 100%; height: 100%; object-fit: cover; }
.dt-cover::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(20,20,26,.22), transparent 32%, transparent 68%, rgba(20,20,26,.5)); }
.dt-head { padding: 20px 20px 6px; display: flex; flex-direction: column; gap: 10px; }
.dt-catch { display: inline-flex; align-self: flex-start; align-items: center; gap: 7px; font-size: 11px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-2); }
.dt-catch i { width: 9px; height: 9px; border-radius: 99px; background-image: var(--gb); font-style: normal; }
.dt-title { margin: 0; font-size: 25px; font-weight: 800; letter-spacing: -.025em; line-height: 1.14; }
.dt-meta { display: flex; flex-wrap: wrap; gap: 7px; }
.dt-meta .chip { background: var(--soft); border: 0; color: var(--ink); font-weight: 600; }
.dt-meta .chip b { font-weight: 750; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 650; color: var(--ink);
  background: var(--soft); padding: 7px 12px; border-radius: 99px; white-space: nowrap;
}
.chip svg { width: 14px; height: 14px; flex: none; color: var(--ink-2); }
.dt-section { padding: 16px 20px 0; }
.dt-section h4 { margin: 0 0 9px; font-size: 12px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-3); }
.dt-desc { color: #55565E; font-size: 14.5px; line-height: 1.6; white-space: pre-wrap; user-select: text; }
.dt-map { border-radius: 20px; overflow: hidden; border: 1px solid var(--line); position: relative; }
.dt-map .ymap { height: 240px; }
.dt-map .map-fallback { height: 130px; display: grid; place-items: center; color: var(--ink-2); font-size: 12.5px; text-align: center; padding: 12px; }
.dt-gallery { display: flex; gap: 10px; overflow-x: auto; padding: 4px 20px 8px; scroll-snap-type: x mandatory; }
.dt-gallery img { width: 150px; aspect-ratio: 4/4.6; object-fit: cover; border-radius: 18px; border: 1px solid var(--line); scroll-snap-align: start; }
.dt-owner { display: flex; align-items: center; gap: 12px; padding: 13px 15px; margin: 16px 20px 0; background: var(--soft); border-radius: 20px; }
.dt-owner img, .dt-owner .avatar-fallback { width: 46px; height: 46px; font-size: 15px; }
.dt-owner .own-name { font-size: 15px; }
.dt-owner .own-sub { font-size: 12.5px; color: var(--ink-2); }
.dt-actions { display: flex; gap: 12px; padding: 18px 20px 6px; }
.dt-actions .btn-ghost, .dt-actions .btn-primary { flex: 1; padding: 15px; }
.dt-no-btn { flex: 1; text-align: center; padding: 15px; border-radius: 18px; background: var(--soft); color: var(--ink-2); font-weight: 700; font-size: 13.5px; }

/* профиль человека (лайкер) */
.pv { padding: 26px 20px 12px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; }
.pv .pv-ava { width: 92px; height: 92px; border-radius: 99px; object-fit: cover; background: #1A1A1A; }
.pv .pv-ava-fb { width: 92px; height: 92px; border-radius: 99px; display: grid; place-items: center; font-size: 30px; font-weight: 800; background: #1A1A1A; color: #fff; }
.pv h3 { margin: 8px 0 0; font-size: 22px; font-weight: 800; }
.pv .pv-sub { color: var(--ink-2); font-size: 13px; }
.pv-cause { margin: 12px auto 0; max-width: 320px; background: var(--soft); border-radius: 16px; padding: 12px 16px; color: var(--ink-2); font-size: 12.5px; line-height: 1.5; }
.pv-cause b { color: var(--ink); }
.pv-actions { padding: 18px 20px calc(12px + var(--safe-b)); display: flex; flex-direction: column; gap: 10px; }

/* ---------- профиль ---------- */
.pf-head { display: flex; align-items: center; gap: 16px; padding: 14px 2px 8px; }
.pf-ava { width: 78px; height: 78px; border-radius: 99px; object-fit: cover; background: #1A1A1A; }
.pf-ava-fb { width: 78px; height: 78px; border-radius: 99px; display: grid; place-items: center; font-size: 26px; font-weight: 800; background: #1A1A1A; color: #fff; }
.pf-name { font-size: 22px; font-weight: 800; letter-spacing: -.02em; line-height: 1.2; }
.pf-sub { color: var(--ink-2); font-size: 12.5px; }
.pf-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 14px 0 4px; }
.pf-stat { background: var(--card); border-radius: 20px; padding: 14px 8px; text-align: center; box-shadow: var(--shadow-soft); }
.pf-stat b { display: block; font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
.pf-stat span { color: var(--ink-3); font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.field { margin: 16px 0; }
.field label { display: block; font-size: 11.5px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 8px; }
.input, textarea.input {
  width: 100%; background: var(--card); border: 1.5px solid var(--line);
  border-radius: 16px; color: var(--ink);
  padding: 13px 15px; font: inherit; font-size: 15px;
  outline: none; transition: border-color .18s ease;
}
.input:focus { border-color: var(--ink); }
textarea.input { min-height: 96px; resize: none; line-height: 1.5; }
.input-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* выбор категории */
.cat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.cat-pill {
  display: flex; flex-direction: column; align-items: center; gap: 7px;
  background: var(--card); border: 1.5px solid var(--line); border-radius: 16px;
  padding: 12px 4px 10px; color: var(--ink-2); font-size: 10.5px; font-weight: 700;
  transition: all .16s ease;
}
.cat-pill i { width: 22px; height: 22px; border-radius: 99px; background-image: var(--gb); opacity: .9; font-style: normal; }
.cat-pill.sel {
  border: 1.5px solid transparent;
  background: linear-gradient(var(--card), var(--card)) padding-box, var(--gb) border-box;
  color: var(--ink);
}
.cat-pill:active { transform: scale(.93); }

/* фото-загрузка */
.up-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 9px; }
.up-slot { position: relative; aspect-ratio: 1; border-radius: 18px; overflow: hidden; border: 1.5px solid var(--line); }
.up-slot img { width: 100%; height: 100%; object-fit: cover; }
.up-slot .up-del {
  position: absolute; top: 6px; right: 6px; width: 26px; height: 26px; border-radius: 99px;
  background: rgba(20,20,26,.6); color: #fff; display: grid; place-items: center; backdrop-filter: blur(6px);
}
.up-slot .up-del svg { width: 13px; height: 13px; }
.up-add {
  aspect-ratio: 1; border-radius: 18px; border: 1.6px dashed #C9C9D2;
  display: grid; place-items: center; color: var(--ink-3); transition: all .16s ease; background: var(--card);
}
.up-add:active { transform: scale(.94); border-color: var(--ink); color: var(--ink); }
.up-add svg { width: 22px; height: 22px; }
.up-slot.loading { background: var(--soft); display: grid; place-items: center; }
.up-slot.loading::after { content: ""; width: 22px; height: 22px; border-radius: 99px; border: 2.5px solid var(--line); border-top-color: var(--ink); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* лайки/мэтчи */
.match-reason { display: flex; align-items: center; gap: 7px; font-size: 11.5px; color: var(--ink-2); flex-wrap: wrap; }
.match-reason svg { width: 13px; height: 13px; flex: none; }
.match-kind { display: inline-flex; align-items: center; gap: 6px; font-size: 10px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; padding: 5px 10px; border-radius: 99px; }
.match-kind.owner { color: #fff; background: var(--ink); }
.match-kind.coswipe { color: var(--ink); background: var(--soft); }
.rc-side .btn-tg { padding: 9px 13px; font-size: 12px; border-radius: 13px; }
.rc-side .btn-ghost { padding: 9px 13px; font-size: 12px; border-radius: 13px; }

/* ---------- тост ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--tab-h) + 30px + var(--safe-b));
  transform: translateX(-50%); z-index: 90;
  background: rgba(26, 26, 30, .95); color: #fff;
  backdrop-filter: blur(12px);
  padding: 12px 19px; border-radius: 99px; font-size: 13px; font-weight: 650;
  box-shadow: 0 18px 44px rgba(20,20,26,.4);
  animation: toastin .25s ease both; max-width: 86vw; text-align: center;
}
.toast.err { background: #B3261E; }
@keyframes toastin { from { opacity: 0; transform: translate(-50%, 10px); } }

/* карта-пикер в форме */
.ymap-picker .ymap { height: 260px; border-radius: 20px; overflow: hidden; border: 1px solid var(--line); }
.coords-hint { font-size: 12px; color: var(--ink-2); margin-top: 8px; }
.coords-hint b { color: var(--ink); }

/* фильтры колоды (шит) */
.filters-head { padding: 22px 20px 4px; }
.filters-head h2 { margin: 0; font-size: 24px; font-weight: 800; letter-spacing: -.02em; }
.filters-head p { margin: 4px 0 0; color: var(--ink-2); font-size: 13px; }
.filters-body { padding: 14px 20px 6px; }
.f-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 9px; }
.f-pill {
  display: flex; align-items: center; gap: 9px;
  border: 1.5px solid var(--line); border-radius: 16px; padding: 12px 13px;
  font-size: 13.5px; font-weight: 650; color: var(--ink);
  transition: all .16s ease; background: var(--card); text-align: left;
}
.f-pill i { width: 20px; height: 20px; border-radius: 99px; background-image: var(--gb); font-style: normal; flex: none; }
.f-pill.sel { border-color: transparent; background: linear-gradient(var(--card), var(--card)) padding-box, var(--gb) border-box; }
.f-pill:active { transform: scale(.96); }
.filters-foot { display: flex; gap: 10px; padding: 16px 20px 0; }
.filters-foot .btn-ghost, .filters-foot .btn-primary { flex: 1; padding: 14px; }

/* тонкий скролл */
.scroll-y::-webkit-scrollbar, .sheet-body::-webkit-scrollbar, .dt-gallery::-webkit-scrollbar { width: 0; height: 0; }

/* ---------- компактно на средних экранах ---------- */
@media (max-height: 880px) {
  .h-title { font-size: 27px; }
  #topbar { padding-top: calc(var(--safe-t) + 10px); }
  .chipbtn, .chipbtn.round { height: 42px; }
  .deck { margin-top: 8px; }
  .deck-actions { height: 88px; gap: 26px; }
  .act-no { width: 56px; height: 56px; }
  .act-want { width: 68px; height: 68px; }
  .act-want svg { width: 29px; height: 29px; }
  .match-banner { padding-top: 9px; padding-bottom: 9px; }
  .mb-avas img, .mb-avas .mb-ava-fb { width: 42px; height: 42px; }
  .view { padding-bottom: calc(var(--tab-h) + 20px + var(--safe-b)); }
  .sw-title { font-size: 23px; }
  .sw-body { padding: 13px 16px 12px; gap: 7px; }
}

/* ---------- короткие экраны ---------- */
@media (max-height: 740px) {
  .h-title { font-size: 24px; }
  .feed-top { padding-top: 2px; }
  .chipbtn, .chipbtn.round { height: 38px; }
  .deck { margin-top: 6px; }
  .deck-actions { height: 78px; gap: 22px; }
  .act-no { width: 50px; height: 50px; }
  .act-want { width: 62px; height: 62px; }
  .match-banner { padding-top: 8px; padding-bottom: 8px; }
  .mb-avas img, .mb-avas .mb-ava-fb { width: 38px; height: 38px; }
  .view { padding-bottom: calc(var(--tab-h) + 16px + var(--safe-b)); }
  .sw-title { font-size: 21px; }
  .sw-body { padding: 12px 14px 11px; gap: 6px; }
  .stamp { font-size: 20px; border-width: 3px; }
}

@media (min-width: 520px) {
  .sheet-panel { left: 50%; transform: translateX(-50%); width: 480px; }
  @keyframes sheetup { from { transform: translate(-50%, 40%); opacity: .6; } to { transform: translate(-50%, 0); } }
}

/* ============================================================
   Добавления новой версии
   ============================================================ */

/* ---------- сегментированные табы (Главная / Мои / Лайки) ---------- */
.segtabs { flex: none; display: flex; gap: 8px; padding: 6px 20px 2px; }
.segtab {
  height: 40px; padding: 0 18px; border-radius: 99px;
  background: var(--card); color: var(--ink-2);
  font-size: 14px; font-weight: 700; letter-spacing: -.01em;
  box-shadow: var(--shadow-soft);
  transition: all .18s ease; white-space: nowrap;
}
.segtab:active { transform: scale(.95); }
.segtab.active { background: var(--ink); color: #fff; }

/* штамп «ХОЧУ» — с градиентной обводкой категории */
.stamp-want {
  border-color: transparent;
  background:
    linear-gradient(rgba(255,255,255,.86), rgba(255,255,255,.86)) padding-box,
    var(--gb) border-box;
}

/* вид мэтча «идут вместе» (kind=together) */
.match-kind.together { color: var(--ink); background: var(--soft); }

/* статус-пилюля архивной карточки в «Мои» */
.status-pill {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 10px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase;
  padding: 4px 9px; border-radius: 99px;
}
.status-pill.on { color: #157F3D; background: rgba(48,164,108,.14); }
.status-pill.off { color: var(--ink-2); background: var(--soft); }

/* кнопка-иконка в строках списков */
.icon-btn {
  width: 40px; height: 40px; border-radius: 99px; flex: none;
  display: grid; place-items: center;
  background: var(--soft); color: var(--ink-2);
  transition: all .15s ease;
}
.icon-btn:active { transform: scale(.88); }
.icon-btn svg { width: 18px; height: 18px; }

@media (max-height: 880px) {
  .segtab { height: 37px; padding: 0 15px; font-size: 13.5px; }
}
@media (max-height: 740px) {
  .segtab { height: 34px; padding: 0 14px; font-size: 13px; }
  .segtabs { padding-top: 3px; }
}

/* заголовки секций в «Лайках» */
.match-sec { margin: 18px 2px 10px; font-size: 11px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-3); }
