:root {
  --bg: #f6f4ee;
  --surface: #ffffff;
  --surface-2: #efece2;
  --text: #23291f;
  --text-dim: #5c6555;
  --border: #dedad0;
  --accent: #2f5233;
  --accent-2: #8a6d2f;
  --accent-3: #7a3b3b;
  --shadow: 0 2px 10px rgba(30, 40, 20, 0.08);
  --radius: 14px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #14170f;
    --surface: #1d2117;
    --surface-2: #262b1e;
    --text: #ecebe3;
    --text-dim: #a6ad9a;
    --border: #333a29;
    --accent: #7fbf8a;
    --accent-2: #d9b968;
    --accent-3: #d98a8a;
    --shadow: 0 2px 14px rgba(0, 0, 0, 0.4);
  }
}
:root[data-theme="dark"] {
  --bg: #14170f;
  --surface: #1d2117;
  --surface-2: #262b1e;
  --text: #ecebe3;
  --text-dim: #a6ad9a;
  --border: #333a29;
  --accent: #7fbf8a;
  --accent-2: #d9b968;
  --accent-3: #d98a8a;
  --shadow: 0 2px 14px rgba(0, 0, 0, 0.4);
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", "Heebo", Arial, sans-serif;
  overflow-x: hidden;
}

.site-header {
  background: linear-gradient(135deg, var(--accent) 0%, #1d3620 100%);
  color: #fff;
  padding: 2.2rem 1rem 1.6rem;
  text-align: center;
}
.header-inner h1 { margin: 0 0 0.4rem; font-size: 1.9rem; }
.subtitle { margin: 0; opacity: 0.9; font-size: 0.95rem; }

.controls {
  position: sticky; top: 0; z-index: 10;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0.8rem 1rem;
}
.controls-inner { max-width: 1100px; margin: 0 auto; }
#search {
  width: 100%;
  padding: 0.65rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-size: 1rem;
  margin-bottom: 0.7rem;
}
#search:focus { outline: 2px solid var(--accent); }

.tabs {
  display: flex; flex-wrap: wrap; gap: 0.5rem;
  overflow-x: auto;
}
.tab {
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-dim);
  padding: 0.45rem 0.95rem;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.88rem;
  white-space: nowrap;
}
.tab.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.tab-link { display: inline-flex; align-items: center; text-decoration: none; }
.tab-link.is-current { background: var(--accent); color: #fff; border-color: var(--accent); }
.catalog-note {
  max-width: 760px;
  margin: 0.2rem auto 1rem;
  color: var(--text-dim);
  line-height: 1.7;
  text-align: center;
}

main { max-width: 1100px; margin: 0 auto; padding: 1rem; }
.result-count { color: var(--text-dim); font-size: 0.85rem; margin: 0.2rem 0.3rem 0.8rem; }
.empty-state { text-align: center; color: var(--text-dim); padding: 3rem 1rem; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 1rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  cursor: pointer;
  display: flex; flex-direction: column;
  transition: transform 0.12s ease;
}
.card:hover { transform: translateY(-2px); }
.card-img {
  width: 100%; aspect-ratio: 4/3;
  background: var(--surface-2);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  color: var(--text-dim); font-size: 2rem;
}
.card-img img { width: 100%; height: 100%; object-fit: cover; }
.card-body { padding: 0.8rem 0.9rem 0.9rem; flex: 1; display: flex; flex-direction: column; gap: 0.25rem; }
.card-name { font-weight: 700; font-size: 1.02rem; }
.card-english { display: inline; margin-inline-start: 0.35rem; color: var(--muted); font-size: 0.86em; font-weight: 600; }
.card-english::before { content: "("; }
.card-english::after { content: ")"; }
.card-latin {
  font-style: italic;
  color: var(--text-dim);
  font-size: 0.85rem;
  direction: ltr;
  unicode-bidi: isolate;
  text-align: right;
}
.card-desc { font-size: 0.85rem; color: var(--text-dim); flex: 1; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.badge-row { display: flex; gap: 0.35rem; flex-wrap: wrap; margin-top: 0.3rem; }
.badge {
  font-size: 0.7rem; padding: 0.15rem 0.55rem; border-radius: 999px;
  background: var(--surface-2); color: var(--text-dim); border: 1px solid var(--border);
}
.badge.cat-buy_israel { background: color-mix(in srgb, var(--accent-2) 20%, transparent); color: var(--accent-2); border-color: transparent; }
.badge.cat-seed_abroad { background: color-mix(in srgb, var(--accent-3) 18%, transparent); color: var(--accent-3); border-color: transparent; }

.modal-backdrop[hidden] { display: none; }
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,0.55);
  display: flex; align-items: center; justify-content: center;
  padding: 1rem; z-index: 100;
}
.modal {
  background: var(--surface); border-radius: var(--radius);
  max-width: 560px; width: 100%; max-height: 88vh; overflow-y: auto;
  position: relative; box-shadow: var(--shadow);
}
.modal-close {
  position: absolute; top: 0.6rem; left: 0.6rem;
  background: var(--surface-2); border: none; border-radius: 50%;
  width: 2rem; height: 2rem; cursor: pointer; font-size: 1rem; color: var(--text);
  z-index: 2;
}
.modal-img { width: 100%; aspect-ratio: 16/10; background: var(--surface-2); overflow: hidden; display:flex; align-items:center; justify-content:center; font-size: 3rem; }
.modal-img img { width: 100%; height: 100%; object-fit: cover; }
.modal-content { padding: 1.2rem 1.3rem 1.5rem; }
.modal-content h2 { margin: 0 0 0.15rem; }
.modal-content .card-latin { font-size: 0.95rem; margin-bottom: 0.6rem; }
.modal-field { margin-top: 0.7rem; }
.modal-field-label { font-size: 0.75rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.03em; margin-bottom: 0.2rem; }
.modal-field-value { font-size: 0.92rem; line-height: 1.5; }

