:root {
  font-family:
    "Plus Jakarta Sans",
    system-ui,
    -apple-system,
    sans-serif;
  color: #183b37;
  background: #f4f8f6;
  font-synthesis: none;
  --accent: #08796b;
  --ink: #163d36;
  --line: #d8e5df;
  --pale: #e7f3ed;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 42px;
  padding: 9px 16px;
  border: 0;
  background: var(--accent);
  color: white;
  font-weight: 650;
  border-radius: 12px;
  cursor: pointer;
}
button:disabled {
  opacity: 0.55;
  cursor: wait;
}
.secondary {
  background: var(--pale);
  color: var(--ink);
}
.danger {
  background: #982d3f;
}
.bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  background: white;
  border-bottom: 1px solid var(--line);
  padding: calc(12px + env(safe-area-inset-top))
    max(16px, calc((100% - 840px) / 2)) 12px;
  min-height: 65px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-weight: 850;
  font-size: 1.45rem;
  letter-spacing: -0.045em;
}
.brand img {
  height: 38px;
  width: 38px;
  border-radius: 12px;
  object-fit: cover;
}
.bar div {
  display: flex;
  gap: 15px;
  font-size: 0.88rem;
  font-weight: 650;
}
main {
  max-width: 840px;
  margin: auto;
  padding: 24px 16px calc(102px + env(safe-area-inset-bottom));
  min-height: 75vh;
}
h1 {
  font-size: clamp(1.65rem, 5vw, 2.35rem);
  line-height: 1.1;
  letter-spacing: -0.045em;
  margin: 0 0 10px;
}
h2 {
  font-size: 1.18rem;
  margin: 24px 0 12px;
  letter-spacing: -0.02em;
}
p {
  line-height: 1.5;
}
.head,
.row,
.actions,
.chips {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.head {
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 14px;
}
.muted,
small {
  color: #526e64;
}
.chips {
  margin: 12px 0;
}
.chips a {
  border: 1px solid var(--line);
  background: white;
  border-radius: 24px;
  padding: 7px 13px;
  font-size: 0.88rem;
}
.chips .active {
  background: var(--ink);
  color: white;
}
.panel,
.card,
form.panel {
  background: white;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 16px;
  margin: 12px 0;
}
.card {
  display: flex;
  align-items: center;
  gap: 13px;
  margin: 9px 0;
  padding: 11px;
  color: inherit;
}
.card strong {
  display: block;
}
.card small {
  display: block;
  margin-top: 3px;
}
.photo {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 13px;
  background: var(--pale);
}
.hero-photo {
  width: 100%;
  max-height: 340px;
  object-fit: cover;
  border-radius: 18px;
}
.empty {
  padding: 16px;
  color: #546e63;
  border: 1px dashed var(--line);
  border-radius: 14px;
}
.map {
  height: clamp(245px, 44vh, 430px);
  border-radius: 20px;
  background: #deece5;
  z-index: 0;
  isolation: isolate;
}
.pin {
  color: #fff;
  background: #08796b;
  border: 2px solid white;
  border-radius: 50%;
  text-align: center;
  font-weight: 800;
  box-shadow: 0 1px 5px #0005;
}
.pin.lost {
  background: #a52841;
}
.pin.feed {
  background: #99571b;
}
nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 10;
  display: flex;
  justify-content: center;
  background: white;
  border-top: 1px solid var(--line);
  padding: 7px 8px calc(8px + env(safe-area-inset-bottom));
  gap: clamp(2px, 4vw, 45px);
}
nav a {
  min-width: 46px;
  text-align: center;
  font-size: 0.72rem;
  color: #546a62;
  font-weight: 650;
  padding: 2px 5px;
}
nav a span {
  display: block;
  font-size: 1.38rem;
  height: 28px;
}
nav a[aria-current] {
  color: var(--accent);
  background: #ebf7f0;
  border-radius: 10px;
}
label {
  display: grid;
  gap: 5px;
  margin: 12px 0;
  color: var(--ink);
  font-weight: 630;
  font-size: 0.92rem;
}
input,
select,
textarea {
  background: #fff;
  width: 100%;
  color: var(--ink);
  border: 1px solid #acc4b8;
  padding: 10px 12px;
  border-radius: 9px;
  min-height: 42px;
}
textarea {
  min-height: 88px;
}
input[type="checkbox"] {
  width: 20px;
  min-height: 20px;
}
.check {
  display: flex;
  align-items: center;
}
.cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.actions {
  margin: 12px 0;
}
.error {
  color: #942640;
}
.message {
  border-bottom: 1px solid var(--line);
  padding: 10px 0;
  margin: 0;
  overflow-wrap: anywhere;
}
.message:last-child {
  border: 0;
}
#toast {
  position: fixed;
  bottom: 85px;
  left: 50%;
  transform: translateX(-50%);
  max-width: min(88vw, 430px);
  z-index: 50;
  background: #153b34;
  color: #fff;
  border-radius: 12px;
  padding: 10px 16px;
  box-shadow: 0 5px 20px #0003;
}
.qr {
  width: 190px;
  height: 190px;
}
.avatar {
  width: 85px;
  height: 85px;
  object-fit: cover;
  border-radius: 20px;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid #c2801a;
  outline-offset: 2px;
}
fieldset {
  border: 0;
  padding: 0;
}
details {
  margin: 14px 0;
}
summary {
  cursor: pointer;
  font-weight: 650;
}
table {
  border-collapse: collapse;
  width: 100%;
  text-align: left;
}
td,
th {
  border-bottom: 1px solid var(--line);
  padding: 9px;
  overflow-wrap: anywhere;
}
pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
@media (max-width: 520px) {
  .cols {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .bar {
    padding-left: 14px;
    padding-right: 14px;
  }
  .bar div {
    gap: 10px;
  }
  .panel {
    padding: 14px;
  }
  h2 {
    margin-top: 20px;
  }
}
.no-photo { display: grid; place-items: center; font-size: 1.5rem; font-weight: 750; color: #087f72; background: #e5f2ee; }
.pin { overflow: hidden; line-height: 30px; }
.pin img { width: 100%; height: 100%; object-fit: cover; }
body[data-route="map"] .bar { display: none; }
body[data-route="map"] #view { max-width: none; padding: 0 0 calc(90px + env(safe-area-inset-bottom)); }
.map-stage { position: relative; background: #e7eee9; }
.map-stage .map { height: clamp(310px,56vh,570px); border-radius: 0; }
.map-controls { position: absolute; z-index: 2; inset: calc(12px + env(safe-area-inset-top)) 12px auto; max-width: 740px; margin: auto; pointer-events: none; }
.map-controls > * { pointer-events: auto; }
.map-search-row, .map-filters, .map-quick, .sheet-title { display: flex; align-items: center; gap: 8px; }
.map-search-row form { display: flex; align-items: center; background: white; border: 1.5px solid #087f72; border-radius: 28px; flex: 1; gap: 8px; padding: 3px 6px 3px 14px; min-width: 0; box-shadow: 0 2px 8px #14382e12; }
.map-search-row form > span:first-child { color: #087f72; font-size: 22px; }
.map-search-row input { border: 0; background: transparent; min-width: 0; padding: 5px 0; min-height: 36px; font-size: 14px; }
.map-search-row button { color: #006b5f; background: #eff5f3; border-radius: 20px; font-size: 12px; min-height: 32px; padding: 5px 9px; }
.map-search-row .error:empty { display: none; }
.map-notices { display: grid; place-items: center; background: white; color: #087f72; border: 1px solid; border-radius: 50%; width: 43px; height: 43px; }
.map-filters { align-items: flex-start; gap: 6px; margin-top: 8px; }
.map-filters details { position: relative; margin: 0; }
.map-filters summary,.map-filters .lost-action,.map-quick .button,.map-quick button { display: block; list-style: none; background: white; border: 1px solid #087f72; color: #145e54; border-radius: 22px; font-weight: 650; font-size: .77rem; padding: 8px 10px; box-shadow: 0 2px 6px #14382e14; }
.map-filters summary::-webkit-details-marker { display: none; }
.map-filters .lost-action { color: #af3035; border-color: #cb777b; }
.map-filters .filter-menu,.map-filters form { position: absolute; top: 100%; min-width: 140px; background: white; margin: 5px 0; border-radius: 14px; padding: 8px; box-shadow: 0 5px 20px #14382e30; z-index: 1; }
.map-filters .filter-menu a { display: block; padding: 6px 8px; }
.map-filters .filter-menu .active { font-weight: 750; color: var(--ink); }
.map-stage .tile-state { position: absolute; left: 12px; bottom: 77px; max-width: 70%; background: white; border-radius: 9px; font-size: 11px; }
.map-stage .tile-state:not(:empty) { padding: 5px 8px; }
.map-quick { position: absolute; bottom: 30px; left: 12px; }
.map-quick .button, .map-quick button { min-height: 34px; }
.map-sheet { background: white; border: 1px solid var(--line); border-radius: 26px 26px 0 0; position: relative; margin: -18px auto 0; max-width: 860px; padding: 10px 16px 24px; min-height: 29vh; }
.sheet-handle { width: 42px; height: 5px; border-radius: 4px; background: #dcede9; margin: 0 auto 14px; }
.sheet-title { justify-content: space-between; }
.sheet-title h1 { font-size: 1.18rem; margin: 0; font-weight: 750; }
.sheet-title .button { border-radius: 20px; min-height: 36px; font-size: .82rem; }

.map-stage .leaflet-bottom { bottom: 20px; }

.city-picker { position: relative; margin: 12px 0; }
.city-picker label { margin: 0 0 5px; }
.city-options { background: white; margin: 4px 0; border: 1px solid var(--line); border-radius: 12px; padding: 4px; max-height: 176px; overflow-y: auto; color: var(--ink); }
.city-options button { text-align: left; display: block; width: 100%; background: white; color: var(--ink); border-radius: 8px; padding: 8px 12px; font-size: .88rem; }
.city-options button:hover, .city-options button[aria-selected="true"] { background: var(--pale); }
.map-filters .city-menu { position: static; min-width: 0; }
.city-menu summary { max-width: 38vw; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.map-filters .city-menu form { inset: 100% 0 auto; width: min(100%, 340px); padding: 12px; }
.city-menu .city-picker { margin: 0 0 8px; }
.map-controls:has(details[open]) { z-index: 4; }
.gps-feedback { background: #f7f3df; padding: 12px 16px; border-radius: 12px; margin: 8px auto 22px; max-width: 720px; font-size: .88rem; }
.gps-feedback button { margin: 4px 0 0 5px; min-height: 36px; }
.chosen-pin { border: 3px solid white; background: #037568; border-radius: 50%; box-shadow: 0 0 0 5px #09786a38; }
.pin.approx { outline: 2px dashed #19786c; outline-offset: 2px; }
.pin-list { display: grid; gap: 7px; max-height: 180px; overflow: auto; }
.pet-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(min(100%,148px),1fr)); gap: 12px; margin: 14px 0; }
.pet-grid .empty { grid-column: 1 / -1; }
.pet-grid .pet-card { display: flex; flex-direction: column; align-items: stretch; gap: 0; margin: 0; padding: 0; overflow: hidden; border-radius: 17px; box-shadow: 0 2px 12px #123c300a; transition: box-shadow .18s ease; }
.pet-card:focus-visible, .pet-card:hover { box-shadow: 0 4px 18px #123c3026; }
.pet-cover { position: relative; aspect-ratio: 4/3; overflow: hidden; display: grid; place-items: center; background: linear-gradient(145deg,#c7e9df,#ecf4e2); }
.pet-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pet-initial { font-size: 2.5rem; color: #397766; font-weight: 750; }
.pet-status { position: absolute; left: 8px; bottom: 8px; font-size: .66rem; line-height: 1.3; font-weight: 700; color: #124d43; background: #fffffff0; border-radius: 14px; padding: 4px 8px; }
.pet-status.lost { color: #982a36; background: #fff1f1; }
.pet-caption { padding: 10px 12px 12px; overflow-wrap: anywhere; }
.pet-caption strong { font-size: 1.04rem; letter-spacing: -.025em; }
.pet-caption small { color: #49655c; font-size: .76rem; }
.pet-caption .approx-label { font-size: .68rem; color: #507167; }
.pet-location { margin: 12px 0; padding: 12px 16px; display: flex; align-items: center; gap: 8px; justify-content: space-between; border-radius: 15px; background: #edf6f2; font-size: .85rem; }
.return-map { display: inline-block; padding: 8px 0; font-weight: 650; }
@media(max-width: 480px) {
  .pet-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
  .city-search, .panel input:not([type="hidden"]), .panel select { font-size: 16px; }
  .map-filters summary, .map-filters .lost-action { padding: 8px; }
}
.species-tabs { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 3px; margin-top: 12px; padding: 3px; background: #edf4f1; border-radius: 22px; }
.species-tabs a { display: inline-block; padding: 7px 14px; line-height: 1.35; font-size: .84rem; font-weight: 650; border-radius: 22px; color: #3f6158; }
.species-tabs a[aria-current] { background: #126a5b; color: #fff; }
.directory-head { display:flex; align-items:center; justify-content:space-between; gap:18px; padding:clamp(18px,3vw,30px); background:#eaf5ef; border-radius:24px; border:1px solid #d6e6de; }
.directory-head h1 { margin:0; letter-spacing:-.04em; }
.directory-head p { margin:8px 0 0; color:#466259; max-width:43ch; }
.directory-head .button { flex:none; }
.directory-tools,.circle-meta { display:flex; align-items:center; flex-wrap:wrap; gap:12px; margin:12px 0; }
.directory-tools { justify-content:space-between; }
.directory-tools .species-tabs { margin:0; }
.text-action { color:#006b5f; display:inline-block; padding:8px 0; font-weight:700; }
.directory-filter { margin:12px 0 18px; background:white; padding:10px 14px; border:1px solid var(--line); border-radius:13px; }
.directory-filter summary { padding:3px 0; }
.directory-filter form.panel { margin:0; padding:4px 0; box-shadow:none; border:0; }
.directory-list { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,270px),1fr)); gap:12px; }
.directory-list .card { min-width:0; margin:0; align-items:flex-start; padding:16px; }
.directory-thumb { flex:0 0 62px; height:62px; display:grid; place-items:center; background:#dcefe6; color:#246958; border-radius:16px; overflow:hidden; font-size:1.7rem; font-weight:750; }
.directory-thumb img { width:100%; height:100%; object-fit:cover; }
.directory-body { min-width:0; overflow-wrap:anywhere; }
.directory-body strong { line-height:1.35; margin:2px 0 4px; }
.directory-body small,.circle-meta span { color:#256a59; font-size:.77rem; font-weight:650; }
.directory-body span,.directory-body p { color:#53665e; font-size:.88rem; }
.directory-body p { display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; margin:6px 0 0; }
.circle-meta span { padding:5px 10px; background:#e8f3ed; border-radius:20px; }
.card.post-card { display:grid; gap:10px; padding:16px; }
.post-card header { display:flex; justify-content:space-between; align-items:baseline; flex-wrap:wrap; gap:5px; }
.post-card strong { white-space:pre-wrap; overflow-wrap:anywhere; }
.post-card img { width:100%; max-height:340px; object-fit:contain; border-radius:12px; background:#f3f7f4; }
.post-card > span { font-size:.8rem; font-weight:650; color:#196b5c; }
.walk-choice { display:flex; align-items:flex-start; gap:10px; padding:12px; border-radius:12px; background:#eff6f1; }
.walk-choice input { flex:none; margin:3px 0; }
.walk-choice small { display:block; margin-top:4px; color:#4b6559; font-weight:450; }
@media(max-width:540px) { .directory-head { align-items:flex-start; flex-direction:column; gap:12px; } .species-tabs a { padding:7px 10px; } }

.walk-choice[hidden]{display:none}

.scan-preview{display:block;max-width:100%;max-height:240px;object-fit:contain;border-radius:16px;margin:8px auto}.scan-preview[hidden]{display:none}
