:root {
  --bg: #14191C;
  --panel: #1B2226;
  --panel-2: #232C31;
  --line: #313C42;
  --ink: #E8E6DF;
  --ink-2: #98A3A6;
  --khaki: #CBBF9E;
  --accent: #F26A1B;           /* puffin-bill orange */
  --accent-soft: rgba(242, 106, 27, .14);
  --season: #8DB85F;
  --season-soft: rgba(141, 184, 95, .16);
  --shadow: 0 12px 32px rgba(0, 0, 0, .45);
  --radius: 10px;
  --head: "Barlow Condensed", "Arial Narrow", sans-serif;
  --sans: "Inter", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { font-family: var(--sans); color: var(--ink); background: var(--bg); font-size: 14px; }
h1, h2, h3, h4 { font-family: var(--head); font-weight: 700; margin: 0; letter-spacing: .02em; }
button { font: inherit; cursor: pointer; color: inherit; }
::-webkit-scrollbar { width: 8px; } ::-webkit-scrollbar-thumb { background: var(--line); border-radius: 4px; }

/* ---------- Intro ---------- */
.intro { position: fixed; inset: 0; z-index: 2000; display: grid; place-items: center; padding: 16px;
  background: radial-gradient(ellipse at 50% 0%, #26323A, #0E1215 70%); }
.intro.hide { opacity: 0; pointer-events: none; transition: opacity .5s; }
.intro-card { max-width: 540px; width: 100%; background: var(--panel); border: 1px solid var(--line); border-radius: 16px;
  padding: 22px 24px 28px; box-shadow: var(--shadow); text-align: center; }
.plate { position: relative; background: #E9E2CF; border-radius: 10px; padding: 18px 0 0; overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.15); }
.plate-label { position: absolute; top: 8px; left: 12px; font-family: var(--mono); font-size: 10px; letter-spacing: .1em;
  text-transform: uppercase; color: #7A6F55; }
.intro-art { width: 100%; height: auto; display: block; }
.intro-card h1 { font-size: 42px; margin: 18px 0 8px; color: #F06AA8; text-transform: uppercase; }
.intro-card p { line-height: 1.6; color: var(--ink-2); margin: 0 auto 10px; max-width: 430px; text-wrap: balance; }
.intro-card p strong { color: var(--ink); }
.intro-card .intro-lead { font-size: 16px; color: var(--ink); }
.intro-card .intro-gift { margin-top: 16px; padding-top: 14px; border-top: 1px dashed var(--line); }
.intro-card .intro-gift strong { color: #F06AA8; }
.intro-card .intro-small { font-size: 13px; font-style: italic; margin-bottom: 0; }
.btn-primary { margin-top: 12px; background: var(--accent); color: #fff; border: 0; border-radius: 6px;
  padding: 12px 26px; font-family: var(--head); font-weight: 700; font-size: 18px; letter-spacing: .06em; text-transform: uppercase; }
.btn-primary:hover { filter: brightness(1.08); }
#intro-go { background: #F06AA8; }
@keyframes waddle { 0%,100% { transform: rotate(-4deg); } 50% { transform: rotate(4deg); } }
@keyframes bob { 0%,100% { transform: rotate(0); } 40% { transform: rotate(-3deg); } 60% { transform: rotate(2deg); } }
/* Interactive intro birds (both scenes) */
.critter { cursor: pointer; outline: none; }
.critter:focus-visible { filter: drop-shadow(0 0 4px var(--accent)); }
.peng .hopper { transform-box: view-box; transform-origin: 80px 170px; animation: sway 2.6s ease-in-out infinite; }
#scene-fantasy .peng .hopper { transform-origin: 88px 170px; }
@keyframes sway { 0%,100% { transform: rotate(-3deg); } 50% { transform: rotate(3deg); } }
.peng .flip-l, .peng .flip-r { transform-box: fill-box; transition: transform .2s; }
.peng .flip-l { transform-origin: 100% 0; }
.peng .flip-r { transform-origin: 0 0; }
#scene-fantasy .peng .flip-r { transform-origin: 0 100%; }
.peng .eyes { transform-box: fill-box; transform-origin: center; animation: blink 5s infinite; }
@keyframes blink { 0%,93%,100% { transform: scaleY(1); } 96% { transform: scaleY(.1); } }
.peng.hop .hopper { animation: hop .75s cubic-bezier(.3,.7,.4,1); }
@keyframes hop { 0% { transform: none; } 15% { transform: scale(1.06,.92); } 45% { transform: translateY(-22px) rotate(-4deg); }
  75% { transform: scale(1.05,.94); } 100% { transform: none; } }
.peng.hop .flip-l { animation: flapL .16s ease-in-out 5 alternate; }
.peng.hop .flip-r { animation: flapR .16s ease-in-out 5 alternate; }
@keyframes flapL { to { transform: rotate(40deg); } }
@keyframes flapR { to { transform: rotate(-40deg); } }
.peng.wave .flip-r { animation: wave .3s ease-in-out 6 alternate; }
@keyframes wave { from { transform: rotate(-20deg); } to { transform: rotate(-60deg); } }
[data-critter="puff"] .bob { transform-box: fill-box; transform-origin: 50% 100%; }
[data-critter="puff"].nod .bob { animation: nod .4s ease-in-out 3; }
@keyframes nod { 50% { transform: rotate(6deg) translateY(2px); } }
[data-critter="puff"] .blower { opacity: 0; transition: opacity .15s; }
[data-critter="puff"].toot .blower { opacity: 1; }
[data-critter="puff"] .tube { transform-box: fill-box; transform-origin: 0 50%; }
[data-critter="puff"].toot .tube { animation: unroll 1.4s ease-out; }
@keyframes unroll { 0% { transform: scaleX(.05); } 22% { transform: scaleX(1.08); } 32% { transform: scaleX(1); }
  52% { transform: scaleX(.9); } 62% { transform: scaleX(1.06); } 80% { transform: scaleX(1); } 100% { transform: scaleX(.05); } }
.fant .tail { transform-box: fill-box; transform-origin: 0 100%; animation: fan 1.8s ease-in-out infinite; }
@keyframes fan { 0%,100% { transform: rotate(0) scale(1); } 20% { transform: rotate(-12deg) scale(.82); } 35% { transform: rotate(4deg) scale(1.05); } }
.fant .flit { transform-box: fill-box; transform-origin: 50% 100%; animation: hopy 3.2s ease-in-out infinite; }
@keyframes hopy { 0%,70%,100% { transform: translateY(0); } 78% { transform: translateY(-5px) rotate(-3deg); } 86% { transform: translateY(0); } }
.fant.show .tail { animation: bigfan .2s ease-in-out 8 alternate; }
@keyframes bigfan { from { transform: rotate(-18deg) scale(.75); } to { transform: rotate(8deg) scale(1.12); } }
/* Poked, the fantail flutters off in a loop and comes back. */
.fant .wing { transform-box: fill-box; transform-origin: 20% 10%; }
.fant.show .flit { animation: flyabout 1.7s ease-in-out; }
#scene-field .fant.show .flit { animation: flyup 1.7s ease-in-out; }
@keyframes flyup { 0% { transform: none; } 25% { transform: translate(-8px, -50px) rotate(-6deg); }
  50% { transform: translate(-22px, -88px) rotate(4deg); } 75% { transform: translate(-10px, -45px) rotate(-3deg); } 100% { transform: none; } }
.fant.show .wing { animation: flapwing .1s ease-in-out 16 alternate; }
@keyframes flyabout { 0% { transform: none; } 20% { transform: translate(-40px, -24px) rotate(-8deg); }
  45% { transform: translate(-110px, -12px) rotate(-4deg); } 70% { transform: translate(-60px, 10px) rotate(6deg); } 100% { transform: none; } }
@keyframes flapwing { to { transform: rotate(-75deg); } }
.twinkle { transform-box: fill-box; transform-origin: center; animation: twinkle 2.4s ease-in-out infinite; }
@keyframes twinkle { 0%,100% { opacity: 1; transform: scale(1); } 50% { opacity: .35; transform: scale(.6) rotate(20deg); } }
.firefly { animation: firefly 3.4s ease-in-out infinite; }
@keyframes firefly { 0%,100% { opacity: .2; transform: translate(0, 0); } 50% { opacity: 1; transform: translate(5px, -7px); } }
.balloons .bal { transform-box: fill-box; transform-origin: 50% 100%; animation: balloon 3.4s ease-in-out infinite; }
.balloons .b2 { animation-delay: -1.1s; } .balloons .b3 { animation-delay: -2.2s; }
@keyframes balloon { 0%,100% { transform: translateY(0) rotate(-3deg); } 50% { transform: translateY(-5px) rotate(3deg); } }
.balloons.fly .bal { animation: flyaway 1.6s ease-in forwards; }
@keyframes flyaway { to { transform: translateY(-120px) rotate(10deg); opacity: 0; } }
.cake .flame { transform-box: fill-box; transform-origin: 50% 100%; animation: flicker .25s ease-in-out infinite alternate; }
.cake .flame:nth-child(2) { animation-delay: -.12s; }
@keyframes flicker { from { transform: scale(1, 1) rotate(-4deg); } to { transform: scale(.85, 1.15) rotate(4deg); } }
.cake.out .flames { opacity: 0; transition: opacity .2s; }
.cake:hover { filter: brightness(1.05); }
.fx { font: 700 14px var(--sans); transform-box: fill-box; transform-origin: center; animation: floatUp 1.3s ease-out forwards; }
@keyframes floatUp { from { opacity: 1; transform: translate(0, 0) scale(.6); }
  to { opacity: 0; transform: translate(var(--dx, 0px), -42px) scale(1.25); } }
.confetti { transform-box: fill-box; animation: confetti 1.1s cubic-bezier(.2,.6,.4,1) forwards; }
@keyframes confetti { to { opacity: 0; transform: translate(var(--dx), var(--dy)) rotate(var(--rot)); } }
.style-toggle { position: absolute; top: 6px; right: 8px; z-index: 2; display: flex; background: rgba(20,25,28,.12);
  border-radius: 6px; padding: 2px; }
.style-toggle button { border: 0; background: none; font-family: var(--mono); font-size: 10px; letter-spacing: .06em;
  text-transform: uppercase; color: #7A6F55; padding: 3px 8px; border-radius: 4px; }
.style-toggle button.on { background: #fff; color: #1B2333; box-shadow: 0 1px 3px rgba(0,0,0,.15); }
.intro-art[hidden] { display: none; }
.plate[data-scene="fantasy"] { background: #120F30; }
.plate[data-scene="fantasy"] .plate-label, .plate[data-scene="fantasy"] .style-toggle button { color: #B8B0E8; }
.plate[data-scene="fantasy"] .style-toggle { background: rgba(255,255,255,.1); }
.plate[data-scene="fantasy"] .style-toggle button.on { color: #1B2333; }
@media (max-width: 480px) { .plate-label { display: none; } }
@media (prefers-reduced-motion: reduce) { .bob, .tail, .flit, .peng .hopper, .peng .eyes, .bal, .flame, .twinkle, .firefly { animation: none !important; } }

/* ---------- Top bar ---------- */
.topbar { height: 64px; display: flex; align-items: center; gap: 18px; padding: 0 18px;
  border-bottom: 1px solid var(--line); background: var(--bg); }
.brand { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.logo { font-size: 28px; }
.title { font-family: var(--head); font-size: 24px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; line-height: 1; }
.subtitle { font-family: var(--mono); font-size: 11px; color: var(--ink-2); margin-top: 3px; }
.spotlights { display: flex; gap: 6px; overflow-x: auto; padding: 4px 0; margin-left: auto; scrollbar-width: none; }
.spot { white-space: nowrap; border: 1px solid var(--line); background: var(--panel); border-radius: 6px;
  padding: 7px 12px; font-family: var(--head); font-weight: 600; font-size: 15px; letter-spacing: .03em; }
.spot:hover { border-color: var(--ink-2); }
.spot.on { background: var(--accent); border-color: var(--accent); color: #fff; }

.spot { display: inline-flex; align-items: center; gap: 7px; }
.spot-ic { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; margin: -4px 0 -4px -6px;
  border: 1.5px solid rgba(255,255,255,.35); }
.spot-emoji { font-size: 15px; }

/* ---------- Bird picker ---------- */
.picker { position: relative; margin-bottom: 10px; }
.picker-btn { width: 100%; display: flex; align-items: center; gap: 9px; text-align: left; background: var(--panel-2);
  border: 1px solid var(--line); border-radius: 6px; padding: 6px 10px; font-size: 13.5px; font-weight: 500; }
.picker-btn:hover { border-color: var(--ink-2); }
.picker-btn .caret { margin-left: auto; color: var(--ink-2); }
.bicon { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; flex-shrink: 0; background: var(--panel); }
.bicon.none { display: grid; place-items: center; font-size: 15px; }
.picker-menu { position: absolute; z-index: 1200; left: 0; right: 0; top: calc(100% + 4px); background: var(--bg);
  border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); overflow: hidden; }
.picker-menu[hidden] { display: none; }
#picker-search { width: 100%; border: 0; border-bottom: 1px solid var(--line); background: var(--panel); color: var(--ink);
  padding: 10px 12px; font: inherit; outline: none; }
.picker-list { max-height: 380px; overflow-y: auto; padding: 4px; }
.pk-group { font-family: var(--head); font-size: 12px; text-transform: uppercase; letter-spacing: .12em; color: var(--khaki);
  padding: 10px 8px 4px; display: flex; align-items: center; gap: 7px; }
.pk-group::before { content: ""; width: 8px; height: 8px; border-radius: 2px; background: var(--c); }
.pk-item { width: 100%; display: flex; align-items: center; gap: 10px; border: 0; background: none; text-align: left;
  padding: 5px 8px; border-radius: 6px; }
.pk-item:hover, .pk-item.on { background: var(--panel-2); }
.pk-name { display: block; font-weight: 500; font-size: 13px; }
.pk-sub { display: block; font-size: 11px; color: var(--ink-2); font-style: italic; }
.pk-empty { padding: 14px; color: var(--ink-2); font-size: 13px; }

/* ---------- Layout ---------- */
.layout { display: flex; height: calc(100% - 64px); }
.sidebar { width: 340px; flex-shrink: 0; overflow-y: auto; border-right: 1px solid var(--line);
  padding: 16px 16px 8px; background: var(--panel); }
.sidebar section { margin-bottom: 22px; }
.sidebar h2 { font-size: 13px; margin-bottom: 10px; text-transform: uppercase; letter-spacing: .12em; color: var(--khaki); }
.count { font-family: var(--mono); font-weight: 400; color: var(--ink-2); letter-spacing: 0; }
.map-wrap { position: relative; flex: 1; min-width: 0; }
#map { position: absolute; inset: 0; background: #0E1215; }

/* Months */
.months { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; }
.months button { border: 1px solid var(--line); background: var(--panel-2); border-radius: 5px; padding: 7px 0;
  font-family: var(--mono); font-size: 11.5px; }
.months button.all { grid-column: span 6; font-family: var(--sans); font-size: 12px; }
.months button.on { background: var(--season); border-color: var(--season); color: #11160E; font-weight: 600; }
.months button.now:not(.on) { border-color: var(--season); color: var(--season); }

/* Group chips */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--panel-2);
  border-radius: 5px; padding: 6px 10px; font-size: 12px; font-weight: 500; }
.chip .dot { width: 9px; height: 9px; border-radius: 2px; background: var(--c); }
.chip.off { opacity: .4; }
.chip.off .dot { background: transparent; border: 2px solid var(--c); }
.species-filter { margin-top: 10px; display: flex; align-items: center; gap: 8px; background: var(--accent-soft);
  border: 1px solid rgba(242,106,27,.35); border-radius: 6px; padding: 8px 10px; font-size: 13px; }
.species-filter[hidden] { display: none; }
.species-filter button { margin-left: auto; border: 0; background: transparent; color: var(--accent); font-weight: 600; white-space: nowrap; }

/* Trip */
.trip { background: var(--panel-2); border: 1px dashed var(--line); border-radius: var(--radius); padding: 12px 14px; }
.trip h2 { margin-bottom: 6px; }
.trip .empty { color: var(--ink-2); font-size: 13px; margin: 0; line-height: 1.5; }
.trip ul { list-style: none; margin: 0 0 8px; padding: 0; }
.trip li { display: flex; align-items: center; gap: 8px; padding: 4px 0; font-size: 13px; }
.trip li a { color: var(--ink); text-decoration: none; cursor: pointer; }
.trip li a:hover { color: var(--accent); }
.trip li button { margin-left: auto; border: 0; background: none; color: var(--ink-2); font-size: 16px; line-height: 1; }
.trip .overlap { font-size: 13px; line-height: 1.5; color: var(--ink-2); }
.trip .overlap strong { color: var(--season); font-family: var(--mono); }

/* Location list */
.loc-list { list-style: none; margin: 0; padding: 0; }
.loc-list li { display: flex; gap: 10px; align-items: flex-start; padding: 9px 8px; border-radius: 6px; cursor: pointer;
  border-left: 2px solid transparent; }
.loc-list li:hover { background: var(--panel-2); }
.loc-list li.sel { background: var(--panel-2); border-left-color: var(--accent); }
.loc-list li.dim { opacity: .4; }
.loc-list .dot { width: 10px; height: 10px; border-radius: 2px; background: var(--c); margin-top: 4px; flex-shrink: 0; }
.loc-list .n { font-weight: 600; }
.loc-list .c { font-size: 12px; color: var(--ink-2); margin-top: 1px; }
.badge { display: inline-block; font-family: var(--mono); font-size: 9.5px; font-weight: 600; text-transform: uppercase;
  padding: 2px 5px; border-radius: 3px; background: var(--season-soft); color: var(--season); margin-left: 6px; vertical-align: 1px; }
.credits { font-size: 11px; color: var(--ink-2); line-height: 1.55; border-top: 1px solid var(--line); padding-top: 10px; }

/* ---------- Map pins & controls ---------- */
/* Lean dot pin: coloured core, crisp white ring, soft halo */
.pin { position: relative; width: 18px; height: 18px; display: grid; place-items: center; transition: transform .18s ease, opacity .2s; }
.pin i { width: 12px; height: 12px; border-radius: 50%; background: var(--c); border: 2px solid #fff;
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--c) 28%, transparent), 0 2px 6px rgba(0,0,0,.35); }
.pin.dim { opacity: .4; filter: saturate(.3); }
.pin.trip::after { content: "★"; position: absolute; top: -9px; right: -9px; font-size: 11px; color: #F2C94C;
  text-shadow: 0 0 3px #000, 0 0 2px #000; }
.pin.sel { transform: scale(1.35); z-index: 2; }
.pin.sel::before { content: ""; position: absolute; inset: -6px; border-radius: 50%; border: 2px solid var(--c);
  animation: ping 1.6s ease-out infinite; }
@keyframes ping { from { transform: scale(.6); opacity: 1; } to { transform: scale(1.8); opacity: 0; } }
.leaflet-marker-icon:hover .pin { transform: scale(1.3); }

/* Clusters: dark puck with a conic ring of group colours */
.clu { width: 100%; height: 100%; border-radius: 50%; background: var(--ring); padding: 3px;
  box-shadow: 0 3px 10px rgba(0,0,0,.4); transition: transform .15s; }
.clu span { width: 100%; height: 100%; border-radius: 50%; background: #14191C; color: #fff; display: grid; place-items: center;
  font-family: var(--mono); font-size: 12px; font-weight: 600; }
.leaflet-marker-icon:hover .clu { transform: scale(1.1); }
.leaflet-tooltip.tip { font-family: var(--head); font-size: 15px; font-weight: 600; letter-spacing: .02em; color: var(--ink);
  background: var(--bg); border: 1px solid var(--line); border-radius: 5px; box-shadow: var(--shadow); }
.leaflet-tooltip-top.tip::before { border-top-color: var(--bg); }
.leaflet-bar a { background: var(--bg); color: var(--ink); border-color: var(--line); }
.leaflet-bar a:hover { background: var(--panel-2); color: var(--ink); }
.leaflet-control-layers { background: var(--bg); color: var(--ink); border: 1px solid var(--line) !important; border-radius: 6px; }
.leaflet-control-layers-expanded { padding: 8px 12px; font-family: var(--sans); }

.legend { position: absolute; left: 12px; bottom: 22px; z-index: 500; width: 236px; background: rgba(20, 25, 28, .92);
  border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); font-size: 12px; backdrop-filter: blur(6px); }
.legend button { border: 0; background: none; text-align: left; }
.lg-head { width: 100%; display: flex; align-items: center; padding: 8px 12px; font-family: var(--head); font-size: 13px;
  font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--khaki); }
.lg-head .caret { margin-left: auto; color: var(--ink-2); }
.lg-rows { padding: 0 6px 4px; }
.lg-row { width: 100%; display: flex; align-items: center; gap: 8px; padding: 3px 6px; border-radius: 6px; }
.lg-row:hover { background: var(--panel-2); }
.lg-row.off { opacity: .38; }
.lg-dot { width: 4px; height: 22px; border-radius: 2px; background: var(--c); }
.lg-ic { width: 22px; height: 22px; border-radius: 50%; object-fit: cover; border: 1.5px solid var(--c); }
.lg-label { flex: 1; }
.lg-n { font-family: var(--mono); font-size: 11px; color: var(--ink-2); }
.lg-key { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 10px; padding: 8px 12px 10px; border-top: 1px solid var(--line);
  color: var(--ink-2); font-size: 11px; }
.lg-key > span { display: flex; align-items: center; gap: 6px; }
.lg-key .pin { width: 16px; height: 16px; }
.lg-key .pin i { width: 9px; height: 9px; background: #98A3A6; box-shadow: none; }
.lg-key .pin.trip::after { top: -7px; right: -7px; font-size: 9px; }
.clu.mini { width: 18px; height: 18px; padding: 2px; box-shadow: none; }
.clu.mini span { font-size: 8px; }

/* Continents */
.cont { border-bottom: 1px solid var(--line); }
.cont summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; padding: 9px 4px;
  font-family: var(--head); font-size: 16px; font-weight: 600; letter-spacing: .03em; }
.cont summary::-webkit-details-marker { display: none; }
.cont summary::after { content: "▸"; margin-left: 6px; color: var(--ink-2); transition: transform .15s; }
.cont[open] summary::after { transform: rotate(90deg); }
.cont summary:hover { color: var(--accent); }
.cont-ic { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; border: 1.5px solid var(--line); }
.cont[open] .cont-ic { border-color: var(--accent); }
.cont-shape { width: 38px; height: 28px; flex-shrink: 0; border-radius: 5px; box-shadow: inset 0 0 0 1px var(--line); }
.cs-sea { fill: #1E2A33; }
.cs-other { fill: #3A464D; }
.cs-mine { fill: var(--khaki); stroke: var(--khaki); stroke-width: .3; }
.cont[open] .cs-mine, .cont summary:hover .cs-mine { fill: var(--accent); stroke: var(--accent); }
.spot-sep { width: 1px; align-self: stretch; margin: 4px 4px; background: var(--line); flex-shrink: 0; }
.cont-n { margin-left: auto; font-family: var(--mono); font-size: 11px; color: var(--ink-2); background: var(--panel-2);
  padding: 1px 7px; border-radius: 10px; }
.cont .loc-list { padding-bottom: 6px; }
.sidebar .empty { color: var(--ink-2); font-size: 13px; }

/* ---------- Detail panel ---------- */
.detail { position: absolute; top: 12px; right: 12px; bottom: 12px; width: 440px; max-width: calc(100% - 24px);
  z-index: 800; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); overflow-y: auto; }
.hero { position: relative; height: 230px; background: var(--panel-2) center/cover no-repeat; border-radius: 12px 12px 0 0; }
.hero::after { content: ""; position: absolute; inset: 0; border-radius: inherit;
  background: linear-gradient(to top, rgba(14, 18, 21, .92), transparent 60%); }
.hero-text { position: absolute; left: 18px; right: 64px; bottom: 14px; color: #fff; z-index: 1; }
.hero-text h3 { font-size: 30px; line-height: 1; text-transform: uppercase; }
.hero-text .where { font-size: 13px; color: var(--khaki); margin-top: 5px; }
.hero-text .coords { font-family: var(--mono); font-size: 11px; color: var(--ink-2); margin-top: 2px; }
.icon-btn { position: absolute; z-index: 2; width: 36px; height: 36px; border-radius: 6px; border: 1px solid rgba(255,255,255,.2);
  background: rgba(20,25,28,.75); color: #fff; font-size: 17px; display: grid; place-items: center; backdrop-filter: blur(4px); }
.close-btn { top: 12px; right: 12px; }
.star-btn { bottom: 14px; right: 14px; }
.star-btn.on { background: #F2C94C; color: #14191C; border-color: #F2C94C; }
.detail-body { padding: 16px 18px 22px; }
.detail-body > p { line-height: 1.6; margin: 0 0 14px; color: #D3D1CA; }
.detail h4 { font-size: 13px; text-transform: uppercase; letter-spacing: .12em; color: var(--khaki); margin: 20px 0 9px; }
.detail h4 .mono { font-family: var(--mono); letter-spacing: 0; color: var(--accent); text-transform: none; }
.info-row { display: flex; gap: 10px; background: var(--panel-2); border-left: 3px solid var(--accent); border-radius: 4px;
  padding: 10px 12px; margin-bottom: 8px; line-height: 1.5; color: #D3D1CA; }
.info-row .ic { font-size: 17px; }

.mbar { display: grid; grid-template-columns: repeat(12, 1fr); gap: 2px; }
.mbar span { font-family: var(--mono); font-size: 9.5px; text-align: center; padding: 3px 0; border-radius: 2px;
  background: #2A3439; color: #5F6B70; font-weight: 600; }
.mbar span.in { background: var(--season); color: #11160E; }
.mbar span.pick { outline: 2px solid #fff; outline-offset: 1px; }
.mbar.best span.in { background: var(--accent); color: #fff; }

.bird { display: flex; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.bird:first-of-type { border-top: 0; }
.bird .ph { width: 92px; height: 92px; flex-shrink: 0; border-radius: 6px; background: var(--panel-2) center/cover no-repeat;
  display: grid; place-items: center; font-size: 28px; color: var(--ink-2); }
.bird .bi { flex: 1; min-width: 0; }
.bird .bn { font-family: var(--head); font-weight: 700; font-size: 19px; letter-spacing: .02em; }
.bird .bn a { color: var(--ink); text-decoration: none; cursor: pointer; border-bottom: 1px dashed var(--ink-2); }
.bird .bn a:hover { color: var(--accent); border-color: var(--accent); }
.bird .bl { font-size: 12px; color: var(--ink-2); font-style: italic; margin: 2px 0 7px; }
.bird .bl .maori { font-style: normal; color: var(--season); font-weight: 600; }
.bird .local { font-size: 12.5px; margin: 7px 0 0; line-height: 1.5; color: var(--ink); }
.bird .gen { font-size: 12.5px; margin: 4px 0 0; line-height: 1.5; color: var(--ink-2); }
.bird.focus { background: var(--accent-soft); margin: 0 -10px; padding: 12px 10px; border-radius: 8px; border-top-color: transparent; }
.facts { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.fact { font-family: var(--mono); font-size: 10.5px; padding: 2px 6px; border-radius: 3px; background: var(--panel-2); color: var(--ink-2); }
.iucn { color: #11160E; font-weight: 600; }
.iucn-LC { background: #8DB85F; } .iucn-NT { background: #C9D36A; } .iucn-VU { background: #F2C94C; }
.iucn-EN { background: #F28C3A; } .iucn-CR, .iucn-EW { background: #E5484D; color: #fff; } .iucn-DD { background: #98A3A6; }
.listen { font-family: var(--mono); font-size: 10.5px; font-weight: 600; padding: 2px 8px; border-radius: 3px;
  border: 1px solid var(--accent); background: transparent; color: var(--accent); }
.listen:hover, .listen.on { background: var(--accent); color: #fff; }
.clip { font-family: var(--mono); font-size: 10.5px; padding: 2px 6px; border-radius: 3px; border: 1px solid var(--line);
  background: transparent; color: var(--ink-2); }
.clip:hover, .clip.on { border-color: var(--season); color: var(--season); }
a.fact.link { color: var(--season); text-decoration: none; }
a.fact.link:hover { background: var(--season-soft); }
.mm-strip { display: flex; gap: 4px; margin-top: 7px; }
.mm-strip img { width: 44px; height: 44px; border-radius: 4px; object-fit: cover; }
.detail h4 .sub { font-family: var(--sans); font-size: 10.5px; letter-spacing: 0; text-transform: none; color: var(--ink-2); font-weight: 400; margin-left: 6px; }
.nearby { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 6px; }
.nearby .empty { color: var(--ink-2); font-size: 12px; }
.nb { display: flex; align-items: center; gap: 7px; background: var(--panel-2); border-radius: 6px; padding: 4px 7px 4px 4px;
  color: var(--ink); text-decoration: none; font-size: 11.5px; line-height: 1.2; }
.nb:hover { outline: 1px solid var(--season); }
.nb img { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.nb span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.nb em { font-style: normal; font-family: var(--mono); font-size: 10px; color: var(--ink-2); }
.inat-link { display: inline-block; margin-top: 8px; font-size: 12px; color: var(--season); }
.collins { font-size: 11.5px; color: var(--khaki); margin-top: 6px; }
.credits a { color: inherit; }
.photo-credit:empty { display: none; }
.photo-credit { font-size: 11px; color: var(--ink-2); margin-top: 14px; }
.photo-credit a { color: inherit; }

/* ---------- Mobile ---------- */
@media (max-width: 820px) {
  .topbar { height: auto; flex-wrap: wrap; padding: 10px 16px; gap: 8px; }
  .spotlights { margin-left: 0; width: 100%; }
  .layout { flex-direction: column-reverse; height: auto; }
  .map-wrap { height: 62vh; flex: none; }
  .sidebar { width: 100%; border-right: 0; overflow: visible; }
  .detail { position: fixed; inset: auto 0 0 0; top: 12vh; width: 100%; max-width: none; border-radius: 12px 12px 0 0; z-index: 1100; }
  .legend { display: none; }
}

[data-critter="puff"] .bob { animation: bobby 2.6s ease-in-out infinite; }
@keyframes bobby { 0%,100% { transform: rotate(0); } 40% { transform: rotate(-3deg); } 60% { transform: rotate(2deg); } }

/* Shortcut bar: no stray scrollbar line */
.spotlights::-webkit-scrollbar { display: none; }

/* Group-by switch */
.groupby { display: flex; align-items: center; gap: 8px; margin: 2px 0 10px; font-size: 12px; color: var(--ink-2); }
.seg { display: flex; background: var(--panel-2); border: 1px solid var(--line); border-radius: 6px; padding: 2px; margin-left: auto; }
.seg button { border: 0; background: none; font-size: 12px; padding: 4px 9px; border-radius: 4px; color: var(--ink-2); }
.seg button.on { background: var(--accent); color: #fff; font-weight: 600; }
.chip { max-width: 100%; }
.lg-label em { display: block; font-style: italic; font-size: 10px; color: var(--ink-2); }
.lg-rows { max-height: calc(100vh - 430px); min-height: 120px; overflow-y: auto; }
.legend { max-width: 260px; }

/* Dark map chrome */
.leaflet-container { background: #0E1215; font-family: var(--sans); }
.leaflet-control-attribution { background: rgba(14,18,21,.8) !important; color: var(--ink-2); }
.leaflet-control-attribution a { color: var(--khaki); }
.home-btn { display: grid !important; place-items: center; }
.leaflet-control-layers-toggle { filter: invert(1) brightness(1.4); }
.leaflet-control-layers label { color: var(--ink); }
.leaflet-control-layers-separator { border-top-color: var(--line); }

/* Bird browser: Order › Family › Species */
.tax { background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; margin-bottom: 10px; }
.tax-current { display: flex; align-items: center; gap: 7px; padding: 8px 10px; border-bottom: 1px solid var(--line); font-size: 13px; flex-wrap: wrap; }
.tx-show { font-family: var(--mono); font-size: 10px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-2); }
.tx-what b { color: var(--accent); font-weight: 600; }
.bicon.sm { width: 22px; height: 22px; }
.tx-clear { margin-left: auto; border: 0; background: none; color: var(--accent); font-weight: 600; font-size: 12px; }
#tax-search { width: 100%; border: 0; border-bottom: 1px solid var(--line); background: var(--panel); color: var(--ink); padding: 8px 10px; font: inherit; font-size: 13px; outline: none; }
.tax-tree { max-height: 360px; overflow-y: auto; padding: 4px; }
.tax-tree details > summary { list-style: none; display: flex; align-items: center; gap: 6px; cursor: pointer; padding: 5px 6px; border-radius: 5px; }
.tax-tree details > summary::-webkit-details-marker { display: none; }
.tax-tree details > summary::before { content: "▸"; color: var(--ink-2); font-size: 10px; width: 10px; transition: transform .15s; }
.tax-tree details[open] > summary::before { transform: rotate(90deg); }
.tax-tree summary:hover { background: var(--panel); }
.tx-order > summary { font-weight: 600; font-size: 13.5px; }
.tx-fam { margin-left: 14px; }
.tx-fam > summary { font-size: 13px; color: #D3D1CA; }
.tx-pick em { display: block; font-size: 10px; font-weight: 400; font-style: italic; color: var(--ink-2); }
.tx-pick:hover { color: var(--accent); }
.tx-pick.on { color: var(--accent); }
.tx-n { margin-left: auto; font-family: var(--mono); font-size: 10.5px; color: var(--ink-2); }
.tx-bird { width: calc(100% - 22px); margin-left: 22px; display: flex; align-items: center; gap: 9px; border: 0; background: none; text-align: left; padding: 4px 6px; border-radius: 6px; }
.tx-bird:hover, .tx-bird.on { background: var(--panel); }
.tx-bird.on .pk-name { color: var(--accent); }
.tx-bird .bicon { width: 26px; height: 26px; }
.spot.gift { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.tx-dot { width: 4px; height: 22px; border-radius: 2px; background: var(--c); flex-shrink: 0; }

/* Places / Countries toggle and the country colour scale */
.view-toggle { position: absolute; top: 12px; left: 58px; z-index: 700; display: flex;
  background: rgba(20,25,28,.92); border: 1px solid var(--line); border-radius: 8px; padding: 3px; box-shadow: var(--shadow); }
.view-toggle button { border: 0; background: none; padding: 6px 14px; border-radius: 6px; font-family: var(--head); font-weight: 600;
  font-size: 15px; letter-spacing: .03em; color: var(--ink-2); }
.view-toggle button.on { background: var(--accent); color: #fff; }
.country-scale { position: absolute; left: 12px; bottom: 22px; z-index: 500; background: rgba(20,25,28,.92); border: 1px solid var(--line);
  border-radius: 8px; padding: 8px 12px; display: flex; flex-direction: column; gap: 4px; font-size: 12px; box-shadow: var(--shadow); }
.country-scale[hidden], .legend[hidden] { display: none; }
.country-scale .cs-title { font-family: var(--head); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--khaki); margin-bottom: 2px; }
.country-scale span { display: flex; align-items: center; gap: 8px; }
.country-scale i { width: 14px; height: 10px; border-radius: 2px; }
/* Phones: one slim row instead of a tall box over the map */
@media (max-width: 820px) {
  .country-scale { flex-direction: row; flex-wrap: wrap; right: 12px; bottom: 46px; gap: 3px 10px; padding: 5px 8px; font-size: 11px; }
  .country-scale .cs-title { width: 100%; font-size: 10px; margin-bottom: 0; }
  .country-scale span { gap: 4px; }
}
/* iOS Safari zooms into inputs under 16px */
@media (max-width: 820px) { #tax-search, #country-search { font-size: 16px; } }

/* Country panel */
.country-head { position: relative; padding: 20px 18px 14px; border-bottom: 1px solid var(--line);
  background: linear-gradient(160deg, #26323A, var(--panel)); border-radius: 12px 12px 0 0; }
.country-head .flag { font-size: 34px; line-height: 1; }
.country-head h3 { font-size: 30px; text-transform: uppercase; margin-top: 6px; }
.country-stats { color: var(--ink-2); font-size: 13px; margin-top: 4px; }
.country-stats b { color: var(--accent); font-family: var(--mono); }
.hotspots { margin: 0; padding-left: 22px; font-size: 13px; }
.hotspots li { padding: 4px 0; cursor: pointer; }
.hotspots li span:hover { color: var(--accent); }
.hotspots li em { font-style: normal; font-family: var(--mono); font-size: 11px; color: var(--ink-2); margin-left: 6px; }
.country-tools { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.country-tools input[type=search] { background: var(--panel-2); border: 1px solid var(--line); border-radius: 6px; color: var(--ink); padding: 7px 10px; font: inherit; font-size: 13px; outline: none; }
.country-tools label { font-size: 12px; color: var(--ink-2); display: flex; align-items: center; gap: 6px; }
.country-tree { max-height: none; background: var(--panel-2); border-radius: 8px; }
.tx-name em { display: block; font-size: 10px; font-weight: 400; font-style: italic; color: var(--ink-2); }
.c-bird .bicon { display: grid; place-items: center; font-size: 13px; }
.star { color: #F2C94C; }
.c-more { margin: 2px 6px 10px 30px; padding: 10px; background: var(--panel); border-radius: 8px; }
.c-photo { width: 100%; max-height: 190px; object-fit: cover; border-radius: 6px; margin-bottom: 8px; }
.bars { display: grid; grid-template-columns: repeat(12, 1fr); gap: 3px; height: 70px; align-items: end; }
.bars span { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; }
.bars i { display: block; width: 100%; background: var(--season); border-radius: 2px 2px 0 0; }
.bars b { font-family: var(--mono); font-size: 9px; color: var(--ink-2); font-weight: 400; margin-top: 2px; }
.best { font-size: 12px; color: var(--ink-2); margin-top: 6px; }
.best b { color: var(--season); }
.c-links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; font-size: 12px; }
.c-links a { color: var(--season); }
.c-links button { border: 1px solid var(--accent); background: none; color: var(--accent); border-radius: 4px; padding: 2px 8px; font-size: 12px; }

.crumb-back { border: 0; background: none; color: var(--khaki); font-size: 13px; padding: 0; margin-bottom: 2px; }
.crumb-back:hover { color: var(--accent); }
.sub-rank { display: flex; flex-direction: column; gap: 3px; max-height: 260px; overflow-y: auto; }
.sub-rank button { position: relative; display: flex; align-items: center; gap: 8px; border: 0; background: var(--panel-2); border-radius: 4px;
  padding: 5px 8px; font-size: 12.5px; text-align: left; overflow: hidden; }
.sub-rank button i { position: absolute; left: 0; top: 0; bottom: 0; background: rgba(107,163,104,.22); }
.sub-rank button span, .sub-rank button em { position: relative; }
.sub-rank button em { margin-left: auto; font-style: normal; font-family: var(--mono); font-size: 11px; color: var(--ink-2); }
.sub-rank button:hover { outline: 1px solid var(--accent); }
.sub-loading { font-size: 12px; color: var(--ink-2); margin: 10px 0; }
.tools-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.fold { margin-left: auto; display: flex; gap: 4px; }
.fold button { border: 1px solid var(--line); background: var(--panel-2); color: var(--ink-2); border-radius: 4px; padding: 2px 8px; font-size: 11px; }
.fold button:hover { color: var(--accent); border-color: var(--accent); }

/* Password lock screen (site-lock.js, only in the built site) */
.site-lock { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.lock-card { width: 100%; max-width: 340px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: var(--shadow); padding: 28px 24px; text-align: center; display: flex; flex-direction: column; gap: 12px; }
.lock-bird { font-size: 44px; line-height: 1; }
.lock-card h1 { margin: 0; font-family: var(--head); font-size: 30px; letter-spacing: .04em; text-transform: uppercase; color: var(--ink); }
.lock-card p { margin: 0; color: var(--ink-2); font-size: 14px; }
.lock-card input[type=password] { font: inherit; font-size: 16px; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--panel-2); color: var(--ink); outline: none; }
.lock-card input[type=password]:focus { border-color: var(--accent); }
.lock-remember { display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 13px; color: var(--ink-2); }
.lock-card button { font-family: var(--head); font-weight: 600; font-size: 17px; letter-spacing: .05em; text-transform: uppercase;
  padding: 10px; border: 0; border-radius: 8px; background: var(--accent); color: #fff; cursor: pointer; }
.lock-card button:disabled { opacity: .6; cursor: default; }
.lock-card .lock-error { color: #F28B82; min-height: 1em; }
.hotspots li.on span { color: var(--accent); font-weight: 600; }
.hotspots li.on::marker { color: var(--accent); }
.hs-banner { display: flex; align-items: flex-start; gap: 10px; margin: 12px 0 4px; padding: 10px 12px; border-radius: 8px;
  background: var(--accent-soft); border: 1px solid rgba(242,106,27,.35); font-size: 12.5px; }
.hs-banner b { display: block; color: var(--ink); margin-bottom: 2px; }
.hs-banner span { color: var(--ink-2); }
.hs-banner a { color: var(--accent); }
.hs-banner button { margin-left: auto; flex-shrink: 0; border: 1px solid var(--accent); background: none; color: var(--accent);
  border-radius: 5px; padding: 3px 8px; font-size: 12px; }
