
:root {
  --forest-950: oklch(0.23 0.045 155);
  --forest-900: oklch(0.29 0.055 155);
  --forest-700: oklch(0.43 0.075 153);
  --forest-600: oklch(0.51 0.085 151);
  --sage-300: oklch(0.80 0.075 133);
  --sage-100: oklch(0.94 0.025 128);
  --paper-50: oklch(0.985 0.008 125);
  --paper-100: oklch(0.955 0.018 125);
  --ink-900: oklch(0.25 0.035 155);
  --ink-600: oklch(0.47 0.025 153);
  --line: oklch(0.86 0.025 132);
  --danger: oklch(0.50 0.14 28);
  --bg: var(--paper-100);
  --surface: var(--paper-50);
  --ink: var(--ink-900);
  --muted: var(--ink-600);
  --primary: var(--forest-900);
  --primary-fg: var(--paper-50);
  --accent: var(--sage-300);
  --hero: var(--forest-950);
  --font-display: "Literata", Georgia, serif;
  --font-body: "Manrope", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 120px; }
body { margin: 0; min-width: 320px; min-height: 100dvh; background: var(--bg); color: var(--ink); font-family: var(--font-body); font-size: 16px; line-height: 1.65; }
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
img, svg { max-width: 100%; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { font-family: var(--font-display); line-height: 1.18; text-wrap: balance; }
:focus-visible { outline: 3px solid var(--forest-600); outline-offset: 3px; }
::selection { background: var(--sage-300); color: var(--forest-950); }
.wrap { width: min(100% - 32px, 1180px); margin-inline: auto; }
.latin, .scientific { font-style: italic; }
.scientific { color: var(--muted); overflow-wrap: anywhere; }
.public-site { min-height: 100dvh; display: flex; flex-direction: column; }
.public-site main { flex: 1; }
.button { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--primary); border-radius: 8px; padding: 10px 17px; background: var(--primary); color: var(--primary-fg); font-weight: 700; transition: transform 160ms ease, background 160ms ease; }
.button:hover { background: var(--forest-700); transform: translateY(-1px); }
.button:active { transform: translateY(0); }
.button:disabled { opacity: .48; cursor: not-allowed; transform: none; }
.button.secondary { background: transparent; color: var(--ink); border-color: var(--line); }
.button.secondary:hover { background: var(--sage-100); }
.button.compact { min-height: 38px; padding: 7px 12px; font-size: .88rem; }
.text-link { display: inline-flex; align-items: center; gap: 5px; color: var(--forest-700); font-weight: 700; margin-top: 10px; }
.text-link:hover { text-decoration: underline; }

.site-header { position: sticky; top: 0; z-index: 30; box-shadow: 0 1px 0 var(--line); }
.header-bar { min-height: 74px; display: flex; align-items: center; gap: 22px; padding-block: 10px; }
.site-header::before { content: ""; position: absolute; inset: 0 0 auto; height: 74px; background: var(--surface); z-index: -1; }
.brand { display: flex; align-items: center; gap: 11px; flex: none; }
.brand img { width: 44px; height: 44px; object-fit: contain; }
.brand span { display: grid; line-height: 1.2; }
.brand strong { font-family: var(--font-display); font-size: 1.15rem; }
.brand small { color: var(--muted); font-size: .71rem; margin-top: 4px; }
.header-search { flex: 1; max-width: 400px; margin-left: auto; display: flex; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); overflow: hidden; }
.header-search input { min-width: 0; flex: 1; min-height: 42px; border: 0; padding: 8px 12px; background: transparent; color: var(--ink); outline: 0; }
.header-search button { width: 44px; border: 0; background: transparent; color: var(--muted); display: grid; place-items: center; }
.header-search button:hover { color: var(--ink); background: var(--sage-100); }
.header-search:focus-within { outline: 2px solid var(--forest-600); outline-offset: 2px; }
.header-actions { display: flex; align-items: center; gap: 10px; }
.languages { display: flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.languages button { min-width: 40px; min-height: 40px; border: 0; background: var(--surface); color: var(--muted); font-size: .75rem; font-weight: 800; }
.languages button:hover { background: var(--sage-100); color: var(--ink); }
.languages button[aria-pressed="true"] { background: var(--primary); color: var(--primary-fg); }
.menu-button { display: none; width: 44px; height: 44px; place-items: center; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); }
.main-nav { background: var(--hero); color: var(--paper-50); }
.main-nav .wrap { display: flex; align-items: stretch; }
.main-nav a { display: flex; align-items: center; min-height: 45px; padding: 8px 13px; border-bottom: 3px solid transparent; color: var(--sage-100); font-size: .85rem; font-weight: 700; transition: background 160ms ease, color 160ms ease; }
.main-nav a:hover { background: oklch(0.38 0.055 155); color: var(--paper-50); }
.main-nav a.active { border-bottom-color: var(--accent); color: var(--paper-50); }
.main-nav .admin-link { margin-left: auto; }

