:root {
  --paper: #ffffff;
  --tile: #f5f5f5;
  --tile-hi: #efefef;
  --border: #e6e6e6;
  --ink: #000000;
  --text-secondary: #757575;
  --text-muted: #a3a3a3;
  --pill: #ececec;
  --pill-hi: #e0e0e0;
  --accent: #00b6c4;
  --danger: #b4433f;
  --danger-dim: #fbf0ef;
  --warn: #927019;
  --warn-dim: #f8f2e2;
  --success: #00949f;
  --success-dim: #e4f6f8;
  --serif: Georgia, "Times New Roman", Times, serif;
  --mono: "IBM Plex Mono", "SF Mono", SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word; /* long links and words wrap instead of widening the page */
}
a { color: inherit; }
::selection { background: #c9f7fb; }
img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; cursor: pointer; }
[hidden] { display: none !important; }

.mono {
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 10.5px;
  color: var(--text-muted);
}

/* Header */
.site-header {
  position: relative;
  display: flex;
  align-items: flex-start;
  min-height: 64px;
  padding: 20px 24px 18px;
}
.hd-mark { display: block; width: 26px; height: 26px; color: var(--ink); }
.hd-word {
  margin: 0;
  font-weight: 400;
  line-height: 1.2;
  position: absolute;
  left: 50%;
  top: 12px;
  transform: translateX(-50%);
  font-size: 34px;
  letter-spacing: -0.02em;
  white-space: nowrap;
}
.hd-word a { text-decoration: none; }
.hd-word a:hover { text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 5px; }
.hd-slash { color: var(--text-muted); }
.hd-menu { margin-left: auto; }

/* Menu overlay: matches the one on joyjcai.com */
.menu { position: fixed; inset: 0; z-index: 60; background: linear-gradient(to right, rgba(255,255,255,0.55), rgba(255,255,255,0.92) 60%); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); opacity: 0; visibility: hidden; transition: opacity 0.3s ease, visibility 0.3s; }
.menu.is-open { opacity: 1; visibility: visible; }
.menu-close { position: absolute; top: 20px; right: 24px; font-size: 17px; padding: 7px 13px; }
.menu-nav { position: absolute; top: 92px; right: 96px; display: flex; flex-direction: column; gap: 14px; text-align: left; }
.menu-nav > a { font-size: 26px; letter-spacing: -0.015em; text-decoration: none; transform: translateY(6px); opacity: 0; transition: opacity 0.35s ease, transform 0.35s ease; }
.menu.is-open .menu-nav > a { opacity: 1; transform: none; }
.menu-nav > a:hover { text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 5px; }
.menu-nav > a:nth-child(2) { transition-delay: 0.04s; }
.menu-nav > a:nth-child(3) { transition-delay: 0.08s; }
.menu-nav > a:nth-child(4) { transition-delay: 0.12s; }
.menu-nav > a:nth-child(5) { transition-delay: 0.16s; }
.menu-nav > a:nth-child(6) { transition-delay: 0.20s; }
.menu-nav > a:nth-child(7) { transition-delay: 0.24s; }
.menu-sub { margin-top: 26px; display: flex; flex-direction: column; gap: 10px; opacity: 0; transition: opacity 0.35s ease 0.26s; }
.menu.is-open .menu-sub { opacity: 1; }
.menu-sub a { font-size: 12.5px; color: var(--text-secondary); text-decoration: none; padding: 10px 0; margin: -10px 0; }
.menu-sub a:hover { color: var(--ink); }
@media (prefers-reduced-motion: reduce) { .menu, .menu-nav > a, .menu-sub { transition: none; } }

.wrap { max-width: calc(1180px + 48px); margin: 0 auto; padding: 0 24px 64px; }

