:root {
  --canvas: #eef1ec;
  --paper: #fbfaf6;
  --ink: #171a16;
  --muted: #5a6158;
  --line: #d8ddd4;
  --line-strong: #c3cbc0;
  --accent: #0f6b4c;
  --accent-deep: #0a4d37;
  --accent-soft: #e3f1ea;
  --danger: #9b2f24;
  --danger-bg: #f8e8e5;
  --warn-bg: #f7f0dc;
  --warn-ink: #5a4714;
  --shadow: 0 1px 0 rgba(23, 26, 22, 0.04), 0 18px 40px rgba(23, 26, 22, 0.08);
  --radius: 12px;
  font-family: Figtree, "Segoe UI", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--canvas);
  color: var(--ink);
}

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

img {
  display: block;
}

h1,
h2,
h3,
.eyebrow {
  font-family: Fraunces, Georgia, serif;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: clamp(1.55rem, 2vw, 1.85rem);
  font-weight: 650;
  letter-spacing: -0.03em;
  line-height: 1.05;
}

h2 {
  font-size: 1.2rem;
  font-weight: 650;
  letter-spacing: -0.02em;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.86em;
  background: rgba(23, 26, 22, 0.06);
  padding: 0.08em 0.32em;
  border-radius: 4px;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -40px;
  background: var(--paper);
  padding: 8px 12px;
  border-radius: 8px;
  z-index: 20;
}

.skip-link:focus {
  top: 12px;
}

.banner {
  background: var(--warn-bg);
  color: var(--warn-ink);
  padding: 0.7rem 1.35rem;
  font-size: 0.92rem;
  line-height: 1.45;
  border-bottom: 1px solid #eadcb0;
}

.banner-error {
  background: var(--danger-bg);
  color: var(--danger);
  border-bottom-color: #ebc7bf;
}

.site-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.35rem 1.5rem;
  align-items: end;
  padding: 1.15rem 1.35rem 1.2rem;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}

.brand .eyebrow {
  margin-bottom: 0.2rem;
}

.eyebrow {
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 650;
}

.lede {
  grid-column: 1;
  max-width: 38rem;
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.45;
}

.site-header .btn-primary {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: center;
}

.layout {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
  min-height: 0;
}

.map-pane {
  position: relative;
  min-height: 280px;
  background: #dfe6da;
}

.map,
.map-fallback {
  position: absolute;
  inset: 0;
}

.map-fallback {
  display: grid;
  place-items: center;
  padding: 1.75rem;
  color: var(--ink);
  background-color: #e7eee3;
  background-image:
    linear-gradient(to right, rgba(15, 107, 76, 0.07) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(15, 107, 76, 0.07) 1px, transparent 1px);
  background-size: 48px 48px;
}

.map-fallback-copy {
  width: min(34rem, 100%);
  background: rgba(251, 250, 246, 0.94);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.35rem 1.4rem 1.45rem;
}

.map-fallback-copy h2 {
  margin: 0.35rem 0 0.65rem;
}

.map-fallback-copy p {
  color: var(--muted);
  line-height: 1.55;
  font-size: 0.98rem;
}

.map-hint {
  position: absolute;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  padding: 0.4rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: var(--shadow);
  font-size: 0.85rem;
  font-weight: 600;
  pointer-events: none;
}

.sidebar {
  background: var(--paper);
  border-left: 1px solid var(--line);
  min-height: 0;
  overflow: auto;
}

.panel {
  padding: 1.25rem 1.25rem 1.6rem;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.muted {
  color: var(--muted);
  font-size: 0.9rem;
}

.form-intro {
  margin-bottom: 1.1rem;
  line-height: 1.45;
}

.field-hint {
  font-weight: 400;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
}

.btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  border-radius: 8px;
  padding: 0.58rem 1rem;
}

.btn:disabled {
  opacity: 0.6;
  cursor: wait;
}

.btn-primary {
  background: var(--accent);
  color: #f7fbf8;
}

.btn-primary:hover {
  background: var(--accent-deep);
}

.btn-ghost {
  color: var(--accent);
  padding-left: 0;
}

.btn-block {
  width: 100%;
  margin-top: 0.25rem;
  padding: 0.72rem 1rem;
}

.state {
  display: grid;
  justify-items: start;
  gap: 0.55rem;
  padding: 1.1rem 0.1rem;
  color: var(--muted);
}

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

.empty {
  background: var(--accent-soft);
  border: 1px solid #cfe0d6;
  border-radius: var(--radius);
  padding: 1.15rem 1.15rem 1.25rem;
  color: var(--ink);
}

.empty p {
  color: var(--muted);
  margin: 0.15rem 0 0.85rem;
  line-height: 1.45;
}

.spinner {
  width: 1.05rem;
  height: 1.05rem;
  border: 2px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.sighting-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.55rem;
}

.sighting-card {
  width: 100%;
  text-align: left;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.85rem 0.95rem;
  cursor: pointer;
  font: inherit;
  color: inherit;
}

.sighting-card:hover,
.sighting-card:focus-visible {
  border-color: var(--accent);
  outline: none;
}

.sighting-card.is-active {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: inset 3px 0 0 var(--accent);
}

.sighting-card h3 {
  font-size: 1.02rem;
}

.sighting-card p {
  color: var(--muted);
  font-size: 0.88rem;
  margin-top: 0.22rem;
}

form {
  display: grid;
  gap: 0.85rem;
}

label {
  display: grid;
  gap: 0.35rem;
  font-weight: 600;
  font-size: 0.88rem;
}

input,
textarea {
  font: inherit;
  font-weight: 400;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 0.62rem 0.72rem;
  width: 100%;
}

input:focus-visible,
textarea:focus-visible,
.btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.coord-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.field-error {
  margin: 0;
  color: var(--danger);
  font-weight: 600;
}

.detail-meta {
  display: grid;
  gap: 0.55rem;
  margin: 1rem 0;
}

.detail-meta div {
  background: var(--canvas);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.65rem 0.8rem;
}

dt {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  font-weight: 650;
}

dd {
  margin: 0.2rem 0 0;
}

.notes {
  white-space: pre-wrap;
  line-height: 1.55;
}

@media (max-width: 840px) {
  .site-header {
    grid-template-columns: 1fr;
  }

  .lede,
  .site-header .btn-primary {
    grid-column: 1;
    grid-row: auto;
  }

  .site-header .btn-primary {
    justify-self: start;
    margin-top: 0.35rem;
  }

  .layout {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(240px, 40vh) minmax(0, 1fr);
  }

  .sidebar {
    border-left: 0;
    border-top: 1px solid var(--line);
  }
}

@media (max-width: 520px) {
  .coord-row {
    grid-template-columns: 1fr;
  }

  .panel {
    padding: 1rem;
  }

  .site-header {
    padding: 1rem;
  }
}