.hero { position: relative; overflow: hidden; background: var(--hero); color: var(--paper-50); }
.hero-inner { min-height: 420px; display: grid; grid-template-columns: minmax(0, 1fr) 260px; align-items: center; gap: 48px; padding-block: 56px 64px; position: relative; }
.hero-copy { position: relative; z-index: 2; }
.hero h1 { font-size: clamp(2.25rem, 5vw, 4.25rem); max-width: 15ch; letter-spacing: -.035em; }
.hero-copy > p { margin-top: 20px; max-width: 55ch; color: var(--sage-100); font-size: 1.04rem; }
.hero-emblem { width: 240px; height: 240px; object-fit: contain; position: relative; z-index: 2; filter: drop-shadow(0 18px 35px oklch(0.15 0.03 155 / .28)); }
.hero-vein { position: absolute; width: 520px; right: -120px; top: -110px; color: var(--sage-300); opacity: .12; }
.hero-search { max-width: 690px; display: flex; gap: 10px; margin-top: 30px; }
.hero-search input { min-width: 0; flex: 1; min-height: 52px; border: 1px solid transparent; border-radius: 8px; padding: 12px 15px; background: var(--paper-50); color: var(--ink); }
.hero-search input:focus { border-color: var(--accent); outline: 2px solid var(--accent); outline-offset: 2px; }
.hero-search button { min-height: 52px; display: flex; align-items: center; gap: 8px; border: 0; border-radius: 8px; padding: 12px 18px; background: var(--accent); color: var(--forest-950); font-weight: 800; white-space: nowrap; }
.hero-search button:hover { background: var(--sage-100); }
.quick-search { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 16px; color: var(--sage-100); font-size: .85rem; }
.quick-search button, .quick-search a { display: inline-flex; align-items: center; text-decoration: none; min-height: 32px; border: 1px solid oklch(0.8 0.075 133 / .4); border-radius: 999px; padding: 3px 12px; background: transparent; color: var(--paper-50); }
.quick-search button:hover, .quick-search a:hover { background: oklch(0.94 0.025 128 / .12); }

