/* ═══════════════════════════════════════════════════════
   Saffron Milk Cap Tracker
   Extends the original palette rather than replacing it:
   cream paper, saffron accent, forest green for actions.
   ═══════════════════════════════════════════════════════ */

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

:root {
  --cream:         #f5f0e8;
  --paper:         #faf8f3;
  --white:         #ffffff;
  --ink:           #2a2218;
  --ink-mid:       #5a4f3f;
  --ink-soft:      #9a8f7f;
  --saffron:       #d4831a;
  --saffron-deep:  #b26a0f;
  --saffron-light: #f0b060;
  --saffron-wash:  #fdf4e6;
  --forest:        #3a5a2e;
  --forest-light:  #5a8a46;
  --forest-wash:   #eef5e8;
  --verdigris:     #6c8f6a;
  --danger:        #a83a28;
  --danger-wash:   #fbeeec;
  --border:        #ddd5c0;
  --border-soft:   #e9e3d4;

  --topbar-h:      54px;
  --sidebar-w:     380px;
  --radius:        10px;
  --radius-sm:     7px;

  --serif: 'Playfair Display', Georgia, serif;
  --sans:  'DM Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

html { height: 100%; }

body {
  height: 100%;
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.55;
  background: var(--cream);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

/* ── Top bar ─────────────────────────────────────────── */

.topbar {
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 18px;
  background: var(--forest);
  color: var(--cream);
  position: relative;
  z-index: 1200;
}

.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-mark { font-size: 20px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.brand-text b {
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
}
.brand-text small {
  font-size: 10.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--saffron-light);
}

.topnav { display: flex; gap: 4px; }

.nav-link {
  padding: 7px 15px;
  font-size: 13px;
  font-weight: 500;
  color: rgba(255,255,255,0.72);
  text-decoration: none;
  border-radius: 100px;
  transition: background 0.18s, color 0.18s;
}
.nav-link:hover  { color: #fff; background: rgba(255,255,255,0.1); }
.nav-link.active { color: var(--forest); background: var(--saffron-light); }

/* ── Views ───────────────────────────────────────────── */

main { height: calc(100% - var(--topbar-h)); }
.view { display: none; height: 100%; }
.view.active { display: block; }
#view-identify { overflow-y: auto; }

.shell { display: flex; height: 100%; overflow: hidden; }

/* ── Sidebar ─────────────────────────────────────────── */

.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  background: var(--paper);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.tabs {
  display: flex;
  background: var(--cream);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.tab-btn {
  flex: 1;
  padding: 12px 4px;
  font-family: var(--sans);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink-soft);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: color 0.18s, border-color 0.18s;
}
.tab-btn:hover  { color: var(--ink-mid); }
.tab-btn.active { color: var(--forest); border-bottom-color: var(--saffron); }

.tab-panel { display: none; flex: 1; overflow-y: auto; }
.tab-panel.active { display: block; }

/* ── Forms ───────────────────────────────────────────── */

#sighting-form { padding: 18px 20px 40px; }

.field-group { border: none; margin-bottom: 22px; }

.field-group > legend {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--forest);
  margin-bottom: 10px;
}

.field-group > legend .req {
  color: var(--saffron);
  font-weight: 500;
  letter-spacing: 0.04em;
}

.field { display: block; margin-bottom: 12px; }
.field:last-child { margin-bottom: 0; }

.label-text {
  display: block;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-mid);
  margin-bottom: 5px;
}

input[type="text"],
input[type="date"],
input[type="number"],
select,
textarea {
  width: 100%;
  padding: 9px 12px;
  font-family: var(--sans);
  font-size: 13.5px;
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--forest-light);
  box-shadow: 0 0 0 3px rgba(90,138,70,0.14);
}

