:root {
  --forest: #173f2a;
  --forest-2: #245b3c;
  --forest-3: #0e2f1d;
  --sage: #cfe0b6;
  --sage-soft: #edf5d5;
  --cream: #fffaf0;
  --yellow: #f4d36a;
  --ink: #173024;
  --muted: #647267;
  --card: #ffffff;
  --line: #dce8d6;
  --danger: #a4382f;
  --shadow: 0 16px 40px rgba(23, 63, 42, .11);
}
[hidden] { display: none !important; }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; background: var(--sage-soft); color: var(--ink); }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid var(--yellow); outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.topbar { position: sticky; top: 0; z-index: 30; background: rgba(255, 250, 240, .94); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.nav-wrap { width: min(1180px, 100%); min-height: 72px; margin: auto; padding: 10px 24px; display: flex; align-items: center; gap: 24px; }
.brand { border: 0; background: transparent; display: flex; align-items: center; gap: 10px; padding: 0; color: var(--forest); font-weight: 950; letter-spacing: .05em; cursor: pointer; }
.brand-mark { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 14px; color: var(--yellow); background: var(--yellow); font-size: .8rem; letter-spacing: -.03em; }
.brand-mark img { width: 34px; height: 34px; display: block; border-radius: 10px; object-fit: cover; }
.nav-tabs { margin-left: auto; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.nav-tabs::-webkit-scrollbar { display: none; }
.nav-tab { border: 0; border-radius: 12px; padding: 10px 13px; background: transparent; color: var(--forest); font-weight: 800; cursor: pointer; }
.nav-tab:hover, .nav-tab.active { background: var(--sage); }

.view { display: none; min-height: calc(100vh - 72px); }
.view.active { display: block; }
.hero { width: min(1180px, 100%); margin: 0 auto; padding: 68px 24px 54px; display: grid; grid-template-columns: 1fr auto; gap: 40px; align-items: end; }
.hero h1, .section-head h2 { margin: 12px 0 14px; font-size: clamp(2.6rem, 6vw, 5.5rem); line-height: .96; letter-spacing: -.055em; color: var(--forest); max-width: 820px; }
.hero p, .section-head p { margin: 0; max-width: 700px; font-size: 1.08rem; line-height: 1.65; color: var(--muted); }
.eyebrow { display: inline-flex; border-radius: 999px; padding: 7px 11px; background: var(--forest); color: white; font-size: .78rem; font-weight: 900; letter-spacing: .09em; text-transform: uppercase; }
.eyebrow.dark { background: var(--yellow); color: var(--forest); }
.hero-stat { width: 190px; min-height: 190px; display: grid; align-content: center; justify-items: center; padding: 22px; border-radius: 40px 40px 40px 12px; background: var(--yellow); color: var(--forest); box-shadow: var(--shadow); transform: rotate(1.5deg); }
.hero-stat strong { font-size: 3.7rem; letter-spacing: -.06em; line-height: 1; }
.hero-stat span { margin-top: 7px; font-weight: 850; }

.bird-of-day { width: min(1180px, calc(100% - 48px)); margin: 0 auto 34px; display: grid; grid-template-columns: minmax(300px, .9fr) 1.1fr; min-height: 430px; border-radius: 34px; overflow: hidden; background: var(--forest); color: white; box-shadow: var(--shadow); }
.daily-photo { min-height: 430px; background: var(--forest-3); overflow: hidden; }
.daily-photo-img { width: 100%; height: 100%; min-height: 430px; display: block; object-fit: cover; object-position: center 28%; }
.daily-copy { padding: clamp(28px, 5vw, 56px); display: flex; flex-direction: column; justify-content: center; }
.daily-kicker { display: flex; align-items: center; justify-content: space-between; gap: 18px; color: var(--sage); font-size: .78rem; font-weight: 900; letter-spacing: .09em; text-transform: uppercase; }
.daily-kicker span { color: var(--yellow); }
.daily-copy h2 { margin: 18px 0 5px; color: white; font-size: clamp(2.4rem, 5vw, 4.6rem); line-height: .95; letter-spacing: -.05em; }
.daily-copy .scientific { color: var(--sage); }
.daily-description { margin: 19px 0; color: #edf5e8; line-height: 1.65; }
.daily-notes { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 22px; }
.daily-notes div { padding: 12px; border: 1px solid rgba(255,255,255,.15); border-radius: 13px; background: rgba(255,255,255,.06); }
.daily-notes div:last-child { grid-column: 1 / -1; }
.daily-notes strong, .daily-notes span { display: block; }
.daily-notes strong { margin-bottom: 4px; color: var(--yellow); font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; }
.daily-notes span { color: #eef5ef; font-size: .84rem; line-height: 1.45; }
.daily-copy .primary { width: fit-content; background: var(--yellow); color: var(--forest); }
.daily-copy .primary:hover { background: white; }

.workspace { width: min(1180px, calc(100% - 48px)); margin: 0 auto 72px; }
.toolbar { display: grid; grid-template-columns: minmax(260px, 1fr) 230px auto auto; gap: 12px; align-items: center; margin-bottom: 24px; }
.random-bird-button { min-height: 50px; padding: 10px 18px; border: 0; border-radius: 15px; background: var(--yellow); color: var(--forest); font: inherit; font-weight: 800; white-space: nowrap; cursor: pointer; }
.random-bird-button:hover { filter: brightness(.96); }
.random-bird-button:focus-visible { outline: 3px solid var(--forest); outline-offset: 2px; }
.search-box { position: relative; display: block; }
.search-box > span[aria-hidden] { position: absolute; top: 12px; left: 16px; z-index: 1; font-size: 1.3rem; color: var(--forest); }
.search-box input, .select-wrap select { width: 100%; min-height: 50px; border: 2px solid transparent; border-radius: 15px; background: white; color: var(--ink); box-shadow: 0 5px 18px rgba(23,63,42,.05); }
.search-box input { padding: 13px 16px 13px 46px; }
.select-wrap select { padding: 12px 40px 12px 15px; cursor: pointer; }
.search-box input:focus, .select-wrap select:focus { border-color: var(--forest-2); outline: none; }
.result-count { min-width: 82px; text-align: right; color: var(--muted); font-weight: 800; }
.bird-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.bird-card { border: 1px solid var(--line); border-radius: 22px; background: var(--card); overflow: hidden; padding: 0; text-align: left; color: inherit; box-shadow: 0 8px 26px rgba(23,63,42,.06); cursor: pointer; transition: transform .18s ease, box-shadow .18s ease; }
.bird-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.card-top { position: relative; min-height: 210px; padding: 14px; background: linear-gradient(145deg, var(--forest), var(--forest-2)); display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; overflow: hidden; }
.card-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 30%; }
.photo-missing { display: grid; place-items: center; padding: 20px; color: rgba(255,255,255,.75); font-size: .82rem; font-weight: 850; }
.card-top::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(4,18,10,.58), transparent 48%, rgba(4,18,10,.18)); pointer-events: none; }
.card-family, .card-sound { position: relative; z-index: 1; }
.card-family { display: inline-flex; max-width: 78%; padding: 6px 9px; border-radius: 999px; background: rgba(9,35,20,.72); color: white; font-size: .74rem; font-weight: 850; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; backdrop-filter: blur(5px); }
.card-sound { width: 31px; height: 31px; display: grid; place-items: center; border-radius: 50%; background: var(--yellow); color: var(--forest); font-weight: 950; }
.card-body { padding: 18px; }
.card-body h3 { margin: 0 0 5px; font-size: 1.22rem; letter-spacing: -.02em; }
.scientific { margin: 0; color: var(--muted); font-style: italic; }
.card-meta { margin-top: 15px; display: flex; gap: 7px; flex-wrap: wrap; }
.card-meta span { padding: 6px 8px; border-radius: 9px; background: #f3f6ef; color: #58705f; font-size: .75rem; font-weight: 760; }
.empty-state { border: 1px dashed #aac199; border-radius: 24px; padding: 48px 24px; text-align: center; color: var(--muted); }
.empty-state strong, .empty-state span { display: block; }
.empty-state strong { margin-bottom: 7px; color: var(--forest); font-size: 1.25rem; }
.load-more { display: block; margin: 28px auto 0; border: 2px solid var(--forest); border-radius: 14px; padding: 12px 20px; background: transparent; color: var(--forest); font-weight: 900; cursor: pointer; }
.load-more:hover { background: var(--forest); color: white; }

.section-head { width: min(1180px, 100%); margin: 0 auto; padding: 64px 24px 36px; display: flex; justify-content: space-between; align-items: end; gap: 28px; }
.section-head.compact h2, .section-head h2 { font-size: clamp(2.3rem, 5vw, 4.6rem); }
.region-workspace { max-width: 1180px; }
.region-controls { display: grid; grid-template-columns: minmax(230px, 340px) auto 1fr; gap: 12px; align-items: end; margin-bottom: 16px; }
.region-select-wrap > span { display: block; margin: 0 0 7px 3px; color: var(--forest); font-size: .78rem; font-weight: 900; letter-spacing: .05em; text-transform: uppercase; }
.location-button { min-height: 50px; border: 2px solid var(--forest); border-radius: 15px; padding: 10px 16px; background: transparent; color: var(--forest); font-weight: 900; cursor: pointer; }
.location-button:hover:not(:disabled) { background: var(--forest); color: white; }
.location-button:disabled { opacity: .6; cursor: wait; }
.location-note { align-self: center; color: var(--muted); font-size: .82rem; line-height: 1.4; }
.regional-map { width: 100%; margin-bottom: 28px; padding: 18px; overflow: hidden; border: 1px solid #bdd2b2; border-radius: 30px; background: linear-gradient(145deg, #dcefd5, #c7e1c2); box-shadow: inset 0 0 0 8px rgba(255,255,255,.2); }
.map-loading { min-height: 280px; display: grid; place-content: center; gap: 6px; color: var(--forest); text-align: center; font-weight: 900; }
.map-loading strong, .map-loading span { display: block; }
.map-loading span { margin-top: 6px; color: var(--muted); font-size: .84rem; font-weight: 700; }
.map-canvases { display: grid; grid-template-columns: 1.35fr .9fr; gap: 14px; }
.map-panel { min-width: 0; padding: 14px; border: 1px solid rgba(23,63,42,.14); border-radius: 20px; background: rgba(255,255,255,.74); }
.map-panel-head { display: flex; justify-content: space-between; align-items: baseline; gap: 14px; margin: 0 2px 8px; }
.map-panel-head h3 { margin: 0; color: var(--forest); font-size: 1rem; }
.map-panel-head span { color: var(--muted); font-size: .72rem; font-weight: 750; }
.map-panel svg { width: 100%; height: auto; display: block; border-radius: 14px; background: #eff7ed; }
.geo-shape { stroke: #fffaf0; stroke-width: 1.1; vector-effect: non-scaling-stroke; transition: opacity .15s ease, stroke-width .15s ease, filter .15s ease; }
.geo-region { cursor: pointer; }
.geo-region:hover, .geo-region:focus, .geo-region.active { filter: saturate(1.28) brightness(1.03); stroke: var(--forest); stroke-width: 2.4; outline: none; }
.map-label { fill: var(--forest); stroke: rgba(255,250,240,.92); stroke-width: 5px; paint-order: stroke; font-size: 16px; font-weight: 950; cursor: pointer; }
.map-label:hover, .map-label.active { fill: #7b4c00; }
.map-legend { display: flex; flex-wrap: wrap; gap: 7px; padding: 14px 2px 1px; }
.map-legend button { display: inline-flex; align-items: center; gap: 7px; border: 1px solid rgba(23,63,42,.16); border-radius: 999px; padding: 7px 10px; background: rgba(255,255,255,.82); color: var(--forest); font-size: .72rem; font-weight: 850; cursor: pointer; }
.map-legend button:hover, .map-legend button.active { border-color: var(--forest); background: white; box-shadow: 0 4px 12px rgba(23,63,42,.12); }
.map-legend i { width: 11px; height: 11px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(23,63,42,.2); }
.region-results-head { display: flex; justify-content: space-between; align-items: end; gap: 24px; margin: 0 0 20px; }
.region-results-head h3 { margin: 11px 0 7px; color: var(--forest); font-size: clamp(2rem, 4vw, 3.4rem); letter-spacing: -.045em; }
.region-results-head p { max-width: 720px; margin: 0; color: var(--muted); line-height: 1.55; }
.region-results-head > strong { padding: 12px 16px; border-radius: 14px; background: var(--yellow); color: var(--forest); white-space: nowrap; }
.mode-switch { display: flex; gap: 7px; padding: 6px; border-radius: 16px; background: white; border: 1px solid var(--line); box-shadow: 0 6px 20px rgba(23,63,42,.06); }
.mode-button { border: 0; border-radius: 11px; padding: 10px 13px; color: var(--forest); background: transparent; font-weight: 850; cursor: pointer; }
.mode-button.active { background: var(--forest); color: white; }
.mode-button:disabled { opacity: .45; cursor: not-allowed; }
.quiz-shell { width: min(800px, calc(100% - 48px)); margin: 0 auto 80px; border: 1px solid var(--line); border-radius: 28px; padding: 26px; background: white; box-shadow: var(--shadow); }
.quiz-filters { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; margin-bottom: 18px; padding: 16px; border-radius: 18px; background: var(--sage-soft); }
.quiz-filters label > span { display: block; margin: 0 0 6px 2px; color: var(--forest); font-size: .72rem; font-weight: 900; letter-spacing: .07em; text-transform: uppercase; }
.quiz-filters select { width: 100%; min-height: 45px; border: 1px solid var(--line); border-radius: 12px; padding: 9px 34px 9px 11px; background: white; color: var(--ink); }
.quiz-pool-count { grid-column: 1 / -1; color: var(--muted); font-size: .82rem; font-weight: 800; }
.quiz-options { display: grid; gap: 14px; margin: 0 0 18px; }
.quiz-style-picker { min-width: 0; margin: 0; padding: 0; border: 0; }
.quiz-style-picker legend, .quiz-size-controls label > span { margin: 0 0 7px 2px; color: var(--forest); font-size: .72rem; font-weight: 900; letter-spacing: .07em; text-transform: uppercase; }
.quiz-style-switch { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; padding: 6px; border: 1px solid var(--line); border-radius: 16px; background: var(--cream); }
.quiz-style-button { min-height: 44px; border: 0; border-radius: 11px; padding: 9px 10px; background: transparent; color: var(--forest); font-weight: 850; cursor: pointer; }
.quiz-style-button:hover { background: white; }
.quiz-style-button.active { background: var(--forest); color: white; box-shadow: 0 4px 12px rgba(23,63,42,.18); }
.quiz-size-controls { display: grid; grid-template-columns: minmax(155px, .38fr) 1fr; gap: 10px; align-items: end; }
.quiz-size-controls label > span { display: block; }
.quiz-size-controls input { width: 100%; min-height: 46px; border: 1px solid var(--line); border-radius: 12px; padding: 9px 12px; background: white; color: var(--ink); font: inherit; font-weight: 800; }
.all-birds-toggle { min-height: 46px; border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; background: white; color: var(--forest); font-weight: 850; cursor: pointer; }
.all-birds-toggle[aria-pressed="true"] { border-color: var(--forest); background: var(--yellow); }
.quiz-topline { display: flex; justify-content: space-between; gap: 20px; padding-bottom: 18px; color: var(--muted); font-size: .88rem; font-weight: 800; }
.quiz-status-actions { display: flex; align-items: center; gap: 12px; }
.quit-quiz { border: 1px solid #c96c63; border-radius: 10px; padding: 7px 10px; background: #fff5f3; color: #9f3e36; font: inherit; font-weight: 850; cursor: pointer; }
.quit-quiz:hover { background: #ffe8e4; }
.quiz-start, .quiz-finish { min-height: 380px; display: grid; align-content: center; justify-items: center; text-align: center; padding: 30px; }
.quiz-icon { width: 76px; height: 76px; display: grid; place-items: center; border-radius: 26px; background: var(--yellow); color: var(--forest); font-size: 2rem; font-weight: 950; transform: rotate(-3deg); }
.quiz-start h3, .quiz-finish h3 { margin: 24px 0 9px; font-size: 1.8rem; letter-spacing: -.03em; }
.quiz-start p, .quiz-finish p { max-width: 520px; margin: 0 0 22px; color: var(--muted); line-height: 1.6; }
.primary { border: 0; border-radius: 14px; padding: 13px 18px; background: var(--forest); color: white; font-weight: 900; cursor: pointer; }
.primary:hover { background: var(--forest-2); }
.primary:disabled { background: #a8b4aa; cursor: not-allowed; }
.clue-label { margin-top: 12px; color: var(--muted); font-size: .75rem; font-weight: 950; letter-spacing: .1em; }
.clue-card { margin: 10px 0 17px; padding: 24px; border-radius: 20px; background: var(--sage-soft); color: var(--forest-3); font-size: 1.12rem; line-height: 1.65; font-weight: 680; }
.quiz-photo { width: 100%; height: min(48vw, 390px); margin: 10px 0 14px; border-radius: 20px; object-fit: cover; object-position: center 30%; background: var(--forest); }
.quiz-clue { margin-top: 0; padding: 16px 20px; font-size: 1rem; }
.quiz-listen { display: inline-flex; margin-bottom: 17px; }
.reveal-photo-button { margin: 0 0 17px 8px; border: 1px solid var(--forest); border-radius: 12px; padding: 10px 13px; background: white; color: var(--forest); font-weight: 850; cursor: pointer; }
.reveal-photo-button:hover { background: var(--sage-soft); }
.answer-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.answer-grid[hidden], .typed-answer[hidden] { display: none !important; }
.answer { min-height: 60px; border: 2px solid var(--line); border-radius: 14px; padding: 12px 14px; background: white; color: var(--ink); text-align: left; font-weight: 790; cursor: pointer; }
.answer:hover:not(:disabled) { border-color: var(--forest-2); }
.answer.correct { border-color: #4f8b55; background: #eaf6e7; }
.answer.wrong { border-color: #b75147; background: #fff0ed; }
.answer:disabled { cursor: default; }
.typed-answer { margin-top: 3px; padding: 18px; border-radius: 18px; background: var(--sage-soft); }
.typed-answer > label { display: block; margin-bottom: 8px; color: var(--forest); font-size: .82rem; font-weight: 850; }
.typed-answer-row { display: grid; grid-template-columns: 1fr auto; gap: 9px; }
.typed-answer-row input { min-width: 0; border: 2px solid var(--line); border-radius: 13px; padding: 12px 14px; background: white; color: var(--ink); font: inherit; }
.typed-answer-row input:focus { outline: 3px solid rgba(244,211,94,.45); border-color: var(--forest); }
.text-button { margin: 9px 0 0; border: 0; padding: 5px 2px; background: transparent; color: var(--forest); font-weight: 850; text-decoration: underline; cursor: pointer; }
.quiz-match { min-height: 420px; }
.match-instructions { margin: 8px 0 16px; color: var(--muted); }
.match-board { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.match-column { display: grid; gap: 9px; align-content: start; }
.match-tile { min-height: 62px; border: 2px solid var(--line); border-radius: 15px; padding: 11px 13px; background: white; color: var(--ink); font-weight: 820; cursor: pointer; transition: border-color .15s, background .15s, opacity .15s; }
.match-tile:hover:not(:disabled), .match-tile.selected { border-color: var(--forest); background: var(--sage-soft); }
.match-tile.matched { border-color: #4f8b55; background: #eaf6e7; opacity: .55; }
.match-tile.wrong { border-color: #b75147; background: #fff0ed; }
.match-clue-tile { display: grid; grid-template-columns: 72px 1fr; gap: 11px; align-items: center; text-align: left; }
.match-clue-tile.call-only { grid-template-columns: 1fr; text-align: center; }
.match-clue-photo { width: 72px; height: 62px; border-radius: 10px; object-fit: cover; object-position: center 30%; background: var(--sage-soft); }
.show-whole-bird { object-fit: contain !important; object-position: center !important; background: var(--sage-soft); }
.match-play { border: 0; border-radius: 10px; padding: 9px 10px; background: var(--forest); color: white; font-weight: 850; cursor: pointer; }
.match-name-tile { text-align: left; }
.feedback { min-height: 28px; margin-top: 14px; font-weight: 850; }
.feedback.correct { color: #2c7040; }
.feedback.wrong { color: var(--danger); }
.next-button { display: block; margin: 12px 0 0 auto; }

.calls-workspace { max-width: 980px; }
.calls-search { margin-bottom: 18px; }
.call-list { display: grid; gap: 11px; }
.call-row { border: 1px solid var(--line); border-radius: 18px; padding: 18px; background: white; display: grid; grid-template-columns: minmax(190px, .7fr) 1fr auto; gap: 18px; align-items: center; }
.call-row h3 { margin: 0 0 4px; font-size: 1.05rem; }
.call-copy { color: var(--muted); line-height: 1.5; font-size: .9rem; }
.call-copy strong { color: var(--forest); }
.source-link { color: var(--forest); font-weight: 900; text-decoration: none; }
.source-link:hover { text-decoration: underline; }
.listen-button { display: inline-flex; justify-content: center; align-items: center; min-height: 42px; padding: 10px 12px; border: 0; border-radius: 12px; background: var(--forest); color: white; text-decoration: none; font-weight: 850; white-space: nowrap; cursor: pointer; }
.listen-button:hover:not(:disabled) { background: var(--forest-2); }
.listen-button:disabled { background: #a8b4aa; cursor: not-allowed; }
.detail-ebird { width: fit-content; margin-top: 14px; }

.taxonomy-workspace { max-width: 1040px; }
.taxonomy-summary { margin-bottom: 16px; border-radius: 20px; padding: 20px; background: var(--yellow); color: var(--forest); display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.taxonomy-summary strong, .taxonomy-summary span { display: block; }
.taxonomy-summary span { font-weight: 800; }
.taxonomy-tree { border: 1px solid var(--line); border-radius: 24px; padding: 0 22px; background: white; box-shadow: 0 8px 26px rgba(23,63,42,.06); }
.taxon-group { border-bottom: 1px solid var(--line); }
.taxon-group:last-child { border-bottom: 0; }
.taxon-group > summary { padding: 20px 2px; cursor: pointer; color: var(--forest); }
.taxon-group > summary span { display: inline-flex; align-items: baseline; gap: 10px; }
.taxon-group > summary strong { font-size: 1.2rem; }
.taxon-group > summary small { color: var(--muted); font-weight: 700; }
.taxon-orders { padding: 0 0 16px 14px; }
.taxon-order { border-left: 3px solid var(--yellow); padding-left: 16px; }
.taxon-order > summary { padding: 20px 2px; cursor: pointer; color: var(--forest); }
.taxon-order > summary span { display: inline-flex; align-items: baseline; gap: 10px; }
.taxon-order > summary strong { font-size: 1.15rem; }
.taxon-order > summary small { color: var(--muted); font-weight: 700; }
.taxon-families { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; padding: 0 0 20px; }
.taxon-family { border-radius: 16px; padding: 16px; background: #f4f8e7; }
.taxon-family h3 { margin: 0 0 9px; }
.taxon-species { display: grid; gap: 4px; }
.taxon-species button { border: 0; border-radius: 9px; padding: 8px 9px; background: transparent; color: var(--ink); display: flex; justify-content: space-between; gap: 12px; text-align: left; cursor: pointer; }
.taxon-species button:hover { background: white; }
.taxon-species em { color: var(--muted); font-size: .78rem; white-space: nowrap; }

.newsletter-masthead { width: min(1180px, calc(100% - 48px)); margin: 46px auto 24px; border-top: 9px solid var(--forest); border-bottom: 2px solid var(--forest); padding: 24px 0 20px; display: flex; align-items: end; justify-content: space-between; gap: 28px; }
.newsletter-volume { color: var(--muted); font-size: .78rem; font-weight: 900; letter-spacing: .09em; text-transform: uppercase; }
.newsletter-masthead h2 { margin: 7px 0 4px; color: var(--forest); font-family: Georgia, 'Times New Roman', serif; font-size: clamp(3rem, 7vw, 6rem); line-height: .9; letter-spacing: -.055em; }
.newsletter-masthead p { margin: 12px 0 0; color: var(--muted); font-weight: 800; }
.newsletter-clock { min-width: 190px; border-radius: 50% 50% 18px 50%; padding: 24px; background: var(--yellow); color: var(--forest); text-align: center; transform: rotate(2deg); }
.newsletter-clock span, .newsletter-clock strong { display: block; }
.newsletter-clock span { margin-bottom: 5px; font-size: .7rem; font-weight: 950; letter-spacing: .08em; text-transform: uppercase; }
.newsletter-clock strong { font-family: Georgia, 'Times New Roman', serif; font-size: 1.8rem; line-height: .9; }
.newsletter-layout { width: min(1180px, calc(100% - 48px)); margin: 0 auto 80px; display: grid; grid-template-columns: minmax(0, 1fr) 250px; gap: 22px; align-items: start; }
.newsletter-issue { display: grid; gap: 18px; }
.newsletter-label { display: inline-block; margin-bottom: 10px; color: #a16b00; font-size: .72rem; font-weight: 950; letter-spacing: .1em; text-transform: uppercase; }
.weekly-lead { display: grid; grid-template-columns: .9fr 1.1fr; overflow: hidden; border: 1px solid var(--line); border-radius: 28px; background: white; box-shadow: var(--shadow); }
.weekly-photo { min-height: 560px; background: var(--forest); overflow: hidden; }
.weekly-photo-img { width: 100%; height: 100%; min-height: 560px; display: block; object-fit: cover; object-position: center 28%; }
.weekly-copy { padding: clamp(26px, 4vw, 44px); }
.weekly-copy h3, .newsletter-card h3, .showdown h3, .weekly-challenge h3, .answer-strip h3 { margin: 0 0 8px; color: var(--forest); font-family: Georgia, 'Times New Roman', serif; font-size: clamp(2rem, 4vw, 3.3rem); line-height: 1; letter-spacing: -.035em; }
.weekly-copy > p:not(.scientific) { color: #45584a; line-height: 1.68; }
.weekly-copy dl { margin: 22px 0; display: grid; gap: 10px; }
.weekly-copy dl div { padding-top: 10px; border-top: 1px solid var(--line); }
.weekly-copy dt { color: var(--forest); font-size: .7rem; font-weight: 950; letter-spacing: .08em; text-transform: uppercase; }
.weekly-copy dd { margin: 4px 0 0; color: var(--muted); line-height: 1.45; }
.weekly-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.newsletter-guide-link { border: 2px solid var(--forest); border-radius: 12px; padding: 9px 12px; background: transparent; color: var(--forest); font-weight: 900; cursor: pointer; }
.newsletter-guide-link:hover { background: var(--forest); color: white; }
.newsletter-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.newsletter-card { min-width: 0; border: 1px solid var(--line); border-radius: 24px; padding: 26px; background: white; }
.newsletter-card h3 { font-size: 2.1rem; }
.newsletter-card p { color: #4d5d52; line-height: 1.65; }
.newsletter-card > a { color: var(--forest); font-weight: 900; }
.mystery-photo { height: 270px; margin: 0 0 20px; border-radius: 18px; overflow: hidden; background: var(--forest); }
.mystery-photo-img { width: 100%; height: 100%; object-fit: cover; object-position: center 30%; filter: saturate(.45) contrast(1.08); }
.season-card { background: var(--yellow); }
.what-time { margin-top: 22px; border: 2px solid var(--forest); border-radius: 18px; padding: 18px; }
.what-time strong, .what-time span, .what-time b { display: block; }
.what-time strong { margin-bottom: 5px; color: var(--forest); text-transform: uppercase; letter-spacing: .08em; font-size: .72rem; }
.what-time span { color: #48584d; line-height: 1.5; }
.what-time b { margin-top: 9px; color: var(--forest); font-family: Georgia, 'Times New Roman', serif; font-size: 1.5rem; }
.showdown { border-radius: 26px; padding: 30px; background: var(--forest); color: white; }
.showdown .newsletter-label { color: var(--yellow); }
.showdown h3 { color: white; }
.showdown h3 em { color: var(--yellow); font-weight: 400; }
.showdown-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 20px; }
.showdown-grid > div { border: 1px solid rgba(255,255,255,.16); border-radius: 17px; padding: 18px; background: rgba(255,255,255,.06); }
.showdown-grid strong, .showdown-grid span { display: block; }
.showdown-grid strong { margin-bottom: 10px; color: var(--yellow); font-size: 1.1rem; }
.showdown-grid span { margin-top: 7px; color: #edf5e8; line-height: 1.5; }
.showdown-grid b { color: white; }
.weekly-challenge { display: flex; align-items: center; justify-content: space-between; gap: 24px; border: 3px dashed var(--forest); border-radius: 24px; padding: 28px; background: white; }
.weekly-challenge h3 { max-width: 650px; font-size: 2rem; }
.challenge-stamp { flex: 0 0 auto; width: 112px; height: 112px; display: grid; place-items: center; border-radius: 50%; background: var(--yellow); color: var(--forest); text-align: center; font-size: .78rem; font-weight: 950; transform: rotate(5deg); }
.answer-strip { scroll-margin-top: 95px; display: grid; grid-template-columns: 1fr minmax(180px, .42fr); gap: 26px; align-items: center; border-radius: 24px; padding: 30px; background: #dbeaca; }
.answer-strip h3 { font-size: 2.2rem; }
.answer-strip p { color: #46564b; line-height: 1.6; }
.newsletter-guide-link.light { background: white; }
.answer-strip blockquote { margin: 0; border-left: 5px solid var(--yellow); padding-left: 20px; color: var(--forest); font-family: Georgia, 'Times New Roman', serif; font-size: 1.55rem; line-height: 1.25; }
.weekly-teaser { display: flex; gap: 12px; border-top: 2px solid var(--forest); padding: 18px 4px 0; color: var(--muted); line-height: 1.5; }
.weekly-teaser strong { color: var(--forest); text-transform: uppercase; letter-spacing: .08em; font-size: .75rem; }
.newsletter-archive { position: sticky; top: 94px; border: 1px solid var(--line); border-radius: 22px; padding: 20px; background: white; box-shadow: 0 8px 24px rgba(23,63,42,.07); }
.newsletter-archive h3 { margin: 12px 0 5px; color: var(--forest); font-family: Georgia, 'Times New Roman', serif; font-size: 1.8rem; }
.newsletter-archive > p { margin: 0 0 16px; color: var(--muted); line-height: 1.5; font-size: .88rem; }
.archive-issue { width: 100%; border: 0; border-top: 1px solid var(--line); padding: 13px 4px; background: transparent; color: var(--ink); text-align: left; cursor: pointer; }
.archive-issue span, .archive-issue strong { display: block; }
.archive-issue span { color: var(--muted); font-size: .7rem; font-weight: 850; text-transform: uppercase; letter-spacing: .06em; }
.archive-issue strong { margin-top: 3px; }
.archive-issue:hover strong, .archive-issue.active strong { color: #a16b00; }

.affiliate-shell { width: min(1040px, calc(100% - 48px)); margin: 64px auto 80px; display: grid; grid-template-columns: .9fr 1.1fr; overflow: hidden; border-radius: 30px; background: white; box-shadow: var(--shadow); }
.affiliate-intro { padding: clamp(34px, 6vw, 66px); background: var(--forest); color: white; }
.affiliate-intro h2 { margin: 24px 0 14px; color: white; font-size: clamp(3rem, 6vw, 5.4rem); line-height: .92; letter-spacing: -.055em; }
.affiliate-intro > p { color: #e7f0e6; font-size: 1.05rem; line-height: 1.7; }
.affiliate-note { margin-top: 34px; border: 1px solid rgba(255,255,255,.17); border-radius: 18px; padding: 18px; background: rgba(255,255,255,.06); }
.affiliate-note strong, .affiliate-note span { display: block; }
.affiliate-note strong { margin-bottom: 5px; color: var(--yellow); }
.affiliate-note span { color: #e4eee2; line-height: 1.5; }
.affiliate-form { padding: clamp(30px, 5vw, 58px); display: grid; gap: 16px; }
.affiliate-form label span { display: block; margin: 0 0 7px 2px; color: var(--forest); font-size: .76rem; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; }
.affiliate-form input, .affiliate-form textarea { width: 100%; border: 2px solid var(--line); border-radius: 14px; padding: 12px 14px; background: var(--cream); color: var(--ink); font: inherit; }
.affiliate-form textarea { resize: vertical; min-height: 130px; }
.affiliate-form input:focus, .affiliate-form textarea:focus { outline: 3px solid rgba(244,211,94,.42); border-color: var(--forest); }
.affiliate-form .primary { justify-self: start; }
.form-note { margin: 0; color: var(--muted); font-size: .82rem; line-height: 1.5; }

.dialog-backdrop { position: fixed; inset: 0; z-index: 60; overflow: auto; padding: 34px 18px; background: rgba(8, 30, 18, .72); backdrop-filter: blur(6px); }
.bird-dialog { position: relative; width: min(980px, 100%); margin: auto; border-radius: 30px; padding: 30px; background: var(--cream); box-shadow: 0 30px 80px rgba(0,0,0,.32); }
.dialog-close { position: sticky; top: 0; z-index: 2; float: right; width: 43px; height: 43px; border: 0; border-radius: 14px; background: var(--forest); color: white; font-size: 1.8rem; line-height: 1; cursor: pointer; }
.detail-header { min-height: 150px; padding: 12px 62px 24px 4px; display: flex; align-items: end; justify-content: space-between; gap: 24px; }
.detail-header h2 { margin: 10px 0 5px; max-width: 700px; font-size: clamp(2.2rem, 5vw, 4.1rem); line-height: .98; letter-spacing: -.05em; }
.detail-photo { height: min(54vw, 460px); margin: 0; border-radius: 24px; overflow: hidden; background: var(--forest); }
.detail-photo-img { width: 100%; height: 100%; object-fit: cover; object-position: center 30%; display: block; }
.detail-photo .photo-missing { width: 100%; height: 100%; }
.media-credit { margin: 8px 4px 18px; color: var(--muted); font-size: .76rem; }
.media-credit a, .source-note a { color: var(--forest); font-weight: 800; }
.plumage-section { margin: 14px 0; padding: 20px; border: 1px solid var(--line); border-radius: 22px; background: white; }
.plumage-heading { display: flex; align-items: end; justify-content: space-between; gap: 18px; margin-bottom: 14px; }
.plumage-heading h3 { margin: 5px 0 0; font-size: 1.2rem; }
.plumage-heading p { max-width: 360px; margin: 0; color: var(--muted); font-size: .78rem; line-height: 1.45; text-align: right; }
.plumage-gallery { display: grid; grid-template-columns: repeat(auto-fit, minmax(175px, 1fr)); gap: 12px; }
.plumage-card { position: relative; min-width: 0; border-radius: 17px; overflow: hidden; background: var(--sage-soft); }
.plumage-card figure { position: relative; height: 210px; margin: 0; background: var(--forest); overflow: hidden; }
.plumage-card img { width: 100%; height: 100%; object-fit: cover; object-position: center 28%; display: block; transition: transform .25s ease; }
.plumage-card:hover img { transform: scale(1.025); }
.plumage-label { position: absolute; left: 10px; bottom: 10px; z-index: 1; padding: 6px 9px; border-radius: 999px; background: var(--yellow); color: var(--forest); box-shadow: 0 3px 12px rgba(0,0,0,.18); font-size: .72rem; font-weight: 900; }
.plumage-credit { margin: 0; padding: 9px 11px 11px; color: var(--muted); font-size: .68rem; line-height: 1.35; }
.plumage-credit a { color: var(--forest); font-weight: 800; }
.plumage-skeleton { height: 210px; border-radius: 17px; background: linear-gradient(100deg, var(--sage-soft) 25%, #f7f9f4 45%, var(--sage-soft) 65%); background-size: 200% 100%; animation: gallery-shimmer 1.2s infinite linear; }
@keyframes gallery-shimmer { to { background-position: -200% 0; } }
.family-tag, .status-tag { display: inline-flex; border-radius: 999px; padding: 7px 10px; font-size: .75rem; font-weight: 900; }
.family-tag { background: var(--sage); color: var(--forest); }
.status-tag { background: var(--yellow); color: var(--forest); white-space: nowrap; }
.detail-facts { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); border-radius: 20px; background: white; overflow: hidden; }
.quick-fact { padding: 16px; border-right: 1px solid var(--line); }
.quick-fact:last-child { border: 0; }
.quick-fact strong { display: block; margin-bottom: 5px; color: var(--muted); font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; }
.quick-fact span { font-size: .92rem; font-weight: 760; }
.detail-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 14px; }
.detail-panel { margin-top: 14px; padding: 21px; border: 1px solid var(--line); border-radius: 20px; background: white; }
.detail-panel h3 { margin: 0 0 15px; font-size: 1.08rem; }
.fact-row { display: grid; grid-template-columns: 100px 1fr; gap: 13px; padding: 10px 0; border-top: 1px solid #ebf0e7; line-height: 1.5; }
.fact-row:first-child { border-top: 0; padding-top: 0; }
.fact-row strong { color: var(--forest); font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; }
.fact-row span { color: #4c5d51; }
.panel-heading { display: flex; justify-content: space-between; gap: 18px; align-items: center; }
.sound-cues { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sound-cue { padding: 14px; border-radius: 13px; background: var(--sage-soft); line-height: 1.5; }
.sound-cue strong { display: block; margin-bottom: 4px; color: var(--forest); }
.source-note { margin: 13px 0 0; color: var(--muted); font-size: .82rem; }
.sound-panel audio { width: 100%; margin-top: 14px; }
.macaulay-player { width: 100%; margin-top: 14px; }
.macaulay-player iframe { display: block; width: 100%; height: 380px; border: 0; border-radius: 14px; }
.description { margin: 0; color: #46564b; line-height: 1.72; }
.similar-list { display: flex; flex-wrap: wrap; gap: 8px; }
.similar-button { border: 0; border-radius: 11px; padding: 9px 11px; background: var(--sage-soft); color: var(--forest); font-weight: 820; cursor: pointer; }
.similar-button:hover { background: var(--sage); }
body.dialog-open { overflow: hidden; }

@media (max-width: 900px) {
  .bird-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .toolbar { grid-template-columns: 1fr 210px auto; }
  .result-count { grid-column: 1 / -1; text-align: left; }
  .section-head { align-items: flex-start; flex-direction: column; }
  .call-row { grid-template-columns: minmax(170px, .7fr) 1fr; }
  .call-row .listen-button { grid-column: 1 / -1; }
  .detail-facts { grid-template-columns: 1fr 1fr; }
  .taxon-families { grid-template-columns: 1fr; }
  .quick-fact:nth-child(2) { border-right: 0; }
  .quick-fact:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .bird-of-day { grid-template-columns: 1fr; }
  .daily-photo, .daily-photo-img { min-height: 360px; max-height: 460px; }
  .region-controls { grid-template-columns: 1fr auto; }
  .location-note { grid-column: 1 / -1; }
  .map-canvases { grid-template-columns: 1fr; }
  .us-map-panel svg { max-height: 520px; }
  .newsletter-layout { grid-template-columns: 1fr; }
  .newsletter-archive { position: static; }
  .affiliate-shell { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .plumage-heading { align-items: flex-start; flex-direction: column; }
  .plumage-heading p { text-align: left; }
  .plumage-gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .plumage-card figure, .plumage-skeleton { height: 175px; }
  .nav-wrap { padding: 8px 14px; gap: 10px; }
  .brand > span:last-child { display: none; }
  .nav-tabs { gap: 2px; }
  .nav-tab { padding: 9px 8px; font-size: .72rem; }
  .hero { grid-template-columns: 1fr; padding: 46px 20px 38px; }
  .hero-stat { width: 100%; min-height: 100px; border-radius: 24px; grid-template-columns: auto auto; gap: 10px; transform: none; }
  .hero-stat strong { font-size: 2.4rem; }
  .workspace { width: calc(100% - 28px); }
  .bird-of-day { width: calc(100% - 28px); border-radius: 25px; }
  .daily-photo, .daily-photo-img { min-height: 280px; }
  .daily-copy { padding: 25px 20px; }
  .daily-notes, .quiz-filters, .quiz-style-switch, .quiz-size-controls { grid-template-columns: 1fr; }
  .daily-notes div:last-child, .quiz-pool-count { grid-column: auto; }
  .toolbar { grid-template-columns: 1fr; }
  .result-count { grid-column: auto; }
  .bird-grid, .answer-grid, .detail-columns, .sound-cues { grid-template-columns: 1fr; }
  .section-head { padding: 46px 18px 28px; }
  .mode-switch { width: 100%; }
  .mode-button { flex: 1; }
  .quiz-shell { width: calc(100% - 28px); padding: 18px; }
  .quiz-start, .quiz-finish { padding: 22px 6px; }
  .match-board { grid-template-columns: 1fr; }
  .match-column { grid-template-columns: 1fr 1fr; }
  .typed-answer-row { grid-template-columns: 1fr; }
  .call-row { grid-template-columns: 1fr; }
  .call-row .listen-button { grid-column: auto; }
  .dialog-backdrop { padding: 0; }
  .bird-dialog { min-height: 100%; border-radius: 0; padding: 18px; }
  .detail-header { align-items: flex-start; flex-direction: column; padding-right: 50px; }
  .detail-facts { grid-template-columns: 1fr; }
  .quick-fact { border-right: 0; border-bottom: 1px solid var(--line); }
  .quick-fact:nth-child(2) { border-right: 0; }
  .quick-fact:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .quick-fact:last-child { border-bottom: 0; }
  .panel-heading { align-items: flex-start; flex-direction: column; }
  .fact-row { grid-template-columns: 84px 1fr; }
  .taxonomy-summary { align-items: flex-start; flex-direction: column; }
  .taxon-species button { flex-direction: column; gap: 2px; }
  .taxon-species em { white-space: normal; }
  .region-controls { grid-template-columns: 1fr; align-items: stretch; }
  .location-note { grid-column: auto; }
  .regional-map { padding: 10px; border-radius: 22px; }
  .map-panel { padding: 8px; }
  .map-panel-head { align-items: flex-start; flex-direction: column; gap: 2px; }
  .map-label { font-size: 20px; }
  .region-results-head { align-items: flex-start; flex-direction: column; }
  .newsletter-masthead { width: calc(100% - 28px); margin-top: 28px; align-items: flex-start; flex-direction: column; }
  .newsletter-clock { width: 100%; min-width: 0; border-radius: 20px; }
  .newsletter-layout { width: calc(100% - 28px); }
  .weekly-lead, .newsletter-grid, .showdown-grid, .answer-strip { grid-template-columns: 1fr; }
  .weekly-photo, .weekly-photo-img { min-height: 320px; max-height: 420px; }
  .weekly-challenge { align-items: flex-start; flex-direction: column; }
  .weekly-teaser { flex-direction: column; }
  .affiliate-shell { width: calc(100% - 28px); margin-top: 36px; }
}

.detail-badges { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.migration-tag {
  align-items: center; background: var(--yellow); border: 1px solid var(--green);
  border-radius: 999px; color: var(--green); display: inline-flex; font-size: .75rem;
  font-weight: 900; letter-spacing: .04em; padding: 8px 11px; text-transform: uppercase;
}
.name-decoder-panel, .etymology-panel, .lookalike-panel { margin-top: 18px; }
.decoder-intro { color: var(--muted); margin: 5px 0 12px; }
.latin-pieces { display: flex; flex-wrap: wrap; gap: 10px; }
.latin-piece {
  background: var(--cream); border: 1px solid var(--line); border-radius: 14px; color: var(--green);
  cursor: pointer; font-family: inherit; font-size: 1rem; font-style: italic; font-weight: 800;
  padding: 10px 14px; text-align: left; transition: transform .15s ease, border-color .15s ease;
}
.latin-piece:hover { border-color: var(--green); transform: translateY(-2px); }
.latin-piece span { display: block; font-size: .62rem; font-style: normal; letter-spacing: .08em; opacity: .65; text-transform: uppercase; }
.latin-meaning { background: rgba(246, 193, 65, .18); border-left: 4px solid var(--yellow); border-radius: 0 10px 10px 0; margin: 12px 0 0; padding: 10px 12px; }
.etymology-grid { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.etymology-grid > div { background: var(--cream); border: 1px solid var(--line); border-radius: 15px; padding: 15px; }
.etymology-grid strong { color: var(--muted); font-size: .68rem; letter-spacing: .08em; text-transform: uppercase; }
.etymology-grid h4 { margin: 5px 0 7px; }
.etymology-grid p { margin: 0; }
.comparison-pair { align-items: stretch; display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); margin-top: 14px; }
.lookalike-comparison { margin-top: 14px; }
.comparison-notes { border-left: 4px solid var(--yellow); padding: 4px 14px; }
.comparison-notes h4 { font-size: 1rem; margin: 0 0 6px; }
.comparison-notes p { font-size: 1rem; line-height: 1.6; margin: 0 0 6px; }
.comparison-notes a { color: var(--green); font-size: .875rem; }
.compare-side { background: var(--cream); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; padding: 12px; }
.compare-bird-link { align-items: center; background: transparent; border: 0; color: var(--green); cursor: pointer; display: grid; font-family: inherit; gap: 11px; grid-template-columns: 78px 1fr; margin-bottom: 8px; padding: 0; text-align: left; width: 100%; }
.compare-photo { border-radius: 12px; height: 78px; object-fit: cover; width: 78px; }
.compare-bird-link b, .compare-bird-link i { display: block; }
.compare-bird-link i { font-size: .78rem; opacity: .66; }
.compare-side .fact-row { grid-template-columns: 70px 1fr; padding: 8px 0; }
.versus-badge { align-self: center; background: var(--yellow); border: 2px solid var(--green); border-radius: 999px; color: var(--green); font-size: .7rem; font-weight: 1000; padding: 8px; }

@media (max-width: 640px) {
  .comparison-pair, .etymology-grid { grid-template-columns: 1fr; }
  .versus-badge { margin: -8px auto; }
  .detail-badges { justify-content: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
}

.mystery-photo--natural { height:auto; aspect-ratio:3 / 2; }
.mystery-photo--natural .mystery-photo-img { display:block; object-position:center; filter:none; }
