/* find-my-pet — warm, mobile-first, Hebrew RTL. Light + dark. */

:root {
  --bg: #faf7f2;
  --surface: #ffffff;
  --surface-2: #f5efe6;
  --surface-3: #fafafa;
  --ink: #2a2a2a;
  --ink-2: #444444;
  --muted: #6b6b6b;
  --line: #eadfd2;
  --accent: #c2410c;
  --accent-2: #ea580c;
  --accent-soft: #fff3e9;
  --pos: #2d6a4f;
  --pos-bg: #e8f3ec;
  --amber: #f59e0b;
  --wa: #25d366;
  --danger: #b91c1c;
  --danger-bg: #fdf2f2;
  --danger-line: #f5c2c2;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 4px 12px rgba(0, 0, 0, 0.05);
  --topbar-bg: rgba(250, 247, 242, 0.97);
  --nav-bg: rgba(250, 247, 242, 0.97);
  --banner-bg: #fff8e6;
  --radius: 14px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --nav-height: 58px;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #17130e;
  --surface: #221c15;
  --surface-2: #2c241b;
  --surface-3: #1d1812;
  --ink: #f3ece2;
  --ink-2: #d9d0c3;
  --muted: #a89a86;
  --line: #362b1f;
  --accent: #fb8c3c;
  --accent-2: #f97316;
  --accent-soft: #33220f;
  --pos: #86cfa4;
  --pos-bg: #1c3528;
  --amber: #fbbf24;
  --danger: #fca5a5;
  --danger-bg: #3a1717;
  --danger-line: #6b2a2a;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 6px 16px rgba(0, 0, 0, 0.35);
  --topbar-bg: rgba(23, 19, 14, 0.97);
  --nav-bg: rgba(23, 19, 14, 0.97);
  --banner-bg: #33290f;
}
:root[data-theme="light"] {
  color-scheme: light;
}
:root[data-theme="dark"] .leaflet-tile {
  filter: brightness(0.72) contrast(1.05) saturate(0.85);
}
:root[data-theme="dark"] .leaflet-container {
  background: #0f0c08;
}

* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  padding: 0;
}
html {
  color-scheme: light dark;
}
body {
  font-family: "Rubik", -apple-system, BlinkMacSystemFont, "Segoe UI", "Arial Hebrew", sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}
button {
  font: inherit;
  cursor: pointer;
  color: inherit;
}
a {
  color: var(--accent);
}
.hidden {
  display: none !important;
}
.small {
  font-size: 12px;
}
.muted {
  color: var(--muted);
}

/* ---------- topbar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--topbar-bg);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  padding: calc(8px + var(--safe-top)) 14px 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.topbar__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.brand {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.brand__paw {
  font-size: 20px;
}
.pill {
  background: var(--accent);
  color: #fff;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  padding: 2px 8px;
  min-width: 22px;
  text-align: center;
}
.pill--amber {
  background: var(--amber);
}
.topbar__tools {
  display: flex;
  align-items: center;
  gap: 6px;
}
.icon-btn {
  position: relative;
  min-width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  font-size: 17px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 8px;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}
.icon-btn:active {
  background: var(--surface-2);
  transform: scale(0.96);
}
.icon-btn.spinning {
  animation: spin 0.7s linear;
}
.icon-btn[aria-pressed="true"] {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.mini-badge {
  position: absolute;
  top: -5px;
  inset-inline-start: -5px;
  background: var(--amber);
  color: #fff;
  border-radius: 999px;
  font-size: 10px;
  min-width: 17px;
  height: 17px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}
.topbar__row--meta {
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 6px;
}
.meta-chip {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.meta-chip:active {
  background: var(--surface-2);
}
.meta-chip--warn {
  border-color: var(--amber);
  background: var(--banner-bg);
}
.search-row {
  display: flex;
  gap: 8px;
}
#f-search {
  flex: 1;
  min-width: 0;
  font: inherit;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink);
}
#f-search:focus,
.f-grid select:focus,
.addr-row input:focus,
.chat-form input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 15%, transparent);
}
.filter-btn {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 12px;
  padding: 0 14px;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.badge {
  background: var(--accent);
  color: #fff;
  border-radius: 999px;
  font-size: 11px;
  min-width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
}

/* active filter chips */
.chips-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.chips-row:empty {
  display: none;
}

