/* ==========================================================
   PetRadius — global styles
   ========================================================== */
:root {
  --brown: #8b694d;
  --brown-dark: #6f533c;
  --brown-soft: #f3ede6;
  --ink: #1b1b1b;
  --ink-2: #3c3c3c;
  --muted: #6b6b6b;
  --band: #ebe9e4;      /* page hero + footer band */
  --card: #f6f5f1;      /* card surface */
  --line: #e4e0d8;
  --white: #ffffff;
  --radius: 16px;
  --radius-sm: 10px;
  --container: 920px;
  --header-h: 64px;
  --shadow: 0 6px 24px rgba(40, 30, 20, 0.06);
  --ease: cubic-bezier(.2, .7, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: 'Figtree', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--white);
  /* sticky footer */
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

body.menu-open { overflow: hidden; }

main { flex: 1 0 auto; }

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select, option { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; letter-spacing: -0.01em; }
p { margin: 0; }

.container {
  width: 100%;
  max-width: calc(var(--container) + 48px);
  margin: 0 auto;
  padding: 0 24px;
}

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: 12px; top: -48px; z-index: 200;
  background: var(--ink); color: #fff; padding: 8px 14px; border-radius: 8px;
  transition: top .2s;
}
.skip-link:focus { top: 12px; }

:focus-visible { outline: 2px solid var(--brown); outline-offset: 3px; border-radius: 6px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 22px; border-radius: 999px; border: 1px solid transparent;
  font-size: 14px; font-weight: 500; line-height: 1.2; cursor: pointer;
  transition: background-color .2s, color .2s, border-color .2s, transform .2s;
  white-space: nowrap;
}
.btn svg { width: 16px; height: 16px; flex: none; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brown); color: #fff; }
.btn-primary:hover { background: var(--brown-dark); }
.btn-outline { background: transparent; color: var(--brown); border-color: var(--brown); }
.btn-outline:hover { background: var(--brown-soft); }
.btn-ghost { background: #fff; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--brown); color: var(--brown); }
.btn-light { background: #fff; color: var(--brown); }
.btn-light:hover { background: var(--brown-soft); }
.btn-outline-light { background: transparent; color: #fff; border-color: rgba(255,255,255,.75); }
.btn-outline-light:hover { background: rgba(255,255,255,.12); }
.btn-block { width: 100%; padding: 13px 22px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,.96);
  backdrop-filter: saturate(160%) blur(8px);
  -webkit-backdrop-filter: saturate(160%) blur(8px);
  border-bottom: 1px solid #efede8;
}
.header-inner {
  height: var(--header-h);
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
}
.brand { display: inline-flex; align-items: center; gap: 8px; flex: none; }
.brand img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; }
.brand span { font-size: 19px; font-weight: 600; color: var(--brown); letter-spacing: -0.01em; }

.main-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 28px; }
.main-nav a {
  font-size: 14px; color: var(--ink-2); padding: 6px 0; position: relative;
  transition: color .2s;
}
.main-nav a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1.5px;
  background: var(--brown); transform: scaleX(0); transform-origin: left;
  transition: transform .25s var(--ease);
}
.main-nav a:hover { color: var(--brown); }
.main-nav a:hover::after, .main-nav a[aria-current="page"]::after { transform: scaleX(1); }
.main-nav a[aria-current="page"] { color: var(--brown); font-weight: 500; }

.header-actions { display: flex; gap: 12px; flex: none; }
.header-actions .btn { padding: 9px 20px; }

.menu-toggle {
  display: none; width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 12px;
  background: #fff; cursor: pointer; align-items: center; justify-content: center; padding: 0;
}
.menu-toggle .bars { position: relative; width: 18px; height: 12px; }
.menu-toggle .bars span {
  position: absolute; left: 0; width: 100%; height: 1.75px; border-radius: 2px; background: var(--ink);
  transition: transform .3s var(--ease), opacity .2s, top .3s var(--ease);
}
.menu-toggle .bars span:nth-child(1) { top: 0; }
.menu-toggle .bars span:nth-child(2) { top: 5px; }
.menu-toggle .bars span:nth-child(3) { top: 10px; }
.menu-toggle[aria-expanded="true"] .bars span:nth-child(1) { top: 5px; transform: rotate(45deg); }
.menu-toggle[aria-expanded="true"] .bars span:nth-child(2) { opacity: 0; }
.menu-toggle[aria-expanded="true"] .bars span:nth-child(3) { top: 5px; transform: rotate(-45deg); }

