/* ============================================================
   Zoo Logbook — styles
   ============================================================ */

:root {
  color-scheme: light;
  --bg: #EDF2EF;
  --surface: #FFFFFF;
  --surface-2: #F5F8F6;
  --ink: #13302A;
  --ink-2: #36504A;
  --muted: #627872;
  --line: #D5E0DB;
  --leaf: #1F6B5A;
  --leaf-hover: #185647;
  --on-leaf: #FFFFFF;
  --leaf-soft: #D9ECE5;
  --amber: #D98E1F;
  --amber-soft: #FAE8C8;
  --danger: #B03F2B;
  --danger-soft: #F7DDD7;
  --shadow: 0 1px 2px rgba(19, 48, 42, .05), 0 10px 30px -14px rgba(19, 48, 42, .22);
  --stamp-filter: none;

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

  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 20px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0E1A17;
    --surface: #15241F;
    --surface-2: #1B2D28;
    --ink: #E4EEEA;
    --ink-2: #BFD0CA;
    --muted: #8FA59E;
    --line: #263A34;
    --leaf: #5DBE9F;
    --leaf-hover: #7ACFB3;
    --on-leaf: #0B1A16;
    --leaf-soft: #1E3B33;
    --amber: #F0B04A;
    --amber-soft: #3A2E17;
    --danger: #E77B66;
    --danger-soft: #3A201B;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 12px 30px -14px rgba(0, 0, 0, .6);
    --stamp-filter: brightness(1.5) saturate(.9);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0E1A17;
  --surface: #15241F;
  --surface-2: #1B2D28;
  --ink: #E4EEEA;
  --ink-2: #BFD0CA;
  --muted: #8FA59E;
  --line: #263A34;
  --leaf: #5DBE9F;
  --leaf-hover: #7ACFB3;
  --on-leaf: #0B1A16;
  --leaf-soft: #1E3B33;
  --amber: #F0B04A;
  --amber-soft: #3A2E17;
  --danger: #E77B66;
  --danger-soft: #3A201B;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 12px 30px -14px rgba(0, 0, 0, .6);
  --stamp-filter: brightness(1.5) saturate(.9);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: var(--font-display); line-height: 1.15; margin: 0; letter-spacing: -.01em; }
h1 { font-size: 2rem; font-weight: 700; }
h2 { font-size: 1.2rem; font-weight: 700; }
h3 { font-size: 1.05rem; font-weight: 700; }
p { margin: 0; }
a { color: inherit; }
button { font: inherit; color: inherit; }
kbd {
  font: inherit; font-size: .8em; font-weight: 700;
  padding: 1px 6px; border-radius: 5px;
  border: 1px solid var(--line); background: var(--surface-2);
}
:focus-visible { outline: 2.5px solid var(--leaf); outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 50; background: var(--leaf); color: var(--on-leaf); padding: 8px 14px; border-radius: var(--r-sm); }
.skip:focus { left: 8px; }

.i {
  width: 20px; height: 20px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round;
}
.muted { color: var(--muted); }
.small { font-size: .875rem; }

/* ---------- App shell ---------- */
.app { display: grid; grid-template-columns: 252px minmax(0, 1fr); min-height: 100vh; }

.sidebar {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; gap: 6px;
  padding: 22px 16px;
  background: var(--surface);
  border-right: 1px solid var(--line);
}
.brand {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-display); font-weight: 800; font-size: 1.25rem;
  text-decoration: none; letter-spacing: -.02em;
  padding: 4px 8px 18px;
}
.brand-mark { width: 40px; height: 40px; flex: none; color: var(--leaf); }
.side-nav { display: flex; flex-direction: column; gap: 2px; margin-top: 14px; }
.side-nav.bottom { margin-top: auto; }
.side-nav a {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: var(--r-sm);
  color: var(--ink-2); text-decoration: none; font-weight: 600;
}
.side-nav a:hover { background: var(--surface-2); color: var(--ink); }
.side-nav a.active { background: var(--leaf-soft); color: var(--leaf); }
.side-tip { font-size: .8rem; color: var(--muted); padding: 12px 12px 0; }

main {
  width: 100%; max-width: 1040px;
  padding: 44px 48px 96px;
  outline: none;
}
/* Big screens: use the extra width and keep the page centred in the space beside the menu. */
@media (min-width: 1360px) {
  main { max-width: 1240px; margin-inline: auto; padding-inline: 56px; }
}
@media (min-width: 1360px) {
  .animal-list { display: grid; grid-template-columns: 1fr 1fr; column-gap: 40px; }
  .wish-list { grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; }
  .settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; align-items: start; }
}
@media (min-width: 1700px) {
  main { max-width: 1400px; }
  .cols { gap: 0 56px; }
}

.mobile-top, .bottombar { display: none; }

@media (max-width: 860px) {
  .app { grid-template-columns: minmax(0, 1fr); align-content: start; }
  .sidebar { display: none; }
  .mobile-top {
    display: flex; align-items: center; justify-content: space-between;
    position: sticky; top: 0; z-index: 20;
    padding: 10px 16px;
    background: color-mix(in srgb, var(--bg) 88%, transparent);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
  }
  .mobile-top .brand { padding: 0; font-size: 1.1rem; }
  .mobile-top .brand-mark { width: 34px; height: 34px; }
  .mobile-top .brand { gap: 8px; }
  main { padding: 24px 16px 120px; }
  h1 { font-size: 1.7rem; }

  .bottombar {
    display: grid; grid-template-columns: repeat(6, 1fr); align-items: end;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    padding: 6px 4px calc(8px + env(safe-area-inset-bottom));
    background: var(--surface);
    border-top: 1px solid var(--line);
  }
  .bottombar a {
    display: flex; flex-direction: column; align-items: center; gap: 2px;
    padding: 6px 0; font-size: .7rem; font-weight: 600;
    color: var(--muted); text-decoration: none;
  }
  .bottombar a.active { color: var(--leaf); }
  .bottombar .fab {
    order: 3; justify-self: center;
    width: 54px; height: 54px; margin-top: -26px;
    border-radius: 50%; border: 4px solid var(--bg);
    background: var(--leaf); color: var(--on-leaf);
    display: grid; place-items: center; cursor: pointer;
    box-shadow: var(--shadow);
  }
  .bottombar .fab .i { width: 26px; height: 26px; stroke-width: 2.4; }
  .bottombar a:nth-child(1) { order: 1; }
  .bottombar a:nth-child(2) { order: 2; }
  .bottombar a:nth-child(4) { order: 4; }
  .bottombar a:nth-child(5) { order: 5; }
  .bottombar a:nth-child(6) { order: 6; }
}

/* ---------- Buttons & inputs ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 42px; padding: 0 18px;
  border-radius: 999px; border: 1.5px solid transparent;
  font-weight: 700; font-size: .95rem; cursor: pointer;
  text-decoration: none; white-space: nowrap;
  transition: background-color .15s, border-color .15s, color .15s;
}
.btn .i { width: 18px; height: 18px; stroke-width: 2.2; }
.btn.primary { background: var(--leaf); color: var(--on-leaf); }
.btn.primary:hover { background: var(--leaf-hover); }
.btn.ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.btn.ghost:hover { border-color: var(--leaf); color: var(--leaf); }
.btn.danger { background: transparent; border-color: var(--danger); color: var(--danger); }
.btn.danger:hover { background: var(--danger-soft); }
.btn.full { width: 100%; }
.btn:disabled { opacity: .55; cursor: progress; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; }

.icon-btn {
  display: inline-grid; place-items: center;
  width: 38px; height: 38px; border-radius: 50%;
  border: none; background: transparent; color: var(--muted);
  cursor: pointer; text-decoration: none;
}
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }
.icon-btn.danger-hover:hover { background: var(--danger-soft); color: var(--danger); }

.link {
  background: none; border: none; padding: 0; cursor: pointer;
  color: var(--leaf); font-weight: 600; font-size: .9rem; text-decoration: none;
}
.link:hover { text-decoration: underline; }

.input, .select {
  width: 100%; min-height: 44px;
  padding: 10px 14px;
  font: inherit; color: var(--ink);
  background: var(--surface);
  border: 1.5px solid var(--line); border-radius: var(--r-md);
}
textarea.input { resize: vertical; min-height: 84px; }
.input:focus, .select:focus { outline: none; border-color: var(--leaf); box-shadow: 0 0 0 3px var(--leaf-soft); }
.select { width: auto; cursor: pointer; padding-right: 36px; appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 19px) 50%, calc(100% - 14px) 50%;
  background-size: 5px 5px; background-repeat: no-repeat;
}

.search {
  position: relative; flex: 1; min-width: 200px;
  display: flex; align-items: center;
}
.search .i { position: absolute; left: 14px; color: var(--muted); pointer-events: none; }
.search input {
  width: 100%; min-height: 44px; padding: 10px 14px 10px 42px;
  font: inherit; color: var(--ink);
  background: var(--surface); border: 1.5px solid var(--line); border-radius: 999px;
}
.search input:focus { outline: none; border-color: var(--leaf); box-shadow: 0 0 0 3px var(--leaf-soft); }

/* ---------- Page structure ---------- */
.page-head {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  margin-bottom: 24px;
}
.page-head .lede { margin-top: 4px; }
.lede { color: var(--ink-2); font-size: 1.1rem; max-width: 60ch; }
.lede.small { font-size: .95rem; color: var(--muted); }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 20px; }
@media (max-width: 560px) {
  /* Filters sit two to a row on phones, under a full-width search box. */
  .toolbar:has(> select + select) { display: grid; grid-template-columns: 1fr 1fr; }
  .toolbar:has(> select + select) > :first-child { grid-column: 1 / -1; }
  .toolbar:has(> select + select) > select { width: 100%; min-width: 0; }
}

.block { margin-top: 40px; }
.block-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  margin-bottom: 14px;
}
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 0 40px; }
@media (max-width: 760px) { .cols { grid-template-columns: 1fr; } }

.back {
  display: inline-flex; align-items: center; gap: 4px;
  color: var(--muted); font-weight: 600; text-decoration: none; margin-bottom: 18px;
}
.back:hover { color: var(--leaf); }

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 24px;
  margin-bottom: 16px;
}
.panel h2 { margin-bottom: 6px; }
.panel > p { margin-bottom: 16px; max-width: 62ch; }
.danger-zone { border-color: color-mix(in srgb, var(--danger) 35%, var(--line)); }

/* ---------- Hero / welcome ---------- */
.hero { padding: 6px 0 4px; }
.greet { color: var(--muted); font-weight: 600; }
.display {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(2rem, 1.1rem + 3.4vw, 3.4rem);
  line-height: 1.04; letter-spacing: -.03em;
  max-width: 17ch; text-wrap: balance;
  margin: 6px 0 14px;
}
.hero .lede { margin-bottom: 22px; }

.welcome { max-width: 620px; padding: 32px 0; }
.welcome-stamps { display: flex; gap: 6px; margin-bottom: 28px; }
.welcome-stamps .stamp:nth-child(2) { margin-top: 18px; }
.welcome .lede { margin-bottom: 26px; }

/* ---------- Stamps ---------- */
.stamp {
  --size: 92px;
  position: relative; flex: none; display: block;
  width: var(--size); height: var(--size);
  color: var(--stamp);
  transform: rotate(var(--rot));
  filter: var(--stamp-filter);
  transition: transform .2s ease;
}
.stamp-art { display: block; width: 100%; height: 100%; overflow: visible; }
/* Lettering on stamps, pins and the logo */
.stz-type { font-family: var(--font-display); font-weight: 800; }
.stamp.big { --size: 148px; }
.ghost-stamp { --stamp: var(--muted); filter: none; opacity: .75; }

.stamp-item {
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 2px;
  text-decoration: none; padding: 6px;
  border-radius: var(--r-md);
}
.stamp-item .stamp { margin-bottom: 10px; }
.stamp-item:hover .stamp { transform: rotate(0deg) scale(1.04); }
.stamp-name { font-weight: 700; line-height: 1.25; }
.stamp-meta { font-size: .85rem; color: var(--muted); }

.stamp-row {
  display: flex; gap: 12px; overflow-x: auto;
  padding: 4px 2px 10px; margin: 0 -2px;
  scrollbar-width: thin;
}
.stamp-row .stamp-item { width: 132px; flex: none; }
.stamp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 20px 12px; }