footer {
  max-width: 1100px; margin: 1rem auto 2rem; padding: 1rem;
  color: var(--text-dim); font-size: 0.78rem; text-align: center; line-height: 1.6;
}

/* ---- detail / grouped species pages ---- */
.home-link { text-decoration: none; color: inherit; }
.detail-main { max-width: 1100px; margin: 0 auto; padding: 1.2rem 1rem 2rem; }

.breadcrumb { font-size: 0.85rem; color: var(--text-dim); margin: 0 0 1rem; }
.breadcrumb a { color: var(--accent); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }

.detail-card {
  display: flex; flex-wrap: wrap; gap: 1.4rem;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 1.2rem; margin-bottom: 1.6rem;
}
.home-hero-card { justify-content: center; text-align: center; padding: 2.4rem 1.6rem; margin-top: 1rem; }
.home-hero-content { flex: 1 1 100%; max-width: 640px; }
.home-hero-content h2 { font-size: 1.9rem; }
.home-cta-button { font-size: 1.05rem; padding: 0.85rem 2.4rem; margin-top: 1.2rem; }
.detail-img {
  flex: 1 1 280px; max-width: 340px; aspect-ratio: 4/3; border-radius: var(--radius);
  overflow: hidden; background: var(--surface-2);
  display: flex; align-items: center; justify-content: center; font-size: 3rem;
}
.detail-img img { width: 100%; height: 100%; object-fit: cover; }
.detail-media { flex: 1 1 280px; max-width: 340px; align-self: flex-start; }
.detail-media .detail-img { max-width: none; width: 100%; position: relative; }
.plant-gallery img { transition: opacity 180ms ease, transform 240ms ease; }
.plant-gallery:hover img { transform: scale(1.025); }
.plant-gallery img.is-changing { opacity: 0; }
.gallery-count {
  position: absolute; inset-inline-end: 0.65rem; bottom: 0.65rem; z-index: 2;
  padding: 0.22rem 0.5rem; border-radius: 999px;
  background: rgba(16, 34, 20, 0.76); color: #fff; font-size: 0.7rem;
  line-height: 1; backdrop-filter: blur(5px);
}
.gallery-thumbs {
  display: flex; gap: 0.45rem; padding: 0.55rem 0 0.1rem;
  overflow-x: auto; scrollbar-width: thin; scroll-snap-type: x proximity;
}
.gallery-thumb {
  flex: 0 0 64px; width: 64px; height: 48px; padding: 0;
  overflow: hidden; border: 2px solid transparent; border-radius: 8px;
  background: var(--surface-2); cursor: pointer; opacity: 0.72;
  scroll-snap-align: center;
  transition: opacity 150ms ease, border-color 150ms ease, transform 150ms ease;
}
.gallery-thumb:hover { opacity: 1; transform: translateY(-1px); }
.gallery-thumb:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.gallery-thumb.is-active { opacity: 1; border-color: var(--accent); }
.gallery-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gallery-dots {
  position: absolute; inset-inline: 0; bottom: 0.65rem; z-index: 2;
  display: flex; justify-content: center; gap: 0.42rem;
}
.gallery-dot {
  width: 0.7rem; height: 0.7rem; padding: 0; border: 1px solid rgba(255,255,255,0.9);
  border-radius: 50%; background: rgba(18,35,21,0.5); cursor: pointer;
  box-shadow: 0 1px 5px rgba(0,0,0,0.28);
}
.gallery-dot.is-active { background: #fff; transform: scale(1.18); }
.media-credit {
  margin: 0.45rem 0 0; color: var(--text-dim); font-size: 0.68rem;
  line-height: 1.45; overflow-wrap: anywhere;
}
.media-credit a { color: var(--accent); text-underline-offset: 2px; }
.no-img { color: var(--text-dim); }
.detail-content { flex: 2 1 320px; min-width: 0; }
.detail-content h2 { margin: 0 0 0.2rem; font-size: 1.5rem; }
.detail-english { display: inline; margin-inline-start: 0.4rem; color: var(--muted); font-size: 0.68em; font-weight: 600; }
.detail-english::before { content: "("; }
.detail-english::after { content: ")"; }
.detail-latin { font-size: 1rem; margin-bottom: 0.6rem; }
.detail-field { margin-top: 0.8rem; }
.detail-field-label { font-size: 0.75rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.03em; margin-bottom: 0.2rem; }
.detail-field-value { font-size: 0.95rem; line-height: 1.6; }
.detail-field-value a { color: var(--accent); text-underline-offset: 2px; overflow-wrap: anywhere; }
.species-note { color: var(--text-dim); font-size: 0.92rem; line-height: 1.6; margin-top: 0.8rem; }

.external-sources {
  margin-top: 1.4rem; padding-top: 1.2rem; border-top: 1px solid var(--border);
}
.external-sources h3 { margin: 0 0 0.7rem; font-size: 1.05rem; }
.source-links { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.source-links a {
  display: inline-grid; gap: 0.08rem; min-width: min(230px, 100%);
  padding: 0.65rem 0.8rem; border: 1px solid var(--border); border-radius: 10px;
  color: var(--text); text-decoration: none; background: var(--surface);
  transition: border-color 140ms ease, transform 140ms ease;
}
.source-links a:hover { border-color: var(--accent); transform: translateY(-1px); }
.source-links span { color: var(--accent); font-weight: 700; }
.source-links small { color: var(--text-dim); line-height: 1.35; }
.external-sources > p { margin: 0.65rem 0 0; color: var(--text-dim); font-size: 0.75rem; }

.section-title { margin: 1.6rem 0 0.9rem; font-size: 1.15rem; }

.sibling-list { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.sibling-link {
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text-dim);
  padding: 0.4rem 0.9rem; border-radius: 999px; text-decoration: none; font-size: 0.86rem;
}
.sibling-link.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.sibling-link:hover:not(.active) { background: var(--border); }

.grid a.card { text-decoration: none; color: inherit; }

/* ---- community navigation, accounts and personal plant actions ---- */
.header-inner { position: relative; max-width: 1100px; margin: 0 auto; }
.community-header-actions {
  position: absolute; top: 50%; right: 0; transform: translateY(-50%);
  display: flex; align-items: center; gap: 0.55rem;
}
.menu-toggle, .account-button {
  border: 1px solid rgba(255,255,255,0.28); color: #fff;
  background: rgba(255,255,255,0.1); border-radius: 999px;
  min-height: 2.45rem; cursor: pointer;
}
.menu-toggle { width: 2.65rem; display: grid; place-content: center; gap: 4px; padding: 0; }
.menu-toggle span { display: block; width: 17px; height: 2px; border-radius: 2px; background: currentColor; }
.account-button { padding: 0.45rem 0.9rem; max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-toggle:hover, .account-button:hover { background: rgba(255,255,255,0.18); }
.drawer-overlay {
  position: fixed; inset: 0; z-index: 80; border: 0; padding: 0;
  background: rgba(10,16,9,0.52); backdrop-filter: blur(2px); cursor: default;
  animation: fade-in 150ms ease-out;
}
.site-drawer {
  position: fixed; top: 0; right: 0; z-index: 90; width: min(350px, 88vw); height: 100svh;
  background: var(--surface); color: var(--text); padding: 1.25rem;
  box-shadow: -20px 0 50px rgba(0,0,0,0.18); animation: drawer-in 180ms ease-out;
}
.drawer-top { display: flex; align-items: center; justify-content: space-between; padding-bottom: 1rem; border-bottom: 1px solid var(--border); }
.drawer-top strong { font-size: 1.05rem; }
.drawer-close { border: 0; background: none; color: var(--text); font-size: 1.8rem; line-height: 1; cursor: pointer; }
.drawer-links { display: grid; margin-top: 0.8rem; }
.drawer-links a {
  color: var(--text); text-decoration: none; padding: 0.9rem 0.2rem;
  border-bottom: 1px solid var(--border); font-size: 1rem;
}
.drawer-links a[aria-current="page"] { color: var(--accent); font-weight: 700; }
.drawer-account {
  width: 100%; margin-top: 1rem; border: 1px solid var(--accent); border-radius: 999px;
  background: var(--accent); color: #fff; padding: 0.75rem 1rem; cursor: pointer;
}
.auth-dialog {
  width: min(520px, calc(100vw - 2rem)); border: 1px solid var(--border); border-radius: 20px;
  background: var(--surface); color: var(--text); padding: 2rem; box-shadow: 0 24px 70px rgba(0,0,0,0.28);
}
.auth-dialog::backdrop { background: rgba(10,16,9,0.58); backdrop-filter: blur(3px); }
.auth-close { position: absolute; top: 0.8rem; left: 0.9rem; border: 0; background: none; color: var(--text); font-size: 1.7rem; cursor: pointer; }
.auth-dialog h2 { margin: 0.15rem 0 0.55rem; font-size: 1.65rem; }
.auth-dialog p { color: var(--text-dim); line-height: 1.6; }
.eyebrow { margin: 0; color: var(--accent) !important; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.04em; }
.oauth-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 0.65rem; margin-top: 1.2rem; }
.oauth-actions button, .sign-out-button {
  border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); color: var(--text);
  padding: 0.75rem; cursor: pointer;
}
.auth-divider { display: flex; align-items: center; gap: 0.8rem; margin: 1.2rem 0; color: var(--text-dim); font-size: 0.8rem; }
.auth-divider::before, .auth-divider::after { content: ''; height: 1px; background: var(--border); flex: 1; }
.magic-link-form label { display: block; font-size: 0.82rem; margin-bottom: 0.4rem; color: var(--text-dim); }
.inline-form { display: flex; gap: 0.5rem; }
.inline-form input, .form-field input, .form-field textarea, .form-field select {
  min-width: 0; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); color: var(--text);
  padding: 0.72rem 0.8rem; font: inherit;
}
.inline-form input { flex: 1; direction: ltr; text-align: left; }
.primary-button, .secondary-button {
  border: 1px solid var(--accent); border-radius: 999px; padding: 0.68rem 1rem; cursor: pointer; font: inherit;
}
.primary-button { background: var(--accent); color: #fff; }
.secondary-button { background: transparent; color: var(--accent); }
.primary-button:disabled, .secondary-button:disabled, button:disabled { opacity: 0.55; cursor: not-allowed; }
.auth-status { min-height: 1.5em; font-size: 0.82rem; }
.auth-status.is-error { color: var(--accent-3); }
.auth-links { display: flex; justify-content: space-between; gap: 0.8rem; margin: 0.8rem 0 0; font-size: 0.82rem; }
.link-button { border: 0; background: none; color: var(--accent); cursor: pointer; font: inherit; padding: 0; }
.turnstile-widget { margin: 0.2rem 0; }
.account-links { display: flex; gap: 0.6rem; margin: 1.2rem 0; }
.account-links a { color: var(--accent); text-decoration: none; }
.community-actions { display: flex; gap: 0.6rem; margin: 0.95rem 0 0.2rem; }
.plant-action {
  display: inline-flex; align-items: center; gap: 0.45rem; border: 1px solid var(--border);
  border-radius: 999px; background: var(--surface-2); color: var(--text); padding: 0.48rem 0.85rem; cursor: pointer;
  transition: background 140ms ease, color 140ms ease, border-color 140ms ease, transform 140ms ease;
}
.plant-action:hover { transform: translateY(-1px); border-color: var(--accent); }
.plant-action.is-active { background: color-mix(in srgb, var(--accent) 14%, var(--surface)); color: var(--accent); border-color: var(--accent); }
.action-icon { font-size: 1.08rem; }
.community-toast {
  position: fixed; left: 50%; bottom: 1.2rem; z-index: 120; transform: translate(-50%, 20px);
  background: var(--text); color: var(--surface); border-radius: 999px; padding: 0.65rem 1rem;
  opacity: 0; pointer-events: none; transition: opacity 160ms ease, transform 160ms ease;
}
.community-toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

/* ---- community workspace pages ---- */
.workspace-main { max-width: 1000px; padding-top: 2rem; }
.workspace-heading { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: 1.6rem; }
.workspace-heading h2 { margin: 0; font-size: clamp(1.7rem, 4vw, 2.5rem); }
.workspace-heading p { margin: 0.35rem 0 0; color: var(--text-dim); }
.quiet-state { padding: 2.4rem 0; border-top: 1px solid var(--border); color: var(--text-dim); line-height: 1.7; }
.collection-section { margin-top: 2rem; }
.collection-section h3 { margin: 0 0 0.6rem; }
.collection-list { border-top: 1px solid var(--border); }
.collection-row {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 1rem;
  padding: 0.9rem 0; border-bottom: 1px solid var(--border); color: inherit; text-decoration: none;
}
.collection-row strong { display: block; }
.collection-row em { display: block; color: var(--text-dim); font-size: 0.82rem; font-weight: 400; direction: ltr; unicode-bidi: isolate; }
.collection-row span:last-child { color: var(--accent); }
.directory-list { border-top: 1px solid var(--border); }
.directory-entry { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 1.2rem; padding: 1.2rem 0; border-bottom: 1px solid var(--border); }
.directory-entry h3 { margin: 0 0 0.35rem; }
.directory-entry p { margin: 0; color: var(--text-dim); line-height: 1.55; }
.directory-meta { display: grid; gap: 0.3rem; justify-items: start; }
.directory-meta a { color: var(--accent); }
.submission-panel { margin-top: 2.2rem; padding-top: 1.4rem; border-top: 1px solid var(--border); }
.stacked-form { display: grid; gap: 0.85rem; max-width: 680px; }
.form-field { display: grid; gap: 0.35rem; }
.form-field label { font-size: 0.82rem; color: var(--text-dim); }
.form-field textarea { min-height: 130px; resize: vertical; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.85rem; }

/* ---- bilingual forum ---- */
.forum-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; }
.forum-toolbar select { border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--text); padding: 0.58rem 0.85rem; }
.forum-layout { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 2rem; }
.forum-categories { border-top: 1px solid var(--border); }
.forum-category {
  display: block; width: 100%; text-align: start; border: 0; border-bottom: 1px solid var(--border);
  background: transparent; color: var(--text); padding: 0.8rem 0; cursor: pointer;
}
.forum-category.is-active { color: var(--accent); font-weight: 700; }
.topic-list { border-top: 1px solid var(--border); }
.topic-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1rem; padding: 1rem 0; border-bottom: 1px solid var(--border); cursor: pointer; }
.topic-row h3 { margin: 0 0 0.3rem; font-size: 1.02rem; }
.topic-meta, .post-meta { color: var(--text-dim); font-size: 0.78rem; }
.language-badge { align-self: start; border: 1px solid var(--border); border-radius: 999px; padding: 0.16rem 0.5rem; color: var(--text-dim); font-size: 0.7rem; }
.topic-detail[hidden], .topic-index[hidden] { display: none; }
.topic-back { border: 0; background: transparent; color: var(--accent); padding: 0; cursor: pointer; margin-bottom: 1rem; }
.topic-body { white-space: pre-wrap; line-height: 1.75; padding: 1rem 0 1.5rem; border-bottom: 1px solid var(--border); }
.forum-post { padding: 1rem 0; border-bottom: 1px solid var(--border); }
.forum-post p { white-space: pre-wrap; line-height: 1.7; }
.native-dialog { width: min(620px, calc(100vw - 2rem)); border: 1px solid var(--border); border-radius: 18px; background: var(--surface); color: var(--text); padding: 1.5rem; }
.native-dialog::backdrop { background: rgba(10,16,9,0.58); }
.dialog-heading { display: flex; justify-content: space-between; gap: 1rem; align-items: center; margin-bottom: 1rem; }
.dialog-heading h2 { margin: 0; }
.dialog-heading button { border: 0; background: none; color: var(--text); font-size: 1.6rem; cursor: pointer; }