/* Mobile menu panel */
.mobile-menu {
  position: fixed; inset: var(--header-h) 0 0 0; z-index: 99;
  background: #fff;
  display: flex; flex-direction: column;
  padding: 12px 24px calc(24px + env(safe-area-inset-bottom));
  overflow-y: auto;
  opacity: 0; visibility: hidden; transform: translateY(-8px);
  transition: opacity .25s var(--ease), transform .25s var(--ease), visibility 0s linear .25s;
}
.mobile-menu.is-open {
  opacity: 1; visibility: visible; transform: none;
  transition: opacity .25s var(--ease), transform .25s var(--ease), visibility 0s;
}
.mobile-menu ul { list-style: none; margin: 0; padding: 0; }
.mobile-menu li { border-bottom: 1px solid #efede8; }
.mobile-menu li a {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 4px; font-size: 20px; font-weight: 500; color: var(--ink);
}
.mobile-menu li a svg { width: 18px; height: 18px; color: #b9b2a8; transition: transform .2s, color .2s; }
.mobile-menu li a:hover svg, .mobile-menu li a[aria-current="page"] svg { color: var(--brown); transform: translateX(3px); }
.mobile-menu li a[aria-current="page"] { color: var(--brown); }
.mobile-menu .mobile-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 28px; }
.mobile-menu .mobile-actions .btn { padding: 13px 20px; font-size: 15px; }
.mobile-menu .mobile-contact { margin-top: auto; padding-top: 32px; font-size: 14px; color: var(--muted); }
.mobile-menu .mobile-contact a { color: var(--brown); }

/* ---------- Page hero band ---------- */
.page-hero { background: var(--band); padding: 76px 0 80px; text-align: center; }
.page-hero h1 { font-size: clamp(32px, 5vw, 40px); font-weight: 700; margin-bottom: 18px; }
.page-hero p { max-width: 560px; margin: 0 auto; font-size: 15px; color: var(--ink-2); }
.page-hero.wide p { max-width: 720px; }

.section { padding: 72px 0; }
.section-head { text-align: center; margin-bottom: 36px; }
.section-head h2 { font-size: clamp(24px, 3.6vw, 28px); font-weight: 700; margin-bottom: 14px; }
.section-head p { color: var(--ink-2); font-size: 14px; }
.band { background: var(--band); }

/* ---------- Home hero ---------- */
.hero {
  position: relative; color: #fff; text-align: center;
  min-height: 480px; display: flex; align-items: center;
  background: #2c2a28 center / cover no-repeat;
  isolation: isolate; overflow: hidden;
}
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(180deg, rgba(20,18,16,.35), rgba(20,18,16,.45));
}
.hero .container { padding-top: 88px; padding-bottom: 88px; }
.hero-logo {
  width: 44px; height: 44px; border-radius: 50%; margin: 0 auto 18px; object-fit: cover;
  box-shadow: 0 0 0 3px rgba(255,255,255,.25);
}
.hero h1 { font-size: clamp(34px, 5.6vw, 48px); font-weight: 700; line-height: 1.22; max-width: 520px; margin: 0 auto 22px; }
.hero p { font-size: clamp(15px, 2vw, 18px); max-width: 560px; margin: 0 auto 30px; opacity: .95; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; }

.stats { background: var(--band); padding: 30px 0; }
.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; text-align: center; }
.stat svg { width: 26px; height: 26px; color: var(--brown); margin: 0 auto 8px; display: block; }
.stat strong { display: block; font-size: 26px; font-weight: 600; line-height: 1.2; }
.stat span { font-size: 13px; color: var(--ink-2); }

.cta { background: var(--brown); color: #fff; text-align: center; padding: 80px 0; }
.cta h2 { font-size: clamp(22px, 3.4vw, 26px); font-weight: 600; margin-bottom: 16px; }
.cta p { max-width: 460px; margin: 0 auto 28px; opacity: .92; font-size: 14px; }
.cta-actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.center { text-align: center; }
.mt-32 { margin-top: 32px; }

/* ---------- Pet cards ---------- */
.pet-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.pet-card {
  background: var(--card); border-radius: var(--radius); overflow: hidden;
  display: flex; flex-direction: column;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease);
}
.pet-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.pet-card .thumb { aspect-ratio: 1 / 1; overflow: hidden; background: #ddd; }
.pet-card .thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--ease); }
.pet-card:hover .thumb img { transform: scale(1.04); }
.pet-card .body { padding: 14px 14px 16px; }
.pet-card .row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.pet-card h3 { font-size: 15px; font-weight: 600; }
.pet-card .breed { font-size: 13px; color: var(--ink-2); }
.tag {
  display: inline-flex; align-items: center; font-size: 12px; padding: 3px 10px; border-radius: 999px;
  background: #e9e6e0; color: var(--ink-2); white-space: nowrap;
}

.search {
  display: flex; gap: 6px; max-width: 360px; margin: 28px auto 0;
}
.search input {
  flex: 1; min-width: 0; height: 40px; padding: 0 16px; border: 1px solid #dcd8d0; border-radius: 12px;
  background: #fff; font-size: 14px; transition: border-color .2s, box-shadow .2s;
}
.search input:focus { outline: none; border-color: var(--brown); box-shadow: 0 0 0 3px rgba(139,105,77,.15); }
.search button {
  width: 40px; height: 40px; flex: none; border: none; border-radius: 50%;
  background: var(--brown); color: #fff; display: grid; place-items: center; cursor: pointer;
  transition: background-color .2s;
}
.search button:hover { background: var(--brown-dark); }
.search button svg { width: 18px; height: 18px; }
.empty-state { text-align: center; color: var(--muted); padding: 40px 0; display: none; }
.empty-state.show { display: block; }

