:root {
  color-scheme: light;
  --ink: #18212f;
  --muted: #596675;
  --line: #d7dde6;
  --panel: #ffffff;
  --bg: #f3f6fa;
  --accent: #0f766e;
  --bad: #b42318;
  --ok: #087443;
}

* {
  box-sizing: border-box;
}

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

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 20px 32px;
  background: #ffffff;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 5;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 30px;
  line-height: 1.1;
}

h2 {
  font-size: 18px;
}

.eyebrow {
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0;
}

nav {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

nav a {
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
}

nav a[aria-current="page"] {
  color: var(--accent);
}

main {
  width: 100%;
  max-width: none;
  margin: 0 auto;
  padding: 20px;
}

.controls,
.status-grid,
.split,
.tabs {
  display: grid;
  gap: 12px;
}

.controls {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  align-items: end;
  padding: 16px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

label,
.control-field {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.search-field small {
  min-height: 14px;
  color: var(--accent);
  font-weight: 600;
}

.search-field {
  min-width: min(100%, 260px);
}

select,
input,
button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  color: var(--ink);
  font: inherit;
}

select,
button,
input[type="search"] {
  padding: 0 14px;
}

button {
  cursor: pointer;
  font-weight: 700;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

button:hover:not(:disabled),
select:hover,
input:hover {
  border-color: var(--accent);
}

.time-control {
  display: grid;
  grid-template-columns: 42px minmax(130px, 1fr) 42px;
  gap: 8px;
  align-items: center;
}

.time-control button,
.def {
  padding: 0 8px;
}

.time-field select,
.search-field input {
  width: 100%;
}

.def {
  width: 22px;
  min-height: 22px;
  margin-left: 4px;
  font-size: 12px;
}

.info-tip,
.def-tip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  width: 22px;
  height: 22px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #ffffff;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  cursor: help;
}

.info-tip::after,
.def-tip::after {
  content: attr(data-tip);
  display: none;
  position: absolute;
  z-index: 12;
  left: 50%;
  bottom: calc(100% + 8px);
  width: min(280px, 78vw);
  transform: translateX(-50%);
  padding: 9px 10px;
  border-radius: 6px;
  background: #111827;
  color: #ffffff;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
}

.info-tip:hover::after,
.info-tip:focus::after,
.def-tip:hover::after,
.def-tip:focus::after {
  display: block;
}

.suggestions {
  display: grid;
  gap: 4px;
  max-height: 220px;
  overflow: auto;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
}

.suggestions button {
  min-height: 34px;
  padding: 6px 8px;
  text-align: left;
  font-weight: 650;
}

.suggestions small {
  display: block;
  color: var(--muted);
  font-weight: 500;
}

.suggestion-divider {
  padding: 6px 8px 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.status-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 16px 0;
}

.status-grid article,
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.status-grid article {
  padding: 16px;
}

.status-grid span,
.status-grid small,
.panel-title p {
  color: var(--muted);
}

.status-grid strong {
  display: block;
  margin: 8px 0 4px;
  font-size: 20px;
}

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

.legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 13px;
  font-weight: 700;
}

.legend i {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  display: inline-block;
}

.tabs {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  margin: 16px 0;
}

.tab-button {
  min-height: 44px;
  padding: 8px 14px;
}

.tab-button.active {
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
}

.split {
  grid-template-columns: minmax(0, 2.35fr) minmax(340px, 0.9fr);
  margin-bottom: 16px;
}

.panel {
  padding: 16px;
  min-width: 0;
}

.panel-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.map-panel {
  position: relative;
}

canvas {
  width: 100%;
  display: block;
  background: #d9eef5;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.tooltip {
  position: absolute;
  max-width: 300px;
  padding: 10px 12px;
  background: #111827;
  color: #ffffff;
  border-radius: 6px;
  font-size: 12px;
  pointer-events: none;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
}

.details {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 14px;
  margin: 0;
}

.details dt {
  color: var(--muted);
}

.details dd {
  margin: 0;
  font-weight: 700;
  text-align: right;
}

svg {
  width: 100%;
  height: auto;
  overflow: visible;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}

.calendar-grid strong {
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.calendar-day {
  min-height: 58px;
  color: #ffffff;
  border: 2px solid transparent;
  display: grid;
  align-content: center;
  justify-items: center;
  padding: 4px;
}

.calendar-day.empty {
  background: transparent;
  border: 0;
}

.calendar-day.selected {
  border-color: #111827;
}

.calendar-day.today {
  box-shadow: inset 0 0 0 2px #ffffff, 0 0 0 2px var(--accent);
}

.calendar-day span {
  font-size: 18px;
}

.calendar-day small {
  color: #ffffff;
  font-size: 11px;
}

pre {
  margin: 0;
  max-height: none;
  overflow: auto;
  white-space: pre-wrap;
  color: #263241;
  font: 14px/1.5 ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
}

.docs-page {
  max-width: 1180px;
  margin: 0 auto;
}

.docs-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.docs-toc {
  position: sticky;
  top: 100px;
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.docs-toc h2 {
  margin-bottom: 4px;
}

.docs-toc a {
  color: var(--ink);
  text-decoration: none;
  font-size: 13px;
}

.docs-toc .toc-l3 {
  padding-left: 12px;
  color: var(--muted);
}

.markdown-body {
  font-size: 15px;
  line-height: 1.65;
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4 {
  margin: 22px 0 10px;
}

.markdown-body p,
.markdown-body ul,
.markdown-body table,
.markdown-body pre {
  margin: 0 0 14px;
}

.markdown-body table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.markdown-body th,
.markdown-body td {
  border: 1px solid var(--line);
  padding: 7px 8px;
  text-align: left;
}

.months-page {
  max-width: 1420px;
  margin: 0 auto;
}

.method-note {
  margin-bottom: 16px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.month-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.month-summary-grid article {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.month-summary-grid span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.month-summary-grid strong {
  font-size: 18px;
}

.months-layout {
  display: grid;
  grid-template-columns: minmax(320px, 0.9fr) minmax(0, 1.4fr);
  gap: 18px;
  align-items: start;
}

.months-layout h2 {
  margin-bottom: 10px;
}

.sighting-cards {
  display: grid;
  gap: 10px;
}

.sighting-card {
  padding: 12px;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.sighting-card > div:first-child {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.sighting-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.stacked-band {
  display: flex;
  height: 14px;
  overflow: hidden;
  margin-bottom: 10px;
  border: 1px solid var(--line);
  border-radius: 4px;
}

.stacked-band span {
  height: 100%;
}

.sighting-card dl {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: 6px 10px;
  margin: 0;
  font-size: 13px;
}

.sighting-card dt {
  color: var(--muted);
}

.sighting-card dd {
  margin: 0;
  font-weight: 700;
}

.table-wrap {
  overflow: auto;
}

.months-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.months-table th,
.months-table td {
  padding: 8px;
  border: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.mini-swatch {
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-right: 7px;
  border: 1px solid #94a3b8;
  border-radius: 3px;
  vertical-align: -2px;
}

.site-footer {
  padding: 18px 24px 30px;
  color: var(--muted);
  text-align: center;
  font-size: 13px;
}

@media (max-width: 1180px) {
  .controls {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 880px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .controls,
  .status-grid,
  .split,
  .tabs {
    grid-template-columns: 1fr;
  }

  main {
    padding: 12px;
  }

  .panel-title {
    align-items: flex-start;
    flex-direction: column;
  }

  .docs-layout {
    grid-template-columns: 1fr;
  }

  .months-layout {
    grid-template-columns: 1fr;
  }

  .docs-toc {
    position: static;
  }

  .info-tip {
    justify-self: start;
  }
}

@media (max-width: 560px) {
  .topbar {
    padding: 16px;
  }

  h1 {
    font-size: 25px;
  }

  .controls,
  .panel,
  .status-grid article {
    padding: 12px;
  }

  .time-control {
    grid-template-columns: 40px minmax(0, 1fr) 40px;
  }

  .legend span {
    width: 100%;
  }
}
