/* ==========================================================================
   Tokens
   ========================================================================== */

:root {
  --bg: #fff7ec;
  --bg-tint: #ffefd9;
  --surface: #ffffff;
  --surface-2: #fff4e5;
  --text: #2d2019;
  --muted: #76614f;
  --border: #f0dec6;
  --border-strong: #e2c8a6;
  /* The outline and offset shadow that make cards and buttons look like stickers. */
  --line: #2d2019;
  /* Text on the bright fills below, which stay the same in dark mode. */
  --on-bright: #2d2019;

  --accent: #4361ee;
  --accent-strong: #3048c9;
  --accent-text: #ffffff;
  --accent-soft: #e7ebff;
  --clay: #e8603c;
  --clay-soft: #ffe6dc;

  --sun: #ffc84a;
  --sun-soft: #fff0c4;
  --pink: #ff8fa6;
  --pink-soft: #ffe4ea;
  --mint: #4cc495;
  --mint-soft: #dcf4e9;
  --sky: #9fc0ff;
  --sky-soft: #e2edff;

  --good-bg: #dcf4e7;
  --good-text: #17704a;
  --warn-bg: #fff0c4;
  --warn-text: #845700;
  --bad-bg: #ffe2db;
  --bad-text: #b3321d;
  --neutral-bg: #f4eadf;
  --neutral-text: #5e5047;

  --pin-yes: #23875a;
  --pin-maybe: #f0b232;
  --pin-no: #d0452c;

  --font-body: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Bricolage Grotesque", "DM Sans", system-ui, sans-serif;

  --radius: 22px;
  --radius-sm: 14px;
  --shadow-sm: 0 1px 2px rgb(45 32 25 / .06);
  --shadow: 0 1px 2px rgb(45 32 25 / .05), 0 10px 30px -8px rgb(45 32 25 / .16);
  --pop: 3px 3px 0 var(--line);
  --pop-lg: 5px 5px 0 var(--line);
  --focus: 0 0 0 3px rgb(67 97 238 / .3);
  --paw-print: rgb(45 32 25 / .06);
  --marker: color-mix(in srgb, var(--sun) 85%, transparent);
  --marker-text: var(--accent);

  --paw: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cellipse cx='12' cy='16.6' rx='5.4' ry='4.4'/%3E%3Cellipse cx='4.6' cy='10.4' rx='2.3' ry='2.9' transform='rotate(-18 4.6 10.4)'/%3E%3Cellipse cx='9.2' cy='5.6' rx='2.3' ry='3' transform='rotate(-6 9.2 5.6)'/%3E%3Cellipse cx='14.8' cy='5.6' rx='2.3' ry='3' transform='rotate(6 14.8 5.6)'/%3E%3Cellipse cx='19.4' cy='10.4' rx='2.3' ry='2.9' transform='rotate(18 19.4 10.4)'/%3E%3C/svg%3E");
  --paw-tile: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 140 140'%3E%3Cdefs%3E%3Cg id='p'%3E%3Cellipse cx='12' cy='16.6' rx='5.4' ry='4.4'/%3E%3Cellipse cx='4.6' cy='10.4' rx='2.3' ry='2.9'/%3E%3Cellipse cx='9.2' cy='5.6' rx='2.3' ry='3'/%3E%3Cellipse cx='14.8' cy='5.6' rx='2.3' ry='3'/%3E%3Cellipse cx='19.4' cy='10.4' rx='2.3' ry='2.9'/%3E%3C/g%3E%3C/defs%3E%3Cuse href='%23p' transform='translate(16 18) rotate(-24 12 12)'/%3E%3Cuse href='%23p' transform='translate(90 82) rotate(20 12 12)'/%3E%3C/svg%3E");

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15192b;
    --bg-tint: #1b2036;
    --surface: #20253b;
    --surface-2: #272d46;
    --text: #f7efe3;
    --muted: #b3acc0;
    --border: #2f3551;
    --border-strong: #3e4566;
    --line: #04050b;

    --accent: #8d9fff;
    --accent-strong: #afbcff;
    --accent-text: #11162c;
    --accent-soft: #262e5a;
    --clay: #ff8a66;
    --clay-soft: #3d2620;

    --sun-soft: #3a3120;
    --pink-soft: #3d2531;
    --mint-soft: #1c3a30;
    --sky-soft: #1f2c4a;

    --good-bg: #1b3a2c;
    --good-text: #8ee0b4;
    --warn-bg: #3b3016;
    --warn-text: #ffd77a;
    --bad-bg: #432520;
    --bad-text: #ffab98;
    --neutral-bg: #2a2f46;
    --neutral-text: #c8c2d3;

    --shadow-sm: 0 1px 2px rgb(0 0 0 / .4);
    --shadow: 0 1px 2px rgb(0 0 0 / .35), 0 10px 30px -8px rgb(0 0 0 / .5);
    --focus: 0 0 0 3px rgb(141 159 255 / .35);
    --paw-print: rgb(255 255 255 / .04);
    --marker: color-mix(in srgb, #4361ee 70%, transparent);
    --marker-text: var(--sun);

    color-scheme: dark;
  }
}