textarea { resize: vertical; min-height: 74px; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid-2 .field { margin-bottom: 0; }

/* ── Buttons ─────────────────────────────────────────── */

.btn-primary, .btn-secondary, .btn-ghost {
  font-family: var(--sans);
  font-weight: 500;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.18s, color 0.18s, border-color 0.18s;
}

.btn-primary {
  width: 100%;
  margin-top: 8px;
  padding: 14px;
  font-size: 14px;
  letter-spacing: 0.03em;
  background: var(--forest);
  color: #fff;
}
.btn-primary:hover:not(:disabled) { background: var(--forest-light); }
.btn-primary:disabled { background: var(--ink-soft); cursor: not-allowed; }

.btn-secondary {
  padding: 9px 15px;
  font-size: 12.5px;
  background: var(--saffron);
  color: #fff;
  white-space: nowrap;
}
.btn-secondary:hover:not(:disabled) { background: var(--saffron-deep); }
.btn-secondary:disabled { background: var(--ink-soft); cursor: not-allowed; }

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 13px;
  font-size: 12.5px;
  background: var(--white);
  color: var(--ink-mid);
  border: 1px solid var(--border);
}
.btn-ghost:hover:not(:disabled) { border-color: var(--saffron); color: var(--saffron-deep); }
.btn-ghost.active { background: var(--forest); border-color: var(--forest); color: #fff; }
.btn-ghost:disabled { opacity: 0.6; cursor: not-allowed; }

:focus-visible { outline: 2px solid var(--saffron); outline-offset: 2px; }

/* ── Location block ──────────────────────────────────── */

.geocode-row { display: flex; gap: 8px; }
.geocode-row input { flex: 1; min-width: 0; }

.geocode-status { font-size: 11.5px; line-height: 1.4; min-height: 15px; margin-top: 5px; }
.geocode-status.success { color: var(--forest); }
.geocode-status.error   { color: var(--danger); }

.location-actions { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }

.cell-readout {
  margin-top: 12px;
  padding: 11px 13px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--ink-soft);
  background: var(--cream);
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
}
.cell-readout.set {
  color: var(--ink-mid);
  background: var(--forest-wash);
  border: 1px solid #c0d8aa;
  border-style: solid;
}
.cell-readout strong { color: var(--forest); font-weight: 700; }
.cell-place { display: block; margin-top: 3px; font-style: italic; }
.cell-note  { display: block; margin-top: 6px; font-size: 11px; color: var(--ink-soft); }

/* ── Upload ──────────────────────────────────────────── */

.upload-area {
  position: relative;
  padding: 22px 16px;
  text-align: center;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 0.18s, background 0.18s;
}
.upload-area:hover, .upload-area.dragging {
  border-color: var(--saffron);
  background: var(--saffron-wash);
}
.upload-area input[type="file"] {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  opacity: 0; cursor: pointer;
}
.upload-icon { font-size: 22px; margin-bottom: 6px; }
.upload-area p { font-size: 12.5px; color: var(--ink-soft); }
.upload-area p strong { color: var(--saffron-deep); font-weight: 500; }
.upload-note { font-size: 11px !important; margin-top: 4px; }

.photo-status { font-size: 11.5px; margin-top: 8px; min-height: 15px; }
.photo-status .ok  { color: var(--forest); }
.photo-status .err { color: var(--danger); }

.exif-offer:not(:empty) {
  margin-top: 10px;
  padding: 10px 12px;
  background: var(--saffron-wash);
  border: 1px solid #ecd9b8;
  border-radius: var(--radius-sm);
}
.exif-offer p { font-size: 11.5px; color: var(--ink-mid); margin-bottom: 7px; }
.offer-row { display: flex; flex-wrap: wrap; gap: 6px; }

/* Shown when a photo has no GPS to offer. Explanatory, not an
   error — the phone removed it, the upload is fine. */
.exif-note {
  font-size: 11.5px;
  line-height: 1.55;
  color: var(--ink-mid);
  margin-bottom: 0 !important;
}
.offer-row + .exif-note { margin-top: 8px; }
.offer-row button {
  padding: 5px 10px;
  font-family: var(--sans);
  font-size: 11.5px;
  color: var(--saffron-deep);
  background: var(--white);
  border: 1px solid var(--saffron-light);
  border-radius: 100px;
  cursor: pointer;
}
.offer-row button:hover { background: var(--saffron); color: #fff; border-color: var(--saffron); }

#image-preview { display: none; margin-top: 10px; }
#image-preview img {
  width: 100%;
  max-height: 180px;
  object-fit: cover;
  border: 1px solid var(--border);
  border-radius: 8px;
}

/* ── Disclosures ─────────────────────────────────────── */

.disclosure {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 12px;
  background: var(--white);
  overflow: hidden;
}

.disclosure-head {
  width: 100%;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  font-family: var(--sans);
  text-align: left;
  background: none;
  border: none;
  cursor: pointer;
}
.disclosure-head:hover { background: var(--cream); }

