:root {
  --yellow: #fffc00;
  --yellow-soft: #fffec6;
  --ink: #10110f;
  --muted: #777970;
  --line: #e8e9e2;
  --surface: #ffffff;
  --canvas: #f4f4ef;
  --green: #3c7952;
  --coral: #ff654f;
  --sprite: url("assets/dog-adoption-contact-sheet.jpg");
  --shadow: 0 20px 55px rgba(16, 17, 15, 0.12);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  background: var(--canvas);
  color: var(--ink);
  font-family: Inter, ui-rounded, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}
button, input, textarea { font: inherit; }
button, label { -webkit-tap-highlight-color: transparent; }
button { color: inherit; cursor: pointer; }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.skip-link { position: fixed; top: -60px; left: 14px; z-index: 100; padding: 11px 15px; border-radius: 10px; background: var(--ink); color: white; text-decoration: none; }
.skip-link:focus { top: 14px; }
button:focus-visible, input:focus-visible, textarea:focus-visible, label:has(input:focus-visible) { outline: 3px solid #6e6cf7; outline-offset: 3px; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 224px minmax(0, 1fr); }
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 28px 20px 22px;
  border-right: 1px solid var(--line);
  background: var(--surface);
  z-index: 20;
}
.brand { display: flex; align-items: center; gap: 10px; width: max-content; color: var(--ink); text-decoration: none; }
.brand-mark { width: 39px; height: 39px; display: grid; place-items: center; border-radius: 13px; background: var(--yellow); transform: rotate(-3deg); }
.brand-mark svg { width: 23px; height: 23px; stroke: none; fill: var(--ink); transform: rotate(3deg); }
.brand-name { font-size: 23px; font-weight: 900; letter-spacing: -1.2px; }
.brand-name span { color: #ddd900; }
.sidebar nav { display: grid; gap: 7px; margin-top: 58px; }
.nav-item { position: relative; min-height: 52px; display: grid; grid-template-columns: 34px 1fr auto; gap: 8px; align-items: center; padding: 0 13px 0 10px; border: 0; border-radius: 15px; background: transparent; text-align: left; transition: 160ms ease; }
.nav-item:hover { background: #f5f5f0; }
.nav-item.active { background: var(--yellow); }
.nav-item > span { display: grid; place-items: center; }
.nav-item svg { width: 21px; height: 21px; stroke-width: 2; }
.nav-item b { font-size: 13px; font-weight: 750; }
.nav-item i { min-width: 22px; height: 22px; display: grid; place-items: center; padding: 0 6px; border-radius: 11px; background: var(--ink); color: white; font-size: 10px; font-style: normal; }
.sidebar-foot { display: grid; grid-template-columns: 38px 1fr 28px; gap: 9px; align-items: center; margin-top: auto; padding: 16px 3px 0; border-top: 1px solid var(--line); }
.mini-avatar, .profile-button { display: grid; place-items: center; border-radius: 50%; background: #e2c9b6; color: #33271e; font-size: 11px; font-weight: 850; }
.mini-avatar { width: 38px; height: 38px; }
.sidebar-foot b, .sidebar-foot span { display: block; }
.sidebar-foot b { font-size: 12px; }
.sidebar-foot span { margin-top: 2px; color: var(--muted); font-size: 9px; }
.sidebar-foot button { display: grid; place-items: center; padding: 0; border: 0; background: transparent; color: #777; }
.sidebar-foot button svg { width: 18px; }

.experience { min-width: 0; display: grid; grid-template-columns: minmax(430px, .96fr) minmax(410px, 1.04fr); height: 100vh; overflow: hidden; }
.camera-panel { min-width: 0; padding: 18px; background: #e9e9e2; }
.camera-frame { position: relative; height: 100%; min-height: 620px; overflow: hidden; border-radius: 28px; background: #c8c0b6; box-shadow: var(--shadow); isolation: isolate; }
.camera-frame > video, .camera-fallback, .capture-preview { position: absolute; inset: 0; width: 100%; height: 100%; display: block; object-fit: cover; }
.camera-frame > video { transform: scaleX(-1); }
.camera-frame > [hidden] { display: none; }
.camera-shade { position: absolute; inset: 0; z-index: 1; background: linear-gradient(180deg, rgba(0,0,0,.36), transparent 27%, transparent 54%, rgba(0,0,0,.58)); pointer-events: none; }
.camera-topbar { position: absolute; top: 22px; left: 22px; right: 22px; z-index: 4; display: flex; justify-content: space-between; align-items: center; color: white; }
.camera-brand { display: none; align-items: center; gap: 7px; font-size: 18px; font-weight: 900; letter-spacing: -.8px; }
.camera-brand span { width: 31px; height: 31px; display: grid; place-items: center; border-radius: 10px; background: var(--yellow); color: var(--ink); }
.camera-brand svg { width: 18px; height: 18px; fill: currentColor; stroke: none; }
.camera-tools { display: flex; gap: 8px; margin-left: auto; }
.round-tool { width: 43px; height: 43px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.18); border-radius: 50%; background: rgba(16,17,15,.35); color: white; backdrop-filter: blur(12px); }
.round-tool:hover, .round-tool.active { background: var(--yellow); color: var(--ink); border-color: var(--yellow); }
.round-tool svg { width: 19px; height: 19px; }
.location-pill { position: absolute; top: 25px; left: 22px; z-index: 4; display: flex; align-items: center; gap: 6px; padding: 9px 12px; border-radius: 20px; background: rgba(16,17,15,.35); color: white; font-size: 10px; font-weight: 650; backdrop-filter: blur(12px); }
.location-pill svg { width: 14px; height: 14px; }
.camera-intro { position: absolute; top: clamp(105px, 18vh, 168px); left: 28px; z-index: 3; max-width: 310px; color: white; text-shadow: 0 2px 16px rgba(0,0,0,.2); }
.eyebrow, .section-kicker { display: block; font-size: 9px; font-weight: 850; letter-spacing: 1.6px; }
.camera-intro .eyebrow { margin-bottom: 10px; color: var(--yellow); }
.camera-intro h1 { margin: 0; font-size: clamp(38px, 4.3vw, 62px); line-height: .94; letter-spacing: -3.3px; font-weight: 900; }
.camera-intro h1 em { position: relative; color: var(--yellow); font-family: Georgia, serif; font-weight: 400; letter-spacing: -3px; }
.camera-intro h1 em::after { content: ""; position: absolute; left: 2px; right: -5px; bottom: -4px; height: 5px; border-radius: 50%; border-top: 3px solid var(--yellow); transform: rotate(-2deg); }
.camera-intro p { max-width: 260px; margin: 17px 0 0; font-size: 13px; line-height: 1.5; text-shadow: 0 2px 12px rgba(0,0,0,.4); }
.camera-frame.live-camera .camera-intro,
.camera-frame:has(> video:not([hidden])) .camera-intro { display: none !important; }
.face-guide { position: absolute; z-index: 2; left: 50%; top: 51%; width: min(40%, 205px); aspect-ratio: .84; transform: translate(-50%, -50%); opacity: .65; }
.face-guide i { position: absolute; width: 27px; height: 27px; border-color: white; border-style: solid; }
.face-guide i:nth-child(1) { top: 0; left: 0; border-width: 2px 0 0 2px; border-radius: 10px 0 0; }
.face-guide i:nth-child(2) { top: 0; right: 0; border-width: 2px 2px 0 0; border-radius: 0 10px 0 0; }
.face-guide i:nth-child(3) { bottom: 0; left: 0; border-width: 0 0 2px 2px; border-radius: 0 0 0 10px; }
.face-guide i:nth-child(4) { right: 0; bottom: 0; border-width: 0 2px 2px 0; border-radius: 0 0 10px; }
.camera-controls { position: absolute; z-index: 4; left: 24px; right: 24px; bottom: 22px; color: white; }
.camera-controls > p { display: flex; align-items: center; justify-content: center; gap: 7px; margin: 0 0 14px; font-size: 10px; font-weight: 650; letter-spacing: .2px; }
.camera-controls > p span { width: 7px; height: 7px; border-radius: 50%; background: #6be788; box-shadow: 0 0 0 3px rgba(107,231,136,.18); }
.capture-row { display: grid; grid-template-columns: 70px 1fr 70px; align-items: center; }
.side-action { justify-self: center; width: 54px; display: grid; place-items: center; gap: 3px; padding: 5px; border: 0; background: transparent; color: white; font-size: 8px; font-weight: 700; cursor: pointer; }
.side-action svg { width: 20px; height: 20px; }
.shutter { justify-self: center; width: 74px; height: 74px; display: grid; place-items: center; padding: 0; border: 4px solid white; border-radius: 50%; background: rgba(255,255,255,.25); transition: transform .15s ease; }
.shutter:hover { transform: scale(1.04); }
.shutter:active { transform: scale(.94); }
.shutter i { width: 57px; height: 57px; border-radius: 50%; background: white; box-shadow: inset 0 0 0 1px #ddd; }
.camera-frame.captured .face-guide, .camera-frame.captured .camera-intro, .camera-frame.captured .camera-controls { opacity: 0; pointer-events: none; transition: opacity .2s; }
.scan-layer { position: absolute; inset: 0; z-index: 8; display: none; align-items: center; justify-content: center; background: rgba(13,14,12,.28); backdrop-filter: blur(2px); color: white; }
.scan-layer.active { display: flex; }
.scan-layer span { position: absolute; left: 8%; right: 8%; top: 25%; height: 2px; background: var(--yellow); box-shadow: 0 0 24px var(--yellow); animation: scan 1.15s ease-in-out infinite alternate; }
.scan-layer b { padding: 11px 15px; border-radius: 20px; background: rgba(16,17,15,.6); font-size: 11px; backdrop-filter: blur(12px); }
@keyframes scan { to { top: 72%; } }
.match-result { position: absolute; z-index: 9; left: 22px; right: 22px; bottom: 22px; display: grid; grid-template-columns: 66px 1fr auto; gap: 13px; align-items: center; padding: 13px; border-radius: 22px; background: rgba(255,255,255,.95); box-shadow: 0 15px 45px rgba(0,0,0,.24); backdrop-filter: blur(18px); animation: resultIn .45s cubic-bezier(.2,.8,.2,1); }
.match-result[hidden] { display: none; }
@keyframes resultIn { from { opacity: 0; transform: translateY(24px) scale(.97); } }
.match-dog { position: relative; width: 66px; height: 74px; padding: 0; overflow: hidden; border: 0; border-radius: 15px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.08); }
.match-dog:hover { box-shadow: inset 0 0 0 2px var(--yellow); }
.photo-open-hint { position: absolute; right: 5px; bottom: 5px; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; background: rgba(16,17,15,.72); color: white; backdrop-filter: blur(6px); }
.photo-open-hint svg { width: 13px; height: 13px; stroke-width: 2.2; }
.match-copy { min-width: 0; }
.match-copy > span { color: #8a8b84; font-size: 8px; font-weight: 850; letter-spacing: 1.1px; }
.match-copy h2 { margin: 4px 0 3px; font-size: 17px; letter-spacing: -.7px; text-transform: capitalize; }
.match-copy p { margin: 0; color: #73756e; font-size: 9px; line-height: 1.35; }
.match-score { display: flex; align-items: center; color: var(--ink); }
.match-score strong { font-size: 32px; line-height: 1; letter-spacing: -2px; }
.match-score span { margin-left: 3px; color: #777970; font-size: 8px; font-weight: 750; line-height: 1.05; text-transform: uppercase; }
.match-cta { grid-column: 1 / -1; height: 43px; display: flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 13px; background: var(--yellow); font-size: 11px; font-weight: 850; }
.match-cta:hover { background: #f4f100; }
.match-cta svg { width: 15px; }
.match-close { position: absolute; right: -8px; top: -40px; width: 33px; height: 33px; border: 1px solid rgba(255,255,255,.2); border-radius: 50%; background: rgba(16,17,15,.46); color: white; font-size: 20px; backdrop-filter: blur(10px); }

.discover-panel { min-width: 0; height: 100vh; overflow-y: auto; padding: 32px clamp(25px, 3vw, 50px) 50px; background: var(--surface); scrollbar-width: thin; }
.discover-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.section-kicker { color: #92948b; }
.discover-header h2 { margin: 5px 0 0; font-size: clamp(25px, 2.3vw, 35px); letter-spacing: -1.5px; line-height: 1.05; }
.profile-button { position: relative; width: 43px; height: 43px; border: 0; }
.profile-button span { position: absolute; right: 0; bottom: 1px; width: 10px; height: 10px; border: 2px solid white; border-radius: 50%; background: #4cb86b; }
.discover-tools { display: flex; gap: 10px; margin-top: 27px; }
.species-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; margin-top: 24px; padding: 5px; border: 1px solid var(--line); border-radius: 16px; background: white; }
.species-switch button { min-height: 43px; border: 0; border-radius: 11px; background: transparent; color: #777970; font-size: 11px; font-weight: 850; }
.species-switch button.active { background: var(--yellow); color: var(--ink); box-shadow: 0 4px 12px rgba(155,153,0,.16); }
.intent-switch { flex: 1; min-width: 190px; display: grid; grid-template-columns: 1fr 1fr; padding: 4px; border-radius: 14px; background: #f1f2ed; }
.intent-switch button { min-height: 38px; padding: 0 15px; border: 0; border-radius: 10px; background: transparent; color: #74766e; font-size: 11px; font-weight: 750; }
.intent-switch button.active { background: white; color: var(--ink); box-shadow: 0 2px 8px rgba(20,20,16,.08); }
.dog-search { width: 47px; height: 47px; display: flex; align-items: center; padding: 0 13px; overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: white; transition: width .2s; }
.dog-search:focus-within { width: 165px; }
.dog-search svg { width: 19px; min-width: 19px; }
.dog-search input { width: 0; min-width: 0; margin-left: 8px; padding: 0; border: 0; outline: 0; background: transparent; font-size: 11px; }
.dog-search:focus-within input, .dog-search input:not(:placeholder-shown) { width: 115px; }
.match-banner { position: relative; display: grid; grid-template-columns: 47px 1fr; gap: 12px; align-items: center; margin: 20px 0; padding: 14px; overflow: hidden; border: 1px solid #efec65; border-radius: 17px; background: linear-gradient(120deg, #fffec3, #fffef1); }
.banner-icon { width: 47px; height: 47px; display: grid; place-items: center; border-radius: 14px; background: var(--yellow); transform: rotate(-5deg); }
.banner-icon svg { width: 25px; height: 25px; fill: var(--ink); stroke: none; }
.banner-copy { min-width: 0; }
.banner-copy > span { display: block; color: #979521; font-size: 8px; font-weight: 850; letter-spacing: 1.2px; }
.banner-edit-row { display: flex; align-items: center; gap: 6px; margin-top: 2px; }
.banner-edit-row input { width: 100%; min-width: 0; margin-left: -5px; padding: 3px 5px; border: 1px solid transparent; border-radius: 6px; outline: 0; background: transparent; color: var(--ink); font: inherit; font-size: 12px; font-weight: 800; }
.banner-edit-row input:hover { border-color: rgba(16,17,15,.14); background: rgba(255,255,255,.45); }
.banner-edit-row input:focus { border-color: var(--ink); background: white; box-shadow: 0 0 0 2px var(--yellow); }
.banner-edit-row button { flex: 0 0 auto; padding: 4px 7px; border: 1px solid rgba(16,17,15,.12); border-radius: 7px; background: rgba(255,255,255,.7); color: var(--ink); font-size: 7px; font-weight: 850; text-transform: uppercase; letter-spacing: .5px; cursor: pointer; }
.banner-edit-row button:hover { background: white; }
.sparkle { position: absolute; right: 14px; top: 8px; color: #d8d500; font-size: 16px; }
.side-recommendation { display: grid; grid-template-columns: 82px minmax(0, 1fr) auto; gap: 13px; align-items: center; margin: -6px 0 18px; padding: 11px; border: 1px solid #e7e5bb; border-radius: 18px; background: white; box-shadow: 0 10px 28px rgba(16,17,15,.09); animation: recommendationIn .35s cubic-bezier(.2,.8,.2,1); }
.side-recommendation[hidden] { display: none; }
@keyframes recommendationIn { from { opacity: 0; transform: translateY(-8px) scale(.98); } }
.recommendation-photo { width: 82px; height: 82px; border-radius: 14px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.08); }
.recommendation-copy { min-width: 0; }
.recommendation-copy .section-kicker { color: #a29f16; font-size: 7px; }
.recommendation-copy h3 { margin: 4px 0 1px; overflow: hidden; font-size: 18px; letter-spacing: -.6px; text-overflow: ellipsis; white-space: nowrap; }
.recommendation-copy p { margin: 0; color: #676962; font-size: 10px; }
.recommendation-copy small { display: block; margin-top: 7px; overflow: hidden; color: #8a8c84; font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.recommendation-actions { display: grid; justify-items: end; gap: 9px; }
.recommendation-actions strong { font-size: 20px; letter-spacing: -1px; }
.recommendation-actions button { height: 32px; padding: 0 10px; border: 0; border-radius: 10px; background: var(--yellow); font-size: 8px; font-weight: 850; white-space: nowrap; }
.recommendation-actions button:hover { background: var(--ink); color: white; }
.display-bar { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin: 0 0 13px; }
.display-bar > span { color: var(--muted); font-size: 9px; font-weight: 700; }
.display-actions { display: flex; align-items: center; gap: 6px; }
.pack-shuffle { height: 37px; display: flex; align-items: center; gap: 5px; padding: 0 10px; border: 1px solid var(--line); border-radius: 10px; background: white; font-size: 8px; font-weight: 800; }
.pack-shuffle:hover { border-color: #b9bbb2; background: var(--yellow-soft); }
.pack-shuffle:disabled { cursor: wait; opacity: .55; }
.pack-shuffle[aria-busy="true"] svg { animation: packSpin .75s linear infinite; }
.pack-shuffle svg { width: 13px; height: 13px; }
@keyframes packSpin { to { transform: rotate(180deg); } }
.view-switch { display: flex; gap: 3px; padding: 3px; border-radius: 11px; background: #f1f2ed; }
.view-switch button { height: 31px; display: flex; align-items: center; gap: 5px; padding: 0 10px; border: 0; border-radius: 8px; background: transparent; color: #73756e; font-size: 9px; font-weight: 800; }
.view-switch button.active { background: white; color: var(--ink); box-shadow: 0 2px 7px rgba(20,20,16,.08); }
.view-switch svg { width: 13px; height: 13px; }
.dog-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 17px 13px; }
.dog-card { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 20px; background: white; transition: transform .18s, box-shadow .18s; animation: cardIn .4s both; animation-delay: var(--delay); }
@keyframes cardIn { from { opacity: 0; transform: translateY(12px); } }
.dog-card:hover { transform: translateY(-3px); box-shadow: 0 13px 30px rgba(17,18,15,.1); }
.dog-photo { background-image: var(--dog-image, var(--sprite)); background-size: var(--dog-size, 300% 200%); background-position: var(--dog-position, var(--photo)); background-repeat: no-repeat; background-color: #ddd; }
.dog-card-photo { position: relative; aspect-ratio: 1.2; }
.distance-pill { position: absolute; left: 10px; top: 10px; padding: 6px 8px; border-radius: 11px; background: rgba(255,255,255,.88); color: #30322e; font-size: 8px; font-weight: 850; backdrop-filter: blur(7px); }
.favorite-button { position: absolute; right: 9px; top: 9px; width: 34px; height: 34px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 50%; background: rgba(255,255,255,.9); color: var(--ink); backdrop-filter: blur(7px); }
.favorite-button svg { width: 17px; height: 17px; fill: transparent; stroke-width: 2; }
.favorite-button.saved { color: var(--coral); }
.favorite-button.saved svg { fill: currentColor; }
.vibe-chip { position: absolute; left: 10px; bottom: 9px; display: flex; align-items: center; gap: 4px; padding: 6px 8px; border-radius: 10px; background: var(--yellow); font-size: 8px; font-weight: 900; }
.dog-card-body { padding: 12px 12px 13px; }
.dog-title-row { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.dog-title-row h3 { margin: 0; font-size: 17px; letter-spacing: -.5px; }
.dog-title-row > span { color: var(--muted); font-size: 9px; white-space: nowrap; }
.breed { margin: 3px 0 9px; color: #71736c; font-size: 10px; }
.dog-tags { display: flex; gap: 4px; overflow: hidden; }
.dog-tags span { padding: 5px 7px; border-radius: 8px; background: #f3f3ef; color: #61635d; font-size: 8px; white-space: nowrap; }
.card-footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 12px; padding-top: 10px; border-top: 1px solid #f0f0ec; }
.shelter { min-width: 0; display: flex; align-items: center; gap: 6px; color: #777970; font-size: 8px; }
.shelter span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shelter svg { min-width: 12px; width: 12px; height: 12px; }
.meet-button { height: 31px; min-width: 50px; padding: 0 11px; border: 0; border-radius: 10px; background: var(--ink); color: white; font-size: 9px; font-weight: 800; }
.meet-button:hover { background: var(--yellow); color: var(--ink); }
.empty-dogs { grid-column: 1/-1; padding: 55px 20px; border: 1px dashed #d5d6cf; border-radius: 18px; text-align: center; color: var(--muted); }
.empty-dogs svg { width: 35px; height: 35px; margin-bottom: 10px; fill: #dedfd7; stroke: none; }
.empty-dogs b, .empty-dogs span { display: block; }
.empty-dogs b { color: var(--ink); }
.empty-dogs span { margin-top: 5px; font-size: 11px; }
.dog-map { position: relative; height: min(68vh, 620px); min-height: 490px; overflow: hidden; border: 1px solid var(--line); border-radius: 21px; background: #eceee8; }
#leafletMap { position: absolute; inset: 0; z-index: 1; font-family: inherit; }
.map-distance-filter { position: absolute; left: 58px; right: 103px; top: 13px; z-index: 500; display: flex; align-items: center; justify-content: center; gap: 3px; padding: 3px; border-radius: 12px; background: rgba(255,255,255,.94); box-shadow: 0 5px 18px rgba(0,0,0,.14); backdrop-filter: blur(10px); }
.map-distance-filter > span { padding: 0 6px; color: var(--muted); font-size: 8px; font-weight: 800; text-transform: uppercase; letter-spacing: .6px; }
.map-distance-filter button { min-width: 39px; height: 30px; padding: 0 7px; border: 0; border-radius: 9px; background: transparent; color: #73756e; font-size: 8px; font-weight: 850; white-space: nowrap; }
.map-distance-filter button:hover { background: var(--yellow-soft); color: var(--ink); }
.map-distance-filter button.active { background: var(--yellow); color: var(--ink); box-shadow: 0 2px 8px rgba(155,153,0,.2); }
.dog-map .leaflet-control-zoom { overflow: hidden; border: 0; border-radius: 12px; box-shadow: 0 4px 16px rgba(0,0,0,.15); }
.dog-map .leaflet-control-zoom a { width: 34px; height: 34px; line-height: 34px; border: 0; color: var(--ink); font-size: 17px; }
.dog-map .leaflet-control-attribution { padding: 3px 6px; background: rgba(255,255,255,.82); font-size: 8px; }
.dog-map .leaflet-popup-content-wrapper { border-radius: 14px; box-shadow: 0 8px 28px rgba(0,0,0,.18); }
.dog-map .leaflet-popup-content { margin: 12px 13px; min-width: 130px; font-family: inherit; }
.map-popup b, .map-popup span { display: block; }
.map-popup b { font-size: 13px; }
.map-popup span { margin-top: 2px; color: var(--muted); font-size: 9px; }
.map-popup button { width: 100%; height: 29px; margin-top: 9px; border: 0; border-radius: 8px; background: var(--yellow); font-size: 8px; font-weight: 850; }
.dog-marker { background: transparent; border: 0; }
.dog-map-marker { position: relative; width: 52px; height: 57px; padding: 4px; border-radius: 50% 50% 48% 48%; background: white; box-shadow: 0 5px 18px rgba(0,0,0,.28); transform-origin: 50% 100%; transition: transform .15s; }
.dog-map-marker::after { content: ""; position: absolute; left: 20px; bottom: -5px; width: 12px; height: 12px; background: white; transform: rotate(45deg); }
.dog-map-marker .dog-photo { position: relative; z-index: 1; width: 44px; height: 44px; border-radius: 50%; box-shadow: inset 0 0 0 2px white; }
.dog-map-marker .marker-vibe { position: absolute; right: -7px; top: -6px; z-index: 2; min-width: 24px; height: 19px; display: grid; place-items: center; padding: 0 4px; border: 2px solid white; border-radius: 10px; background: var(--yellow); color: var(--ink); font-size: 7px; font-weight: 900; }
.dog-marker:hover .dog-map-marker { transform: translateY(-3px) scale(1.06); }
.map-location { position: absolute; left: 13px; bottom: 13px; z-index: 500; display: grid; grid-template-columns: 10px 1fr; gap: 8px; align-items: center; padding: 10px 12px; border-radius: 13px; background: rgba(255,255,255,.94); box-shadow: 0 5px 18px rgba(0,0,0,.14); backdrop-filter: blur(10px); }
.map-location > span { width: 9px; height: 9px; border: 2px solid white; border-radius: 50%; background: #6774f5; box-shadow: 0 0 0 3px rgba(103,116,245,.2); }
.map-location b, .map-location small { display: block; }
.map-location b { font-size: 9px; }
.map-location small { margin-top: 2px; color: var(--muted); font-size: 7px; }
.recenter-map { position: absolute; right: 13px; top: 13px; z-index: 500; height: 36px; display: flex; align-items: center; gap: 5px; padding: 0 11px; border: 0; border-radius: 12px; background: rgba(255,255,255,.94); box-shadow: 0 5px 18px rgba(0,0,0,.14); font-size: 8px; font-weight: 800; backdrop-filter: blur(10px); }
.recenter-map svg { width: 13px; height: 13px; }
.profile-sheet { grid-column: 1 / -1; padding: 26px; border: 1px solid var(--line); border-radius: 22px; background: linear-gradient(155deg, #fffef0, white 50%); }
.profile-preferences-header { display: grid; grid-template-columns: 76px minmax(0, 1fr) auto; align-items: center; gap: 17px; padding-bottom: 22px; border-bottom: 1px solid var(--line); }
.profile-hero { position: relative; width: 76px; }
.profile-avatar { width: 72px; height: 72px; display: grid; place-items: center; border: 4px solid white; border-radius: 50%; background: #e2c9b6; box-shadow: 0 7px 22px rgba(0,0,0,.12); font-size: 18px; font-weight: 900; }
.profile-paw { position: absolute; right: -1px; bottom: -3px; width: 29px; height: 29px; display: grid; place-items: center; border: 3px solid white; border-radius: 10px; background: var(--yellow); transform: rotate(-7deg); }
.profile-paw svg { width: 15px; height: 15px; fill: var(--ink); stroke: none; }
.profile-sheet h3 { margin: 4px 0 0; font-size: 22px; letter-spacing: -.8px; }
.profile-preferences-header p { max-width: 390px; margin: 5px 0 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.preference-count { align-self: start; padding: 7px 9px; border-radius: 9px; background: var(--yellow); font-size: 7px; font-weight: 900; letter-spacing: .7px; white-space: nowrap; }
.preference-form { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 10px; margin-top: 22px; text-align: left; }
.preference-field { display: grid; gap: 7px; }
.preference-field > span { font-size: 8px; font-weight: 850; letter-spacing: .65px; text-transform: uppercase; }
.preference-field select, .preference-field textarea { width: 100%; border: 1px solid #dddeda; border-radius: 12px; outline: 0; background: white; color: var(--ink); font: inherit; font-size: 10px; transition: border-color .15s, box-shadow .15s; }
.preference-field select { height: 43px; padding: 0 34px 0 11px; }
.preference-field textarea { min-height: 82px; padding: 12px; line-height: 1.55; resize: vertical; }
.preference-field select:focus, .preference-field textarea:focus { border-color: #9ea096; box-shadow: 0 0 0 3px rgba(255,255,0,.26); }
.preference-description { grid-column: 1 / -1; }
.preference-description small { color: var(--muted); font-size: 8px; line-height: 1.45; }
.preference-actions { grid-column: 1 / -1; display: flex; justify-content: flex-end; gap: 8px; }
.preference-actions button { height: 43px; padding: 0 16px; border-radius: 12px; font-size: 9px; font-weight: 850; }
.preference-clear { border: 1px solid var(--line); background: white; color: var(--ink); }
.preference-clear:disabled { color: #a5a79f; cursor: default; }
.preference-submit { display: flex; align-items: center; justify-content: center; gap: 5px; border: 0; background: var(--ink); color: white; }
.preference-submit svg { width: 14px; height: 14px; }
.profile-stats { display: grid; grid-template-columns: repeat(3, 1fr); margin: 24px 0 0; padding-top: 19px; border-top: 1px solid var(--line); text-align: center; }
.profile-stats div { padding: 5px; border-right: 1px solid var(--line); }
.profile-stats div:last-child { border-right: 0; }
.profile-stats b, .profile-stats span { display: block; }
.profile-stats b { font-size: 20px; }
.profile-stats span { margin-top: 4px; color: var(--muted); font-size: 8px; }

.mobile-nav { display: none; }
.dog-dialog, .interest-dialog { padding: 0; border: 0; border-radius: 24px; background: white; color: var(--ink); box-shadow: 0 28px 90px rgba(0,0,0,.32); }
.dog-dialog::backdrop, .interest-dialog::backdrop { background: rgba(12,13,11,.66); backdrop-filter: blur(3px); }
.photo-dialog { width: min(920px, calc(100vw - 30px)); height: min(820px, calc(100dvh - 30px)); padding: 0; overflow: hidden; border: 0; border-radius: 25px; background: #0d0e0c; color: white; box-shadow: 0 28px 90px rgba(0,0,0,.45); }
.photo-dialog::backdrop { background: rgba(5,6,5,.9); backdrop-filter: blur(7px); }
.photo-dialog-close { position: absolute; right: 15px; top: 15px; z-index: 3; width: 40px; height: 40px; border: 1px solid rgba(255,255,255,.16); border-radius: 50%; background: rgba(16,17,15,.72); color: white; font-size: 25px; backdrop-filter: blur(8px); }
.photo-dialog-stage { height: calc(100% - 104px); overflow: hidden; background: #080908; cursor: zoom-in; touch-action: none; user-select: none; }
.photo-dialog-stage.can-pan { cursor: grab; }
.photo-dialog-stage.can-pan:active { cursor: grabbing; }
.photo-dialog-image { width: 100%; height: 100%; background-size: contain; background-position: center; transition: transform .12s ease-out; will-change: transform; }
.photo-dialog-stage:active .photo-dialog-image { transition: none; }
.photo-dialog-footer { min-height: 104px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 16px 20px; }
.photo-dialog-footer span { color: var(--yellow); font-size: 8px; font-weight: 850; letter-spacing: 1.2px; }
.photo-dialog-footer h2 { margin: 3px 0 1px; font-size: 18px; letter-spacing: -.5px; text-transform: capitalize; }
.photo-dialog-footer p { margin: 0; color: #989b93; font-size: 9px; }
.photo-zoom-controls { display: flex; align-items: center; gap: 5px; }
.photo-zoom-controls button, .photo-zoom-controls output { height: 36px; min-width: 36px; display: grid; place-items: center; padding: 0 10px; border: 1px solid rgba(255,255,255,.12); border-radius: 10px; background: #22241f; color: white; font-size: 13px; font-weight: 800; }
.photo-zoom-controls button:hover { border-color: var(--yellow); }
.photo-zoom-controls output { min-width: 58px; color: var(--yellow); font-size: 10px; }
.dog-dialog { width: min(455px, calc(100vw - 30px)); overflow: hidden; }
.dialog-close { position: absolute; right: 14px; top: 14px; z-index: 3; width: 37px; height: 37px; border: 0; border-radius: 50%; background: rgba(255,255,255,.9); font-size: 22px; backdrop-filter: blur(8px); }
.dialog-photo { height: 290px; position: relative; }
.dialog-vibe { position: absolute; left: 17px; bottom: 15px; padding: 8px 11px; border-radius: 12px; background: var(--yellow); font-size: 9px; font-weight: 900; }
.dialog-body { padding: 22px; }
.dialog-title { display: flex; align-items: start; justify-content: space-between; gap: 16px; }
.dialog-title h2 { margin: 0; font-size: 28px; letter-spacing: -1px; }
.dialog-title p { margin: 4px 0 0; color: var(--muted); font-size: 11px; text-transform: capitalize; }
.dialog-title .favorite-button { position: static; border: 1px solid var(--line); min-width: 40px; width: 40px; height: 40px; }
.dialog-tags { margin-top: 15px; flex-wrap: wrap; }
.dialog-body > p { margin: 17px 0; color: #65675f; line-height: 1.6; font-size: 12px; }
.dialog-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.dialog-facts div { padding: 12px; border-radius: 12px; background: #f5f5f1; }
.dialog-facts span, .dialog-facts b { display: block; }
.dialog-facts span { color: var(--muted); font-size: 8px; font-weight: 750; letter-spacing: .7px; text-transform: uppercase; }
.dialog-facts b { margin-top: 4px; font-size: 11px; }
.dialog-body .photo-credit { margin: 12px 2px 0; color: #92948b; font-size: 9px; }
.photo-credit a { color: var(--ink); font-weight: 750; }
.dialog-action { width: 100%; height: 50px; display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 15px; border: 0; border-radius: 14px; background: var(--yellow); font-size: 12px; font-weight: 850; }
.dialog-action svg { width: 17px; }
.interest-dialog { width: min(430px, calc(100vw - 28px)); }
.interest-dialog form { position: relative; padding: 31px; }
.interest-dialog .dialog-close { background: #f1f1ed; }
.form-paw { width: 52px; height: 52px; display: grid; place-items: center; margin-bottom: 18px; border-radius: 15px; background: var(--yellow); transform: rotate(-5deg); }
.form-paw svg { width: 28px; height: 28px; fill: var(--ink); stroke: none; }
.interest-dialog h2 { margin: 5px 0 7px; font-size: 28px; letter-spacing: -1px; }
.interest-dialog form > p:not(.section-kicker) { margin: 0 0 20px; color: var(--muted); font-size: 12px; line-height: 1.55; }
.interest-dialog label { display: block; margin-top: 12px; }
.interest-dialog label > span { display: block; margin-bottom: 6px; font-size: 9px; font-weight: 800; }
.interest-dialog input, .interest-dialog textarea { width: 100%; border: 1px solid #dfe0da; border-radius: 11px; background: #fafaf7; outline: none; }
.interest-dialog input { height: 43px; padding: 0 11px; }
.interest-dialog textarea { padding: 10px 11px; resize: vertical; }
.interest-dialog input:focus, .interest-dialog textarea:focus { border-color: #a5a79d; }
.send-button { width: 100%; height: 49px; display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 18px; border: 0; border-radius: 13px; background: var(--ink); color: white; font-size: 11px; font-weight: 850; }
.send-button svg { width: 17px; }
.toast { position: fixed; left: 50%; bottom: 24px; z-index: 100; max-width: calc(100vw - 28px); padding: 11px 15px; border-radius: 13px; background: var(--ink); color: white; box-shadow: 0 8px 25px rgba(0,0,0,.24); font-size: 11px; font-weight: 700; opacity: 0; pointer-events: none; transform: translate(-50%, 15px); transition: .2s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 1080px) {
  .app-shell { grid-template-columns: 82px minmax(0, 1fr); }
  .sidebar { align-items: center; padding-left: 13px; padding-right: 13px; }
  .brand-name, .nav-item b, .nav-item i, .sidebar-foot > div:not(.mini-avatar), .sidebar-foot button { display: none; }
  .sidebar nav { width: 100%; }
  .nav-item { display: grid; grid-template-columns: 1fr; padding: 0; text-align: center; }
  .sidebar-foot { display: block; }
  .experience { grid-template-columns: minmax(390px, .92fr) minmax(390px, 1.08fr); }
  .discover-panel { padding-left: 22px; padding-right: 22px; }
}

@media (max-width: 820px) {
  body { background: #111; }
  .app-shell { display: block; min-height: 100dvh; }
  .sidebar { display: none; }
  .experience { display: block; height: auto; overflow: visible; }
  .camera-panel { height: calc(100dvh - 72px - env(safe-area-inset-bottom)); min-height: 610px; padding: 0; background: #111; }
  .camera-frame { height: 100%; min-height: 0; border-radius: 0; box-shadow: none; }
  .camera-brand { display: flex; }
  .location-pill { top: 75px; left: 17px; }
  .camera-topbar { top: max(16px, env(safe-area-inset-top)); left: 17px; right: 17px; }
  .camera-intro { left: 22px; top: 132px; }
  .camera-intro h1 { font-size: clamp(42px, 13vw, 62px); }
  .face-guide { top: 52%; width: 42%; }
  .camera-controls { bottom: 19px; }
  .discover-panel { display: none; min-height: 100dvh; height: auto; overflow: visible; padding: max(27px, env(safe-area-inset-top)) 17px calc(98px + env(safe-area-inset-bottom)); }
  body[data-screen="nearby"] { background: white; }
  body[data-screen="nearby"] .camera-panel, body[data-screen="saved"] .camera-panel, body[data-screen="profile"] .camera-panel { display: none; }
  body[data-screen="nearby"] .discover-panel, body[data-screen="saved"] .discover-panel, body[data-screen="profile"] .discover-panel { display: block; }
  body[data-screen="saved"] .match-banner, body[data-screen="profile"] .match-banner { display: none; }
  .mobile-nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; height: calc(72px + env(safe-area-inset-bottom)); display: grid; grid-template-columns: repeat(4, 1fr); padding: 8px 8px env(safe-area-inset-bottom); border-top: 1px solid rgba(220,221,215,.9); background: rgba(255,255,255,.96); box-shadow: 0 -5px 24px rgba(0,0,0,.08); backdrop-filter: blur(16px); }
  .mobile-nav button { position: relative; display: grid; place-items: center; align-content: center; gap: 2px; border: 0; border-radius: 13px; background: transparent; color: #878981; font-size: 8px; font-weight: 750; }
  .mobile-nav button.active { color: var(--ink); }
  .mobile-nav button.active::before { content: ""; position: absolute; top: 0; width: 24px; height: 3px; border-radius: 2px; background: var(--yellow); }
  .mobile-nav button:first-child.active svg { width: 31px; height: 31px; padding: 6px; border-radius: 50%; background: var(--yellow); }
  .mobile-nav svg { width: 21px; height: 21px; }
  .mobile-nav i { position: absolute; top: 4px; left: calc(50% + 8px); min-width: 15px; height: 15px; display: none; place-items: center; padding: 0 3px; border: 2px solid white; border-radius: 9px; background: var(--coral); color: white; font-size: 7px; font-style: normal; }
  .mobile-nav i.visible { display: grid; }
  .toast { bottom: calc(86px + env(safe-area-inset-bottom)); }
  .map-location { display: none; }
  .map-distance-filter > span { display: none; }
}

@media (max-width: 480px) {
  .camera-fallback { object-position: 49% center; }
  .camera-intro { top: 130px; }
  .camera-intro p { max-width: 235px; }
  .match-result { left: 13px; right: 13px; bottom: 14px; grid-template-columns: 60px 1fr auto; gap: 10px; }
  .match-dog { width: 60px; height: 67px; }
  .match-score strong { font-size: 28px; }
  .discover-header h2 { font-size: 29px; }
  .discover-tools { margin-top: 20px; }
  .dog-search { min-width: 47px; }
  .dog-list { gap: 15px 9px; }
  .profile-sheet { padding: 20px 17px; }
  .profile-preferences-header { grid-template-columns: 64px minmax(0, 1fr); gap: 13px; }
  .profile-hero { width: 64px; }
  .profile-avatar { width: 60px; height: 60px; font-size: 15px; }
  .profile-paw { width: 25px; height: 25px; }
  .profile-preferences-header h3 { font-size: 19px; }
  .preference-count { grid-column: 1 / -1; justify-self: start; }
  .preference-form { grid-template-columns: 1fr; }
  .preference-description, .preference-actions { grid-column: auto; }
  .preference-actions button { flex: 1; }
  .dog-card { border-radius: 17px; }
  .dog-card-photo { aspect-ratio: .98; }
  .dog-card-body { padding: 10px 10px 11px; }
  .dog-title-row h3 { font-size: 16px; }
  .dog-tags span:nth-child(n+2) { display: none; }
  .shelter span { max-width: 78px; }
  .match-banner { margin: 16px 0; }
  .side-recommendation { grid-template-columns: 72px minmax(0, 1fr); }
  .recommendation-photo { width: 72px; height: 72px; }
  .recommendation-actions { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; }
  .display-bar { align-items: flex-start; }
  .display-bar > span { max-width: 100px; padding-top: 5px; line-height: 1.35; }
  .pack-shuffle { width: 37px; padding: 0; justify-content: center; font-size: 0; }
  .dog-map { height: calc(100dvh - 280px); min-height: 500px; border-radius: 18px; }
  .map-distance-filter { right: 12px; }
  .map-distance-filter button { flex: 1; min-width: 0; }
  .recenter-map { top: 57px; }
  .dog-dialog { width: 100%; max-width: none; margin: auto 0 0; border-radius: 25px 25px 0 0; }
  .dialog-photo { height: 39vh; min-height: 250px; }
  .photo-dialog { width: 100%; height: 100dvh; max-width: none; max-height: none; margin: 0; border-radius: 0; }
  .photo-dialog-stage { height: calc(100% - 132px); }
  .photo-dialog-footer { min-height: 132px; align-items: flex-start; padding: 14px 15px calc(14px + env(safe-area-inset-bottom)); flex-direction: column; gap: 10px; }
  .photo-dialog-footer p { display: none; }
  .photo-zoom-controls { width: 100%; }
  .photo-zoom-controls button, .photo-zoom-controls output { flex: 1; }
  .interest-dialog { width: calc(100vw - 20px); margin: auto 10px 10px; border-radius: 22px; }
  .interest-dialog form { padding: 25px 21px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