/* quick prefilters (sex / popular breeds) */
.quick-chips {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 2px 0 4px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.quick-chips::-webkit-scrollbar {
  display: none;
}
.quick-chips:empty {
  display: none;
}
.quick-chip {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 13px;
  white-space: nowrap;
  color: var(--ink);
  transition: transform 0.12s ease, background 0.12s ease;
}
.quick-chip:active {
  transform: scale(0.94);
}
.quick-chip[aria-pressed="true"] {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 600;
}
.quick-label {
  flex: 0 0 auto;
  align-self: center;
  font-size: 11px;
  color: var(--muted);
}

.chip-btn {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 12px;
  display: inline-flex;
  gap: 6px;
  align-items: center;
}
.chip-btn .x {
  color: var(--muted);
  font-size: 13px;
}
.chat-result-chip {
  border-color: var(--amber);
  background: var(--banner-bg);
}
.chip-btn--suggest {
  border-color: var(--pos);
  color: var(--pos);
  font-weight: 600;
}

/* ---------- install banner ---------- */
.install-banner {
  position: sticky;
  top: 0;
  z-index: 950;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--banner-bg);
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  animation: fade-up 0.3s ease;
}
.install-banner__icon {
  font-size: 22px;
  flex-shrink: 0;
}
.install-banner__text {
  flex: 1;
  line-height: 1.35;
}
.install-banner__text b {
  white-space: nowrap;
}
.install-banner__actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.install-btn {
  border: none;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  border-radius: 999px;
  padding: 7px 15px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 2px 8px color-mix(in srgb, var(--accent) 30%, transparent);
}
.install-dismiss {
  border: none;
  background: none;
  color: var(--muted);
  font-size: 15px;
  padding: 4px;
}
.install-steps {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 4px;
}
.install-step {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 11px 13px;
  font-size: 14px;
  line-height: 1.5;
}
.install-step__num {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  flex-shrink: 0;
}
.install-note {
  margin-top: 14px;
  background: var(--surface-2);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 13px;
  color: var(--ink-2);
  line-height: 1.6;
}
.install-installed {
  text-align: center;
  padding: 22px 10px;
}
.install-installed .big {
  font-size: 46px;
  margin-bottom: 6px;
}
.install-installed h3 {
  margin: 0 0 6px;
}
.install-installed p {
  color: var(--muted);
  font-size: 13px;
  margin: 0;
}

/* ---------- map ---------- */
.map-view {
  position: fixed;
  top: 0;
  bottom: calc(var(--nav-height) + var(--safe-bottom));
  inset-inline: 0;
  z-index: 500;
}
.map-view #map {
  position: absolute;
  inset: 0;
}
body.view-map main,
body.view-map #empty-state,
body.view-map #favorites-empty,
body.view-map #sentinel,
body.view-map #loading,
body.view-map .install-banner {
  display: none !important;
}
body.view-map .search-row,
body.view-map #quick-chips,
body.view-map #chips {
  display: none;
}
body.view-map .leaflet-top {
  top: calc(104px + var(--safe-top));
}
.leaflet-popup-content {
  font-family: inherit;
  direction: rtl;
  text-align: right;
}
.shelter-marker-dim {
  opacity: 0.35;
}
.map-popup-btn {
  margin-top: 6px;
  padding: 4px 10px;
  font: inherit;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
}

