/* ----------  Base  ---------- */
:root {
  --paw:        #ff8a3d;          /* warm tangerine */
  --paw-dark:   #d96a1c;
  --milk:       #fff8f1;          /* cream */
  --ink:        #2b1d12;
  --ink-soft:   #6b5747;
  --line:       #f0d8c1;
  --tag-bg:     #ffe9d6;
  --tag-ink:    #8a4a14;
  --shadow:     0 6px 24px rgba(120, 60, 0, 0.10);
  --shadow-lg:  0 18px 60px rgba(120, 60, 0, 0.18);
  --radius:     14px;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  background: var(--milk);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}
a { color: var(--paw-dark); }
a:hover { color: var(--ink); }

button { font: inherit; cursor: pointer; }
input, select, button { font-family: inherit; }

.muted { color: var(--ink-soft); }

/* ----------  Hero  ---------- */
.hero {
  position: relative;
  background:
    radial-gradient(circle at 20% 0%, rgba(255,180,120,0.5) 0 22%, transparent 40%),
    radial-gradient(circle at 85% 10%, rgba(255,200,160,0.5) 0 18%, transparent 35%),
    linear-gradient(135deg, #ff8030 0%, #f06014 50%, #c83a08 100%);
  color: #fff;
  padding: 56px 24px 110px;
  overflow: hidden;
}
@media (max-width: 600px) {
  .hero { padding: 36px 18px 80px; }
  .hero-mark .paw { width: 56px; height: 56px; font-size: 32px; }
  .mark-text strong { font-size: 24px; }
  .mark-text em { font-size: 13px; }
  .hero-tag { font-size: 14px; margin-bottom: 16px; }
  .hero-lang { top: 14px; right: 14px; padding: 6px 12px; font-size: 12px; }
  .searchbar { padding: 4px 4px 4px 14px; }
  .searchbar input { font-size: 15px; padding: 10px 4px; }
  .searchbar button { padding: 9px 14px; font-size: 14px; }
  .chips { gap: 6px; margin-top: 14px; }
  .chip { font-size: 12px; padding: 6px 10px; }
  .chip .count { display: none; }
}
.hero::before {
  content: '🐾  🦴  🐾  🐾  🦴  🐾  🐾  🦴  🐾';
  position: absolute; inset: 0;
  font-size: 90px; letter-spacing: 90px;
  color: rgba(255,255,255,0.07);
  white-space: nowrap; pointer-events: none;
  transform: rotate(-8deg) translate(-5%, 30%);
  user-select: none;
}
.hero-inner { max-width: 980px; margin: 0 auto; position: relative; z-index: 1; }
.hero-mark { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.hero-mark .paw {
  font-size: 44px;
  background: #fff;
  width: 70px; height: 70px;
  border-radius: 50%;
  display: grid; place-items: center;
  box-shadow: var(--shadow);
  transform: rotate(-12deg);
}
.mark-text { display: flex; flex-direction: column; line-height: 1.1; }
.mark-text strong {
  font-family: 'Fraunces', serif;
  font-weight: 800;
  font-size: clamp(28px, 4vw, 38px);
  letter-spacing: -0.01em;
}
.mark-text em {
  font-style: normal;
  font-weight: 500;
  opacity: 0.9;
  font-size: 16px;
  margin-top: 2px;
}
.hero-tag {
  font-size: clamp(16px, 1.6vw, 18px);
  max-width: 720px;
  margin: 0 0 28px;
  color: #fff;
  font-weight: 600;
  line-height: 1.5;
  text-shadow: 0 1px 2px rgba(60, 20, 0, 0.55), 0 0 16px rgba(60, 20, 0, 0.25);
}
.hero-tag .muted { color: #fff5e6; font-weight: 500; }
.hero-tag br + .muted { font-size: 0.92em; }

.searchbar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  border-radius: 999px;
  padding: 6px 6px 6px 18px;
  box-shadow: var(--shadow-lg);
  max-width: 640px;
}
.searchbar .search-icon { font-size: 18px; opacity: 0.6; }
.searchbar input {
  flex: 1;
  border: 0; outline: 0;
  padding: 12px 8px;
  font-size: 16px;
  background: transparent;
  color: var(--ink);
  min-width: 0;
}
.searchbar button {
  border: 0;
  background: var(--paw-dark);
  color: #fff;
  border-radius: 999px;
  padding: 11px 22px;
  font-weight: 600;
  transition: transform .12s, background .12s;
}
.searchbar button:hover { background: var(--ink); transform: translateY(-1px); }

.hero-stats {
  display: flex; gap: 18px; margin: 20px 0 0; flex-wrap: wrap;
}
.hero-stats .stat {
  background: rgba(255,255,255,0.16);
  border: 1px solid rgba(255,255,255,0.22);
  backdrop-filter: blur(6px);
  padding: 10px 18px; border-radius: 12px;
  display: flex; flex-direction: column; align-items: flex-start;
  color: #fff;
}
.hero-stats .stat strong {
  font-family: 'Fraunces', serif; font-weight: 700;
  font-size: 24px; line-height: 1; letter-spacing: -0.01em;
}
.hero-stats .stat span {
  font-size: 12px; opacity: 0.92; margin-top: 4px;
  text-transform: uppercase; letter-spacing: 0.06em;
}
@media (max-width: 600px) {
  .hero-stats { gap: 8px; margin-top: 14px; }
  .hero-stats .stat { padding: 8px 14px; flex: 1 1 auto; }
  .hero-stats .stat strong { font-size: 18px; }
  .hero-stats .stat span { font-size: 10px; }
}

.chips { margin-top: 18px; display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  background: rgba(255,255,255,0.92);
  color: var(--tag-ink);
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: transform .1s, box-shadow .1s;
}
.chip:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.chip[aria-pressed="true"] {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}
.chip .count {
  font-size: 11px;
  background: rgba(0,0,0,0.08);
  padding: 1px 7px;
  border-radius: 999px;
}
.chip[aria-pressed="true"] .count { background: rgba(255,255,255,0.18); color: #fff; }

.hero-wave {
  position: absolute;
  bottom: -1px; left: 0; right: 0;
  width: 100%; height: 80px;
  display: block;
}

.hero-lang {
  position: absolute; top: 18px; right: 22px;
  background: rgba(0,0,0,0.22);
  border: 1px solid rgba(255,255,255,0.4);
  color: #fff;
  padding: 8px 16px;
  border-radius: 999px;
  font-weight: 600; font-size: 13px;
  z-index: 5;
  cursor: pointer; transition: background .15s;
  backdrop-filter: blur(6px);
}
.hero-lang:hover { background: rgba(0,0,0,0.4); }

.card-actions {
  display: flex; align-items: center; gap: 12px;
  margin-top: 10px; flex-wrap: wrap;
}
.card-phone {
  font-size: 13px; font-weight: 600;
  color: var(--paw-dark); text-decoration: none;
  background: var(--tag-bg); padding: 4px 12px;
  border-radius: 999px;
}
.card-phone:hover { background: var(--paw); color: #fff; }
.afcd-pill {
  display: inline-block;
  background: #d2f3da; color: #1f6b30;
  padding: 1px 8px; border-radius: 999px;
  font-size: 11px; font-weight: 600;
}
.clinic-name a { color: inherit; text-decoration: none; }
.clinic-name a:hover { color: var(--paw-dark); }
[lang^="zh"] body, [data-lang="zh"] body { font-family: 'Noto Sans TC', 'Inter', system-ui, sans-serif; }

/* ----------  Layout  ---------- */
.layout {
  max-width: 1400px;
  margin: -32px auto 0;
  padding: 0 20px 40px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: 24px;
  position: relative;
  z-index: 2;
}
@media (max-width: 960px) {
  .layout { grid-template-columns: 1fr; padding: 0 14px 32px; }
  .map-pane { height: 50vh; position: static !important; min-height: 320px; }
  .clinic-card { padding: 14px 16px; }
  .clinic-name { font-size: 16px; }
  .card-actions { gap: 8px; }
}

.list-pane { min-width: 0; }
.list-head {
  display: flex; align-items: center; gap: 12px;
  margin: 8px 0 14px;
  flex-wrap: wrap;
}
.list-head h2 {
  font-family: 'Fraunces', serif;
  font-weight: 600;
  font-size: 22px;
  margin: 0;
  flex: 1 1 100%;
  min-width: 0;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.list-actions { display: flex; gap: 8px; flex-wrap: wrap; flex: 1 1 100%; }
.list-actions select, .list-actions .ghost {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 13px;
  color: var(--ink);
}
.list-actions .ghost[aria-pressed="true"] {
  background: var(--ink); color: #fff; border-color: var(--ink);
}

.results {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-direction: column; gap: 10px;
}
.clinic-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  cursor: pointer;
  transition: transform .12s, box-shadow .12s, border-color .12s;
}
.clinic-card:hover {
  border-color: var(--paw);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.clinic-card.is-active {
  border-color: var(--paw);
  box-shadow: 0 0 0 3px rgba(255,138,61,0.18), var(--shadow);
}
.clinic-name {
  font-family: 'Fraunces', serif;
  font-weight: 600;
  font-size: 18px;
  margin: 0 0 4px;
  color: var(--ink);
  display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap;
}
.clinic-name .zh { font-family: 'Inter', sans-serif; font-size: 14px; color: var(--ink-soft); font-weight: 500; }
.clinic-meta { font-size: 13px; color: var(--ink-soft); margin: 0 0 8px; }
.clinic-addr { font-size: 13px; color: var(--ink-soft); margin: 0; }
.clinic-tags { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12px; font-weight: 500;
  padding: 3px 10px; border-radius: 999px;
  background: var(--tag-bg); color: var(--tag-ink);
}
.tag .dot { width: 8px; height: 8px; border-radius: 50%; }

.empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--ink-soft);
  background: #fff;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
}
.skeleton {
  background: linear-gradient(90deg, #fff 0%, #fcecd8 50%, #fff 100%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: var(--radius);
  height: 90px;
  margin-bottom: 10px;
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

.footnote {
  margin: 24px 4px 8px;
  font-size: 12px; color: var(--ink-soft);
}

/* ----------  Map  ---------- */
.map-pane {
  position: sticky;
  top: 16px;
  height: calc(100vh - 32px);
  min-height: 480px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  background: #ffeacb;
  box-shadow: var(--shadow);
}
#map { width: 100%; height: 100%; }
.map-notice {
  position: absolute; left: 12px; right: 12px; top: 12px;
  background: #fff; padding: 12px 14px;
  border-radius: 10px;
  font-size: 13px; color: var(--ink);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.map-notice strong { color: var(--paw-dark); }

/* ----------  Dialog  ---------- */
.clinic-dialog {
  border: 0;
  border-radius: 18px;
  padding: 0;
  max-width: 600px;
  width: calc(100% - 32px);
  background: #fff;
  box-shadow: var(--shadow-lg);
}
.clinic-dialog::backdrop { background: rgba(43, 29, 18, 0.45); backdrop-filter: blur(2px); }
.dlg-close {
  position: absolute; top: 10px; right: 14px;
  border: 0; background: transparent;
  font-size: 28px; line-height: 1;
  color: var(--ink-soft);
}
.dlg-close:hover { color: var(--ink); }
#dlgBody { padding: 28px; }
#dlgBody h3 {
  font-family: 'Fraunces', serif;
  font-size: 22px; margin: 0 0 4px;
}
#dlgBody .zh { color: var(--ink-soft); font-size: 14px; }
#dlgBody .addr { margin: 12px 0; color: var(--ink-soft); font-size: 14px; }
#dlgBody .links { margin: 14px 0; display: flex; flex-wrap: wrap; gap: 8px; }
#dlgBody .links a {
  background: var(--paw); color: #fff;
  text-decoration: none; padding: 8px 14px;
  border-radius: 999px; font-size: 13px; font-weight: 500;
}
#dlgBody .links a.alt { background: #fff; color: var(--paw-dark); border: 1px solid var(--paw); }
#dlgBody .links a:hover { background: var(--paw-dark); color: #fff; }
#dlgBody h4 {
  margin: 18px 0 8px;
  font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--ink-soft);
}
#dlgBody ul.vets {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-direction: column; gap: 8px;
}
#dlgBody ul.vets li {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 14px;
}
#dlgBody ul.vets .name { font-weight: 600; }
#dlgBody ul.vets .qual { color: var(--ink-soft); font-size: 12px; }
