/* Catch the Clothes — «Обсидиан». The photo is the screen; the chrome is black glass and type.
   Only transform and opacity move. Real backdrop blur only on small floating things. */
:root {
  --bg: #000;
  --s1: #0e0e10;            /* surfaces */
  --s2: #17171a;
  --s3: #222226;
  --hair: rgba(255, 255, 255, .08);
  --fg: #fff;
  --fg2: rgba(255, 255, 255, .64);
  --fg3: rgba(255, 255, 255, .4);
  --accent: #c8ff3d;        /* acid green: a signal, never a fill for big areas */
  --ink: #0a0d00;
  --nope: #ff453a;
  --gold: #ffd60a;
  --chrome: rgba(22, 22, 24, .62);
  --safe-t: max(env(safe-area-inset-top), calc(var(--tg-content-safe-area-inset-top, 0px) + var(--tg-safe-area-inset-top, 0px)));
  --safe-b: max(env(safe-area-inset-bottom), var(--tg-safe-area-inset-bottom, 0px), 8px);
  --ease: cubic-bezier(.23, 1, .32, 1);
  --ease-io: cubic-bezier(.77, 0, .175, 1);
  --spring: cubic-bezier(.2, .9, .25, 1.12);
  font: 17px/1.35 -apple-system, "SF Pro Text", system-ui, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  color-scheme: dark;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--fg); overflow: hidden; overscroll-behavior: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; touch-action: manipulation; -webkit-user-select: none; user-select: none; }
