:root {
    --sfenc-ink:#2e2924;
    --sfenc-text:#4d4740;
    --sfenc-muted:#756d63;
    --sfenc-paper:#f8f4ee;
    --sfenc-warm:#eee6da;
    --sfenc-line:#d8cfc3;
    --sfenc-accent:#94663e;
    --sfenc-dark:#211b16;
}

/* Dynamic archive controls only. The surrounding archive layout is owned by Oxygen. */
.sfenc-search-wrap,
.sfenc-category-pills,
.sfenc-letters,
.sfenc-entry-results {
    width:100%;
    box-sizing:border-box;
}

.sfenc-search-wrap * ,
.sfenc-category-pills *,
.sfenc-letters *,
.sfenc-entry-results * {
    box-sizing:border-box;
}

.sfenc-search {
    position:relative;
    display:flex;
    align-items:stretch;
    width:100%;
    max-width:980px;
    margin:0 auto;
}

.sfenc-search input {
    width:100%;
    min-width:0;
    height:58px;
    padding:0 126px 0 20px;
    border:1px solid #d9d0c5;
    border-radius:8px;
    background:#fff;
    color:var(--sfenc-ink);
    font:inherit;
    font-size:16px;
    line-height:1;
    box-shadow:0 7px 20px rgba(42,31,20,.10);
    outline:none;
}

.sfenc-search input:focus {
    border-color:var(--sfenc-accent);
    box-shadow:0 7px 22px rgba(42,31,20,.12),0 0 0 2px rgba(148,102,62,.10);
}

.sfenc-search button {
    position:absolute;
    top:7px;
    right:7px;
    height:44px;
    padding:0 22px;
    border:0;
    border-radius:6px;
    background:var(--sfenc-dark);
    color:#fff;
    font-size:11px;
    font-weight:700;
    letter-spacing:1.3px;
    text-transform:uppercase;
    cursor:pointer;
}

.sfenc-term-count {
    margin-top:16px;
    text-align:center;
    color:#6f675d;
    font-size:14px;
    line-height:1.4;
}

.sfenc-category-pills {
    display:flex;
    flex-wrap:wrap;
    justify-content:center;
    gap:8px;
    max-width:1120px;
    margin:0 auto;
}

.sfenc-category-pill {
    display:inline-flex;
    align-items:center;
    justify-content:center;
    min-height:34px;
    padding:7px 14px;
    border:1px solid #d8cfc3;
    border-radius:999px;
    background:#fbfaf7;
    color:#5f574d;
    font-size:13px;
    line-height:1.2;
    text-decoration:none !important;
    transition:background-color .18s ease,border-color .18s ease,color .18s ease;
}

.sfenc-category-pill:hover,
.sfenc-category-pill.is-active {
    border-color:var(--sfenc-accent);
    background:var(--sfenc-accent);
    color:#fff;
}

.sfenc-letters {
    display:flex;
    flex-wrap:wrap;
    align-items:center;
    justify-content:center;
    gap:14px;
    padding:17px 12px;
    border-top:1px solid var(--sfenc-line);
    border-bottom:1px solid var(--sfenc-line);
}

.sfenc-letters a {
    color:var(--sfenc-accent);
    font-size:16px;
    font-weight:700;
    line-height:1;
    letter-spacing:.8px;
    text-decoration:none !important;
}

.sfenc-letters a:hover,
.sfenc-letters a.is-active {
    color:var(--sfenc-dark);
}

.sfenc-letters a.is-empty {
    opacity:.30;
}

.sfenc-results-heading {
    display:flex;
    align-items:flex-end;
    justify-content:space-between;
    gap:24px;
    padding-bottom:22px;
    margin-bottom:28px;
    border-bottom:1px solid var(--sfenc-line);
}

.sfenc-results-heading h2 {
    margin:0;
    color:var(--sfenc-ink);
    font-size:30px;
    font-weight:400;
    line-height:1.15;
}

.sfenc-results-heading span {
    color:var(--sfenc-muted);
    font-size:12px;
    letter-spacing:1px;
    text-transform:uppercase;
}

.sfenc-reference-list {
    width:100%;
}

.sfenc-letter-group {
    margin:0 0 58px;
}

