:root {
  color-scheme: light;
  --forest: #2f6b3d;
  --forest-dark: #174624;
  --cream: #f7f3e8;
  --surface: #ffffff;
  --text: #263128;
  --muted: #6b746d;
  --line: #dfe6dc;
  --notice: #e7efe2;
  --warning: #7a4b00;
  --danger: #9a2f2a;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--cream);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}
a { color: var(--forest-dark); }
img { display: block; max-width: 100%; }
button, input { font: inherit; }
[hidden] { display: none !important; }

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.site-header,
.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 11px clamp(16px, 4vw, 52px);
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.site-header { position: sticky; top: 0; z-index: 20; }
.site-footer {
  margin-top: 48px;
  border-top: 1px solid var(--line);
  border-bottom: 0;
  color: var(--muted);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--forest-dark);
  font-size: 1.45rem;
  font-weight: 900;
  text-decoration: none;
}
.brand-mark {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 50%;
  background: var(--forest);
  color: #fff;
}
.brand-mark svg {
  width: 25px;
  height: 25px;
  fill: currentColor;
}

.header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}
.language-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 4px;
}
.language-link {
  min-width: 40px;
  padding: 9px 10px;
  border-radius: 999px;
  color: var(--forest-dark);
  font-weight: 850;
  text-align: center;
  text-decoration: none;
}
.language-link:hover,
.language-link.active { background: var(--notice); }

.login-button {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  gap: 7px;
  padding: 9px 15px;
  border-radius: 999px;
  background: var(--forest);
  color: #fff;
  font-weight: 850;
  text-decoration: none;
}
.login-button:hover { background: var(--forest-dark); }

.public-notice {
  padding: 9px 18px;
  background: var(--notice);
  color: #35563b;
  font-size: 0.88rem;
  font-weight: 650;
  text-align: center;
}

.page-shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
}
.catalog-shell { width: min(760px, calc(100% - 32px)); }

.catalog-intro { padding: 28px 0 16px; }
.catalog-intro h1 {
  margin: 0;
  color: var(--forest-dark);
  font-size: clamp(1.9rem, 5vw, 2.4rem);
  line-height: 1.15;
  letter-spacing: -0.025em;
}
.catalog-intro p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 1rem;
}

