/**
 * دليل أسر نجد — الواجهة العامة
 * طبقة عرض نظيفة ترث هوية قالب العمران وتحتفظ بقيم احتياطية عند استخدام ثيم آخر.
 */
.anf-shell {
    --anf-green: var(--alomran-green, #1E4724);
    --anf-green-dark: var(--alomran-green-dark, #2D4A19);
    --anf-gold: var(--alomran-gold-mid, var(--alomran-gold, #C4A35A));
    --anf-beige: var(--alomran-beige, #FFF9ED);
    --anf-text: var(--alomran-text, #3C2B1A);
    --anf-muted: #756D62;
    --anf-paper: #FFFDF8;
    --anf-white: #FFFFFF;
    --anf-line: rgba(196, 163, 90, .34);
    --anf-line-soft: rgba(60, 43, 26, .10);
    --anf-shadow: 0 12px 28px rgba(60, 43, 26, .12);
    --anf-shadow-soft: 0 6px 18px rgba(60, 43, 26, .08);
    --anf-radius-sm: var(--alomran-radius-sm, 8px);
    --anf-radius-md: var(--alomran-radius-md, 12px);
    --anf-radius-lg: var(--alomran-radius-lg, 16px);
    direction: rtl;
    text-align: right;
    color: var(--anf-text);
    font-family: inherit;
    font-size: 16px;
    line-height: 1.85;
    -webkit-font-smoothing: antialiased;
}
.anf-shell *,
.anf-shell *::before,
.anf-shell *::after { box-sizing: border-box; }
.anf-shell a { color: var(--anf-green); }
.anf-shell a:hover { color: var(--anf-green-dark); }

/* Layout */
.anf-shell {
    width: min(1170px, calc(100% - 32px));
    margin: 0 auto;
    padding: 28px 0 48px;
}
.anf-shell--family { width: min(1080px, calc(100% - 32px)); }

/* Intro */
.anf-hero {
    position: relative;
    margin: 0 0 24px;
    padding: 6px 0 16px;
}
.anf-hero::after,
.anf-home-section-title::after,
.anf-family__title::after {
    content: "";
    display: block;
    width: 42px;
    height: 2px;
    margin-top: 10px;
    border-radius: var(--anf-radius-sm);
    background: var(--anf-gold);
}
.anf-hero__eyebrow {
    margin: 0 0 5px;
    color: var(--anf-gold);
    font-size: 14px;
    font-weight: 700;
}
.anf-title {
    margin: 0;
    color: var(--anf-green-dark);
    font-size: 32px;
    line-height: 1.45;
    font-weight: 700;
}
.anf-intro {
    max-width: 920px;
    margin: 0;
    color: var(--anf-text);
    font-size: 16px;
    line-height: 1.9;
}
.anf-intro p { margin: 0; }

/* Search */
.anf-search {
    margin: 0 0 24px;
    padding: 22px;
    background: var(--anf-paper);
    border: 1px solid var(--anf-line);
    border-radius: var(--anf-radius-lg);
    box-shadow: var(--anf-shadow-soft);
}
.anf-search__top {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 118px;
    gap: 12px;
    align-items: end;
}
.anf-field { min-width: 0; }
.anf-label {
    display: block;
    margin: 0 0 6px;
    color: var(--anf-green-dark);
    font-size: 14px;
    font-weight: 700;
}
.anf-input,
.anf-select,
.anf-textarea {
    width: 100%;
    min-height: 48px;
    padding: 10px 14px;
    border: 1px solid #D8D5CD;
    border-radius: var(--anf-radius-sm);
    background: var(--anf-white);
    color: var(--anf-text);
    font: inherit;
    font-size: 16px;
    line-height: 1.5;
    transition: border-color .18s ease, box-shadow .18s ease;
}
.anf-field--search .anf-input { min-height: 54px; padding-inline: 16px; }
.anf-input::placeholder { color: #99958E; }
.anf-input:hover,
.anf-select:hover,
.anf-textarea:hover { border-color: var(--anf-gold); }
.anf-input:focus,
.anf-select:focus,
.anf-textarea:focus {
    outline: 0;
    border-color: var(--anf-green);
    box-shadow: 0 0 0 3px rgba(30, 71, 36, .10);
}
.anf-select {
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    padding-inline-end: 14px;
    padding-inline-start: 40px;
    /* Clean RTL dropdown chevron: one small downward arrow on the left. */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5 11 1.5' fill='none' stroke='%231E4724' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-position: left 16px center;
    background-size: 12px 8px;
    background-repeat: no-repeat;
}
.anf-filters-wrap {
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid rgba(196, 163, 90, .25);
}
.anf-filters {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
}
.anf-search__footer { display: flex; justify-content: flex-end; margin-top: 12px; }
.anf-clear { color: var(--anf-muted); font-size: 14px; text-decoration: none; }
.anf-button {
    min-height: 46px;
    padding: 9px 20px;
    border: 1px solid transparent;
    border-radius: var(--anf-radius-sm);
    font: inherit;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background .18s ease, border-color .18s ease, transform .18s ease;
}
.anf-button--primary { color: #fff; background: var(--anf-green); border-color: var(--anf-green); }
.anf-button--primary:hover { color: #fff; background: var(--anf-green-dark); transform: translateY(-1px); }
.anf-button--outline { color: var(--anf-green); background: var(--anf-white); border-color: rgba(30, 71, 36, .24); }
.anf-button--outline:hover { background: var(--anf-beige); border-color: var(--anf-green); }
.anf-search__submit { min-width: 118px; min-height: 54px; }

/* Autocomplete */
.anf-autocomplete { position: relative; }
.anf-suggestions {
    position: absolute;
    z-index: 30;
    inset-inline: 0;
    top: calc(100% + 6px);
    max-height: 320px;
    overflow: auto;
    padding: 6px;
    margin: 0;
    list-style: none;
    background: var(--anf-white);
    border: 1px solid var(--anf-line);
    border-radius: var(--anf-radius-md);
    box-shadow: var(--anf-shadow);
}
.anf-suggestions[hidden] { display: none; }
.anf-suggestion { padding: 9px 11px; border-radius: var(--anf-radius-sm); cursor: pointer; }
.anf-suggestion:hover,
.anf-suggestion[aria-selected="true"] { background: var(--anf-beige); }
.anf-suggestion__name { display: block; color: var(--anf-green); font-size: 16px; font-weight: 700; }
.anf-suggestion__context { display: block; margin-top: 2px; color: var(--anf-muted); font-size: 14px; }

/* Home statistics */
.anf-home-stats { margin: 0 0 18px; }
.anf-home-section-title {
    margin: 0 0 12px;
    color: var(--anf-green-dark);
    font-size: 22px;
    line-height: 1.5;
    font-weight: 700;
}
.anf-stats-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    overflow: hidden;
    background: var(--anf-white);
    border: 1px solid var(--anf-line);
    border-radius: var(--anf-radius-md);
    box-shadow: var(--anf-shadow-soft);
}
.anf-stat {
    min-width: 0;
    padding: 15px 18px;
    border-inline-start: 1px solid var(--anf-line-soft);
    text-align: center;
}
.anf-stat:first-child { border-inline-start: 0; }
.anf-stat strong { display: inline; color: var(--anf-green-dark); font-size: 22px; line-height: 1.35; font-weight: 700; }
.anf-stat span { display: inline; margin-inline-start: 7px; color: var(--anf-text); font-size: 14px; }

/* Home notices */
.anf-home-notices {
    display: grid;
    grid-template-columns: 1.15fr .85fr;
    gap: 14px;
    margin-top: 18px;
}
.anf-review-box,
.anf-caution {
    margin: 0;
    padding: 20px 22px;
    border-radius: var(--anf-radius-md);
    box-shadow: var(--anf-shadow-soft);
}
.anf-review-box { background: var(--anf-beige); border: 1px solid var(--anf-line); }
.anf-caution { background: var(--anf-white); border: 1px solid var(--anf-line); border-inline-start: 3px solid var(--anf-gold); }
.anf-review-box__head { display: flex; align-items: center; gap: 9px; margin-bottom: 5px; }
.anf-review-box__head > span {
    display: inline-grid;
    place-items: center;
    flex: 0 0 26px;
    width: 26px;
    height: 26px;
    border: 1px solid var(--anf-gold);
    border-radius: 50%;
    color: var(--anf-green-dark);
    font-size: 14px;
    font-weight: 700;
}
.anf-review-box h2,
.anf-caution h2 {
    margin: 0;
    color: var(--anf-green-dark);
    font-size: 20px;
    line-height: 1.55;
    font-weight: 700;
}
.anf-review-box p,
.anf-caution p { margin: 6px 0 0; color: var(--anf-text); font-size: 16px; line-height: 1.9; }
.anf-caution p + p { margin-top: 8px; }

/* Results */
.anf-results__head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin: 24px 0 14px; }
.anf-results__title { margin: 0; color: var(--anf-green-dark); font-size: 22px; font-weight: 700; }
.anf-count { margin: 0; color: var(--anf-muted); font-size: 14px; }
.anf-count strong { color: var(--anf-green); font-size: 16px; }
.anf-list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.anf-card {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 16px;
    min-height: 164px;
    padding: 20px;
    overflow: hidden;
    background: var(--anf-white);
    border: 1px solid var(--anf-line);
    border-radius: var(--anf-radius-lg);
    box-shadow: var(--anf-shadow-soft);
}
.anf-card::before { content: ""; position: absolute; inset-block: 0; inset-inline-start: 0; width: 3px; background: var(--anf-gold); }
.anf-card__body { min-width: 0; }
.anf-card__name { margin: 0 0 12px; font-size: 22px; line-height: 1.4; font-weight: 700; }
.anf-card__name a { color: var(--anf-green-dark); text-decoration: none; }
.anf-card__meta { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px 16px; }
.anf-card__row { display: grid; grid-template-columns: 62px minmax(0, 1fr); gap: 7px; align-items: baseline; }
.anf-card__label { color: var(--anf-muted); font-size: 14px; font-weight: 700; }
.anf-card__values { color: var(--anf-text); font-size: 16px; }
.anf-card__values .anf-value { margin-inline-end: 7px; color: var(--anf-text); text-decoration: none; font-weight: 700; }
.anf-card__open { align-self: end; display: inline-flex; gap: 6px; align-items: center; color: var(--anf-green); font-size: 14px; font-weight: 700; text-decoration: none; white-space: nowrap; }
.anf-card__flag { margin: 10px 0 0; color: #8A5B16; font-size: 14px; }
.anf-empty { padding: 24px; background: var(--anf-white); border: 1px solid var(--anf-line); border-radius: var(--anf-radius-md); }
.anf-empty p { margin: 5px 0 0; color: var(--anf-muted); }
.anf-pagination { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--anf-line-soft); }
.anf-page { min-height: 42px; padding: 7px 14px; display: inline-flex; align-items: center; border: 1px solid var(--anf-line); border-radius: var(--anf-radius-sm); background: var(--anf-white); color: var(--anf-green); font-size: 14px; text-decoration: none; }
.anf-page--current { color: var(--anf-muted); background: var(--anf-beige); }

/* Family page */
.anf-breadcrumb { display: flex; align-items: center; gap: 8px; margin: 0 0 14px; color: var(--anf-muted); font-size: 14px; }
.anf-breadcrumb a { text-decoration: none; }
.anf-family {
    overflow: hidden;
    background: var(--anf-white);
    border: 1px solid var(--anf-line);
    border-radius: var(--anf-radius-lg);
    box-shadow: var(--anf-shadow);
}
.anf-family__hero { padding: 24px 28px 20px; background: linear-gradient(180deg, var(--anf-paper), var(--anf-beige)); border-bottom: 1px solid var(--anf-line); }
.anf-family__title { font-size: 32px; }
.anf-family__title::after { margin-top: 8px; }
.anf-profile { padding: 8px 28px 14px; }
.anf-facts { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); margin: 0; }
.anf-facts__row { min-width: 0; padding: 14px 16px; border-inline-start: 1px solid var(--anf-line-soft); }
.anf-facts__row:first-child { border-inline-start: 0; }
.anf-facts__label { margin: 0 0 4px; color: var(--anf-muted); font-size: 14px; font-weight: 700; }
.anf-facts__value { margin: 0; color: var(--anf-green-dark); font-size: 16px; font-weight: 700; }
.anf-facts__value .anf-value { color: var(--anf-green-dark); text-decoration: none; }
.anf-family__section { margin: 0 28px; padding: 22px 0; border-top: 1px solid var(--anf-line-soft); }
.anf-family__section h2 { margin: 0 0 8px; color: var(--anf-green-dark); font-size: 20px; font-weight: 700; }
.anf-family__note { font-size: 16px; line-height: 1.9; }
.anf-family__note p { margin: 0; }
.anf-section-intro { margin: 0 0 10px; color: var(--anf-muted); font-size: 14px; }
.anf-family__sources ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.anf-family__sources li { padding: 10px 12px; background: var(--anf-beige); border-radius: var(--anf-radius-sm); font-size: 14px; }

/* Notices */
.anf-notice { margin: 12px 0 0; padding: 10px 12px; border-radius: var(--anf-radius-sm); font-size: 14px; }
.anf-notice--warn { background: #FFF7E4; border: 1px solid #E7C77B; color: #704C14; }
.anf-notice--ok { background: #F1F8F1; border: 1px solid #B7D3B8; color: var(--anf-green-dark); }
.anf-notice--error { background: #FFF0EE; border: 1px solid #E2B4AE; color: #813C34; }

/* Suggestion */
.anf-suggest { margin-top: 20px; padding: 20px 22px; background: var(--anf-paper); border: 1px solid var(--anf-line); border-radius: var(--anf-radius-lg); box-shadow: var(--anf-shadow-soft); }
.anf-suggest__head { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.anf-suggest__head h2 { margin: 0 0 3px; color: var(--anf-green-dark); font-size: 20px; font-weight: 700; }
.anf-suggest__head p { margin: 0; color: var(--anf-muted); font-size: 14px; }
.anf-suggest__form { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--anf-line-soft); }
.anf-suggest__form[hidden] { display: none; }
.anf-form-grid { display: grid; gap: 12px; }
.anf-form-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.anf-form-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.anf-form-grid--4 { grid-template-columns: 2fr .8fr .8fr 1.4fr; }
.anf-geo-correction { margin: 12px 0; padding: 14px; border: 1px solid var(--anf-line); border-radius: var(--anf-radius-md); background: var(--anf-cream); }
.anf-geo-unlisted { margin-top: 10px; }
.anf-check { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; color: var(--anf-ink); cursor: pointer; }
.anf-check input { width: 18px; height: 18px; }
.anf-geo-unlisted [data-anf-geo-unlisted-field] { margin-top: 10px; }
.anf-suggest__form .anf-field { margin-bottom: 12px; }
.anf-textarea { min-height: 92px; resize: vertical; }
.anf-fieldset { margin: 4px 0 14px; padding: 16px 0 0; border: 0; border-top: 1px solid var(--anf-line-soft); }
.anf-fieldset legend { padding: 0 0 9px; color: var(--anf-green-dark); font-size: 14px; font-weight: 700; }
.anf-hint { margin: 5px 0 0; color: var(--anf-muted); font-size: 14px; }
.anf-required { color: #9B3C31; }
.anf-actions { margin-top: 4px; }
.anf-form-status { margin: 9px 0 0; font-size: 14px; font-weight: 700; }
.anf-hp { position: absolute; inset-inline-start: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Accessibility helpers */
.screen-reader-text {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

@media (max-width: 900px) {
    .anf-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .anf-list { grid-template-columns: 1fr; }
    .anf-home-notices { grid-template-columns: 1fr; }
    .anf-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .anf-facts__row:nth-child(3) { border-inline-start: 0; border-top: 1px solid var(--anf-line-soft); }
    .anf-facts__row:nth-child(4) { border-top: 1px solid var(--anf-line-soft); }
    .anf-form-grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 600px) {
    .anf-shell,
    .anf-shell--family { width: calc(100% - 22px); padding: 20px 0 38px; }
    .anf-title,
    .anf-family__title { font-size: 28px; }
    .anf-search { padding: 16px; }
    .anf-search__top { grid-template-columns: 1fr; }
    .anf-search__submit { width: 100%; }
    .anf-filters { grid-template-columns: 1fr; }
    .anf-stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .anf-stat { border-top: 1px solid var(--anf-line-soft); }
    .anf-stat:nth-child(-n+2) { border-top: 0; }
    .anf-stat:nth-child(odd) { border-inline-start: 0; }
    .anf-card { grid-template-columns: 1fr; padding: 18px; }
    .anf-card__meta { grid-template-columns: 1fr; }
    .anf-card__open { justify-self: start; }
    .anf-family__hero { padding: 20px 18px 17px; }
    .anf-profile { padding: 6px 18px 12px; }
    .anf-facts { grid-template-columns: 1fr; }
    .anf-facts__row { border-inline-start: 0; border-top: 1px solid var(--anf-line-soft); padding: 12px 0; }
    .anf-facts__row:first-child { border-top: 0; }
    .anf-family__section { margin-inline: 18px; }
    .anf-family__sources ul { grid-template-columns: 1fr; }
    .anf-suggest { padding: 17px 16px; }
    .anf-suggest__head { align-items: flex-start; flex-direction: column; gap: 12px; }
    .anf-suggest__head .anf-button { width: 100%; }
    .anf-form-grid--2,
    .anf-form-grid--3,
    .anf-form-grid--4 { grid-template-columns: 1fr; }
    .anf-pagination { flex-wrap: wrap; }
}

@media (prefers-reduced-motion: reduce) {
    .anf-shell *,
    .anf-shell *::before,
    .anf-shell *::after { transition: none; }
}

@media print {
    .anf-search,
    .anf-suggest,
    .anf-pagination { display: none; }
}


/* ==========================================================
 * Directory state isolation
 * Home and results are deliberately scoped so later changes
 * to one state cannot alter the other.
 * ========================================================== */

/* Shared directory rhythm */
body .anf-directory {
    padding-top: 8px;
}
body .anf-directory > .anf-hero {
    margin: 0 0 18px;
    padding: 0 0 12px;
}
body .anf-directory > .anf-hero .anf-hero__eyebrow {
    margin: 0 0 4px;
    font-size: 14px;
    line-height: 1.55;
}
body .anf-directory > .anf-hero .anf-intro {
    max-width: 960px;
    margin: 0;
    font-size: 16px;
    line-height: 1.75;
}
body .anf-directory > .anf-hero::after {
    margin-top: 8px;
}
body .anf-directory > .anf-search {
    margin: 0 0 18px;
}

/* ---------- HOME: stable baseline ---------- */
body .anf-directory--home > .anf-add-family {
    margin: 0 0 22px;
}
body .anf-directory--home > .anf-add-family > .anf-add-family__prompt {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 14px 18px;
    background: var(--anf-paper);
    border: 1px solid var(--anf-line);
    border-radius: var(--anf-radius-md);
    box-shadow: var(--anf-shadow-soft);
}
body .anf-directory--home .anf-add-family__copy {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
body .anf-directory--home .anf-add-family__copy strong {
    color: var(--anf-green-dark);
    font-size: 16px;
    line-height: 1.55;
    font-weight: 700;
}
body .anf-directory--home .anf-add-family__copy span {
    color: var(--anf-muted);
    font-size: 14px;
    line-height: 1.65;
}
body .anf-directory--home .anf-add-family__link {
    appearance: none;
    flex: 0 0 auto;
    min-height: 42px;
    padding: 8px 16px;
    border: 1px solid var(--anf-green);
    border-radius: var(--anf-radius-sm);
    background: var(--anf-green);
    color: #fff;
    font: inherit;
    font-size: 14px;
    line-height: 1.4;
    font-weight: 700;
    cursor: pointer;
}
body .anf-directory--home .anf-add-family__link:hover {
    background: var(--anf-green-dark);
    color: #fff;
}
body .anf-directory--home > .anf-home-stats {
    display: block;
    margin: 0 0 18px;
}
body .anf-directory--home > .anf-home-stats > .anf-home-section-title {
    margin: 0 0 12px;
    color: var(--anf-green-dark);
    font-size: 22px;
    line-height: 1.5;
    font-weight: 700;
}
body .anf-directory--home > .anf-home-stats > .anf-stats-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    overflow: hidden;
    background: var(--anf-white);
    border: 1px solid var(--anf-line);
    border-radius: var(--anf-radius-md);
    box-shadow: var(--anf-shadow-soft);
}
body .anf-directory--home .anf-stats-grid > .anf-stat {
    display: block;
    min-width: 0;
    padding: 15px 18px;
    border-inline-start: 1px solid var(--anf-line-soft);
    text-align: center;
}
body .anf-directory--home .anf-stats-grid > .anf-stat:first-child {
    border-inline-start: 0;
}
body .anf-directory--home .anf-stat > strong {
    display: inline;
    color: var(--anf-green-dark);
    font-size: 22px;
    line-height: 1.35;
    font-weight: 700;
}
body .anf-directory--home .anf-stat > span {
    display: inline;
    margin-inline-start: 7px;
    color: var(--anf-text);
    font-size: 14px;
}
body .anf-directory--home > .anf-home-notices {
    display: grid;
    grid-template-columns: 1.15fr .85fr;
    gap: 14px;
    margin: 18px 0 0;
}
body .anf-directory--home > .anf-home-notices > .anf-review-box,
body .anf-directory--home > .anf-home-notices > .anf-caution {
    display: block;
    margin: 0;
    padding: 20px 22px;
    border-radius: var(--anf-radius-md);
    box-shadow: var(--anf-shadow-soft);
}
body .anf-directory--home > .anf-home-notices > .anf-review-box {
    background: var(--anf-beige);
    border: 1px solid var(--anf-line);
}
body .anf-directory--home > .anf-home-notices > .anf-caution {
    background: var(--anf-white);
    border: 1px solid var(--anf-line);
    border-inline-start: 3px solid var(--anf-gold);
}
body .anf-directory--home .anf-review-box__head {
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 0 0 5px;
}
body .anf-directory--home .anf-review-box__head > span {
    display: inline-grid;
    place-items: center;
    flex: 0 0 26px;
    width: 26px;
    height: 26px;
    border: 1px solid var(--anf-gold);
    border-radius: 50%;
    color: var(--anf-green-dark);
    font-size: 14px;
    font-weight: 700;
}
body .anf-directory--home .anf-review-box h2,
body .anf-directory--home .anf-caution h2 {
    margin: 0;
    color: var(--anf-green-dark);
    font-size: 20px;
    line-height: 1.55;
    font-weight: 700;
}
body .anf-directory--home .anf-review-box p,
body .anf-directory--home .anf-caution p {
    margin: 6px 0 0;
    color: var(--anf-text);
    font-size: 16px;
    line-height: 1.9;
}

/* ---------- RESULTS: independent working state ---------- */
body .anf-directory--results > .anf-hero {
    margin-bottom: 14px;
}
body .anf-directory--results > .anf-search {
    margin-bottom: 14px;
}
body .anf-directory--results > .anf-add-family {
    margin: 0 0 14px;
}
body .anf-directory--results > .anf-add-family > .anf-add-family__prompt {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 13px 16px;
    background: var(--anf-paper);
    border: 1px solid var(--anf-line);
    border-radius: var(--anf-radius-md);
    box-shadow: var(--anf-shadow-soft);
}
body .anf-directory--results .anf-add-family__copy {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
body .anf-directory--results .anf-add-family__copy strong {
    color: var(--anf-green-dark);
    font-size: 15px;
    line-height: 1.55;
    font-weight: 700;
}
body .anf-directory--results .anf-add-family__copy span {
    color: var(--anf-muted);
    font-size: 14px;
    line-height: 1.6;
}
body .anf-directory--results .anf-add-family__link {
    appearance: none;
    flex: 0 0 auto;
    min-height: 40px;
    padding: 7px 15px;
    border: 1px solid var(--anf-green);
    border-radius: var(--anf-radius-sm);
    background: var(--anf-green);
    color: #fff;
    font: inherit;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}
body .anf-directory--results .anf-add-family__link:hover {
    background: var(--anf-green-dark);
    color: #fff;
}
body .anf-directory .anf-add-family__form {
    margin-top: 12px;
    padding: 20px;
    background: var(--anf-paper);
    border: 1px solid var(--anf-line);
    border-radius: var(--anf-radius-lg);
    box-shadow: var(--anf-shadow-soft);
}
body .anf-directory .anf-add-family__form h2 {
    margin: 0 0 4px;
    color: var(--anf-green-dark);
    font-size: 20px;
    line-height: 1.5;
}
body .anf-directory .anf-form-intro {
    margin: 0 0 16px;
    color: var(--anf-muted);
    font-size: 14px;
}
body .anf-directory--results > .anf-results-toolbar {
    display: flex;
    justify-content: flex-start;
    margin: 0 0 12px;
}
body .anf-directory--results .anf-back-directory {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--anf-green);
    font-size: 14px;
    line-height: 1.5;
    font-weight: 700;
    text-decoration: none;
}
body .anf-directory--results .anf-back-directory:hover {
    color: var(--anf-green-dark);
    text-decoration: underline;
}
body .anf-directory--results .anf-results__head {
    margin-top: 0;
}
body .anf-directory--results .anf-results__title {
    font-size: 22px;
    line-height: 1.5;
}
body .anf-directory--results .anf-card__name {
    font-size: 20px;
    line-height: 1.45;
}
body .anf-directory--results .anf-count,
body .anf-directory--results .anf-card__label,
body .anf-directory--results .anf-card__open {
    font-size: 14px;
}

@media (max-width: 900px) {
    body .anf-directory--home > .anf-home-notices {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    body .anf-directory {
        padding-top: 6px;
    }
    body .anf-directory > .anf-hero {
        margin-bottom: 14px;
        padding-bottom: 9px;
    }
    body .anf-directory > .anf-hero .anf-intro {
        font-size: 15px;
    }
    body .anf-directory--home > .anf-add-family > .anf-add-family__prompt,
    body .anf-directory--results > .anf-add-family > .anf-add-family__prompt {
        align-items: stretch;
        flex-direction: column;
        gap: 10px;
        padding: 14px;
    }
    body .anf-directory .anf-add-family__link {
        width: 100%;
    }
    body .anf-directory .anf-add-family__form {
        padding: 16px;
    }
}

@media (max-width: 600px) {
    body .anf-directory--home > .anf-home-stats > .anf-stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* 2.7.0 — low-friction reader corrections */
.anf-correctable{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.anf-correctable--title{justify-content:flex-start}
.anf-correct-link{border:0;background:transparent;color:#6f795f;padding:2px 4px;font:inherit;font-size:.78em;text-decoration:underline;text-underline-offset:3px;cursor:pointer}
.anf-correct-link:hover,.anf-correct-link:focus{color:#1e4724}
.anf-facts__value{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.anf-facts__correction{grid-column:1/-1}
.anf-quick-correction{margin:8px 0 12px;padding:12px 14px;border:1px solid rgba(30,71,36,.16);border-radius:12px;background:#fffdf7}
.anf-quick-correction__line{display:flex;gap:8px;align-items:center}
.anf-quick-correction__line .anf-input{flex:1}
.anf-quick-correction__actions{display:flex;gap:8px;align-items:center;margin-top:8px;flex-wrap:wrap}
.anf-quick-source{margin-top:8px}
.anf-button--text{background:transparent!important;border:0!important;color:#5d6b54!important;padding-inline:4px!important;box-shadow:none!important}
.anf-button--compact{padding:8px 12px!important;font-size:.9rem!important}
.anf-lineage-alert{margin-top:14px;padding-top:12px;border-top:1px solid rgba(30,71,36,.10)}
.anf-choice-row{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:12px}
.anf-choice-row label{cursor:pointer}
.anf-choice-row input{position:absolute;opacity:0;pointer-events:none}
.anf-choice-row span{display:inline-block;padding:8px 12px;border:1px solid #d8d4c7;border-radius:999px;background:#fff;color:#403124}
.anf-choice-row input:checked+span{border-color:#1e4724;background:#eef4ed;color:#1e4724;font-weight:700}
.anf-suggest__form--simple{max-width:760px}
@media(max-width:640px){.anf-quick-correction__line{align-items:stretch;flex-direction:column}.anf-choice-row{gap:6px}.anf-choice-row span{padding:7px 10px;font-size:.9rem}}