img { -webkit-user-drag: none; user-select: none; }
svg.i { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.chrome { background: var(--chrome); -webkit-backdrop-filter: blur(22px) saturate(170%); backdrop-filter: blur(22px) saturate(170%);
  box-shadow: inset 0 0 0 .5px rgba(255, 255, 255, .14), inset 0 1px 0 rgba(255, 255, 255, .1); }
@media (prefers-reduced-transparency: reduce) { .chrome { background: rgba(22, 22, 24, .96); -webkit-backdrop-filter: none; backdrop-filter: none; } }

/* ---------------- frame ---------------- */
#app { position: fixed; inset: 0; transform-origin: 50% 0; will-change: transform; overflow: hidden; }
.topbar { position: absolute; z-index: 6; left: 0; right: 0; top: 0; padding: calc(var(--safe-t) + 8px) 20px 10px; pointer-events: none;
  background: linear-gradient(180deg, #000 55%, rgba(0, 0, 0, 0)); transition: opacity .25s var(--ease), transform .35s var(--ease); }
.topbar h1 { margin: 0; font-size: 34px; font-weight: 800; letter-spacing: -.035em; line-height: 1.1; }
body[data-tab="feed"] .topbar { opacity: 0; transform: translateY(-10px); }
main { position: absolute; inset: 0; }
.screen { position: absolute; inset: 0; opacity: 0; pointer-events: none; transform: scale(.985); transition: opacity .22s var(--ease), transform .32s var(--ease); }
.screen.active { opacity: 1; pointer-events: auto; transform: none; }
.page { overflow-y: auto; -webkit-overflow-scrolling: touch; padding: calc(var(--safe-t) + 62px) 16px calc(var(--safe-b) + 110px); }

/* ---------------- tab bar: icons only, a pill that glides ---------------- */
.tabbar { position: fixed; z-index: 20; left: 50%; bottom: calc(var(--safe-b) + 8px); transform: translateX(-50%); display: flex; padding: 5px; border-radius: 30px;
  background: rgba(24, 24, 27, .72); -webkit-backdrop-filter: blur(24px) saturate(170%); backdrop-filter: blur(24px) saturate(170%);
  box-shadow: inset 0 0 0 .5px rgba(255, 255, 255, .14), inset 0 1px 0 rgba(255, 255, 255, .08), 0 12px 32px rgba(0, 0, 0, .55); }
.tabbar button { position: relative; z-index: 1; width: 66px; height: 46px; display: grid; place-items: center; color: rgba(255, 255, 255, .5);
  transition: color .25s var(--ease), transform .15s var(--ease); }
.tabbar button.on { color: #fff; }
.tabbar button:active { transform: scale(.9); }
.tabbar svg.i { width: 25px; height: 25px; }
.tab-pill { position: absolute; z-index: 0; top: 5px; left: 5px; width: 66px; height: 46px; border-radius: 23px; background: rgba(255, 255, 255, .14);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12); transition: transform .5s var(--spring); }

/* ---------------- feed: full-bleed cards ---------------- */
.stack { position: absolute; inset: 0; }
.card { position: absolute; inset: 0; overflow: hidden; background: #0b0b0c; border-radius: 46px; touch-action: none; will-change: transform;
  transform-origin: 50% 80%; contain: layout paint; }
.card .photo { position: absolute; inset: 0; }
.card .photo img { position: absolute; inset: -2%; width: 104%; height: 104%; object-fit: cover; opacity: 0; transition: opacity .35s var(--ease);
  transform: translate3d(calc(var(--tx, 0) * -6px), calc(var(--ty, 0) * -6px), 0); }
.card .photo img.lo { filter: blur(18px) saturate(1.1); }
.card .photo img.ready { opacity: 1; }
.card .ph { position: absolute; inset: 0; background: radial-gradient(80% 60% at 50% 40%, rgba(var(--card-tint, 40, 40, 44), .5), #070707); }
.card:not(.top) .photo { opacity: .55; }
.card.top .photo { transition: opacity .3s var(--ease); }
.shade { position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(0, 0, 0, .5) 0, transparent 17%, transparent 44%, rgba(0, 0, 0, .66) 66%, rgba(0, 0, 0, .94) 88%, #000 100%); }
.sheen { position: absolute; inset: -20%; pointer-events: none; opacity: .16; will-change: transform;
  background: linear-gradient(115deg, transparent 38%, rgba(255, 255, 255, .55) 49%, transparent 60%);
  transform: translate3d(calc(var(--tx, 0) * 20%), calc(var(--ty, 0) * 10%), 0); }
.card:not(.top) .sheen { display: none; }
.bars { position: absolute; z-index: 3; top: calc(var(--safe-t) + 6px); left: 16px; right: 16px; display: flex; gap: 3px; }
.bars i { flex: 1; height: 2.5px; border-radius: 2px; background: rgba(255, 255, 255, .26); transition: background-color .2s; }
.bars i.on { background: #fff; }
.score { position: absolute; z-index: 3; top: calc(var(--safe-t) + 20px); right: 16px; height: 32px; padding: 0 12px 0 9px; border-radius: 16px;
  display: flex; align-items: center; gap: 5px; font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; }
.score svg.i { width: 15px; height: 15px; color: var(--accent); stroke-width: 2.2; }
.score.hot { color: var(--gold); }
.score.hot svg.i { color: var(--gold); }
.flags { position: absolute; z-index: 3; top: calc(var(--safe-t) + 60px); right: 16px; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.flag { height: 26px; padding: 0 10px; border-radius: 13px; display: inline-flex; align-items: center; font-size: 12.5px; font-weight: 650; }
.flag.warn { color: #ffb340; }
.flag.lucky { color: var(--accent); }
.meta { position: absolute; z-index: 3; left: 22px; right: 22px; bottom: calc(var(--safe-b) + 150px); }
.eyebrow { font-size: 12px; font-weight: 650; letter-spacing: .13em; text-transform: uppercase; color: rgba(255, 255, 255, .58);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand { margin-top: 7px; font-size: 44px; font-weight: 800; letter-spacing: -.045em; line-height: .96; overflow: hidden; text-overflow: ellipsis;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.brand.long { font-size: 34px; letter-spacing: -.035em; }
.title { margin-top: 8px; font-size: 16px; color: rgba(255, 255, 255, .72); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.line { margin-top: 15px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.price { font-size: 30px; font-weight: 700; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.deal { height: 24px; padding: 0 8px; border-radius: 7px; display: inline-flex; align-items: center; font-size: 13px; font-weight: 750; background: var(--accent); color: var(--ink); }
.facts { font-size: 14px; font-weight: 550; color: rgba(255, 255, 255, .6); }
.why { margin-top: 14px; display: flex; gap: 11px; font-size: 14.5px; line-height: 1.38; color: rgba(255, 255, 255, .86); }
.why::before { content: ""; flex: none; width: 3px; border-radius: 2px; background: var(--accent); }
.why span { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* the decision shows on the whole screen as you drag: a wash of colour from the side you're going to */
.stamp { position: absolute; z-index: 2; inset: 0; opacity: 0; pointer-events: none; display: grid; place-items: center; }
.stamp.yes { background: radial-gradient(120% 70% at 100% 45%, rgba(200, 255, 61, .42), transparent 62%); }
.stamp.no { background: radial-gradient(120% 70% at 0% 45%, rgba(255, 69, 58, .45), transparent 62%); }
.stamp.save { background: radial-gradient(120% 60% at 50% 0%, rgba(255, 214, 10, .4), transparent 62%); }
.stamp .mark { display: flex; flex-direction: column; align-items: center; gap: 8px; font-size: 15px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.stamp .mark svg.i { width: 76px; height: 76px; stroke-width: 1.6; filter: drop-shadow(0 6px 24px rgba(0, 0, 0, .5)); }
.stamp.yes .mark { color: var(--accent); }
.stamp.no .mark { color: var(--nope); }
.stamp.save .mark { color: var(--gold); }
.stamp .t2 { display: none; }
.stamp.yes.love { background: radial-gradient(130% 80% at 100% 45%, rgba(255, 190, 0, .55), transparent 64%); }
.stamp.yes.love .mark { color: var(--gold); }
.stamp.yes.love .t1 { display: none; }
.stamp.yes.love .t2 { display: block; }
.stamp.yes.love svg.i { fill: currentColor; }

.hud { position: absolute; z-index: 12; top: calc(var(--safe-t) + 20px); left: 16px; pointer-events: none; }
.hud-pill { pointer-events: auto; height: 32px; padding: 0 13px 0 11px; border-radius: 16px; display: flex; align-items: center; gap: 7px;
  font-size: 14px; font-weight: 650; font-variant-numeric: tabular-nums;
  background: rgba(0, 0, 0, .38); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); box-shadow: inset 0 0 0 .5px rgba(255, 255, 255, .16); }
.hud-pill.bump { animation: bump .45s var(--spring); }
@keyframes bump { 40% { transform: scale(1.08); } }
.live { width: 6px; height: 6px; border-radius: 3px; background: var(--fg3); transition: background-color .3s, box-shadow .3s; }
.live.on { background: var(--accent); box-shadow: 0 0 8px var(--accent); }

.dock { position: absolute; z-index: 12; left: 0; right: 0; bottom: calc(var(--safe-b) + 74px); display: flex; justify-content: center; align-items: center; gap: 16px;
  transition: opacity .3s var(--ease), transform .4s var(--ease); }
.dock.off { opacity: 0; transform: translateY(20px); pointer-events: none; }
.act { width: 62px; height: 62px; border-radius: 31px; display: grid; place-items: center; color: #fff;
  background: rgba(255, 255, 255, .1); -webkit-backdrop-filter: blur(20px) saturate(160%); backdrop-filter: blur(20px) saturate(160%);
  box-shadow: inset 0 0 0 .5px rgba(255, 255, 255, .2), inset 0 1px 0 rgba(255, 255, 255, .14); transition: transform .16s var(--ease), background-color .2s; }
.act:active { transform: scale(.9); }
.act svg.i { width: 27px; height: 27px; stroke-width: 2.1; }
.act.save { width: 50px; height: 50px; }
.act.save svg.i { width: 22px; height: 22px; }
.act.yes { background: #fff; color: #000; box-shadow: 0 8px 26px rgba(0, 0, 0, .45); }
.act.yes svg.i { fill: none; }
.act.yes.pop svg.i { animation: heart .5s var(--spring); fill: currentColor; }
@keyframes heart { 30% { transform: scale(1.35); } }

.fresh { position: absolute; z-index: 15; left: 50%; top: calc(var(--safe-t) + 62px); height: 38px; padding: 0 15px 0 12px; border-radius: 19px; display: flex; align-items: center; gap: 7px;
  font-size: 14.5px; transform: translate(-50%, -16px) scale(.94); opacity: 0; transition: transform .5s var(--spring), opacity .25s;
  background: #fff; color: #000; box-shadow: 0 10px 30px rgba(0, 0, 0, .5); }
.fresh.on { transform: translate(-50%, 0); opacity: 1; }
.fresh svg.i { width: 17px; height: 17px; }
.fresh b { max-width: 230px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 650; }

.empty { position: absolute; inset: 0 30px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; color: var(--fg2); }
.empty.inline { position: static; padding: 80px 20px; }
.empty-mark { width: 76px; height: 76px; border-radius: 24px; display: grid; place-items: center; background: var(--s2); color: var(--accent); box-shadow: inset 0 0 0 .5px var(--hair); }
.empty-mark svg.i { width: 34px; height: 34px; }
.empty h2 { margin: 18px 0 6px; font-size: 24px; letter-spacing: -.03em; color: var(--fg); }
.empty p { margin: 0; font-size: 15px; max-width: 290px; }

/* sparks for a strong like */
.burst { position: absolute; z-index: 30; left: 50%; top: 45%; width: 0; height: 0; pointer-events: none; }
.burst i { position: absolute; width: 8px; height: 8px; margin: -4px; border-radius: 50%; animation: spark .85s cubic-bezier(.15, .8, .3, 1) forwards; }
@keyframes spark { 0% { transform: translate(0, 0) scale(1.4); opacity: 1; } 100% { transform: translate(var(--dx), var(--dy)) scale(0); opacity: 0; } }
.love-word { position: absolute; left: -45px; top: -50px; width: 90px; text-align: center; font-size: 76px; line-height: 100px; animation: pop .95s var(--spring) forwards; }
@keyframes pop { 0% { transform: scale(.4); opacity: 0; } 25% { transform: scale(1.2); opacity: 1; } 70% { transform: scale(1); opacity: 1; } 100% { transform: translateY(-30px) scale(.9); opacity: 0; } }

/* reasons after a no: a row of chips above the dock */
.reasons { position: fixed; z-index: 25; left: 0; right: 0; bottom: calc(var(--safe-b) + 150px); padding: 0 14px; display: flex; justify-content: center;
  opacity: 0; transform: translateY(14px); pointer-events: none; transition: opacity .2s var(--ease), transform .35s var(--ease); }
.reasons.on { opacity: 1; transform: none; pointer-events: auto; }
.chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 7px; }
.chips button { height: 36px; padding: 0 14px; border-radius: 18px; font-size: 14.5px; font-weight: 600; background: rgba(28, 28, 31, .82);
  -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); box-shadow: inset 0 0 0 .5px rgba(255, 255, 255, .16); transition: transform .12s var(--ease), background-color .2s; }
.chips button:active { transform: scale(.95); }
.chips button.on { background: var(--nope); }

/* toast: comes down from the top, leaves fully */
.toast { position: fixed; z-index: 40; left: 50%; top: calc(var(--safe-t) + 10px); height: 42px; padding: 0 6px 0 16px; border-radius: 21px; display: flex; align-items: center; gap: 12px;
  font-size: 14.5px; font-weight: 600; white-space: nowrap; background: rgba(28, 28, 31, .94); box-shadow: inset 0 0 0 .5px rgba(255, 255, 255, .14), 0 12px 34px rgba(0, 0, 0, .55);
  transform: translate(-50%, calc(-100% - var(--safe-t) - 30px)); opacity: 0; transition: transform .42s var(--spring), opacity .2s; pointer-events: none; }
.toast.on { transform: translate(-50%, 0); opacity: 1; pointer-events: auto; }
.toast button { height: 32px; padding: 0 11px 0 9px; border-radius: 16px; display: flex; align-items: center; gap: 5px; font-size: 14px; font-weight: 650; color: var(--accent); background: rgba(255, 255, 255, .07); }
.toast button svg.i { width: 16px; height: 16px; }

/* ---------------- item: a full-screen sheet ---------------- */
.scrim { position: fixed; z-index: 45; inset: 0; background: #000; opacity: 0; pointer-events: none; }
.scrim.on { pointer-events: auto; }
.sheet { position: fixed; z-index: 46; inset: 0; background: var(--bg); border-radius: 46px 46px 0 0; overflow: hidden; transform: translateY(105%); will-change: transform; }
.grabber { position: absolute; z-index: 3; left: 50%; top: calc(var(--safe-t) + 6px); width: 40px; height: 5px; margin-left: -20px; border-radius: 3px; background: rgba(255, 255, 255, .7); box-shadow: 0 1px 6px rgba(0, 0, 0, .4); }
.sheet-body { position: absolute; inset: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; padding-bottom: calc(var(--safe-b) + 100px); }
.gallery { position: relative; }
.pager { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.pager::-webkit-scrollbar { display: none; }
.pager img { flex: none; width: 100%; aspect-ratio: 4 / 5; object-fit: cover; scroll-snap-align: center; background: #0b0b0c; }
.pager img.blur { filter: blur(16px); }
.dots { position: absolute; left: 0; right: 0; bottom: 14px; display: flex; justify-content: center; gap: 6px; }
.dots i { width: 6px; height: 6px; border-radius: 3px; background: rgba(255, 255, 255, .4); transition: width .3s var(--ease), background-color .3s; }
.dots i.on { width: 18px; background: #fff; }
.gallery::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(180deg, rgba(0,0,0,.45), transparent 18%, transparent 80%, rgba(0,0,0,.6)); }
.d-head { padding: 18px 20px 4px; }
.d-eyebrow { font-size: 12px; font-weight: 650; letter-spacing: .13em; text-transform: uppercase; color: var(--fg3); }
.d-brand { margin-top: 6px; font-size: 36px; font-weight: 800; letter-spacing: -.04em; line-height: 1; }
.d-title { margin-top: 8px; font-size: 16px; color: var(--fg2); }
.d-price { display: flex; align-items: baseline; gap: 10px; margin-top: 14px; }
.d-price .price { font-size: 32px; }
.d-sub { font-size: 14px; color: var(--fg2); }
.skeleton { width: 55%; height: 34px; border-radius: 10px; background: var(--s2); }
.d-card { margin: 12px 16px 0; padding: 15px 16px; border-radius: 22px; background: var(--s1); box-shadow: inset 0 0 0 .5px var(--hair); }
.d-card h4 { margin: 0 0 6px; display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 650; letter-spacing: .12em; text-transform: uppercase; color: var(--fg3); }
.d-card p { margin: 0; font-size: 15.5px; line-height: 1.4; }
.why-card { background: linear-gradient(160deg, rgba(200, 255, 61, .13), rgba(200, 255, 61, .03) 60%), var(--s1); box-shadow: inset 0 0 0 .5px rgba(200, 255, 61, .22); }
.why-card h4 { color: var(--accent); }
.d-score { height: 22px; padding: 0 8px; border-radius: 11px; display: inline-grid; place-items: center; background: var(--accent); color: var(--ink); letter-spacing: 0; font-size: 12px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; font-size: 15px; }
.kv dt { color: var(--fg3); }
.kv dd { margin: 0; text-align: right; }
.d-desc { white-space: pre-line; color: var(--fg2); font-size: 15px; }
.d-desc.clamp { display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; }
.more { margin-top: 6px; font-size: 15px; font-weight: 650; color: var(--accent); }
.d-section { margin: 26px 20px 10px; font-size: 20px; font-weight: 750; letter-spacing: -.02em; }
.d-similar { display: flex; gap: 10px; overflow-x: auto; padding: 0 16px 2px; scrollbar-width: none; scroll-snap-type: x proximity; }
.d-similar::-webkit-scrollbar { display: none; }
.d-similar button { flex: none; width: 128px; text-align: left; scroll-snap-align: start; transition: transform .15s var(--ease); }
.d-similar button:active { transform: scale(.96); }
.d-similar img { width: 128px; height: 160px; border-radius: 18px; object-fit: cover; background: var(--s2); display: block; }
.d-similar b { display: block; margin-top: 7px; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.d-similar span { font-size: 14px; color: var(--fg2); font-variant-numeric: tabular-nums; }
.d-bar { position: fixed; z-index: 47; left: 12px; right: 12px; bottom: calc(var(--safe-b) + 8px); display: flex; gap: 8px; padding: 6px; border-radius: 32px;
  background: rgba(24, 24, 27, .78); -webkit-backdrop-filter: blur(24px) saturate(170%); backdrop-filter: blur(24px) saturate(170%);
  box-shadow: inset 0 0 0 .5px rgba(255, 255, 255, .14), 0 12px 32px rgba(0, 0, 0, .55); transform: translateY(140%); transition: transform .5s var(--spring); }
.sheet.open .d-bar { transform: none; }
.btn { height: 52px; border-radius: 26px; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 0 18px; font-size: 16.5px; font-weight: 650;
  background: rgba(255, 255, 255, .1); text-decoration: none; color: inherit; transition: transform .14s var(--ease), background-color .2s; }
.btn:active { transform: scale(.96); }
.btn.primary { flex: 1; background: #fff; color: #000; }
.btn.round { width: 52px; padding: 0; }
.btn svg.i { width: 21px; height: 21px; }
.btn.saved { color: var(--gold); }
.btn.saved svg.i { fill: currentColor; }

/* share */
.share { position: fixed; z-index: 60; inset: 0; display: flex; align-items: flex-end; justify-content: center; padding: 0 12px calc(var(--safe-b) + 12px);
  background: rgba(0, 0, 0, .6); opacity: 0; pointer-events: none; transition: opacity .25s var(--ease); }
.share.on { opacity: 1; pointer-events: auto; }
.share-card { width: min(420px, 100%); padding: 12px; border-radius: 36px; background: var(--s1); box-shadow: inset 0 0 0 .5px var(--hair), 0 20px 60px rgba(0,0,0,.6);
  transform: translateY(40px) scale(.97); transition: transform .5s var(--spring); }
.share.on .share-card { transform: none; }
.share-card img { display: block; width: 100%; aspect-ratio: 4 / 5; border-radius: 26px; background: var(--s2); object-fit: cover; }
.share-buttons { display: flex; flex-direction: column; gap: 8px; padding-top: 12px; }
.share-buttons .row2 { display: flex; gap: 8px; }
.share-buttons .row2 .btn { flex: 1; }
.share-note { margin: 4px 8px 2px; font-size: 13px; color: var(--fg3); text-align: center; }

/* ---------------- pages ---------------- */
.seg { display: inline-flex; padding: 3px; border-radius: 18px; background: var(--s2); margin-bottom: 14px; }
.seg button { height: 32px; padding: 0 14px; border-radius: 15px; font-size: 14px; font-weight: 600; color: var(--fg2); transition: background-color .2s, color .2s; }
.seg button.on { background: var(--s3); color: #fff; box-shadow: 0 2px 8px rgba(0, 0, 0, .35); }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 12px; }
.tile { text-align: left; animation: rise .45s var(--ease) both; animation-delay: calc(var(--i, 0) * 30ms); transition: transform .15s var(--ease); content-visibility: auto; contain-intrinsic-size: auto 280px; }
.tile:active { transform: scale(.97); }
.tile .t-img { position: relative; aspect-ratio: 4 / 5; border-radius: 22px; overflow: hidden; background: var(--s2); }
.tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tile .t-drop { position: absolute; left: 8px; top: 8px; height: 24px; padding: 0 8px; border-radius: 12px; display: inline-flex; align-items: center; font-size: 12.5px; font-weight: 750; background: var(--accent); color: var(--ink); }
.tile .t-brand { margin-top: 9px; font-size: 15px; font-weight: 700; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile .t-sub { font-size: 14px; color: var(--fg2); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } }

.search { display: flex; align-items: center; gap: 10px; height: 48px; padding: 0 8px 0 14px; border-radius: 24px; background: var(--s2); color: var(--fg3); margin-bottom: 16px; box-shadow: inset 0 0 0 .5px var(--hair); }
.search input { flex: 1; min-width: 0; background: none; border: 0; outline: 0; color: var(--fg); font: inherit; font-size: 17px; }
.search input::placeholder { color: var(--fg3); }
.cam { width: 36px; height: 36px; border-radius: 18px; display: grid; place-items: center; color: var(--accent); background: rgba(200, 255, 61, .1); }
.cam:active { transform: scale(.9); }
.cam svg.i { width: 20px; height: 20px; }
.hint-card { width: 100%; display: flex; gap: 14px; align-items: center; text-align: left; padding: 16px; border-radius: 22px; background: var(--s1); box-shadow: inset 0 0 0 .5px var(--hair); transition: transform .15s var(--ease); }
.hint-card:active { transform: scale(.98); }
.hint-card > svg.i { width: 30px; height: 30px; color: var(--accent); }
.hint-card b { display: block; font-size: 16px; }
.hint-card span { font-size: 14px; color: var(--fg2); }
.quick { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.quick button { height: 36px; padding: 0 14px; border-radius: 18px; font-size: 14.5px; font-weight: 600; background: var(--s2); color: var(--fg2); transition: transform .12s var(--ease); }
.quick button:active { transform: scale(.95); }
.list { display: flex; flex-direction: column; }
.li { width: 100%; display: flex; gap: 14px; align-items: center; text-align: left; padding: 10px 0; box-shadow: inset 0 -.5px 0 var(--hair); content-visibility: auto; contain-intrinsic-size: auto 96px; }
.li img { width: 62px; height: 78px; border-radius: 14px; object-fit: cover; background: var(--s2); flex: none; }
.li > div { flex: 1; min-width: 0; }
.li b, .li span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.li b { font-size: 16px; }
.li span { font-size: 14px; color: var(--fg2); }
.li .sim { flex: none; font-size: 14px; font-weight: 750; color: var(--accent); font-variant-numeric: tabular-nums; }
.query-photo { width: 72px; height: 90px; border-radius: 16px; object-fit: cover; margin-bottom: 12px; box-shadow: 0 0 0 2px var(--accent); }
.search-msg { padding: 20px 4px; font-size: 15px; color: var(--fg3); }

.group { margin-bottom: 26px; }
.group-title { margin: 0 4px 10px; font-size: 20px; font-weight: 750; letter-spacing: -.02em; }
.rows { border-radius: 22px; overflow: hidden; background: var(--s1); box-shadow: inset 0 0 0 .5px var(--hair); }
.r { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 0 16px; font-size: 16px; }
.r + .r { box-shadow: inset 0 .5px 0 var(--hair); }
.r .dot { width: 8px; height: 8px; border-radius: 4px; background: var(--fg3); flex: none; }
.r .dot.ok { background: var(--accent); box-shadow: 0 0 8px rgba(200, 255, 61, .7); }
.r .dot.limited { background: #ffb340; }
.r .dot.blocked, .r .dot.error { background: var(--nope); }
.r .v { margin-left: auto; color: var(--fg2); font-size: 15px; font-variant-numeric: tabular-nums; text-align: right; }
.r-name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.meter { width: 90px; height: 5px; border-radius: 3px; background: rgba(255, 255, 255, .08); overflow: hidden; flex: none; }
.meter i { display: block; height: 100%; width: var(--p); border-radius: 3px; background: var(--accent); transform-origin: left; animation: grow .8s var(--ease) both; }
@keyframes grow { from { transform: scaleX(0); } }
.pct { width: 42px; text-align: right; font-size: 14px; color: var(--fg2); font-variant-numeric: tabular-nums; }

.hero { padding: 22px 20px 20px; margin-bottom: 26px; border-radius: 28px; background: radial-gradient(120% 90% at 100% 0%, rgba(200, 255, 61, .16), transparent 55%), var(--s1);
  box-shadow: inset 0 0 0 .5px var(--hair); }
.hero-n { display: flex; align-items: baseline; gap: 10px; }
.hero-n b { font-size: 64px; font-weight: 800; letter-spacing: -.055em; line-height: .9; font-variant-numeric: tabular-nums; }
.hero-n span { font-size: 17px; color: var(--fg2); }
.hero-split { display: flex; gap: 8px; margin-top: 16px; }
.hero-split span { flex: 1; height: 58px; border-radius: 18px; display: flex; flex-direction: column; justify-content: center; padding: 0 12px; background: var(--s2);
  font-size: 12px; font-weight: 600; color: var(--fg3); letter-spacing: .04em; text-transform: uppercase; }
.hero-split span b { font-size: 22px; letter-spacing: -.02em; color: var(--fg); text-transform: none; font-variant-numeric: tabular-nums; }
.hero-split .love b { color: var(--gold); }
.hero p { margin: 14px 0 0; font-size: 14px; color: var(--fg2); }
.refs { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 0 16px; }
.refs::-webkit-scrollbar { display: none; }
.refs img { flex: none; width: 104px; height: 138px; object-fit: cover; border-radius: 18px; background: var(--s2); }
.price-band { padding: 20px 16px 16px; border-radius: 22px; background: var(--s1); box-shadow: inset 0 0 0 .5px var(--hair); }
.pb-track { position: relative; height: 6px; border-radius: 3px; background: rgba(255, 255, 255, .08); }
.pb-track i { position: absolute; top: 0; bottom: 0; border-radius: 3px; background: var(--accent); }
.pb-track b { position: absolute; top: -6px; width: 18px; height: 18px; margin-left: -9px; border-radius: 50%; background: #fff; box-shadow: 0 2px 10px rgba(0, 0, 0, .6); }
.pb-labels { display: flex; justify-content: space-between; margin-top: 14px; font-size: 14px; color: var(--fg2); font-variant-numeric: tabular-nums; }
.pb-labels .mid { color: var(--fg); font-weight: 700; }
.pb-note { margin-top: 6px; font-size: 13px; color: var(--fg3); }
.pills { display: flex; flex-wrap: wrap; gap: 7px; }
.pills span { padding: 7px 12px; border-radius: 15px; font-size: 14px; background: var(--s2); }
.pills.cold span { color: #ff8a80; background: rgba(255, 69, 58, .1); }
.pills.styles span { font-size: 13px; color: var(--fg2); }

[hidden], [hidden] *, .screen:not(.active) * { animation: none !important; }
@media (prefers-reduced-motion: reduce) {
  .screen, .toast, .reasons, .fresh, .tab-pill, .share-card, .d-bar, .dock { transition: opacity .2s ease !important; transform: none !important; }
  .sheen, .card .photo img { transform: none !important; }
  .tile, .meter i, .hud-pill.bump, .act.yes.pop svg.i { animation: none !important; }
}
/* hidden screens are not drawn at all (visibility flips after the fade), pages have a solid floor */
.screen { visibility: hidden; transition: opacity .22s var(--ease), transform .32s var(--ease), visibility 0s linear .32s; }
.screen.active { visibility: visible; transition: opacity .22s var(--ease), transform .32s var(--ease), visibility 0s; }
.page { background: var(--bg); }

/* ===================================================================== round 4 =====
   Springs for CSS: app.js writes --spring/--bounce/--snap as linear() curves sampled from real springs
   (Apple's damping + response) with their settle times; the fallbacks below are close cubic curves. */
:root { --spring: cubic-bezier(.2, .8, .2, 1); --spring-ms: 520ms; --bounce: cubic-bezier(.2, .9, .25, 1.15); --bounce-ms: 640ms;
  --snap: cubic-bezier(.2, .8, .2, 1); --snap-ms: 360ms; }
html { -webkit-text-size-adjust: 100%; }
button, a, .tile, .li { -webkit-touch-callout: none; }
.screen { transition: opacity .26s var(--ease), transform var(--spring-ms) var(--spring), visibility 0s linear var(--spring-ms); }
.screen.active { transition: opacity .26s var(--ease), transform var(--spring-ms) var(--spring), visibility 0s; }
.tab-pill { transition: transform var(--bounce-ms) var(--bounce); }

/* ---- the island: one living pill at the top for the count, news and every message ---- */
.island { position: fixed; z-index: 70; left: 50%; top: calc(var(--safe-t) + 14px); height: 34px; max-width: calc(100% - 140px); padding: 0 14px 0 12px;
  display: flex; align-items: center; gap: 8px; border-radius: 17px; transform: translateX(-50%); white-space: nowrap; pointer-events: none;
  background: rgba(0, 0, 0, .58); -webkit-backdrop-filter: blur(20px) saturate(160%); backdrop-filter: blur(20px) saturate(160%);
  box-shadow: inset 0 0 0 .5px rgba(255, 255, 255, .16); font-size: 14px; font-weight: 650; font-variant-numeric: tabular-nums;
  transition: height var(--bounce-ms) var(--bounce), padding var(--bounce-ms) var(--bounce), border-radius var(--bounce-ms) var(--bounce),
    background-color .3s, color .3s, opacity .25s, transform var(--bounce-ms) var(--bounce); }
.island-text { overflow: hidden; text-overflow: ellipsis; transition: opacity .2s, filter .2s; }
.island-icon { display: grid; place-items: center; }
.island-icon svg.i { width: 18px; height: 18px; stroke-width: 2.2; }
.island .live { width: 7px; height: 7px; border-radius: 4px; background: var(--fg3); }
.island .live.on { background: var(--accent); box-shadow: 0 0 8px var(--accent); }
.island.msg { height: 44px; padding: 0 18px 0 14px; border-radius: 22px; font-size: 15px; transform: translateX(-50%) scale(1.02); background: rgba(10, 10, 12, .9);
  max-width: calc(100% - 28px); }
.island.msg .island-text { animation: inkIn .35s var(--ease); }
@keyframes inkIn { from { opacity: 0; filter: blur(4px); } }
.island[data-tone="like"] .island-icon, .island[data-tone="new"] .island-icon { color: var(--accent); }
.island[data-tone="love"] .island-icon, .island[data-tone="save"] .island-icon { color: var(--gold); }
.island[data-tone="dislike"] .island-icon, .island[data-tone="bad"] .island-icon { color: var(--nope); }
body:not([data-tab="feed"]) .island:not(.msg) { opacity: 0; transform: translateX(-50%) translateY(-8px) scale(.9); }
body:has(.sheet.open) .island:not(.msg) { opacity: 0; }

/* ---- card: corner row; the photo is shown whole when its shape is far from the screen ---- */
.corner { position: absolute; z-index: 4; left: 16px; right: 16px; top: calc(var(--safe-t) + 14px); display: flex; align-items: center; justify-content: space-between; pointer-events: none; }
.corner .score { position: static; display: flex; height: 34px; padding: 0 12px 0 10px; border-radius: 17px; gap: 5px; align-items: center; font-size: 15px; font-weight: 750;
  background: rgba(0, 0, 0, .45); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); box-shadow: inset 0 0 0 .5px rgba(255, 255, 255, .16); }
.share-btn { position: relative; pointer-events: auto; width: 34px; height: 34px; border-radius: 17px; display: grid; place-items: center;
  background: rgba(0, 0, 0, .45); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); box-shadow: inset 0 0 0 .5px rgba(255, 255, 255, .16);
  transition: transform .14s var(--ease); }
.share-btn::after { content: ""; position: absolute; inset: -12px; }   /* a finger-sized target around a small button */
.share-btn:active { transform: scale(.88); }
.share-btn svg.i { width: 18px; height: 18px; stroke-width: 2; }
.card .flags { top: calc(var(--safe-t) + 58px); right: auto; left: 16px; align-items: flex-start; }
.card .flags .flag { background: rgba(0, 0, 0, .45); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); }
.bars { top: calc(var(--safe-t) + 4px); }
.card.fit .photo img.lo { filter: blur(30px) saturate(1.3) brightness(.55); }
.card.fit .photo img.hi { inset: calc(var(--safe-t) + 58px) 10px calc(var(--safe-b) + 268px) 10px; width: auto; height: auto; object-fit: contain;
  filter: drop-shadow(0 18px 40px rgba(0, 0, 0, .55)); }
.card.zooming .meta, .card.zooming .corner, .card.zooming .bars { opacity: 0; transition: opacity .18s; }
.card .meta, .card .corner { transition: opacity .25s var(--ease); }
.photo { transform-origin: 50% 50%; will-change: transform; }
.meta { bottom: calc(var(--safe-b) + 168px); }
.brand.s { font-size: 36px; letter-spacing: -.04em; }
.brand.xs { font-size: 30px; letter-spacing: -.03em; }
.stamp .mark { transform: scale(var(--mark, .6)); }

/* ---- the dock: the undo button grows in; the reasons take the place of the buttons ---- */
.dock { bottom: calc(var(--safe-b) + 76px); height: 72px; }
.dock-main, .dock-why { position: absolute; inset: 0; display: flex; justify-content: center; align-items: center; }
.dock-main { gap: 14px; transition: opacity .22s var(--ease), transform var(--bounce-ms) var(--bounce), filter .22s; }
.dock.why .dock-main { opacity: 0; transform: scale(.86); filter: blur(6px); pointer-events: none; }
.dock-why { flex-direction: column; gap: 8px; opacity: 0; pointer-events: none; transform: translateY(10px) scale(.96);
  transition: opacity .22s var(--ease), transform var(--bounce-ms) var(--bounce); }
.dock.why .dock-why { opacity: 1; transform: none; pointer-events: auto; }
.why-title { font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: rgba(255, 255, 255, .6); }
.why-row { display: flex; gap: 6px; padding: 0 12px; flex-wrap: nowrap; }
.why-row button { height: 42px; padding: 0 14px; border-radius: 21px; font-size: 15px; font-weight: 650; background: rgba(30, 30, 33, .82);
  -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); box-shadow: inset 0 0 0 .5px rgba(255, 255, 255, .18);
  opacity: 0; transform: translateY(8px) scale(.9); transition: opacity .2s, transform var(--bounce-ms) var(--bounce), background-color .2s; }
.dock.why .why-row button { opacity: 1; transform: none; }
.dock.why .why-row button:nth-child(2) { transition-delay: 30ms; }
.dock.why .why-row button:nth-child(3) { transition-delay: 60ms; }
.dock.why .why-row button:nth-child(4) { transition-delay: 90ms; }
.dock.why .why-row button:nth-child(5) { transition-delay: 120ms; }
.why-row button:active { transform: scale(.93); }
.why-row button.on { background: var(--nope); }
.act { width: 64px; height: 64px; border-radius: 32px;
  transition: transform .16s var(--ease), width var(--bounce-ms) var(--bounce), margin var(--bounce-ms) var(--bounce), opacity .2s, background-color .2s;
  background: linear-gradient(180deg, rgba(255, 255, 255, .16), rgba(255, 255, 255, .06)); }
.act svg.i { width: 28px; height: 28px; stroke-width: 2.2; }
.act:active { transform: scale(.88); }
.act.no { color: #fff; }
.act.yes { width: 72px; height: 72px; border-radius: 36px; background: linear-gradient(180deg, #fff, #e6e6e6); color: #000;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .45), inset 0 -2px 0 rgba(0, 0, 0, .08); }
.act.yes svg.i { width: 31px; height: 31px; }
.act.save { width: 52px; height: 52px; border-radius: 26px; color: var(--gold); }
.act.undo { position: relative; width: 0; height: 52px; margin-right: -14px; opacity: 0; overflow: hidden; color: #fff; pointer-events: none; }
.dock.undo .act.undo { width: 52px; margin-right: 0; opacity: 1; pointer-events: auto; }
.act.undo svg.i { width: 22px; height: 22px; }
.act.undo .ring { position: absolute; inset: 4px; width: 44px; height: 44px; transform: rotate(-90deg); fill: none; stroke: rgba(255, 255, 255, .5); stroke-width: 2;
  stroke-dasharray: 125.7; stroke-dashoffset: 0; }
.dock.undo .act.undo .ring { animation: countdown 5s linear forwards; }
@keyframes countdown { to { stroke-dashoffset: 125.7; } }

/* ---- long-press menu: the card sinks, a menu rises under it ---- */
.menu { position: fixed; z-index: 65; inset: 0; display: flex; align-items: flex-end; padding: 0 12px calc(var(--safe-b) + 12px);
  background: rgba(0, 0, 0, .45); opacity: 0; pointer-events: none; transition: opacity .22s var(--ease); }
.menu.on { opacity: 1; pointer-events: auto; }
.menu-card { width: 100%; padding: 6px; border-radius: 30px; background: rgba(28, 28, 31, .9); -webkit-backdrop-filter: blur(30px) saturate(170%);
  backdrop-filter: blur(30px) saturate(170%); box-shadow: inset 0 0 0 .5px rgba(255, 255, 255, .14), 0 20px 60px rgba(0, 0, 0, .6);
  transform: translateY(30px) scale(.95); transform-origin: 50% 100%; transition: transform var(--bounce-ms) var(--bounce); }
.menu.on .menu-card { transform: none; }
.menu-head { padding: 12px 14px 10px; }
.menu-head b { display: block; font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.menu-head span { font-size: 14px; color: var(--fg2); }
.menu-card button { width: 100%; height: 56px; display: flex; align-items: center; gap: 14px; padding: 0 16px; border-radius: 22px; font-size: 17px; font-weight: 550;
  text-align: left; transition: background-color .15s; }
.menu-card button:active { background: rgba(255, 255, 255, .1); }
.menu-card button svg.i { width: 22px; height: 22px; color: var(--fg2); }

/* ---- sheet and share use the springs too ---- */
.d-bar { transition: transform var(--bounce-ms) var(--bounce); }
.share-card { transition: transform var(--bounce-ms) var(--bounce); }
.share-card img { opacity: 0; transition: opacity .3s var(--ease); }
.share-card img.ready { opacity: 1; }
.pager img { transform-origin: 50% 50%; will-change: transform; }
.pager img.zoomed { position: relative; z-index: 2; }
.d-card h4 svg.i { width: 15px; height: 15px; }
.li { animation: rise .4s var(--ease) both; animation-delay: calc(var(--i, 0) * 25ms); }
input, textarea { font-size: 17px; }
.why-row { gap: 5px; padding: 0 8px; max-width: 100vw; }
.why-row button { height: 40px; padding: 0 11px; font-size: 14px; }
