/* Option A ("Atlas") — the shared layer for its deeper pages: search & listing, species, genus, family.
   Builds on brand.css. Scientific-name conventions follow Kew's Plants of the World Online:
   names italic, authorities roman and lighter, ranks connecting words roman. */

/* ---------- scientific names ---------- */
.tx-name i { font-style: italic; }
.tx-name .auth { font-style: normal; font-weight: 300; color: var(--ink-3); font-size: .82em; letter-spacing: 0; }
.tx-name .rank { font-style: normal; }
h1 .tx-name .auth { font-size: .5em; vertical-align: .12em; margin-left: .15em; }

/* ---------- header ---------- */
.atlas-header .bar { gap: 22px; }
.atlas-header .site-nav { gap: 22px; margin-left: 8px; }
.hsearch { position: relative; margin-left: auto; width: min(360px, 34vw); }
.hsearch form { display: flex; align-items: center; gap: 8px; height: 42px; padding: 0 6px 0 16px; border-radius: 999px; background: var(--paper); box-shadow: inset 0 0 0 1px var(--hairline); transition: box-shadow .2s, background-color .2s; }
.hsearch form:focus-within { background: #fff; box-shadow: inset 0 0 0 1.5px var(--navy); }
.hsearch svg { width: 16px; height: 16px; color: var(--navy); flex: none; }
.hsearch input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font: inherit; font-size: 14px; color: var(--ink); }
.ac { position: absolute; top: calc(100% + 8px); right: 0; width: max(100%, 460px); background: #fff; border-radius: 12px; box-shadow: 0 18px 48px rgba(0,26,56,.22); padding: 8px; z-index: 80; display: none; max-height: 70vh; overflow: auto; }
.ac.open { display: block; }
.ac h6 { margin: 8px 10px 4px; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); font-weight: 500; }
.ac a { display: flex; align-items: center; gap: 12px; padding: 7px 10px; border-radius: 8px; text-decoration: none; color: var(--ink); font-size: 14px; }
.ac a[aria-selected="true"], .ac a:hover { background: var(--paper); }
.ac img, .ac .ph0 { width: 36px; height: 36px; border-radius: 6px; object-fit: cover; background: var(--paper-2); flex: none; }
.ac .meta { display: block; font-size: 12px; color: var(--ink-3); }
.ac .ar { margin-left: auto; color: var(--earth); font-size: 14px; }
.ac .all { justify-content: center; color: var(--navy); font-weight: 500; border-top: 1px solid var(--hairline); border-radius: 0 0 8px 8px; margin-top: 6px; }
.ac mark { background: #F3E3D6; color: inherit; border-radius: 2px; }

/* ---------- breadcrumb & page head ---------- */
.crumbs { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 13px; color: var(--ink-3); padding: 18px 0 0; list-style: none; margin: 0; }
.crumbs li + li::before { content: "›"; margin-right: 6px; color: var(--sand); }
.crumbs a { color: var(--navy); text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }
.crumbs [aria-current] { color: var(--ink-2); }

/* ---------- taxon hero (POWO's split header, in OBG dress) ---------- */
.taxon-hero { background: var(--paper-2); position: relative; overflow: hidden; }
.taxon-hero .grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: 48px; align-items: stretch; padding-bottom: 44px; }
.taxon-hero .txt { padding-top: 26px; display: flex; flex-direction: column; gap: 12px; }
.rank-tag { display: inline-flex; gap: 10px; align-items: center; font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--copper-700); font-weight: 500; }
.rank-tag a { color: inherit; text-decoration: none; border-bottom: 1px solid rgba(138,74,36,.35); text-transform: none; letter-spacing: 0; font-size: 14px; font-style: italic; }
.taxon-hero h1 { font-size: clamp(36px, 4.4vw, 58px); font-weight: 500; letter-spacing: -.01em; line-height: 1.05; }
.vern { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 18px; }
.vern .en { font-size: 22px; color: var(--ink); }
.vern .ar { font-size: 26px; color: var(--earth); }
.protologue { font-size: 14px; color: var(--ink-2); }
.protologue b { font-weight: 500; color: var(--ink); }
.status { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 2px; }
.pill { display: inline-flex; align-items: center; gap: 8px; height: 30px; padding: 0 12px; border-radius: 999px; background: #fff; box-shadow: inset 0 0 0 1px var(--hairline); font-size: 13px; color: var(--ink); white-space: nowrap; }
.pill .dot { width: 9px; height: 9px; border-radius: 50%; }
.pill.navy { background: var(--navy); color: #fff; box-shadow: none; }
.range { font-size: 16.5px; color: var(--ink-2); max-width: 60ch; line-height: 1.6; }
.keyfacts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 10px 0 0; border-top: 1px solid var(--paper-3); }
.keyfacts div { padding: 14px 16px 0 0; }
.keyfacts dt { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.keyfacts dd { margin: 4px 0 0; font-size: 15px; color: var(--ink); line-height: 1.35; }
.hero-photo { position: relative; border-radius: 0 0 var(--radius-lg) var(--radius-lg); overflow: hidden; background: var(--paper-3); min-height: 420px; }
.hero-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero-photo .count { position: absolute; right: 14px; bottom: 14px; background: rgba(0,26,56,.72); color: #fff; border: 0; border-radius: 999px; height: 34px; padding: 0 14px; font-size: 13px; cursor: pointer; }
.hero-photo .cap { position: absolute; left: 14px; bottom: 14px; color: #fff; font-size: 12px; font-style: italic; text-shadow: 0 1px 4px rgba(0,0,0,.6); }
.collage { display: grid; grid-template-columns: 2fr 1fr; grid-template-rows: 1fr 1fr; gap: 6px; min-height: 420px; border-radius: 0 0 var(--radius-lg) var(--radius-lg); overflow: hidden; }
.collage a { position: relative; display: block; background: var(--paper-3); overflow: hidden; }
.collage a:first-child { grid-row: span 2; }
.collage img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.collage a:hover img { transform: scale(1.03); }
.collage span { position: absolute; left: 10px; bottom: 8px; color: #fff; font-size: 12px; font-style: italic; text-shadow: 0 1px 4px rgba(0,0,0,.65); }

/* ---------- in-page section nav (POWO's sub-tabs) ---------- */
.secnav { position: sticky; top: 76px; z-index: 40; background: #fff; box-shadow: 0 1px 0 var(--hairline); }
.secnav ul { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0; overflow-x: auto; scrollbar-width: none; }
.secnav a { display: block; padding: 16px 14px 14px; font-size: 14px; color: var(--ink-2); text-decoration: none; border-bottom: 2px solid transparent; white-space: nowrap; }
.secnav a:hover { color: var(--navy); }
.secnav a.is-active { color: var(--navy); border-color: var(--copper); font-weight: 500; }

/* ---------- sections: heading column + content (POWO layout) ---------- */
.tsec { display: grid; grid-template-columns: 250px 1fr; gap: 48px; padding: 56px 0; border-bottom: 1px solid var(--hairline); scroll-margin-top: 140px; }
.tsec:last-of-type { border-bottom: 0; }
.tsec > header h2 { font-size: 24px; position: relative; padding-top: 16px; }
.tsec > header h2::before { content: ""; position: absolute; left: 0; top: 0; width: 36px; height: 3px; background: var(--copper); border-radius: 2px; }
.tsec > header p { font-size: 13px; color: var(--ink-3); margin-top: 8px; line-height: 1.5; }
.tsec .body { min-width: 0; font-size: 16px; line-height: 1.7; color: var(--ink); }
.tsec .body p + p { margin-top: 12px; }
.according { font-size: 13px; color: var(--ink-3); margin-bottom: 18px; display: flex; gap: 8px; align-items: center; }
.according b { color: var(--ink-2); font-weight: 500; }
.empty-note { color: var(--ink-3); font-style: italic; }
.translit { font-size: .86em; color: var(--copper-700); font-style: italic; white-space: nowrap; }

/* morphology rows */
.morph { display: grid; grid-template-columns: 170px 1fr; border-top: 1px solid var(--hairline); }
.morph dt, .morph dd { padding: 14px 0; border-bottom: 1px solid var(--hairline); margin: 0; }
.morph dt { font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--copper-700); font-weight: 500; padding-right: 18px; }
.morph dd { font-size: 15.5px; line-height: 1.65; }

/* definition grids (classification, management, key/value) */
.kv { display: grid; grid-template-columns: 200px 1fr; margin: 0; border-top: 1px solid var(--hairline); }
.kv dt, .kv dd { margin: 0; padding: 11px 0; border-bottom: 1px solid var(--hairline); font-size: 15px; }
.kv dt { color: var(--ink-3); font-size: 14px; }
.kv a { color: var(--navy); }
.classif dd { font-size: 16px; }
.classif-note { font-size: 12.5px; color: var(--ink-3); margin-top: 10px; line-height: 1.5; }
.readmore { position: relative; }
.readmore.clamped .more-body { display: none; }
.readmore .toggle { margin-top: 10px; }
@media (max-width: 900px) { .dist-grid { grid-template-columns: 1fr !important; } }

.syn-list, .ref-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.syn-list li { padding: 10px 14px; background: #fff; box-shadow: inset 0 0 0 1px var(--hairline); border-radius: var(--radius); font-size: 15.5px; line-height: 1.4; }
.ref-list { counter-reset: r; gap: 12px; }
.ref-list li { counter-increment: r; display: grid; grid-template-columns: 34px 1fr; font-size: 14.5px; line-height: 1.55; color: var(--ink-2); }
.ref-list li::before { content: counter(r) "."; color: var(--copper-700); font-weight: 500; }
.sub-h { font-size: 13px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); font-weight: 500; margin: 30px 0 12px; }
.sub-h:first-child { margin-top: 0; }

/* names */
.name-groups { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.name-group { background: #fff; box-shadow: inset 0 0 0 1px var(--hairline); border-radius: var(--radius); padding: 14px 16px; }
.name-group .lang { font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 4px; }
.name-group .names { font-size: 15.5px; line-height: 1.5; }
.name-group.ar-g { direction: rtl; text-align: right; }
.name-group.ar-g .names { font-family: var(--font-ar); font-size: 17px; }
.voices { display: grid; gap: 10px; }
.voice { display: grid; grid-template-columns: 44px 1fr auto; gap: 14px; align-items: center; padding: 10px 14px 10px 10px; border-radius: var(--radius); background: #fff; box-shadow: inset 0 0 0 1px var(--hairline); }
.voice .play { width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--navy); color: #fff; cursor: pointer; display: grid; place-items: center; transition: background-color .2s; }
.voice .play:hover { background: var(--navy-600); }
.voice .play svg { width: 16px; height: 16px; }
.voice .play[aria-pressed="true"] { background: var(--copper); }
.voice .t { font-size: 15.5px; }
.voice .lg { font-size: 12.5px; color: var(--ink-3); }
.voice .tag { font-size: 12px; color: var(--copper-700); background: #F7EDE5; border-radius: 999px; padding: 3px 10px; white-space: nowrap; }
.voice.ar-v { direction: rtl; grid-template-columns: 1fr auto; }
.voice.ar-v .t { font-family: var(--font-ar); font-size: 17px; }

/* IUCN scale */
.iucn-scale { display: flex; gap: 4px; margin: 6px 0 14px; }
.iucn-scale span { flex: 1; text-align: center; padding: 10px 0 8px; border-radius: 6px; font-size: 13px; font-weight: 500; background: var(--paper); color: var(--ink-3); position: relative; }
.iucn-scale span small { display: block; font-size: 10.5px; font-weight: 400; margin-top: 2px; }
.iucn-scale span.on { color: #fff; }
.iucn-scale span.on::after { content: ""; position: absolute; left: 50%; bottom: -9px; transform: translateX(-50%); border: 6px solid transparent; border-top-color: var(--ink); }
.cons-text { font-size: 15px; color: var(--ink-2); margin-top: 16px; }

/* phenology strip */
.pheno { display: grid; grid-template-columns: repeat(12, 1fr); gap: 3px; margin: 4px 0 8px; }
.pheno span { text-align: center; font-size: 11.5px; color: var(--ink-3); padding: 26px 0 0; position: relative; }
.pheno span::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 18px; border-radius: 4px; background: var(--paper-2); }
.pheno span.on::before { background: var(--copper); }
.pheno.heat span::before { background: rgba(189, 119, 78, var(--a, 0)); box-shadow: inset 0 0 0 1px var(--paper-3); }
.pheno-note { font-size: 13.5px; color: var(--ink-2); }

/* steps (propagation) */
.steps { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.steps li { position: relative; padding-left: 22px; font-size: 15px; line-height: 1.6; }
.steps li::before { content: ""; position: absolute; left: 4px; top: 10px; width: 6px; height: 6px; border-radius: 50%; background: var(--copper); }
.steps li.h { padding-left: 0; font-weight: 500; color: var(--navy); margin-top: 8px; }
.steps li.h::before { display: none; }

/* gallery & lightbox */
.gallery-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.gallery-grid button { border: 0; padding: 0; background: var(--paper-2); border-radius: var(--radius); overflow: hidden; aspect-ratio: 1; cursor: zoom-in; }
.gallery-grid button:first-child { grid-column: span 2; grid-row: span 2; }
.gallery-grid img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.gallery-grid button:hover img { transform: scale(1.03); }
.lightbox { position: fixed; inset: 0; z-index: 200; background: rgba(0, 16, 34, .94); display: none; align-items: center; justify-content: center; }
.lightbox.open { display: flex; }
.lightbox img { max-width: 88vw; max-height: 82vh; border-radius: 6px; }
.lightbox .cap { position: absolute; bottom: 24px; left: 0; right: 0; text-align: center; color: rgba(255,255,255,.85); font-size: 13px; }
.lightbox button { position: absolute; border: 0; background: rgba(255,255,255,.12); color: #fff; width: 48px; height: 48px; border-radius: 50%; cursor: pointer; font-size: 22px; }
.lightbox button:hover { background: rgba(255,255,255,.24); }
.lightbox .x { top: 20px; right: 20px; }
.lightbox .prev { left: 24px; top: 50%; }
.lightbox .next { right: 24px; top: 50%; }

/* cite */
.cite { background: #fff; box-shadow: inset 0 0 0 1px var(--hairline); border-radius: var(--radius-lg); padding: 20px 22px; font-size: 14.5px; color: var(--ink-2); line-height: 1.6; }
.cite .row { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 12px; }
.linkbtn { border: 0; background: none; color: var(--navy); font-weight: 500; cursor: pointer; padding: 4px 0; font-size: 13.5px; }
.linkbtn:hover { text-decoration: underline; }

/* ---------- taxon cards & lists ---------- */
.tcards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.tcard { display: flex; flex-direction: column; background: #fff; border-radius: var(--radius-lg); overflow: hidden; text-decoration: none; color: inherit; box-shadow: 0 1px 0 var(--hairline); transition: transform .2s, box-shadow .2s; }
.tcard:hover { transform: translateY(-2px); box-shadow: 0 1px 0 var(--hairline), var(--shadow-lg); }
.tcard .ph { aspect-ratio: 4 / 3; background: var(--paper-2); overflow: hidden; display: grid; place-items: center; }
.tcard .ph img { width: 100%; height: 100%; object-fit: cover; }
.tcard .ph .leaf { width: 40px; height: 40px; color: var(--sand); }
.tcard .tx { padding: 14px 16px 16px; display: grid; gap: 3px; }
.tcard .nm { font-size: 16px; color: var(--ink); line-height: 1.3; }
.tcard .cm { display: flex; justify-content: space-between; gap: 10px; font-size: 13.5px; color: var(--ink-2); }
.tcard .cm .ar { color: var(--earth); font-size: 15px; white-space: nowrap; }
.tcard .fm { font-size: 12.5px; color: var(--ink-3); }
.tcard .tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }

.taxlist { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--hairline); }
.taxlist li { display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: center; padding: 12px 4px; border-bottom: 1px solid var(--hairline); }
.taxlist a { text-decoration: none; color: var(--ink); font-size: 16px; }
.taxlist a:hover .tx-name i { text-decoration: underline; text-decoration-color: var(--sand); text-underline-offset: 3px; }
.taxlist .sub { display: block; font-size: 13px; color: var(--ink-3); margin-top: 2px; }
.taxlist .right { display: flex; gap: 8px; align-items: center; font-size: 13px; color: var(--ink-3); }
.count-line { font-size: 15px; color: var(--ink-2); margin-bottom: 14px; }
.count-line b { color: var(--navy); font-weight: 500; }

.stat-strip { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--paper-3); border-radius: var(--radius); background: #fff; margin-top: 8px; }
.stat-strip div { padding: 14px 16px; }
.stat-strip div + div { border-left: 1px solid var(--paper-3); }
.stat-strip b { display: block; font-size: 28px; font-weight: 500; color: var(--navy); line-height: 1.1; }
.stat-strip span { font-size: 12.5px; color: var(--ink-3); }

/* ---------- search & listing ---------- */
.search-head { background: var(--paper-2); padding: 8px 0 0; position: relative; overflow: hidden; }
.search-head h1 { font-size: clamp(30px, 3.4vw, 44px); margin: 14px 0 6px; }
.search-head .lead { color: var(--ink-2); font-size: 16px; font-weight: 300; }
.bigsearch { position: relative; max-width: 760px; margin: 22px 0 0; }
.bigsearch form { display: flex; align-items: center; gap: 12px; height: 60px; padding: 0 8px 0 22px; background: #fff; border-radius: 999px; box-shadow: 0 0 0 1px var(--hairline), 0 10px 30px rgba(0,26,56,.08); }
.bigsearch form:focus-within { box-shadow: 0 0 0 2px var(--navy), 0 10px 30px rgba(0,26,56,.1); }
.bigsearch svg { width: 20px; height: 20px; color: var(--navy); flex: none; }
.bigsearch input { flex: 1; min-width: 0; border: 0; outline: 0; font: inherit; font-size: 17px; background: transparent; }
.bigsearch .ac { left: 0; right: auto; width: 100%; }
.try { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 16px 0 0; font-size: 13px; color: var(--ink-3); }
.try a { text-decoration: none; color: var(--navy); background: #fff; border-radius: 999px; padding: 5px 12px; box-shadow: inset 0 0 0 1px var(--hairline); font-size: 13px; }
.try a:hover { box-shadow: inset 0 0 0 1px var(--navy); }
.rank-tabs { display: flex; gap: 4px; margin-top: 28px; }
.rank-tabs a { padding: 14px 18px 12px; text-decoration: none; color: var(--ink-2); font-size: 15px; border-bottom: 3px solid transparent; }
.rank-tabs a span { font-size: 12.5px; color: var(--ink-3); margin-left: 6px; }
.rank-tabs a.is-active { color: var(--navy); border-color: var(--copper); font-weight: 500; background: var(--paper); border-radius: 8px 8px 0 0; }

.listing { display: grid; grid-template-columns: 280px 1fr; gap: 36px; padding: 32px 0 80px; align-items: start; }
.facets { position: sticky; top: 96px; max-height: calc(100vh - 116px); overflow: auto; padding-right: 6px; scrollbar-width: thin; }
.facets-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.facets-head h2 { font-size: 15px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); font-weight: 500; }
.fgroup { border-top: 1px solid var(--paper-3); padding: 4px 0 10px; }
.fgroup summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; padding: 12px 0 8px; font-size: 15px; font-weight: 500; color: var(--navy); }
.fgroup summary::-webkit-details-marker { display: none; }
.fgroup summary::after { content: ""; width: 8px; height: 8px; border-right: 1.6px solid var(--ink-3); border-bottom: 1.6px solid var(--ink-3); transform: rotate(45deg); margin-right: 4px; transition: transform .2s; }
.fgroup[open] summary::after { transform: rotate(-135deg); }
.fgroup summary .n { margin-left: auto; margin-right: 10px; background: var(--navy); color: #fff; border-radius: 999px; font-size: 11px; min-width: 18px; height: 18px; display: inline-grid; place-items: center; padding: 0 5px; font-weight: 500; }
.fopt { display: flex; align-items: center; gap: 10px; padding: 5px 2px; font-size: 14px; cursor: pointer; border-radius: 6px; }
.fopt:hover { background: rgba(255,255,255,.7); }
.fopt input { accent-color: var(--navy); width: 16px; height: 16px; margin: 0; flex: none; }
.fopt .sw { width: 10px; height: 10px; border-radius: 2px; flex: none; }
.fopt .t { line-height: 1.25; }
.fopt .t small { display: block; font-size: 12px; color: var(--ink-3); }
.fopt .t small.ar, .taxlist .sub.ar { text-align: left; }
.fopt .cnt { margin-left: auto; font-size: 12.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.fopt.zero { opacity: .42; }
.fsearch { width: 100%; height: 34px; border: 1px solid var(--hairline); border-radius: 8px; padding: 0 10px; font: inherit; font-size: 13.5px; margin: 2px 0 8px; background: #fff; }
.fmore { margin-top: 4px; }
.months { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; padding: 4px 0; }
.months button { height: 34px; border: 0; border-radius: 6px; background: #fff; box-shadow: inset 0 0 0 1px var(--hairline); font-size: 12.5px; cursor: pointer; color: var(--ink-2); }
.months button[aria-pressed="true"] { background: var(--copper); color: #fff; box-shadow: none; }
.mini-map { max-width: 180px; margin: 2px auto 8px; }

.results-bar { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.results-bar h2 { font-size: 22px; }
.results-bar p { font-size: 13.5px; color: var(--ink-3); }
.results-bar .ctl { display: flex; gap: 10px; align-items: center; }
.results-bar select { height: 38px; border: 1px solid var(--hairline); border-radius: 999px; padding: 0 14px; font: inherit; font-size: 14px; background: #fff; color: var(--ink); }
.seg-toggle { display: inline-flex; background: #fff; border: 1px solid var(--hairline); border-radius: 999px; padding: 3px; }
.seg-toggle button { border: 0; background: none; height: 30px; padding: 0 12px; border-radius: 999px; cursor: pointer; font-size: 13px; color: var(--ink-2); }
.seg-toggle button[aria-pressed="true"] { background: var(--navy); color: #fff; }
.chips-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.chips-row:empty { display: none; }
.fchip { display: inline-flex; gap: 4px; align-items: center; height: 30px; padding: 0 4px 0 12px; border-radius: 999px; background: var(--navy); color: #fff; font-size: 13px; }
.fchip small { opacity: .7; margin-right: 3px; }
.fchip button { border: 0; background: rgba(255,255,255,.18); color: #fff; width: 22px; height: 22px; border-radius: 50%; cursor: pointer; font-size: 14px; line-height: 1; }
.results .tcards { grid-template-columns: repeat(3, 1fr); }
.rtable { width: 100%; border-collapse: collapse; background: #fff; border-radius: var(--radius-lg); overflow: hidden; box-shadow: 0 1px 0 var(--hairline); font-size: 14px; }
.rtable th { text-align: left; font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); font-weight: 500; padding: 12px 14px; border-bottom: 1px solid var(--hairline); background: var(--paper); }
.rtable td { padding: 10px 14px; border-bottom: 1px solid var(--hairline); vertical-align: middle; }
.rtable tbody tr:hover { background: var(--paper); }
.rtable a { color: var(--ink); text-decoration: none; }
.rtable .ar { color: var(--earth); }
.rtable .mini-pheno { display: grid; grid-template-columns: repeat(12, 6px); gap: 2px; }
.rtable .mini-pheno i { height: 10px; border-radius: 1px; background: var(--paper-3); }
.rtable .mini-pheno i.on { background: var(--copper); }
.pager { display: flex; justify-content: center; gap: 6px; margin-top: 32px; flex-wrap: wrap; }
.pager a, .pager span { min-width: 40px; height: 40px; display: inline-grid; place-items: center; border-radius: 999px; text-decoration: none; font-size: 14px; color: var(--ink-2); padding: 0 12px; }
.pager a { background: #fff; box-shadow: inset 0 0 0 1px var(--hairline); }
.pager a:hover { box-shadow: inset 0 0 0 1px var(--navy); color: var(--navy); }
.pager [aria-current] { background: var(--navy); color: #fff; box-shadow: none; }
.noresults { background: #fff; border-radius: var(--radius-lg); padding: 48px; text-align: center; color: var(--ink-2); }
.noresults h3 { margin-bottom: 8px; }
.mark { background: #F3E3D6; border-radius: 2px; }
.fam-card .ord { font-size: 12.5px; color: var(--ink-3); }
.filters-toggle { display: none; }

@media (max-width: 1100px) {
  .taxon-hero .grid { grid-template-columns: 1fr; gap: 24px; }
  .hero-photo, .collage { min-height: 300px; border-radius: var(--radius-lg); }
  .tsec { grid-template-columns: 1fr; gap: 18px; padding: 40px 0; }
  .tcards, .results .tcards { grid-template-columns: repeat(2, 1fr); }
  .listing { grid-template-columns: 1fr; }
  .facets { position: static; max-height: none; display: none; }
  .facets.open { display: block; }
  .filters-toggle { display: inline-flex; }
  .hsearch { width: 220px; }
}
@media (max-width: 700px) {
  .keyfacts, .stat-strip { grid-template-columns: 1fr 1fr; }
  .stat-strip div:nth-child(3) { border-left: 0; }
  .morph, .kv { grid-template-columns: 1fr; }
  .morph dt, .kv dt { border-bottom: 0; padding-bottom: 0; }
  .name-groups { grid-template-columns: 1fr; }
  .gallery-grid { grid-template-columns: repeat(2, 1fr); }
  .tcards, .results .tcards { grid-template-columns: 1fr 1fr; }
  .hsearch { display: none; }
  .results { min-width: 0; }
  .results #results { overflow-x: auto; }
  .results-bar .ctl { flex-wrap: wrap; }
  .rtable .hide-sm { display: none; }
  .iucn-scale span small { display: none; }
}

/* ---------- statuses: OBG's coloured ecological-status tags + conservation search ---------- */
.tcard .ph, .hero-photo { position: relative; }
.eco-tag { position: absolute; left: 10px; top: 10px; z-index: 2; height: 22px; padding: 0 10px; border-radius: 999px; font-size: 11.5px; font-weight: 500; letter-spacing: .02em; display: inline-flex; align-items: center; box-shadow: 0 1px 6px rgba(0,0,0,.2); }
.hero-photo .eco-tag { left: 14px; top: 14px; height: 26px; font-size: 12.5px; }
.ac .ph0.st { width: 14px; height: 14px; border-radius: 50%; margin: 0 11px; }
a.pill { text-decoration: none; transition: box-shadow .2s, background-color .2s; }
a.pill:hover { box-shadow: inset 0 0 0 1px var(--navy); }
a.pill.navy:hover { background: var(--navy-600); box-shadow: none; }
.fgroup-title { font-size: 11.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--copper-700); font-weight: 500; margin: 22px 0 0; padding-top: 14px; border-top: 2px solid var(--copper); }
.fgroup-title + .fgroup { border-top: 0; }

.status-browse { display: grid; grid-template-columns: 1.55fr 1fr; gap: 16px; margin-bottom: 30px; }
.sb-card { background: #fff; border-radius: var(--radius-lg); padding: 20px 22px 22px; box-shadow: 0 1px 0 var(--hairline); }
.sb-card h3 { font-size: 17px; display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.sb-card h3 .ar { font-size: 15px; color: var(--earth); font-weight: 400; }
.sb-card .sub { font-size: 12.5px; color: var(--ink-3); margin: 3px 0 14px; }
.sb-h { font-size: 11.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); margin: 16px 0 8px; font-weight: 500; }
.iucn-tiles { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.iucn-tiles a { display: flex; flex-direction: column; gap: 3px; text-decoration: none; color: var(--ink); background: var(--paper); border-radius: 8px; padding: 10px 9px 9px; border-top: 4px solid var(--c); transition: transform .2s, box-shadow .2s; min-width: 0; }
.iucn-tiles a:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(0,26,56,.1); }
.iucn-tiles b { font-size: 19px; font-weight: 500; line-height: 1; }
.iucn-tiles .nm { font-size: 11.5px; line-height: 1.2; color: var(--ink-2); min-height: 2.4em; }
.iucn-tiles .ar { font-size: 12px; color: var(--earth); line-height: 1.3; }
.iucn-tiles .n { font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; margin-top: auto; }
.desig { display: flex; flex-wrap: wrap; gap: 6px; }
.desig a { display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 12px; border-radius: 999px; background: var(--paper); text-decoration: none; color: var(--ink); font-size: 13px; transition: box-shadow .2s; }
.desig a:hover { box-shadow: inset 0 0 0 1px var(--navy); }
.desig .ar { color: var(--earth); font-size: 13px; }
.desig .n { color: var(--ink-3); font-size: 12px; }
.eco-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.eco-tiles a { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 4px 10px; padding: 12px; border-radius: 8px; background: var(--paper); text-decoration: none; color: var(--ink); transition: transform .2s, box-shadow .2s; }
.eco-tiles a:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(0,26,56,.1); }
.eco-tiles .tag { height: 22px; padding: 0 10px; border-radius: 999px; font-size: 11.5px; font-weight: 500; display: inline-flex; align-items: center; }
.eco-tiles .ar { font-size: 14px; color: var(--earth); text-align: right; }
.eco-tiles .n { grid-column: 1 / -1; font-size: 12.5px; color: var(--ink-3); }
.eco-tiles a.native { grid-column: 1 / -1; }
@media (max-width: 1100px) { .status-browse { grid-template-columns: 1fr; } }
@media (max-width: 700px) { .iucn-tiles { grid-template-columns: repeat(4, 1fr); } .iucn-tiles .nm { min-height: 0; } }
.eco-inline { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 999px; font-size: 12.5px; font-weight: 500; text-decoration: none; }
.pill .ar { font-size: 13px; opacity: .92; }
/* the two status cards stack, so seven Red List tiles fit on one row */
.status-browse { grid-template-columns: 1fr; }
.eco-tiles { grid-template-columns: repeat(5, 1fr); }
.eco-tiles a.native { grid-column: auto; }
@media (max-width: 900px) { .eco-tiles { grid-template-columns: 1fr 1fr; } }
/* word-by-word title reveal (motion.js / home slideshow) */
.mw { display: inline-block; overflow: hidden; vertical-align: top; padding: 0 .06em .12em 0; margin-bottom: -.12em; }
.mwi { display: inline-block; will-change: transform; }
/* Red List scale in the official IUCN colours: every category shown, this species' one lifted and marked. */
/* Every box is the same height (labels get room for two lines, centred); this species' category is
   lifted and shadowed rather than enlarged, and the others are faded so it stands out. */
.iucn-scale { align-items: stretch; margin-top: 14px; }
.iucn-scale span { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 10px 4px;
  opacity: .4; transition: opacity .2s, transform .2s; }
.iucn-scale span small { display: flex; align-items: center; justify-content: center; min-height: 2.6em; line-height: 1.25; opacity: .9; }
.iucn-scale span:hover { opacity: .8; }
.iucn-scale span.on { opacity: 1; transform: translateY(-8px); box-shadow: 0 10px 22px rgba(0,0,0,.2) !important; }
.iucn-scale span.gap { margin-left: 14px; }

/* header language switch: English ⇄ العربية, keeping the same plant, filters and section */
.lang-switch { flex: none; height: 38px; padding: 0 14px; border-radius: 999px; display: inline-flex; align-items: center;
  font-size: 14px; color: var(--navy); text-decoration: none; box-shadow: inset 0 0 0 1px var(--hairline); margin-inline-start: 12px; }
.lang-switch:hover { box-shadow: inset 0 0 0 1px var(--navy); }
.lang-switch:lang(ar) { font-family: var(--font-ar); font-size: 15px; }