.sfenc-letter-heading {
    display:flex;
    align-items:flex-end;
    gap:20px;
    margin-bottom:31px;
}

.sfenc-letter-heading::after {
    content:"";
    flex:1;
    height:2px;
    margin-bottom:8px;
    background:var(--sfenc-accent);
}

.sfenc-letter-heading h2 {
    margin:0;
    color:var(--sfenc-accent);
    font-size:48px;
    font-weight:400;
    line-height:1;
}

.sfenc-letter-entries {
    width:100%;
}

.sfenc-term-entry {
    max-width:1020px;
    padding:0 0 32px;
    margin:0 0 32px;
    border-bottom:1px solid #e2d9ce;
}

.sfenc-term-entry:last-child {
    margin-bottom:0;
}

.sfenc-term-entry h3 {
    margin:0 0 10px;
    color:var(--sfenc-ink);
    font-size:26px;
    font-weight:600;
    line-height:1.25;
}

.sfenc-term-entry h3 a {
    color:inherit;
    text-decoration:none;
}

.sfenc-term-entry h3 a:hover {
    color:var(--sfenc-accent);
}

.sfenc-entry-cats {
    display:flex;
    flex-wrap:wrap;
    gap:6px;
    margin-bottom:12px;
}

.sfenc-entry-cats a {
    display:inline-flex;
    align-items:center;
    padding:5px 10px;
    border-radius:999px;
    background:#eee5d8;
    color:#795b3f;
    font-size:11px;
    line-height:1.2;
    text-decoration:none !important;
}

.sfenc-definition {
    max-width:1000px;
    margin:0 0 13px;
    color:#3d3833;
    font-size:17px;
    line-height:1.65;
}

.sfenc-inline-related {
    color:#625b52;
    font-size:14px;
    line-height:1.7;
}

.sfenc-inline-related strong {
    color:#645b51;
}

.sfenc-inline-related a {
    color:var(--sfenc-accent);
    text-decoration:none;
}

.sfenc-inline-related a:hover {
    text-decoration:underline;
    text-underline-offset:3px;
}

.sfenc-inline-related span {
    color:#6d655b;
}

.sfenc-pagination ul {
    display:flex;
    flex-wrap:wrap;
    justify-content:center;
    gap:7px;
    list-style:none;
    padding:12px 0 0;
    margin:0;
}

.sfenc-pagination a,
.sfenc-pagination span {
    display:flex;
    min-width:40px;
    height:40px;
    padding:0 10px;
    align-items:center;
    justify-content:center;
    border:1px solid var(--sfenc-line);
    border-radius:4px;
    color:var(--sfenc-ink);
    text-decoration:none;
}

.sfenc-pagination .current {
    background:var(--sfenc-accent);
    border-color:var(--sfenc-accent);
    color:#fff;
}

.sfenc-empty {
    padding:28px;
    border:1px solid var(--sfenc-line);
    background:#fbf8f3;
}

@media (max-width:760px) {
    .sfenc-search input {
        height:54px;
        padding-right:105px;
        font-size:14px;
    }
    .sfenc-search button {
        height:40px;
        padding:0 15px;
    }
    .sfenc-category-pills { gap:7px; }
    .sfenc-category-pill { font-size:12px; padding:7px 11px; }
    .sfenc-letters { gap:11px; padding:15px 6px; }
    .sfenc-letters a { font-size:14px; }
    .sfenc-letter-heading h2 { font-size:40px; }
    .sfenc-term-entry h3 { font-size:23px; }
    .sfenc-definition { font-size:16px; }
    .sfenc-results-heading { align-items:flex-start; flex-direction:column; gap:8px; }
}

.sfenc-breadcrumb {
	display:flex;
	flex-wrap:wrap;
	gap:10px;
	color:var(--sfenc-muted);
	font-size:13px;
	margin-bottom:48px;
}

.sfenc-entry-header {
	max-width:1050px;
	margin-bottom:54px;
	padding-bottom:38px;
	border-bottom:1px solid var(--sfenc-line);
}

.sfenc-entry-categories {
	display:flex;
	flex-wrap:wrap;
	gap:9px;
	margin-top:24px;
}

