/* Барахолка — чёрно-белая тема: чёрный фон, тонкие белые обводки, белые кнопки.
   Тема Telegram намеренно не используется: у барахолки свой вид. */
@property --spin { syntax: '<angle>'; initial-value: 0deg; inherits: false; }

:root {
  --bg: #000;
  --surface: #0b0b0c;
  --raised: #141416;
  --line: rgba(255, 255, 255, .11);
  --line-2: rgba(255, 255, 255, .24);
  --text: #fff;
  --muted: #8f8f95;
  --dim: #55555b;
  --inv: #000;
  --ok: #5fe3a1;
  --accent: #a78bfa;
  --bad: #ff6b6b;
  --r: 16px;
  --r-s: 12px;
  --display: "Unbounded", "Manrope", system-ui, sans-serif;
  --body: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, system-ui, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body {
  font: 15px/1.45 var(--body);
  -webkit-font-smoothing: antialiased;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  overscroll-behavior-y: none;
}
body.has-fb { padding-bottom: calc(84px + env(safe-area-inset-bottom, 0px)); }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; transition: transform .12s, background .15s, opacity .15s; }
button:active:not(:disabled) { transform: scale(.97); }
button:disabled { opacity: .45; cursor: default; }
img { display: block; max-width: 100%; }
:focus-visible { outline: 1.5px solid #fff; outline-offset: 2px; }
[hidden] { display: none !important; }
::selection { background: #fff; color: #000; }

/* ---------- иконки ---------- */
.ico { width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }
.ico.s { width: 17px; height: 17px; stroke-width: 1.8; }
.ico.l { width: 30px; height: 30px; stroke-width: 1.4; }
.ico.xl { width: 76px; height: 76px; stroke-width: 1.1; filter: drop-shadow(0 0 14px rgba(255, 255, 255, .28)); }
.ico.draw path { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 1.1s cubic-bezier(.65, 0, .25, 1) forwards; animation-delay: var(--d, 0s); }
.ico.float { animation: float 4s ease-in-out infinite; }
.ico.fill path { fill: currentColor; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes float { 50% { transform: translateY(-6px); } }
@keyframes pop { 40% { transform: scale(1.28); } }
.pop { animation: pop .35s ease-out; }

/* ---------- раскладка ---------- */
.wrap { max-width: 640px; margin: 0 auto; padding: 14px 14px 30px; display: flex; flex-direction: column; gap: 14px; }
.wrap.flush { padding: 0 0 30px; }
.pad { padding: 0 14px; display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; align-items: center; gap: 10px; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }

/* шапка */
.brand { display: flex; align-items: center; gap: 12px; padding: 4px 0 2px; }
.brand .mark { width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--line-2); display: grid; place-items: center; font: 600 17px var(--display); flex: none; }
.brand .name { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.brand .name b { font: 600 19px/1.1 var(--display); letter-spacing: .04em; text-transform: uppercase; }
.brand .name small { font-size: 11.5px; letter-spacing: .22em; text-transform: uppercase; color: var(--muted); }
.page-title { display: flex; flex-direction: column; gap: 4px; }
.page-title b { font: 600 22px/1.15 var(--display); letter-spacing: -.01em; }
.page-title small { color: var(--muted); font-size: 13px; }
.fb-back { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: 14px; align-self: flex-start; padding: 2px 0; }

.ghost-btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line-2); border-radius: 999px; padding: 7px 12px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.pills { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 -14px; padding: 0 14px; }
.pills::-webkit-scrollbar { display: none; }
.pill-btn { flex: none; display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line); border-radius: 999px; padding: 8px 14px 8px 11px; font-size: 14px; font-weight: 600; background: var(--surface); }

/* поиск */
.search { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line-2); border-radius: var(--r); padding: 0 14px; background: var(--surface); color: var(--muted); }
.search:focus-within { border-color: #fff; color: #fff; }
.search input { flex: 1; min-width: 0; border: 0; background: transparent; padding: 13px 0; outline: none; color: var(--text); }
.search input::placeholder { color: var(--dim); }
.search input::-webkit-search-cancel-button { display: none; }
.search .x { color: var(--muted); display: grid; place-items: center; padding: 4px; }
.bar { display: flex; justify-content: space-between; gap: 8px; }
.linkbtn { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13.5px; font-weight: 600; padding: 2px 0; }
.linkbtn:hover { color: #fff; }

/* категории */
.cats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.cat { border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); padding: 14px 4px 10px; text-align: center; font-size: 11.5px; font-weight: 600; line-height: 1.2;
  display: flex; flex-direction: column; align-items: center; gap: 8px; color: #fff; }
.cat:active { border-color: var(--line-2); }

.h-row { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.h-row b { font: 600 15px var(--display); letter-spacing: .02em; }
.h-row small { color: var(--muted); font-size: 12.5px; }
.eyebrow { font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); font-weight: 700; }

/* ---------- лента ---------- */
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.card { border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; background: var(--surface); text-align: left; display: flex; flex-direction: column; position: relative; isolation: isolate; }
.thumb { aspect-ratio: 1 / 1; width: 100%; object-fit: cover; background: var(--raised); }
.thumb.ph { display: grid; place-items: center; color: var(--dim); }
.card .b { padding: 9px 11px 12px; display: flex; flex-direction: column; gap: 3px; }
.price { font: 600 14.5px/1.2 var(--display); font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.price.soft { font-family: var(--body); font-weight: 800; font-size: 14px; letter-spacing: .01em; }
.card .t { font-size: 13px; line-height: 1.3; color: #e8e8ea; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.6em; }
.meta { color: var(--muted); font-size: 12px; }

/* ТОП: переливающаяся рамка */
.card.promo { border-color: transparent; }
.card.promo::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1.3px; z-index: 2; pointer-events: none;
  background: conic-gradient(from var(--spin), #fff, #4a4a4f 25%, #fff 50%, #2a2a2e 75%, #fff);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
  animation: spin 5s linear infinite;
}
@keyframes spin { to { --spin: 360deg; } }
.badge-top { position: absolute; top: 8px; left: 8px; z-index: 3; display: inline-flex; align-items: center; gap: 4px; background: #fff; color: #000;
  font: 700 10.5px var(--display); letter-spacing: .08em; padding: 4px 8px 4px 6px; border-radius: 999px; overflow: hidden; }
.badge-top .ico { width: 13px; height: 13px; stroke-width: 2; }
.badge-top::after { content: ""; position: absolute; inset: 0; background: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, .9) 50%, transparent 65%); transform: translateX(-120%); animation: sheen 3.2s ease-in-out infinite; }
@keyframes sheen { 60%, 100% { transform: translateX(120%); } }

.sentinel { height: 1px; }
.loading { color: var(--muted); text-align: center; padding: 16px; font-size: 13.5px; }
.skel { background: linear-gradient(90deg, var(--surface), var(--raised), var(--surface)); background-size: 200% 100%; animation: skel 1.3s linear infinite; border-radius: var(--r); }
@keyframes skel { to { background-position: -200% 0; } }

.empty { text-align: center; padding: 44px 20px; color: var(--muted); display: flex; flex-direction: column; gap: 10px; align-items: center; }
.empty b { color: var(--text); font: 600 16px var(--display); }
.empty span { max-width: 32ch; font-size: 14px; }

/* ---------- фишки и выбор ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chips.scroll { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -14px; padding: 0 14px; }
.chips.scroll::-webkit-scrollbar { display: none; }
.chip { flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 7px 13px; border-radius: 999px; border: 1px solid var(--line-2); font-size: 13px; font-weight: 600; white-space: nowrap; color: #e8e8ea; }
.chip .ico { width: 15px; height: 15px; }
.chip.on { background: #fff; color: #000; border-color: #fff; }
.chip.static { border-color: var(--line); color: var(--muted); font-weight: 500; }
.sws { display: flex; flex-wrap: wrap; gap: 12px; }
.sw { width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--line-2); }
.sw.on { outline: 1.5px solid #fff; outline-offset: 3px; }
.sw.multi { background: conic-gradient(#d93b3b, #e9c43a, #3a9a5b, #2d6cdf, #d93b3b); }
.seg { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--line-2); border-radius: var(--r-s); padding: 3px; gap: 3px; }
.seg button { padding: 9px 2px; border-radius: 9px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.seg button.on { background: #fff; color: #000; }
@media (max-width: 360px) { .seg { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- блоки и поля ---------- */
.sect { border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.sect.list { padding: 0; gap: 0; overflow: hidden; }
.sect.alert { border-color: rgba(167, 139, 250, .5); box-shadow: 0 0 24px -12px rgba(167, 139, 250, .6); }
.lab { font-size: 11.5px; color: var(--muted); letter-spacing: .14em; text-transform: uppercase; font-weight: 700; }
.lab em { font-style: normal; color: #fff; }
.field { width: 100%; border: 1px solid var(--line-2); border-radius: var(--r-s); background: transparent; padding: 12px 13px; outline: none; color: var(--text); }
.field:focus { border-color: #fff; }
.field::placeholder { color: var(--dim); }
textarea.field { resize: vertical; min-height: 120px; line-height: 1.45; }
.counter { font-size: 11.5px; color: var(--dim); text-align: right; font-variant-numeric: tabular-nums; }
.counter.over { color: var(--bad); }
.inputs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.note { font-size: 13px; color: var(--muted); line-height: 1.45; margin: 0; }
.note.box { border: 1px dashed var(--line-2); border-radius: var(--r); padding: 12px 14px; color: #d8d8dc; }
.warn { border: 1px solid rgba(167, 139, 250, .45); border-radius: var(--r); padding: 12px 14px; font-size: 13.5px; line-height: 1.45; color: #e2d9ff; }
.err { border: 1px solid rgba(255, 107, 107, .45); border-radius: var(--r-s); padding: 11px 13px; font-size: 14px; color: #ffd0d0; }
.prog { height: 2px; background: var(--line); border-radius: 2px; overflow: hidden; }
.prog i { display: block; height: 100%; background: #fff; transition: width .3s; }

/* фото в форме */
.ph-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.ph { aspect-ratio: 1; border-radius: var(--r-s); overflow: hidden; position: relative; background: var(--raised); border: 1px solid var(--line); }
.ph img { width: 100%; height: 100%; object-fit: cover; }
.ph .x { position: absolute; top: 5px; right: 5px; width: 22px; height: 22px; border-radius: 50%; background: rgba(0, 0, 0, .7); color: #fff; display: grid; place-items: center; border: 1px solid var(--line-2); }
.ph .x .ico { width: 12px; height: 12px; stroke-width: 2.2; }
.ph .cover { position: absolute; left: 5px; right: 5px; bottom: 5px; background: #fff; color: #000; font-size: 9.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; text-align: center; border-radius: 6px; padding: 2px 0; }
.ph.add { border: 1px dashed var(--line-2); background: transparent; color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-size: 11.5px; font-weight: 600; }
.ph.add input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

/* ---------- карточка объявления ---------- */
.gal-wrap { position: relative; border-bottom: 1px solid var(--line); }
.gallery { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; background: #050505; aspect-ratio: 1 / 1; max-height: 64vh; }
.gallery::-webkit-scrollbar { display: none; }
.gallery img { flex: none; width: 100%; height: 100%; object-fit: contain; scroll-snap-align: center; }
.dots { position: absolute; left: 0; right: 0; bottom: 12px; display: flex; justify-content: center; gap: 5px; }
.dots i { width: 6px; height: 6px; border-radius: 50%; background: rgba(255, 255, 255, .35); transition: background .2s, width .2s; }
.dots i.on { background: #fff; width: 16px; border-radius: 3px; }
.big-price { font: 600 28px/1.1 var(--display); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.l-title { font-size: 18px; font-weight: 700; line-height: 1.3; }
.desc { white-space: pre-wrap; word-wrap: break-word; line-height: 1.55; color: #e8e8ea; }
.seller { display: flex; gap: 12px; align-items: center; }
.ava { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line-2); display: grid; place-items: center; font: 600 16px var(--display); flex: none; }
.seller div { display: flex; flex-direction: column; min-width: 0; gap: 2px; }
.acts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.acts.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.act { border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); padding: 12px 4px 10px; display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: #e8e8ea; }
.act.on { color: #fff; border-color: #fff; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; background: #fff; color: #000; border-radius: 14px; padding: 13px 16px; font-weight: 700; font-size: 15px; text-align: center; }
.btn .ico { width: 18px; height: 18px; stroke-width: 2; }
.btn.sec { background: transparent; color: #fff; border: 1px solid var(--line-2); font-weight: 600; }
.btn.danger { background: transparent; color: var(--bad); border: 1px solid rgba(255, 107, 107, .45); font-weight: 600; }
.btn.small { padding: 8px 12px; font-size: 13px; border-radius: 11px; gap: 6px; }
.btn.small .ico { width: 15px; height: 15px; }
.btn.top { background: #fff; color: #000; position: relative; overflow: hidden; }
.btn.top::after { content: ""; position: absolute; inset: 0; background: linear-gradient(105deg, transparent 35%, rgba(0, 0, 0, .12) 50%, transparent 65%); transform: translateX(-120%); animation: sheen 3s ease-in-out infinite; }
.btns { display: flex; flex-wrap: wrap; gap: 7px; }
.btns .btn { flex: 1 1 auto; }

/* статусы: обводка и цветная точка */
.st { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 700; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line-2); white-space: nowrap; color: #e8e8ea; }
.st::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--muted); }
.st.active::before { background: var(--ok); box-shadow: 0 0 8px var(--ok); }
.st.pending::before { background: var(--accent); box-shadow: 0 0 8px var(--accent); }
.st.rejected::before, .st.hidden::before { background: var(--bad); box-shadow: 0 0 8px var(--bad); }
.st.top { background: #fff; color: #000; border-color: #fff; }
.st.top::before { display: none; }

/* строки списков */
.item { border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); padding: 10px; display: grid; grid-template-columns: 68px minmax(0, 1fr); gap: 5px 12px; text-align: left; position: relative; isolation: isolate; }
.item .thumb { width: 68px; height: 68px; aspect-ratio: auto; border-radius: 11px; grid-row: span 3; }
.item .r1 { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.item .r1 b { font-size: 14.5px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .r1 span { font: 600 13.5px var(--display); white-space: nowrap; font-variant-numeric: tabular-nums; }
.item .r2 { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.item .why { grid-column: 1 / -1; font-size: 13px; color: #ffbdbd; }
.item .btns { grid-column: 1 / -1; margin-top: 6px; }
.item .flags { grid-column: 1 / -1; font-size: 12.5px; color: var(--accent); }
.limits { text-align: center; color: var(--muted); font-size: 12.5px; font-variant-numeric: tabular-nums; }

/* ---------- админка ---------- */
.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.tile { border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); padding: 12px; display: flex; flex-direction: column; gap: 4px; text-align: left; }
.tile b { font: 600 20px/1.1 var(--display); font-variant-numeric: tabular-nums; }
.tile span { font-size: 11.5px; color: var(--muted); line-height: 1.25; }
.tile.hot { border-color: rgba(167, 139, 250, .65); box-shadow: 0 0 24px -10px rgba(167, 139, 250, .7); }
.tile.hot b { color: var(--accent); }
.kv { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 7px 14px; font-size: 13.5px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; word-break: break-word; }
.logrow { font-size: 13px; padding: 11px 14px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; }
.logrow:last-child { border-bottom: 0; }
.logrow small { color: var(--muted); }
pre.errtext { white-space: pre-wrap; word-break: break-word; font: 11.5px/1.45 ui-monospace, Menlo, Consolas, monospace; border: 1px solid var(--line); padding: 10px; border-radius: 10px; margin: 4px 0 0; max-height: 240px; overflow: auto; color: #d8d8dc; }
.toggle { display: flex; justify-content: space-between; align-items: center; gap: 14px; }
.switch { width: 50px; height: 30px; border-radius: 15px; border: 1px solid var(--line-2); position: relative; flex: none; transition: background .15s; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: var(--muted); transition: left .18s, background .18s; }
.switch.on { background: #fff; }
.switch.on::after { left: 23px; background: #000; }

/* ---------- шторка, тост, кнопка ---------- */
.backdrop { position: fixed; inset: 0; background: rgba(0, 0, 0, .7); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); z-index: 50; animation: fade .18s; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 51; background: #0c0c0d; border: 1px solid var(--line-2); border-bottom: 0; border-radius: 24px 24px 0 0;
  max-height: 88vh; overflow-y: auto; max-width: 640px; margin: 0 auto;
  padding: 10px 18px calc(18px + env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; gap: 16px; animation: up .22s cubic-bezier(.2, .8, .2, 1); }
.sheet .handle { width: 40px; height: 4px; border-radius: 2px; background: var(--line-2); align-self: center; flex: none; }
.sheet h3 { margin: 0; font: 600 18px/1.25 var(--display); }
.sheet .opt { text-align: left; padding: 14px; border-radius: var(--r-s); border: 1px solid var(--line); font-weight: 600; display: flex; align-items: center; gap: 10px; }
.sheet .opt:active { border-color: #fff; }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }

#toast { position: fixed; left: 16px; right: 16px; top: calc(14px + env(safe-area-inset-top, 0px)); z-index: 60; background: #fff; color: #000;
  padding: 12px 16px; border-radius: 999px; font-size: 14px; font-weight: 600; text-align: center; max-width: 480px; margin: 0 auto;
  box-shadow: 0 10px 40px rgba(255, 255, 255, .12); animation: drop .25s cubic-bezier(.2, .8, .2, 1); }
#toast.bad { background: #1a0d0d; color: #ffd0d0; border: 1px solid rgba(255, 107, 107, .5); }
@keyframes drop { from { transform: translateY(-16px); opacity: 0; } }

#fb-main { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: linear-gradient(transparent, #000 30%); padding: 18px 14px calc(12px + env(safe-area-inset-bottom, 0px)); }
#fb-main button { width: 100%; max-width: 612px; margin: 0 auto; display: block; background: #fff; color: #000; border-radius: 14px; padding: 15px; font-weight: 700; font-size: 15px; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } .ico.draw path { stroke-dashoffset: 0; } }
@media (min-width: 560px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.big-price.price.soft { font: 600 24px/1.15 var(--display); display: inline-flex; align-items: center; gap: 8px; }
.big-price.price.soft .ico { width: 24px; height: 24px; }

/* ---------- движение ---------- */
:root { --ease-out: cubic-bezier(.2, .8, .2, 1); --spring: cubic-bezier(.34, 1.56, .64, 1); }

/* нажатия: пружина и рябь от пальца */
button { transition: transform .45s var(--spring), background .15s, opacity .15s, border-color .15s; }
button:active:not(:disabled) { transform: scale(.95); transition-duration: .08s; }
.card:active { transform: scale(.975); }
.item { transition: transform .45s var(--spring); }
.item:active { transform: scale(.98); transition-duration: .08s; }
.btn, .cat, .pill-btn, .act, .chip, .opt, .tile, .ghost-btn, .item, #fb-main-btn { position: relative; overflow: hidden; }
.rpl { position: absolute; left: var(--x); top: var(--y); width: var(--s); height: var(--s); margin: calc(var(--s) / -2) 0 0 calc(var(--s) / -2);
  border-radius: 50%; background: radial-gradient(circle, rgba(255, 255, 255, .24), rgba(255, 255, 255, 0) 70%);
  transform: scale(0); animation: rpl .6s var(--ease-out) forwards; pointer-events: none; }
.btn:not(.sec):not(.danger) .rpl, .chip.on .rpl, #fb-main-btn .rpl { background: radial-gradient(circle, rgba(0, 0, 0, .16), rgba(0, 0, 0, 0) 70%); }
@keyframes rpl { to { transform: scale(1); opacity: 0; } }

/* экраны */
.view { animation: view-in .4s var(--ease-out) backwards; }
.view.back { animation-name: view-back; }
.view.fade { animation-name: view-fade; animation-duration: .5s; }
@keyframes view-in { from { opacity: 0; transform: translateX(36px); } }
@keyframes view-back { from { opacity: 0; transform: translateX(-36px); } }
@keyframes view-fade { from { opacity: 0; } }
.rise { animation: rise .6s var(--ease-out) backwards; animation-delay: var(--i-delay, 0s); }
@keyframes rise { from { opacity: 0; transform: translateY(20px) scale(.98); } }

/* фото проявляются */
img.thumb, .gallery img, .ph img { opacity: 0; transform: scale(1.05); transition: opacity .5s ease, transform .8s var(--ease-out); }
img.loaded { opacity: 1; transform: none; }

/* шторки: выезд, закрытие, смахивание */
.sheet { transition: transform .32s var(--ease-out); animation: up .38s var(--spring); }
.sheet.closing { animation: sheet-out .24s cubic-bezier(.4, 0, 1, 1) forwards; }
.backdrop { transition: opacity .2s; }
.backdrop.closing { animation: fade-out .24s ease-in forwards; }
.sheet.fresh > * { animation: rise .45s var(--ease-out) backwards; }
.sheet.fresh > *:nth-child(2) { animation-delay: .03s; } .sheet.fresh > *:nth-child(3) { animation-delay: .06s; }
.sheet.fresh > *:nth-child(4) { animation-delay: .09s; } .sheet.fresh > *:nth-child(5) { animation-delay: .12s; }
.sheet.fresh > *:nth-child(6) { animation-delay: .15s; } .sheet.fresh > *:nth-child(n+7) { animation-delay: .18s; }
@keyframes sheet-out { to { transform: translateY(105%); } }
@keyframes fade-out { to { opacity: 0; } }

/* тост */
#toast { animation: drop .45s var(--spring); }
#toast.out { animation: toast-out .2s ease-in forwards; }
@keyframes toast-out { to { transform: translateY(-14px) scale(.96); opacity: 0; } }

/* фото в форме */
.ph.pop-in { animation: pop-in .5s var(--spring) backwards; }
.ph.pop-out { animation: pop-out .17s ease-in forwards; }
@keyframes pop-in { from { transform: scale(.4) rotate(-6deg); opacity: 0; } }
@keyframes pop-out { to { transform: scale(.4); opacity: 0; } }

/* искры: избранное и отправка */
.burst { position: absolute; left: 50%; top: 50%; width: 0; height: 0; pointer-events: none; z-index: 3; }
.burst i { position: absolute; left: -3px; top: -3px; width: 6px; height: 6px; border-radius: 50%; background: #fff; animation: burst .75s var(--ease-out) forwards; }
.burst i:nth-child(even) { background: var(--accent); box-shadow: 0 0 8px var(--accent); }
@keyframes burst {
  from { transform: rotate(var(--a)) translateY(0) scale(1); opacity: 1; }
  to { transform: rotate(var(--a)) translateY(calc(var(--r, 22px) * -1)) scale(.3); opacity: 0; }
}
.pulse { position: relative; display: inline-grid; place-items: center; }
.pulse::before, .pulse::after { content: ""; position: absolute; inset: -12px; border-radius: 50%; border: 1.5px solid var(--accent); animation: ring 2.2s var(--ease-out) infinite; }
.pulse::after { animation-delay: .75s; }
.pulse.bad::before, .pulse.bad::after { border-color: var(--bad); }
@keyframes ring { from { transform: scale(.7); opacity: .9; } to { transform: scale(1.8); opacity: 0; } }

/* заставка при открытии */
#splash { position: fixed; inset: 0; z-index: 100; background: #000; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 20px;
  transition: opacity .5s ease, transform .7s var(--ease-out); }
#splash.hide { opacity: 0; transform: scale(1.08); pointer-events: none; }
#splash .logo { position: relative; width: 96px; height: 96px; display: grid; place-items: center; }
#splash svg { position: absolute; inset: 0; width: 100%; height: 100%; fill: none; stroke: #fff; stroke-width: 1.2; transform: rotate(-90deg); overflow: visible; }
#splash circle { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 1s var(--ease-out) .1s forwards; }
#splash circle.glow { stroke: var(--accent); stroke-width: 3; filter: blur(7px); opacity: .8; }
#splash .glyph { font: 600 36px var(--display); animation: glyph .8s var(--spring) .35s backwards; }
#splash b { font: 600 15px var(--display); letter-spacing: .34em; padding-left: .34em; text-transform: uppercase; animation: word .9s var(--ease-out) .5s backwards; }
@keyframes glyph { from { transform: scale(.3); opacity: 0; } }
@keyframes word { from { letter-spacing: .9em; opacity: 0; } }

@media (prefers-reduced-motion: reduce) { img.thumb, .gallery img, .ph img { opacity: 1; transform: none; } #splash { display: none; } }