/* ---------- Lists ---------- */
.plain-list { list-style: none; margin: 0; padding: 0; }
.plain-list li { border-top: 1px solid var(--line); }
.plain-list li:last-child { border-bottom: 1px solid var(--line); }
.row-link {
  display: grid; grid-template-columns: 1fr auto; gap: 0 12px;
  padding: 12px 4px; text-decoration: none;
}
.row-link:hover .row-main { color: var(--leaf); }
.row-main { font-weight: 700; }
.row-sub { grid-column: 1; color: var(--muted); font-size: .875rem; }
.row-end { grid-column: 2; grid-row: 1 / span 2; align-self: center; color: var(--muted); font-size: .875rem; }
.bar-row { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; padding: 12px 4px; }
.bar-row .row-end { grid-row: 1; }
.bar { grid-column: 1 / -1; height: 6px; border-radius: 99px; background: var(--leaf-soft); overflow: hidden; }
.bar span { display: block; height: 100%; border-radius: inherit; background: var(--leaf); }

.progress { height: 8px; border-radius: 99px; background: var(--leaf-soft); overflow: hidden; margin-bottom: 18px; }
.progress span { display: block; height: 100%; background: var(--leaf); border-radius: inherit; }

/* ---------- Chips ---------- */
.chips { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; }
.chips.roomy { gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 12px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--line);
  font-size: .875rem; font-weight: 500; color: var(--ink-2);
  line-height: 1.5;
}
.chip-n { color: var(--muted); font-size: .8rem; font-weight: 700; }
button.chip { cursor: pointer; }
.chip.action:hover, .chip.more:hover { border-color: var(--leaf); color: var(--leaf); }
.chip.action .i { width: 14px; height: 14px; stroke-width: 2.4; }
.chip.more { background: transparent; font-weight: 700; color: var(--leaf); }
.chip[aria-pressed="true"] { background: var(--leaf); border-color: var(--leaf); color: var(--on-leaf); }

/* ---------- Visits timeline ---------- */
.year-h {
  font-size: 1.6rem; font-weight: 800; letter-spacing: -.02em;
  margin: 32px 0 6px; color: var(--ink-2);
}
.year:first-child .year-h { margin-top: 0; }
.timeline { list-style: none; margin: 0; padding: 0; }
.v-item {
  display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; gap: 16px;
  padding: 18px 0; border-top: 1px solid var(--line);
}
.v-date { display: flex; flex-direction: column; align-items: center; padding-top: 2px; }
.v-day { font-family: var(--font-display); font-weight: 800; font-size: 1.6rem; line-height: 1; }
.v-mon { font-size: .8rem; font-weight: 700; color: var(--muted); margin-top: 3px; }
.v-top { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 12px; margin-bottom: 10px; }
.v-zoo { font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; text-decoration: none; }
.v-zoo:hover { color: var(--leaf); }
.v-notes { margin-top: 10px; color: var(--ink-2); white-space: pre-wrap; max-width: 65ch; }
.v-actions { display: flex; gap: 2px; align-items: flex-start; }
@media (max-width: 560px) {
  .v-item { grid-template-columns: 42px minmax(0, 1fr); gap: 12px; }
  .v-actions { grid-column: 2; margin-top: -6px; margin-left: -10px; }
}

.stars { display: inline-flex; gap: 1px; color: var(--amber); }
.stars .i { width: 16px; height: 16px; fill: currentColor; stroke: none; }
.stars .off { color: var(--line); }

/* ---------- Animals ---------- */
.animal-list { list-style: none; margin: 0; padding: 0; }
.a-row {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 16px;
  padding: 14px 4px; border-top: 1px solid var(--line);
}
.a-name { font-weight: 700; font-size: 1.05rem; }
.a-meta { grid-column: 1; color: var(--muted); font-size: .9rem; }
.a-meta a { color: var(--ink-2); text-decoration: none; }
.a-meta a:hover { color: var(--leaf); text-decoration: underline; }
.a-link { color: inherit; text-decoration: none; }
.a-link:hover { color: var(--leaf); }
.a-row.unseen .a-name { color: var(--ink-2); }
.a-count.not-seen { background: transparent; border: 1.5px dashed var(--line); color: var(--muted); font-weight: 700; font-size: .78rem; white-space: nowrap; }
.unseen-block { margin-top: 28px; }
.a-count {
  grid-column: 2; grid-row: 1 / span 2; align-self: center;
  min-width: 44px; text-align: center;
  padding: 4px 10px; border-radius: 999px;
  background: var(--leaf-soft); color: var(--leaf); font-weight: 800; font-size: .9rem;
}

/* ---------- Zoo page ---------- */
.zoo-hero { display: flex; gap: 28px; align-items: center; flex-wrap: wrap; }
.zoo-hero h1 { font-size: clamp(1.9rem, 1.2rem + 2.4vw, 2.8rem); letter-spacing: -.025em; margin-bottom: 6px; }
.zoo-hero .lede { margin-bottom: 10px; }
.zoo-hero .stars { margin-bottom: 16px; }

/* ---------- News ---------- */
.news-list { display: grid; gap: 12px; }
.news-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 18px 20px;
}
.news-card:hover { border-color: color-mix(in srgb, var(--leaf) 50%, var(--line)); }
.news-meta { display: flex; gap: 12px; flex-wrap: wrap; font-size: .82rem; margin-bottom: 6px; }
.news-src { color: var(--leaf); font-weight: 700; }
.news-meta time { color: var(--muted); }
.news-card h3 { font-family: var(--font-body); font-size: 1.05rem; line-height: 1.35; }
.news-card h3 a { text-decoration: none; }
.news-card h3 a:hover { color: var(--leaf); text-decoration: underline; }
.news-card p { margin-top: 6px; color: var(--muted); font-size: .92rem; max-width: 70ch; }
#nsources { margin-bottom: 18px; }

.skeleton { height: 92px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); position: relative; overflow: hidden; }
.skeleton::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--leaf-soft) 70%, transparent), transparent);
  transform: translateX(-100%);
  animation: shimmer 1.3s infinite;
}
@keyframes shimmer { to { transform: translateX(100%); } }

.link-grid { list-style: none; margin: 0 0 14px; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; }
.link-grid a {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 12px 14px; border-radius: var(--r-md);
  background: var(--surface); border: 1px solid var(--line);
  font-weight: 600; text-decoration: none;
}
.link-grid a:hover { border-color: var(--leaf); color: var(--leaf); }
.link-grid .i { width: 16px; height: 16px; color: var(--muted); }

/* ---------- Settings ---------- */
.segmented { display: inline-flex; padding: 4px; gap: 4px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); flex-wrap: wrap; }
.segmented button {
  border: none; background: transparent; cursor: pointer;
  padding: 8px 16px; border-radius: 999px; font-weight: 600; color: var(--ink-2);
}
.segmented button[aria-checked="true"] { background: var(--surface); color: var(--leaf); box-shadow: var(--shadow); }
.feed-list { list-style: none; margin: 0 0 14px; padding: 0; }
.feed-list li {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 0; border-top: 1px solid var(--line);
}
.feed-list li:last-child { border-bottom: 1px solid var(--line); }
.feed-name { font-weight: 600; overflow-wrap: anywhere; }
.feed-url { display: block; color: var(--muted); font-size: .8rem; overflow-wrap: anywhere; }
.feed-form { display: flex; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.feed-form .input { flex: 1; min-width: 220px; }

/* ---------- Empty states ---------- */
.empty {
  text-align: center; padding: 48px 20px;
  border: 1.5px dashed var(--line); border-radius: var(--r-lg);
}
.empty h2 { margin-bottom: 6px; }
.empty p { color: var(--muted); max-width: 44ch; margin: 0 auto 18px; }

/* ---------- Dialogs ---------- */
.sheet {
  width: min(580px, calc(100% - 32px));
  max-height: calc(100vh - 48px);
  padding: 0; border: none;
  border-radius: var(--r-lg);
  background: var(--surface); color: var(--ink);
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .45);
}
.sheet.small { width: min(420px, calc(100% - 32px)); }
.sheet::backdrop { background: rgba(8, 22, 18, .5); backdrop-filter: blur(3px); }
.sheet[open] { animation: sheet-in .22s ease-out; }
@keyframes sheet-in { from { opacity: 0; transform: translateY(16px) scale(.98); } }
.sheet form { display: flex; flex-direction: column; max-height: inherit; }
.sheet-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 16px 6px 24px;
}
.sheet-head h2 { font-size: 1.45rem; }
.sheet-body { padding: 12px 24px 8px; overflow-y: auto; }
.sheet.small .sheet-body { padding-top: 24px; }
.sheet.small h2 { margin-bottom: 8px; }
.sheet-foot {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 16px 24px 20px;
  border-top: 1px solid var(--line);
}
@media (max-width: 560px) {
  .sheet:not(.small) {
    width: 100%; max-width: 100%; max-height: 92vh;
    margin: auto 0 0; border-radius: var(--r-lg) var(--r-lg) 0 0;
  }
  .sheet:not(.small)[open] { animation-name: sheet-up; }
  @keyframes sheet-up { from { transform: translateY(40px); opacity: .4; } }
  .sheet-foot { padding-bottom: calc(20px + env(safe-area-inset-bottom)); }
  .sheet-foot .btn { flex: 1; }
}

.field { margin-bottom: 18px; }
.field label, .field .label { display: block; font-weight: 700; margin-bottom: 6px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 420px) { .field-row { grid-template-columns: 1fr; } }
.opt { font-weight: 500; color: var(--muted); font-size: .85rem; margin-left: 4px; }
.hint { font-size: .82rem; color: var(--muted); margin-top: 6px; }
.err { color: var(--danger); font-size: .85rem; font-weight: 600; margin-top: 6px; }
.err:empty { display: none; }
.input.invalid { border-color: var(--danger); }

.rating { display: flex; gap: 2px; min-height: 44px; align-items: center; }
.rating button {
  border: none; background: none; cursor: pointer; padding: 4px;
  color: color-mix(in srgb, var(--muted) 40%, transparent); border-radius: 6px;
}
.rating button .i { width: 30px; height: 30px; fill: currentColor; stroke: none; }
.rating button.on { color: var(--amber); }
.rating button:hover { transform: scale(1.1); }

.chip-input {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  min-height: 44px; padding: 6px 8px;
  border: 1.5px solid var(--line); border-radius: var(--r-md);
  background: var(--surface); cursor: text;
}
.chip-input:focus-within { border-color: var(--leaf); box-shadow: 0 0 0 3px var(--leaf-soft); }
.chip-input input {
  flex: 1; min-width: 160px; border: none; outline: none; background: transparent;
  font: inherit; color: var(--ink); padding: 4px 6px;
}
.chip-input .chip { background: var(--leaf-soft); border-color: transparent; color: var(--ink); padding-right: 4px; }
.chip-x {
  display: grid; place-items: center; width: 22px; height: 22px;
  border: none; background: transparent; border-radius: 50%; cursor: pointer; color: var(--muted);
}
.chip-x:hover { background: color-mix(in srgb, var(--danger) 15%, transparent); color: var(--danger); }
.chip-x .i { width: 14px; height: 14px; stroke-width: 2.4; }

.suggest {
  margin-top: 12px; padding: 14px;
  border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--line);
}
.suggest-head { display: flex; justify-content: space-between; gap: 10px; font-size: .88rem; font-weight: 700; margin-bottom: 10px; color: var(--ink-2); }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 28px; z-index: 100;
  display: flex; align-items: center; gap: 16px;
  max-width: calc(100% - 32px);
  padding: 12px 14px 12px 20px; border-radius: 999px;
  background: var(--ink); color: var(--bg);
  font-weight: 600; box-shadow: var(--shadow);
  transform: translate(-50%, 140%); opacity: 0;
  transition: transform .25s ease, opacity .25s ease;
}
.toast.show { transform: translate(-50%, 0); opacity: 1; }
.toast-action {
  border: none; cursor: pointer; font-weight: 800;
  padding: 6px 12px; border-radius: 999px;
  background: color-mix(in srgb, var(--bg) 18%, transparent); color: var(--bg);
}
@media (max-width: 860px) { .toast { bottom: calc(96px + env(safe-area-inset-bottom)); } }

/* ---------- Motion preferences ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ============================================================
   Accounts, profiles and people
   ============================================================ */
.local-mode .needs-server { display: none !important; }

