  html.bs-quick-capture-redirect,
  html.bs-quick-capture-redirect body {
    background: rgba(15, 23, 42, .62) !important;
  }
  @media (orientation: landscape) and (max-height: 560px) and (max-width: 980px) and (pointer: coarse) {
    html,
    body {
      background: rgba(15, 23, 42, .62) !important;
    }
    body {
      overflow: hidden !important;
    }
    body::before {
      content: "";
      position: fixed;
      inset: 0;
      z-index: 2147483647;
      background: rgba(15, 23, 42, .62);
    }
    body > .site-header,
    body > main,
    body > .site-footer,
    body > #offline-banner,
    body > .flash-stack {
      opacity: 0 !important;
      pointer-events: none !important;
    }
  }
  html.bs-quick-capture-redirect body {
    overflow: hidden !important;
  }
  html.bs-quick-capture-redirect body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 2147483647;
    background: rgba(15, 23, 42, .62);
  }
  html.bs-quick-capture-redirect body > .site-header,
  html.bs-quick-capture-redirect body > main,
  html.bs-quick-capture-redirect body > .site-footer,
  html.bs-quick-capture-redirect body > #offline-banner,
  html.bs-quick-capture-redirect body > .flash-stack {
    opacity: 0 !important;
    pointer-events: none !important;
  }
