:root {
  font-family: "DM Sans", sans-serif;
  color: #302b32;
  background: #f4f2f4;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  --pink: #fd5068;
  --pink-dark: #e83d5b;
  --muted: #8c858e;
}

* { box-sizing: border-box; }
html, body { width: 100%; min-width: 320px; min-height: 100%; margin: 0; }
body { min-height: 100vh; display: grid; place-items: center; background: radial-gradient(ellipse at 50% 40%, #fff 0%, #f5f2f5 68%, #eee9ee 100%); }
button, a { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }

.app-shell {
  position: relative;
  width: min(100%, 480px);
  height: min(900px, 100dvh);
  min-height: 600px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 18px 70px rgba(49, 31, 47, .12);
}
.app-header {
  flex: 0 0 62px;
  display: grid;
  grid-template-columns: 1fr auto 38px;
  align-items: center;
  gap: 12px;
  padding: 0 17px;
  border-bottom: 1px solid #f4f1f3;
  background: rgba(255,255,255,.97);
  z-index: 2;
}
.brand { display: inline-flex; align-items: center; gap: 5px; width: fit-content; color: #29232b; font: 800 24px/1 "Manrope", sans-serif; letter-spacing: -1.7px; }
.brand-mark { color: var(--pink); font-size: 21px; }
.brand-accent { color: var(--pink); }
.location-button {
  min-width: 0; display: inline-flex; align-items: center; gap: 5px; padding: 8px 10px;
  border: 0; border-radius: 30px; color: #726b73; background: #f7f5f7; font-size: 11px; font-weight: 700; cursor: default;
}
.location-button svg { width: 13px; fill: none; stroke: var(--pink); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.header-button { width: 36px; height: 36px; display: grid; place-items: center; border: 0; border-radius: 50%; color: #77707a; background: transparent; cursor: pointer; }
.header-button:hover { color: var(--pink); background: #fff1f3; }
.header-button svg { width: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.distance-banner { flex: 0 0 auto; display: flex; align-items: flex-start; gap: 8px; padding: 9px 14px; color: #775c19; background: #fff3cc; font-size: 10px; line-height: 1.4; }
.distance-banner[hidden] { display: none; }
.distance-banner p { margin: 0; }
.banner-icon { flex: 0 0 15px; width: 15px; height: 15px; display: grid; place-items: center; margin-top: 1px; border-radius: 50%; color: white; background: #dfa92f; font-size: 10px; font-weight: 800; }
.distance-banner.is-warning { color: #775c19; background: #fff3cc; }
.distance-banner.is-warning .banner-icon { background: #dfa92f; }
.distance-banner.is-success { color: #286b4d; background: #eaf8ef; }
.distance-banner.is-success .banner-icon { background: #42a875; }
.distance-banner.is-info { color: #625a69; background: #f3eff5; }
.distance-banner.is-info .banner-icon { background: #91859a; }

.discover-screen { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 12px 15px 0; }
.discovery-bar { flex: 0 0 35px; display: flex; align-items: center; justify-content: space-between; padding: 0 2px 5px; }
.discovery-bar > div { display: flex; align-items: center; gap: 8px; }
.online-dot { width: 8px; height: 8px; border-radius: 50%; background: #30c982; box-shadow: 0 0 0 3px #e6f9ef; }
.discovery-bar h1 { margin: 0; color: #3a333a; font: 800 17px "Manrope", sans-serif; letter-spacing: -.3px; }
.distance-pill { padding: 5px 9px; border: 1px solid #efeaf0; border-radius: 20px; color: #8a828a; background: #faf8fa; font-size: 9px; font-weight: 700; white-space: nowrap; }
.card-area { position: relative; flex: 1; min-height: 0; margin-bottom: 2px; }
.profile-card, .card-shadow { position: absolute; inset: 3px 1px 5px; overflow: hidden; border-radius: 19px; }
.card-shadow { background: #fff; box-shadow: 0 5px 18px rgba(54, 37, 51, .08); }
.card-shadow-back { inset: 0 12px 10px; transform: scale(.965) translateY(-5px); background: #f7f4f6; }
.card-shadow-front { inset: 2px 6px 7px; transform: scale(.985) translateY(-2px); background: #fbf9fb; }
.profile-card { z-index: 1; background: #e8dfdf; box-shadow: 0 8px 24px rgba(46, 31, 43, .14); touch-action: pan-y; user-select: none; cursor: grab; transition: transform .22s ease, box-shadow .22s ease; }
.profile-card.is-dragging { transition: none; cursor: grabbing; }
.profile-card.swipe-right { transform: translateX(120%) rotate(18deg) !important; opacity: .2; }
.profile-card.swipe-left { transform: translateX(-120%) rotate(-18deg) !important; opacity: .2; }
.profile-photo { width: 100%; height: 100%; display: block; object-fit: cover; object-position: center 24%; pointer-events: none; }
.photo-overlay { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(20,15,20,.17) 0%, transparent 20%, transparent 45%, rgba(12,9,12,.16) 58%, rgba(12,9,12,.83) 100%); pointer-events: none; }
.profile-top { position: absolute; top: 13px; right: 13px; left: 13px; display: flex; justify-content: space-between; align-items: center; }
.adoption-badge { display: inline-flex; align-items: center; gap: 6px; padding: 8px 11px; border: 1px solid rgba(255,255,255,.32); border-radius: 30px; color: white; background: rgba(30,25,30,.35); backdrop-filter: blur(10px); font-size: 9px; font-weight: 800; letter-spacing: .15px; }
.adoption-badge span:first-child { color: #ff8296; font-size: 12px; }
.photo-info-button { width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.36); border-radius: 50%; color: white; background: rgba(30,25,30,.33); backdrop-filter: blur(10px); cursor: pointer; }
.photo-info-button svg { width: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.profile-copy { position: absolute; right: 18px; bottom: 17px; left: 18px; color: white; pointer-events: none; }
.name-row { display: flex; align-items: center; gap: 9px; }
.name-row h2 { display: flex; align-items: baseline; gap: 8px; margin: 0; font: 800 clamp(28px, 7vw, 36px)/1.1 "Manrope", sans-serif; letter-spacing: -.9px; text-shadow: 0 1px 10px rgba(0,0,0,.12); }
.cat-age { font: 500 24px/1 "DM Sans", sans-serif; }
.verified { width: 17px; height: 17px; flex: 0 0 17px; display: grid; place-items: center; border-radius: 50%; color: white; background: #36a9e9; font: 800 11px sans-serif; }
.cat-meta { display: flex; align-items: center; gap: 6px; margin: 7px 0 11px; color: rgba(255,255,255,.92); font-size: 11px; font-weight: 600; }
.cat-meta svg { width: 13px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.meta-divider { opacity: .65; }
.cat-bio { max-width: 390px; margin: 0 0 12px; color: rgba(255,255,255,.93); font-size: 11px; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.traits { display: flex; flex-wrap: wrap; gap: 6px; }
.trait { padding: 6px 9px; border: 1px solid rgba(255,255,255,.28); border-radius: 20px; color: white; background: rgba(255,255,255,.14); backdrop-filter: blur(6px); font-size: 9px; font-weight: 700; }
.swipe-stamp { position: absolute; top: 66px; padding: 6px 11px; border: 3px solid; border-radius: 6px; font: 800 20px/1 "Manrope", sans-serif; letter-spacing: 1px; opacity: 0; transition: opacity .1s ease; transform: rotate(-12deg); }
.stamp-nope { left: 19px; color: #ff536a; border-color: #ff536a; }
.stamp-like { right: 19px; color: #65d8a0; border-color: #65d8a0; transform: rotate(12deg); }
.swipe-stamp.is-visible { opacity: 1; }
.gesture-hint { flex: 0 0 20px; display: flex; justify-content: center; align-items: center; gap: 8px; color: #aaa2aa; font-size: 9px; font-weight: 600; }
.hint-arrow { color: #f5a1ad; font-size: 16px; }
.hint-heart { color: var(--pink); font-size: 11px; }
.action-dock { flex: 0 0 75px; display: flex; align-items: center; justify-content: center; gap: clamp(12px, 4vw, 21px); }
.action-button { display: grid; flex: 0 0 auto; place-items: center; border: 0; border-radius: 50%; background: white; cursor: pointer; box-shadow: 0 3px 12px rgba(39, 27, 38, .12); transition: transform .16s ease, box-shadow .16s ease; }
.action-button:hover { transform: translateY(-3px) scale(1.05); box-shadow: 0 6px 15px rgba(39, 27, 38, .16); }
.action-button:active { transform: scale(.94); }
.action-button svg { width: 20px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.rewind-button, .boost-button { width: 39px; height: 39px; }
.rewind-button { color: #edbf4b; }
.boost-button { color: #a45ce5; }
.pass-button, .super-button { width: 49px; height: 49px; }
.pass-button { color: #ff536a; }
.pass-button svg { width: 22px; }
.super-button { color: #36a9ee; }
.super-button svg { width: 22px; }
.like-button { width: 59px; height: 59px; color: white; background: linear-gradient(145deg, #ff7184, #fa3f64); box-shadow: 0 6px 17px rgba(244, 62, 99, .32); }
.like-button:hover { box-shadow: 0 8px 22px rgba(244, 62, 99, .4); }
.like-button svg { width: 28px; stroke: white; stroke-width: 2; }

.bottom-nav { flex: 0 0 61px; display: grid; grid-template-columns: repeat(4, 1fr); align-items: center; border-top: 1px solid #f1eef1; background: rgba(255,255,255,.98); }
.nav-item { position: relative; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; border: 0; color: #a49da5; background: transparent; font-size: 9px; font-weight: 700; cursor: pointer; }
.nav-item svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.nav-item.is-active { color: var(--pink); }
.nav-item.is-active::before { position: absolute; top: 0; width: 35px; height: 2px; border-radius: 2px; background: var(--pink); content: ""; }
.nav-item.is-active svg { fill: currentColor; }

.toast { position: fixed; z-index: 5; bottom: max(75px, calc((100vh - 900px)/2 + 72px)); left: 50%; width: max-content; max-width: calc(100vw - 32px); padding: 12px 16px; border-radius: 24px; color: white; background: #302831; box-shadow: 0 6px 20px rgba(32,23,31,.2); font-size: 11px; text-align: center; opacity: 0; pointer-events: none; transform: translate(-50%, 10px); transition: .22s ease; }
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }
.contact-dialog { position: relative; width: min(410px, calc(100% - 30px)); max-height: min(85dvh, 700px); overflow-y: auto; padding: 28px 25px 24px; border: 1px solid #f2eaf0; border-radius: 24px; color: #302b32; background: white; box-shadow: 0 20px 70px rgba(39,25,38,.22); text-align: center; }
.contact-dialog::backdrop { background: rgba(34,24,34,.5); backdrop-filter: blur(3px); }
.dialog-close { position: absolute; top: 10px; right: 14px; width: 30px; height: 30px; border: 0; border-radius: 50%; color: #8b818a; background: #f7f4f6; font-size: 23px; line-height: 1; cursor: pointer; }
.dialog-heart { width: 42px; height: 42px; display: grid; place-items: center; margin: 0 auto 14px; border-radius: 50%; color: var(--pink); background: #fff0f2; font-size: 20px; }
.dialog-kicker { color: var(--pink-dark); font-size: 9px; font-weight: 800; letter-spacing: 1.1px; text-transform: uppercase; }
.contact-dialog h2 { margin: 8px 0; font: 800 24px "Manrope", sans-serif; letter-spacing: -.6px; }
.dialog-description { max-width: 320px; margin: 0 auto 17px; color: #827984; font-size: 11px; line-height: 1.6; }
.dialog-steps { display: grid; gap: 9px; margin: 0 0 18px; text-align: left; }
.dialog-step { display: flex; align-items: flex-start; gap: 10px; padding: 11px 12px; border-radius: 12px; background: #faf7f9; }
.step-number { flex: 0 0 24px; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; color: var(--pink-dark); background: #ffe8ec; font-size: 9px; font-weight: 800; }
.dialog-step p { margin: 0; color: #817780; font-size: 10px; line-height: 1.5; }
.dialog-step strong { display: block; margin: 0 0 2px; color: #403841; font-size: 10px; }
.dialog-contact { display: inline-flex; width: 100%; align-items: center; justify-content: center; gap: 12px; padding: 13px 15px; border-radius: 28px; color: white; background: linear-gradient(100deg, #ff7083, #f23e64); box-shadow: 0 5px 14px rgba(244,62,99,.24); font-size: 11px; font-weight: 800; text-decoration: none; }
.dialog-contact[hidden] { display: none; }
.dialog-footnote { margin: 12px 0 0; color: #9a8d97; font-size: 10px; line-height: 1.5; }

@media (min-width: 481px) {
  .app-shell { border-radius: 18px; height: min(900px, calc(100dvh - 36px)); min-height: 600px; }
}
@media (max-width: 380px) {
  .app-header { padding: 0 12px; gap: 6px; }
  .brand { font-size: 22px; }
  .location-button { padding: 7px 8px; font-size: 10px; }
  .discover-screen { padding-right: 11px; padding-left: 11px; }
  .action-dock { gap: 12px; }
  .rewind-button, .boost-button { width: 34px; height: 34px; }
  .pass-button, .super-button { width: 44px; height: 44px; }
  .like-button { width: 54px; height: 54px; }
}
@media (max-height: 700px) {
  .app-shell { min-height: 0; }
  .app-header { flex-basis: 54px; }
  .discover-screen { padding-top: 7px; }
  .discovery-bar { flex-basis: 31px; }
  .action-dock { flex-basis: 66px; }
  .bottom-nav { flex-basis: 55px; }
  .profile-copy { bottom: 13px; }
  .cat-bio { margin-bottom: 8px; -webkit-line-clamp: 2; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
