:root {
  --forest-deep: #1f3d1f;
  --forest-mid: #3a6b34;
  --forest-glow: #6a9c52;
  --berry: #8c3a2b;
  --berry-bright: #b5543f;
  --slate: #6d7566;
  --ink: #202a1d;
  --bg: #f6f5ee;
  --card: #ffffff;
  --border: #e0ddce;
  --deep-shadow: #0c1a0c;
  --warn-bg: #fdf3e3;
  --warn-border: #e9cf9a;
  --danger-bg: #fbebe8;
  --danger-border: #e5b3a8;
  --danger-text: #7a2418;
  --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --font-mono: 'JetBrains Mono', 'SFMono-Regular', Consolas, monospace;
}

* { box-sizing: border-box; }

.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;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
}

header.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  background: var(--forest-deep);
  color: #fff;
  flex-wrap: wrap;
  gap: 10px;
}
header.site-header a { color: #fff; text-decoration: none; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.15rem; }
nav.site-nav { display: flex; flex-wrap: wrap; }
nav.site-nav a { margin-left: 18px; font-size: 0.95rem; opacity: 0.9; }
nav.site-nav a:hover, nav.site-nav a.active { opacity: 1; text-decoration: underline; }

main { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.map-page main { max-width: none; padding: 0; }

#map { width: 100%; height: 72vh; min-height: 480px; }

.map-filters { background: var(--card); border-bottom: 1px solid var(--border); padding: 12px 20px; }
.map-filters-row { max-width: 1400px; margin: 0 auto; display: flex; flex-wrap: wrap; align-items: center; gap: 20px; }
.filter-group { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.filter-group-end { margin-left: auto; gap: 14px; }
.filter-group-label { font-weight: 700; font-size: 0.82rem; color: var(--forest-deep); margin-right: 2px; }
.filter-chip { display: inline-flex; align-items: center; gap: 5px; font-size: 0.85rem; color: var(--ink); background: #eef0e5; border-radius: 999px; padding: 4px 10px 4px 8px; cursor: pointer; user-select: none; }
.filter-chip input { accent-color: var(--forest-mid); cursor: pointer; }
#species-filter { font-size: 0.85rem; padding: 5px 8px; border-radius: 6px; border: 1px solid var(--border); background: #fff; color: var(--ink); max-width: 180px; }
.filter-count { font-size: 0.85rem; color: var(--slate); white-space: nowrap; }
.filter-clear { font-size: 0.82rem; font-weight: 600; color: var(--forest-mid); background: none; border: 1px solid var(--border); border-radius: 999px; padding: 5px 12px; cursor: pointer; white-space: nowrap; }
.filter-clear:hover { background: #eef0e5; }
@media (max-width: 900px) {
  .map-filters-row { gap: 12px; }
  .filter-group-end { margin-left: 0; width: 100%; justify-content: space-between; }
}

.chart-hero {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  background: radial-gradient(circle at 78% 32%, var(--forest-mid) 0%, var(--forest-deep) 45%, var(--deep-shadow) 100%);
  border-radius: 18px;
  margin: 28px auto 40px;
  padding: 64px 40px 48px;
  color: #fff;
  max-width: 1200px;
}
.chart-hero-rings { position: absolute; top: 50%; right: -8%; transform: translateY(-50%); width: min(560px, 55%); height: auto; z-index: 0; opacity: 0.9; pointer-events: none; }
.chart-depth-label { font-family: var(--font-mono); font-size: 11px; fill: #d3e6c9; }
@media (prefers-reduced-motion: no-preference) {
  .chart-ring-pulse { animation: chart-pulse 6s ease-in-out infinite; transform-origin: center; }
  .chart-ring-pulse:nth-of-type(2) { animation-delay: 1.4s; }
  .chart-ring-pulse:nth-of-type(3) { animation-delay: 2.8s; }
}
@keyframes chart-pulse { 0%, 100% { opacity: 0.55; } 50% { opacity: 1; } }
.chart-hero-content { position: relative; z-index: 1; max-width: 620px; }
.chart-eyebrow { font-family: var(--font-mono); font-size: 0.78rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--berry-bright); margin: 0 0 14px; }
.chart-hero h1 { font-family: var(--font-display); font-weight: 700; font-size: clamp(2.1rem, 4vw, 3.1rem); line-height: 1.08; margin: 0 0 16px; color: #fff; letter-spacing: -0.01em; }
.chart-sub { font-size: 1.08rem; color: #dcebd2; max-width: 480px; margin: 0 0 28px; line-height: 1.55; }
.chart-actions { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 36px; }
.cta-primary { display: inline-flex; align-items: center; gap: 8px; background: var(--berry); color: #fff; font-weight: 700; padding: 13px 26px; border-radius: 999px; text-decoration: none; font-size: 0.98rem; box-shadow: 0 8px 20px rgba(140, 58, 43, 0.35); }
.cta-primary:hover { background: var(--berry-bright); }
.cta-ghost { display: inline-flex; align-items: center; padding: 13px 24px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, 0.35); color: #fff; text-decoration: none; font-weight: 600; font-size: 0.95rem; }
.cta-ghost:hover { border-color: #fff; background: rgba(255, 255, 255, 0.08); }
.chart-stats { display: flex; gap: 32px; flex-wrap: wrap; margin: 0; padding: 20px 0 0; border-top: 1px solid rgba(255, 255, 255, 0.16); }
.chart-stats div { display: flex; flex-direction: column; gap: 4px; }
.chart-stats dt { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: #a8cf98; margin: 0; }
.chart-stats dd { margin: 0; font-family: var(--font-mono); font-size: 1.05rem; font-weight: 600; color: #fff; }
@media (max-width: 720px) {
  .chart-hero { padding: 44px 24px 36px; border-radius: 0; }
  .chart-hero-rings { display: none; }
}

.home-about { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.home-content { padding: 0 0 64px; }
.home-about h2 { font-family: var(--font-display); color: var(--forest-deep); margin-bottom: 16px; margin-top: 44px; }
.home-about h2:first-child { margin-top: 0; }

.explore-grid { display: grid; grid-template-columns: 1.15fr 1fr 1fr 1fr; gap: 18px; margin-bottom: 8px; }
.explore-clusters { display: contents; }
.explore-feature { display: flex; flex-direction: column; justify-content: flex-end; gap: 10px; background: linear-gradient(160deg, var(--forest-deep), var(--forest-mid)); color: #fff; border-radius: 14px; padding: 28px 24px; text-decoration: none; min-height: 260px; }
.explore-feature-title { font-family: var(--font-display); font-size: 1.5rem; font-weight: 700; }
.explore-feature-desc { color: #dcebd2; font-size: 0.92rem; max-width: 240px; }
.explore-feature-arrow { font-family: var(--font-mono); font-size: 0.85rem; color: var(--berry-bright); }
.explore-cluster { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 20px; display: flex; flex-direction: column; }
.cluster-label { font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--berry); margin: 0 0 6px; }
.cluster-link { display: flex; flex-direction: column; gap: 2px; padding: 9px 0; text-decoration: none; color: var(--ink); border-top: 1px solid var(--border); }
.cluster-link:first-of-type { border-top: 0; }
.cluster-link-title { font-weight: 600; font-size: 0.94rem; }
.cluster-link-title:hover { color: var(--forest-mid); }
.cluster-link-desc { font-size: 0.8rem; color: var(--slate); }
@media (max-width: 980px) {
  .explore-grid { grid-template-columns: 1fr 1fr; }
  .explore-feature { grid-column: 1 / -1; min-height: 200px; }
}
@media (max-width: 640px) { .explore-grid { grid-template-columns: 1fr; } }

.spot-log { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: var(--card); margin-bottom: 8px; }
.spot-log-row { display: flex; align-items: center; gap: 6px; padding: 12px 12px 12px 18px; border-top: 1px solid var(--border); }
.spot-log-row:first-child { border-top: 0; }
.spot-log-row:hover { background: #eef0e5; }
.spot-log-link { flex: 1 1 auto; min-width: 0; display: grid; grid-template-columns: auto 1fr auto; align-items: baseline; gap: 14px; text-decoration: none; color: var(--ink); }
.spot-log-name { font-weight: 700; color: var(--forest-deep); }
.spot-log-meta { font-family: var(--font-mono); font-size: 0.78rem; color: var(--slate); white-space: nowrap; }
.spot-log-species { font-size: 0.82rem; color: var(--slate); text-align: right; }
.map-link { flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 8px; text-decoration: none; font-size: 1.05rem; opacity: 0.7; }
.map-link:hover { opacity: 1; background: rgba(31, 61, 31, 0.08); }
h1 .map-link, h3 .map-link { vertical-align: middle; }
@media (max-width: 640px) {
  .spot-log-link { grid-template-columns: 1fr; }
  .spot-log-species { text-align: left; }
}

.home-quote { border-left: 3px solid var(--berry); padding: 4px 0 4px 24px; margin: 8px 0 20px; }
.home-quote p { margin: 0 0 14px; }
.home-quote p:first-of-type { font-family: var(--font-display); font-size: 1.25rem; font-style: italic; color: var(--forest-deep); line-height: 1.5; }

.spot-marker-icon { background: none !important; border: none !important; }
.spot-marker { display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35); font-size: 19px; line-height: 1; cursor: pointer; }
.leaflet-popup-content-wrapper { border-radius: 8px; }
.spot-popup h3 { margin: 0 0 6px; font-size: 1rem; }
.spot-popup p { margin: 2px 0; font-size: 0.85rem; }
.spot-popup a { color: var(--forest-mid); font-weight: 600; }
.species-pill { display: inline-block; background: #eaf1e3; color: var(--forest-deep); border-radius: 999px; padding: 2px 8px; font-size: 0.75rem; margin: 2px 3px 0 0; }

.spot-detail { padding: 32px 0 64px; }
.spot-detail h1 { color: var(--forest-deep); margin-bottom: 4px; }
.spot-title-link { color: inherit; text-decoration: none; }
.spot-title-link:hover { text-decoration: underline; }
.spot-meta { color: var(--slate); font-size: 0.95rem; margin-bottom: 20px; }
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 0.8rem; font-weight: 600; margin-right: 8px; }
.badge-crow-open-access { background: #eaf1e3; color: var(--forest-deep); }
.badge-national-trust { background: #f0e7d8; color: #6b4a1e; }
.badge-woodland-trust { background: #e3ecd8; color: var(--forest-deep); }
.badge-forestry-england { background: #dfeee0; color: var(--forest-mid); }
.badge-public-park { background: #eceded; color: var(--slate); }
.badge-common-land { background: #f0eee1; color: var(--slate); }

.species-table { width: 100%; border-collapse: collapse; margin: 20px 0; }
.species-table th, .species-table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); font-size: 0.9rem; }
.species-table th { background: #eef0e5; }

.card { background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 20px; margin-bottom: 20px; }
.page-card { max-width: 640px; margin: 60px auto; background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 28px; }

.species-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-bottom: 8px; }
.species-card { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 16px 10px; text-decoration: none; color: var(--ink); transition: box-shadow 0.15s, transform 0.15s; }
.species-card:hover { box-shadow: 0 4px 14px rgba(31, 61, 31, 0.12); transform: translateY(-2px); }
.species-card-icon { font-size: 1.8rem; }
.species-card-name { font-weight: 700; color: var(--forest-deep); font-size: 0.92rem; }
.species-card-count { font-size: 0.78rem; color: var(--slate); }
.species-card-season { margin-top: 2px; font-size: 0.72rem; font-weight: 600; color: var(--forest-mid); background: #eaf1e3; border-radius: 999px; padding: 2px 8px; }

/* Safety-critical components */
.disclaimer-block {
  background: var(--danger-bg);
  border: 2px solid var(--danger-border);
  border-radius: 10px;
  padding: 18px 20px;
  margin: 20px 0 28px;
  display: flex;
  gap: 14px;
  align-items: flex-start;
}
.disclaimer-block .disclaimer-icon { font-size: 1.6rem; line-height: 1; flex: 0 0 auto; }
.disclaimer-block strong { color: var(--danger-text); display: block; margin-bottom: 4px; font-size: 1rem; }
.disclaimer-block p { margin: 0; color: var(--danger-text); font-size: 0.92rem; line-height: 1.5; }

.lookalike-block {
  background: var(--danger-bg);
  border-left: 4px solid var(--danger-text);
  border-radius: 6px;
  padding: 16px 18px;
  margin: 16px 0;
}
.lookalike-block h3 { margin: 0 0 8px; color: var(--danger-text); font-size: 1rem; }
.lookalike-block p { margin: 0; font-size: 0.92rem; line-height: 1.6; color: #3a1a13; }

.advisory-block {
  background: var(--warn-bg);
  border: 1px solid var(--warn-border);
  border-radius: 8px;
  padding: 14px 16px;
  font-size: 0.9rem;
  margin: 20px 0;
}
.advisory-block a { color: var(--forest-mid); }

.rod-licence-note { background: var(--warn-bg); border: 1px solid var(--warn-border); border-radius: 8px; padding: 14px 16px; font-size: 0.9rem; margin: 20px 0; }
.rod-licence-note a { color: var(--forest-mid); }

.sources-list { font-size: 0.85rem; color: var(--slate); margin: 24px 0; }
.sources-list a { color: var(--forest-mid); }
.sources-list ul { margin: 6px 0 0; padding-left: 20px; }

.species-photo { margin: 0 0 20px; }
.species-photo img { width: 100%; max-height: 480px; object-fit: cover; border-radius: 10px; border: 1px solid var(--border); display: block; }
.species-photo-caption { font-size: 0.8rem; color: var(--slate); margin-top: 6px; }
.species-photo-caption a { color: var(--forest-mid); }

footer.site-footer { padding: 24px; text-align: center; color: var(--slate); font-size: 0.85rem; border-top: 1px solid var(--border); margin-top: 40px; }
footer.site-footer a { color: var(--slate); }

.back-link { display: inline-block; margin: 16px 0; color: var(--forest-mid); font-weight: 600; text-decoration: none; }

/* Contact page (fleet standard layout) */
.contact-layout { display: grid; grid-template-columns: 1.3fr 1fr; gap: 24px; margin: 24px 0 60px; align-items: start; }
@media (max-width: 800px) { .contact-layout { grid-template-columns: 1fr; } }
.contact-card { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 24px; }
.contact-form div { margin-bottom: 14px; }
.contact-form label { display: block; font-weight: 600; font-size: 0.9rem; margin-bottom: 6px; }
.contact-form input, .contact-form textarea, .contact-form select { width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 0.95rem; font-family: inherit; }
.contact-form textarea { min-height: 120px; resize: vertical; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 560px) { .form-row { grid-template-columns: 1fr; } }
.honey { position: absolute; left: -9999px; }
.button { display: inline-flex; align-items: center; gap: 8px; padding: 12px 22px; border-radius: 999px; font-weight: 700; text-decoration: none; font-size: 0.95rem; border: none; cursor: pointer; }
.button.primary { background: var(--berry); color: #fff; }
.button.primary:hover { background: var(--berry-bright); }
.button.whatsapp { background: #25d366; color: #fff; }
.button.whatsapp:hover { background: #20b858; }
#form-alert { margin-bottom: 12px; }
#form-alert.success { background: #eaf1e3; border: 1px solid #c3dcae; color: var(--forest-deep); padding: 10px 14px; border-radius: 8px; }
#form-alert.error { background: var(--danger-bg); border: 1px solid var(--danger-border); color: var(--danger-text); padding: 10px 14px; border-radius: 8px; }

/* Legal guide page */
.law-section { margin: 28px 0; }
.law-section h2 { font-family: var(--font-display); color: var(--forest-deep); }
.law-callout { background: #eaf1e3; border-left: 4px solid var(--forest-mid); border-radius: 6px; padding: 14px 18px; margin: 14px 0; font-size: 0.92rem; }

@media (max-width: 640px) {
  header.site-header { flex-direction: column; align-items: flex-start; gap: 8px; }
  nav.site-nav a { margin-left: 0; margin-right: 14px; }
}
