/* Tiny overrides on top of Pico. Keep this file short. */

.topnav { padding-block: 0.25rem; border-bottom: 1px solid var(--pico-muted-border-color); }
.topnav a.active { font-weight: bold; text-decoration: underline; }

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}
.kpi { padding: 0.75rem 1rem; border: 1px solid var(--pico-muted-border-color);
       border-radius: var(--pico-border-radius); }
.kpi .label { font-size: 0.85rem; color: var(--pico-muted-color); text-transform: uppercase;
              letter-spacing: 0.04em; }
.kpi .value { font-size: 1.75rem; font-weight: 600; line-height: 1.1; }
.kpi.warn .value { color: var(--pico-color-amber-450); }
.kpi.bad  .value { color: var(--pico-color-red-450); }

.tag-badge {
  display: inline-block;
  padding: 0.1rem 0.5rem;
  margin: 0.1rem 0.15rem 0.1rem 0;
  border-radius: 999px;
  background: var(--pico-secondary-background);
  color: var(--pico-secondary-inverse);
  font-size: 0.78rem;
  white-space: nowrap;
}
.tag-badge.snow  { background: #1e88e5; color: white; }
.tag-badge.ice   { background: #0277bd; color: white; }
.tag-badge.mud   { background: #6d4c41; color: white; }
.tag-badge.dry   { background: #43a047; color: white; }
.tag-badge.water { background: #00838f; color: white; }
.tag-badge.danger { background: #c62828; color: white; }

.conf-badge {
  display: inline-block;
  padding: 0.05rem 0.5rem;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  vertical-align: middle;
  background: var(--pico-secondary-background);
  color: var(--pico-secondary-inverse);
}
.conf-badge.conf-high   { background: #2e7d32; color: white; }
.conf-badge.conf-medium { background: #ef6c00; color: white; }
.conf-badge.conf-low    { background: #6c757d; color: white; }

.peak-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 0.75rem;
}
.peak-card { padding: 0.75rem 1rem; border: 1px solid var(--pico-muted-border-color);
             border-radius: var(--pico-border-radius); display: flex; flex-direction: column; gap: 0.25rem; }
.peak-card h4 { margin-bottom: 0; }
.peak-card .meta { font-size: 0.85rem; color: var(--pico-muted-color); }
.peak-card .summary { font-size: 0.9rem; }

.report-row { padding: 0.65rem 0; border-bottom: 1px solid var(--pico-muted-border-color); }
.report-row:last-child { border-bottom: none; }
.report-row .meta { font-size: 0.82rem; color: var(--pico-muted-color); }
.report-row .summary { margin: 0.25rem 0; }

.section { margin-block: 2rem; }
.section h3 { margin-bottom: 0.5rem; }

.two-col { display: grid; grid-template-columns: 2fr 1fr; gap: 1.5rem; }
@media (max-width: 900px) { .two-col { grid-template-columns: 1fr; } }

.dim { color: var(--pico-muted-color); }
.mono { font-family: var(--pico-font-family-monospace); font-size: 0.85rem; }
.right { text-align: right; }

table.compact th, table.compact td { padding: 0.35rem 0.5rem; }

.empty {
  padding: 1rem; border: 1px dashed var(--pico-muted-border-color);
  border-radius: var(--pico-border-radius); color: var(--pico-muted-color); font-style: italic;
}

/* Data-source health (/health) — the conditions model's external feeds. */
.src-banner {
  padding: 0.75rem 1rem; border-radius: var(--pico-border-radius);
  margin-bottom: 1rem; font-weight: 600;
}
.src-banner.bad  { background: #c62828; color: white; }
.src-banner.warn { background: #ef6c00; color: white; }
.src-banner.ok   { background: #2e7d32; color: white; }
.src-pill {
  display: inline-block; padding: 0.05rem 0.5rem; border-radius: 999px;
  font-size: 0.72rem; font-weight: 700; white-space: nowrap;
  background: var(--pico-secondary-background); color: var(--pico-secondary-inverse);
}
.src-pill.ok      { background: #2e7d32; color: white; }
.src-pill.warn    { background: #ef6c00; color: white; }
.src-pill.bad     { background: #c62828; color: white; }
.src-pill.unknown { background: #6c757d; color: white; }
/* The /health "rebuild this cache" action button (force-expire degraded entries). */
.cache-rebuild { margin: 0; }
button.btn-rebuild {
  margin: 0; width: auto; font-size: 0.72rem; font-weight: 700; line-height: 1.4;
  padding: 0.1rem 0.6rem; border: 0; border-radius: 999px;
  background: #ef6c00; color: white; cursor: pointer;
}
button.btn-rebuild:hover { background: #e65100; }
/* A coloured left edge so severity reads at a glance down the table. */
tr.sev-bad     td:first-child { border-left: 3px solid #c62828; }
tr.sev-warn    td:first-child { border-left: 3px solid #ef6c00; }
tr.sev-ok      td:first-child { border-left: 3px solid #2e7d32; }
tr.sev-unknown td:first-child { border-left: 3px solid #6c757d; }

/* Wildlife sightings (iNaturalist) — peak card + Reports view */
.wildlife-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 0.75rem;
}
.wildlife-card {
  display: flex; gap: 0.75rem; padding: 0.6rem; align-items: flex-start;
  border: 1px solid var(--pico-muted-border-color);
  border-left: 3px solid var(--pico-muted-border-color);
  border-radius: var(--pico-border-radius);
}
.wildlife-card.hazard  { border-left-color: #c62828; }
.wildlife-card.notable { border-left-color: #2e7d32; }
.wildlife-photo {
  width: 84px; height: 84px; object-fit: cover; flex-shrink: 0;
  border-radius: var(--pico-border-radius);
}
.wildlife-body { min-width: 0; flex: 1; }
.wildlife-name { line-height: 1.2; }
.wildlife-meta { font-size: 0.75rem; margin-top: 0.2rem; word-break: break-word; }

/* Type-to-filter combobox (progressive enhancement over a native <select>). */
.combobox { position: relative; }
.combobox > label { display: block; }
.combobox-input { margin-bottom: 0; }
.combobox-list {
  position: absolute; left: 0; right: 0; z-index: 20;
  margin: 0.15rem 0 0; padding: 0.25rem; list-style: none;
  max-height: 16rem; overflow-y: auto;
  background: var(--pico-background-color);
  border: 1px solid var(--pico-form-element-border-color);
  border-radius: var(--pico-border-radius);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45);
}
.combobox-option {
  padding: 0.4rem 0.6rem; line-height: 1.3; cursor: pointer;
  border-radius: calc(var(--pico-border-radius) - 1px);
}
.combobox-option.active {
  background: var(--pico-primary-background); color: var(--pico-primary-inverse);
}
.combobox-option[aria-selected="true"] { font-weight: 600; }
.combobox-empty {
  padding: 0.4rem 0.6rem; color: var(--pico-muted-color); font-style: italic;
}

/* Self-logged field-report wizard (mobile-first) + list */
.obs-wizard .slider-out { float: right; font-weight: 600; font-size: 0.9rem;
  color: var(--pico-primary); }
.obs-wizard input[type="range"] { margin-top: 0.4rem; }
/* One tick mark under each slider stop, so its discrete steps are visible. */
.slider-wrap { display: block; margin-bottom: 1rem; }
/* Move the range's own bottom spacing onto the wrap so the ticks can hug the
   track instead of being pushed a full row below it. */
.slider-wrap > input[type="range"] { margin-bottom: 0; }
.slider-ticks {
  display: flex; justify-content: space-between;
  /* Inset by ~half the thumb so the end ticks line up with the thumb's travel. */
  padding-inline: 0.6rem; margin-top: -0.4rem; pointer-events: none;
}
.slider-tick {
  width: 2px; height: 0.5rem; border-radius: 1px;
  background: var(--pico-form-element-border-color);
}
/* One step visible at a time; if JS is off, `hidden` is never set and every
   step shows (the form still submits fine). */
.obs-wizard .step[hidden] { display: none; }
.wiz-head { margin-bottom: 0.5rem; }
.wiz-head progress { margin-bottom: 0.15rem; }
.include-switch { font-weight: 600; }
.band-counter { font-weight: 400; }
/* Thumb-reachable nav pinned to the bottom on a phone. */
.obs-wizard .wiz-nav {
  position: sticky; bottom: 0; z-index: 2;
  display: flex; gap: 0.5rem; padding: 0.75rem 0;
  background: var(--pico-background-color);
  border-top: 1px solid var(--pico-muted-border-color);
}
.obs-wizard .wiz-nav button { margin: 0; flex: 1; }
.obs-wizard .wiz-nav button.secondary { flex: 0 0 33%; }
.saved-banner {
  padding: 0.6rem 0.9rem; border-radius: var(--pico-border-radius);
  background: #2e7d32; color: white;
}
.saved-banner a { color: white; }

.fr-list { display: flex; flex-direction: column; gap: 0.75rem; }
.fr-card { padding: 0.75rem 1rem; border: 1px solid var(--pico-muted-border-color);
  border-radius: var(--pico-border-radius); }
.fr-card header { margin-bottom: 0.35rem; }
.fr-badges { display: flex; flex-wrap: wrap; gap: 0.25rem; }
.fr-notes { margin: 0.5rem 0 0.25rem; font-size: 0.92rem; }
.fr-card footer { font-size: 0.8rem; margin-top: 0.4rem; }