/* ==========================================================================
   Base
   ========================================================================== */

* { box-sizing: border-box; }

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

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.55 var(--font-body);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-underline-offset: 2px; }
a:hover { color: var(--accent-strong); }

h1, h2, h3 { font-family: var(--font-display); font-weight: 700; line-height: 1.15; letter-spacing: -.02em; margin: 0 0 .5rem; }
h1 { font-size: 2rem; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.05rem; margin-top: 1rem; }

:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 6px; }

.paw-icon {
  display: inline-block; width: 1em; height: 1em; flex: none; vertical-align: -.12em;
  background: currentColor; -webkit-mask: var(--paw) center / contain no-repeat; mask: var(--paw) center / contain no-repeat;
}

/* ==========================================================================
   Layout
   ========================================================================== */

.site-header {
  position: sticky; top: 0; z-index: 1000;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 2px solid var(--line);
}
.site-header-inner {
  max-width: 1280px; margin: 0 auto; padding: .65rem 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.site-header nav { display: flex; align-items: center; gap: 1.1rem; flex-wrap: wrap; font-size: .95rem; }
.site-header nav a { color: var(--muted); text-decoration: none; font-weight: 600; }
.site-header nav a:hover { color: var(--text); }

.brand {
  display: inline-flex; align-items: center; gap: .5rem; text-decoration: none; color: var(--text);
  font-family: var(--font-display); font-weight: 700; font-size: 1.3rem; letter-spacing: -.02em;
}
.brand:hover { color: var(--text); }
.logo-mark { flex: none; overflow: visible; }
.logo-house { fill: var(--accent); stroke: var(--line); stroke-width: 2.2; stroke-linejoin: round; }
.logo-paw { fill: var(--sun); }

.page { width: 100%; max-width: 980px; margin: 0 auto; padding: 1.75rem 16px 4rem; flex: 1; }
.page-wide { max-width: 1280px; }
.page-home { max-width: none; padding: 0 0 2rem; }

/* A dog peeks over the footer's top edge, so leave it room. */
.site-footer {
  position: relative; margin-top: 6rem;
  background: var(--bg-tint); border-top: 2px solid var(--line); color: var(--muted); font-size: .9rem;
  padding: 1.75rem 16px 2rem; text-align: center;
}
.site-footer p { max-width: 720px; margin: 0 auto; }
.site-footer strong { color: var(--text); font-family: var(--font-display); font-weight: 700; }
.site-footer .footer-credit { margin-top: .35rem; font-size: .8rem; }
.footer-dog {
  --w: 88px; position: absolute; right: max(16px, 8%); width: var(--w);
  bottom: calc(100% + 2px - var(--w) * .1);
}

.narrow { max-width: 460px; margin: 1.5rem auto 0; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.muted { color: var(--muted); margin: 0; }
.hint { color: var(--muted); font-size: .9rem; margin: 0; }
.empty { color: var(--muted); }
.note { background: var(--surface); border-left: 3px solid var(--clay); padding: .6rem .85rem; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }

.row { display: flex; gap: .75rem; flex-wrap: wrap; align-items: flex-end; }
.grow { flex: 1 1 200px; }
.stack { display: grid; gap: .9rem; }
hr { border: 0; border-top: 2px dashed var(--border); margin: 1.5rem 0; }

/* ==========================================================================
   Dogs (shared/_dog)
   ========================================================================== */

.dog { display: block; overflow: visible; }
.dog .dog-eye { transform-box: fill-box; transform-origin: center; animation: blink 6s infinite; }
.dog:nth-child(2) .dog-eye { animation-delay: 1.7s; }
.dog:nth-child(3) .dog-eye { animation-delay: 3.4s; }
li:nth-child(even) .dog .dog-eye { animation-delay: 2.5s; }
@keyframes blink {
  0%, 93%, 100% { transform: scaleY(1); }
  96% { transform: scaleY(.1); }
}
@media (prefers-reduced-motion: reduce) {
  .dog .dog-eye { animation: none; }
}

/* ==========================================================================
   Forms & buttons
   ========================================================================== */

label { display: grid; gap: .3rem; font-size: .88rem; color: var(--muted); font-weight: 500; }

input[type=text], input[type=email], input[type=password], input[type=url], input[type=tel],
input[type=number], input[type=date], select, textarea {
  font: inherit; font-size: 1rem; font-weight: 500; color: var(--text); background: var(--surface);
  border: 2px solid var(--border-strong); border-radius: var(--radius-sm);
  padding: .55rem .8rem; width: 100%; min-height: 46px;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: var(--focus); }
input::placeholder, textarea::placeholder { color: color-mix(in srgb, var(--muted) 65%, transparent); font-weight: 400; }
input[type=number] { max-width: 10rem; }
input[type=date] { max-width: 12rem; }
input[type=checkbox], input[type=radio] { accent-color: var(--accent); width: 1rem; height: 1rem; }
select {
  appearance: none; -webkit-appearance: none; padding-right: 2.2rem; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5l5-5' fill='none' stroke='%23a08a76' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right .85rem center;
}

.button, .link-button { font: inherit; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.button {
  gap: .4rem; background: var(--accent); color: var(--accent-text); border: 2px solid var(--line);
  border-radius: 999px; padding: .55rem 1.25rem; min-height: 44px;
  font-weight: 700;
  box-shadow: var(--pop); transition: background .15s, transform .1s, box-shadow .1s;
}
.button:hover { background: var(--accent-strong); color: var(--accent-text); transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--line); }
.button:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--line); }
.button-secondary { background: var(--surface); color: var(--text); }
.button-secondary:hover { background: var(--surface-2); color: var(--text); }
.button-ghost { background: transparent; color: var(--accent); border-color: var(--border-strong); box-shadow: none; }
.button-ghost:hover { background: var(--accent-soft); color: var(--accent-strong); border-color: var(--accent); box-shadow: none; transform: none; }
.button-danger { background: var(--bad-text); color: var(--surface); }
.button-danger:hover { background: var(--bad-text); color: var(--surface); filter: brightness(1.1); }
.button-small { min-height: 36px; padding: .3rem .95rem; font-size: .92rem; box-shadow: 2px 2px 0 var(--line); }
.button-small.button-ghost { box-shadow: none; }
.link-button { background: none; border: 0; padding: 0; color: var(--muted); font-weight: 600; }
.link-button:hover { color: var(--text); text-decoration: underline; }
.link-button.danger { color: var(--bad-text); margin-top: 1rem; }
form.button_to { display: inline; }