/* ---------- grid + cards ---------- */
main {
  max-width: 1280px;
  margin: 0 auto;
  padding: 14px 14px calc(84px + var(--safe-bottom));
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: 14px;
}
.card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  content-visibility: auto;
  contain-intrinsic-size: 380px;
  animation: fade-up 0.25s ease both;
}
@media (prefers-reduced-motion: reduce) {
  .card {
    animation: none;
  }
}
.card:nth-child(2) { animation-delay: 0.02s; }
.card:nth-child(3) { animation-delay: 0.04s; }
.card:nth-child(4) { animation-delay: 0.06s; }
.card:nth-child(5) { animation-delay: 0.08s; }
.card:nth-child(6) { animation-delay: 0.1s; }
.card.fav {
  border-color: var(--amber);
  box-shadow: 0 0 0 1px var(--amber), var(--shadow);
}
.badge-new {
  position: absolute;
  top: 8px;
  inset-inline-end: 8px;
  z-index: 2;
  background: var(--pos);
  color: #fff;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  animation: badge-pulse 2.4s ease-in-out 3;
}
@media (prefers-reduced-motion: reduce) {
  .badge-new {
    animation: none;
  }
}
.badge-gone {
  position: absolute;
  top: 8px;
  inset-inline-end: 8px;
  z-index: 2;
  background: var(--muted);
  color: #fff;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}
.fav-btn {
  position: absolute;
  top: 8px;
  inset-inline-start: 8px;
  z-index: 3;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.1);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(4px);
  font-size: 20px;
  color: color-mix(in srgb, var(--muted) 80%, transparent);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: transform 0.15s ease, color 0.15s ease;
}
.fav-btn:active {
  transform: scale(0.9);
}
.card.fav .fav-btn {
  color: var(--amber);
  background: var(--surface);
}
.fav-btn.pop {
  animation: heart-pop 0.45s ease;
}
.photo {
  display: block;
  aspect-ratio: 4 / 3;
  background: var(--surface-2);
  overflow: hidden;
  position: relative;
  cursor: pointer;
}
.photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.35s ease;
}
.card:active .photo img {
  transform: scale(1.02);
}
.photo.no-img {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 13px;
}
.photo.no-img img {
  display: none;
}
.img-count {
  position: absolute;
  bottom: 8px;
  inset-inline-start: 8px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  padding: 2px 7px;
  border-radius: 6px;
  font-size: 11px;
  z-index: 2;
}
.body {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.body h2 {
  margin: 0;
  font-size: 17px;
}
.body h2 a {
  color: var(--ink);
  text-decoration: none;
}
.meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}
.shelter {
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dist {
  flex-shrink: 0;
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.chip {
  background: var(--surface-2);
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11.5px;
}
.chip-pos {
  background: var(--pos-bg);
  color: var(--pos);
}
.chip-muted {
  background: transparent;
  color: var(--muted);
  font-style: italic;
  padding: 0;
}
.bio {
  margin: 2px 0 0;
  font-size: 13px;
  color: var(--ink-2);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.contact {
  font-size: 11.5px;
  color: var(--muted);
}
.card__link {
  margin-top: 4px;
  color: var(--accent);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

/* ---------- skeletons ---------- */
.skeleton-card {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--surface);
}
.sk {
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 37%, var(--surface-2) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
}
@media (prefers-reduced-motion: reduce) {
  .sk {
    animation: none;
  }
}
.sk-photo {
  aspect-ratio: 4 / 3;
}
.sk-body {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.sk-line {
  height: 12px;
  border-radius: 6px;
}
.sk-line.short {
  width: 55%;
}

/* ---------- empty + loading ---------- */
.empty {
  max-width: 480px;
  margin: 48px auto;
  padding: 32px 20px calc(84px + var(--safe-bottom));
  text-align: center;
  color: var(--muted);
}
.empty__icon {
  font-size: 52px;
  margin-bottom: 8px;
  animation: float 3s ease-in-out infinite;
}
@media (prefers-reduced-motion: reduce) {
  .empty__icon {
    animation: none;
  }
}
.empty h3 {
  margin: 0 0 8px;
  color: var(--ink);
  font-size: 18px;
}
.empty p {
  margin: 0 0 18px;
  font-size: 14px;
}
.loading {
  padding: 60px 20px;
  text-align: center;
  color: var(--muted);
}
.paw-loading {
  font-size: 40px;
  animation: paw-bounce 0.9s ease-in-out infinite alternate;
}
@media (prefers-reduced-motion: reduce) {
  .paw-loading {
    animation: none;
  }
}

/* ---------- bottom navigation ---------- */
.bottom-nav {
  position: fixed;
  bottom: 0;
  inset-inline: 0;
  z-index: 2000;
  display: flex;
  height: calc(var(--nav-height) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: var(--nav-bg);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
}
.nav-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 11px;
  padding: 4px 0;
  transition: color 0.15s ease, transform 0.12s ease;
}
.nav-btn:active {
  transform: scale(0.95);
}
.nav-btn[aria-selected="true"] {
  color: var(--accent);
  font-weight: 600;
}
.nav-btn__icon {
  position: relative;
  font-size: 20px;
  line-height: 1;
}
.nav-btn__badge {
  position: absolute;
  top: -5px;
  inset-inline-end: -12px;
  background: var(--amber);
  color: #fff;
  border-radius: 999px;
  font-size: 10px;
  min-width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  font-weight: 500;
}

/* ---------- buttons ---------- */
.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 11px 18px;
  font-weight: 600;
  box-shadow: 0 2px 8px color-mix(in srgb, var(--accent) 30%, transparent);
}
.primary:active {
  transform: translateY(1px);
}
.primary:disabled {
  opacity: 0.55;
  box-shadow: none;
}
.ghost {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 16px;
  color: var(--muted);
}
.ghost:active {
  background: var(--surface-2);
  color: var(--ink);
}
.wide {
  width: 100%;
}

/* ---------- sheets ---------- */
.backdrop {
  position: fixed;
  inset: 0;
  background: rgba(20, 18, 15, 0.45);
  z-index: 3000;
  backdrop-filter: blur(2px);
}
.sheet {
  position: fixed;
  z-index: 3100;
  inset-inline: 0;
  bottom: 0;
  max-height: 88vh;
  background: var(--bg);
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  padding-bottom: var(--safe-bottom);
  animation: sheet-up 0.22s ease;
}
@keyframes sheet-up {
  from {
    transform: translateY(24px);
    opacity: 0;
  }
  to {
    transform: none;
    opacity: 1;
  }
}
@media (prefers-reduced-motion: reduce) {
  .sheet {
    animation: none;
  }
}
.sheet__handle {
  width: 44px;
  height: 5px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--muted) 35%, transparent);
  margin: 8px auto 0;
  flex-shrink: 0;
}
.sheet__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 18px 6px;
}
.sheet__head h2 {
  margin: 0;
  font-size: 18px;
}
.sheet__close {
  border: none;
  background: transparent;
  font-size: 18px;
  color: var(--muted);
  width: 40px;
  height: 40px;
  border-radius: 50%;
}
.sheet__body {
  padding: 8px 18px 18px;
  overflow-y: auto;
}
.sheet__actions {
  display: flex;
  gap: 10px;
  padding: 10px 18px 16px;
  border-top: 1px solid var(--line);
  background: var(--bg);
}
.sheet__actions .primary {
  flex: 1;
}
.sheet--tall {
  height: 90vh;
}