/* Intro */
.intro { padding: 24px 0 28px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 40px; align-items: stretch; }
.intro-text { max-width: 620px; }
.fact { margin: 12px 0 0; font-family: var(--serif); font-size: 15.5px; line-height: 1.6; color: var(--text-secondary); }
.fact a { color: var(--ink); }
.fact .mono { margin-right: 10px; font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted); }
.fact a { text-underline-offset: 3px; text-decoration-color: var(--border); }
.fact a:hover { text-decoration-color: var(--accent); }
/* The photo has a fixed width and fills the intro's height, so it never squeezes the text
   column (however long Luke's pick is) and the text never runs under the tabs. Anchored at
   the bottom: trimming above his head is fine, never his mouth. */
.luke { --luke-w: clamp(110px, 10vw, 150px); position: relative; margin: 0; display: flex; align-items: flex-end; padding-right: calc(var(--luke-w) + 12px); min-height: calc(var(--luke-w) * 1.1); }
.luke img { position: absolute; top: 0; right: 0; bottom: 0; width: var(--luke-w); height: 100%; object-fit: cover; object-position: 50% 100%; background: var(--tile); }
.luke figcaption { order: 1; width: 110px; margin: 0; font-family: var(--serif); font-size: 13px; line-height: 1.4; letter-spacing: 0; text-transform: none; color: var(--text-secondary); text-align: right; }
.saber { vertical-align: -2px; }

.lede, .body-copy { color: var(--text-secondary); font-family: var(--serif); font-size: 18px; line-height: 1.5; letter-spacing: -0.005em; margin: 0; }
.body-copy { max-width: 760px; margin: 20px 0; }

/* Tabs */
.tabs { display: flex; gap: 28px; border-bottom: 1px solid var(--border); }
.tab {
  background: none;
  border: 0;
  border-bottom: 1px solid transparent;
  margin-bottom: -1px;
  padding: 10px 0;
  font-family: var(--mono);
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
}
.tab-icon { flex: none; color: var(--text-muted); transition: color 0.15s; }
.tab.active { color: var(--ink); border-bottom-color: var(--ink); }
.tab.active .tab-icon, .tab:hover .tab-icon { color: var(--ink); }
.tab:hover { color: var(--ink); }
.tab-count { font-size: 10px; }


/* Toolbar: search and filters in one compact row that stays in view while scrolling */
.toolbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--paper);
  border-bottom: 1px solid transparent;
  padding: 16px 0 8px;
  transition: border-color 0.15s;
}
/* The bar only shows its edge while it's stuck to the top over the animals. */
.toolbar.stuck { border-bottom-color: var(--border); }
.bar { display: flex; align-items: flex-end; gap: 12px clamp(14px, 1.6vw, 24px); flex-wrap: wrap; }
.bar-more { flex: 1 1 100%; padding-top: 2px; margin-top: 0; }
/* On wider screens the filter "sheet" is just part of the toolbar row. */
.filter-sheet { display: contents; }
.sheet-head, .sheet-foot, .filters-btn { display: none; }
.sheet-scrim { position: fixed; inset: 0; z-index: 44; background: rgba(0, 0, 0, 0.2); }
/* Every toolbar control shares one look: a mono key, a serif value and the same underline,
   at the same height, so the row reads as one even strip. */