/* Sticky, so "Draft saved." is seen even when the page comes back scrolled to a section. */
.flash {
  padding: .7rem 1rem; border-radius: var(--radius-sm); margin-bottom: 1rem; font-weight: 600;
  position: sticky; top: .75rem; z-index: 5; border: 2px solid var(--line); box-shadow: var(--pop);
}
.flash-notice { background: var(--good-bg); color: var(--good-text); }
.flash-alert { background: var(--bad-bg); color: var(--bad-text); }
.page-home .flash { max-width: 980px; margin: 1rem auto 0; }
.errors { background: var(--bad-bg); color: var(--bad-text); padding: .7rem 1rem; border-radius: var(--radius-sm); margin-bottom: 1rem; font-weight: 600; }
.errors ul { margin: .25rem 0 0; padding-left: 1.2rem; }
.errors ul:first-child { margin: 0; }

/* ==========================================================================
   Pills, checks, tags
   ========================================================================== */

.pill, .tag {
  display: inline-flex; align-items: center; gap: .3rem; border-radius: 999px;
  padding: .2rem .7rem; font-size: .8rem; font-weight: 700; white-space: nowrap;
}
.pill-breed-friendly { background: var(--sun); color: var(--on-bright); border: 2px solid var(--line); padding-block: .1rem; }
.pill-breed-friendly::before { content: ""; width: .9em; height: .9em; background: currentColor; -webkit-mask: var(--paw) center / contain no-repeat; mask: var(--paw) center / contain no-repeat; }
.pill-restricted, .pill-no-dogs, .pill-verdict-no { background: var(--bad-bg); color: var(--bad-text); }
.pill-expired, .tag-warn, .pill-verdict-maybe { background: var(--warn-bg); color: var(--warn-text); }
.pill-incomplete, .pill-unverified { background: var(--neutral-bg); color: var(--neutral-text); }
.pill-verdict-yes { background: var(--good-bg); color: var(--good-text); }
/* Needs attention: a note to check, or a detail that's missing. */
.tag-check { background: var(--warn-bg); color: var(--warn-text); }
.tag-missing { background: var(--neutral-bg); color: var(--neutral-text); }
.unknown { color: var(--muted); font-style: italic; }

.check {
  display: inline-grid; place-items: center; width: 1.45rem; height: 1.45rem; border-radius: 50%;
  font-size: .8rem; font-weight: 700; flex: none;
}
.check-yes { background: var(--good-bg); color: var(--good-text); }
.check-no { background: var(--bad-bg); color: var(--bad-text); }
.check-unknown { background: var(--neutral-bg); color: var(--neutral-text); }

/* ==========================================================================
   Home
   ========================================================================== */

.hero {
  position: relative; overflow: hidden; text-align: center;
  padding: clamp(2.5rem, 7vw, 4.5rem) 16px clamp(2.25rem, 5vw, 3.5rem);
  background:
    radial-gradient(55% 65% at 8% 0%, color-mix(in srgb, var(--sun) 32%, transparent), transparent 70%),
    radial-gradient(45% 60% at 96% 12%, color-mix(in srgb, var(--pink) 26%, transparent), transparent 70%),
    radial-gradient(70% 50% at 50% 115%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 70%),
    var(--bg-tint);
  border-bottom: 2px solid var(--line);
}
/* Scattered paw prints behind everything. */
.hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; background: var(--paw-print);
  -webkit-mask: var(--paw-tile) 0 0 / 150px 150px repeat; mask: var(--paw-tile) 0 0 / 150px 150px repeat;
}
.hero > * { position: relative; }
.eyebrow {
  display: inline-flex; align-items: center; gap: .4rem; margin: 0 0 1.1rem; padding: .3rem .95rem; border-radius: 999px;
  background: var(--surface); border: 2px solid var(--line); box-shadow: 2px 2px 0 var(--line);
  color: var(--text); font-size: .88rem; font-weight: 600;
}
.eyebrow .paw-icon { color: var(--accent); }
.hero h1 {
  font-size: clamp(2.3rem, 6.5vw, 3.9rem); font-weight: 700; max-width: 16ch; margin: 0 auto 1rem;
  line-height: 1.04; letter-spacing: -.03em; text-wrap: balance;
}
/* "yes", marked with a highlighter. */
.hero h1 em {
  display: inline-block; font-style: normal; color: var(--marker-text); transform: rotate(-3deg);
  padding: 0 .14em; border-radius: .12em;
  background: linear-gradient(transparent 58%, var(--marker) 58%, var(--marker) 94%, transparent 94%);
}
.hero-lede { color: var(--muted); font-size: clamp(1.05rem, 2.4vw, 1.2rem); margin: 0 auto 1.75rem; max-width: 34rem; }