.editorial-section { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 40px; padding-block: 42px 12px; }
.editorial-section > h2 { font-size: 1.3rem; padding-top: 4px; }
.section-content { min-width: 0; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); border-block: 1px solid var(--line); }
.stats > div { display: grid; gap: 4px; padding: 22px 18px; }
.stats > div + div { border-left: 1px solid var(--line); }
.stats strong { font-family: var(--font-display); color: var(--forest-700); font-size: clamp(2.2rem, 5vw, 3.6rem); line-height: 1; }
.stats span { color: var(--muted); font-weight: 700; }
.stat-note { margin-top: 10px; color: var(--muted); font-size: .9rem; }
.analytics-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 38px; }
.analytics-grid h3 { font-size: 1rem; margin-bottom: 16px; }
.bars { display: grid; gap: 12px; }
.bar-row { display: grid; grid-template-columns: minmax(85px, 38%) 1fr 24px; gap: 10px; align-items: center; font-size: .85rem; }
.bar-row > span { overflow-wrap: anywhere; }
.bar-row strong { font-variant-numeric: tabular-nums; }
.bar-track { height: 8px; background: var(--sage-100); overflow: hidden; }
.bar-track i { display: block; height: 100%; background: var(--forest-600); }
.group-grid { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); }
.group-tile { min-width: 0; padding: 22px; background: var(--surface); transition: background 180ms ease; }
.group-tile + .group-tile { border-left: 1px solid var(--line); }
.group-tile:hover { background: var(--sage-100); }
.group-icon { display: block; color: var(--forest-600); margin-bottom: 18px; }
.group-tile h3 { font-size: 1.07rem; }
.group-tile p { color: var(--muted); font-size: .84rem; line-height: 1.55; margin-top: 9px; min-height: 4.6em; }
.group-tile strong { display: flex; align-items: center; justify-content: space-between; gap: 5px; margin-top: 18px; color: var(--forest-700); font-size: .78rem; }
.quote-section blockquote { margin: 0; padding: 24px 28px; border-block: 1px solid var(--line); font-family: var(--font-display); font-size: 1.2rem; line-height: 1.6; }
.quote-section cite { display: block; margin-top: 10px; color: var(--muted); font-family: var(--font-body); font-size: .85rem; font-style: normal; }
.section-top-link { display: flex; justify-content: flex-end; margin-bottom: 14px; }
.section-top-link a { display: inline-flex; align-items: center; gap: 6px; color: var(--forest-700); font-weight: 700; font-size: .88rem; }
.section-top-link a:hover { text-decoration: underline; }
.plant-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.plant-card { min-width: 0; display: block; background: var(--surface); border: 1px solid var(--line); overflow: hidden; transition: border-color 180ms ease, transform 180ms ease; }
.plant-card:hover { border-color: var(--forest-600); transform: translateY(-3px); }
.plant-art { aspect-ratio: 4 / 3; overflow: hidden; background: var(--sage-100); }
.plant-art img, .plant-art svg { width: 100%; height: 100%; display: block; object-fit: cover; transition: transform 220ms ease; }
.plant-card:hover .plant-art img { transform: scale(1.025); }
.plant-card-body { padding: 14px 15px 16px; }
.plant-card h3 { font-size: 1.05rem; overflow-wrap: anywhere; }
.plant-card .scientific { font-size: .8rem; margin-top: 5px; }
.tag { display: inline-block; color: var(--forest-700); font-size: .74rem; font-weight: 700; margin-top: 10px; }
.about-section { padding-bottom: 66px; }
.about-copy { max-width: 68ch; color: var(--muted); line-height: 1.8; }