.sfenc-entry-categories a {
	border:1px solid var(--sfenc-line);
	padding:8px 11px;
	font-size:11px;
	font-weight:700;
	letter-spacing:1px;
	text-transform:uppercase;
}

.sfenc-entry-layout {
	display:grid;
	grid-template-columns:minmax(0,760px) minmax(260px,1fr);
	gap:80px;
	align-items:start;
}

.sfenc-entry-content {
	color:var(--sfenc-text);
	font-size:18px;
	line-height:1.85;
}

.sfenc-entry-content h2 { margin-top:52px; }
.sfenc-entry-content h3 { margin-top:38px; }

.sfenc-entry-aside {
	position:sticky;
	top:120px;
}

.sfenc-related {
	padding-top:8px;
	border-top:1px solid var(--sfenc-line);
}

.sfenc-related h2 { font-size:25px; margin-top:18px; }

.sfenc-related-list {
	display:flex;
	flex-direction:column;
	align-items:flex-start;
	gap:8px;
}

.sfenc-related-list a,
.sfenc-related-list span {
	font-size:15px;
	line-height:1.5;
}

.sfenc-related-list span { color:var(--sfenc-muted); }

.sfenc-explore {
	margin-top:80px;
	padding:48px;
	background:var(--sfenc-warm);
}

.sfenc-explore-links {
	display:flex;
	flex-wrap:wrap;
	gap:12px 30px;
	margin-top:26px;
}

.sfenc-explore-links a {
	font-size:13px;
	font-weight:700;
	letter-spacing:1px;
	text-transform:uppercase;
}

.sfenc-entry-footer-nav {
	margin-top:55px;
	padding-top:28px;
	border-top:1px solid var(--sfenc-line);
}

.sfenc-empty {
	padding:36px;
	background:var(--sfenc-warm);
}

@media (max-width: 980px) {
	.sfenc-category-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
	.sfenc-letters { grid-template-columns:repeat(9,minmax(40px,1fr)); }
	.sfenc-entry-layout { grid-template-columns:1fr; gap:45px; }
	.sfenc-entry-aside { position:static; }
}

@media (max-width: 640px) {
	.sfenc { font-size:16px; }
	.sfenc-block { padding:42px 0; }
	.sfenc-category-grid { grid-template-columns:1fr; }
	.sfenc-letters { grid-template-columns:repeat(6,minmax(38px,1fr)); }
	.sfenc-search { grid-template-columns:1fr; gap:8px; }
	.sfenc-search input,
	.sfenc-search select { border-right:1px solid var(--sfenc-line); }
	.sfenc-search button { min-height:50px; }
	.sfenc-entry-card { grid-template-columns:45px 1fr; gap:16px; }
	.sfenc-entry-letter { font-size:28px; }
	.sfenc-results-heading { align-items:flex-start; flex-direction:column; }
	.sfenc-explore { padding:30px 24px; }
}


/* ==========================================================
   V7 ARCHIVE PRESENTATION — approved reference-library design
   ========================================================== */

.sfenc-search-wrap {
    width:100%;
}
.sfenc-search {
    width:100%;
    max-width:none;
}
.sfenc-search input {
    height:62px;
    padding-left:22px;
    padding-right:145px;
    border-color:#d5c9b8;
    border-radius:7px;
    font-size:15px;
    box-shadow:none;
}
.sfenc-search input:focus {
    border-color:#a37245;
    box-shadow:0 0 0 2px rgba(163,114,69,.10);
}
.sfenc-search button {
    top:6px;
    right:6px;
    height:50px;
    min-width:118px;
    border-radius:5px;
    background:#24272b;
    font-size:11px;
    letter-spacing:1.5px;
}
.sfenc-term-count {
    margin-top:10px;
    color:#84796d;
    font-size:12px;
}

.sfenc-category-pills {
    max-width:100%;
    gap:8px 9px;
}
.sfenc-category-pill {
    min-height:32px;
    padding:7px 14px;
    border-color:#ded4c7;
    background:#fbf8f3;
    color:#625b52;
    font-size:11px;
    box-shadow:none;
}
.sfenc-category-pill:hover,
.sfenc-category-pill.is-active {
    border-color:#a37245;
    background:#a37245;
    color:#fff;
}