/* The search card, with three dogs resting their paws on its top edge: each
   drawing's neck stops a tenth of its width above the bottom (see shared/_dog). */
.hero-search { max-width: 760px; margin: 0 auto; text-align: left; }
.hero-search .search-form { box-shadow: var(--pop-lg); padding: 1.35rem; border-radius: 26px; }
.hero-dogs { display: flex; justify-content: center; align-items: flex-end; gap: .35rem; position: relative; z-index: 1; pointer-events: none; }
.hero-dogs .dog { --w: 104px; width: var(--w); flex: none; margin-bottom: calc(var(--w) * -.1); }
.hero-dogs .dog-center { --w: 126px; }
@media (max-width: 560px) {
  .hero-dogs .dog { --w: 82px; }
  .hero-dogs .dog-center { --w: 100px; }
}

.trust-row {
  list-style: none; padding: 0; margin: 2rem auto 0; max-width: 760px;
  display: flex; justify-content: center; gap: .75rem 1.75rem; flex-wrap: wrap;
  color: var(--text); font-size: .95rem; font-weight: 500;
}
.trust-row li { display: inline-flex; align-items: center; gap: .5rem; }
.trust-icon {
  display: inline-grid; place-items: center; width: 1.9rem; height: 1.9rem; border-radius: 50%;
  border: 2px solid var(--line); color: var(--on-bright); font: 700 .95rem/1 var(--font-display);
}
.trust-icon svg { width: 1rem; height: 1rem; fill: none; stroke: currentColor; stroke-width: 2.3; stroke-linecap: round; stroke-linejoin: round; }
.trust-icon-sun { background: var(--sun); }
.trust-icon-sky { background: var(--sky); }
.trust-icon-pink { background: var(--pink); }

.how, .breeds { max-width: 980px; margin: 0 auto; padding: 3.5rem 16px 0; text-align: center; }
.how > h2, .breeds > h2 { font-size: clamp(1.7rem, 4vw, 2.3rem); margin-bottom: 1.5rem; }
.how-steps {
  list-style: none; padding: 0; margin: 0; text-align: left;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.1rem;
}
.how-steps li {
  background: var(--surface); border: 2px solid var(--line); border-radius: var(--radius);
  padding: 1.35rem; box-shadow: var(--pop);
}
.how-steps h3 { font-size: 1.25rem; margin: .8rem 0 .35rem; }
.how-steps p { margin: 0; color: var(--muted); }
/* Step numbers are dog tags, hole and all. */
.how-number {
  position: relative; display: inline-grid; place-items: center; width: 2.9rem; height: 2.9rem; border-radius: 50%;
  background: var(--sun); color: var(--on-bright); border: 2px solid var(--line); transform: rotate(-8deg);
  font: 700 1.15rem/1 var(--font-display); padding-top: .55rem;
}
.how-number::before {
  content: ""; position: absolute; top: 3px; left: 50%; width: 6px; height: 6px; margin-left: -3px;
  border-radius: 50%; background: var(--surface); border: 1.5px solid var(--line);
}
.how-steps li:nth-child(2) .how-number { background: var(--pink); transform: rotate(6deg); }
.how-steps li:nth-child(3) .how-number { background: var(--mint); transform: rotate(-4deg); }
.how-legend { display: grid; gap: .45rem; }
.how-legend > span { display: inline-flex; align-items: center; gap: .5rem; color: var(--text); }
.how-count { margin-top: 1.75rem; color: var(--muted); font-weight: 500; }