/* Each control: a mono label on top, the serif value below, one underline. */
.field, .dd-btn, .field-btn {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 2px 8px;
  padding: 0 0 7px;
  border: 0;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  background: transparent;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 22px;
  color: var(--ink);
  transition: border-color 0.15s;
}
.field:focus-within, .dd-btn:focus-visible, .dd.open .dd-btn, .field-btn:focus-visible { border-bottom-color: var(--accent); outline: none; }
.field input, .field input[type="search"], .field input[type="text"] { flex: 1; min-width: 0; width: 100%; border: 0; padding: 0; background: transparent; font: inherit; line-height: inherit; color: inherit; outline: none; -webkit-appearance: none; appearance: none; }
.field input::placeholder, .field input[type="search"]::placeholder { color: var(--text-muted); }
.field-btn { cursor: pointer; white-space: nowrap; text-align: left; }
.field-btn:hover, .dd-btn:hover { border-bottom-color: var(--text-muted); }
.field-btn.on { border-bottom-color: var(--ink); }
.search { position: relative; flex: 1 1 180px; min-width: 140px; }
.search input[type="search"] { padding-right: 30px; }
.search .key-hint { position: absolute; right: 0; bottom: 8px; font-family: var(--mono); font-size: 12px; color: var(--text-muted); pointer-events: none; }
.search input:focus + .key-hint, .search input:not(:placeholder-shown) + .key-hint { display: none; }
input[type="search"], select {
  border: none;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  background: transparent;
  font-family: var(--serif);
  font-size: 15px;
  padding: 7px 0;
  color: var(--ink);
  width: 100%;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23a3a3a3'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 2px center;
  padding-right: 18px;
  text-overflow: ellipsis;
  cursor: pointer;
}
.zip { flex: 0 0 96px; min-width: 0; }
.zip:has(input[aria-invalid="true"]) { border-bottom-color: var(--danger); }
.zip-note { margin: 8px 0 0; color: var(--danger); text-transform: none; letter-spacing: 0; font-size: 12px; }
.zip-note:empty { display: none; }

/* Active filter chips */
.chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: -12px 0 24px; }
.chips:empty { display: none; }
.chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--border); background: var(--paper); border-radius: 999px; padding: 5px 8px 5px 12px; font-family: var(--mono); font-size: 12px; line-height: 1; color: var(--ink); cursor: pointer; }
.chip:hover { background: var(--tile); }
.chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.chip .x { color: var(--text-muted); font-size: 14px; line-height: 1; }
.chip:hover .x { color: var(--ink); }
.chips .reset { margin-left: 4px; }

.text-btn { background: none; border: 0; padding: 6px 0; font-size: 12px; text-transform: none; letter-spacing: 0; color: var(--ink); text-decoration: underline; text-decoration-color: var(--border); text-underline-offset: 4px; white-space: nowrap; }
.text-btn.on { text-decoration-color: var(--ink); }
.text-btn:hover { text-decoration-color: var(--accent); }
.text-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.layout-toggle { margin-left: auto; display: inline-flex; gap: 2px; }

/* Spotlight: one-tap views for animals who most need a home */
.spotlight { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 22px; padding: 12px 0 24px; }
/* Text toggles in the bracket style of joyjcai.com's shortcuts: [ ] off, [•] on. */
.toggle { background: none; border: 0; padding: 4px 0; font-size: 12px; text-transform: none; letter-spacing: 0; color: var(--text-secondary); white-space: nowrap; }
.toggle::before { content: "[ ]"; margin-right: 6px; color: var(--text-muted); }
.toggle.on { color: var(--ink); }
.toggle.on::before { content: "[\2022]"; color: var(--accent); }
.toggle:hover { color: var(--ink); }
.toggle .count { margin-left: 6px; color: var(--text-muted); }
.toggle.on .count { color: var(--text-secondary); }
.toggle:focus-visible, .icon-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.icon-btn { background: none; border: 0; padding: 4px; display: inline-grid; place-items: center; color: var(--text-muted); }
.icon-btn:hover, .icon-btn.on { color: var(--ink); }
.spotlight > span.mono { margin-right: -8px; }