/* filter sheet */
.f-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.f-grid label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: var(--muted);
}
.f-grid select {
  font: inherit;
  font-size: 14px;
  color: var(--ink);
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  width: 100%;
}
.gf-title {
  margin: 14px 0 6px;
  font-size: 13px;
  color: var(--muted);
}
.gf-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.gf {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 13px;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}
.gf input {
  accent-color: var(--accent);
}
.gf.unavailable {
  opacity: 0.45;
}
.gf .opt-count {
  color: var(--muted);
  font-size: 11px;
}
.opt-count.zero {
  opacity: 0.5;
}
.toggle-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}
.toggle {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 13px;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}
.toggle input {
  accent-color: var(--accent);
}
.mini-count {
  background: var(--amber);
  color: #fff;
  border-radius: 999px;
  padding: 0 6px;
  font-size: 11px;
}
.mini-count.opt {
  background: none;
  color: var(--muted);
  padding: 0;
}

/* location sheet */
.or {
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  margin: 14px 0 8px;
}
.addr-row {
  display: flex;
  gap: 8px;
}
.addr-row input {
  flex: 1;
  min-width: 0;
  font: inherit;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
}
.radius-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 18px;
}
.radius-chip {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 999px;
  padding: 7px 15px;
  font-size: 13px;
}
.radius-chip[aria-pressed="true"] {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 600;
}
#loc-sheet h3 {
  margin: 0;
  font-size: 14px;
}