/* Signed out: no navigation, centred sign-in */
.signed-out .app { grid-template-columns: minmax(0, 1fr); }
.signed-out .sidebar, .signed-out .bottombar, .signed-out .mobile-actions { display: none !important; }
.signed-out main { margin: 0 auto; }

.loading { display: flex; align-items: center; gap: 12px; color: var(--muted); font-weight: 600; padding: 48px 0; }
.spinner {
  width: 22px; height: 22px; border-radius: 50%;
  border: 3px solid var(--leaf-soft); border-top-color: var(--leaf);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.auth {
  display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 48px; align-items: center;
  min-height: calc(100vh - 140px);
}
.auth .lede { max-width: 42ch; }
.auth-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 28px; box-shadow: var(--shadow);
}
.auth-card h2 { font-size: 1.4rem; margin-bottom: 6px; }
.auth-card > div > p, .auth-card form > p.muted { margin-bottom: 18px; }
.auth-note { display: flex; align-items: center; gap: 6px; margin-top: 14px; }
.auth-note .i { width: 16px; height: 16px; }
.auth-foot { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 16px 0 12px; }
.code-input { font-size: 1.6rem; font-weight: 800; letter-spacing: .35em; text-align: center; font-variant-numeric: tabular-nums; }
.dev-note {
  margin-bottom: 18px; padding: 12px 14px; border-radius: var(--r-md);
  background: var(--amber-soft); color: var(--ink); font-size: .9rem;
}
.dev-note a { color: var(--leaf); font-weight: 700; }
@media (max-width: 860px) {
  .auth { grid-template-columns: minmax(0, 1fr); gap: 28px; min-height: 0; padding-top: 8px; }
  .auth .welcome-stamps { margin-bottom: 18px; }
}

.banner {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 16px 18px; margin-bottom: 28px;
  border-radius: var(--r-lg); background: var(--leaf-soft);
}
.banner.subtle { background: var(--surface-2); border: 1px solid var(--line); }
.banner p { margin-top: 2px; }

/* Avatars */
.avatar {
  --stamp: var(--leaf);
  display: inline-grid; place-items: center; flex: none;
  width: 40px; height: 40px; border-radius: 50%; object-fit: cover;
  background: color-mix(in srgb, var(--stamp) 16%, var(--surface));
  color: var(--stamp); filter: var(--stamp-filter);
  font-family: var(--font-display); font-weight: 800; font-size: .95rem;
}
img.avatar { filter: none; background: var(--surface-2); }
.avatar.sm { width: 34px; height: 34px; font-size: .8rem; }
.avatar.md { width: 52px; height: 52px; font-size: 1.1rem; }
.avatar.xl { width: 112px; height: 112px; font-size: 2.3rem; }

.user-chip {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; margin-bottom: 4px; border-radius: var(--r-sm);
  text-decoration: none;
}
.user-chip:hover, .user-chip.active { background: var(--surface-2); }
.user-text { display: flex; flex-direction: column; min-width: 0; }
.user-name { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-handle { font-size: .8rem; color: var(--muted); }
.side-note { display: flex; align-items: center; gap: 6px; font-size: .8rem; color: var(--muted); padding: 8px 12px; }
.side-note .i { width: 15px; height: 15px; }

.mobile-actions { display: flex; align-items: center; gap: 2px; }
.mobile-avatar { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; }
.mobile-avatar.active .avatar { outline: 2px solid var(--leaf); outline-offset: 2px; }

/* People */
.people-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.person {
  position: relative; display: flex; align-items: center; gap: 14px;
  padding: 16px; border-radius: var(--r-lg);
  background: var(--surface); border: 1px solid var(--line); text-decoration: none;
}
.person:hover { border-color: var(--leaf); }
.person-text { display: flex; flex-direction: column; min-width: 0; }
.person-name { font-weight: 700; font-size: 1.05rem; }
.person-stats { font-size: .85rem; color: var(--leaf); font-weight: 600; margin-top: 2px; }
.you-tag { position: absolute; top: 12px; right: 12px; font-size: .75rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--leaf-soft); color: var(--leaf); }

.person-hero { display: flex; gap: 24px; align-items: center; flex-wrap: wrap; }
.person-hero h1 { font-size: clamp(1.9rem, 1.2rem + 2.4vw, 2.6rem); letter-spacing: -.025em; margin-bottom: 4px; }
.person-hero .muted { margin-bottom: 10px; }
.person-bio { margin-bottom: 10px; max-width: 60ch; white-space: pre-wrap; }
.stamp-item.static { cursor: default; }
.stamp-item.static:hover .stamp { transform: rotate(var(--rot)); }
.v-item.readonly { grid-template-columns: 52px minmax(0, 1fr); }
@media (max-width: 560px) { .v-item.readonly { grid-template-columns: 42px minmax(0, 1fr); } }

/* Profile form */
.photo-panel { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.photo-panel h2 { margin-bottom: 4px; }
.photo-panel p { margin-bottom: 14px; }
.prefix-input { position: relative; }
.prefix-input span { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); font-weight: 700; }
.prefix-input .input { padding-left: 32px; }
.switch-row { display: flex; gap: 14px; align-items: flex-start; cursor: pointer; padding: 14px 0; margin-bottom: 4px; border-top: 1px solid var(--line); }
.switch-row input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch {
  position: relative; flex: none; width: 46px; height: 28px; margin-top: 2px;
  border-radius: 999px; background: var(--line); transition: background-color .15s;
}
.switch::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px;
  border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .15s;
}
.switch-row input:checked + .switch { background: var(--leaf); }
.switch-row input:checked + .switch::after { transform: translateX(18px); }
.switch-row input:focus-visible + .switch { outline: 2.5px solid var(--leaf); outline-offset: 2px; }
.muted.block { display: block; margin-top: 2px; font-weight: 400; }
.share-row {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px 12px; margin-bottom: 12px; border-radius: var(--r-md); background: var(--surface-2);
}
.share-row .i { color: var(--muted); }
.share-url { flex: 1; min-width: 0; font-size: .9rem; overflow-wrap: anywhere; }
.form-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-top: 16px; border-top: 1px solid var(--line); }

/* Password sign-in */
.auth.single { grid-template-columns: minmax(0, 440px); justify-content: center; }
.auth-tabs { display: flex; width: 100%; margin-bottom: 22px; }
.auth-tabs button { flex: 1; }
.password-input { position: relative; }
.password-input .input { padding-right: 76px; }
.reveal {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  border: none; background: transparent; cursor: pointer;
  padding: 6px 10px; border-radius: 999px;
  font-weight: 700; font-size: .85rem; color: var(--leaf);
}
.reveal:hover { background: var(--leaf-soft); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
#authForm .err, .pw-form .err { margin: -6px 0 12px; }
.pw-form { max-width: 440px; }
.auth-tabs button { white-space: nowrap; padding: 8px 10px; }

/* ============================================================
   Admin
   ============================================================ */
.needs-admin { display: none !important; }
.is-admin .side-nav a.needs-admin { display: flex !important; }
.is-admin .mobile-actions .needs-admin { display: inline-grid !important; }

.admin-tabs {
  display: flex; gap: 4px; flex-wrap: wrap;
  margin-bottom: 24px; padding-bottom: 12px; border-bottom: 1px solid var(--line);
}
.admin-tabs a {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: 999px;
  font-weight: 600; color: var(--ink-2); text-decoration: none;
}
.admin-tabs a:hover { background: var(--surface-2); color: var(--ink); }
.admin-tabs a.active { background: var(--ink); color: var(--bg); }
.count { min-width: 20px; padding: 0 6px; border-radius: 999px; background: var(--danger); color: #fff; font-size: .75rem; font-weight: 800; text-align: center; }

.admin-stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 0;
  margin: 0 0 8px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); overflow: hidden;
}
.admin-stats div { padding: 14px 18px; border-right: 1px solid var(--line); }
.admin-stats div:last-child { border-right: none; }
.admin-stats dt { font-size: .85rem; color: var(--muted); }
.admin-stats dd { margin: 2px 0 0; font-family: var(--font-display); font-weight: 800; font-size: 1.6rem; }

.badge {
  display: inline-block; vertical-align: middle; margin-left: 4px;
  padding: 1px 8px; border-radius: 999px;
  font-size: .72rem; font-weight: 700; line-height: 1.6;
  background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line);
}
.badge.leaf { background: var(--leaf-soft); color: var(--leaf); border-color: transparent; }
.badge.amber { background: var(--amber-soft); color: var(--ink); border-color: transparent; }
.badge.danger { background: var(--danger-soft); color: var(--danger); border-color: transparent; }

.admin-list { list-style: none; margin: 0; padding: 0; }
.admin-list li { border-top: 1px solid var(--line); }
.admin-row { display: flex; align-items: center; gap: 12px; padding: 12px 4px; text-decoration: none; }
.admin-row:hover .admin-row-title { color: var(--leaf); }
.admin-row-main { display: flex; flex-direction: column; min-width: 0; }
.admin-row-title { font-weight: 700; }

.log-list { list-style: none; margin: 0; padding: 0; }
.log-list li { display: flex; flex-direction: column; padding: 10px 0; border-top: 1px solid var(--line); }
.log-what { overflow-wrap: anywhere; }

.report-list { display: grid; gap: 12px; }
.report-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px; }
.report-who { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.report-card > p { margin-bottom: 10px; }
.report-details { margin: 0 0 14px; padding: 10px 14px; border-left: 3px solid var(--amber); background: var(--surface-2); border-radius: 0 var(--r-sm) var(--r-sm) 0; white-space: pre-wrap; }
.btn.small-btn { min-height: 34px; padding: 0 14px; font-size: .85rem; }

.admin-user-name { font-size: clamp(1.6rem, 1.1rem + 1.8vw, 2.2rem); margin-bottom: 6px; }
.person-hero .btn-row { margin-top: 12px; }
.admin-visits { list-style: none; margin: 0; padding: 0; }
.admin-visit { display: flex; gap: 12px; justify-content: space-between; padding: 14px 0; border-top: 1px solid var(--line); }
.admin-visit-main { display: flex; flex-direction: column; gap: 8px; min-width: 0; }

.name-list { list-style: none; margin: 0; padding: 0; }
.name-list li { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 10px 0; border-top: 1px solid var(--line); }
.check { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: .9rem; color: var(--ink-2); cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--leaf); }
details summary { cursor: pointer; }

.report-link { display: inline-flex; align-items: center; gap: 6px; margin-top: 4px; color: var(--muted); font-size: .85rem; }
.report-link .i { width: 16px; height: 16px; }
.report-link:hover { color: var(--danger); }
.radio-list { border: none; padding: 0; margin: 0 0 16px; display: grid; gap: 4px; }
.radio-list label { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--r-md); border: 1px solid var(--line); cursor: pointer; font-weight: 600; }
.radio-list label:has(input:checked) { border-color: var(--leaf); background: var(--leaf-soft); }
.radio-list input { accent-color: var(--leaf); width: 18px; height: 18px; }
.switch-row.disabled { opacity: .55; cursor: not-allowed; }
.admin-strip { margin-bottom: 24px; }
.mobile-avatar { text-decoration: none; }
.admin-stats { gap: 1px; background: var(--line); }
.admin-stats div { background: var(--surface); border-right: none; }
/* Bottom bar adapts to however many tabs are showing */
@media (max-width: 860px) {
  .bottombar { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 1fr; }
}

/* Social links */
.social-fields { border: none; margin: 4px 0 8px; padding: 16px 0 0; border-top: 1px solid var(--line); }
.social-fields legend { padding: 0; margin-bottom: 4px; }
.social-fields .hint { margin: 0 0 14px; }
.field-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 16px; }
.social-links { list-style: none; margin: 4px 0 12px; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.social-links a {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px 5px 10px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line);
  text-decoration: none; font-size: .85rem;
}
.social-links a:hover { border-color: var(--leaf); }
.social-links .i { width: 15px; height: 15px; color: var(--leaf); }
.social-label { font-weight: 700; }
.social-handle { color: var(--muted); max-width: 22ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Animal photos */
.chip.has-img { padding-left: 3px; }
.chip-img { width: 22px; height: 22px; border-radius: 50%; object-fit: cover; flex: none; background: var(--surface-2); }
.chip-input .chip.has-img { padding-left: 3px; }
.row-img { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; vertical-align: middle; margin-right: 10px; background: var(--surface-2); }
.a-name { display: flex; align-items: center; }
.bar-row .row-main { display: flex; align-items: center; }

.photo-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.photo-card {
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px;
  padding: 16px 12px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line);
}
.photo-thumb { width: 88px; height: 88px; border-radius: 50%; object-fit: cover; margin-bottom: 6px; background: var(--surface-2); }
.empty-thumb { display: grid; place-items: center; color: var(--muted); border: 1.5px dashed var(--line); background: transparent; }
.empty-thumb .i { width: 30px; height: 30px; }
.photo-name { font-weight: 700; line-height: 1.25; }
.photo-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; margin-top: 8px; }
.photo-actions .btn { margin: 0; }