.section-lede { color: var(--muted); font-size: 1.08rem; max-width: 34rem; margin: -.75rem auto 1.75rem; }
.breed-cards {
  list-style: none; padding: 0; margin: 0;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1.1rem;
}
.breed-card {
  display: grid; height: 100%; text-decoration: none; color: var(--text); background: var(--surface);
  border: 2px solid var(--line); border-radius: var(--radius); box-shadow: var(--pop); overflow: hidden;
  transition: transform .15s, box-shadow .15s;
}
.breed-card:hover { color: var(--text); transform: translate(-2px, -2px); box-shadow: var(--pop-lg); }
.breed-card:active { transform: translate(1px, 1px); box-shadow: 1px 1px 0 var(--line); }
.breed-card-art {
  display: flex; justify-content: center; align-items: flex-end; padding-top: 1rem;
  background: var(--sun-soft); border-bottom: 2px solid var(--line);
}
.breed-card-rottweiler .breed-card-art { background: var(--sky-soft); }
.breed-card-shepherd .breed-card-art { background: var(--mint-soft); }
.breed-card-husky .breed-card-art { background: var(--pink-soft); }
.breed-card-art .dog { width: 128px; transform-origin: 50% 100%; transition: transform .2s; }
.breed-card:hover .dog { transform: scale(1.06); }
.breed-card-name { font: 700 1.25rem/1.2 var(--font-display); letter-spacing: -.01em; padding: .85rem 1rem .1rem; }
.breed-card-cta { color: var(--accent); font-weight: 700; font-size: .95rem; padding: 0 1rem 1rem; }
.breeds-cities { margin: 1.75rem 0 0; color: var(--muted); }
@media (prefers-reduced-motion: reduce) {
  .breed-card, .breed-card .dog { transition: none; }
}

/* ==========================================================================
   Search form
   ========================================================================== */

.search-form {
  display: grid; gap: 1rem;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "pets" "near" "submit";
  background: var(--surface); border: 2px solid var(--line); border-radius: var(--radius); padding: 1.1rem;
  box-shadow: var(--pop);
}
.field { min-width: 0; }
.field-label { font: 600 .86rem/1.2 var(--font-body); color: var(--text); }
.field-near { grid-area: near; }
.search-form .button-search { grid-area: submit; min-height: 52px; font-size: 1.15rem; }
.search-form input[type=number] { max-width: none; }

.input-suffix { position: relative; display: block; }
.input-suffix input { padding-right: 2.4rem; }
/* The browser's up/down arrows would sit on top of the unit. */
.input-suffix input[type=number] { -moz-appearance: textfield; appearance: textfield; }
.input-suffix input::-webkit-inner-spin-button, .input-suffix input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.input-suffix > span { position: absolute; right: .85rem; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: .9rem; font-weight: 600; pointer-events: none; }

/* Pets: one row per pet. Dogs get breed, "mixed with" and weight; picking
   "Cat" hides those fields (:has) and shows a short note instead. */
.pets { grid-area: pets; border: 0; padding: 0; margin: 0; min-width: 0; display: grid; gap: .6rem; }
.pets > legend { padding: 0; margin-bottom: .5rem; font-size: 1.05rem; line-height: 1.25rem; font-weight: 600; }
.pet-list { display: grid; gap: .75rem; }
.pet-row { display: grid; gap: .35rem; }
.pet-row + .pet-row { padding-top: .75rem; border-top: 2px dashed var(--border); }
.pet-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.pet-head[hidden], .add-pet[hidden] { display: none; }
.pet-number { font: 700 .92rem var(--font-body); }
.pet-remove { background: none; border: 0; padding: 0; color: var(--muted); font: inherit; font-size: .88rem; font-weight: 600; cursor: pointer; text-decoration: underline; }
.pet-remove:hover { color: var(--bad-text); }
.pet-fields {
  display: grid; gap: .6rem; align-items: end;
  grid-template-columns: 6.75rem minmax(0, 1.35fr) minmax(0, 1fr) 7.5rem;
}
.pet-fields .field-label { font-size: .85rem; }
.cat-note { display: none; margin: 0; color: var(--muted); font-size: .9rem; align-self: center; }
.pet-fields:has(.kind-select option[value=cat]:checked) .dog-only { display: none; }
.pet-fields:has(.kind-select option[value=cat]:checked) .cat-note { display: block; grid-column: 2 / -1; }
.add-pet {
  justify-self: start; background: none; border: 2px dashed var(--border-strong); border-radius: 999px;
  padding: .35rem 1rem; color: var(--accent); font: 700 .92rem var(--font-body); cursor: pointer;
}
.add-pet:hover { background: var(--accent-soft); border-color: var(--accent); }

.search-form-compact {
  grid-template-columns: minmax(0, 3fr) minmax(12rem, 1.3fr) auto;
  grid-template-areas: "pets near submit";
  align-items: end;
}
.search-form-compact .button-search { min-height: 46px; font-size: 1.02rem; padding-inline: 1.4rem; }
/* "Add another pet" moves up beside "Your pet", so the pets end with their
   fields and "Close to" and the button line up with them. It's placed from
   below the legend (1.25rem tall, .5rem margin), centered on its line. */
.search-form-compact .pets { position: relative; }
.search-form-compact .add-pet {
  position: absolute; top: -1.125rem; right: 0; transform: translateY(-50%);
  padding: .1rem .8rem; font-size: .85rem;
}

@media (max-width: 860px) {
  .search-form-compact { grid-template-columns: minmax(0, 1fr); grid-template-areas: "pets" "near" "submit"; }
  .pet-fields { grid-template-columns: minmax(0, 1fr) 7.5rem; }
  .pet-fields .field-kind, .pet-fields .field-breed { grid-column: 1 / -1; }
  .pet-fields:has(.kind-select option[value=cat]:checked) .cat-note { grid-column: 1 / -1; }
}