.catalog-controls { margin-bottom: 18px; }
.search-box {
  display: flex;
  min-height: 52px;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  border: 1px solid #eef0ec;
  border-radius: 18px;
  background: #fff;
}
.search-icon {
  color: #465149;
  font-size: 1.65rem;
  line-height: 1;
  transform: rotate(-15deg);
}
.search-box input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 1rem;
}
.search-box input::placeholder { color: #777f79; }

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.filter-chip {
  min-height: 38px;
  padding: 7px 14px;
  border: 1px solid #bfcabf;
  border-radius: 10px;
  background: transparent;
  color: #4d5750;
  cursor: pointer;
}
.filter-chip:hover { border-color: var(--forest); }
.filter-chip.active {
  border-color: #d9ead8;
  background: #dcefd9;
  color: var(--forest-dark);
  font-weight: 700;
}
.result-count {
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 0.94rem;
}

.species-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
.species-card {
  overflow: hidden;
  border: 1px solid #eef0ec;
  border-radius: 20px;
  background: #fff;
}
.species-card-link {
  display: grid;
  min-height: 108px;
  grid-template-columns: 88px minmax(0, 1fr) 24px;
  align-items: center;
  gap: 14px;
  padding: 14px;
  color: inherit;
  text-decoration: none;
}
.species-card-link:hover { background: #fbfcfa; }
.species-thumb {
  width: 74px;
  height: 74px;
  border-radius: 14px;
  object-fit: cover;
  background: var(--notice);
}
.species-card-copy { min-width: 0; }
.species-card h2 {
  margin: 0;
  color: #303832;
  font-size: 1.02rem;
  line-height: 1.25;
}
.scientific-name {
  margin: 5px 0 9px;
  color: #7a817c;
  font-family: Georgia, "Times New Roman", serif;
  font-style: italic;
}
.scientific-name.large { margin: 10px 0 20px; font-size: 1.35rem; }
.card-arrow {
  color: #8a918c;
  font-size: 2rem;
  font-weight: 300;
}
.category {
  display: inline-flex;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 800;
}
.category-edible { background: #e5f2e2; color: #2a6338; }
.category-caution { background: #fff1d8; color: #8a5500; }
.category-toxic { background: #f9e4e3; color: #a0322d; }
.category-inedible { background: #ededed; color: #505650; }
.catalog-empty {
  padding: 30px 18px;
  border-radius: 18px;
  background: #fff;
  color: var(--muted);
  text-align: center;
}
.catalog-safety { margin-top: 22px; }

h1, h2 { color: var(--forest-dark); line-height: 1.15; }
.hero { padding: clamp(44px, 8vw, 84px) 0 40px; }
.eyebrow {
  margin: 0 0 8px;
  color: var(--forest);
  font-size: 0.82rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.species-detail-page h1 {
  max-width: 860px;
  margin: 0;
  font-size: clamp(2.25rem, 6vw, 4.5rem);
  letter-spacing: -0.04em;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 26px;
}
.button {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  padding: 11px 18px;
  border: 1px solid var(--forest);
  border-radius: 14px;
  font-weight: 850;
  text-decoration: none;
}
.button.primary { background: var(--forest); color: #fff; }
.button.secondary { background: #fff; color: var(--forest-dark); }

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 24px 0 10px;
  color: var(--muted);
  font-size: 0.9rem;
}
.species-page { padding: 20px 0 0; }
.species-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(320px, 1.1fr);
  align-items: center;
  gap: clamp(28px, 6vw, 72px);
  padding: 28px 0 42px;
}
.species-figure {
  overflow: hidden;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: #fff;
}
.species-figure > img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: contain;
  background: linear-gradient(135deg, #174624, #4c8254);
}
.photo-credit {
  margin: 0;
  padding: 10px 14px 12px;
  color: var(--muted);
  font-size: 0.78rem;
}
.content-section,
.info-card,
.safety-note,
.catalog-note {
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #fff;
}
.content-section { padding: clamp(22px, 4vw, 34px); }
.content-section h2,
.info-card h2 { margin: 0 0 10px; font-size: 1.25rem; }
.content-section p,
.info-card p,
.safety-note p { margin: 0; }
.info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 16px;
}
.info-card { padding: 22px; }
.lookalike-list { margin: 0; padding-left: 20px; }
.lookalike-list li + li { margin-top: 6px; }
.scientific-inline { color: var(--muted); font-style: italic; }
.safety-note {
  margin-top: 18px;
  padding: 20px 22px;
  border-color: #e3c37d;
  background: #fff1d8;
  color: var(--warning);
}
.safety-note.severe {
  border-color: #e4a38b;
  background: #ffe8de;
  color: var(--danger);
}
.safety-note strong { display: block; margin-bottom: 6px; }
.catalog-note {
  margin-top: 16px;
  padding: 16px 18px;
  color: var(--muted);
  font-size: 0.9rem;
}

@media (max-width: 760px) {
  .site-header { position: static; align-items: flex-start; }
  .header-actions { align-items: flex-end; flex-direction: column-reverse; }
  .species-hero-grid { grid-template-columns: 1fr; }
  .species-hero-grid > div { order: 2; }
  .species-figure { order: 1; }
  .info-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .site-header {
    align-items: center;
    flex-wrap: wrap;
  }
  .brand { font-size: 1.2rem; }
  .brand-mark { width: 40px; height: 40px; }
  .header-actions {
    width: 100%;
    align-items: center;
    flex-direction: row;
    justify-content: space-between;
  }
  .language-nav {
    display: flex;
    flex-wrap: nowrap;
  }
  .language-link {
    min-width: 35px;
    padding: 7px 8px;
  }
  .login-button { padding: 8px 12px; font-size: 0.88rem; }
  .species-card-link {
    grid-template-columns: 72px minmax(0, 1fr) 20px;
    gap: 11px;
    padding: 11px;
  }
  .species-thumb { width: 68px; height: 68px; }
  .site-footer { align-items: flex-start; flex-direction: column; }
}
