/* Chobe Birding Challenge — Pangolin Photo Safaris
   Used on a boat in full sun: big tap targets, strong contrast, no dark mode.
   Brand: yellow #E9A713 (African sunlight), brown #653600 (earth). */

:root {
  --white: #ffffff;
  --paper: #faf7f2;
  --border: #e6ddd0;
  --border-strong: #cbb896;

  --ink: #3d2100;
  --ink-soft: #6b4a26;
  --ink-faint: #8f7d6c;

  --brand: #653600;
  --sun: #e9a713;
  --sun-dim: #fdf3dc;
  --sun-ink: #7a5500; /* yellow is too light for text; this is its readable shade */

  --danger: #b3261e;
  --danger-dim: #fbeae7;
  --ok: #2e7d32;
  --warn: #a15c00;
  --warn-dim: #fff1dc;

  --radius: 12px;
  --tap: 48px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);

  --font: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--white);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.45;
  overscroll-behavior-y: none;
}

button,
input {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

h1,
h2 {
  margin: 0;
  line-height: 1.2;
}

h1 {
  font-size: 1.4rem;
}

h2 {
  font-size: 1.05rem;
  margin-bottom: 8px;
}

p {
  margin: 0;
}

.app {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.muted {
  color: var(--ink-soft);
}

.small {
  font-size: 0.8rem;
  color: var(--ink-faint);
}

.center {
  text-align: center;
}

.eyebrow {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.error {
  color: var(--danger);
  font-size: 0.9rem;
  min-height: 1.3em;
}

.danger {
  color: var(--danger);
}

/* --- Layout ------------------------------------------------------------- */

.page {
  width: 100%;
  margin: 0 auto;
  padding: 20px 16px calc(24px + var(--safe-bottom));
  flex: 1;
}

.page--narrow {
  max-width: 520px;
}

.page--wide {
  max-width: 760px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.page--list {
  max-width: 640px;
  padding-top: 4px;
}

.row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.row > * {
  flex: 1 1 140px;
}

.topbar {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: calc(10px + var(--safe-top)) 16px 10px;
}

.topbar > * {
  width: 100%;
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
}

.topbar--plain {
  display: flex;
  border-bottom: 0;
}

.stick {
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar--session {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.topbar__row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar__title {
  font-size: 1.1rem;
}

.team {
  flex: 1;
  min-width: 0;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border-left: 1px solid var(--border);
  padding-left: 10px;
}

.footer {
  position: sticky;
  bottom: 0;
  background: var(--white);
  border-top: 1px solid var(--border);
  padding: 12px 16px calc(12px + var(--safe-bottom));
}

.footer {
  display: flex;
  justify-content: center;
}

.footer > * {
  max-width: 520px;
}

.logo {
  display: block;
  height: 30px;
  width: auto;
}

.hero__title {
  margin: 0;
}

.logo--wordmark {
  height: auto;
  width: 100%;
  max-width: 300px;
  margin: 0 auto;
}

.connection {
  margin-left: auto;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--ok);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.connection::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

.connection--off {
  color: var(--warn);
}

/* --- Controls ----------------------------------------------------------- */

.btn {
  text-decoration: none; /* a link styled as a button */
  min-height: var(--tap);
  padding: 0 18px;
  border-radius: var(--radius);
  border: 2px solid transparent;
  font-weight: 700;
  font-size: 0.95rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
}

.btn:disabled {
  opacity: 0.45;
  cursor: default;
}

.btn--primary {
  background: var(--sun);
  color: var(--brand);
}

.btn--outline {
  background: var(--white);
  border-color: var(--border-strong);
  color: var(--brand);
}

.btn--ghost {
  background: transparent;
  color: var(--ink-soft);
}

.btn--danger {
  background: var(--danger);
  color: var(--white);
}

.btn--big {
  width: 100%;
  min-height: 54px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.btn--small {
  min-height: 40px;
  padding: 0 14px;
  font-size: 0.85rem;
}

.icon-btn {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  font-size: 1.8rem;
  line-height: 1;
  color: var(--brand);
  flex: none;
}

.icon-btn:hover {
  background: var(--paper);
}

.icon-btn--back {
  width: 48px;
  height: 48px;
  margin-left: -8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--sun);
  text-decoration: none;
}

.icon-btn--back svg {
  display: block;
}

.link {
  background: none;
  border: 0;
  padding: 8px;
  color: var(--sun-ink);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.input {
  width: 100%;
  min-height: var(--tap);
  padding: 0 14px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: var(--white);
  font-size: 16px; /* anything smaller makes iOS zoom in */
}

.input:focus,
.btn:focus-visible,
.choice:focus-visible,
.chip:focus-visible,
.bird:focus-visible {
  outline: 3px solid var(--sun);
  outline-offset: 1px;
}

.input:focus {
  border-color: var(--sun);
  outline: none;
}

.label {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  margin: 18px 0 6px;
}

/* --- Home --------------------------------------------------------------- */

.home {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.hero {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.rule {
  background: var(--sun-dim);
  color: var(--brand);
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: 10px;
  padding: 8px 12px;
}

.rule--small {
  font-size: 0.72rem;
  padding: 5px 10px;
}

.choices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 22px;
}

.choice {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: var(--white);
  text-align: left;
}

.choice span {
  font-size: 0.8rem;
  color: var(--ink-faint);
}

.choice[aria-pressed='true'] {
  border-color: var(--sun);
  background: var(--sun-dim);
}

.links {
  text-align: center;
}

.card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  background: var(--white);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.card--resume {
  border: 2px solid var(--sun);
  background: var(--sun-dim);
}

.card__title {
  font-weight: 700;
  font-size: 1.05rem;
}

/* --- Challenge ---------------------------------------------------------- */

.timer {
  display: flex;
  align-items: center;
  gap: 14px;
}

.timer__bar {
  flex: 1;
  height: 10px;
  border-radius: 5px;
  background: var(--paper);
  border: 1px solid var(--border);
  overflow: hidden;
}

.timer__fill {
  display: block;
  height: 100%;
  width: 0;
  background: var(--sun);
  transition: width 1s linear;
}

.timer__label {
  flex: 1;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink-soft);
}

.timer__time {
  font-size: 1.6rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

.topbar--low .timer__fill {
  background: var(--danger);
}

.topbar--low .timer__time {
  color: var(--danger);
}

.count {
  flex: 1;
  font-weight: 700;
  font-size: 1.05rem;
}

.toolbar {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 10px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toolbar > * {
  max-width: 640px;
  width: 100%;
  margin: 0 auto;
}

.chips {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
}

.chip {
  flex: none;
  border: 0;
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 0.8rem;
  font-weight: 600;
  background: var(--paper);
  color: var(--ink-soft);
}

.chip[aria-pressed='true'] {
  background: var(--brand);
  color: var(--white);
}

.birds {
  list-style: none;
  margin: 0;
  padding: 0;
}

.birds > li + li {
  border-top: 1px solid var(--border);
}

.bird {
  width: 100%;
  min-height: 52px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 6px;
  border: 0;
  background: none;
  text-align: left;
  border-radius: 8px;
}

.bird:disabled {
  cursor: default;
  color: var(--ink-soft);
}

.bird__box {
  width: 26px;
  height: 26px;
  flex: none;
  border: 2px solid var(--border-strong);
  border-radius: 7px;
  display: grid;
  place-items: center;
}

.bird[aria-pressed='true'] {
  background: var(--sun-dim);
}

.bird[aria-pressed='true'] .bird__box {
  background: var(--sun);
  border-color: var(--sun);
}

.bird[aria-pressed='true'] .bird__box::after {
  content: '';
  width: 7px;
  height: 13px;
  border: solid var(--brand);
  border-width: 0 3px 3px 0;
  transform: translateY(-2px) rotate(45deg);
}

.bird[aria-pressed='true'] .bird__name {
  font-weight: 700;
}

.bird__name {
  flex: 1;
  min-width: 0;
}

.tag {
  flex: none;
  font-size: 0.7rem;
  font-weight: 700;
  width: 24px;
  height: 22px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  background: var(--paper);
  color: var(--ink-soft);
}

.tag--migrant {
  background: var(--warn-dim);
  color: var(--warn);
}

.empty,
.loading {
  text-align: center;
  color: var(--ink-faint);
  padding: 40px 12px;
  list-style: none;
}

/* --- Overlays ----------------------------------------------------------- */

.overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgb(61 33 0 / 0.45);
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

@media (min-width: 600px) {
  .overlay {
    align-items: center;
  }
}

.sheet {
  background: var(--white);
  width: 100%;
  max-width: 440px;
  max-height: 85dvh;
  overflow-y: auto;
  border-radius: 18px 18px 0 0;
  padding: 20px 20px calc(20px + var(--safe-bottom));
  display: flex;
  flex-direction: column;
  gap: 10px;
}

@media (min-width: 600px) {
  .sheet {
    border-radius: 18px;
  }
}

.sheet--result {
  text-align: center;
  gap: 8px;
}

.sheet--result .row {
  margin-top: 10px;
}

.sheet__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.big-number {
  font-size: 3.4rem;
  font-weight: 700;
  line-height: 1;
  color: var(--brand);
}

.sent {
  font-size: 0.85rem;
  color: var(--ok);
  font-weight: 600;
  min-height: 1.3em;
}

.sent--waiting {
  color: var(--warn);
}

.species {
  margin: 0;
  padding-left: 20px;
  columns: 2 180px;
  column-gap: 20px;
}

.species li {
  padding: 3px 0;
  break-inside: avoid;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + var(--safe-bottom));
  transform: translateX(-50%);
  z-index: 60;
  background: var(--brand);
  color: var(--white);
  padding: 12px 18px;
  border-radius: 12px;
  font-size: 0.9rem;
  font-weight: 600;
  max-width: calc(100% - 32px);
  box-shadow: 0 8px 24px rgb(0 0 0 / 0.2);
}

/* --- Leaderboard -------------------------------------------------------- */

.tabs {
  display: flex;
  background: var(--paper);
  border-radius: var(--radius);
  padding: 4px;
  margin-bottom: 16px;
}

.tab {
  flex: 1;
  border: 0;
  background: none;
  min-height: 42px;
  border-radius: 9px;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--ink-soft);
}

.tab[aria-selected='true'] {
  background: var(--sun);
  color: var(--brand);
}

.board {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.note {
  font-size: 0.85rem;
  background: var(--paper);
  border-radius: 10px;
  padding: 10px 12px;
  color: var(--ink-soft);
}

.note--waiting {
  background: var(--warn-dim);
  color: var(--warn);
}

.note ul {
  margin: 4px 0 0;
  padding-left: 18px;
}

.empty-state {
  text-align: center;
  padding: 40px 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.podium {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  align-items: end;
  gap: 8px;
}

.podium__step {
  border: 0;
  border-radius: 12px 12px 4px 4px;
  background: var(--paper);
  padding: 12px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 0;
}

.podium__step--1 {
  background: var(--sun-dim);
  padding-top: 22px;
  padding-bottom: 22px;
}

.podium__place {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.podium__team {
  font-size: 0.8rem;
  font-weight: 700;
  width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.podium__count {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--brand);
}

.podium__step--1 .podium__count {
  font-size: 2rem;
}

.ranks {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.ranks > li + li {
  border-top: 1px solid var(--border);
}

.rank {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 0;
  background: var(--white);
  text-align: left;
}

.rank--top {
  background: #fffaf0;
}

.rank__pos {
  width: 28px;
  flex: none;
  font-weight: 700;
  color: var(--ink-faint);
}

.rank--top .rank__pos {
  color: var(--sun-ink);
}

.rank__team {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  font-weight: 600;
}

.rank__team > span:first-child {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rank__count {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--brand);
  font-variant-numeric: tabular-nums;
}

/* --- Admin -------------------------------------------------------------- */

.signin {
  max-width: 340px;
  margin: 40px auto 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-align: center;
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
}

.stat {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
}

.stat strong {
  font-size: 1.6rem;
}

.admin-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.admin-list > li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-right: 8px;
}

.admin-list > li + li {
  border-top: 1px solid var(--border);
}

.admin-list__main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 12px 14px;
  border: 0;
  background: none;
  text-align: left;
}

/* --- Home menu ---------------------------------------------------------- */

.menu {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.menu__item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 16px 18px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  color: var(--ink);
  text-decoration: none;
  background: var(--white);
}

.menu__item strong {
  font-size: 1.05rem;
}

.menu__item span {
  font-size: 0.85rem;
  color: var(--ink-faint);
}

.menu__item--primary {
  background: var(--sun);
  border-color: var(--sun);
  color: var(--brand);
}

.menu__item--primary span {
  color: var(--brand);
}

.hello p {
  font-size: 0.95rem;
}

/* --- Forms -------------------------------------------------------------- */

.intro {
  margin-bottom: 8px;
}

.field .label {
  margin-top: 14px;
}

select.input {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-soft) 50%), linear-gradient(135deg, var(--ink-soft) 50%, transparent 50%);
  background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%;
  background-size: 6px 6px;
  background-repeat: no-repeat;
  padding-right: 36px;
}

.check {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin: 16px 0 0;
  font-size: 0.9rem;
  color: var(--ink-soft);
}

.check input {
  width: 22px;
  height: 22px;
  flex: none;
  margin: 1px 0 0;
  accent-color: var(--brand);
}

.form .btn--big {
  margin-top: 18px;
}

.form .error {
  margin-top: 12px;
}

.code {
  font-size: 1.5rem;
  letter-spacing: 0.3em;
}

.link--inline {
  padding: 0;
}

.page--gap {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* --- My bird list ------------------------------------------------------- */

.topbar__link {
  margin-left: auto;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--sun-ink);
}

.toolbar__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.summary {
  font-weight: 700;
  font-size: 1.05rem;
}

.birds > li.group {
  list-style: none;
  padding: 16px 6px 4px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
  border-top: 0;
}

.birds > li.group + li {
  border-top: 0;
}

.bird-row {
  display: flex;
  align-items: stretch;
}

.bird-row .bird {
  flex: 1;
  min-width: 0;
}

.bird__more {
  flex: none;
  width: 30px;
  border: 0;
  background: none;
  font-size: 1.4rem;
  color: var(--ink-faint);
}

.bird-row--today .bird__name::after {
  content: 'today';
  margin-left: 8px;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ok);
}

.history {
  list-style: none;
  margin: 0;
  padding: 0;
}

.history li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
}

.toast {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* While a form slides up from the bottom, messages show at the top so they don't cover its buttons. */
body:has(.overlay) .toast {
  bottom: auto;
  top: calc(16px + env(safe-area-inset-top, 0px));
}

.toast__action {
  border: 0;
  background: none;
  color: var(--sun);
  font-weight: 700;
  padding: 4px 0;
}

/* --- Trips -------------------------------------------------------------- */

.trip,
.day {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-top: 12px;
  background: var(--white);
}

.trip > summary,
.day > summary {
  list-style: none;
  cursor: pointer;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.trip > summary::-webkit-details-marker,
.day > summary::-webkit-details-marker {
  display: none;
}

.trip__title {
  font-weight: 700;
  font-size: 1.05rem;
}

.trip > .day {
  margin: 0 12px 12px;
  background: var(--paper);
}

.day > summary > span:first-child {
  font-weight: 600;
}

.outing {
  padding: 4px 16px 12px;
}

.outing__title {
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 4px;
}

.species--trip {
  margin: 0;
}

.lifer {
  font-weight: 700;
}

.lifer__tag {
  margin-left: 6px;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ok);
}

/* --- Admin, privacy ----------------------------------------------------- */

.admin-list--compact .admin-list__main {
  padding: 8px 12px;
}

.prose h1 {
  margin-bottom: 12px;
}

.prose h2 {
  margin-top: 24px;
}

.prose p,
.prose li {
  color: var(--ink-soft);
  margin-bottom: 8px;
}

/* --- Life list progress and the save prompt ---------------------------- */

.progress {
  display: flex;
  align-items: center;
  gap: 10px;
}

.progress__bar {
  flex: 1;
  height: 8px;
  border-radius: 4px;
  background: var(--paper);
  border: 1px solid var(--border);
  overflow: hidden;
}

.progress__fill {
  display: block;
  height: 100%;
  background: var(--sun);
}

.nudge {
  border: 2px solid var(--sun);
  background: var(--sun-dim);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin: 8px 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nudge .btn {
  align-self: flex-start;
}

.nudge__row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* --- Shared lists ------------------------------------------------------- */

.menu--list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.menu--list li + li {
  margin-top: 10px;
}

.group-head {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.shared-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 6px;
  list-style: none;
}

.birds > li.shared-row + li.shared-row {
  border-top: 1px solid var(--border);
}

.shared-row__text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.shared-row .btn {
  flex: none;
}

.bird__box--on {
  background: var(--sun);
  border-color: var(--sun);
}

.bird__box--on::after {
  content: '';
  width: 7px;
  height: 13px;
  border: solid var(--brand);
  border-width: 0 3px 3px 0;
  transform: translateY(-2px) rotate(45deg);
}

.group-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin: 28px 0 12px;
}

.map-link {
  text-decoration: none;
}

/* --- Where are you? --------------------------------------------- */

.where {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.where__label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--ink-soft);
}

.where__select {
  min-height: 44px;
  font-weight: 600;
}

/* --- Life list ---------------------------------------------------------- */

.topbar__link--next {
  margin-left: 14px;
}

.topbar__link + .topbar__link--next {
  margin-left: 14px;
}

.bird__name .tag,
.life__name .tag {
  display: inline-grid;
  vertical-align: 2px;
  margin-left: 4px;
}

.bird .tag {
  margin-left: auto;
}

.life {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
}

.life > li.group {
  padding: 16px 0 4px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.life__row {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.life__number {
  flex: none;
  width: 44px;
  font-weight: 700;
  color: var(--sun-ink);
  font-variant-numeric: tabular-nums;
}

.life__text {
  flex: 1;
  min-width: 0;
}

.life__name {
  font-weight: 700;
}

/* --- Birds | Mammals ---------------------------------------------------- */

.kinds {
  display: flex;
  background: var(--paper);
  border-radius: var(--radius);
  padding: 4px;
}

.kinds__tab {
  flex: 1;
  border: 0;
  background: none;
  min-height: 42px;
  border-radius: 9px;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--ink-soft);
}

.kinds__tab[aria-selected='true'] {
  background: var(--brand);
  color: var(--white);
}

.page > .kinds {
  margin-bottom: 14px;
}

/* --- Badges ------------------------------------------------------------- */

.badges {
  margin: 20px 0 8px;
}

.badges__grid {
  list-style: none;
  margin: 8px 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 10px;
}

.badges__grid > li {
  display: flex;
}

.badge {
  width: 100%;
  font: inherit;
  color: inherit;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  text-align: center;
  background: var(--white);
  opacity: 0.55;
}

.badge--earned {
  opacity: 1;
  border: 2px solid var(--sun);
  background: var(--sun-dim);
}

.badge__icon {
  font-size: 1.8rem;
  line-height: 1.2;
  filter: grayscale(1);
}

.badge__icon img {
  display: block;
  width: 2.3rem;
  height: 2.3rem;
  margin: 0 auto;
}

.badge--earned .badge__icon {
  filter: none;
}

.badge__name {
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.2;
}

.badge__detail {
  font-size: 0.7rem;
  color: var(--ink-faint);
}

.badge__bar {
  width: 70%;
  height: 4px;
  border-radius: 2px;
  background: var(--paper);
  overflow: hidden;
  margin-top: 2px;
}

.badge__bar span {
  display: block;
  height: 100%;
  background: var(--sun);
}

/* Rhinos and pangolins: never located. */
.tag--nogps {
  display: inline-block;
  width: auto;
  height: auto;
  padding: 2px 6px;
  font-size: 0.65rem;
  line-height: 1.3;
  vertical-align: 2px;
  background: var(--danger-dim);
  color: var(--danger);
  white-space: nowrap;
}

/* Birds on BirdLife Botswana's rarities lists. */
.tag--record {
  display: inline-block;
  width: auto;
  height: auto;
  padding: 2px 6px;
  font-size: 0.65rem;
  line-height: 1.3;
  vertical-align: 2px;
  white-space: nowrap;
  background: #e6effa;
  color: #1f4f8f;
}

.tag--record-A {
  background: #efe6fa;
  color: #5b2d91;
}

.tag--record-bpc {
  background: #fbe9dc;
  color: #8a3d0c;
}

.note--protect {
  margin-top: 14px;
  background: var(--danger-dim);
  color: var(--ink-soft);
}

/* How it works */
.faq {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--white);
  margin-top: 8px;
}

.faq > summary {
  cursor: pointer;
  padding: 14px 40px 14px 16px;
  font-weight: 600;
  list-style: none;
  position: relative;
}

.faq > summary::-webkit-details-marker {
  display: none;
}

.faq > summary::after {
  content: '+';
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.3rem;
  font-weight: 400;
  color: var(--sun-ink);
}

.faq[open] > summary::after {
  content: '−';
}

.faq__answer {
  padding: 0 16px 14px;
  color: var(--ink-soft);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.faq--plain {
  border: 0;
  background: transparent;
  margin: 0;
}

.faq--plain > summary {
  padding: 8px 0;
  color: var(--sun-ink);
}

.faq--plain > div {
  padding-bottom: 8px;
}

.steps {
  margin: 0;
  padding-left: 1.3em;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.link--inline {
  padding: 0;
  text-decoration: underline;
}

.card--done {
  border-color: var(--ok, #2e7d32);
}

/* Which bird was that? */
.chips--wrap {
  flex-wrap: wrap;
  overflow: visible;
}

.chip--colour {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.swatch {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.25);
  flex: none;
}

.swatches {
  display: inline-flex;
  gap: 3px;
}

.id-question {
  border: 0;
  padding: 0;
  margin: 0 0 16px;
}

.id-question legend {
  font-weight: 700;
  margin-bottom: 8px;
  padding: 0;
}

.id-question .chip {
  padding: 9px 14px;
  font-size: 0.85rem;
}

.id-matches {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.id-match {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--white);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.id-match__head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.id-match__tip {
  margin: 0;
  font-size: 0.9rem;
  color: var(--ink-soft);
}

.id-match__foot {
  display: flex;
  align-items: center;
  gap: 10px;
}

.id-match__foot > :last-child {
  margin-left: auto;
}

.id-match__seen {
  color: var(--ok);
  font-weight: 700;
  font-size: 0.85rem;
}

.id-results {
  scroll-margin-top: 90px;
}

.id-bar {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: calc(16px + env(safe-area-inset-bottom));
  max-width: 520px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px;
  border: 0;
  border-radius: var(--radius);
  background: var(--brand);
  color: var(--white);
  font-size: 0.95rem;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
  transition: opacity 0.2s, transform 0.2s;
}

.id-bar--away {
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
}

.identify {
  padding-bottom: 90px;
}

.search-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.search-row > .input {
  flex: 1;
  min-width: 0;
}

.search-row__id[hidden] {
  display: none;
}

/* Sending a sighting to BirdLife Botswana */
.report textarea.input {
  min-height: 96px;
  padding-top: 10px;
  resize: vertical;
  font: inherit;
}

.report__number {
  max-width: 120px;
}

.report__where {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.report__sent {
  color: var(--ok);
  font-weight: 700;
}

/* My map */
.map-page {
  display: flex;
  flex-direction: column;
  height: calc(100dvh - 74px);
}

.map__bar {
  padding: 10px 16px 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 900px;
  width: 100%;
  margin: 0 auto;
}

.map__row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.map__trip {
  flex: 1;
  min-width: 0;
  min-height: 40px;
  padding-top: 6px;
  padding-bottom: 6px;
}

.map__note {
  margin: 0;
}

.map {
  flex: 1;
  min-height: 280px;
  background: #e9e2d4;
}

/* Pins and the numbered badges of pins close together */
.map-pin {
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.35));
}

.map-pin svg {
  display: block;
}

.leaflet-marker-icon.map-cluster {
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #e9a713;
  border: 3px solid #ffffff;
  box-shadow: 0 0 0 4px rgba(233, 167, 19, 0.35), 0 2px 4px rgba(0, 0, 0, 0.35);
  color: #653600;
  font: 700 14px/1 Helvetica, Arial, sans-serif;
}

.map-cluster--mammals {
  background: #653600;
  box-shadow: 0 0 0 4px rgba(101, 54, 0, 0.35), 0 2px 4px rgba(0, 0, 0, 0.35);
  color: #ffffff;
}

/* Map / Satellite */
.map-view {
  display: flex;
  background: #ffffff;
  overflow: hidden;
}

.map-view__btn {
  border: 0;
  padding: 8px 12px;
  min-height: 36px;
  background: #ffffff;
  color: #653600;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
}

.map-view__btn + .map-view__btn {
  border-left: 1px solid #ccc;
}

.map-view__btn[aria-pressed='true'] {
  background: #653600;
  color: #ffffff;
}

.map__popup {
  list-style: none;
  margin: 4px 0 0;
  padding: 0;
  max-height: 220px;
  overflow-y: auto;
}

.map__popup li {
  padding: 3px 0;
  border-bottom: 1px solid #eee;
}

.map__popup span {
  display: block;
  font-size: 0.8em;
  color: #777;
}

.map__approx {
  margin: 0 0 4px !important;
  font-size: 0.85em;
  color: #7a5500;
  font-weight: 700;
}

.form__keep {
  margin: 14px 0 0;
}

.home__signed-in {
  text-align: center;
  margin: 8px 0 0;
}

/* "= Resident" / "= Migrant" after the first bird of each, explaining the squares */
.status-key {
  margin-left: 4px;
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--ink-faint);
  white-space: nowrap;
}

/* IUCN Red List: Near Threatened or worse */
.tag--red {
  display: inline-block;
  width: auto;
  height: auto;
  padding: 2px 6px;
  margin-left: 4px;
  font-size: 0.65rem;
  line-height: 1.3;
  vertical-align: 2px;
  white-space: nowrap;
  background: #fde7e4;
  color: #a3261a;
}

.tag--red-CR,
.tag--red-EN {
  background: #c62828;
  color: #ffffff;
}

.card__title + .tag--red {
  margin: 4px 0 0;
}

.red-key {
  display: flex;
  align-items: center;
  gap: 4px 10px;
  margin-top: 0;
  font-size: 0.75rem;
  line-height: 1.2;
}

.red-key__item {
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.red-key .tag--red {
  flex: none;
  margin-left: 0;
}

/* On a phone the full names don't fit in one line: the four tags stay in a row, each name under its tag */
@media (max-width: 600px) {
  .red-key {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    align-items: start;
  }

  .red-key__item {
    flex-direction: column;
    gap: 3px;
    white-space: normal;
    text-align: center;
  }
}

/* R / M, Red List and other tags sit after the name, in line with it, all one size */
.bird__name .tag {
  display: inline-grid;
  vertical-align: 2px;
  margin-left: 4px;
  width: auto;
  min-width: 20px;
  height: auto;
  padding: 2px 6px;
  font-size: 0.65rem;
  line-height: 1.3;
}