/* Custom dropdowns (public/dropdown.js) */
.dd { position: relative; flex: 0 1 auto; min-width: 0; }
.dd-native { position: absolute; inset: 0; opacity: 0; pointer-events: none; width: 100%; }
.dd-btn { width: 100%; justify-content: flex-start; text-align: left; }
.dd-key { grid-column: 1 / -1; font-family: var(--mono); font-size: 10px; line-height: 14px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); }
.dd-btn::after, .field-btn::after {
  content: "";
  grid-column: 2;
  grid-row: 2;
  width: 10px;
  height: 6px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23a3a3a3'/%3E%3C/svg%3E") no-repeat center;
  transition: transform 0.15s;
}
.dd.open .dd-btn::after, .field-btn[aria-expanded="true"]::after { transform: rotate(180deg); }
.dd-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dd-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 30;
  min-width: 100%;
  width: max-content;
  max-width: 320px;
  max-height: 320px;
  overflow-y: auto;
  margin: 0;
  padding: 4px 0;
  list-style: none;
  background: var(--paper);
  border: 1px solid var(--border);
}
.dd-menu li {
  padding: 8px 14px 8px 16px;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
  border-left: 2px solid transparent;
}
.dd-menu li.active { background: var(--tile); color: var(--ink); }
.dd-menu li.on { color: var(--ink); border-left-color: var(--accent); }
.dd-menu li.off { color: var(--text-muted); cursor: default; }
.dd.disabled .dd-btn { color: var(--text-muted); cursor: default; }
.dd.disabled .dd-btn::after { opacity: 0.5; }
input::placeholder { color: var(--text-muted); }
input[type="search"]:focus, select:focus { border-bottom-color: var(--accent); }

.pill {
  border: 0;
  border-radius: 999px;
  background: var(--pill);
  padding: 9px 14px;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1;
  color: var(--ink);
  white-space: nowrap;
  transition: background 0.2s ease;
}
.pill:hover { background: var(--pill-hi); }
.pill.on { background: var(--ink); color: var(--paper); }
.pill:focus-visible, .btn:focus-visible, .tab:focus-visible, .card:focus-visible, .reset:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.check { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; text-transform: none; letter-spacing: 0; color: var(--text-secondary); cursor: pointer; white-space: nowrap; }
.check input { accent-color: var(--ink); margin: 0; }
.reset { background: none; border: 0; margin-left: auto; padding: 4px 0; font-size: 12.5px; text-transform: none; letter-spacing: 0; text-decoration: underline; text-underline-offset: 3px; }
.reset:hover { color: var(--ink); }

