:root {
  --ds-page: #faf9f6;
  --ds-ink: #1c1c1a;
  --ds-ink-2: #6b6b66;
  --ds-hairline: #e3e1db;
  --ds-raised: #f0eee9;
  --ds-teal: #0f766e;
  --ds-red: #b42921;
}
html, body { margin: 0; min-height: 100%; overflow-x: clip; }
body { overflow-wrap: break-word; touch-action: manipulation; }
body { background: var(--ds-page); color: var(--ds-ink); font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif; -webkit-font-smoothing: antialiased; }
.page { max-width: 720px; margin: 0 auto; padding: calc(16px + env(safe-area-inset-top, 0px)) 16px calc(32px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 20px; }
.lede { margin: 0; font-size: 15px; line-height: 22px; color: var(--ds-ink-2); }
h2.group-label { margin: 24px 0 12px; font-size: 20px; line-height: 26px; }
h2.group-label:first-child { margin-top: 0; }
p { font-size: 15px; line-height: 22px; }
.caption { font-size: 12px; line-height: 18px; color: var(--ds-ink-2); }
.closing { font-size: 12px; line-height: 18px; color: var(--ds-ink-2); border-top: 1px solid var(--ds-hairline); padding-top: 16px; }

.file-nav { display: flex; flex-wrap: wrap; gap: 20px; border-bottom: 1px solid var(--ds-hairline); }
.file-nav a { padding: 10px 0; color: var(--ds-ink-2); text-decoration: none; font-size: 15px; }
.file-nav a[aria-current="page"] { color: var(--ds-ink); box-shadow: inset 0 -1px 0 var(--ds-ink); }
@media (max-width: 600px) { .file-nav a { display: inline-flex; align-items: center; min-height: 44px; } }

.install-hint { display: flex; align-items: center; gap: 10px; background: #26361f; color: #fff; border-radius: 14px; padding: 12px 16px; font-size: 14px; line-height: 20px; }
.install-hint button { margin-left: auto; flex: none; border: 0; border-radius: 999px; padding: 8px 14px; font: inherit; font-weight: 600; background: #fff; color: #26361f; cursor: pointer; }
.install-hint[hidden] { display: none; }
.install-hint .hint-close { background: none; color: rgba(255,255,255,.8); padding: 8px 4px; font-weight: 400; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 8px 16px; border-radius: 999px; border: 0; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; text-decoration: none; }
.btn-primary { background: var(--ds-teal); color: #fff; }
.btn-secondary { background: var(--ds-raised); color: var(--ds-ink); }
.btn-ghost { background: none; color: var(--ds-ink-2); }
.btn-compact { min-height: 36px; padding: 6px 14px; font-size: 13px; }
.btn:disabled { opacity: 0.55; cursor: default; }

.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; line-height: 18px; font-weight: 600; letter-spacing: 0.01em; }
.badge-edible { color: var(--ds-teal); background: color-mix(in srgb, var(--ds-teal) 12%, transparent); }
.badge-cook { color: var(--ds-teal); background: transparent; box-shadow: inset 0 0 0 1px var(--ds-teal); }
.badge-noteating { color: var(--ds-ink-2); background: var(--ds-raised); }
.badge-poisonous { color: var(--ds-red); background: color-mix(in srgb, var(--ds-red) 10%, transparent); }

.tile-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 12px; }
@media (min-width: 768px) { .tile-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px 16px; } }
.tile { display: flex; flex-direction: column; gap: 6px; min-width: 0; padding: 0; border: 0; background: none; text-align: left; cursor: pointer; font: inherit; color: inherit; text-decoration: none; }
.tile-photo { display: block; aspect-ratio: 4 / 5; border-radius: 12px; overflow: hidden; background: var(--ds-raised); }
.tile-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tile-name { font-weight: 600; font-size: 14px; line-height: 20px; }
.tile-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tile-found { font-size: 12px; line-height: 18px; font-weight: 600; color: var(--ds-teal); }

.photo-strip { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 6px; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; }
.photo-strip img { flex: none; height: 340px; width: auto; max-width: 85vw; object-fit: cover; border-radius: 12px; scroll-snap-align: start; object-fit: cover; background: var(--ds-raised); }
.species-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.species-latin { font-size: 14px; font-style: italic; color: var(--ds-ink-2); }
.species-actions { display: flex; gap: 12px; flex-wrap: wrap; }

.callout { border-radius: 14px; padding: 12px 16px; font-size: 14px; line-height: 20px; }
.callout-warning { background: color-mix(in srgb, #b45309 10%, transparent); color: #7c3a06; }
.callout-title { display: block; font-weight: 700; margin-bottom: 4px; }

.check-list { display: flex; flex-direction: column; }
.check-row { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 8px 0; border: 0; border-bottom: 1px solid var(--ds-hairline); background: none; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.check-box { flex: none; width: 26px; height: 26px; border-radius: 8px; box-shadow: inset 0 0 0 1.5px var(--ds-ink-2); display: inline-flex; align-items: center; justify-content: center; font-size: 15px; font-weight: 700; color: #fff; }
.check-box.is-on { background: var(--ds-teal); box-shadow: inset 0 0 0 1.5px var(--ds-teal); }
.check-names { flex: 1 1 auto; display: flex; flex-direction: column; min-width: 0; }
.check-row .badge { flex: none; text-align: center; }
.check-name { font-weight: 600; font-size: 14px; line-height: 20px; }
.check-latin { font-size: 12px; font-style: italic; color: var(--ds-ink-2); }

.pick-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.pick-chip { padding: 8px 12px; min-height: 36px; border-radius: 999px; border: 0; background: var(--ds-raised); color: var(--ds-ink); font: inherit; font-size: 13px; cursor: pointer; }
.pick-chip.is-picked { background: var(--ds-teal); color: #fff; font-weight: 600; }
.form-fields { display: flex; flex-direction: column; gap: 14px; margin-top: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field-label { font-size: 12px; color: var(--ds-ink-2); }
.field input, .field textarea { font: inherit; font-size: 16px; color: var(--ds-ink); padding: 10px 12px; border: 1px solid var(--ds-hairline); border-radius: 8px; background: #fff; width: 100%; box-sizing: border-box; }
.field textarea { resize: vertical; }
.form-actions { margin-top: 16px; }

.entry-list { display: flex; flex-direction: column; }
.entry { display: flex; align-items: flex-start; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--ds-hairline); }
.entry-body { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.entry-name { font-weight: 600; font-size: 14px; line-height: 20px; }
.entry-facts { font-size: 12px; color: var(--ds-ink-2); }
.entry-notes { font-size: 14px; line-height: 20px; white-space: pre-wrap; }

.book-warning { margin: 0; background: #b42921; color: #fff; font-weight: 700; font-size: 15px; line-height: 22px; padding: 14px 16px; border-radius: 14px; }
.book-bullets { margin: 0; padding: 0 0 0 4px; list-style: none; display: flex; flex-direction: column; gap: 10px; }
.book-bullets li { position: relative; padding-left: 20px; font-size: 15px; line-height: 22px; color: var(--ds-ink); }
.book-bullets li::before { content: ''; position: absolute; left: 2px; top: 8px; width: 7px; height: 7px; border-radius: 50%; background: #b42921; }
.book-credit { margin: 0; display: inline-block; align-self: flex-start; background: #26361f; color: #fff; font-size: 13px; font-weight: 600; line-height: 18px; padding: 8px 14px; border-radius: 999px; }

.hero { position: relative; border-radius: 16px; overflow: hidden; min-height: 190px; display: flex; align-items: flex-end; background: #2b2b26; }
.hero-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 54%; }
.hero-shade { position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,0.62) 0%, rgba(0,0,0,0.28) 55%, rgba(0,0,0,0.12) 100%); }
.hero-text { position: relative; padding: 20px; display: flex; flex-direction: column; gap: 2px; }
.hero-title { margin: 0; font-family: Georgia, 'Times New Roman', serif; font-weight: 700; font-size: 30px; line-height: 34px; color: #fff; text-shadow: 0 1px 8px rgba(0,0,0,0.45); }
.hero-fact { margin: 0; font-size: 12px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: rgba(255,255,255,0.92); text-shadow: 0 1px 6px rgba(0,0,0,0.5); }
@media (min-width: 768px) { .hero { min-height: 240px; } .hero-title { font-size: 38px; line-height: 42px; } }

/* mobile: prevent iOS input-focus autozoom */
input, textarea, select { font-size: 16px; }

.community-qr { display: inline-block; padding: 10px; background: #fff; border-radius: 16px; border: 1px solid var(--ds-hairline); }
.community-qr img { display: block; width: 148px; height: auto; border-radius: 8px; }

#app > div { display: contents; }
html { background: var(--ds-page); }
.callout + .species-actions, p + .species-actions { margin-top: 16px; }
.species-actions { row-gap: 12px; }