.disclosure-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--forest);
  white-space: nowrap;
}
.disclosure-summary {
  font-size: 11.5px;
  color: var(--ink-mid);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chevron { color: var(--ink-soft); font-size: 11px; transition: transform 0.2s; }
.disclosure.open .chevron { transform: rotate(180deg); }

.disclosure-body { display: none; padding: 4px 14px 16px; }
.disclosure.open .disclosure-body { display: block; }

.panel-note {
  font-size: 11.5px;
  color: var(--ink-soft);
  line-height: 1.5;
  margin-bottom: 12px;
}

/* Warning under the notes textarea. notes is public, and free
   text describing the walk in defeats the grid entirely. */
.field-hint {
  display: block;
  margin-top: 6px;
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--ink-soft);
}

.subsection { margin-top: 14px; }
.terrain-readout { margin-top: 12px; font-size: 11.5px; color: var(--ink-soft); }

.muted { color: var(--ink-soft); }

/* ── Tick lists ──────────────────────────────────────── */

.tick-list { display: grid; gap: 2px; margin-bottom: 14px; }

.tick {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 7px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s;
}
.tick:hover { background: var(--cream); }
.tick input { margin-top: 2px; accent-color: var(--forest); flex-shrink: 0; }
.tick span { font-size: 13px; color: var(--ink); line-height: 1.35; }
.tick small { display: block; font-size: 11px; color: var(--ink-soft); font-style: italic; }
.tick-inline { margin-top: 10px; background: var(--cream); }

/* ── Rain chart ──────────────────────────────────────── */

.rain-bars {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 44px;
  padding: 4px 0;
}
.rain-bar {
  flex: 1;
  background: var(--forest-light);
  border-radius: 2px 2px 0 0;
  min-height: 2px;
  opacity: 0.75;
}
.rain-bar.is-day { background: var(--saffron); opacity: 1; }
.rain-axis {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: var(--ink-soft);
  margin-top: 2px;
}

.form-footnote {
  margin-top: 14px;
  font-size: 11px;
  line-height: 1.55;
  color: var(--ink-soft);
  text-align: center;
}

/* ── Map ─────────────────────────────────────────────── */

.map-wrap { flex: 1; position: relative; min-width: 0; }
#map { position: absolute; inset: 0; z-index: 0; background: var(--cream); }
#map.picking { cursor: crosshair; }

.map-controls {
  position: absolute;
  top: 12px; left: 12px; right: 12px;
  z-index: 500;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-start;
  pointer-events: none;
}
.map-controls > * { pointer-events: auto; }

.year-filter, .month-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 6px;
  background: rgba(250,248,243,0.94);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 2px 10px rgba(42,34,24,0.09);
  backdrop-filter: blur(6px);
}

.year-pill {
  padding: 5px 12px;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-mid);
  background: none;
  border: none;
  border-radius: 100px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.year-pill:hover  { background: var(--cream); }
.year-pill.active { background: var(--forest); color: #fff; }

.month-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  font-family: var(--sans);
  font-size: 11.5px;
  color: var(--ink-mid);
  background: none;
  border: 1px solid transparent;
  border-radius: 100px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, opacity 0.15s;
}
.month-chip i { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.month-chip b { font-weight: 700; font-size: 10.5px; color: var(--ink-soft); }
.month-chip.season { font-weight: 500; color: var(--ink); }
.month-chip:hover:not(:disabled) { background: var(--cream); }
.month-chip.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.month-chip.active b { color: rgba(255,255,255,0.7); }
.month-chip.no-data { opacity: 0.35; cursor: default; }

/* ── Cell markers ────────────────────────────────────── */

.cell-marker { background: none; border: none; }

.cell-ring {
  display: grid;
  place-items: center;
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(42,34,24,0.35);
  cursor: pointer;
  transition: transform 0.15s;
}
.cell-ring:hover { transform: scale(1.08); }
.cell-ring--preview { width: 36px; height: 36px; background: var(--forest); }

.cell-count {
  display: grid;
  place-items: center;
  width: 68%;
  height: 68%;
  border-radius: 50%;
  background: var(--paper);
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}

.leaflet-interactive.cell-outline {
  stroke: var(--ink);
  stroke-width: 1;
  stroke-dasharray: 4 3;
  fill: var(--ink);
  fill-opacity: 0.04;
}
path.cell-preview {
  stroke: var(--forest);
  stroke-width: 2;
  stroke-dasharray: 6 4;
  fill: var(--forest-light);
  fill-opacity: 0.15;
}

/* ── Feed ────────────────────────────────────────────── */

.panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 20px 10px;
}
.panel-count {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--forest);
}
.panel-hint { font-size: 11px; color: var(--ink-soft); }