/* ==========================================================================
   Results
   ========================================================================== */

.results-search { margin-bottom: 1.75rem; }

.results-layout { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 1.5rem; align-items: start; }
/* Without a Google key there's no map (SearchesHelper#google_maps_browser_key). */
.results-layout:not(:has(.results-map)) { grid-template-columns: minmax(0, 1fr); max-width: 760px; }
.results-map {
  position: sticky; top: 5rem; height: calc(100vh - 6.5rem); min-height: 340px; overflow: hidden;
  border-radius: var(--radius); border: 2px solid var(--line); box-shadow: var(--pop); z-index: 0;
  background: var(--surface-2);
}
@media (max-width: 860px) {
  .results-layout { grid-template-columns: 1fr; }
  .results-map { position: relative; top: 0; height: 300px; order: -1; }
}

.results-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; margin-bottom: .75rem; }
.results-head h1 { font-size: 2rem; margin: 0; }
.results-summary { margin: .2rem 0 0; color: var(--muted); }

.segmented { display: inline-flex; padding: 3px; gap: 2px; background: var(--surface); border: 2px solid var(--line); border-radius: 999px; }
.segmented a { padding: .3rem .9rem; border-radius: 999px; color: var(--muted); text-decoration: none; font-size: .9rem; font-weight: 600; }
.segmented a:hover { color: var(--text); }
.segmented a.active { background: var(--sun); color: var(--on-bright); }
.results-controls { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: flex-end; }
.distance-drive { margin-right: .25rem; }

.legend { display: flex; gap: .5rem 1.25rem; flex-wrap: wrap; margin: 0 0 1rem; color: var(--muted); font-size: .9rem; font-weight: 500; }
.legend > span { display: inline-flex; align-items: center; gap: .4rem; }

.result-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 1.1rem; }
.result {
  position: relative; background: var(--surface); border: 2px solid var(--line); border-radius: var(--radius);
  padding: 1.15rem 1.25rem 1rem 1.5rem; box-shadow: var(--pop); overflow: hidden;
  transition: box-shadow .2s, transform .2s;
}
.result::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 6px; background: var(--pin-maybe); }
.result-yes::before { background: var(--pin-yes); }
.result-no::before { background: var(--pin-no); }
.result:hover { box-shadow: var(--pop-lg); transform: translate(-1px, -1px); }
.result-highlight { box-shadow: 0 0 0 4px var(--sun), var(--pop-lg); }