.sfenc-letters {
    width:100%;
    gap:18px;
    padding:8px 0 2px;
    border:0;
}
.sfenc-letters a {
    color:#9a6940;
    font-size:14px;
    font-weight:600;
    letter-spacing:.6px;
}
.sfenc-letters a:hover,
.sfenc-letters a.is-active {
    color:#2e2924;
}

.sfenc-entry-results {
    width:100%;
}
.sfenc-results-heading {
    padding:0 0 22px;
    margin:0 0 34px;
}
.sfenc-results-heading h2 {
    font-size:28px;
}
.sfenc-reference-list {
    width:100%;
}
.sfenc-letter-group {
    margin-bottom:62px;
}
.sfenc-letter-heading {
    gap:20px;
    margin-bottom:26px;
}
.sfenc-letter-heading::after {
    height:1px;
    margin-bottom:8px;
    background:#a37245;
}
.sfenc-letter-heading h2 {
    color:#9a6940;
    font-size:54px;
    font-weight:400;
}

.sfenc-term-entry {
    position:relative;
    display:grid;
    grid-template-columns:minmax(0,1fr) minmax(245px,310px);
    grid-template-rows:auto auto 1fr;
    column-gap:54px;
    max-width:none;
    padding:0 0 24px;
    margin:0 0 24px;
    border-bottom:1px solid #ddd4c8;
}
.sfenc-term-entry h3 {
    grid-column:1;
    grid-row:1;
    margin:0 0 8px;
    font-size:23px;
    font-weight:500;
}
.sfenc-entry-cats {
    grid-column:1;
    grid-row:2;
    margin:0 0 9px;
}
.sfenc-entry-cats a {
    padding:5px 10px;
    background:#eee5d8;
    color:#866241;
    font-size:10px;
}
.sfenc-definition {
    grid-column:1;
    grid-row:3;
    max-width:720px;
    margin:0;
    font-size:15px;
    line-height:1.65;
}
.sfenc-inline-related {
    grid-column:2;
    grid-row:1 / span 3;
    align-self:center;
    padding-left:26px;
    border-left:1px solid #e4dacf;
    color:#6d655c;
    font-size:12px;
    line-height:1.8;
}
.sfenc-inline-related strong {
    display:block;
    margin-bottom:3px;
    color:#5f574e;
    font-size:11px;
}
.sfenc-inline-related a {
    color:#9a6940;
}

.sfenc-empty {
    width:100%;
    padding:32px;
    border:1px solid #ded4c7;
    background:#f1e9de;
    color:#5e574f;
}

@media (max-width:800px) {
    .sfenc-search input {
        height:56px;
        padding-right:112px;
    }
    .sfenc-search button {
        height:44px;
        min-width:96px;
        padding:0 14px;
    }
    .sfenc-letters {
        gap:12px;
    }
    .sfenc-term-entry {
        grid-template-columns:1fr;
        grid-template-rows:auto;
        column-gap:0;
    }
    .sfenc-term-entry h3,
    .sfenc-entry-cats,
    .sfenc-definition,
    .sfenc-inline-related {
        grid-column:1;
        grid-row:auto;
    }
    .sfenc-inline-related {
        margin-top:14px;
        padding:12px 0 0;
        border-left:0;
        border-top:1px solid #e4dacf;
    }
}


/* ==========================================================
   V7.1 discovery alignment refinements
   ========================================================== */

.sfenc-search-wrap,
.sfenc-search {
    width:100%;
    max-width:none;
    margin-left:auto;
    margin-right:auto;
}

.sfenc-category-pills {
    width:100%;
    justify-content:center;
    margin-left:auto;
    margin-right:auto;
}

.sfenc-letters {
    width:100%;
    display:flex;
    justify-content:center;
    align-items:center;
    flex-wrap:wrap;
    gap:20px;
    margin-left:auto;
    margin-right:auto;
    text-align:center;
}

.sfenc-letters a {
    font-size:16px;
    line-height:1;
    min-width:12px;
}

@media (max-width:800px) {
    .sfenc-letters {
        justify-content:center;
        gap:14px;
    }

    .sfenc-letters a {
        font-size:15px;
    }
}