/* status sheet */
.status-grid {
  display: grid;
  gap: 10px;
}
.status-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
}
.status-card h3 {
  margin: 0 0 6px;
  font-size: 14px;
}
.status-line {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 13px;
  padding: 3px 0;
  border-bottom: 1px dashed var(--line);
}
.status-line:last-child {
  border-bottom: none;
}
.status-ok {
  color: var(--pos);
  font-weight: 600;
}
.status-bad {
  color: var(--danger);
  font-weight: 600;
}
.status-warn {
  color: var(--amber);
  font-weight: 600;
}

/* ---------- about ---------- */
.about-hero {
  text-align: center;
  padding: 8px 0 14px;
}
.about-hero .paw {
  font-size: 44px;
}
.about-hero h3 {
  margin: 6px 0 4px;
  font-size: 18px;
}
.about-hero p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}
.about-section {
  margin-top: 16px;
}
.about-section h4 {
  margin: 0 0 8px;
  font-size: 14px;
  color: var(--muted);
  font-weight: 600;
}
.about-source {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  margin-bottom: 8px;
  text-decoration: none;
  color: var(--ink);
}
.about-source__emoji {
  font-size: 22px;
  flex-shrink: 0;
}
.about-source__body {
  flex: 1;
  min-width: 0;
}
.about-source__name {
  font-weight: 600;
  font-size: 14px;
}
.about-source__desc {
  color: var(--muted);
  font-size: 12px;
}
.about-source__count {
  color: var(--muted);
  font-size: 12px;
  flex-shrink: 0;
}
.about-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.about-links a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 13px;
  text-decoration: none;
  color: var(--ink);
}
.theme-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.theme-option {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 13px;
}
.theme-option[aria-pressed="true"] {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 600;
}
.about-note {
  background: var(--surface-2);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 13px;
  color: var(--ink-2);
  line-height: 1.6;
}
.about-version {
  text-align: center;
  color: var(--muted);
  font-size: 11px;
  margin-top: 16px;
}

/* chat */
.sheet--chat {
  height: 88vh;
}
.chat-log {
  flex: 1;
  overflow-y: auto;
  padding: 10px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.msg {
  max-width: 88%;
  padding: 10px 13px;
  border-radius: 16px;
  font-size: 14px;
  white-space: pre-wrap;
  word-break: break-word;
}
.msg--user {
  align-self: flex-start;
  background: var(--accent);
  color: #fff;
  border-bottom-right-radius: 6px;
}
.msg--bot {
  align-self: flex-end;
  background: var(--surface);
  border: 1px solid var(--line);
  border-bottom-left-radius: 6px;
}
.msg--error {
  align-self: flex-end;
  background: var(--danger-bg);
  border: 1px solid var(--danger-line);
  color: var(--danger);
}
.msg__thumbs {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
}
.msg__thumb {
  flex-shrink: 0;
  width: 74px;
  border: none;
  background: none;
  padding: 0;
  font-size: 11px;
  color: var(--ink);
}
.msg__thumb img {
  width: 74px;
  height: 74px;
  object-fit: cover;
  border-radius: 10px;
  display: block;
}
.msg__thumb span {
  display: block;
  margin-top: 3px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.msg__apply {
  margin-top: 10px;
  border: none;
  background: var(--amber);
  color: #fff;
  font-weight: 600;
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 13px;
}
.chat-form {
  display: flex;
  gap: 8px;
  padding: 10px 14px 6px;
  border-top: 1px solid var(--line);
  background: var(--bg);
}
.chat-form input {
  flex: 1;
  min-width: 0;
  font: inherit;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink);
}
.chat-hint {
  padding: 4px 18px calc(12px + var(--safe-bottom));
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}
.typing {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
}
.typing i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--muted);
  animation: blink 1s infinite alternate;
}
.typing i:nth-child(2) {
  animation-delay: 0.2s;
}
.typing i:nth-child(3) {
  animation-delay: 0.4s;
}
@keyframes blink {
  from {
    opacity: 0.25;
  }
  to {
    opacity: 1;
  }
}
@media (prefers-reduced-motion: reduce) {
  .typing i {
    animation: none;
  }
}