#feed-list { padding: 0 20px 32px; display: grid; gap: 9px; }

.empty { padding: 20px; font-size: 12.5px; color: var(--ink-soft); text-align: center; }

.find-card {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 12px;
  padding: 10px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.find-card:hover, .find-card:focus-visible {
  border-color: var(--saffron-light);
  box-shadow: 0 2px 10px rgba(42,34,24,0.07);
}

.find-thumb {
  width: 64px; height: 64px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  background: var(--cream);
}

.find-body { min-width: 0; }
.find-head { display: flex; align-items: center; gap: 7px; margin-bottom: 3px; }
.month-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.find-date { font-size: 12px; font-weight: 500; color: var(--ink); }

.mine-tag, .measured-tag {
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 100px;
  background: var(--forest-wash);
  color: var(--forest);
}
.measured-tag { background: var(--saffron-wash); color: var(--saffron-deep); }

.find-place {
  font-family: var(--serif);
  font-size: 13.5px;
  color: var(--ink);
  line-height: 1.3;
  margin-bottom: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.find-meta { font-size: 11.5px; color: var(--ink-soft); line-height: 1.4; }
.find-plants { font-style: italic; }

/* ── Cell detail ─────────────────────────────────────── */

.detail-head { padding: 14px 20px 12px; border-bottom: 1px solid var(--border-soft); }

.back-btn {
  font-family: var(--sans);
  font-size: 12px;
  color: var(--forest);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0 0 8px;
}
.back-btn:hover { color: var(--saffron-deep); }

.detail-head h2 { font-family: var(--serif); font-size: 17px; font-weight: 500; }
.detail-sub { font-size: 11.5px; color: var(--ink-soft); margin-top: 4px; line-height: 1.45; }

.detail-list { padding: 14px 20px 32px; display: grid; gap: 14px; }

.detail-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.detail-card > img {
  width: 100%;
  height: 170px;
  object-fit: cover;
  display: block;
  background: var(--cream);
}
.detail-meta { padding: 12px 14px 14px; }

.detail-rows { margin-top: 9px; display: grid; gap: 5px; }
.detail-rows > div { display: grid; grid-template-columns: 108px 1fr; gap: 8px; }
.detail-rows dt {
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-soft);
  padding-top: 1px;
}
.detail-rows dd { font-size: 12.5px; color: var(--ink-mid); }

.detail-notes {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border-soft);
  font-size: 12.5px;
  font-style: italic;
  color: var(--ink-mid);
  line-height: 1.5;
}

.detail-actions { margin-top: 12px; display: flex; gap: 8px; }
.detail-actions button {
  font-family: var(--sans);
  font-size: 11.5px;
  padding: 5px 12px;
  border-radius: 100px;
  cursor: pointer;
  background: none;
  border: 1px solid var(--border);
  color: var(--ink-soft);
}
.detail-actions .delete-btn:hover { border-color: var(--danger); color: var(--danger); }
.detail-actions .report-btn:hover { border-color: var(--ink-mid); color: var(--ink-mid); }
.detail-actions button:disabled { opacity: 0.5; cursor: not-allowed; }

/* ── Conditions now ──────────────────────────────────── */

#conditions-now { padding: 18px 20px 32px; }

.now-place {
  font-family: var(--serif);
  font-size: 18px;
  color: var(--ink);
  margin-bottom: 14px;
}

.now-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }

.stat {
  padding: 12px 10px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-align: center;
}
.stat-value {
  display: block;
  font-family: var(--serif);
  font-size: 23px;
  font-weight: 500;
  color: var(--forest);
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.stat-value em { font-size: 12px; font-style: normal; color: var(--ink-soft); margin-left: 1px; }
.stat-label {
  display: block;
  margin-top: 5px;
  font-size: 10px;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
  line-height: 1.3;
}

.now-chart {
  margin-top: 16px;
  padding: 12px 14px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.now-chart .rain-bars { height: 52px; }

.now-note {
  margin-top: 14px;
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--ink-soft);
}

/* ── Toast ───────────────────────────────────────────── */

.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(16px);
  max-width: min(420px, calc(100vw - 32px));
  padding: 12px 22px;
  background: var(--ink);
  color: #fff;
  font-size: 13px;
  text-align: center;
  border-radius: 100px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
  z-index: 9999;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ═══ Identification guide ════════════════════════════ */

.guide {
  max-width: 720px;
  margin: 0 auto;
  padding: 44px 24px 90px;
}

.guide-head { margin-bottom: 30px; }

.eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--saffron);
  margin-bottom: 8px;
}