.page-content { padding-block: 38px 70px; min-height: 50vh; }
.page-content.narrow { max-width: 900px; }
.page-heading { display: flex; align-items: center; gap: 12px; padding-bottom: 24px; border-bottom: 1px solid var(--line); margin-bottom: 26px; }
.page-heading > svg, .page-heading > span { color: var(--forest-600); }
.page-heading h1 { font-size: clamp(1.8rem, 4vw, 2.65rem); }
.page-lead { color: var(--muted); margin-bottom: 18px; }
.catalog-tools { display: grid; gap: 14px; }
.search-field { max-width: 520px; display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding-inline: 13px; color: var(--muted); }
.search-field input { min-width: 0; flex: 1; min-height: 46px; border: 0; background: transparent; color: var(--ink); outline: 0; }
.search-field:focus-within { border-color: var(--forest-600); outline: 2px solid var(--forest-600); outline-offset: 2px; }
.filter-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.filter-chips button { min-height: 40px; padding: 7px 13px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink); font-size: .83rem; font-weight: 700; }
.filter-chips button:hover { border-color: var(--forest-600); }
.filter-chips button.selected { background: var(--primary); border-color: var(--primary); color: var(--primary-fg); }
.filter-chips.secondary button { min-height: 34px; font-size: .76rem; }
.result-count { color: var(--muted); font-size: .87rem; margin-block: 18px 14px; }
.empty-state { min-height: 180px; display: grid; justify-items: start; align-content: center; gap: 16px; color: var(--muted); }
.empty-state h1 { color: var(--ink); }
.pagination { display: flex; justify-content: center; align-items: center; gap: 18px; margin-top: 30px; }
.pagination span { color: var(--muted); font-variant-numeric: tabular-nums; }
.detail-page { padding-block: 26px 64px; }
.back-link { display: inline-flex; align-items: center; gap: 6px; color: var(--forest-700); font-weight: 700; margin-bottom: 24px; }
.back-link:hover { text-decoration: underline; }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); align-items: center; gap: 46px; }
.detail-art { aspect-ratio: 4 / 3; max-height: 500px; background: var(--sage-100); overflow: hidden; }
.detail-art img, .detail-art svg { display: block; width: 100%; height: 100%; object-fit: cover; }
.detail-label { color: var(--forest-600); font-size: .75rem; font-weight: 800; letter-spacing: .12em; }
.detail-intro h1 { font-size: clamp(2.1rem, 5vw, 4rem); margin-top: 12px; overflow-wrap: anywhere; }
.detail-intro .scientific { font-size: 1.1rem; margin-top: 8px; }
.detail-facts { margin-top: 38px; }
.detail-facts section { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 30px; border-top: 1px solid var(--line); padding-block: 24px; }
.detail-facts h2, .herbarium-data > h2 { color: var(--forest-700); font-size: 1.2rem; }
.detail-facts p { max-width: 68ch; white-space: pre-line; }
.herbarium-data { margin-top: 24px; }
.herbarium-data > h2 { margin-bottom: 12px; }
.herbarium-data dl { margin: 0; }
.herbarium-data dl > div { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 24px; padding-block: 12px; border-top: 1px solid var(--line); }
.herbarium-data dt { color: var(--muted); font-size: .85rem; }
.herbarium-data dd { margin: 0; overflow-wrap: anywhere; }
.herbarium-data dd a { display: inline-flex; align-items: center; gap: 4px; color: var(--forest-700); font-weight: 700; }
.date-note { color: var(--muted); font-size: .83rem; margin-top: 22px; }
.people-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.person { display: flex; align-items: flex-start; gap: 16px; padding: 22px; border-top: 2px solid var(--forest-600); background: var(--surface); }
.person-photo, .avatar { flex: none; width: 68px; height: 68px; border-radius: 50%; object-fit: cover; }
.avatar { display: grid; place-items: center; background: var(--primary); color: var(--primary-fg); font-family: var(--font-display); font-size: 1.8rem; }
.person h2 { font-size: 1.15rem; }
.person-role { color: var(--forest-700); font-weight: 700; margin-top: 4px; }
.person p:not(.person-role) { color: var(--muted); margin-top: 7px; }
.citation-block { margin: 22px 0; padding: 24px; border-left: 3px solid var(--forest-600); background: var(--surface); font-family: var(--font-display); font-size: 1.15rem; line-height: 1.75; overflow-wrap: anywhere; }
.document-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.document-list li { display: flex; align-items: center; gap: 13px; padding-block: 16px; border-bottom: 1px solid var(--line); }
.document-list li > svg { color: var(--forest-600); flex: none; }
.document-list li > span { flex: 1; font-weight: 700; }
.contact-layout { display: grid; grid-template-columns: 1.3fr 1fr; gap: 50px; }
.contact-list { margin: 0; }
.contact-list > div { padding-block: 15px; border-top: 1px solid var(--line); }
.contact-list dt { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: .84rem; font-weight: 700; }
.contact-list dd { margin: 5px 0 0 26px; }
.contact-list a { color: var(--forest-700); font-weight: 700; display: inline-flex; align-items: center; gap: 5px; }
.contact-aside { background: var(--hero); color: var(--paper-50); padding: 28px; align-self: start; }
.contact-aside > svg { color: var(--accent); }
.contact-aside h2 { margin-top: 25px; }
.contact-aside p { color: var(--sage-100); font-size: .9rem; margin-top: 12px; }
.loading-state { min-height: 240px; display: flex; align-items: center; justify-content: center; gap: 12px; color: var(--muted); }
.site-footer { border-top: 1px solid var(--line); background: var(--surface); padding-block: 34px 18px; margin-top: 20px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 44px; }
.footer-grid h2 { font-size: 1rem; margin-bottom: 10px; }
.footer-grid p { color: var(--muted); font-size: .84rem; }
.footer-grid a { color: var(--forest-700); font-weight: 700; }
.footer-grid a:hover { text-decoration: underline; }
.footer-links { display: grid; justify-items: start; gap: 4px; font-size: .84rem; }
.copyright { border-top: 1px solid var(--line); margin-top: 26px; padding-top: 14px; color: var(--muted); font-size: .75rem; }