/* isolation keeps the number's ears (behind it) in front of the card. */
.result-head { display: flex; gap: .85rem; align-items: flex-start; flex-wrap: wrap; isolation: isolate; }
.result-title { flex: 1 1 220px; min-width: 0; }
.result-title h2 { font-size: 1.3rem; margin: 0 0 .15rem; }
.result-address { margin: 0; color: var(--muted); font-size: .92rem; display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.distance { background: var(--surface-2); border: 1.5px solid var(--border-strong); border-radius: 999px; padding: 0 .55rem; font-size: .8rem; font-weight: 600; color: var(--text); }
.result-badges { display: flex; gap: .35rem; flex-wrap: wrap; align-items: center; }

/* Numbered dog heads, in the list and on the map: a circle with floppy ears. */
.result-number, .map-pin {
  position: relative; display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; flex: none;
  background: var(--pin); color: #fff; border: 2px solid var(--line); font: 700 .9rem/1 var(--font-display);
}
.result-number { margin: .15rem .15rem 0; }
.result-number::before, .result-number::after, .map-pin::before, .map-pin::after {
  content: ""; position: absolute; z-index: -1; top: -2px; width: 12px; height: 18px;
  background: color-mix(in srgb, var(--pin) 70%, #000); border: 2px solid var(--line);
  border-radius: 50% 50% 50% 50% / 40% 40% 60% 60%;
}
.result-number::before, .map-pin::before { left: -7px; transform: rotate(26deg); }
.result-number::after, .map-pin::after { right: -7px; transform: rotate(-26deg); }
.pin-yes { --pin: var(--pin-yes); }
.pin-maybe { --pin: var(--pin-maybe); color: var(--on-bright); }
.pin-no { --pin: var(--pin-no); }

.checks { list-style: none; padding: 0; margin: 1rem 0; display: grid; gap: .45rem; }
.check-row { display: flex; align-items: flex-start; gap: .6rem; font-size: .95rem; }
.check-row strong { font-weight: 700; margin-right: .2rem; }
.check-row-unknown > span:last-child { color: var(--muted); }
.check-row-unknown strong { color: var(--text); }

.result-facts {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .6rem 1rem;
  margin: 0; padding: .85rem 0; border-top: 2px dashed var(--border); border-bottom: 2px dashed var(--border);
  font-size: .92rem;
}
.result-facts dt { font: 500 .8rem/1.3 var(--font-body); color: var(--muted); }
.result-facts dd { margin: .1rem 0 0; font-weight: 600; }

.result-foot { display: flex; justify-content: space-between; align-items: center; gap: .75rem; flex-wrap: wrap; margin-top: .9rem; }
.result-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.verified { color: var(--muted); font-size: .85rem; font-weight: 500; display: inline-flex; align-items: center; gap: .35rem; }
.verified::before { content: "✓"; display: inline-grid; place-items: center; width: 1.15rem; height: 1.15rem; border-radius: 50%; background: var(--good-bg); color: var(--good-text); font-size: .7rem; font-weight: 700; }

.results-more { margin-top: 1.25rem; color: var(--muted); font-weight: 500; }

.empty-state {
  text-align: center; background: var(--surface); border: 2px dashed var(--border-strong); border-radius: var(--radius);
  padding: 2rem 1.5rem 2.25rem; color: var(--muted);
}
/* The dog peeks over a short ledge. */
.empty-state .dog { width: 110px; margin: 0 auto; padding: 0 18px; box-sizing: content-box; border-bottom: 2px solid var(--line); }
.empty-state h2 { color: var(--text); margin: .9rem 0 .35rem; font-size: 1.5rem; }
.empty-state p { margin: 0 auto; max-width: 28rem; }

/* Map pins: the same dog heads (map_controller.js). Google hangs a marker
   above its spot, so these move down half their height to sit centered on it;
   isolation keeps the ears behind the head but in front of the map. */
.map-marker { isolation: isolate; transform: translateY(50%); }
.map-pin { box-shadow: 0 3px 8px rgb(0 0 0 / .3); cursor: pointer; }
.map-origin {
  width: 18px; height: 18px; border-radius: 50%; transform: translateY(50%);
  background: var(--accent); border: 3px solid #fff; box-shadow: 0 2px 6px rgb(0 0 0 / .35);
}

/* ==========================================================================
   Breed pages (BreedPage): landing pages for search engines
   ========================================================================== */

.breed-page-head { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 1.75rem; align-items: end; margin-bottom: 1.75rem; }
.breed-page-head .eyebrow { margin-bottom: .75rem; }
.breed-page-head h1 { font-size: clamp(2rem, 5vw, 2.9rem); line-height: 1.08; letter-spacing: -.03em; margin-bottom: .6rem; text-wrap: balance; }
/* The dog peeks over a short ledge, like the empty state's. */
.breed-page-dog { width: 132px; padding: 0 14px; box-sizing: content-box; border-bottom: 2px solid var(--line); }
.breed-page-lede { color: var(--muted); font-size: 1.08rem; margin: 0 0 1.1rem; max-width: 38rem; }
@media (max-width: 640px) {
  .breed-page-head { grid-template-columns: 1fr; gap: 1rem; }
  .breed-page-dog { width: 100px; }
}

.breed-index { margin-top: 2.5rem; }
.breed-index h2 { font-size: 1.4rem; }
.breed-links { list-style: none; padding: 0; margin: .75rem 0 0; display: flex; flex-wrap: wrap; gap: .5rem; }
.breed-links a {
  display: inline-flex; align-items: center; gap: .45rem; padding: .35rem .5rem .35rem .9rem; border-radius: 999px;
  background: var(--surface); border: 2px solid var(--line); color: var(--text); text-decoration: none; font-weight: 600;
}
.breed-links li:first-child:not(:has(.breed-link-count)) a { padding-right: .9rem; }
.breed-links a:hover { background: var(--sun-soft); color: var(--text); }
.breed-link-count { display: inline-grid; place-items: center; min-width: 1.6rem; height: 1.6rem; padding: 0 .35rem; border-radius: 999px; background: var(--surface-2); color: var(--muted); font-size: .82rem; font-weight: 700; }
.breed-page-note { margin-top: 2.5rem; color: var(--muted); font-size: .9rem; max-width: 40rem; }

/* ==========================================================================
   Admin
   ========================================================================== */

.tabs { display: flex; gap: 1.25rem; border-bottom: 1px solid var(--border); margin-bottom: 1rem; }
.tabs a { padding: .5rem 0; text-decoration: none; color: var(--muted); border-bottom: 2px solid transparent; font-weight: 600; }
.tabs a.active { color: var(--text); border-color: var(--accent); }

.table { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); }
.table th, .table td { text-align: left; padding: .75rem 1rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table th { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); background: var(--surface-2); }
.table .actions { text-align: right; white-space: nowrap; }
@media (max-width: 640px) {
  .table thead { display: none; }
  .table tr { display: block; border-bottom: 1px solid var(--border); padding: .5rem 0; }
  .table td { display: block; border: 0; padding: .2rem 1rem; }
  .table .actions { text-align: left; }
}

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; margin-bottom: 1rem; box-shadow: var(--shadow-sm); }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.attention { border-left: 3px solid var(--warn-text); }
.attention h2 { font-size: 1.1rem; margin-top: 0; }
.attention-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .6rem; }
.attention-list li { display: flex; flex-wrap: wrap; align-items: baseline; gap: .35rem .6rem; }
.attention-message { flex: 1 1 16rem; }
.attention-actions { display: inline-flex; gap: .9rem; align-items: baseline; font-size: .9rem; }
.table td.needs .tag { margin: .1rem .15rem .1rem 0; }
label.flagged input, label.flagged textarea { border-color: var(--warn-text); }
.flag-note { color: var(--warn-text); font-size: .82rem; font-weight: 500; }
/* A note under one field would push its box above its neighbors'. */
.row:has(> label .flag-note) { align-items: flex-start; }
details.card summary { cursor: pointer; font-weight: 600; }