/* ---------- lightbox ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 5000;
  background: rgba(20, 18, 15, 0.88);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  animation: fade-in 0.18s ease;
}
.lb-inner {
  background: var(--surface);
  border-radius: 16px;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  width: 100%;
  max-width: 1100px;
  max-height: 92vh;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.4);
}
@media (max-width: 800px) {
  .lb-inner {
    grid-template-columns: 1fr;
    max-height: 95dvh;
    border-radius: 14px;
  }
}
.lb-photo {
  position: relative;
  background: #16130f;
  aspect-ratio: 4 / 3;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
@media (max-width: 800px) {
  .lb-photo {
    aspect-ratio: auto;
    height: 42dvh;
    flex-shrink: 0;
  }
}
.lb-photo img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
}
.lb-img-prev,
.lb-img-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.88);
  border: none;
  font-size: 24px;
  line-height: 1;
  color: #2a2a2a;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.lb-img-prev {
  right: 10px;
}
.lb-img-next {
  left: 10px;
}
.lb-img-prev[hidden],
.lb-img-next[hidden] {
  display: none;
}
.lb-counter {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  direction: ltr;
}
.lb-fav {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  border: none;
  font-size: 22px;
  color: #999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.lb-fav.active {
  color: var(--amber);
  background: #fff;
}
.lb-fav.pop {
  animation: heart-pop 0.45s ease;
}
@media (max-width: 800px) {
  .lb-fav {
    left: 10px;
    right: auto;
  }
}
.heart-burst {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 90px;
  pointer-events: none;
  animation: heart-burst 0.7s ease forwards;
  z-index: 5;
}
.heart-fly {
  position: fixed;
  z-index: 7000;
  font-size: 34px;
  pointer-events: none;
  animation: heart-fly 0.8s ease-in forwards;
}
.lb-info {
  padding: 20px 22px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.lb-info h2 {
  margin: 0;
  font-size: 24px;
}
.lb-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
}
.lb-shelter {
  font-weight: 500;
}
.lb-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.lb-bio {
  font-size: 14px;
  line-height: 1.7;
  color: var(--ink-2);
  white-space: pre-wrap;
  max-height: 200px;
  overflow-y: auto;
  padding: 10px 12px;
  background: var(--surface-3);
  border-radius: 10px;
  border: 1px solid var(--line);
}
@media (max-width: 800px) {
  .lb-bio {
    max-height: none;
    overflow: visible;
  }
}
.lb-contact {
  font-size: 13px;
  color: var(--muted);
  padding: 8px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.lb-contact > div {
  padding: 2px 0;
}
.lb-actions {
  display: flex;
  gap: 8px;
  margin-top: auto;
}
.lb-source {
  flex: 1;
  background: var(--accent);
  color: #fff;
  padding: 11px 14px;
  border-radius: 10px;
  text-align: center;
  font-weight: 500;
  text-decoration: none;
}
.lb-whatsapp {
  background: var(--wa);
  color: #fff;
  padding: 11px 14px;
  border-radius: 10px;
  text-align: center;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}
.lb-close {
  position: absolute;
  top: calc(14px + var(--safe-top));
  right: 14px;
  z-index: 5001;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  border: none;
  font-size: 20px;
  backdrop-filter: blur(4px);
}
.lb-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 5001;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  border: none;
  font-size: 30px;
  line-height: 1;
  backdrop-filter: blur(4px);
}
.lb-prev {
  right: 12px;
}
.lb-next {
  left: 12px;
}
@media (max-width: 800px) {
  .lb-nav {
    display: none;
  }
}

/* review mode */
body.review-mode .topbar,
body.review-mode .map-view,
body.review-mode main,
body.review-mode .bottom-nav,
body.review-mode .install-banner,
body.review-mode #empty-state,
body.review-mode #favorites-empty,
body.review-mode #sentinel {
  display: none !important;
}
body.review-mode .lightbox {
  padding: 0;
  background: #14110d;
}
body.review-mode .lb-inner {
  max-height: none;
  height: 100dvh;
  border-radius: 0;
  max-width: none;
}

