:root {
  --bg: #f4f1ea; --card: #fff; --ink: #1f2a22; --muted: #6b7568; --accent: #2f7d4f; --accent-ink: #fff;
  --line: #e0dbcf; --shadow: 0 1px 3px rgba(0,0,0,.08);
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #151a16; --card: #1f2621; --ink: #e8ede9; --muted: #98a399; --accent: #5dbb84; --accent-ink: #0d140f; --line: #2c352e; --shadow: none; }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif; }
a { color: var(--accent); }
.top { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--bg); z-index: 5; flex-wrap: wrap; }
.brand { font-weight: 700; font-size: 1.15rem; text-decoration: none; color: var(--ink); }
.brand small { font-weight: 400; color: var(--muted); font-size: .8rem; margin-left: 6px; }
nav a { margin-left: 16px; text-decoration: none; color: var(--ink); }
nav a.active { color: var(--accent); font-weight: 600; }
.pill { background: var(--accent); color: var(--accent-ink); border-radius: 999px; padding: 0 7px; font-size: .75rem; }
main { max-width: 1280px; margin: 0 auto; padding: 16px; min-height: 70vh; }
footer { text-align: center; color: var(--muted); font-size: .8rem; padding: 24px 16px; }
h1 { margin: .2em 0 .1em; } h2 { margin-top: 1.4em; }
.muted { color: var(--muted); }
.controls { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0; }
input[type=search], input[type=text], textarea { font: inherit; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--ink); }
input[type=search] { flex: 1; min-width: 200px; }
textarea { width: 100%; min-height: 70px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.chip, button, .btn { font: inherit; border: 1px solid var(--line); background: var(--card); color: var(--ink); border-radius: 999px; padding: 5px 12px; cursor: pointer; text-decoration: none; display: inline-block; }
.chip.on, button.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
button:hover, .chip:hover { border-color: var(--accent); }
.animals { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.acard { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 0; overflow: hidden; text-decoration: none; color: var(--ink); box-shadow: var(--shadow); display: block; }
.acard .pz { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; display: block; background: var(--line); }
.acard .pz.noimg { display: flex; align-items: center; justify-content: center; font-size: 2.4rem; }
.acard .meta { padding: 10px 12px 12px; }
.acard:hover { border-color: var(--accent); }
.acard .em { font-size: 1.6rem; } .acard b { display: block; } .acard i { color: var(--muted); font-size: .85rem; }
.acard .badge { float: right; font-size: .75rem; color: var(--accent); }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 14px 0; }
.masonry { columns: 4 240px; column-gap: 12px; }
.tile { break-inside: avoid; margin-bottom: 12px; position: relative; background: var(--card); border-radius: 10px; overflow: hidden; box-shadow: var(--shadow); }
.tile img { width: 100%; height: auto; display: block; cursor: zoom-in; background: var(--line); }
.tile .save { position: absolute; top: 8px; right: 8px; border-radius: 50%; width: 34px; height: 34px; padding: 0; font-size: 1.1rem; opacity: .95; }
.tile .save.on { background: #d6456b; border-color: #d6456b; color: #fff; }
.tile figcaption { font-size: .72rem; color: var(--muted); padding: 6px 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.88); z-index: 20; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 16px; color: #fff; }
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 95vw; max-height: 78vh; object-fit: contain; }
.lightbox .cap { margin-top: 10px; font-size: .85rem; max-width: 900px; text-align: center; }
.lightbox a { color: #9be0b7; }
.lightbox .bar { margin-top: 10px; display: flex; gap: 8px; }
.facts { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin: 10px 0; }
.drop { border: 2px dashed var(--line); border-radius: 12px; padding: 14px 16px; margin: 12px 0 20px; background: var(--card); }
.drop.over { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, var(--card)); }
.drop input[type=text] { min-width: 180px; }
.pinbox { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin: 14px 0; overflow-x: auto; }
.status { padding: 24px; text-align: center; color: var(--muted); }
.bgroup { margin-bottom: 28px; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* animal page header: official Planet Zoo 2 art */
.hero { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; margin: 10px 0 4px; }
.hero-art { height: 220px; max-width: 100%; width: auto; border-radius: 14px; background: #fdf0d5; box-shadow: var(--shadow); }
.hero-head { width: 120px; height: 120px; object-fit: contain; }
.hero-txt { flex: 1; min-width: 220px; }
.hero-txt h1 { margin: 0 0 4px; font-size: 2rem; }
.hero-map { margin: 0; width: 170px; }
.hero-map img { width: 100%; display: block; border-radius: 12px; background: #0f2630; box-shadow: var(--shadow); }
.hero-map figcaption { text-align: center; color: var(--muted); font-size: .78rem; margin-top: 4px; }
footer a { color: inherit; }

/* compact version shown inside the floorplan's inspiration window */
.embed .top, .embed footer, .embed .hero-txt p { display: none; }
.embed main { padding: 10px; min-height: 0; }
.embed .hero { gap: 12px; } .embed .hero-art { height: 130px; } .embed .hero-map { width: 100px; } .embed .hero-txt h1 { font-size: 1.4rem; }
/* the hidden attribute must win over button / chip display rules */
[hidden] { display: none !important; }