.facts { display: grid; grid-template-columns: max-content 1fr; gap: .45rem 1.5rem; margin: 1rem 0 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }
.facts dd p { margin: 0; }
@media (max-width: 640px) { .facts { grid-template-columns: 1fr; } .facts dd { margin-bottom: .4rem; } }
.sources { padding-left: 1.2rem; margin: .25rem 0 0; }

.call-sheet fieldset {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.1rem 1.25rem; margin: 0 0 1rem; display: grid; gap: .85rem; box-shadow: var(--shadow-sm);
}
.call-sheet legend { font-family: var(--font-display); font-weight: 650; font-size: 1.05rem; padding: 0 .4rem; }
.question { display: flex; justify-content: space-between; align-items: center; gap: .5rem 1rem; flex-wrap: wrap; }
.question > span, .question > label { color: var(--text); font-size: 1rem; font-weight: 500; }
.choices { display: flex; gap: .3rem; flex-wrap: wrap; }
.choice { display: inline-flex; align-items: center; gap: .4rem; color: var(--text); font-size: .95rem; cursor: pointer; }
.choices .choice { border: 1px solid var(--border-strong); border-radius: 999px; padding: .35rem .8rem; transition: background .15s, border-color .15s; }
.choices .choice:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.breed-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .45rem .75rem; }
.source-row { display: grid; gap: .65rem; padding-bottom: .85rem; border-bottom: 1px dashed var(--border); }
.source-row:last-child { border-bottom: 0; padding-bottom: 0; }
.form-actions {
  display: flex; gap: .75rem; justify-content: flex-end; position: sticky; bottom: 0; padding: .85rem 0;
  background: linear-gradient(transparent, var(--bg) 35%);
}

/* The property page: one screen with jump links to each part of the work. */
.jump { display: flex; flex-wrap: wrap; gap: .25rem 1.1rem; margin: -.5rem 0 1.25rem; font-size: .9rem; }
.jump a { color: var(--muted); text-decoration: none; font-weight: 500; }
.jump a:hover { color: var(--text); text-decoration: underline; }
section[id] { scroll-margin-top: 1rem; }
.card-head h2, .section-head h2 { margin: 0; font-size: 1.15rem; }
.card-head .hint { flex: 1 1 16rem; text-align: right; }
.card-head .button, .card-head form { white-space: nowrap; flex: none; }
.card-head > div > .hint { text-align: left; }
@media (max-width: 640px) { .card-head .hint { flex-basis: 100%; text-align: left; } }
.card-head + .stack, .card-head + form { margin-top: 1rem; }
.section-head { display: grid; gap: .35rem; margin: .5rem 0 1rem; }

/* The email to send, and the reply box that reads what comes back. */
.email-request { margin-top: 1rem; border-top: 1px solid var(--border); padding-top: .75rem; }
.email-request summary { cursor: pointer; font-weight: 600; font-size: .95rem; }
.email-request[open] summary { margin-bottom: .75rem; }
.email-request textarea { font-family: var(--font-body); }
.email-results h2 { font-size: 1.1rem; margin-top: 0; }
.email-results .quote { color: var(--muted); font-style: italic; }
.email-request .stack > .button, .email-fill .stack > .button { justify-self: start; }

/* Reach filter and tags: how the leasing office can be contacted. */
.filters { display: flex; flex-wrap: wrap; gap: .25rem .5rem; align-items: center; margin: 0 0 1rem; font-size: .9rem; }
.filters-label { color: var(--neutral-text); }
.filters a { padding: .15rem .5rem; border-radius: 999px; background: var(--neutral-bg); color: inherit; text-decoration: none; }
.filters a.active { background: var(--text); color: var(--bg); }
.table td.reach .tag { margin: .1rem .15rem .1rem 0; }
.tag-reach { background: var(--neutral-bg); color: var(--neutral-text); }
.tag-reach-ai { background: var(--good-bg); color: var(--good-text); }

/* Work queue: outreach status, quick actions and the log of tries. */
.pill-work { white-space: nowrap; }
.pill-neutral { background: var(--neutral-bg); color: var(--neutral-text); }
.pill-good { background: var(--good-bg); color: var(--good-text); }
.pill-warn { background: var(--warn-bg); color: var(--warn-text); }
.filters select { font: inherit; padding: .15rem .4rem; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface); color: inherit; }
.outreach .card-head { flex-wrap: wrap; }
.outreach .card-head .muted { flex: 1 1 16rem; text-align: right; }
.outreach-actions { margin: .75rem 0 1rem; }
.outreach-question textarea { font-size: .9rem; }
.outreach-log { margin-top: 1rem; }
.outreach-log fieldset { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .75rem 1rem 1rem; }
.outreach-log .choices { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; margin-bottom: .75rem; }
.attempts { list-style: none; padding: 0; margin: 1rem 0 0; font-size: .9rem; }
.attempts li { padding: .35rem 0; border-top: 1px solid var(--border); }