/* Admin workspace */
.admin-login { min-height: 100dvh; display: grid; place-items: center; align-content: center; gap: 12px; padding: 24px 16px; background: var(--hero); color: var(--paper-50); }
.admin-login > section { width: min(100%, 430px); }
.login-brand { display: flex; align-items: center; justify-content: center; gap: 10px; font-family: var(--font-display); font-size: 1.25rem; margin-bottom: 34px; }
.login-brand img { width: 48px; height: 48px; }
.login-icon { width: 54px; height: 54px; display: grid; place-items: center; border: 1px solid oklch(0.8 0.075 133 / .35); color: var(--accent); margin-bottom: 20px; }
.admin-login h1 { font-size: 2rem; }
.admin-login section > p { color: var(--sage-100); margin-top: 10px; }
.admin-login form { display: grid; gap: 16px; margin-top: 28px; }
.admin-login .admin-field > span { color: var(--paper-50); }
.admin-login .admin-field input { background: oklch(0.34 0.05 155); border-color: oklch(0.65 0.05 145); color: var(--paper-50); }
.login-submit { width: 100%; background: var(--accent); border-color: var(--accent); color: var(--forest-950); }
.login-submit:hover { background: var(--sage-100); }
.back-site { display: inline-flex; align-items: center; gap: 5px; margin-top: 24px; color: var(--sage-100); font-size: .85rem; }
.back-site svg { transform: rotate(180deg); }
.admin-shell { min-height: 100dvh; background: var(--paper-100); }
.admin-header { position: sticky; top: 0; z-index: 30; background: var(--surface); border-bottom: 1px solid var(--line); }
.admin-header-inner { min-height: 70px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 10px 24px; }
.admin-brand { display: flex; align-items: center; gap: 9px; }
.admin-brand img { width: 40px; height: 40px; }
.admin-brand span { display: grid; line-height: 1.15; }
.admin-brand strong { font-family: var(--font-display); }
.admin-brand small { color: var(--muted); font-size: .7rem; }
.admin-header-actions { display: flex; align-items: center; gap: 9px; }
.save-state { color: var(--forest-700); font-size: .78rem; margin-right: 8px; }
.save-state.unsaved { color: var(--danger); }
.icon-button { width: 42px; height: 42px; display: inline-grid; place-items: center; flex: none; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); color: var(--ink); transition: background 150ms ease; }
.icon-button:hover { background: var(--sage-100); }
.icon-button.danger, .text-button.danger { color: var(--danger); }
.admin-layout { display: grid; grid-template-columns: 230px minmax(0, 1fr); max-width: 1500px; margin-inline: auto; }
.admin-sidebar { min-height: calc(100dvh - 70px); padding: 24px 16px; border-right: 1px solid var(--line); background: var(--surface); }
.admin-user { display: flex; align-items: center; gap: 10px; padding: 0 8px 22px; border-bottom: 1px solid var(--line); }
.admin-user > span { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; background: var(--primary); color: var(--primary-fg); font-weight: 800; }
.admin-user div { display: grid; }
.admin-user small { color: var(--muted); font-size: .72rem; }
.admin-sidebar nav { display: grid; gap: 4px; margin-top: 18px; }
.admin-sidebar nav button { min-height: 44px; display: flex; align-items: center; gap: 10px; padding: 9px 11px; border: 0; border-radius: 7px; background: transparent; color: var(--muted); text-align: left; font-size: .88rem; font-weight: 700; }
.admin-sidebar nav button:hover { background: var(--sage-100); color: var(--ink); }
.admin-sidebar nav button.active { background: var(--primary); color: var(--primary-fg); }
.admin-sidebar nav button svg:last-child { margin-left: auto; }
.sidebar-help { display: flex; align-items: flex-start; gap: 8px; color: var(--muted); border-top: 1px solid var(--line); margin-top: 26px; padding: 20px 8px 0; font-size: .75rem; }
.sidebar-help svg { color: var(--forest-600); flex: none; margin-top: 3px; }
.admin-main { min-width: 0; padding: 30px 34px 70px; }
.admin-editor { max-width: 980px; display: grid; gap: 22px; }
.admin-editor.narrow-editor { max-width: 550px; }
.admin-section-heading { border-bottom: 1px solid var(--line); padding-bottom: 18px; }
.admin-section-heading.with-action { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.admin-section-heading h2 { font-size: 1.55rem; }
.admin-section-heading p { color: var(--muted); font-size: .85rem; margin-top: 6px; }
.admin-field { min-width: 0; display: grid; gap: 6px; color: var(--ink); font-size: .84rem; font-weight: 700; }
.admin-field input, .admin-field textarea, .admin-field select { width: 100%; min-width: 0; min-height: 44px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); color: var(--ink); padding: 10px 12px; font-weight: 500; line-height: 1.5; }
.admin-field textarea { resize: vertical; }
.admin-field input:focus, .admin-field textarea:focus, .admin-field select:focus { border-color: var(--forest-600); outline: 2px solid var(--forest-600); outline-offset: 1px; }
.two-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.three-columns { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.localized-fields, .details-body fieldset { min-width: 0; margin: 0; border: 1px solid var(--line); border-radius: 8px; padding: 16px; background: oklch(0.965 0.015 128); }
.localized-fields legend, .details-body legend { padding-inline: 5px; font-size: .83rem; font-weight: 800; }
.admin-stats { display: grid; grid-template-columns: repeat(3, 1fr); border-block: 1px solid var(--line); }
.admin-stats > div { display: grid; gap: 3px; padding: 20px; }
.admin-stats > div + div { border-left: 1px solid var(--line); }
.admin-stats strong { color: var(--forest-700); font-family: var(--font-display); font-size: 2.3rem; line-height: 1.1; }
.admin-stats span { color: var(--muted); font-size: .8rem; font-weight: 700; }
.admin-shortcuts { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--line); }
.admin-shortcuts button, .admin-shortcuts a { display: grid; grid-template-columns: 28px 1fr auto 18px; align-items: center; gap: 10px; min-height: 68px; border: 0; background: var(--surface); color: var(--ink); padding: 14px 16px; text-align: left; }
.admin-shortcuts button:nth-child(even), .admin-shortcuts a:nth-child(even) { border-left: 1px solid var(--line); }
.admin-shortcuts button:nth-child(n+3), .admin-shortcuts a:nth-child(n+3) { border-top: 1px solid var(--line); }
.admin-shortcuts button:hover, .admin-shortcuts a:hover { background: var(--sage-100); }
.admin-shortcuts button > svg, .admin-shortcuts a > svg { color: var(--forest-600); }
.server-note { display: flex; gap: 10px; align-items: flex-start; padding: 16px; background: var(--sage-100); color: var(--muted); font-size: .84rem; }
.server-note svg { flex: none; color: var(--forest-700); margin-top: 3px; }
.admin-search { max-width: 440px; display: flex; align-items: center; gap: 9px; border: 1px solid var(--line); border-radius: 7px; padding-inline: 12px; background: var(--surface); color: var(--muted); }
.admin-search input { min-width: 0; flex: 1; min-height: 43px; border: 0; outline: 0; background: transparent; color: var(--ink); }
.admin-record-list { border-top: 1px solid var(--line); }
.admin-record { display: flex; align-items: center; gap: 10px; padding-block: 10px; border-bottom: 1px solid var(--line); }
.record-main { min-width: 0; flex: 1; display: flex; align-items: center; gap: 12px; border: 0; background: transparent; color: var(--ink); text-align: left; padding: 0; }
.record-main > span:last-child { min-width: 0; display: grid; }
.record-main strong, .record-main small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.record-main small { color: var(--muted); font-size: .75rem; }
.record-thumb { width: 48px; height: 48px; display: grid; place-items: center; flex: none; background: var(--sage-100); color: var(--forest-600); overflow: hidden; }
.record-thumb img { width: 100%; height: 100%; object-fit: cover; }
.import-box { display: flex; align-items: center; flex-wrap: wrap; gap: 14px; padding: 18px; border: 1px dashed var(--forest-600); background: var(--sage-100); }
.import-box > div { flex: 1 1 260px; }
.import-box h3 { font-size: 1rem; }
.import-box p { color: var(--muted); font-size: .78rem; margin-top: 4px; }
.import-box > p { flex-basis: 100%; }
.import-box label, .upload-button { position: relative; overflow: hidden; }
.import-box input[type="file"], .upload-button input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.plant-editor { display: grid; gap: 20px; border-top: 3px solid var(--forest-600); background: var(--surface); padding: 22px; }
.editor-title { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.editor-title span { color: var(--forest-600); font-size: .73rem; font-weight: 800; letter-spacing: .05em; }
.editor-title h3 { font-size: 1.25rem; margin-top: 3px; }
.editor-details { border-top: 1px solid var(--line); padding-top: 14px; }
.editor-details summary { cursor: pointer; min-height: 36px; color: var(--forest-700); font-weight: 800; font-size: .88rem; }
.details-body { display: grid; gap: 16px; padding-top: 14px; }
.details-body fieldset { display: grid; gap: 14px; }
.upload-control { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.upload-label { flex-basis: 100%; font-size: .84rem; font-weight: 800; }
.upload-preview { width: 110px; height: 82px; object-fit: cover; border: 1px solid var(--line); }
.file-attached { display: inline-flex; align-items: center; gap: 5px; color: var(--forest-700); font-size: .8rem; }
.text-button { display: inline-flex; align-items: center; gap: 4px; min-height: 38px; border: 0; background: transparent; font-size: .78rem; font-weight: 700; }
.edit-cards { display: grid; gap: 16px; }
.edit-card { display: grid; gap: 15px; padding: 20px; border: 1px solid var(--line); background: var(--surface); }
.edit-card-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.edit-card-top h3 { font-size: 1.05rem; overflow-wrap: anywhere; }
.admin-empty { padding: 24px; color: var(--muted); text-align: center; border: 1px dashed var(--line); }
.security-form { display: grid; gap: 16px; }
.security-form .button { justify-self: start; }
.form-error { color: var(--danger); font-size: .82rem; overflow-wrap: anywhere; }
.form-success { color: var(--forest-700); font-size: .84rem; font-weight: 700; }
.admin-error { max-width: 980px; margin-bottom: 18px; padding: 12px 15px; border: 1px solid var(--danger); color: var(--danger); background: var(--surface); font-size: .84rem; }
.admin-toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 40; display: flex; align-items: center; gap: 8px; max-width: calc(100% - 32px); padding: 12px 18px; border-radius: 8px; background: var(--hero); color: var(--paper-50); box-shadow: 0 8px 30px oklch(0.2 0.03 155 / .25); font-weight: 700; font-size: .85rem; }
.spin { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 1050px) {
  .brand small { display: none; }
  .main-nav a { padding-inline: 10px; font-size: .78rem; }
  .hero-inner { grid-template-columns: 1fr 200px; }
  .hero-emblem { width: 190px; height: 190px; }
  .plant-grid { grid-template-columns: repeat(3, 1fr); }
  .group-grid { grid-template-columns: 1fr 1fr; }
  .group-tile:nth-child(3) { border-left: 0; }
  .group-tile:nth-child(n+3) { border-top: 1px solid var(--line); }
  .group-tile p { min-height: 0; }
  .three-columns { grid-template-columns: 1fr; }
}

@media (max-width: 820px) {
  .wrap { width: min(100% - 28px, 1180px); }
  .header-bar { flex-wrap: wrap; gap: 10px; padding-block: 9px; }
  .site-header::before { height: 100%; }
  .brand { margin-right: auto; }
  .header-search { order: 3; flex-basis: 100%; max-width: none; }
  .menu-button { display: grid; }
  .main-nav { display: none; }
  .main-nav.open { display: block; }
  .main-nav .wrap { flex-direction: column; padding-block: 6px; }
  .main-nav a { border-bottom: 0; border-left: 3px solid transparent; min-height: 44px; }
  .main-nav a.active { border-left-color: var(--accent); }
  .main-nav .admin-link { margin-left: 0; }
  .hero-inner { grid-template-columns: 1fr; min-height: 0; padding-block: 42px 48px; }
  .hero-emblem { display: none; }
  .hero h1 { max-width: 20ch; }
  .editorial-section { grid-template-columns: 1fr; gap: 18px; padding-block: 34px 6px; }
  .editorial-section > h2 { font-size: 1.4rem; }
  .plant-grid { grid-template-columns: repeat(2, 1fr); }
  .detail-grid { grid-template-columns: 1fr; gap: 24px; }
  .detail-facts section { grid-template-columns: 1fr; gap: 10px; }
  .contact-layout { grid-template-columns: 1fr; gap: 28px; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 28px; }
  .footer-grid > div:first-child { grid-column: 1 / -1; }
  .admin-header-inner { align-items: flex-start; padding-inline: 16px; }
  .save-state { display: none; }
  .admin-layout { grid-template-columns: minmax(0, 1fr); }
  .admin-sidebar { min-width: 0; min-height: 0; border-right: 0; border-bottom: 1px solid var(--line); padding: 12px 16px; }
  .admin-user, .sidebar-help { display: none; }
  .admin-sidebar nav { display: flex; overflow-x: auto; margin-top: 0; padding-bottom: 3px; }
  .admin-sidebar nav button { flex: none; }
  .admin-sidebar nav button svg:last-child { display: none; }
  .admin-main { padding: 24px 18px 60px; }
}

@media (max-width: 560px) {
  body { font-size: 15px; }
  .brand strong { font-size: 1rem; }
  .brand img { width: 38px; height: 38px; }
  .languages button { min-width: 36px; }
  .hero h1 { font-size: 2.15rem; }
  .hero-search { flex-direction: column; }
  .hero-search button { justify-content: center; }
  .quick-search { align-items: flex-start; }
  .stats > div { padding: 16px 9px; }
  .stats strong { font-size: 2.2rem; }
  .stats span { font-size: .73rem; }
  .analytics-grid { grid-template-columns: 1fr; gap: 28px; }
  .group-grid { grid-template-columns: 1fr; }
  .group-tile + .group-tile { border-left: 0; border-top: 1px solid var(--line); }
  .plant-grid { gap: 10px; }
  .plant-card-body { padding: 11px; }
  .plant-card h3 { font-size: .93rem; }
  .plant-card .scientific { font-size: .72rem; }
  .tag { font-size: .67rem; }
  .people-grid { grid-template-columns: 1fr; }
  .person { padding: 17px; }
  .herbarium-data dl > div { grid-template-columns: 1fr; gap: 3px; }
  .document-list li { flex-wrap: wrap; }
  .document-list li > span { min-width: 60%; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-grid > div:first-child { grid-column: auto; }
  .admin-header-inner { flex-wrap: wrap; }
  .admin-header-actions { width: 100%; }
  .admin-header-actions .button.secondary { margin-right: auto; }
  .admin-section-heading.with-action { align-items: flex-start; flex-direction: column; }
  .two-columns { grid-template-columns: 1fr; }
  .admin-stats > div { padding: 14px 9px; }
  .admin-stats strong { font-size: 1.8rem; }
  .admin-stats span { font-size: .68rem; }
  .admin-shortcuts { grid-template-columns: 1fr; }
  .admin-shortcuts button:nth-child(even), .admin-shortcuts a:nth-child(even) { border-left: 0; }
  .admin-shortcuts button + button, .admin-shortcuts a + a { border-top: 1px solid var(--line); }
  .admin-record { flex-wrap: wrap; }
  .record-main { flex-basis: calc(100% - 52px); }
  .admin-record > .button { margin-left: 60px; }
  .plant-editor, .edit-card { padding: 16px; }
}

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

/* --- PHP versiyasi uchun qo'shimchalar (tugma o'rniga havolalar) --- */
.languages a { min-width: 40px; min-height: 40px; display: inline-flex; align-items: center; justify-content: center; border-radius: 7px; background: var(--surface); color: var(--muted); font-size: .78rem; font-weight: 700; text-decoration: none; }
.languages a:hover { background: var(--sage-100); color: var(--ink); }
.languages a[aria-pressed="true"] { background: var(--primary); color: var(--primary-fg); }
.filter-chips a { min-height: 40px; display: inline-flex; align-items: center; padding: 7px 13px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink); font-size: .84rem; font-weight: 700; text-decoration: none; }
.filter-chips a:hover { border-color: var(--forest-600); }
.filter-chips a.selected { background: var(--primary); border-color: var(--primary); color: var(--primary-fg); }
.pagination a.disabled { opacity: .45; pointer-events: none; }
.admin-sidebar nav a { min-height: 44px; display: flex; align-items: center; gap: 10px; padding: 9px 11px; border-radius: 7px; color: var(--muted); font-size: .88rem; font-weight: 700; text-decoration: none; }
.admin-sidebar nav a:hover { background: var(--sage-100); color: var(--ink); }
.admin-sidebar nav a.active { background: var(--primary); color: var(--primary-fg); }
.admin-sidebar nav a svg:last-child { margin-left: auto; }
.flash { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 8px; margin-bottom: 18px; font-weight: 600; }
.flash.ok { background: var(--sage-100); color: var(--forest-900); }
.flash.err { background: oklch(0.95 0.03 28); color: var(--danger); }
.admin-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.admin-table th, .admin-table td { padding: 10px 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.admin-table th { color: var(--muted); font-size: .76rem; text-transform: uppercase; letter-spacing: .04em; }
.admin-table .actions { display: flex; gap: 6px; justify-content: flex-end; white-space: nowrap; }
.admin-table img.thumb { width: 44px; height: 44px; object-fit: cover; border-radius: 6px; }
.inline-form { display: inline; }
.upload-preview { max-width: 160px; border-radius: 8px; display: block; margin-bottom: 8px; }
.admin-field input[type="file"] { padding: 8px; }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
@media (max-width: 760px) { .two-columns, .three-columns { grid-template-columns: 1fr; } .admin-sidebar { min-height: auto; border-right: 0; border-bottom: 1px solid var(--line); } .admin-sidebar nav { display: flex; flex-wrap: wrap; } }
.admin-shortcuts a { text-decoration: none; color: var(--ink); }