/* ============================================================
   Map, regions, conservation, badges, yearly summary, wishlist, pages
   ============================================================ */
.zoo-map { height: min(560px, 70vh); border-radius: var(--r-lg); border: 1px solid var(--line); overflow: hidden; background: var(--surface-2); position: relative; z-index: 0; }
.zoo-map.small-map { height: min(420px, 60vh); }
@media (max-width: 560px) { .zoo-map { height: min(440px, 62vh); } .zoo-map.small-map { height: 320px; } }
.map-msg { display: grid; place-items: center; height: 100%; margin: 0; color: var(--muted); }
.map-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin: 10px 0 6px; }
.legend { display: inline-flex; align-items: center; gap: 8px; font-size: .85rem; color: var(--muted); }
.legend .dot { width: 12px; height: 12px; border-radius: 50%; border: 1.5px solid var(--muted); background: #fff; margin-left: 6px; }
.legend .dot.filled { background: var(--leaf); border-color: #fff; box-shadow: 0 0 0 1px var(--leaf); margin-left: 0; }
.maplibregl-popup-content { font-family: var(--font-body); font-size: .9rem; line-height: 1.45; color: #13302A; border-radius: 10px; padding: 10px 14px; box-shadow: 0 4px 18px rgba(0,0,0,.18); }
.maplibregl-popup-content a { color: #1F6B5A; font-weight: 700; }
.maplibregl-popup-close-button { font-size: 18px; padding: 0 6px; color: #627872; }
.map-pop-muted { color: #627872; }
.zoo-map .maplibregl-ctrl-attrib { font-size: 11px; }
.place-line { display: flex; align-items: center; gap: 4px; color: var(--ink-2); margin-bottom: 6px; }
.place-line .i { width: 16px; height: 16px; color: var(--leaf); }

.region { padding: 16px 0; border-top: 1px solid var(--line); }
.region-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 8px; }
.region-head h3 { font-size: 1.05rem; }
.progress.small { height: 6px; margin-bottom: 12px; }

/* IUCN Red List badges */
.iucn {
  display: inline-block; vertical-align: middle; margin-left: 6px;
  padding: 1px 8px; border-radius: 4px;
  font-size: .7rem; font-weight: 800; letter-spacing: .01em; line-height: 1.6; white-space: nowrap;
  color: #fff;
}
.iucn.small { padding: 0 5px; font-size: .65rem; }
.iucn-EX, .iucn-EW { background: #3d2b3f; }
.iucn-CR { background: #b3261e; }
.iucn-EN { background: #c9561a; }
.iucn-VU { background: #b98a00; }
.iucn-NT { background: #6d8a2c; color: #fff; }
.iucn-LC { background: #2f7a55; }
.iucn-DD { background: #7a7a7a; }
.status-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 0 20px; }
.status-list li { display: flex; align-items: center; gap: 6px; padding: 8px 0; border-top: 1px solid var(--line); }
.status-list li span:first-of-type { flex: 1; font-weight: 600; }
.link-inline { color: var(--leaf); font-weight: 700; }

/* Badges */
.badge-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.badge-item {
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 2px;
  padding: 16px 12px; border-radius: var(--r-lg); background: var(--surface); border: 1px dashed var(--line);
}
.badge-item.earned { border-style: solid; }
.medal {
  display: grid; place-items: center; width: 60px; height: 60px; margin-bottom: 8px;
  border-radius: 50%; font-size: 1.7rem;
  background: var(--surface-2); border: 3px solid var(--line); filter: grayscale(1); opacity: .55;
}
.badge-item.earned .medal { filter: none; opacity: 1; background: var(--amber-soft); border-color: var(--amber); }
.badge-title { font-weight: 700; line-height: 1.25; }
.badge-desc { font-size: .8rem; color: var(--muted); }
.badge-item .progress { width: 100%; margin: 8px 0 0; }
.badge-count { font-size: .75rem; color: var(--muted); font-weight: 700; }

/* Yearly summary */
.year-picker { margin-bottom: 20px; }
.chip.current { background: var(--ink); color: var(--bg); border-color: var(--ink); }
a.chip { text-decoration: none; }
.recap { padding: 8px 0 8px; }
.recap-kicker { font-weight: 700; color: var(--leaf); }
.recap-title { max-width: 20ch; }
.recap-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 1px; margin: 18px 0 0; background: var(--line); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.recap-facts div { background: var(--surface); padding: 14px 18px; }
.recap-facts dt { font-size: .85rem; color: var(--muted); }
.recap-facts dd { margin: 2px 0 0; font-family: var(--font-display); font-weight: 800; font-size: 1.8rem; }
.month-bars { display: grid; grid-template-columns: repeat(12, 1fr); gap: 6px; height: 150px; align-items: end; }
.mb { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 4px; }
.mb-bar { width: 100%; min-height: 3px; border-radius: 6px 6px 2px 2px; background: var(--leaf); }
.mb-n { font-size: .75rem; font-weight: 700; color: var(--ink-2); min-height: 1em; order: -1; }
.mb-l { font-size: .75rem; color: var(--muted); }
.recap-fav { display: flex; align-items: center; gap: 18px; }
.share-block .share-row { margin-top: 10px; }

/* Wishlist */
.wish-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.wish-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px 18px; }
.wish-card.seen { border-color: color-mix(in srgb, var(--leaf) 45%, var(--line)); }
.wish-head { display: flex; align-items: center; gap: 14px; margin-bottom: 10px; }
.wish-img { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; flex: none; background: var(--surface-2); }
.wish-img.empty-thumb { display: grid; place-items: center; color: var(--muted); border: 1.5px dashed var(--line); background: transparent; }
.wish-title { flex: 1; min-width: 0; }
.wish-title b { font-size: 1.05rem; }
.seen-note { color: var(--leaf); font-weight: 700; font-size: .9rem; }
.sightings { list-style: none; margin: 6px 0 0; padding: 0; }
.sightings li { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 8px 0; border-top: 1px solid var(--line); }
.link.small { font-size: .85rem; }

/* Privacy, rules and footer links */
.prose { max-width: 68ch; }
.prose h1 { margin-bottom: 6px; }
.prose h2 { margin: 28px 0 8px; }
.prose p, .prose li { color: var(--ink-2); line-height: 1.65; }
.prose ul, .prose ol { padding-left: 1.3em; display: grid; gap: 6px; }
.prose .lede { margin-bottom: 8px; }
.foot-links { display: flex; gap: 16px; justify-content: center; margin: 32px 0 0; font-size: .85rem; }
.foot-links a { color: var(--muted); }
.foot-links a:hover { color: var(--leaf); }
.foot-links.side { justify-content: flex-start; flex-wrap: wrap; gap: 4px 14px; margin: 4px 0 0; padding: 0 12px; }
.foot-links a { white-space: nowrap; }
.foot-links { flex-wrap: wrap; row-gap: 6px; }
.check.agree { align-items: flex-start; margin: 4px 0 14px; font-weight: 500; line-height: 1.4; }
.check.agree input { margin-top: 2px; flex: none; }
.check.month-only { margin: 4px 0 14px; font-weight: 500; }
.v-day.month { font-size: 1.15rem; }
.signed-out .foot-links { margin-top: 20px; }
.status-pick { width: 100%; margin-top: 6px; }
.status-pick .select { width: 100%; min-height: 36px; padding: 6px 30px 6px 10px; font-size: .82rem; }
details.panel summary { list-style-position: inside; }

/* ============================================================
   Zoo and animal pages, people, photos, passes, offline
   ============================================================ */
.zoo-tags { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.accredit { display: inline-block; padding: 2px 10px; border-radius: 999px; background: #e6eef8; color: #24467a; font-size: .75rem; font-weight: 800; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .accredit { background: #1d2c40; color: #9fc0ef; } }
:root[data-theme="dark"] .accredit { background: #1d2c40; color: #9fc0ef; }
.admin-check { margin-top: 12px; font-size: .85rem; }
.zoo-map.tiny-map { height: 220px; margin-top: 22px; }
.zoo-animal-list { list-style: none; margin: 0 0 10px; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 0 20px; }
.zoo-animal-list li { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 8px 0; border-top: 1px solid var(--line); }
.zoo-animal-list a { display: inline-flex; align-items: center; text-decoration: none; font-weight: 700; flex: 1; min-width: 0; }
.zoo-animal-list a:hover .za-name { color: var(--leaf); text-decoration: underline; }
.zoo-animal-list .muted { width: 100%; padding-left: 38px; margin-top: -4px; }
.empty-dot { display: inline-block; border: 1.5px dashed var(--line); background: transparent; }
.link-plain { color: inherit; text-decoration: none; }
.link-plain:hover { color: var(--leaf); text-decoration: underline; }
a.chip:hover { border-color: var(--leaf); color: var(--leaf); }

.animal-hero { display: flex; gap: 24px; align-items: center; flex-wrap: wrap; }
.animal-hero h1 { font-size: clamp(1.9rem, 1.2rem + 2.4vw, 2.8rem); letter-spacing: -.025em; margin-bottom: 8px; }
.animal-photo { width: 140px; height: 140px; border-radius: 50%; object-fit: cover; flex: none; background: var(--surface-2); }
.animal-photo.empty-thumb { display: grid; place-items: center; color: var(--muted); border: 2px dashed var(--line); background: transparent; }
.animal-photo.empty-thumb .i { width: 44px; height: 44px; }
.status-line { margin-bottom: 8px; }
.status-line .iucn { margin-left: 0; }
.animal-hero .btn-row { margin-top: 12px; }

.small-h { font-size: 1rem; margin: 20px 0 8px; }
.request-list { list-style: none; margin: 0; padding: 0; }
.request-list li { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 0; border-top: 1px solid var(--line); }
.request-list li > span:first-child { flex: 1; min-width: 0; }
.req-status { font-size: .75rem; font-weight: 800; padding: 2px 10px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); }
.req-added { background: var(--leaf-soft); color: var(--leaf); border-color: transparent; }
.req-rejected { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.req-note { width: 100%; }
.req-head { margin-bottom: 10px; }
.req-name { font-size: 1.1rem; }
.req-work:not(:empty) { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.lookup-list { list-style: none; margin: 8px 0 10px; padding: 0; display: grid; gap: 6px; }
.lookup-pick { width: 100%; text-align: left; cursor: pointer; padding: 10px 12px; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--surface-2); line-height: 1.4; }
.lookup-pick:hover { border-color: var(--leaf); }
.req-form .zoo-map.tiny-map { margin: 0 0 6px; }

.follow-line { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 4px 0 6px; }
.following-list { margin-bottom: 20px; }
.avatar.xs { width: 22px; height: 22px; font-size: .6rem; }
.feed { list-style: none; margin: 0; padding: 0; }
.feed-item { display: flex; gap: 14px; padding: 16px 0; border-top: 1px solid var(--line); }
.feed-body { flex: 1; min-width: 0; }
.feed-body > p:first-child { margin-bottom: 2px; }
.feed-body .chips { margin-top: 8px; }
.boards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; margin-bottom: 14px; }
.board { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px; }
.board h2 { margin-bottom: 10px; }
.board-list { list-style: none; margin: 0; padding: 0; }
.board-list li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); }
.board-list li.me { background: var(--leaf-soft); margin: 0 -10px; padding: 8px 10px; border-radius: var(--r-sm); }
.rank { width: 24px; font-family: var(--font-display); font-weight: 800; color: var(--muted); text-align: center; }
.board-list li:nth-child(-n+3) .rank { color: var(--amber); }
.board-who { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; text-decoration: none; font-weight: 600; }
.board-who span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.score { font-weight: 700; font-size: .9rem; color: var(--ink-2); white-space: nowrap; }

.photo-strip { display: flex; gap: 8px; flex-wrap: wrap; }
.photo-strip.small { margin-top: 10px; }
.photo-thumb-btn { padding: 0; border: none; background: none; cursor: zoom-in; border-radius: var(--r-md); overflow: hidden; }
.photo-thumb-btn img { display: block; width: 112px; height: 112px; object-fit: cover; }
.photo-strip.small .photo-thumb-btn img { width: 76px; height: 76px; }
.photo-edit { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.photo-edit:empty { display: none; }
.photo-edit-item { position: relative; }
.photo-edit-item img { width: 80px; height: 80px; object-fit: cover; border-radius: var(--r-md); display: block; }
.photo-edit-item .chip-x { position: absolute; top: 4px; right: 4px; background: rgba(0, 0, 0, .55); color: #fff; }
.photo-edit-item.pending img { outline: 2px dashed var(--leaf); outline-offset: 1px; }
.lightbox { padding: 0; border: none; background: transparent; max-width: min(96vw, 1200px); max-height: 94vh; }
.lightbox::backdrop { background: rgba(0, 0, 0, .85); }
.lightbox img { display: block; max-width: min(96vw, 1200px); max-height: calc(94vh - 56px); margin: 0 auto; border-radius: var(--r-md); }
.lb-bar { display: flex; justify-content: center; align-items: center; gap: 12px; padding: 8px; color: #fff; }
.lb-bar .icon-btn { color: #fff; }
.lb-bar .icon-btn:hover { background: rgba(255, 255, 255, .15); color: #fff; }
.i.flip { transform: scaleX(-1); }
.admin-photos { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.admin-photos li { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.admin-photos .photo-thumb-btn img { width: 150px; height: 150px; }

.pass-panel { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-top: 22px; }
.pass-panel h2 { margin-bottom: 4px; }
.pass-result { margin-top: 6px; }
.saved { color: var(--leaf); }
.pass-line { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: -8px 0 18px; color: var(--ink-2); }
.pass-line .i { color: var(--leaf); }

.offline-bar {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 20px; z-index: 90;
  display: flex; align-items: center; gap: 8px; max-width: calc(100% - 32px);
  padding: 10px 16px; border-radius: 999px; background: var(--amber-soft); color: var(--ink);
  font-size: .88rem; font-weight: 600; box-shadow: var(--shadow);
}
.offline-bar[hidden] { display: none; }
.offline-bar .i { width: 16px; height: 16px; }
@media (max-width: 860px) { .offline-bar { bottom: calc(86px + env(safe-area-inset-bottom)); } }
.field label.btn { display: inline-flex; margin-bottom: 0; font-weight: 700; }

/* Admin: badges */
.admin-badges { list-style: none; margin: 16px 0 0; padding: 0; }
.admin-badge { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.admin-badge .medal { width: 52px; height: 52px; margin: 0; flex: none; filter: none; opacity: 1; background: var(--amber-soft); border-color: var(--amber); }
.admin-badge.off .medal, .badge-item.off .medal { filter: grayscale(1); opacity: .5; background: var(--surface-2); border-color: var(--line); }
.badge-item.off { opacity: .75; border-style: dashed; }
.admin-badge-main { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 200px; }
.rule-sum { font-style: italic; }
.danger-text { color: var(--danger); }
.field[hidden] { display: none; }
.badge-editor { margin: 16px 0 8px; padding: 18px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface-2); }
.badge-editor h3 { margin: 0 0 14px; }
.badge-editor-grid { display: grid; grid-template-columns: minmax(0, 1fr) 200px; gap: 24px; align-items: start; }
.badge-preview { position: sticky; top: 16px; }
.badge-preview .badge-grid { grid-template-columns: 1fr; }
.emoji-input { max-width: 120px; font-size: 1.4rem; text-align: center; }
.emoji-pick { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; max-width: 420px; }
.emoji-pick button { width: 36px; height: 36px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); font-size: 1.15rem; cursor: pointer; }
.emoji-pick button:hover { border-color: var(--leaf); }
.emoji-pick button:focus-visible { outline: 2px solid var(--leaf); outline-offset: 1px; }
@media (max-width: 700px) {
  .badge-editor-grid { grid-template-columns: minmax(0, 1fr); }
  .badge-preview { position: static; order: -1; }
  .badge-preview .badge-grid { grid-template-columns: minmax(0, 200px); }
}

/* Help */
.help-layout { display: block; }
.help h3 { margin: 18px 0 6px; font-size: 1rem; }
.help section { scroll-margin-top: 24px; }
.help-note { padding: 10px 14px; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--line); font-size: .92rem; }
.help-search { display: flex; margin: 18px 0 4px; max-width: 520px; }
.status-key { list-style: none; padding-left: 0 !important; }
.status-key .iucn { min-width: 30px; text-align: center; margin-right: 6px; }
.help kbd { font: inherit; font-size: .8em; font-weight: 700; padding: 1px 6px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; background: var(--surface); }
.help-toc { display: none; }
@media (min-width: 1100px) {
  .help-layout { display: grid; grid-template-columns: minmax(0, 68ch) 230px; gap: 56px; align-items: start; justify-content: space-between; }
  .help-toc { display: block; position: sticky; top: 32px; padding: 18px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); }
  .help-toc-title { font-weight: 800; margin: 0 0 8px; }
  .help-toc ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
  .help-toc a { display: block; padding: 5px 8px; border-radius: var(--r-sm); color: var(--ink-2); text-decoration: none; font-size: .9rem; }
  .help-toc a:hover { background: var(--surface-2); color: var(--leaf); }
}
.help-chips ul { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.help-chips a { display: inline-block; padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; font-size: .85rem; color: var(--ink-2); text-decoration: none; background: var(--surface); }
.help-chips a:hover { border-color: var(--leaf); color: var(--leaf); }
@media (min-width: 1100px) { .help-chips { display: none; } }

/* Public profile */
.pf-hero {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 24px; align-items: start;
  padding: 26px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); margin-bottom: 14px;
}
.pf-hero h1 { margin: 0; }
.pf-who .muted { margin: 2px 0 8px; }
.pf-sum { display: flex; flex-direction: column; gap: 2px; margin: 12px 0 0; }
.pf-actions { display: flex; flex-direction: column; gap: 8px; align-items: stretch; }
.pf-stats, .pf-high { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.pf-high { margin-top: 14px; }
.pf-tile {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: var(--r-lg);
  background: var(--surface); border: 1px solid var(--line); color: var(--ink); text-decoration: none; min-width: 0;
}
a.pf-tile:hover { border-color: var(--leaf); }
.pf-tile > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.pf-tile b { font-family: 'Bricolage Grotesque', system-ui, sans-serif; font-size: 1.45rem; line-height: 1.1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pf-tile b + span { font-size: .8rem; color: var(--muted); }
.pf-tile.wordy b { font-size: 1.05rem; white-space: normal; line-height: 1.2; }
.pf-ic { display: grid; place-items: center; width: 40px; height: 40px; flex: none; border-radius: 50%; background: var(--leaf-soft); color: var(--leaf); }
.pf-map-row { display: grid; grid-template-columns: minmax(0, 2fr) minmax(240px, 1fr); gap: 12px; }
.pf-map { height: min(440px, 60vh); margin: 0; }
.pf-regions { padding: 18px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); }
.pf-big { margin: 0 0 12px; color: var(--muted); }
.pf-big b { display: block; font-family: 'Bricolage Grotesque', system-ui, sans-serif; font-size: 2rem; color: var(--ink); line-height: 1; }
.pf-bars { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 6px; }
.pf-bars li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: center; font-size: .85rem; }
.pf-bar { position: relative; display: block; padding: 5px 8px; border-radius: var(--r-sm); overflow: hidden; }
.pf-bar::before { content: ''; position: absolute; inset: 0 auto 0 0; width: var(--w); background: var(--leaf-soft); border-radius: var(--r-sm); }
.pf-bar span { position: relative; font-weight: 600; white-space: nowrap; }
.pf-topzoos, .pf-recent, .pf-badges { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.pf-topzoos { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
.pf-topzoos a {
  position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 2px; height: 100%;
  padding: 18px 12px 14px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); color: var(--ink); text-decoration: none;
}
.pf-topzoos a:hover, .pf-recent a:hover { border-color: var(--leaf); }
.pf-topzoos .stamp { margin-bottom: 8px; }
.pf-zname { font-weight: 700; line-height: 1.25; }
.pf-rank { position: absolute; top: 10px; left: 10px; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--surface-2); font-size: .78rem; font-weight: 800; }
.pf-topzoos li:first-child .pf-rank { background: var(--amber); color: #1b1404; }
.pf-photos { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.pf-photos .photo-thumb-btn { width: 100%; aspect-ratio: 1; height: auto; }
.pf-photos .photo-thumb-btn img { width: 100%; height: 100%; object-fit: cover; }
.pf-badges { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.pf-badges li { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); }
.pf-badges .medal { width: 44px; height: 44px; margin: 0; font-size: 1.3rem; flex: none; filter: none; opacity: 1; background: var(--amber-soft); border-color: var(--amber); }
.pf-badges li > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.pf-recent { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.pf-recent a { display: flex; gap: 12px; align-items: flex-start; height: 100%; padding: 14px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.pf-recent a > span:last-child { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.pf-all summary { list-style: none; cursor: pointer; }
.pf-all summary::-webkit-details-marker { display: none; }
.pf-all[open] summary { margin-bottom: 16px; }
.pf-report { text-align: center; margin-top: 28px; }
@media (max-width: 900px) {
  .pf-map-row { grid-template-columns: minmax(0, 1fr); }
  .pf-photos { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .pf-hero { grid-template-columns: auto minmax(0, 1fr); padding: 18px; gap: 16px; }
  .pf-actions { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; }
  .pf-stats, .pf-high { grid-template-columns: 1fr 1fr; }
  .pf-tile { padding: 12px; gap: 10px; }
  .pf-ic { width: 34px; height: 34px; }
  .pf-tile b { font-size: 1.2rem; }
  .pf-map { height: 320px; }
  .pf-topzoos { grid-template-columns: 1fr 1fr; }
  .pf-topzoos a { padding: 16px 8px 12px; }
  .pf-topzoos .stamp { transform: scale(.85); margin-bottom: 2px; }
}

/* Map opened from the computer copy: no map pictures, just the pins */
.map-note { position: absolute; left: 12px; bottom: 10px; z-index: 500; margin: 0; padding: 4px 10px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: .78rem; color: var(--muted); pointer-events: none; }

/* Map pins: little passport stamps. Zoos you haven't been to are blank stamps with a paw print. */
.map-stamp {
  --size: calc(40px * var(--pin-scale, 1));
  width: var(--size); height: var(--size); display: block; cursor: pointer; border-radius: 50%;
  color: var(--stamp); z-index: 2;
  filter: var(--stamp-filter) drop-shadow(0 1.5px 2px rgba(0,0,0,.35));
}
.map-stamp svg { display: block; width: 100%; height: 100%; transform: rotate(var(--rot)); overflow: visible; }
.map-stamp .pin-face { fill: var(--surface); }
.map-stamp:hover, .map-stamp:focus-visible { z-index: 5; outline: none; }
.map-stamp:hover svg, .map-stamp:focus-visible svg { transform: rotate(0deg) scale(1.12); }
.map-stamp:focus-visible { box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--leaf); }
.map-stamp.unvisited {
  --size: calc(15px * var(--pin-scale, 1) + 5px);
  color: var(--muted); z-index: 1; opacity: .85;
  filter: drop-shadow(0 1px 1px rgba(0,0,0,.18));
}
.map-stamp.unvisited .pin-face { fill-opacity: .8; }
.map-stamp.unvisited:hover, .map-stamp.unvisited:focus-visible { opacity: 1; }
.map-stamp.unvisited:hover, .map-stamp.unvisited:focus-visible { color: var(--leaf); }
/* Pop-ups always sit above the map pins */
.zoo-map .maplibregl-popup { z-index: 20; }

/* Zoo page: links, animal list, admin panel */
.zoo-links { display: flex; flex-wrap: wrap; gap: 8px; margin: 2px 0 10px; }
.zoo-links:empty { display: none; }
.zoo-progress { max-width: 420px; margin-bottom: 12px; }
.zoo-progress p { margin: 0 0 6px; }
.zoo-progress .progress { margin-bottom: 0; }
.zoo-list-tools { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.zoo-list .chip.seen { background: var(--leaf-soft); border-color: transparent; color: var(--leaf); font-weight: 700; }
.zoo-list .chip.not-seen { background: transparent; border-style: dashed; }
.zoo-list .tick { margin-left: 6px; font-weight: 800; }
.zoo-admin { margin-top: 24px; }
.zoo-admin summary { cursor: pointer; }
.zoo-admin h3 { margin: 18px 0 8px; font-size: 1rem; }
.zoo-admin textarea { width: 100%; font-family: inherit; }
.lookup-list { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 8px; }
.lookup-list li { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-md); }
.suggestions li { align-items: flex-start; }
.suggestions li > span:first-child { display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 0; }
.zoo-list + .muted.small { margin-top: 12px; }

/* Zoos page: two rows of stamps, then "Show all" */
.stamp-grid .stamp-item[hidden] { display: none; }
.show-more { display: flex; margin: 18px auto 0; }
.show-more[hidden] { display: none; }

/* ---------- Admin: grouped tabs ---------- */
.admin-nav { display: flex; flex-wrap: wrap; gap: 6px 22px; margin-bottom: 24px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.admin-nav .admin-tabs { margin: 0; padding: 0; border: none; gap: 2px; }
.admin-group { display: flex; flex-direction: column; gap: 4px; }
.admin-group-label { font-size: .72rem; font-weight: 700; color: var(--muted); padding-left: 14px; }
.admin-nav .admin-tabs a { padding: 6px 12px; }

/* To-do panel */
.todo-panel { margin-bottom: 26px; }
.todo-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.todo-card { display: flex; gap: 12px; align-items: center; height: 100%; padding: 14px; border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--surface); color: var(--ink); text-decoration: none; }
.todo-card:hover { border-color: var(--leaf); }
.todo-n { display: grid; place-items: center; min-width: 42px; height: 42px; padding: 0 8px; border-radius: 999px; background: var(--leaf-soft); color: var(--leaf); font-family: var(--font-display); font-weight: 800; font-size: 1.15rem; }
.todo-card.has .todo-n { background: var(--amber-soft); color: var(--ink); }
.todo-card.bad .todo-n { background: var(--danger-soft); color: var(--danger); }
.todo-text { display: flex; flex-direction: column; min-width: 0; }

/* Charts */
.act-charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; margin-bottom: 8px; }
.act-chart { margin: 0; padding: 16px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); }
.act-chart figcaption { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.act-bars { display: flex; align-items: flex-end; gap: 4px; height: 140px; }
.act-bar { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; min-width: 0; }
.act-fill { width: 100%; max-width: 30px; background: var(--leaf); border-radius: 4px 4px 0 0; }
.act-v { font-size: .7rem; font-weight: 700; color: var(--ink-2); min-height: 1em; }
.act-l { font-size: .66rem; color: var(--muted); margin-top: 4px; white-space: nowrap; min-height: 1.2em; }
.act-list { list-style: none; margin: 0; padding: 0; }
.act-list li { display: grid; grid-template-columns: 24px minmax(0, 1.4fr) minmax(60px, 1fr) auto; gap: 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); }
.act-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.act-track, .u-track { height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.act-track span, .u-track span { display: block; height: 100%; background: var(--leaf); border-radius: inherit; }

/* Health */
.health-summary { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; padding: 18px 20px; border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--surface); }
.health-summary h2 { margin: 0; }
.health-summary.good { border-color: var(--leaf); background: var(--leaf-soft); }
.health-summary.warn { border-color: var(--amber); background: var(--amber-soft); }
.health-summary.bad { border-color: var(--danger); background: var(--danger-soft); }
.health-email { margin: 10px 0 0; padding: 10px 14px; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--line); }
.health-email.good { border-color: var(--leaf); }
.health-email.bad { border-color: var(--danger); color: var(--danger); }
.health-group { margin-top: 26px; }
.health-list { list-style: none; margin: 0; padding: 0; }
.health-list li { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; border-top: 1px solid var(--line); }
.hl-icon { display: grid; place-items: center; width: 24px; height: 24px; flex: none; border-radius: 50%; font-weight: 800; font-size: .8rem; color: #fff; background: var(--muted); margin-top: 1px; }
.hl-ok .hl-icon { background: var(--leaf); }
.hl-warn .hl-icon { background: var(--amber); color: #1b1404; }
.hl-fail .hl-icon { background: var(--danger); }
.hl-info .hl-icon { background: var(--surface-2); color: var(--ink-2); font-style: italic; font-family: Georgia, serif; }
.hl-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.hl-main > span { color: var(--ink-2); font-size: .92rem; overflow-wrap: anywhere; }
.hl-fix { margin-top: 4px; padding: 6px 10px; border-radius: var(--r-sm); background: var(--surface-2); }

/* Storage */
.meters { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; margin-bottom: 10px; }
.meter { padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); }
.meter-head { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.meter-bar { display: block; height: 12px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.meter-bar span { display: block; height: 100%; background: var(--leaf); border-radius: inherit; }
.meter.warn .meter-bar span { background: var(--amber); }
.meter.bad .meter-bar span { background: var(--danger); }
.sub-h { font-size: 1rem; margin: 24px 0 10px; }
.usage-list { list-style: none; margin: 0; padding: 0; }
.usage-list li { display: grid; grid-template-columns: minmax(120px, 1fr) minmax(80px, 2fr) 80px 90px; gap: 12px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); }
.u-name { font-weight: 600; }
.u-size { font-weight: 700; text-align: right; }

/* Zoo data */
.zd-list { list-style: none; margin: 0; padding: 0; }
.zd-list li { display: grid; grid-template-columns: minmax(180px, 1.2fr) minmax(0, 2fr) auto; gap: 12px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); }
.zd-list li.is-closed .zd-name { color: var(--muted); }
.zd-main { display: flex; flex-direction: column; min-width: 0; }
.zd-name { font-weight: 700; color: var(--ink); text-decoration: none; }
.zd-name:hover { color: var(--leaf); }
.zd-pills { display: flex; flex-wrap: wrap; gap: 5px; }
.zd-pill { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px; font-size: .76rem; font-weight: 600; }
.zd-pill.ok { background: var(--leaf-soft); color: var(--leaf); }
.zd-pill.no { border: 1px dashed var(--line); color: var(--muted); }
.zd-pill.closed { background: var(--ink); color: var(--bg); }

/* Announcement and featured, on the home page */
.announce { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 14px 12px 16px; margin-bottom: 20px; border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--surface); }
.announce p { flex: 1; min-width: 200px; margin: 0; font-weight: 600; }
.announce-ic { display: grid; place-items: center; width: 34px; height: 34px; flex: none; border-radius: 50%; background: var(--leaf-soft); color: var(--leaf); }
.announce-celebrate { border-color: var(--amber); background: color-mix(in srgb, var(--amber-soft) 60%, var(--surface)); }
.announce-celebrate .announce-ic { background: var(--amber); color: #1b1404; }
.announce-warning { border-color: var(--danger); background: color-mix(in srgb, var(--danger-soft) 55%, var(--surface)); }
.announce-warning .announce-ic { background: var(--danger); color: #fff; }
.feature-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; }
.feature-card { display: flex; gap: 16px; align-items: center; padding: 16px; border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--surface); color: var(--ink); text-decoration: none; }
.feature-card:hover { border-color: var(--leaf); }
.feature-card .stamp { --size: 72px; flex: none; }
.feature-img { width: 72px; height: 72px; flex: none; border-radius: 50%; object-fit: cover; background: var(--surface-2); display: grid; place-items: center; color: var(--muted); }
.feature-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; align-items: flex-start; }
.feature-kicker { font-size: .78rem; font-weight: 700; color: var(--amber); }
.feature-text b { font-size: 1.1rem; }
.feature-note { font-size: .9rem; color: var(--ink-2); }
.feature-you { color: var(--leaf); font-weight: 600; }
.closed-banner { border-color: var(--ink-2); }

@media (max-width: 700px) {
  .zd-list li { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .usage-list li { grid-template-columns: minmax(0, 1fr) 70px; }
  .usage-list .u-track, .usage-list .u-files { display: none; }
  .act-list li { grid-template-columns: 22px minmax(0, 1fr) auto; }
  .act-list .act-track { display: none; }
  .admin-nav { gap: 10px; }
}
#anPreview, #ftPreview { margin-bottom: 16px; }
#anPreview .announce { margin-bottom: 0; }

/* Unlisted names: the add button first, then smaller Rename / Remove links */
.name-more { display: inline-flex; gap: 12px; margin-left: 6px; font-size: .88rem; }

/* Profile photos keep their real colours in dark mode */
img.avatar { filter: none; background: var(--surface-2); }

/* ---------- Photo editor ---------- */
.photo-editor { width: min(620px, calc(100% - 32px)); }
.pe-wrap { display: flex; flex-direction: column; max-height: inherit; overflow-y: auto; }
.pe-head { padding-bottom: 12px; gap: 12px; justify-content: flex-start; align-items: baseline; }
.pe-stage { padding: 0 24px; }
.pe-stage canvas {
  display: block; width: 100%; border-radius: var(--r-md);
  background: #0e1d19 repeating-conic-gradient(#14271f 0 25%, #0e1d19 0 50%) 0 0 / 22px 22px;
  touch-action: none; cursor: grab;
}
.pe-stage canvas:active { cursor: grabbing; }
.pe-stage canvas:focus-visible { outline: 3px solid var(--leaf); outline-offset: 3px; }
.pe-tabs { display: flex; gap: 4px; padding: 14px 24px 0; border-bottom: 1px solid var(--line); margin: 0 0 4px; }
.pe-tabs button {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 12px 10px; border: 0; background: none; color: var(--muted);
  font: inherit; font-weight: 700; cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -1px;
}
.pe-tabs button[aria-selected="true"] { color: var(--leaf); border-bottom-color: var(--leaf); }
.pe-panel { padding: 14px 24px 6px; display: grid; gap: 14px; }
.pe-shapes { justify-self: start; }
.pe-zoom { display: flex; align-items: center; gap: 8px; }
.pe-zoom input, .pe-slider input { flex: 1; accent-color: var(--leaf); min-width: 0; }
.pe-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.pe-reset { margin-left: auto; }
.pe-slider { display: flex; align-items: center; gap: 12px; font-weight: 700; }
.pe-slider span { width: 92px; flex: none; }
.pe-slider output { width: 36px; text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; font-weight: 600; }
@media (max-width: 560px) {
  .pe-stage, .pe-panel { padding-left: 16px; padding-right: 16px; }
  .pe-tabs { padding-left: 16px; padding-right: 16px; }
  .pe-tools .btn { flex: 1 1 auto; }
  .pe-reset { margin-left: 0; }
}
.photo-edit-item .pe-again {
  position: absolute; left: 4px; bottom: 4px; background: rgba(0, 0, 0, .55); color: #fff;
  border: 0; border-radius: 999px; width: 26px; height: 26px; display: grid; place-items: center; cursor: pointer;
}
.photo-edit-item .pe-again .i { width: 14px; height: 14px; }
.pe-panel[hidden], .pe-shapes[hidden] { display: none; }
.photo-card .name-more { display: flex; justify-content: center; gap: 6px 16px; flex-wrap: wrap; margin: 2px 0 0; font-size: .9rem; }
.hidden-animals { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.hidden-animals li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--r-md); }

/* StampTheZoo logo on the sign-in page */
.auth-logo { display: block; width: 168px; height: 168px; color: var(--leaf); margin: 0 0 22px -6px; transform: rotate(-4deg); }
.auth-intro .welcome-stamps { margin: 26px 0 0; }
@media (max-width: 700px) { .auth-logo { width: 128px; height: 128px; margin-bottom: 14px; } }

/* Narrow phones: just the logo in the top bar, so the buttons beside it fit */
@media (max-width: 400px) {
  .mobile-top .brand-name { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}
.zd-more { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 4px 0 0; font-size: .88rem; }

/* Zoo regulars: levels for visiting the same zoo again and again */
.regular-intro { margin: -4px 0 12px; }
.regular-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.regular-list li {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 14px;
  padding: 12px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md);
}
.regular-medal { font-size: 1.7rem; line-height: 1; filter: grayscale(1); opacity: .35; }
.regular-list li.earned .regular-medal { filter: none; opacity: 1; }
.regular-main { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.regular-name { font-weight: 700; text-decoration: none; color: inherit; }
.regular-name:hover { text-decoration: underline; }
.regular-main .progress { max-width: 260px; margin-top: 4px; }
.regular-ladder { display: flex; gap: 4px; }
.regular-ladder span {
  min-width: 30px; padding: 3px 0; text-align: center; border-radius: 999px;
  font-size: .75rem; font-weight: 700; color: var(--muted); border: 1px dashed var(--line);
}
.regular-ladder span.on { background: var(--leaf); border: 1px solid var(--leaf); color: var(--surface); }
.regular-here { margin: 6px 0 0; font-weight: 600; }
@media (max-width: 640px) {
  .regular-list li { grid-template-columns: auto minmax(0, 1fr); }
  .regular-ladder { grid-column: 1 / -1; }
  .regular-ladder span { flex: 1; min-width: 0; }
}

/* While the site checks whether you're signed in, keep the menus hidden (their space is kept, so nothing jumps) */
.booting .sidebar, .booting .mobile-actions, .booting .bottombar, .booting .site-foot { visibility: hidden; }

/* "You're looking at example visits" */
.examples-banner { margin-bottom: 20px; }

/* Map: groups of zoos that would overlap, shown as a bubble with a count */
.map-group {
  width: var(--d); height: var(--d); display: grid; place-items: center; cursor: pointer; border-radius: 50%;
  background: var(--leaf); color: var(--surface); font-family: var(--font-display); font-weight: 800; font-size: .95rem;
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--leaf) 28%, transparent), 0 2px 6px rgba(0,0,0,.25);
  z-index: 3; transition: transform .15s ease;
}
.map-group:hover, .map-group:focus-visible { transform: scale(1.1); outline: none; }
.map-group:focus-visible { box-shadow: 0 0 0 3px var(--surface), 0 0 0 6px var(--leaf); }
.map-group.none-visited {
  background: color-mix(in srgb, var(--surface) 88%, transparent); color: var(--muted); font-size: .85rem;
  box-shadow: 0 0 0 1.5px var(--muted), 0 1px 3px rgba(0,0,0,.18); z-index: 2;
}
@media (prefers-reduced-motion: reduce) { .map-group { transition: none; } }

/* ---------- Welcome page: what visitors see before they sign in ---------- */
.welcome-page { width: 100%; }
.wl-preview {
  display: flex; align-items: center; gap: 8px; margin: 0 0 18px; padding: 10px 14px;
  background: var(--amber-soft); border-radius: var(--r-md); font-size: .92rem;
}
.wl-preview .i { width: 18px; height: 18px; }
.wl-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 8px; }
.wl-top .brand { text-decoration: none; }
.wl-top-links { display: flex; gap: 8px; }

.wl-hero { text-align: center; padding: 40px 0 72px; border-bottom: 1px solid var(--line); }
.wl-logo { display: block; width: 172px; height: 172px; margin: 0 auto 26px; color: var(--leaf); transform: rotate(-5deg); }
.wl-hero h1 { font-size: clamp(2.4rem, 5.4vw, 4.1rem); line-height: 1.02; letter-spacing: -.02em; max-width: 15ch; margin: 0 auto 20px; }
.wl-hero .lede { max-width: 58ch; margin: 0 auto 30px; }
.wl-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.wl-btn { min-height: 50px; padding: 0 26px; font-size: 1.02rem; }
.wl-note { margin: 14px 0 0; }
.wl-stats { display: flex; justify-content: center; gap: 0; margin: 44px 0 0; padding: 0; }
.wl-stats > div { padding: 0 34px; border-left: 1px solid var(--line); }
.wl-stats > div:first-child { border-left: 0; }
.wl-stats dt { color: var(--muted); font-size: .88rem; font-weight: 600; }
.wl-stats dd { margin: 2px 0 0; font-family: var(--font-display); font-weight: 800; font-size: 2rem; color: var(--leaf); }

.wl-section {
  display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr); gap: 56px; align-items: center;
  padding: 72px 0; border-bottom: 1px solid var(--line);
}
.wl-section.flip .wl-visual { order: 2; }
.wl-text h2 { font-size: clamp(1.9rem, 3.4vw, 2.7rem); line-height: 1.05; letter-spacing: -.015em; margin: 0 0 14px; }
.wl-text .lede { margin: 0 0 20px; }
.wl-points { list-style: none; margin: 0 0 26px; padding: 0; display: grid; gap: 10px; }
.wl-points li { display: flex; gap: 10px; align-items: flex-start; }
.wl-points .i {
  flex: none; width: 22px; height: 22px; padding: 4px; margin-top: 1px; border-radius: 50%;
  background: var(--leaf-soft); color: var(--leaf); stroke-width: 3;
}

/* The picture side: a soft green panel with real pieces of the site inside */
.wl-visual {
  position: relative; min-height: 320px; display: grid; place-items: center; padding: 34px; overflow: hidden;
  border-radius: var(--r-lg);
  background:
    radial-gradient(circle at 1px 1px, color-mix(in srgb, var(--leaf) 16%, transparent) 1px, transparent 0) 0 0 / 18px 18px,
    var(--leaf-soft);
}
.wl-visual.is-image { padding: 0; background: var(--surface-2); }
.wv-photo { width: 100%; height: 100%; min-height: 320px; object-fit: cover; display: block; }
.wv-stamps { display: grid; grid-template-columns: repeat(3, auto); gap: 14px 22px; justify-content: center; }
.wv-stamps .stamp { --size: 104px; }
.wv-list, .wv-regulars {
  list-style: none; margin: 0; padding: 8px; width: min(100%, 420px); display: grid; gap: 4px;
  background: var(--surface); border-radius: var(--r-md); box-shadow: var(--shadow);
}
.wv-list li { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto auto; gap: 10px; align-items: center; padding: 8px 10px; }
.wv-list li + li { border-top: 1px solid var(--line); }
.wv-ani { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }
.wv-ani-none { display: grid; place-items: center; background: var(--leaf-soft); color: var(--leaf); }
.wv-ani-none .i { width: 20px; height: 20px; }
.wv-ani-name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wv-seen { display: inline-flex; align-items: center; gap: 4px; font-size: .8rem; font-weight: 700; color: var(--muted); }
.wv-seen.on { color: var(--leaf); }
.wv-seen .i { width: 15px; height: 15px; stroke-width: 3; }
.wv-regulars { padding: 6px; gap: 6px; background: transparent; box-shadow: none; }
.wv-regulars li { box-shadow: var(--shadow); }
.wv-map {
  position: relative; width: min(100%, 440px); aspect-ratio: 5 / 4; border-radius: var(--r-md); box-shadow: var(--shadow);
  background:
    radial-gradient(ellipse 30% 44% at 40% 52%, color-mix(in srgb, var(--leaf) 14%, var(--surface)) 0 98%, transparent 100%),
    radial-gradient(ellipse 18% 20% at 26% 16%, color-mix(in srgb, var(--leaf) 14%, var(--surface)) 0 98%, transparent 100%),
    radial-gradient(ellipse 20% 26% at 72% 70%, color-mix(in srgb, var(--leaf) 14%, var(--surface)) 0 98%, transparent 100%),
    color-mix(in srgb, #8EC3D6 30%, var(--surface));
}
.wv-pin { position: absolute; transform: translate(-50%, -50%); }
.wv-map .map-stamp { --pin-scale: 1; }
.wv-badges { width: min(100%, 400px); grid-template-columns: 1fr 1fr; }
.wv-profile { width: min(100%, 420px); padding: 20px; background: var(--surface); border-radius: var(--r-md); box-shadow: var(--shadow); }
.wv-prof-top { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; }
.wv-prof-top b { display: block; font-family: var(--font-display); font-size: 1.1rem; }
.wv-follow { pointer-events: none; }
.wv-prof-stats { display: flex; gap: 18px; margin: 16px 0; font-size: .9rem; color: var(--muted); }
.wv-prof-stats b { color: var(--ink); font-size: 1.05rem; }
.wv-prof-stamps { display: flex; justify-content: space-between; gap: 6px; }
.wv-prof-stamps .stamp { --size: 78px; }

/* Closing: the one deep-green panel on the page */
.wl-closing {
  margin: 72px 0 0; padding: 56px 32px; text-align: center; border-radius: var(--r-lg);
  background: var(--leaf); color: var(--on-leaf);
}
.wl-closing h2 { font-size: clamp(1.9rem, 3.6vw, 2.8rem); margin: 0 auto 12px; max-width: 22ch; color: inherit; }
.wl-closing .lede { color: inherit; opacity: .88; max-width: 52ch; margin: 0 auto 26px; }
.wl-closing .btn.primary { background: var(--on-leaf); color: var(--leaf); }
.wl-closing .btn.primary:hover { background: color-mix(in srgb, var(--on-leaf) 88%, var(--leaf)); }
.wl-closing .btn.ghost { color: var(--on-leaf); border-color: color-mix(in srgb, var(--on-leaf) 45%, transparent); }
.wl-closing .btn.ghost:hover { border-color: var(--on-leaf); color: var(--on-leaf); }
.auth-more { margin: 22px 0 0; }

@media (max-width: 860px) {
  .wl-section { grid-template-columns: minmax(0, 1fr); gap: 28px; padding: 52px 0; }
  .wl-section.flip .wl-visual { order: 0; }
  .wl-visual { min-height: 0; padding: 24px 16px; }
  .wv-photo { min-height: 220px; }
}
@media (max-width: 560px) {
  .wl-hero { padding: 24px 0 52px; }
  .wl-logo { width: 128px; height: 128px; }
  .wl-top .brand-name { display: none; }
  .wl-stats { flex-direction: column; gap: 16px; }
  .wl-stats > div { border-left: 0; padding: 0; }
  .wv-stamps { grid-template-columns: repeat(3, auto); gap: 10px; }
  .wv-stamps .stamp { --size: 84px; }
  .wv-prof-stamps .stamp { --size: 62px; }
  .wl-btn { width: 100%; }
  .wl-closing { padding: 40px 20px; }
}

/* Admin: welcome page editor */
.wl-ed-top { margin: 0 0 16px; }
.wl-ed-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 24px; }
.wl-ed-preview { min-height: 220px; padding: 16px; transform-origin: top; }
.wl-ed-preview .wv-stamps .stamp { --size: 70px; }
.wl-ed-preview .wv-prof-stamps .stamp { --size: 56px; }
.wl-ed-upload { margin-top: 10px; cursor: pointer; }
.wl-down .i { transform: rotate(-90deg); }
.wl-ed .btn-row .icon-btn:first-child .i { transform: rotate(90deg); }
@media (max-width: 860px) { .wl-ed-grid { grid-template-columns: minmax(0, 1fr); } }
/* Where the phone header already shows the logo, the welcome page's own top bar just keeps its buttons */
@media (max-width: 860px) {
  .wl-top { justify-content: flex-end; margin-bottom: 0; }
  .wl-top .brand { display: none; }
}
.zoo-admin .tiny-map { margin: 8px 0 12px; }

/* Admin: account actions */
.acct-panel { margin-top: 28px; }
.acct-list { list-style: none; margin: 8px 0 0; padding: 0; }
.acct-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 14px 0; border-top: 1px solid var(--line); }
.acct-row:first-child { border-top: 0; }
.acct-row p { margin: 2px 0 0; max-width: 70ch; }
.acct-row .btn { flex: none; }
.acct-status { margin: 4px 0 6px; padding: 10px 14px; border-radius: var(--r-md); background: color-mix(in srgb, var(--danger) 10%, transparent); }
.danger-text { color: var(--danger); }
@media (max-width: 560px) { .acct-row { flex-direction: column; align-items: stretch; } }
.frozen-banner { margin-bottom: 20px; border-left: 4px solid var(--danger); }
.field label.check { display: flex; align-items: flex-start; line-height: 1.4; }
.field label.check input { flex: none; margin-top: 1px; }

/* Notifications */
.nav-count { margin-left: auto; min-width: 22px; padding: 1px 7px; border-radius: 999px; background: var(--leaf); color: #fff; font-size: .75rem; font-weight: 700; text-align: center; }
.notif-btn { position: relative; }
.nav-dot { position: absolute; top: 3px; right: 2px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 999px; background: var(--danger); color: #fff; font-size: .65rem; font-weight: 700; line-height: 17px; text-align: center; }
.note-list { list-style: none; margin: 8px 0 0; padding: 0; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); overflow: hidden; }
.note + .note { border-top: 1px solid var(--line); }
.note > a, .note > div { display: flex; gap: 14px; align-items: flex-start; padding: 14px 16px; color: inherit; text-decoration: none; }
.note > a:hover { background: var(--surface-2); }
.note.unread > a, .note.unread > div { background: color-mix(in srgb, var(--leaf-soft) 55%, transparent); }
.note-ic { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--surface-2); color: var(--leaf); }
.note.unread .note-ic { background: var(--leaf); color: #fff; }
.note-text { display: flex; flex-direction: column; gap: 3px; line-height: 1.45; }

/* Visits waiting to upload */
.pending-badge { display: inline-flex; align-items: center; gap: 4px; }
.pending-badge .i { width: 13px; height: 13px; }
.offline-bar .link { color: inherit; text-decoration: underline; font-weight: 600; }

/* Compare logbooks */
.cmp-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.cmp-col { padding: 16px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); }
.cmp-num { margin: 0 0 10px; color: var(--muted); }
.cmp-num b { display: block; font-size: 1.9rem; line-height: 1.1; color: var(--ink); }
.cmp-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.cmp-h { margin: 22px 0 8px; font-size: 1rem; }
@media (max-width: 760px) { .cmp-grid { grid-template-columns: minmax(0, 1fr); } }

/* Zoos near you */
.near-form { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 12px 0 4px; }
.near-form .input { flex: 1 1 180px; max-width: 260px; }
.near-list { list-style: none; margin: 8px 0 0; padding: 0; counter-reset: near; }
.near-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 14px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.near-list li:first-child { border-top: 0; }
.near-zoo { display: flex; flex-direction: column; color: inherit; text-decoration: none; }
.near-zoo:hover b { color: var(--leaf); }
.near-mi { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--ink-2); white-space: nowrap; }
@media (max-width: 520px) { .near-list li { grid-template-columns: minmax(0, 1fr) auto; } .near-list .btn { grid-column: 1 / -1; justify-self: start; } }

/* Maintenance mode */
.maint .sidebar, .maint .bottombar, .maint .mobile-actions { display: none !important; }
.maint .app { grid-template-columns: minmax(0, 1fr); }
.maint-page { max-width: 520px; margin: 12vh auto 0; text-align: center; }
.maint-mark { width: 84px; height: 84px; color: var(--leaf); }
.maint-page h1 { margin: 14px 0 6px; }
.maint-page .btn-row { justify-content: center; margin-top: 18px; }
.maint-bar { position: fixed; top: 12px; left: calc(50% + 120px); transform: translateX(-50%); z-index: 95; display: flex; align-items: center; gap: 8px 12px; max-width: calc(100% - 32px);
  padding: 8px 16px; border-radius: 999px; background: var(--amber-soft); color: var(--ink); font-size: .88rem; box-shadow: var(--shadow); }
.maint-bar .i { width: 16px; height: 16px; flex: none; }
@media (max-width: 860px) { .maint-bar { top: auto; left: 50%; bottom: calc(86px + env(safe-area-inset-bottom)); flex-wrap: wrap; border-radius: var(--r-md); } }
.maint-bar[hidden] { display: none; }
.maint-panel { margin-top: 24px; }
.maint-panel.on { border-color: var(--danger); }
.maint-panel .field { max-width: 560px; }

/* Appeals */
.appeal-box { margin-top: 14px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface-2); }
.appeal-box p { margin: 0 0 10px; }
.report-card.appeal { border-left: 4px solid var(--leaf); }
.auto-hide { margin-bottom: 18px; align-items: center; }
.auto-hide .select { flex: none; width: auto; }

/* Same internet address */
.same-ip { margin-top: 20px; }
.same-ip p { margin: 4px 0 0; }
.same-ip.warn { background: var(--danger-soft); border-left: 4px solid var(--danger); }

/* Growth charts on Overview */
.growth-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.growth { margin: 0; padding: 14px 16px 10px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); }
.growth figcaption { display: flex; flex-direction: column; gap: 2px; margin-bottom: 12px; }
.g-bars { display: flex; align-items: flex-end; gap: 2px; height: 96px; border-bottom: 1px solid var(--line); }
.g-bar { position: relative; flex: 1; height: 100%; display: flex; align-items: flex-end; outline: none; }
.g-bar::before { content: ''; display: block; width: 100%; height: var(--h); min-height: 0; background: var(--leaf); border-radius: 4px 4px 0 0; }
.g-bar:hover::before, .g-bar:focus-visible::before { background: color-mix(in srgb, var(--leaf) 75%, var(--ink)); }
.g-bar:hover::after, .g-bar:focus-visible::after { content: attr(data-tip); position: absolute; bottom: calc(var(--h) + 8px); left: 50%; transform: translateX(-50%); z-index: 3; padding: 6px 9px; border-radius: 8px; background: var(--ink); color: var(--surface); font-size: .78rem; white-space: nowrap; pointer-events: none; }
.growth .g-bars .g-bar:first-child:hover::after, .growth .g-bars .g-bar:first-child:focus-visible::after { left: 0; transform: none; }
.growth .g-bars .g-bar:last-child:hover::after, .growth .g-bars .g-bar:last-child:focus-visible::after { left: auto; right: 0; transform: none; }
.g-axis { display: flex; justify-content: space-between; margin-top: 4px; }
.g-table { margin-top: 10px; }
.g-table table { border-collapse: collapse; margin-top: 8px; }
.g-table th, .g-table td { padding: 4px 12px 4px 0; text-align: left; font-variant-numeric: tabular-nums; }
@media (max-width: 760px) { .growth-row { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Likes on visits ---------- */
.like-btn, .like-count {
  display: inline-flex; align-items: center; gap: 5px; min-height: 34px; padding: 0 10px; margin-left: -4px;
  border: 1px solid transparent; border-radius: 999px; background: none; color: var(--muted);
  font: inherit; font-size: .85rem; font-weight: 700; cursor: pointer; line-height: 1;
}
.like-btn .i, .like-count .i { width: 18px; height: 18px; }
.like-btn:hover { background: var(--danger-soft); color: var(--danger); }
.like-btn.on { color: var(--danger); }
.like-btn.on .i { fill: currentColor; }
.like-btn:disabled { cursor: progress; }
.like-btn:focus-visible, .like-count:focus-visible { outline: 2px solid var(--leaf); outline-offset: 2px; }
.like-n:empty { display: none; }
.like-count { color: var(--danger); min-height: 28px; padding: 0 8px; margin-left: 0; background: var(--danger-soft); }
.like-count .i { width: 15px; height: 15px; fill: currentColor; }
.like-count:hover { border-color: var(--danger); }
.feed-foot { margin-top: 6px; }
.feed-foot:empty { display: none; }
.v-top .like-btn { min-height: 30px; margin: -4px 0; }
.pf-recent li.has-like { position: relative; }
.pf-recent li.has-like a { padding-bottom: 46px; }
.pf-recent li .like-btn, .pf-recent li .like-count { position: absolute; left: 50px; bottom: 10px; margin: 0; }
.pf-recent li { position: relative; }
.pf-recent li:has(.like-count) a { padding-bottom: 46px; }
.liker-list { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 4px; max-height: 50vh; overflow: auto; }
.liker-list a { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: var(--r-md); color: var(--ink); text-decoration: none; }
.liker-list a:hover { background: var(--surface-2); }
.liker-list a > span:last-child { display: flex; flex-direction: column; }
.v-item.flash { animation: stz-flash 2.4s ease-out; border-radius: var(--r-md); }
@keyframes stz-flash { 0%, 30% { background: var(--leaf-soft); } 100% { background: transparent; } }
@media (prefers-reduced-motion: reduce) { .v-item.flash { animation: none; background: var(--leaf-soft); } }

/* ---------- Blocked members ---------- */
.blocked-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.blocked-list li { display: flex; align-items: center; gap: 12px; }
.blocked-who { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.blocked-who b, .blocked-who span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pf-report { display: flex; flex-wrap: wrap; gap: 6px 18px; }

/* ---------- Contact us ---------- */
.contact-form { margin: 18px 0 14px; display: grid; gap: 4px; }
.contact-form .field-row { margin: 0; }
.contact-form .btn.primary { justify-self: start; }
.contact-form > p.muted { margin: 6px 0 0; }
.contact-sent { display: flex; gap: 14px; align-items: flex-start; margin: 18px 0; }
.contact-sent > .i { flex: none; width: 36px; height: 36px; padding: 7px; border-radius: 50%; background: var(--leaf-soft); color: var(--leaf); stroke-width: 2.6; }
.contact-sent h2 { margin: 2px 0 6px; }

/* ---------- Admin: messages and restoring ---------- */
.message-card .msg-from { margin-bottom: 10px; overflow-wrap: anywhere; }
.message-card .report-details { border-left-color: var(--leaf); overflow-wrap: anywhere; }
.backup-list li { display: flex; align-items: center; gap: 10px; }
.backup-list li .row-link { flex: 1; min-width: 0; }
.backup-list li .link { flex: none; padding: 6px 2px; }
.restore-upload { margin-top: 14px; padding-top: 12px; display: grid; gap: 8px; justify-items: start; }
#emailBox > p.muted, #emailBox form > p.muted:first-child { margin: 0 0 14px; }

/* ---------- Admin: edit one zoo ---------- */
.ze-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px 16px; flex-wrap: wrap; margin: 4px 0 16px; }
.ze-title { font-size: 1.6rem; margin: 2px 0 4px; }
.ze-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.ze-grid > .panel { margin: 0; min-width: 0; }
.ze-grid h3 { margin: 0 0 12px; font-size: 1.1rem; }
.ze-h-gap { margin-top: 22px !important; }
.ze-wide { grid-column: 1 / -1; }
@media (max-width: 1000px) { .ze-grid { grid-template-columns: minmax(0, 1fr); } }
.ze-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 2px 0 8px; }
.ze-chip { display: inline-flex; align-items: center; gap: 4px; padding: 4px 4px 4px 12px; border-radius: 999px; background: var(--surface-2); font-size: .88rem; font-weight: 600; max-width: 100%; overflow-wrap: anywhere; }
.ze-chip.builtin { padding-right: 12px; color: var(--muted); }
.ze-chip button { border: 0; background: none; color: var(--muted); width: 28px; height: 28px; border-radius: 50%; cursor: pointer; font-size: 1.05rem; line-height: 1; }
.ze-chip button:hover { background: var(--danger-soft); color: var(--danger); }
.ze-add { display: flex; gap: 8px; }
.ze-add .input { flex: 1; min-width: 0; }
.ze-assoc { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 8px; }
.ze-assoc label { display: flex; gap: 10px; align-items: flex-start; height: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-md); cursor: pointer; background: var(--surface); }
.ze-assoc label.on { border-color: var(--leaf); background: var(--leaf-soft); }
.ze-assoc input { margin-top: 3px; accent-color: var(--leaf); width: 18px; height: 18px; flex: none; }
.ze-assoc b { display: block; }
.ze-assoc span.muted { display: block; font-size: .82rem; line-height: 1.35; }
.ze-sub { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; margin: 4px 0 8px; }
#zeAssoc details { margin: 12px 0 10px; }
#zeAssoc details > summary { cursor: pointer; font-weight: 700; color: var(--leaf); margin-bottom: 10px; }
.ze-status { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.ze-status label { display: flex; gap: 8px; align-items: center; padding: 10px 16px; border: 1px solid var(--line); border-radius: var(--r-md); cursor: pointer; }
.ze-status label:has(input:checked) { border-color: var(--leaf); background: var(--leaf-soft); font-weight: 700; }
.ze-status input { accent-color: var(--leaf); }
.ze-danger { border-color: color-mix(in srgb, var(--danger) 35%, var(--line)); }
.ze-pos { margin-top: 10px; }
.ze-bar { position: sticky; bottom: 12px; z-index: 15; padding: 12px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: 0 6px 24px rgba(0, 0, 0, .12); display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.ze-bar > span { margin-right: auto; min-width: 0; }
@media (max-width: 860px) { .ze-bar { bottom: calc(76px + env(safe-area-inset-bottom)); } }
@media (max-width: 420px) { .ze-bar .btn { flex: 1; } .ze-bar > span { flex-basis: 100%; } }