@keyframes fade-in { from { opacity: 0; } }
@keyframes drawer-in { from { transform: translateX(100%); } }

@media (max-width: 720px) {
  .site-header { padding-top: 4.2rem; }
  .community-header-actions { top: -2.9rem; right: 0; transform: none; }
  .account-button { max-width: 120px; }
  .oauth-actions, .form-grid { grid-template-columns: 1fr; }
  .inline-form { flex-direction: column; }
  .workspace-heading { align-items: start; flex-direction: column; }
  .directory-entry, .forum-layout { grid-template-columns: 1fr; }
  .forum-categories { display: flex; gap: 0.5rem; overflow-x: auto; border-top: 0; padding-bottom: 0.6rem; }
  .forum-category { width: auto; border: 1px solid var(--border); border-radius: 999px; padding: 0.45rem 0.75rem; white-space: nowrap; }
}

/* ---- scientific sources directory ---- */
.sources-page { scroll-behavior: smooth; }
.sources-site-header { padding-block: 1.4rem 1.15rem; }
.sources-main { max-width: 1180px; padding: 0 1.25rem 5rem; }
.sources-hero {
  min-height: min(680px, calc(100svh - 120px)); display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(300px, 0.92fr); align-items: center;
  gap: clamp(2rem, 7vw, 7rem); padding: clamp(4rem, 10vw, 8rem) 0 5rem;
  border-bottom: 1px solid var(--border); overflow: hidden;
}
.sources-hero-copy { max-width: 650px; animation: sources-rise 620ms cubic-bezier(.2,.72,.25,1) both; }
.sources-kicker {
  margin: 0 0 0.8rem; color: var(--accent); font-size: 0.78rem; font-weight: 800;
  letter-spacing: 0.08em; text-transform: uppercase;
}
.sources-hero h2 {
  margin: 0; font-size: clamp(2.7rem, 7vw, 6rem); line-height: 0.98;
  letter-spacing: -0.055em; text-wrap: balance;
}
.sources-hero-copy > p:not(.sources-kicker) {
  max-width: 610px; margin: 1.7rem 0 0; color: var(--text-dim);
  font-size: clamp(1rem, 2vw, 1.2rem); line-height: 1.8;
}
.sources-start {
  display: inline-flex; align-items: center; gap: 0.7rem; margin-top: 2rem;
  color: var(--accent); font-weight: 750; text-decoration: none;
  border-bottom: 1px solid currentColor; padding-bottom: 0.25rem;
}
.sources-start span { transition: transform 180ms ease; }
.sources-start:hover span { transform: translateY(4px); }
.botanical-mark { position: relative; display: grid; place-items: center; min-height: 440px; }
.botanical-mark::before {
  content: ''; position: absolute; width: min(430px, 90%); aspect-ratio: 1; border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 9%, var(--surface));
}
.botanical-mark svg { position: relative; z-index: 1; width: min(390px, 88%); height: auto; overflow: visible; }
.botanical-mark .stem, .botanical-mark .branch {
  fill: none; stroke: var(--accent); stroke-width: 5; stroke-linecap: round;
}
.botanical-mark .branch { stroke-width: 3; opacity: 0.74; }
.botanical-mark .leaf { fill: color-mix(in srgb, var(--accent) 24%, var(--surface)); stroke: var(--accent); stroke-width: 3; }
.botanical-mark .fruit { fill: color-mix(in srgb, var(--accent-2) 58%, var(--surface)); stroke: var(--accent-2); stroke-width: 3; }
.botanical-mark .seed { fill: var(--surface); opacity: 0.78; }
.source-principle {
  display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 1.5rem;
  align-items: baseline; padding: 1.5rem 0; border-bottom: 1px solid var(--border);
}
.source-principle strong { color: var(--accent); }
.source-principle p { margin: 0; color: var(--text-dim); line-height: 1.7; }
.source-index {
  position: sticky; top: 0; z-index: 9; display: flex; gap: 0.4rem; overflow-x: auto;
  margin-inline: -1.25rem; padding: 0.85rem 1.25rem;
  background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border); scrollbar-width: thin;
}
.source-index a {
  flex: 0 0 auto; color: var(--text-dim); text-decoration: none; font-size: 0.82rem;
  border: 1px solid transparent; border-radius: 999px; padding: 0.4rem 0.75rem;
  transition: color 140ms ease, border-color 140ms ease, background 140ms ease;
}
.source-index a:hover { color: var(--accent); border-color: var(--border); background: var(--surface); }
.source-section { scroll-margin-top: 4.5rem; padding: clamp(4rem, 8vw, 7rem) 0 0; }
.source-section-heading {
  display: grid; grid-template-columns: 70px minmax(0, 1fr); gap: 1.2rem;
  align-items: start; margin-bottom: 1.8rem;
}
.source-section-heading > span { color: var(--accent-2); font-size: 0.78rem; font-weight: 800; padding-top: 0.35rem; }
.source-section-heading h3 { margin: 0; font-size: clamp(1.8rem, 4vw, 3.1rem); letter-spacing: -0.035em; }
.source-section-heading p { margin: 0.55rem 0 0; color: var(--text-dim); line-height: 1.65; }
.source-directory { border-top: 1px solid var(--border); }
.source-entry {
  display: grid; grid-template-columns: minmax(190px, 0.8fr) minmax(280px, 1.4fr) minmax(185px, 0.65fr);
  gap: clamp(1rem, 3vw, 2.5rem); align-items: center; padding: 1.25rem 0;
  border-bottom: 1px solid var(--border); color: inherit; text-decoration: none;
  transition: padding-inline 170ms ease, background 170ms ease, border-color 170ms ease;
}
.source-entry:hover {
  padding-inline: 0.8rem; background: color-mix(in srgb, var(--accent) 5%, var(--surface));
  border-color: var(--accent);
}
.source-entry > div { min-width: 0; }
.source-entry strong { display: block; font-size: 1.02rem; }
.source-entry span { display: block; margin-top: 0.25rem; color: var(--text-dim); font-size: 0.75rem; line-height: 1.35; }
.source-entry p { margin: 0; color: var(--text-dim); line-height: 1.6; font-size: 0.9rem; }
.source-entry b {
  color: var(--accent); direction: ltr; text-align: left; unicode-bidi: isolate;
  font-size: 0.78rem; font-weight: 650; overflow-wrap: anywhere;
}
.source-entry-featured { background: color-mix(in srgb, var(--accent) 4%, transparent); }
.source-entry-featured strong::after {
  content: 'מומלץ'; display: inline-block; margin-inline-start: 0.5rem; padding: 0.12rem 0.4rem;
  border-radius: 999px; background: color-mix(in srgb, var(--accent) 13%, transparent);
  color: var(--accent); font-size: 0.62rem; vertical-align: 0.16em;
}
.sources-note {
  margin-top: clamp(5rem, 10vw, 9rem); padding: clamp(2rem, 6vw, 4.5rem);
  background: var(--accent); color: #fff; border-radius: 2px;
}
.sources-note .sources-kicker { color: #d6e8d7; }
.sources-note h3 {
  margin: 0; max-width: 780px; font-size: clamp(2rem, 5vw, 4.2rem);
  line-height: 1.04; letter-spacing: -0.045em;
}
.sources-note > p:not(.sources-kicker) {
  max-width: 800px; margin: 1.3rem 0; color: rgba(255,255,255,0.82); line-height: 1.8;
}
.sources-note a { display: inline-block; color: #fff; font-weight: 700; text-underline-offset: 0.3em; }
@keyframes sources-rise {
  from { opacity: 0; transform: translateY(22px); }
  to { opacity: 1; transform: none; }
}
@media (max-width: 780px) {
  .sources-site-header { padding-top: 4.2rem; }
  .sources-hero { min-height: auto; grid-template-columns: 1fr; gap: 1rem; padding-top: 3.5rem; }
  .botanical-mark { min-height: 280px; }
  .botanical-mark svg { width: min(270px, 74%); }
  .source-principle { grid-template-columns: 1fr; gap: 0.35rem; }
  .source-section-heading { grid-template-columns: 42px minmax(0, 1fr); }
  .source-entry { grid-template-columns: 1fr; gap: 0.55rem; padding-block: 1.15rem; }
  .source-entry b { text-align: right; }
}
@media (prefers-reduced-motion: reduce) {
  .sources-hero-copy { animation: none; }
  .sources-start span, .source-entry { transition: none; }
  .sources-page { scroll-behavior: auto; }
}

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

.scientific-primary {
  display: inline-block;
  direction: ltr;
  unicode-bidi: isolate;
  font-style: italic;
}
.name-status {
  direction: rtl;
  text-align: right;
  font-style: normal;
  color: var(--text-dim);
  font-size: 0.84rem;
}
.name-status-badge {
  display: inline-block;
  margin-inline-start: 0.55rem;
  padding: 0.16rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-dim);
  font-size: 0.66rem;
  font-style: normal;
  font-weight: 600;
  vertical-align: 0.15em;
}
.translated-name-note {
  margin-top: 0.38rem;
  color: var(--text-dim);
  font-size: 0.78rem;
}

/* ---- donate page ---- */
.header-donate-link {
  display: inline-block;
  margin-top: 0.7rem;
  padding: 0.35rem 1rem;
  border-radius: 999px;
  background: rgba(255,255,255,0.16);
  color: #fff;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  border: 1px solid rgba(255,255,255,0.35);
  transition: background 0.15s ease;
}
.header-donate-link:hover { background: rgba(255,255,255,0.28); }

.donate-intro-card { margin-bottom: 1.4rem; }
.donate-intro-text { font-size: 1rem; line-height: 1.75; }

.donate-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.2rem;
  margin-bottom: 1.6rem;
}
.donate-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.4rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.6rem;
}
.donate-card-primary { border-color: var(--accent); }
.donate-card-header { display: flex; flex-direction: column; align-items: center; gap: 0.4rem; }
.donate-card-header h3 { margin: 0; font-size: 1.2rem; }
.donate-badge {
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.7rem;
  border-radius: 999px;
}
.donate-card-text { color: var(--text-dim); font-size: 0.92rem; margin: 0; }
.donate-button {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  padding: 0.7rem 1.8rem;
  border-radius: 999px;
  font-size: 1rem;
  margin: 0.3rem 0;
  transition: opacity 0.15s ease;
}
.donate-button:hover { opacity: 0.88; }
.donate-button-disabled {
  background: var(--surface-2);
  color: var(--text-dim);
  cursor: default;
}
.donate-card-hint { color: var(--text-dim); font-size: 0.82rem; margin: 0.4rem 0 0.2rem; }
.donate-qr {
  max-width: 260px;
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--border);
}
.donate-footnote {
  text-align: center;
  color: var(--text-dim);
  font-size: 0.9rem;
  margin-top: 0.5rem;
}