/* ---------- compare ---------- */
.compare-inner {
  background: var(--surface);
  border-radius: 16px;
  overflow: hidden;
  width: 100%;
  max-width: 1400px;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
}
.compare-header {
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  background: var(--surface-3);
  flex-wrap: wrap;
}
.compare-header h2 {
  margin: 0;
  font-size: 18px;
}
.compare-grid {
  flex: 1;
  overflow: auto;
  padding: 16px;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(270px, 1fr);
  gap: 14px;
  align-items: start;
}
.cmp-col {
  position: relative;
  background: var(--surface-3);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.cmp-remove {
  position: absolute;
  top: 8px;
  inset-inline-start: 8px;
  z-index: 2;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(0, 0, 0, 0.1);
  color: #999;
  font-size: 14px;
}
.cmp-photo {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  display: block;
  background: var(--surface-2);
}
.cmp-photo.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 13px;
}
.cmp-body {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.cmp-name {
  margin: 0;
  font-size: 18px;
}
.cmp-meta {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted);
}
.cmp-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.cmp-bio {
  font-size: 13px;
  line-height: 1.6;
  color: var(--ink-2);
  max-height: 150px;
  overflow-y: auto;
  padding: 8px 10px;
  background: var(--surface);
  border-radius: 8px;
  border: 1px solid var(--line);
  white-space: pre-wrap;
}
.cmp-contact {
  font-size: 12px;
  color: var(--muted);
}
.cmp-actions {
  display: flex;
  gap: 6px;
  margin-top: auto;
}
.cmp-source,
.cmp-whatsapp {
  flex: 1;
  padding: 7px 10px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 500;
  text-decoration: none;
  text-align: center;
}
.cmp-source {
  background: var(--accent);
  color: #fff;
}
.cmp-whatsapp {
  background: var(--wa);
  color: #fff;
}

/* ---------- toast ---------- */
.toast {
  position: fixed;
  bottom: calc(var(--nav-height) + 16px + var(--safe-bottom));
  inset-inline: 0;
  margin: 0 auto;
  width: max-content;
  max-width: 90vw;
  background: color-mix(in srgb, var(--ink) 92%, transparent);
  color: var(--bg);
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 13px;
  z-index: 6000;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
}

/* confetti canvas */
#confetti-canvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 7000;
}

/* ---------- keyframes ---------- */
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes shimmer {
  from {
    background-position: 100% 0;
  }
  to {
    background-position: -100% 0;
  }
}
@keyframes heart-pop {
  0% {
    transform: scale(0.7);
  }
  55% {
    transform: scale(1.35);
  }
  100% {
    transform: scale(1);
  }
}
@keyframes heart-burst {
  0% {
    opacity: 0;
    transform: scale(0.3);
  }
  35% {
    opacity: 1;
    transform: scale(1.15);
  }
  100% {
    opacity: 0;
    transform: scale(1.6);
  }
}
@keyframes heart-fly {
  0% {
    opacity: 1;
    transform: scale(1);
  }
  100% {
    opacity: 0;
    transform: scale(0.4) translateY(-180px);
  }
}
@keyframes badge-pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.08);
  }
}
@keyframes paw-bounce {
  from {
    transform: translateY(0) rotate(-8deg);
  }
  to {
    transform: translateY(-10px) rotate(8deg);
  }
}
@keyframes float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-6px);
  }
}