.guide h1 {
  font-family: var(--serif);
  font-size: clamp(30px, 6vw, 44px);
  font-weight: 500;
  line-height: 1.06;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

.standfirst {
  font-family: var(--serif);
  font-size: 17px;
  font-style: italic;
  color: var(--ink-mid);
  margin-top: 12px;
  max-width: 54ch;
}

/* Hero at the top of the identification guide. width/height are
   on the <img> so the safety notice below it doesn't get shoved
   down when the photo finally decodes. */
.guide-hero { margin: 0 0 30px; }
.guide-hero img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  background: var(--cream);
}
.guide-hero figcaption {
  margin-top: 9px;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--ink-soft);
}

.safety {
  padding: 18px 20px;
  background: var(--danger-wash);
  border-left: 4px solid var(--danger);
  border-radius: 0 var(--radius) var(--radius) 0;
  margin-bottom: 40px;
}
.safety h2 {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--danger);
  margin-bottom: 9px;
}
.safety p { font-size: 14px; line-height: 1.6; color: var(--ink-mid); }
.safety p + p { margin-top: 10px; }
.safety strong { color: var(--ink); }

/* Steps — a genuine sequence, so the numbering means something */
.step {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 18px;
  padding: 26px 0;
  border-top: 1px solid var(--border);
}

.step-num {
  display: grid;
  place-items: center;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--forest);
  color: #fff;
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 600;
}

.step-body h2 {
  font-family: var(--serif);
  font-size: 23px;
  font-weight: 500;
  margin-bottom: 10px;
  text-wrap: balance;
}
.step-body > p { font-size: 14.5px; line-height: 1.62; color: var(--ink-mid); margin-bottom: 16px; }