/* ---- back to top ---- */
.back-to-top {
  position: fixed;
  bottom: 1.3rem;
  left: 1.3rem;
  z-index: 90;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--accent);
  font-size: 1.3rem;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 140ms ease, opacity 140ms ease;
}
.back-to-top:hover { transform: translateY(-2px); }
.back-to-top[hidden] { display: none; }

/* ---- feedback widget ---- */
.feedback-button {
  position: fixed;
  bottom: 1.3rem;
  right: 1.3rem;
  z-index: 90;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  padding: 0.65rem 1.1rem;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 600;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 140ms ease, border-color 140ms ease;
}
.feedback-button:hover { transform: translateY(-2px); border-color: var(--accent); }
.share-collection-button {
  position: fixed;
  bottom: 4.6rem;
  right: 1.3rem;
  z-index: 90;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
  padding: 0.65rem 1.1rem;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 600;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 140ms ease, opacity 140ms ease;
}
.share-collection-button:hover { transform: translateY(-2px); opacity: 0.9; }
.feedback-dialog {
  width: min(480px, calc(100vw - 2rem)); border: 1px solid var(--border); border-radius: 20px;
  background: var(--surface); color: var(--text); padding: 2rem; box-shadow: 0 24px 70px rgba(0,0,0,0.28);
}
.feedback-dialog::backdrop { background: rgba(10,16,9,0.58); backdrop-filter: blur(3px); }
.feedback-dialog h2 { margin: 0.15rem 0 0.55rem; font-size: 1.5rem; }
.feedback-dialog p { color: var(--text-dim); line-height: 1.6; }
.feedback-dialog .stacked-form { margin-top: 1.1rem; }