/* ---------- Pet detail ---------- */
.pet-detail-page { background: #f7f6f2; }
.back-link { display: inline-flex; align-items: center; gap: 8px; color: var(--brown); font-size: 14px; margin: 28px 0 22px; }
.back-link svg { width: 15px; height: 15px; transition: transform .2s; }
.back-link:hover svg { transform: translateX(-3px); }
.pet-detail { display: grid; grid-template-columns: 1fr 1.07fr; gap: 28px; padding-bottom: 72px; align-items: start; }
.pet-detail .photo { border-radius: var(--radius); overflow: hidden; aspect-ratio: 1/1; background: #ddd; }
.pet-detail .photo img { width: 100%; height: 100%; object-fit: cover; }
.pet-detail .tag { background: #e9e6e0; font-weight: 500; padding: 6px 14px; }
.pet-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 18px 0 16px; }
.pet-title h1 { font-size: clamp(28px, 4vw, 32px); font-weight: 500; }
.fav-btn {
  width: 40px; height: 40px; border-radius: 50%; border: none; background: transparent; color: #c0392b;
  display: grid; place-items: center; cursor: pointer; transition: background-color .2s, transform .2s;
}
.fav-btn:hover { background: #fbecea; }
.fav-btn:active { transform: scale(.9); }
.fav-btn svg { width: 20px; height: 20px; }
.fav-btn[aria-pressed="true"] svg { fill: currentColor; }
.chips { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 24px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px;
  background: #e9e6e0; font-size: 12.5px; font-weight: 500;
}
.chip svg { width: 15px; height: 15px; color: var(--ink-2); }
.pet-detail h2 { font-size: 18px; font-weight: 500; margin: 0 0 8px; }
.pet-detail .block { margin-bottom: 20px; font-size: 14px; color: var(--ink-2); }
.pet-detail .block ul { margin: 0; padding-left: 26px; }
.pet-detail .block li { margin: 2px 0; }
.pet-detail .block li b { color: var(--ink); font-weight: 600; }
.shelter-box { background: var(--band); border-radius: var(--radius); padding: 18px 18px; margin: 4px 0 28px; }
.shelter-box h2 { margin-bottom: 10px; }
.shelter-box p { font-size: 14px; color: var(--ink-2); margin: 4px 0; }

/* ---------- About ---------- */
.values-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.value-card { background: var(--card); border: 1px solid #ece9e3; border-radius: var(--radius); padding: 22px 18px; }
.value-card svg { width: 28px; height: 28px; color: var(--brown); margin-bottom: 16px; }
.value-card h3 { font-size: 15px; font-weight: 600; margin-bottom: 10px; }
.value-card p { font-size: 13.5px; color: var(--ink-2); }

.team-card {
  background: #fff; border-radius: var(--radius); padding: 32px 36px; max-width: 720px; margin: 0 auto;
  display: grid; grid-template-columns: 200px 1fr; gap: 40px; align-items: center;
}
.team-card .person { text-align: center; }
.team-card .person img { width: 130px; height: 130px; border-radius: 50%; margin: 0 auto 18px; object-fit: cover; }
.team-card .person h3 { font-size: 20px; font-weight: 500; margin-bottom: 8px; }
.team-card .person span { color: var(--brown); font-size: 13px; }
.team-card .bio { font-size: 13.5px; color: var(--ink-2); line-height: 1.6; }

/* ---------- Resources ---------- */
.res-section { margin-bottom: 56px; }
.res-section:last-child { margin-bottom: 0; }
.res-section > h2 { font-size: 18px; font-weight: 600; margin-bottom: 18px; }
.res-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.res-card {
  background: var(--card); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease);
}
.res-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.res-card .thumb { aspect-ratio: 3 / 2; background: #e6e3dd; overflow: hidden; }
.res-card .thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top center; }
.res-card .body { padding: 16px 14px 18px; display: flex; flex-direction: column; flex: 1; }
.res-card h3 { font-size: 15px; font-weight: 600; margin-bottom: 10px; }
.res-card p { font-size: 13.5px; color: var(--ink-2); margin-bottom: 12px; }
.read-more { margin-top: auto; display: inline-flex; align-items: center; gap: 6px; color: var(--brown); font-size: 14px; }
.read-more svg { width: 15px; height: 15px; transition: transform .2s; }
.res-card:hover .read-more svg { transform: translateX(3px); }

/* ---------- Forms (contact / auth) ---------- */
.form-card {
  background: #f7f6f2; border: 1px solid #ebe8e2; border-radius: var(--radius);
  padding: 32px 28px 30px; max-width: 560px; margin: 0 auto;
}
.form-card.narrow { max-width: 420px; }
.form-card h2 { font-size: 20px; font-weight: 600; margin-bottom: 18px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 14px; }
.field { display: flex; flex-direction: column; gap: 7px; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: 13.5px; }
.field input, .field textarea {
  width: 100%; border: 1px solid #e3dfd8; background: #fff; border-radius: 12px;
  padding: 10px 14px; font-size: 15px; transition: border-color .2s, box-shadow .2s;
}
.field input { height: 40px; }
.field textarea { min-height: 120px; resize: vertical; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--brown); box-shadow: 0 0 0 3px rgba(139,105,77,.15); }
.field input[aria-invalid="true"], .field textarea[aria-invalid="true"] { border-color: #b94a3b; }
.form-card .btn-block { margin-top: 26px; }
.form-note { font-size: 13.5px; margin-top: 14px; padding: 12px 14px; border-radius: 10px; display: none; }
.form-note.show { display: block; }
.form-note.ok { background: #e8f2ea; color: #245c36; }
.form-note.err { background: #fbecea; color: #8e2d22; }
.form-alt { text-align: center; font-size: 13.5px; color: var(--muted); margin-top: 18px; }
.form-alt a { color: var(--brown); font-weight: 500; }

/* ---------- Footer ---------- */
.site-footer { background: var(--band); padding: 40px 0 28px; flex-shrink: 0; }
.footer-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; }
.footer-brand .brand span { color: var(--ink); font-weight: 500; }
.footer-brand p { font-size: 13.5px; color: var(--ink-2); margin-top: 10px; max-width: 270px; }
.site-footer h3 { font-size: 14px; font-weight: 600; margin: 8px 0 14px; }
.site-footer h3.caps { text-transform: uppercase; font-weight: 500; letter-spacing: .01em; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.site-footer li a, .site-footer .email { font-size: 13.5px; color: var(--ink-2); transition: color .2s; word-break: break-word; }
.site-footer li a:hover, .site-footer .email:hover { color: var(--brown); }
.copyright { text-align: center; font-size: 13px; color: var(--ink-2); margin-top: 32px; }

/* ---------- Quiz wrapper ---------- */
.quiz-section { padding: 72px 0; }

/* ==========================================================
   Responsive
   ========================================================== */
@media (max-width: 960px) {
  .main-nav ul { gap: 20px; }
  .pet-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .values-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 860px) {
  .main-nav, .header-actions { display: none; }
  .menu-toggle { display: inline-flex; }
}

@media (min-width: 861px) {
  .mobile-menu { display: none; }
}

@media (max-width: 760px) {
  .res-grid { grid-template-columns: repeat(2, 1fr); }
  .pet-detail { grid-template-columns: 1fr; gap: 22px; }
  .pet-detail .photo { max-width: 560px; }
  .team-card { grid-template-columns: 1fr; gap: 20px; padding: 28px 22px; text-align: center; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 640px) {
  body { font-size: 15px; }
  .container { padding: 0 18px; }
  .page-hero { padding: 52px 0 56px; }
  .section, .quiz-section { padding: 52px 0; }
  .hero { min-height: 520px; }
  .hero .container { padding-top: 64px; padding-bottom: 64px; }
  .stats-grid { gap: 8px; }
  .stat strong { font-size: 22px; }
  .stat span { font-size: 12px; }
  .pet-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .pet-card .body { padding: 12px; }
  .pet-card .row { flex-wrap: wrap; }
  .cta { padding: 60px 0; }
  .form-card { padding: 24px 18px; }
  .form-grid { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
  .res-grid { grid-template-columns: 1fr; }
  .values-grid { grid-template-columns: 1fr; }
  .hero-actions .btn, .cta-actions .btn { flex: 1 1 auto; }
}

@media (max-width: 380px) {
  .pet-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .mobile-menu .mobile-actions { grid-template-columns: 1fr; }
}

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

/* ==========================================================
   Accounts
   ========================================================== */
[hidden] { display: none !important; }

.avatar {
  width: 36px; height: 36px; border-radius: 50%; flex: none; overflow: hidden;
  display: inline-grid; place-items: center;
  background: var(--brown-soft); color: var(--brown);
}
.avatar svg { width: 55%; height: 55%; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-sm { width: 32px; height: 32px; }
.avatar-xl { width: 88px; height: 88px; background: #fff; box-shadow: 0 0 0 1px #fff; }
.avatar-xl svg { width: 46%; height: 46%; }

/* Header menu */
.account-menu { position: relative; flex: none; }
.avatar-btn {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  height: 40px; padding: 3px 12px 3px 3px; border-radius: 999px;
  background: #fff; border: 1px solid var(--line); color: var(--ink);
  font-size: 14px; font-weight: 500; transition: border-color .2s, background-color .2s;
}
.avatar-btn .avatar { width: 32px; height: 32px; }
.avatar-btn > svg { width: 15px; height: 15px; color: var(--muted); transition: transform .2s var(--ease); }
.avatar-btn:hover, .avatar-btn[aria-expanded="true"] { border-color: var(--brown); }
.avatar-btn[aria-expanded="true"] > svg { transform: rotate(180deg); }
.account-name { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-dropdown {
  position: absolute; right: 0; top: calc(100% + 10px); width: 250px; z-index: 120;
  background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 8px;
  box-shadow: 0 14px 40px rgba(40,30,20,.12);
  animation: dropIn .18s var(--ease);
}
@keyframes dropIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.account-who { display: flex; align-items: center; gap: 10px; padding: 8px 10px 12px; border-bottom: 1px solid #efede8; margin-bottom: 6px; }
.account-who > span:last-child { min-width: 0; display: flex; flex-direction: column; }
.account-who strong { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.account-who small { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.account-dropdown a, .account-dropdown button {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border-radius: 9px;
  font-size: 14px; color: var(--ink-2); background: none; border: none; cursor: pointer; text-align: left;
}
.account-dropdown a:hover, .account-dropdown button:hover { background: var(--card); color: var(--brown); }
.account-dropdown svg { width: 17px; height: 17px; flex: none; }
.account-dropdown button { border-top: 1px solid #efede8; border-radius: 0 0 9px 9px; margin-top: 6px; padding-top: 11px; }

.mobile-account { margin-top: 24px; }
.mobile-account-card {
  display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 14px; background: var(--card);
}
.mobile-account-card .avatar { width: 44px; height: 44px; background: #fff; }
.mobile-account-card > span:nth-child(2) { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.mobile-account-card strong { font-size: 16px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mobile-account-card small { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mobile-account-card > svg { width: 18px; height: 18px; color: var(--muted); }
.mobile-logout { margin-top: 24px; font-size: 15px; }

@media (max-width: 860px) {
  .account-menu { margin-left: auto; }
  .avatar-btn { padding: 3px; width: 44px; height: 44px; justify-content: center; border-radius: 12px; }
  .avatar-btn .avatar { width: 34px; height: 34px; border-radius: 9px; }
  .avatar-btn .account-name, .avatar-btn > svg { display: none; }
  .header-inner { gap: 12px; }
}

/* Heart buttons on cards */
.pet-card-wrap { position: relative; display: flex; }
.pet-card-wrap > .pet-card { flex: 1; min-width: 0; }
.pet-card-wrap[hidden] { display: none !important; }
.card-fav, .fav-btn { -webkit-tap-highlight-color: transparent; }
.card-fav {
  position: absolute; top: 10px; right: 10px; width: 36px; height: 36px; border-radius: 50%;
  border: none; cursor: pointer; display: grid; place-items: center;
  background: rgba(255,255,255,.92); color: #c0392b; box-shadow: 0 2px 10px rgba(0,0,0,.12);
  transition: transform .2s var(--ease), background-color .2s;
}
.card-fav:hover { transform: scale(1.08); background: #fff; }
.card-fav svg { width: 18px; height: 18px; }
.card-fav[aria-pressed="true"] svg, .fav-btn[aria-pressed="true"] svg { fill: currentColor; }
.card-fav.pop, .fav-btn.pop { animation: pop .35s var(--ease); }
@keyframes pop { 40% { transform: scale(1.25); } 100% { transform: scale(1); } }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom)); z-index: 300;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--ink); color: #fff; font-size: 14px; padding: 12px 18px; border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,.2); max-width: calc(100vw - 32px); width: max-content;
  transition: opacity .25s var(--ease), transform .25s var(--ease);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.toast a { color: #f1d9c3; font-weight: 600; text-decoration: underline; text-underline-offset: 2px; margin-left: 4px; }

.preview-note {
  font-size: 13px; line-height: 1.5; color: #6a4b16; background: #fbf3e2; border: 1px solid #f0e0bd;
  padding: 10px 12px; border-radius: 10px; margin: 0 0 18px;
}

/* Busy buttons */
.is-busy { opacity: .75; cursor: progress; }

/* ---------- Auth pages ---------- */
.auth-page { padding: 72px 0; }
.auth-shell {
  max-width: 460px; margin: 0 auto; background: #f7f6f2;
  border: 1px solid #ebe8e2; border-radius: 20px;
}
.auth-panel { padding: 40px 36px 34px; text-align: left; }
.auth-logo { width: 52px; height: 52px; border-radius: 50%; display: block; margin: 0 auto 18px; }
.auth-panel h1 { font-size: 26px; font-weight: 700; margin-bottom: 8px; text-align: center; }
.auth-sub { color: var(--ink-2); font-size: 14.5px; margin-bottom: 24px; text-align: center; }
.btn-google {
  display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; height: 46px;
  border: 1px solid #dadce0; border-radius: 999px; background: #fff; color: #1f1f1f;
  font-size: 14.5px; font-weight: 500; cursor: pointer; transition: background-color .2s, box-shadow .2s;
}
.btn-google:hover { background: #fbfbfb; box-shadow: 0 1px 4px rgba(0,0,0,.08); }
.btn-google:disabled { opacity: .7; cursor: progress; }
.auth-divider { display: flex; align-items: center; gap: 12px; margin: 22px 0; color: var(--muted); font-size: 13px; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.auth-form { display: grid; gap: 16px; }
.auth-form .btn-block { margin-top: 6px; height: 46px; }
.auth-form .form-note { margin-top: 0; }
.label-row { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.link-btn { border: none; background: none; padding: 0; color: var(--brown); font-size: 13px; cursor: pointer; }
.link-btn:hover { text-decoration: underline; }
.input-icon { position: relative; }
.input-icon > svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; color: #a39a8e; pointer-events: none; }
.input-icon input { padding-left: 42px !important; height: 46px !important; }
.input-icon.has-toggle input { padding-right: 46px !important; }
.pw-toggle {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 36px; height: 36px;
  border: none; background: none; border-radius: 8px; color: #8d857a; cursor: pointer; display: grid; place-items: center;
}
.pw-toggle:hover { color: var(--brown); background: var(--card); }
.pw-toggle svg { width: 18px; height: 18px; }
.pw-toggle[aria-pressed="true"] { color: var(--brown); }
.auth-legal { font-size: 12.5px; color: var(--muted); text-align: center; margin-top: 16px; }
.auth-panel .form-alt { margin-top: 14px; }
.demo-box {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  background: #fff; border: 1px dashed #d8cbbb; border-radius: 12px; padding: 12px 14px; margin: -6px 0 18px;
}
.demo-box div { display: flex; flex-direction: column; font-size: 13.5px; min-width: 0; }
.demo-box span { color: var(--ink-2); font-size: 13px; }
.demo-box .btn { padding: 8px 16px; font-size: 13px; }

@media (max-width: 640px) {
  .auth-page { padding: 52px 0; }
  .auth-panel { padding: 30px 20px 28px; }
  .auth-panel h1 { font-size: 23px; }
  .demo-box .btn { width: 100%; }
}

/* ---------- Profile ---------- */
.gate-card, .empty-card {
  max-width: 480px; margin: 0 auto; text-align: center; background: var(--card);
  border: 1px solid #ece9e3; border-radius: var(--radius); padding: 40px 28px;
}
.empty-card { max-width: none; padding: 44px 24px; }
.gate-icon {
  width: 56px; height: 56px; border-radius: 16px; background: var(--brown-soft); color: var(--brown);
  display: grid; place-items: center; margin: 0 auto 18px;
}
.gate-icon svg { width: 26px; height: 26px; }
.gate-card h1, .empty-card h2 { font-size: 22px; font-weight: 700; margin-bottom: 10px; }
.empty-card h2 { font-size: 18px; }
.gate-card p, .empty-card p { color: var(--ink-2); font-size: 14px; margin-bottom: 22px; }
.gate-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

.profile-hero { background: var(--band); padding: 40px 0 36px; }
.profile-head { display: flex; align-items: center; gap: 22px; }
.profile-id { flex: 1; min-width: 0; }
.profile-id h1 { font-size: clamp(24px, 3.4vw, 30px); font-weight: 700; margin-bottom: 4px; overflow-wrap: anywhere; }
.profile-id p { color: var(--ink-2); font-size: 14px; overflow-wrap: anywhere; }
.profile-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.profile-chips .chip { background: #fff; font-size: 12px; padding: 5px 12px; }
.profile-chips .chip:empty { display: none; }
.profile-signout { flex: none; }
.profile-signout svg { width: 16px; height: 16px; }

.profile-body { padding: 28px 0 72px; }
.tabs {
  display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 26px;
  overflow-x: auto; scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  position: relative; border: none; background: none; cursor: pointer; white-space: nowrap;
  padding: 12px 14px; font-size: 14.5px; font-weight: 500; color: var(--muted);
  display: inline-flex; align-items: center; gap: 8px;
}
.tab:hover { color: var(--ink); }
.tab[aria-selected="true"] { color: var(--brown); }
.tab[aria-selected="true"]::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px; background: var(--brown); border-radius: 2px; }
.tab .count { font-size: 12px; background: #eeebe5; color: var(--ink-2); border-radius: 999px; padding: 1px 8px; font-weight: 600; }
.tab[aria-selected="true"] .count { background: var(--brown-soft); color: var(--brown); }

.profile-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; }
.profile-card-head { margin-bottom: 20px; }
.profile-card-head h2 { font-size: 18px; font-weight: 600; margin-bottom: 4px; }
.profile-card-head p { font-size: 13.5px; color: var(--muted); }
.field select {
  width: 100%; height: 40px; border: 1px solid #e3dfd8; background: #fff; border-radius: 12px; padding: 0 12px; font-size: 15px;
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b6b6b' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 16px;
}
.field select:focus { outline: none; border-color: var(--brown); box-shadow: 0 0 0 3px rgba(139,105,77,.15); }
.field input[readonly] { background: var(--card); color: var(--ink-2); }
.field .hint { font-size: 12px; color: var(--muted); }
.field .optional { color: var(--muted); font-weight: 400; }
.pw-row {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  margin-top: 22px; padding: 16px 0 0; border-top: 1px solid #efede8;
}
.pw-row div { display: flex; flex-direction: column; font-size: 14px; }
.pw-row span { font-size: 13px; color: var(--muted); }
.profile-actions { display: flex; align-items: center; justify-content: flex-end; gap: 14px; margin-top: 22px; flex-wrap: wrap; }
.profile-actions .form-note { margin: 0; flex: 1 1 240px; }

.summary-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 30px; }
.summary-card {
  background: var(--card); border: 1px solid #ece9e3; border-radius: 14px; padding: 16px 18px;
  display: flex; flex-direction: column; gap: 4px; transition: border-color .2s, transform .2s var(--ease);
}
.summary-card:hover { border-color: #d9cfc2; transform: translateY(-2px); }
.summary-title { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; font-weight: 600; color: var(--muted); }
.summary-card strong { font-size: 26px; font-weight: 700; color: var(--brown); line-height: 1.25; }
.summary-card strong small { font-size: 15px; color: var(--muted); font-weight: 500; }
.summary-card .summary-text { font-size: 17px; display: block; line-height: 1.3; margin: 4px 0 2px; }
.summary-sub { font-size: 12.5px; color: var(--ink-2); }
.panel-title { font-size: 16px; font-weight: 600; margin-bottom: 12px; }
.history-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.history-list:empty { display: none; }
.history-list:empty + .empty-card { margin-top: 0; }
.history-item {
  display: flex; align-items: center; gap: 16px; background: #fff; border: 1px solid var(--line);
  border-radius: 14px; padding: 14px 16px;
}
.score-pill {
  flex: none; min-width: 58px; text-align: center; padding: 8px 10px; border-radius: 10px;
  background: var(--brown-soft); color: var(--brown); font-weight: 700; font-size: 14px;
}
.score-pill.is-match { background: #e9f0ec; color: #2b6a47; }
.history-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.history-body strong { font-size: 14.5px; font-weight: 600; }
.history-body span { font-size: 13px; color: var(--ink-2); overflow-wrap: anywhere; }
.history-meta { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; font-size: 12.5px; color: var(--muted); }
.history-meta a { color: var(--brown); font-weight: 500; font-size: 13px; }

@media (max-width: 760px) {
  .summary-grid { grid-template-columns: 1fr; }
  .summary-card { flex-direction: row; flex-wrap: wrap; align-items: baseline; column-gap: 12px; }
  .summary-title { flex-basis: 100%; }
  .summary-card .summary-text { margin: 0; }
}
@media (max-width: 640px) {
  .profile-hero { padding: 28px 0; }
  .profile-head { flex-wrap: wrap; gap: 16px; }
  .avatar-xl { width: 68px; height: 68px; }
  .profile-signout { width: 100%; }
  .profile-card { padding: 20px 16px; }
  .profile-actions .btn { width: 100%; }
  .pw-row .btn { width: 100%; }
  .history-item { flex-wrap: wrap; gap: 10px 12px; }
  .history-meta { flex-direction: row; align-items: center; gap: 12px; width: 100%; padding-left: 70px; justify-content: space-between; }
}

@media (max-width: 480px) {
  .footer-grid { grid-template-columns: 1fr; gap: 24px; }
  .site-footer li a, .site-footer .email { word-break: normal; }
}

.site-footer .footer-contact { gap: 10px; }
.footer-contact a { display: inline-flex; align-items: center; gap: 8px; }
.footer-contact svg { width: 16px; height: 16px; flex: none; color: var(--brown); }

/* ---------- Pet listing filters ---------- */
.pets-section { padding-top: 40px; }
.pet-filters { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.type-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.filter-chip {
  display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 16px; border-radius: 999px;
  border: 1px solid var(--line); background: #fff; color: var(--ink-2); font-size: 14px; font-weight: 500; cursor: pointer;
  transition: background-color .2s, border-color .2s, color .2s;
}
.filter-chip span { font-size: 12px; color: var(--muted); font-weight: 600; }
.filter-chip:hover { border-color: var(--brown); color: var(--brown); }
.filter-chip[aria-pressed="true"] { background: var(--brown); border-color: var(--brown); color: #fff; }
.filter-chip[aria-pressed="true"] span { color: rgba(255,255,255,.8); }
.filter-selects { display: flex; gap: 8px; flex-wrap: wrap; }
.filter-selects select {
  height: 38px; border: 1px solid var(--line); border-radius: 999px; background-color: #fff; padding: 0 36px 0 16px;
  font-size: 14px; font-weight: 500; color: var(--ink-2); cursor: pointer; appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b6b6b' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; background-size: 14px;
}
.filter-selects select:focus { outline: none; border-color: var(--brown); box-shadow: 0 0 0 3px rgba(139,105,77,.15); }
.results-count { font-size: 13px; color: var(--muted); margin-bottom: 16px; }
.empty-state p { margin-bottom: 14px; }
.pet-card .pet-meta { font-size: 12.5px; color: var(--muted); margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pet-detail .block.story p + p { margin-top: 10px; }
.pet-detail .block p { overflow-wrap: anywhere; }

@media (max-width: 640px) {
  .pets-section { padding-top: 28px; }
  .pet-filters { flex-direction: column; align-items: stretch; }
  .type-chips { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .filter-chip { justify-content: center; padding: 0 10px; }
  .filter-selects { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filter-selects select { width: 100%; min-width: 0; padding-left: 14px; }
}
@media (max-width: 380px) {
  .filter-selects { grid-template-columns: 1fr; }
}

.show-more-wrap { display: flex; justify-content: center; margin-top: 32px; }
.show-more-wrap:has(> [hidden]) { display: none; }
.show-more { padding: 12px 26px; }
.show-more svg { width: 16px; height: 16px; }
@media (max-width: 640px) { .show-more { width: 100%; } }

/* Slightly larger overall scale on laptop/desktop screens */
@media (min-width: 861px) {
  html { zoom: 1.1; }
}

/* ---------- Footer legal links ---------- */
.footer-bottom { display: flex; align-items: center; justify-content: center; gap: 8px 22px; flex-wrap: wrap; margin-top: 32px; }
.footer-bottom .copyright { margin: 0; }
.legal-links { display: flex; gap: 18px; }
.legal-links a { font-size: 13px; color: var(--ink-2); transition: color .2s; }
.legal-links a:hover { color: var(--brown); }
@media (max-width: 480px) { .footer-bottom { flex-direction: column; } }

.auth-legal a { color: var(--brown); text-decoration: underline; text-underline-offset: 2px; }

/* ---------- Legal pages ---------- */
.legal { max-width: 760px; }
.legal-intro { font-size: 15.5px; color: var(--ink-2); line-height: 1.7; margin-bottom: 28px; }
.legal-toc { background: var(--card); border: 1px solid #ece9e3; border-radius: var(--radius); padding: 20px 24px; margin-bottom: 40px; }
.legal-toc h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; margin-bottom: 10px; }
.legal-toc ol { margin: 0; padding-left: 20px; columns: 2; column-gap: 32px; }
.legal-toc li { font-size: 14px; margin: 0; padding: 4px 0; break-inside: avoid; }
.legal-toc a { color: var(--brown); }
.legal-toc a:hover { text-decoration: underline; }
.legal section { margin-bottom: 34px; scroll-margin-top: 90px; }
.legal section h2 { font-size: 20px; font-weight: 600; margin-bottom: 12px; }
.legal p, .legal li { font-size: 15px; line-height: 1.7; color: var(--ink-2); }
.legal p + p { margin-top: 12px; }
.legal ul { margin: 10px 0 0; padding-left: 22px; }
.legal li + li { margin-top: 6px; }
.legal strong { color: var(--ink); font-weight: 600; }
.legal section a { color: var(--brown); text-decoration: underline; text-underline-offset: 2px; overflow-wrap: anywhere; }
@media (max-width: 640px) { .legal-toc ol { columns: 1; } .legal-toc { padding: 18px 18px; } }

/* ---------- Pet status ---------- */
.pet-card .thumb { position: relative; }
.status-badge {
  position: absolute; left: 10px; top: 10px; padding: 4px 10px; border-radius: 999px;
  font-size: 11.5px; font-weight: 600; letter-spacing: .02em; background: rgba(40,36,32,.82); color: #fff;
}
.status-badge.status-adopted { background: #2b6a47; }
.status-badge.status-pending { background: #b07a1e; }
.pet-card-wrap.is-unavailable .thumb img { filter: grayscale(.55); opacity: .85; }
.tag-status { background: #f1e4d6; color: var(--brown-dark); font-weight: 600; margin-left: 6px; }
.status-note {
  display: flex; flex-direction: column; gap: 4px; background: #fbf3e2; border: 1px solid #f0e0bd;
  border-radius: 12px; padding: 12px 14px; margin: 14px 0 18px; font-size: 14px; color: #5f4a1c;
}
.status-note strong { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; }
.status-note a { color: var(--brown); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; align-self: flex-start; }
.status-note.status-adopted { background: #e8f2ea; border-color: #cfe3d4; color: #245c36; }
@media (max-width: 640px) {
  .filter-selects { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 460px) {
  .filter-selects { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filter-selects select:first-of-type { grid-column: 1 / -1; }
}