/* Results */
.mix { display: flex; align-items: center; gap: 8px 16px; flex-wrap: wrap; margin: 2px 0 0; }
.mix:empty { display: none; }
.mix-bar { flex: 1 1 200px; display: flex; height: 4px; background: #dcdcdc; overflow: hidden; }
.mix-bar i { display: block; height: 100%; }
.mix-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.mix-legend span { display: inline-flex; align-items: center; gap: 6px; }
.mix-legend b { width: 8px; height: 8px; display: inline-block; }
.mix-dog { background: var(--ink); }
.mix-cat { background: var(--accent); }
.mix-rabbit { background: #a3a3a3; }
.mix-other { background: #dcdcdc; }
.result-bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 6px 16px; padding: 14px 0 12px; margin-top: 36px; border-top: 1px solid var(--border); }
.grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 32px 24px;
}
/* Cards follow the Tools grid on joyjcai.com: no border, gray photo tile, tag, name, gray description. */
.card-wrap { position: relative; min-width: 0; }
.card { display: flex; flex-direction: column; min-width: 0; color: inherit; text-decoration: none; }
.marks { position: absolute; left: 8px; top: 8px; z-index: 2; display: flex; flex-wrap: wrap; gap: 4px; max-width: calc(100% - 52px); }
.mark { background: var(--paper); color: var(--ink); border-radius: 999px; padding: 4px 8px; font-size: 9.5px; letter-spacing: 0.06em; line-height: 1; }
.share {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 3;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
  display: grid;
  place-items: center;
  opacity: 0;
  transition: opacity 0.15s, background 0.15s;
}
.card-wrap:hover .share, .share:focus-visible { opacity: 1; }
.share:hover { background: var(--pill); }
.share:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (hover: none) { .share { opacity: 1; } }
.card .photo {
  aspect-ratio: 1 / 1;
  background: var(--tile);
  overflow: hidden;
  position: relative;
  margin-bottom: 8px;
  transition: background 0.25s ease;
}
.card:hover .photo { background: var(--tile-hi); }
.card .photo img { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 0.3s ease, transform 0.4s ease; }
@media (hover: hover) { .card:hover .photo img { transform: scale(1.03); } }
.card .photo img.loaded { opacity: 1; }
/* Second photo, shown on hover (desktop only) once it has loaded */
.card .photo img.alt { z-index: 2; opacity: 0; }
.card:hover .photo img.alt.loaded { opacity: 1; }
.photo-count { position: absolute; right: 8px; bottom: 8px; z-index: 3; background: var(--paper); border-radius: 999px; padding: 3px 7px; font-size: 9.5px; letter-spacing: 0.06em; opacity: 0; transition: opacity 0.15s; }
.card:hover .photo-count { opacity: 1; }
@media (hover: none) { .photo-count { display: none; } }
.no-photo { position: absolute; inset: 0; display: none; flex-direction: column; align-items: center; justify-content: center; gap: 10px; }
.photo.missing .no-photo { display: flex; }
.ascii { margin: 0; font-family: var(--mono); font-size: 11px; line-height: 1.45; letter-spacing: 0.02em; color: #adadad; white-space: pre; user-select: none; }
.ascii i { color: var(--accent); font-style: normal; }
.card:hover .ascii { color: #8f8f8f; }
/* Time waiting: 2px track, cyan fill (full at a year or more) */
.wait-row { display: flex; align-items: center; gap: 8px; min-height: 12px; margin: 0 0 8px; }
.wait { flex: 1; height: 2px; background: #dcdcdc; overflow: hidden; }
.wait i { display: block; height: 100%; background: var(--accent); }
.wait-label { flex: none; font-size: 9.5px; letter-spacing: 0.06em; color: var(--text-secondary); }
.sp-icon { flex: none; color: var(--ink); }
.card-tag span { overflow: hidden; text-overflow: ellipsis; }
.card-tag { display: flex; align-items: center; gap: 6px; font-size: 10.5px; letter-spacing: 0.06em; margin-bottom: 4px; color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-name { display: block; font-size: 17.5px; line-height: 1.25; letter-spacing: -0.01em; overflow-wrap: anywhere; }
.card:hover .card-name, .card:focus-visible .card-name { text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 4px; }
.card:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.card-desc { display: block; font-size: 14px; line-height: 1.45; color: var(--text-secondary); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-shelter { display: block; font-size: 13px; line-height: 1.4; color: var(--text-secondary); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.more { display: flex; justify-content: center; padding-top: 32px; }
@media (max-width: 980px) { .grid:not(.list) { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* Buttons */
.btn {
  border: 0;
  border-radius: 999px;
  padding: 11px 22px;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.15s, background 0.2s ease;
}
.btn-primary { background: var(--ink); color: var(--paper); }
.btn-primary:hover { opacity: 0.82; }
.btn-secondary { background: var(--pill); color: var(--ink); }
.btn-secondary:hover { background: var(--pill-hi); }

/* Badges */
.badge {
  display: inline-block;
  border-radius: 999px;
  padding: 2px 9px;
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 9.5px;
  vertical-align: 1px;
}
.badge-live { background: var(--success-dim); color: var(--success); }
.badge-link { background: var(--warn-dim); color: var(--warn); }
.badge-error { background: var(--danger-dim); color: var(--danger); }

/* Empty and loading */
.empty { grid-column: 1 / -1; padding: 64px 0; text-align: center; }
.empty p { font-size: 20px; margin: 0 0 8px; }
.empty-fix { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 20px; }
.spinner {
  width: 18px;
  height: 18px;
  border: 1.5px solid var(--border);
  border-top-color: var(--ink);
  border-radius: 50%;
  margin: 0 auto 16px;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Shelter tables */
.shelter-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 14px 0 10px; }
.region-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.sub-pills { padding-left: 14px; border-left: 1px solid var(--border); }
.legend { margin: 0 0 4px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.legend .badge + .badge, .legend .badge:not(:first-child) { margin-left: 10px; }
.region-head, .subregion-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; }
.region-head { margin: 22px 0 6px; }
.subregion-head { margin: 18px 0 8px; }
.region-title { font-size: 22px; font-weight: 400; letter-spacing: -0.02em; margin: 0; }
.subregion-title { font-size: 17px; font-weight: 400; letter-spacing: -0.01em; margin: 0; }
.pill-sm { padding: 7px 12px; font-size: 12px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th {
  background: var(--tile);
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 10px;
  font-weight: 400;
  color: var(--text-muted);
  text-align: left;
  padding: 9px 12px;
}
td { padding: 11px 12px; border-bottom: 1px solid var(--border); vertical-align: top; font-size: 15px; }
td.num { font-family: var(--mono); font-size: 12px; }
td .sub { display: block; color: var(--text-secondary); font-size: 13.5px; }
td a.link { font-family: var(--mono); font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.08em; }
.row-btn { background: none; border: 0; padding: 0; text-align: left; font-size: 15px; text-decoration: underline; text-decoration-color: var(--border); text-underline-offset: 3px; }
.row-btn:hover { text-decoration-color: var(--accent); }

.site-footer { padding: 28px 0 24px; }
.footer-inner {
  max-width: calc(1180px + 48px);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 11.5px;
  letter-spacing: 0.04em;
  text-transform: none;
}
.site-footer a { text-decoration: none; color: var(--text-secondary); }
.site-footer .footer-cta { text-decoration: underline; text-underline-offset: 3px; }
.site-footer .footer-cta:hover, .reset:hover { text-decoration-color: var(--accent); }
.site-footer a:hover { color: var(--ink); }


/* Touch screens: 16px inputs stop iOS from zooming in on focus; no gray tap flash. */
@media (pointer: coarse) {
  .field, .field input, .field input[type="search"], .field input[type="text"] { font-size: 16px; }
  a, button { -webkit-tap-highlight-color: transparent; }
}

@media (max-width: 720px) {
  .site-header { padding: 16px 16px 14px; min-height: 56px; }
  .hd-word { font-size: 22px; top: 18px; }
  .hd-menu .key-hint { display: none; }
  .menu-nav { right: 24px; }
  .wrap { padding: 0 16px 48px; }
  .site-footer { padding: 18px 0; }
  .footer-inner { padding: 0 16px; }
  /* Phones: a small photo of Luke beside the intro instead of its own row. */
  .intro { padding: 24px 0 20px; grid-template-columns: minmax(0, 1fr) 84px; gap: 16px; align-items: start; }
  .luke { width: 84px; padding-right: 0; min-height: 0; flex-direction: column; align-items: stretch; gap: 6px; }
  .luke figcaption { order: 2; width: auto; text-align: left; font-size: 11px; line-height: 1.35; }
  .lede { font-size: 16.5px; }
  .fact { font-size: 15px; }
  .luke img { position: static; order: 1; width: 100%; flex: none; height: auto; min-height: 0; aspect-ratio: 3 / 4; object-position: 50% 100%; }
  .search { flex: 1 1 0; flex-basis: 0; }
  .filters-btn { display: inline-flex; }
  .layout-toggle { margin-left: 0; }
  .to-top { right: 16px; bottom: 72px; }
  /* Phones: filters open in a panel that slides up from the bottom. */
  .filter-sheet { display: none; }
  /* The toolbar is sticky (its own layer), so lift the whole toolbar above the overlay. */
  .toolbar.sheet-open { z-index: 45; }
  .toolbar.sheet-open .filter-sheet {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 41;
    max-height: 85vh;
    overflow-y: auto;
    background: var(--paper);
    border-top: 1px solid var(--border);
    box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.08);
    padding: 0 16px 16px;
  }
  .sheet-head { display: flex; align-items: center; justify-content: space-between; flex: 1 1 100%; position: sticky; top: 0; z-index: 2; background: var(--paper); padding: 14px 0 10px; border-bottom: 1px solid var(--border); }
  .sheet-title { font-size: 20px; letter-spacing: -0.01em; }
  .sheet-foot { display: flex; align-items: center; justify-content: space-between; flex: 1 1 100%; position: sticky; bottom: -16px; background: var(--paper); padding: 12px 0 16px; border-top: 1px solid var(--border); margin-bottom: -16px; }
  .filter-sheet .zip, .filter-sheet .dd { flex: 1 1 calc(50% - 7px); max-width: none; min-width: 0; }
  .filter-sheet #moreToggle, .filter-sheet #reset { display: none; }
  .filter-sheet .bar-more[hidden] { display: flex !important; }
  .filter-sheet .bar-more { border-top: 0; padding-top: 0; gap: 14px; }
  .sub-pills { padding-left: 0; border-left: 0; }
  .bar { gap: 10px 14px; }
  .key-hint { display: none; }
  .dd-menu { max-width: calc(100vw - 32px); }
  .reset { margin-left: 0; }
  .grid:not(.list) { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .grid { gap: 22px 12px; }
  .card-name { font-size: 16px; }
  .card-desc { font-size: 13px; }
  .tabs { gap: 20px; }
  /* Shelter tables become stacked rows on phones instead of scrolling sideways. */
  .table-wrap table, .table-wrap tbody, .table-wrap tr, .table-wrap td { display: block; }
  .table-wrap thead { display: none; }
  .table-wrap tr { padding: 12px 0; border-bottom: 1px solid var(--border); }
  .table-wrap td { border: 0; padding: 0; }
  .table-wrap td:first-child { margin-bottom: 6px; }
  .table-wrap td:not(:first-child) { display: inline-block; margin-right: 12px; font-size: 13px; color: var(--text-secondary); vertical-align: middle; }
  .table-wrap td.area-cell:empty, .table-wrap td.num:empty { display: none; }
  .table-wrap td.num::after { content: " animals"; font-family: var(--mono); }
}
@media (max-width: 380px) {
  .tabs { gap: 16px; }
  .tab { font-size: 13px; white-space: nowrap; gap: 6px; }
  .tab-icon { width: 16px; height: 16px; }
}
@media (max-width: 360px) {
  /* Both tabs on one line on the narrowest phones */
  .tabs { gap: 12px; }
  .tab { font-size: 12px; gap: 5px; }
  .tab-icon { width: 15px; height: 15px; }
}
/* Narrow phones: the full title doesn't fit centered between the mark and the Menu button,
   so it sits right after the mark and scales with the screen. */
@media (max-width: 430px) {
  .hd-word { left: 52px; transform: none; font-size: clamp(15px, 5.2vw, 22px); top: calc(32px - 0.6em); }
  .hd-menu { padding: 8px 11px; font-size: 12px; }
}

/* List layout: one row per animal with a small thumbnail */
.grid.list { grid-template-columns: 1fr; gap: 0; }
.grid.list .card-wrap { border-bottom: 1px solid var(--border); }
.grid.list .card { display: grid; grid-template-columns: 96px minmax(0, 1fr); column-gap: 18px; padding: 12px 0; align-items: center; }
.grid.list .card .photo { grid-row: 1 / span 5; margin: 0; width: 96px; }
.grid.list .card > :not(.photo) { grid-column: 2; }
.grid.list .marks, .grid.list .photo-count, .grid.list .no-photo .mono { display: none; }
.grid.list .ascii { font-size: 6px; }
.grid.list .wait-row { max-width: 360px; margin-bottom: 4px; }
.grid.list .card:hover { background: var(--tile); }
.grid.list .share { top: 50%; right: 0; transform: translateY(-50%); }

/* Bottom bar: the same as the rest of joyjcai.com. A solid band keeps scrolled content from
   showing through it. */
body { padding-bottom: 64px; }
body::after { content: ""; position: fixed; left: 0; right: 0; bottom: 0; height: 64px; background: var(--paper); z-index: 39; pointer-events: none; }
.ft-pages { position: fixed; left: 24px; bottom: 22px; display: flex; gap: 14px; font-size: 13px; text-transform: none; letter-spacing: 0; z-index: 40; }
.ft-pages a { color: var(--ink); position: relative; text-decoration: none; }
.ft-pages a:hover { color: var(--text-secondary); }
.pg-name { margin-left: 6px; color: var(--text-secondary); }
.pg-icon { display: none; }
.pg-icon svg { width: 13px; height: 13px; display: block; }
/* Too narrow for inline names: icons, with each name as a hover label */
@media (max-width: 1600px) {
  .pg-name { position: absolute; left: 0; bottom: calc(100% + 6px); font-size: 11.5px; white-space: nowrap; padding: 2px 6px; margin-left: -6px; background: var(--paper); opacity: 0; pointer-events: none; transition: opacity 0.15s ease; }
  .ft-pages a:hover .pg-name, .ft-pages a:focus-visible .pg-name { opacity: 1; }
  .ft-pages a { display: inline-flex; align-items: center; gap: 5px; padding: 12px 6px; margin: -12px -6px; }
  .pg-icon { display: block; color: var(--text-secondary); }
  .ft-pages a.is-current .pg-icon { color: var(--ink); }
}
@media (max-width: 960px) { .pg-key { display: none; } }
.ft-find { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 40; }
.ft-clock { position: fixed; right: 24px; bottom: 24px; font-size: 11.5px; letter-spacing: 0.04em; text-transform: none; z-index: 40; }

.find { position: fixed; inset: 0; z-index: 70; background: rgba(255,255,255,0.5); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); opacity: 0; visibility: hidden; transition: opacity 0.25s ease, visibility 0.25s; display: flex; justify-content: center; align-items: flex-start; padding-top: 18vh; }
.find.is-open { opacity: 1; visibility: visible; }
.find-panel { width: min(540px, calc(100vw - 48px)); background: var(--paper); border: 1px solid var(--border); box-shadow: 0 24px 60px rgba(0,0,0,0.09); }
.find-input { width: 100%; border: none; outline: none; font-family: var(--mono); font-size: 14px; padding: 18px 20px; border-bottom: 1px solid var(--border); background: transparent; color: var(--ink); }
.find-input::placeholder { color: var(--text-muted); }
.find-results { list-style: none; margin: 0; padding: 0; max-height: 320px; overflow-y: auto; }
.find-results li { display: flex; justify-content: space-between; align-items: baseline; padding: 12px 20px; cursor: pointer; font-size: 16px; letter-spacing: -0.01em; }
.find-results li.is-sel { background: var(--tile); }
.find-results .fr-type { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.08em; color: var(--text-muted); }
.find-results .find-empty { font-family: var(--mono); font-size: 12px; color: var(--text-muted); cursor: default; }

/* Phones: icons only, Find on the right, no clock (as on joyjcai.com) */
@media (max-width: 640px) {
  .ft-clock { display: none; }
  .ft-pages { left: 16px; }
  .ft-pages a { padding: 14px 5px; margin: -14px -5px; }
  .pg-icon svg { width: 16px; height: 16px; }
  .ft-find { left: auto; right: 16px; transform: none; }
  .ft-find .key-hint { display: none; }
  body::after { border-top: 1px solid var(--border); }
}

/* Back to top: sits above the bottom bar */
.to-top { position: fixed; right: 24px; bottom: 76px; z-index: 30; }

/* Shelter address links to directions */
td .sub a { color: inherit; text-decoration: underline; text-decoration-color: var(--border); text-underline-offset: 3px; }
td .sub a:hover { text-decoration-color: var(--accent); }

/* Accessibility helpers */
.skip-link { position: fixed; left: 16px; top: -48px; z-index: 50; background: var(--ink); color: var(--paper); padding: 10px 16px; border-radius: 999px; font-family: var(--mono); font-size: 13px; text-decoration: none; }
.skip-link:focus { top: 12px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
#grid:focus { outline: none; }
.toast {
  position: fixed;
  left: 50%;
  bottom: 80px;
  z-index: 60;
  transform: translate(-50%, 12px);
  background: var(--ink);
  color: var(--paper);
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 12.5px;
  text-transform: none;
  letter-spacing: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
}
.toast.on { opacity: 1; transform: translate(-50%, 0); }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