/* ---- comments ---- */
.comments-section { margin-top: 1.8rem; }
.comments-list { margin-bottom: 1.4rem; }
.comment-row { padding: 0.9rem 0; border-bottom: 1px solid var(--border); }
.comment-meta { display: flex; align-items: baseline; gap: 0.6rem; margin-bottom: 0.3rem; }
.comment-meta strong { font-size: 0.92rem; }
.comment-meta span { color: var(--text-dim); font-size: 0.78rem; }
.comment-row p { margin: 0; line-height: 1.6; }
.comment-form textarea { min-height: 90px; }

@media (max-width: 640px) {
  .feedback-button { right: 0.8rem; bottom: 0.8rem; padding: 0.55rem 0.9rem; font-size: 0.82rem; }
  .share-collection-button { right: 0.8rem; bottom: 3.9rem; padding: 0.55rem 0.9rem; font-size: 0.82rem; }
  .back-to-top { left: 0.8rem; bottom: 0.8rem; width: 2.6rem; height: 2.6rem; }
}

.professional-cta-card { margin-top: 1.6rem; }
.professional-cta-card h3 { margin: 0 0 0.5rem; }
.professional-cta-card .donate-button { margin-top: 0.8rem; direction: ltr; }

/* ---- admin panel ---- */
.admin-section { margin-top: 2.2rem; }
.admin-row { align-items: start; }
.admin-row .directory-meta { flex-direction: row; gap: 0.5rem; }
.comment-row-meta { margin: 0 0 0.3rem; color: var(--text-dim); font-size: 0.8rem; }
.comment-row-meta a { color: var(--accent); }
#comments-search { border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--text); padding: 0.5rem 0.9rem; min-width: 240px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
