/* ══════════════════════════════════════════════════════════════
   ERRORFIX KNOWLEDGE BASE — CSS STYLES
   Add these styles to your theme's style.css or functions.php
   ══════════════════════════════════════════════════════════════ */

/* ── KB INDEX PAGE ──────────────────────────────────────────── */

.ef-kb-index-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0;
}

/* Hero Section */
.ef-kb-hero {
    padding: 2.5rem 1.5rem 1.5rem;
    border-bottom: 1px solid var(--border, #252836);
}

.ef-hero-label {
    font-family: 'DM Mono', monospace;
    font-size: 0.65rem;
    color: var(--brand, #7c6af7);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin-bottom: 0.6rem;
}

.ef-kb-hero h1 {
    font-family: 'DM Serif Display', serif;
    font-size: clamp(1.6rem, 3vw, 2.2rem);
    line-height: 1.2;
    margin-bottom: 0.5rem;
    color: var(--text, #e8eaf0);
}

.ef-kb-hero h1 em {
    color: var(--accent, #e8c547);
    font-style: normal;
}

.ef-kb-hero p {
    color: var(--text-muted, #6b7280);
    font-size: 0.88rem;
    max-width: 520px;
    line-height: 1.6;
}

.ef-stats {
    display: flex;
    gap: 1.5rem;
    margin-top: 1.2rem;
}

.ef-stat {
    font-family: 'DM Mono', monospace;
    font-size: 0.72rem;
    color: var(--text-muted, #6b7280);
}

.ef-stat strong {
    color: var(--accent, #e8c547);
    font-size: 1rem;
    display: block;
    font-family: 'DM Serif Display', serif;
}

/* Controls / Filters */
.ef-kb-controls {
    padding: 1.2rem 1.5rem;
    border-bottom: 1px solid var(--border, #252836);
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.filter-btn {
    font-family: 'DM Mono', monospace;
    font-size: 0.68rem;
    letter-spacing: 0.05em;
    padding: 5px 12px;
    border-radius: 6px;
    border: 1px solid var(--border, #252836);
    background: transparent;
    color: var(--text-muted, #6b7280);
    cursor: pointer;
    transition: all 0.18s;
    white-space: nowrap;
    text-decoration: none;
    display: inline-block;
}

.filter-btn:hover {
    border-color: var(--brand, #7c6af7);
    color: var(--text, #e8eaf0);
}

.filter-btn.active {
    background: var(--brand, #7c6af7);
    border-color: var(--brand, #7c6af7);
    color: #fff;
}

.filter-btn.brand-active {
    background: var(--surface2, #1a1e2a);
    border-color: var(--accent, #e8c547);
    color: var(--accent, #e8c547);
}

.filter-sep {
    width: 1px;
    height: 24px;
    background: var(--border, #252836);
    margin: 0 0.3rem;
    align-self: center;
}

/* Article Grid */
.ef-kb-grid {
    padding: 1.5rem;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.art-card {
    background: var(--surface, #13161e);
    border: 1px solid var(--border, #252836);
    border-radius: 10px;
    padding: 1.25rem;
    transition: border-color 0.2s, background 0.2s;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    text-decoration: none;
    color: inherit;
}

.art-card:hover {
    border-color: var(--brand, #7c6af7);
    background: var(--surface2, #1a1e2a);
}

.art-card.featured {
    border-color: rgba(232, 197, 71, 0.35);
    background: var(--surface2, #1a1e2a);
}

.card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.card-tag {
    font-family: 'DM Mono', monospace;
    font-size: 0.6rem;
    letter-spacing: 0.08em;
    padding: 3px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    white-space: nowrap;
}

.tag-general {
    background: rgba(124, 106, 247, 0.15);
    color: #a89ff9;
    border: 1px solid rgba(124, 106, 247, 0.2);
}

.tag-bosch {
    background: rgba(74, 222, 128, 0.12);
    color: #4ade80;
    border: 1px solid rgba(74, 222, 128, 0.2);
}

.tag-samsung {
    background: rgba(56, 189, 248, 0.12);
    color: #7dd3fc;
    border: 1px solid rgba(56, 189, 248, 0.2);
}

.tag-hotpoint {
    background: rgba(248, 113, 113, 0.12);
    color: #f87171;
    border: 1px solid rgba(248, 113, 113, 0.2);
}

.tag-beko {
    background: rgba(251, 146, 60, 0.12);
    color: #fb923c;
    border: 1px solid rgba(251, 146, 60, 0.2);
}

.tag-indesit {
    background: rgba(232, 197, 71, 0.12);
    color: #e8c547;
    border: 1px solid rgba(232, 197, 71, 0.2);
}

.tag-siemens {
    background: rgba(139, 92, 246, 0.12);
    color: #a78bfa;
    border: 1px solid rgba(139, 92, 246, 0.2);
}

.card-featured-badge {
    font-family: 'DM Mono', monospace;
    font-size: 0.58rem;
    color: var(--accent, #e8c547);
    letter-spacing: 0.06em;
}

.how-to-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-family: 'DM Mono', monospace;
    font-size: 0.6rem;
    color: #4ade80;
    margin-bottom: -0.2rem;
}

.how-to-badge .dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #4ade80;
    flex-shrink: 0;
}

.art-card h3 {
    font-family: 'DM Serif Display', serif;
    font-size: 1rem;
    line-height: 1.3;
    color: var(--text, #e8eaf0);
}

.art-card p {
    font-size: 0.8rem;
    color: var(--text-muted, #6b7280);
    line-height: 1.5;
    flex: 1;
}

.card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 0.2rem;
}

.card-meta {
    font-family: 'DM Mono', monospace;
    font-size: 0.62rem;
    color: var(--text-muted, #6b7280);
}

.card-arrow {
    font-size: 0.75rem;
    color: var(--brand, #7c6af7);
    opacity: 0.7;
}

/* ── SINGLE ARTICLE PAGE ───────────────────────────────────── */

.ef-kb-article-page {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem 1.5rem 4rem;
}

/* Breadcrumb */
.ef-kb-breadcrumb {
    font-family: 'DM Mono', monospace;
    font-size: 0.65rem;
    color: var(--text-muted, #6b7280);
    display: flex;
    gap: 0.35rem;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 1.75rem;
}

.ef-kb-breadcrumb a {
    color: var(--brand, #7c6af7);
    text-decoration: none;
}

.ef-kb-breadcrumb .bc-sep {
    color: var(--border, #252836);
}

/* Article Header */
.ef-kb-article-header {
    display: grid;
    grid-template-columns: 1fr 200px;
    gap: 1.5rem;
    align-items: start;
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border, #252836);
}

@media (max-width: 768px) {
    .ef-kb-article-header {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }
}

.ef-kb-meta-row {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.ef-kb-pill {
    font-family: 'DM Mono', monospace;
    font-size: 0.58rem;
    letter-spacing: 0.08em;
    padding: 3px 9px;
    border-radius: 4px;
    text-transform: uppercase;
}

.ef-kb-pill-brand {
    background: rgba(74, 222, 128, 0.1);
    color: #4ade80;
    border: 1px solid rgba(74, 222, 128, 0.2);
}

.ef-kb-pill-type {
    background: rgba(124, 106, 247, 0.12);
    color: #a89ff9;
    border: 1px solid rgba(124, 106, 247, 0.2);
}

.ef-kb-pill-general {
    background: rgba(232, 197, 71, 0.1);
    color: #e8c547;
    border: 1px solid rgba(232, 197, 71, 0.2);
}

.ef-kb-meta-sep {
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: var(--border, #252836);
}

.ef-kb-meta-txt {
    font-family: 'DM Mono', monospace;
    font-size: 0.63rem;
    color: var(--text-muted, #6b7280);
}

.ef-kb-article-title {
    font-family: 'DM Serif Display', serif;
    font-size: clamp(1.4rem, 2.5vw, 1.9rem);
    line-height: 1.2;
    margin-bottom: 0.75rem;
    color: var(--text, #e8eaf0);
}

/* Accent the last word of the title — applied via PHP */
.ef-kb-article-title .title-accent {
    color: var(--accent, #e8c547);
    font-style: italic;
}

.ef-kb-article-deck {
    font-size: 0.88rem;
    color: #9ca3b4;
    line-height: 1.75;
    font-weight: 300;
}

/* Key Facts Sidebar */
.ef-kb-key-facts {
    background: var(--surface2, #1a1e2a);
    border: 1px solid var(--border, #252836);
    border-top: 3px solid var(--brand, #7c6af7);
    border-radius: 10px;
    padding: 1.25rem;
    position: sticky;
    top: 80px;
}

.kf-label {
    font-family: 'DM Mono', monospace;
    font-size: 0.65rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--brand, #7c6af7);
    margin-bottom: 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.kf-label::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border, #252836);
}

.kf-row {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.kf-item {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border, #252836);
}

.kf-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.kf-k {
    font-family: 'DM Mono', monospace;
    font-size: 0.6rem;
    color: #8b8fa8;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.kf-v {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.92rem;
    color: var(--text, #e8eaf0);
    font-weight: 500;
    line-height: 1.4;
}

/* TOC */
.ef-kb-toc {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 2rem;
    padding: 1rem 0;
    border-top: 1px solid var(--border, #252836);
    border-bottom: 1px solid var(--border, #252836);
}

.ef-kb-toc-item {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-muted, #6b7280);
    padding: 0.4rem 0.9rem;
    cursor: pointer;
    white-space: nowrap;
    border: 1px solid var(--border, #252836);
    border-radius: 20px;
    background: var(--surface, #13161e);
    text-decoration: none;
    transition: all 0.18s;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.ef-kb-toc-item:first-child {
    padding-left: 0.9rem;
}

.ef-kb-toc-item:hover {
    color: var(--accent, #e8c547);
    border-color: var(--accent, #e8c547);
    background: var(--surface2, #1a1e2a);
}

.toc-n {
    font-family: 'DM Mono', monospace;
    font-size: 0.62rem;
    color: var(--brand, #7c6af7);
    margin-right: 0;
}

/* Article Body Blocks */
.ef-kb-article-body {
    margin-bottom: 2.5rem;
}

.ef-kb-block {
    margin-bottom: 2.25rem;
}

.ef-kb-block:has(.block-label) {
    margin-top: 3rem;
}

.block-label {
    font-family: 'DM Mono', monospace;
    font-size: 0.6rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--brand, #7c6af7);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.block-label::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border, #252836);
}

.ef-kb-block h2 {
    font-family: 'DM Serif Display', serif;
    font-size: 1.3rem;
    color: var(--text, #e8eaf0);
    margin-bottom: 0.75rem;
    line-height: 1.3;
}

.ef-kb-block p {
    font-size: 0.9rem;
    color: #c8cad4;
    font-weight: 300;
    line-height: 1.8;
    margin-bottom: 0.9rem;
}

.ef-kb-block p:last-child {
    margin-bottom: 0;
}

/* Two-column prose */
.prose-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 0.9rem;
}

@media (max-width: 768px) {
    .prose-2col {
        grid-template-columns: 1fr;
    }
}

/* Pull Quote */
.ef-kb-pull-quote {
    border-left: 3px solid var(--accent, #e8c547);
    padding: 0.9rem 1.1rem;
    background: var(--surface, #13161e);
    border-radius: 0 10px 10px 0;
    margin: 1.25rem 0;
}

.ef-kb-pull-quote p {
    font-family: 'DM Serif Display', serif;
    font-style: italic;
    font-size: 1.05rem;
    color: var(--accent, #e8c547);
    line-height: 1.6;
    margin: 0;
}

/* Callouts */
.ef-kb-callout {
    border-radius: 10px;
    padding: 0.9rem 1.1rem;
    margin: 1rem 0;
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
}

.c-tip {
    background: rgba(124, 106, 247, 0.07);
    border: 1px solid rgba(124, 106, 247, 0.18);
}

.c-warn {
    background: rgba(251, 146, 60, 0.07);
    border: 1px solid rgba(251, 146, 60, 0.18);
}

.c-safe {
    background: rgba(248, 113, 113, 0.07);
    border: 1px solid rgba(248, 113, 113, 0.18);
}

.callout-ico {
    font-size: 13px;
    line-height: 1.7;
    flex-shrink: 0;
}

.ef-kb-callout p {
    margin: 0;
    font-size: 0.82rem;
    line-height: 1.6;
}

.c-tip p {
    color: #c4bffa;
}

.c-warn p {
    color: #fdba74;
}

.c-safe p {
    color: #fca5a5;
}

/* Divider */
.ef-kb-divider {
    border: none;
    border-top: 1px solid var(--border, #252836);
    margin: 2rem 0;
}

/* Footer */
.ef-kb-article-footer {
    border-top: 2px solid var(--border, #252836);
    padding-top: 2rem;
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.ef-kb-related-section {
    margin-bottom: 1.75rem;
}

.sec-head {
    font-family: 'DM Mono', monospace;
    font-size: 0.65rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-muted, #6b7280);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.85rem;
}

.sec-head::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border, #252836);
}

/* Error Code Grid */
.ec-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(145px, 1fr));
    gap: 0.55rem;
}

.ec-chip {
    background: var(--surface, #13161e);
    border: 1px solid var(--border, #252836);
    border-radius: 8px;
    padding: 0.65rem 0.85rem;
    cursor: pointer;
    transition: border-color 0.18s;
    text-decoration: none;
    display: block;
}

.ec-chip:hover {
    border-color: var(--accent, #e8c547);
}

.ec-code {
    font-family: 'DM Mono', monospace;
    font-size: 0.88rem;
    color: var(--accent, #e8c547);
    display: block;
    margin-bottom: 2px;
}

.ec-desc {
    font-size: 0.68rem;
    color: var(--text-muted, #6b7280);
    line-height: 1.3;
}

/* Article Cards */
.ac-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.55rem;
}

@media (max-width: 768px) {
    .ac-grid {
        grid-template-columns: 1fr;
    }
}

.ac-card {
    background: var(--surface, #13161e);
    border: 1px solid var(--border, #252836);
    border-radius: 10px;
    padding: 0.85rem 1rem;
    cursor: pointer;
    transition: border-color 0.18s;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    text-decoration: none;
}

.ac-card:hover {
    border-color: var(--brand, #7c6af7);
}

.ac-tag {
    font-family: 'DM Mono', monospace;
    font-size: 0.58rem;
    color: var(--brand, #7c6af7);
}

.ac-title {
    font-family: 'DM Serif Display', serif;
    font-size: 0.88rem;
    line-height: 1.3;
    color: var(--text, #e8eaf0);
}

/* ── FIXES v2 ────────────────────────────────────────────────
   Added to resolve layout, breadcrumb, TOC and index issues
   ─────────────────────────────────────────────────────────── */

/* Remove top padding from ef-kb-index-page since container handles spacing */
.ef-kb-index-page {
    max-width: 100%;
    padding: 0;
}

/* Breadcrumb — inherit theme .breadcrumb styles, just add KB overrides */
.ef-kb-breadcrumb {
    font-family: 'DM Mono', monospace;
    font-size: 0.72rem;
}
.ef-kb-breadcrumb a {
    color: var(--brand, #7c6af7);
    text-decoration: none;
}
.ef-kb-breadcrumb span {
    color: var(--border, #252836);
}

/* TOC items — pill style anchor links, no scrollbar */
.ef-kb-toc {
    scroll-behavior: smooth;
}
a.ef-kb-toc-item {
    text-decoration: none;
}
a.ef-kb-toc-item:hover {
    color: var(--accent, #e8c547);
    border-color: var(--accent, #e8c547);
    background: var(--surface2, #1a1e2a);
}

/* Empty state on index */
.ef-kb-empty {
    grid-column: 1 / -1;
    text-align: center;
    color: var(--text-muted, #6b7280);
    padding: 60px 20px;
    font-size: 0.9rem;
}

/* Article page inside container */
.ef-kb-article-page {
    max-width: 860px;
    margin: 0 auto;
    padding: 2rem 0 4rem;
}

/* Ensure key facts sidebar doesn't overflow on narrow screens */
@media (max-width: 860px) {
    .ef-kb-article-header {
        grid-template-columns: 1fr;
    }
    .ef-kb-key-facts {
        position: static;
    }
}

/* Smooth scroll for the whole page when TOC links are clicked */
html {
    scroll-behavior: smooth;
}

/* Offset scroll target to account for sticky header (~60px) */
.ef-kb-block {
    scroll-margin-top: 80px;
}

/* ══════════════════════════════════════════════════════════════
   KB STYLES v2.1 — Fix pack
   1. TOC anchor scroll fix
   2. Key facts sidebar colour & linked codes
   3. Redesigned error code cards
   4. Brand filter count badges & empty state
   ══════════════════════════════════════════════════════════════ */

/* ── 1. TOC SCROLL FIX ────────────────────────────────────── */

html { scroll-behavior: smooth; }

/* Offset for sticky header so heading isn't hidden behind it */
.ef-kb-block[id] {
    scroll-margin-top: 80px;
}

/* ── 2. KEY FACTS SIDEBAR — linked codes ─────────────────── */

/* Inline error code links inside key facts */
.kf-v-codes {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
}

.kf-code-link {
    font-family: 'DM Mono', monospace;
    font-size: 0.78rem;
    color: var(--accent, #e8c547);
    text-decoration: none;
    font-weight: 600;
    border-bottom: 1px dashed rgba(232,197,71,0.35);
    transition: border-color 0.15s, color 0.15s;
}

.kf-code-link:hover {
    color: #fff;
    border-bottom-color: #fff;
}

.kf-sep {
    color: var(--border, #252836);
    font-size: 0.75rem;
}

/* No left highlight on kf rows */

/* ── 3. REDESIGNED ERROR CODE CARDS ─────────────────────── */

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

.ec-card {
    background: var(--surface, #13161e);
    border: 1px solid var(--border, #252836);
    border-radius: 10px;
    padding: 1rem 1.1rem;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    transition: border-color 0.18s, background 0.18s;
    position: relative;
    overflow: hidden;
}

.ec-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent, #e8c547), transparent);
    opacity: 0;
    transition: opacity 0.18s;
}

.ec-card:hover {
    border-color: var(--accent, #e8c547);
    background: var(--surface2, #1a1e2a);
}

.ec-card:hover::before {
    opacity: 1;
}

.ec-card-top {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.5rem;
}

.ec-card-code {
    font-family: 'DM Mono', monospace;
    font-size: 1.1rem;
    color: var(--accent, #e8c547);
    font-weight: 600;
    letter-spacing: 0.04em;
}

.ec-card-brand {
    font-family: 'DM Mono', monospace;
    font-size: 0.58rem;
    color: var(--muted, #6b7280);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.ec-card-desc {
    font-size: 0.78rem;
    color: var(--muted, #6b7280);
    line-height: 1.4;
    flex: 1;
    margin: 0;
}

.ec-card-arrow {
    font-family: 'DM Mono', monospace;
    font-size: 0.65rem;
    color: var(--brand, #7c6af7);
    margin-top: 0.25rem;
}

/* ── 4. BRAND FILTER ENHANCEMENTS ─────────────────────────── */

/* Count badge on filter buttons */
.filter-count {
    display: inline-block;
    font-family: 'DM Mono', monospace;
    font-size: 0.55rem;
    background: rgba(255,255,255,0.1);
    border-radius: 3px;
    padding: 1px 4px;
    margin-left: 3px;
    vertical-align: middle;
}

.filter-btn.active .filter-count,
.filter-btn.brand-active .filter-count {
    background: rgba(255,255,255,0.2);
}

/* Empty / no-articles brand filter */
.filter-btn--empty {
    opacity: 0.35;
    cursor: default;
    pointer-events: none;
}

/* Wrap brand filters so they wrap onto a new line on narrow screens */
.ef-brand-filters {
    flex-wrap: wrap;
}

/* Add a tag colour for new brands */
.tag-whirlpool  { background: rgba(96,165,250,0.12);  color: #93c5fd; border: 1px solid rgba(96,165,250,0.2); }
.tag-lg         { background: rgba(167,139,250,0.12); color: #c4b5fd; border: 1px solid rgba(167,139,250,0.2); }
.tag-aeg        { background: rgba(52,211,153,0.12);  color: #6ee7b7; border: 1px solid rgba(52,211,153,0.2); }
.tag-miele      { background: rgba(251,191,36,0.12);  color: #fcd34d; border: 1px solid rgba(251,191,36,0.2); }
.tag-candy      { background: rgba(249,168,212,0.12); color: #fbcfe8; border: 1px solid rgba(249,168,212,0.2); }
.tag-hoover     { background: rgba(167,139,250,0.12); color: #c4b5fd; border: 1px solid rgba(167,139,250,0.2); }
.tag-zanussi    { background: rgba(94,234,212,0.12);  color: #99f6e4; border: 1px solid rgba(94,234,212,0.2); }
.tag-electrolux { background: rgba(96,165,250,0.12);  color: #93c5fd; border: 1px solid rgba(96,165,250,0.2); }
.tag-neff       { background: rgba(251,146,60,0.12);  color: #fdba74; border: 1px solid rgba(251,146,60,0.2); }
.tag-smeg       { background: rgba(232,197,71,0.12);  color: #fde68a; border: 1px solid rgba(232,197,71,0.2); }
.tag-haier      { background: rgba(56,189,248,0.12);  color: #7dd3fc; border: 1px solid rgba(56,189,248,0.2); }
.tag-hisense    { background: rgba(74,222,128,0.12);  color: #86efac; border: 1px solid rgba(74,222,128,0.2); }

   DIAGRAM BLOCK — v2.2
   ══════════════════════════════════════════════════════════════ */

.ef-kb-diagram-block {
    background: var(--surface, #13161e);
    border: 1px solid var(--border, #252836);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 2.25rem;
    scroll-margin-top: 80px;
}

/* Header row: label left, tab switcher right */
.diag-header {
    padding: 0.75rem 1.1rem;
    border-bottom: 1px solid var(--border, #252836);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.diag-label {
    font-family: 'DM Mono', monospace;
    font-size: 0.62rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--brand, #7c6af7);
}

/* Tab buttons */
.diag-tabs {
    display: flex;
    gap: 0.3rem;
}

.diag-tab {
    font-family: 'DM Mono', monospace;
    font-size: 0.65rem;
    padding: 4px 12px;
    border-radius: 6px;
    border: 1px solid var(--border, #252836);
    background: transparent;
    color: var(--muted, #6b7280);
    cursor: pointer;
    transition: all 0.18s;
    white-space: nowrap;
}

.diag-tab:hover {
    border-color: var(--brand, #7c6af7);
    color: var(--text, #e8eaf0);
}

.diag-tab.active {
    background: var(--surface2, #1a1e2a);
    border-color: var(--accent, #e8c547);
    color: var(--accent, #e8c547);
}

/* Canvas area */
.diag-canvas {
    background: #08090d;
    min-height: 260px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 0;
}

/* Tab panels — hidden by default, shown when active */
.diag-panel {
    display: none;
    width: 100%;
    text-align: center;
}

.diag-panel.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Images and SVGs inside panels */
.diag-img {
    width: 100%;
    height: auto;
    max-height: none;
    border-radius: 0;
    display: block;
    margin: 0;
}

.diag-svg {
    max-width: 100%;
    max-height: 480px;
    width: 100%;
    height: auto;
    display: block;
}

/* Empty placeholder state */
.diag-empty {
    text-align: center;
    padding: 2.5rem 1rem;
}

.diag-empty-icon {
    font-size: 2.5rem;
    color: var(--border, #252836);
    margin-bottom: 0.75rem;
    line-height: 1;
}

.diag-empty p {
    font-size: 0.8rem;
    color: var(--muted, #6b7280);
    margin: 0;
}

.diag-empty code {
    font-family: 'DM Mono', monospace;
    font-size: 0.72rem;
    background: var(--surface2, #1a1e2a);
    border: 1px solid var(--border, #252836);
    border-radius: 4px;
    padding: 1px 6px;
    color: var(--brand, #7c6af7);
}

/* Footer: caption left, full screen link right */
.diag-footer {
    padding: 0.6rem 1.1rem;
    border-top: 1px solid var(--border, #252836);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.diag-caption {
    font-size: 0.75rem;
    color: var(--muted, #6b7280);
    font-style: italic;
    flex: 1;
}

.diag-expand {
    font-family: 'DM Mono', monospace;
    font-size: 0.62rem;
    color: var(--brand, #7c6af7);
    text-decoration: none;
    white-space: nowrap;
    transition: color 0.15s;
}

.diag-expand:hover {
    color: var(--accent, #e8c547);
}

/* Mobile: stack header vertically */
@media (max-width: 600px) {
    .diag-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.6rem;
    }
    .diag-canvas {
        min-height: 200px;
    }
    .ef-kb-toc {
        flex-direction: column;
        gap: 0.4rem;
    }
    .ef-kb-toc-item {
        width: 100%;
        white-space: normal;
    }
}

/* ══════════════════════════════════════════════════════════════
   KB STYLES v2.3 — Header tightening & Applies To bar
   ══════════════════════════════════════════════════════════════ */

/* Applies To — full-width bar above the two-column header */
.ef-kb-applies-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--surface2, #1a1e2a);
    border: 1px solid var(--border, #252836);
    border-left: 3px solid var(--accent, #e8c547);
    border-radius: 8px;
    padding: 0.6rem 1rem;
    margin-bottom: 1.25rem;
}

.ef-kb-applies-label {
    font-family: 'DM Mono', monospace;
    font-size: 0.6rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--accent, #e8c547);
    white-space: nowrap;
}

.ef-kb-applies-value {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.85rem;
    color: var(--text, #e8eaf0);
    font-weight: 500;
}

/* If sidebar is empty (all facts were Applies To), collapse header to single col */
.ef-kb-article-header:not(:has(.ef-kb-key-facts)) {
    grid-template-columns: 1fr;
}


/* ══════════════════════════════════════════════════════════════
   AFFILIATE LINK BLOCK  (.ef-kb-affiliate-block)
   Renders inline within article body — subtle but actionable.
   ══════════════════════════════════════════════════════════════ */

/* ──────────────────────────────────────────────────────────────
   AFFILIATE LINK BLOCK
   Structure: bold product heading → context sentence + CTA button
   ══════════════════════════════════════════════════════════════ */

.ef-kb-affiliate-block {
    margin: 1.25rem 0;
    border: 1px solid var(--border, #252836);
    border-radius: 8px;
    background: var(--surface, #13161e);
    overflow: hidden;
}

/* ── Product name — bold heading at top ── */
.aff-block-heading {
    display: flex;
    align-items: baseline;
    gap: 0.6rem;
    flex-wrap: wrap;
    padding: 0.7rem 1rem 0.5rem;
    border-bottom: 1px solid var(--border, #252836);
}

.aff-block-name {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text, #e8eaf0);
    line-height: 1.3;
}

.aff-block-cost {
    font-family: 'DM Mono', monospace;
    font-size: 0.65rem;
    color: var(--muted, #6b7280);
}

/* ── Body row: context text left, CTA button right ── */
.aff-block-body {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.55rem 1rem;
    flex-wrap: wrap;
}

.aff-block-context {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.78rem;
    font-weight: 400;
    color: var(--muted, #6b7280);
    line-height: 1.4;
    flex: 1 1 140px;
}

/* ── CTA: small outlined pill ── */
.aff-block-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.35rem 0.85rem;
    background: transparent;
    color: var(--brand, #7c6af7);
    font-family: 'DM Mono', monospace;
    font-size: 0.7rem;
    font-weight: 600;
    border-radius: 5px;
    border: 1px solid rgba(124,106,247,0.4);
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 0;
    transition: background 0.15s, border-color 0.15s;
}

.aff-block-btn:hover {
    background: rgba(124,106,247,0.1);
    border-color: var(--brand, #7c6af7);
    color: var(--brand, #7c6af7);
    text-decoration: none;
}

.aff-block-btn--disabled {
    background: transparent;
    color: var(--muted, #666);
    border: 1px dashed var(--border, #252836);
    cursor: default;
}

/* ── Disclosure footer ── */
.aff-block-disclosure {
    margin: 0;
    padding: 0.3rem 1rem;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.62rem;
    color: var(--muted, #555);
    border-top: 1px solid var(--border, #252836);
    line-height: 1.4;
}

.aff-block-disclosure a {
    color: var(--muted, #666);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.aff-block-disclosure a:hover {
    color: var(--text, #e8eaf0);
}

/* Legacy class aliases — kept for any cached output */
.aff-block-topbar  { display: none; }
.aff-block-inner   { display: none; }
.aff-block-eyebrow { display: none; }
.aff-block-desc    { display: none; }
.aff-block-domain  { display: none; }
.aff-block-text    { display: none; }

/* ── Eyebrow: capped at 1 line, smaller and softer ── */
.aff-block-topbar {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.9rem;
    border-bottom: 1px solid var(--border, #252836);
}

.aff-block-eyebrow {
    font-family: 'DM Mono', monospace;
    font-size: 0.58rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--muted, #6b7280);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Body: single row — product left, CTA right (wraps on narrow screens) ── */
.aff-block-inner {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.75rem;
    padding: 0.65rem 0.9rem;
    flex-wrap: wrap;
}

.aff-block-text {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 0;
    flex: 1 1 160px;
}

.aff-block-desc {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text, #e8eaf0);
    line-height: 1.3;
}

.aff-block-cost {
    font-family: 'DM Mono', monospace;
    font-size: 0.65rem;
    color: var(--muted, #6b7280);
}

/* ── CTA: small pill, not full-width ── */
.aff-block-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.35rem 0.8rem;
    background: transparent;
    color: var(--brand, #7c6af7);
    font-family: 'DM Mono', monospace;
    font-size: 0.68rem;
    font-weight: 600;
    border-radius: 5px;
    border: 1px solid rgba(124,106,247,0.35);
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 0;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.aff-block-btn:hover {
    background: rgba(124,106,247,0.1);
    border-color: var(--brand, #7c6af7);
    color: var(--brand, #7c6af7);
    text-decoration: none;
    transform: none;
}

.aff-block-btn--disabled {
    background: transparent;
    color: var(--muted, #666);
    border: 1px dashed var(--border, #252836);
    cursor: default;
}

.aff-block-domain {
    display: none; /* hidden — name alone is enough in compact layout */
}

.aff-block-disclosure {
    margin: 0;
    padding: 0.3rem 0.9rem;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.62rem;
    color: var(--muted, #555);
    border-top: 1px solid var(--border, #252836);
    line-height: 1.4;
}

.aff-block-disclosure a {
    color: var(--muted, #666);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.aff-block-disclosure a:hover {
    color: var(--text, #e8eaf0);
}