/* Diagrams */
.diagram {
  width: 100%;
  max-width: 340px;
  height: auto;
  margin: 4px 0 18px;
  display: block;
}
.dg-cap    { fill: #e8955f; }
.dg-zone   { fill: none; stroke: #c4671f; stroke-width: 1.5; opacity: 0.8; }
.dg-gill   { stroke: #d4831a; stroke-width: 1.6; stroke-linecap: round; }
.dg-latex  { fill: #e8621b; }
.dg-stem   { fill: #edb277; }
.dg-pit    { fill: #b8590f; }
.dg-bruise { fill: var(--verdigris); }
.dg-label  { font-family: var(--sans); font-size: 10px; fill: var(--ink-soft); }

/* Your own photos, in place of a diagram — see js/guide.js.
   auto-fit keeps one photo full-width at the diagram's size
   and lets two or three share the row instead of stacking. */
.guide-photos {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  max-width: 340px;
  margin: 4px 0 18px;
}
.guide-photo { margin: 0; }
.guide-photo img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
  background: var(--cream);
}
.guide-photo figcaption {
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--ink-soft);
}
.guide-photo figcaption:empty { display: none; }
.guide-photo.is-missing figcaption { color: var(--danger); font-style: italic; }

/* Branches */
.branch {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  padding: 13px 16px;
  border-radius: var(--radius);
  margin-bottom: 10px;
}
.branch.yes { background: var(--forest-wash); }
.branch.no  { background: var(--cream); }

.branch-tag {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding-top: 2px;
  color: var(--forest);
}
.branch.no .branch-tag { color: var(--ink-soft); }

.branch p { font-size: 14px; line-height: 1.55; color: var(--ink-mid); }
.branch b { color: var(--ink); font-weight: 500; }

.branch-result { display: block; margin-top: 5px; font-weight: 700; color: var(--forest); }
.branch.no .branch-result { color: var(--ink-soft); }
/* Only the tag belongs in column 1. Anything else auto-placed
   into that `auto` track stretches it to fit a whole paragraph
   and squeezes the branch text into what's left — which is what
   a third child (.branch-note) used to do. Keyed on "not the
   tag" rather than on the note specifically, so adding a fourth
   child can't bring the bug back. */
.branch > *:not(.branch-tag) { grid-column: 2; }

.branch-note {
  margin-top: 8px;
  font-size: 12.5px !important;
  font-style: italic;
}

.aside {
  margin-top: 16px;
  padding: 14px 16px;
  background: var(--saffron-wash);
  border-left: 3px solid var(--saffron-light);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 13.5px !important;
  line-height: 1.6;
  color: var(--ink-mid);
}
.aside b { color: var(--ink); }

/* Swatches */
.swatches {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 9px;
  margin-bottom: 18px;
}
.swatch {
  padding: 12px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-align: center;
}
.swatch.pass { border-color: var(--forest-light); box-shadow: 0 0 0 2px var(--forest-wash); }
.swatch i {
  display: block;
  width: 34px; height: 34px;
  margin: 0 auto 8px;
  border-radius: 50%;
  border: 1px solid rgba(42,34,24,0.14);
}
.swatch b { display: block; font-size: 12.5px; color: var(--ink); }
.swatch small { display: block; margin-top: 3px; font-size: 10.5px; color: var(--ink-soft); line-height: 1.35; }

/* Lookalikes */
.lookalikes { padding: 30px 0 0; border-top: 1px solid var(--border); }
.lookalikes > h2 {
  font-family: var(--serif);
  font-size: 25px;
  font-weight: 500;
  margin-bottom: 14px;
  text-wrap: balance;
}
.lookalikes > p { font-size: 14.5px; line-height: 1.65; color: var(--ink-mid); margin-bottom: 14px; }

.lookalike-cards { display: grid; gap: 12px; margin: 22px 0; }

.lookalike {
  padding: 16px 18px;
  background: var(--white);
  border: 1px solid var(--border);
  border-left-width: 4px;
  border-radius: 0 var(--radius) var(--radius) 0;
}
.lookalike.danger  { border-left-color: var(--danger); }
.lookalike.caution { border-left-color: var(--saffron); }

.lookalike h3 { font-family: var(--serif); font-size: 17px; font-weight: 500; }
.lookalike .verdict {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 4px 0 9px;
}
.lookalike.danger  .verdict { color: var(--danger); }
.lookalike.caution .verdict { color: var(--saffron-deep); }
.lookalike p { font-size: 13.5px; line-height: 1.58; color: var(--ink-mid); }
.lookalike p + p { margin-top: 8px; }
.lookalike .tell b { color: var(--ink); }

/* Field notes */
.field-notes { padding: 30px 0 0; border-top: 1px solid var(--border); margin-top: 30px; }
.field-notes h2 { font-family: var(--serif); font-size: 25px; font-weight: 500; margin-bottom: 16px; }
.field-notes dl { display: grid; gap: 1px; background: var(--border-soft); border: 1px solid var(--border-soft); border-radius: var(--radius); overflow: hidden; }
.field-notes dl > div { display: grid; grid-template-columns: 96px 1fr; gap: 14px; padding: 12px 16px; background: var(--paper); }
.field-notes dt {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--ink-soft);
  padding-top: 2px;
}
.field-notes dd { font-size: 13.5px; line-height: 1.55; color: var(--ink-mid); }

.guide-foot {
  margin-top: 34px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}
.guide-foot p { font-size: 12.5px; line-height: 1.65; color: var(--ink-soft); }

/* ── Leaflet overrides ───────────────────────────────── */

.leaflet-control-attribution { font-size: 10px !important; }
.leaflet-bar a { border-radius: 4px !important; }

/* ── Responsive ──────────────────────────────────────── */

@media (max-width: 860px) {
  :root { --sidebar-w: 320px; }
  .find-card { grid-template-columns: 56px 1fr; }
  .find-thumb { width: 56px; height: 56px; }
}

@media (max-width: 720px) {
  .shell { flex-direction: column-reverse; }

  .sidebar {
    width: 100%;
    min-width: 0;
    height: 55%;
    border-right: none;
    border-top: 1px solid var(--border);
  }

  .map-wrap { height: 45%; flex: none; }

  /* The map is only ~340px tall here, so the overlay has to
     earn its space. One scrolling row instead of two wrapped
     ones gives ~30px back. */
  .map-controls {
    top: 8px; left: 8px; right: 8px;
    align-items: stretch;
    gap: 6px;
  }
  .year-filter { align-self: flex-start; }

  .month-legend {
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 3px;
    padding: 5px;
    scrollbar-width: none;
  }
  .month-legend::-webkit-scrollbar { display: none; }
  .month-chip { padding: 3px 7px; font-size: 11px; flex-shrink: 0; }
  .month-chip b { display: none; }

  .now-stats { grid-template-columns: 1fr; }
  .step { grid-template-columns: 32px 1fr; gap: 12px; }
  .step-num { width: 30px; height: 30px; font-size: 15px; }
  .guide { padding: 30px 18px 70px; }
  .detail-rows > div { grid-template-columns: 1fr; gap: 1px; }
  .field-notes dl > div { grid-template-columns: 1fr; gap: 2px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