.hero-compact h2 { display: inline-flex; align-items: center; gap: 8px; }
.hero-title-icon { width: 25px; height: 25px; object-fit: contain; display: inline-block; }
.locality-gps-gate {
  margin-top: 10px;
  display: grid;
  gap: 8px;
}
.locality-gps-gate__actions {
  display: flex;
  gap: 8px;
  flex-wrap: nowrap;
}
.locality-gps-gate__actions .chip {
  flex: 1 1 0;
  min-width: 0;
  min-height: 34px;
  padding: 6px 10px;
  font-size: .92rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.locality-gps-gate__msg {
  min-height: 1.2em;
  font-size: .82rem;
  opacity: .85;
}
.locality-manual-wrap {
  margin-top: 10px;
}
@media (max-width: 640px) {
  .locality-gps-gate__actions {
    gap: 6px;
  }
  .locality-gps-gate__actions .chip {
    min-height: 32px;
    padding: 5px 8px;
    font-size: .86rem;
  }
}
/* Home-only spacing adjustments for map layout */
main {
  padding: 0;
  max-width: none;
  width: 100%;
  margin: 0;
  gap: 0;
  --home-nav-offset: var(--home-nav-offset-desktop, 72px);
}
.site-footer { margin-top: 0; }
/* Home-only sticky header above the map */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1200;
  border-bottom-color: transparent;
  margin-bottom: 0;
}
/* Keep sticky map visible below header while cards scroll. */
main .dashboard--map .map-section {
  top: var(--home-nav-offset, 0px);
  height: calc(100vh - var(--home-nav-offset, 0px));
  min-height: calc(100vh - var(--home-nav-offset, 0px));
}
@supports (height: 100svh){
  main .dashboard--map .map-section {
    height: calc(100svh - var(--home-nav-offset, 0px));
    min-height: calc(100svh - var(--home-nav-offset, 0px));
  }
}
/* Keep flash over the map without shifting layout. */
html.bs-home-flash-pending main .flash-stack { visibility: hidden !important; }
main .flash-stack {
  position: fixed;
  top: calc(var(--home-nav-offset, 72px) + 12px);
  left: 0;
  right: 0;
  width: min(760px, calc(100% - 24px));
  z-index: 1350;
  margin: 0 auto;
  padding: 0;
  pointer-events: none;
  overscroll-behavior: contain;
}
main .flash-stack .flash {
  pointer-events: auto;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-left-width: 3px;
  box-shadow: 0 16px 34px rgba(2, 6, 23, .46);
}
main .flash-stack .flash[data-tone="success"]{
  --flash-accent: var(--accent, #16a34a);
  --flash-accent-soft: rgba(255,255,255,.16);
  --flash-bg: #166534;
  --flash-border: #22c55e;
  --flash-ink: #ffffff;
}
main .flash-stack .flash[data-tone="info"]{
  --flash-bg:#0b2a4a;
  --flash-border:#1d4ed8;
  --flash-ink:#dbeafe;
}
main .flash-stack .flash[data-tone="warning"]{
  --flash-bg:#422006;
  --flash-border:#b45309;
  --flash-ink:#ffedd5;
}
main .flash-stack .flash[data-tone="error"]{
  --flash-bg:#450a0a;
  --flash-border:#b91c1c;
  --flash-ink:#fee2e2;
}
main .flash-stack .flash__icon {
  display: none;
}
main .flash-stack .flash__body {
  text-shadow: none;
  text-align: left;
  color: var(--flash-ink);
}
main .flash-stack .flash__close {
  position: relative;
  flex: 0 0 26px;
  top: auto;
  right: auto;
  margin-left: 4px;
  color: rgba(255, 255, 255, .9);
}
main .flash-stack .flash__close:hover {
  background: rgba(255,255,255,.14);
  color: #ffffff;
}

#charts-grid {
  scroll-margin-top: calc(var(--home-nav-offset, 72px) + 24px);
}
.chart-insight-card {
  display: grid !important;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 18px;
  padding: 20px !important;
}
.chart-insight-card__head h3 {
  margin: 0;
}
.chart-insight-card__head {
  text-align: center;
}
.chart-insight-card__eyebrow {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.species-insight-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(170px, .8fr);
  align-items: center;
  gap: 20px;
}
.species-insight-layout .chart-aspect {
  min-width: 0;
}
.donut-center-stat {
  position: absolute;
  inset: 50% auto auto 50%;
  z-index: 2;
  transform: translate(-50%, -50%);
  display: grid;
  justify-items: center;
  pointer-events: none;
}
.donut-center-stat__value {
  color: var(--fg);
  font-size: clamp(1.4rem, 2.5vw, 2.2rem);
  line-height: 1;
  font-weight: 800;
}
.donut-center-stat__label {
  margin-top: 6px;
  color: var(--muted);
  font-size: .62rem;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.species-insight-list {
  display: grid;
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.species-insight-item {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr);
  gap: 9px;
  align-items: start;
}
.species-insight-swatch {
  width: 9px;
  height: 9px;
  margin-top: 5px;
  border-radius: 50%;
}
.species-insight-name,
.species-insight-meta {
  display: block;
}
.species-insight-name {
  color: var(--fg);
  font-size: .82rem;
  font-weight: 700;
}
.species-insight-meta {
  margin-top: 2px;
  color: var(--muted);
  font-size: .72rem;
  font-weight: 700;
}
.chart-insight-footer {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.chart-insight-stat {
  min-width: 0;
  padding: 0 16px;
  border-right: 1px solid var(--border);
}
.chart-insight-stat:first-child { padding-left: 0; }
.chart-insight-stat:last-child {
  padding-right: 0;
  border-right: 0;
}
.chart-insight-stat__label,
.chart-insight-stat__value {
  display: block;
}
.chart-insight-stat__label {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: .66rem;
  font-weight: 800;
  letter-spacing: .09em;
  text-transform: uppercase;
}
.chart-insight-stat__value {
  overflow: hidden;
  color: #60a5fa;
  font-size: 1.35rem;
  line-height: 1;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#species-dominant {
  font-size: .95rem;
}
.daily-insight-head {
  display: grid;
  justify-items: center;
  gap: 12px;
  text-align: center;
}
.daily-insight-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
  color: var(--muted);
  font-size: .72rem;
  font-weight: 700;
}
.daily-insight-legend__item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.daily-insight-legend__line {
  width: 22px;
  height: 3px;
  border-radius: 999px;
}
.daily-insight-legend__line--daily { background: rgba(22,163,74,.75); }
.daily-insight-legend__line--trend { background: #2563eb; }
.daily-insight-footer {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
#daily-peak-date {
  font-size: 1rem;
}
@media (min-width: 1101px) {
  .chart-grid--trends > .chart-insight-card {
    min-height: 660px;
  }
  .chart-insight-card > .chart-aspect,
  .species-insight-layout {
    height: 430px;
    min-height: 0;
  }
  .chart-insight-card > .chart-aspect,
  .species-insight-layout .chart-aspect {
    padding-top: 0 !important;
  }
  .species-insight-layout .donut-fit {
    top: 50%;
    bottom: auto;
    width: min(100%, 390px);
    height: auto;
    transform: translate(-50%, -50%);
  }
}
@media (max-width: 1100px) {
  .species-insight-layout {
    grid-template-columns: 1fr;
  }
  .species-insight-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 640px) {
  .chart-insight-card { padding: 14px !important; }
  .species-insight-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 12px;
    row-gap: 14px;
    width: min(100%, 250px);
    margin-inline: auto;
  }
  .species-insight-name {
    font-size: .72rem;
    line-height: 1.25;
  }
  .species-insight-meta {
    font-size: .64rem;
    line-height: 1.25;
  }
  .chart-insight-footer {
    align-items: stretch;
  }
  .chart-insight-stat {
    display: grid;
    align-content: start;
    justify-items: center;
    padding: 0 6px;
    text-align: center;
  }
  .chart-insight-stat__label {
    min-height: 2.6em;
    margin-bottom: 5px;
    font-size: .56rem;
    line-height: 1.3;
    letter-spacing: .04em;
  }
  .chart-insight-stat__value {
    max-width: 100%;
    font-size: 1rem;
    line-height: 1.15;
  }
  #species-dominant {
    display: -webkit-box;
    overflow: hidden;
    font-size: .78rem;
    line-height: 1.2;
    text-overflow: clip;
    white-space: normal;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }
  .daily-insight-head {
    align-items: center;
    flex-direction: column;
    gap: 10px;
    text-align: center;
  }
  .daily-insight-legend {
    justify-content: center;
  }
  .daily-insight-footer {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    row-gap: 18px;
  }
  .daily-insight-footer .chart-insight-stat:nth-child(2) {
    border-right: 0;
  }
  .daily-insight-footer .chart-insight-stat:nth-child(3),
  .daily-insight-footer .chart-insight-stat:nth-child(4) {
    padding-top: 16px;
    border-top: 1px solid var(--border);
  }
}
