/* ==================== KNOWLEDGE BASE / RESOURCE CENTER ==================== */

/* ── Container ── */
.kb-container { padding: 0; height: 100%; overflow-y: auto; }
.kb-loading { text-align: center; padding: 80px 20px; color: #6b7280; font-size: 15px; }
.kb-loading i { color: #1E6332; margin-right: 8px; }
/* Supabase load states */
.kb-loading-state { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 80px 20px; color: #6b7280; font-size: 15px; }
.kb-loading-spinner { width: 42px; height: 42px; border: 4px solid #e8e4df; border-top-color: #1E6332; border-radius: 50%; animation: progressSpin 0.8s linear infinite; }
.kba-loading { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 60px 20px; color: #6b7280; }

/* ── Hero Search ── */
.kb-hero {
    background: linear-gradient(135deg, #1E6332 0%, #214A3E 50%, #2F8542 100%);
    padding: 48px 32px 58px;
    text-align: center;
    position: relative;
}
.kb-hero::before {
    content: '';
    position: absolute; inset: 0;
    background: radial-gradient(circle at 20% 80%, rgba(255,255,255,0.06) 0%, transparent 50%),
                radial-gradient(circle at 80% 20%, rgba(255,255,255,0.04) 0%, transparent 50%);
    pointer-events: none;
}
.kb-hero-inner { position: relative; z-index: 1; max-width: 680px; margin: 0 auto; }
.kb-hero-title {
    font-family: 'Futura PT', 'Jost', sans-serif;
    font-size: 28px; font-weight: 700; color: #fff; margin: 0 0 8px;
}
.kb-hero-subtitle { color: rgba(255,255,255,0.75); font-size: 15px; margin: 0 0 24px; line-height: 1.5; }

/* ── Search Bar ── */
.kb-search-wrap {
    position: relative; display: flex; align-items: center; z-index: 50;
}
.kb-search-wrap-hero {
    max-width: 560px; margin: 0 auto;
}
.kb-search-icon {
    position: absolute; left: 16px; color: #9ca3af; font-size: 15px; pointer-events: none; z-index: 1;
}
.kb-search-input {
    width: 100%; padding: 14px 16px 14px 44px;
    border: 2px solid transparent; border-radius: 12px;
    font-size: 15px; font-family: 'Futura PT', 'Jost', sans-serif;
    background: #fff; color: #231F20;
    box-shadow: 0 4px 20px rgba(0,0,0,0.12);
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
}
.kb-search-input:focus {
    border-color: #1E6332;
    box-shadow: 0 4px 20px rgba(0,0,0,0.12), 0 0 0 3px rgba(30,99,50,0.15);
}
.kb-search-input::placeholder { color: #aaa; }
.kb-search-wrap-sm { max-width: 320px; }
.kb-search-wrap-sm .kb-search-input,
.kb-search-wrap-sm .kb-local-input { padding: 10px 14px 10px 38px; font-size: 14px; border: 1.5px solid #e5e1da; box-shadow: none; border-radius: 10px; font-family: 'Futura PT', 'Jost', sans-serif; color: #231F20; outline: none; width: 100%; }
.kb-search-wrap-sm .kb-search-input:focus,
.kb-search-wrap-sm .kb-local-input:focus { border-color: #1E6332; box-shadow: 0 0 0 3px rgba(30,99,50,0.1); }
.kb-search-wrap-sm .kb-local-input::placeholder { color: #aaa; }
.kb-search-wrap-lg { max-width: 600px; }

/* ── Live Search Dropdown ── */
.kb-live-search {
    position: absolute; top: 100%; left: 0; right: 0; z-index: 100;
    margin-top: 6px; background: #fff; border: 1px solid #e5e1da;
    border-radius: 12px; box-shadow: 0 12px 40px rgba(0,0,0,0.12);
    max-height: 420px; overflow-y: auto; overflow-x: hidden;
    animation: kbLsIn 0.15s ease;
}
@keyframes kbLsIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: translateY(0); } }
.kb-ls-category { padding: 0; }
.kb-ls-category + .kb-ls-category { border-top: 1px solid #f0ede8; }
.kb-ls-cat-header {
    padding: 10px 16px 6px; font-size: 11px; font-weight: 700; color: #9ca3af;
    text-transform: uppercase; letter-spacing: 0.4px;
    font-family: 'Futura PT', 'Jost', sans-serif;
}
.kb-ls-cat-header i { margin-right: 5px; font-size: 12px; }
.kb-ls-cat-count { font-weight: 500; opacity: 0.6; margin-left: 4px; }
.kb-ls-item {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 16px; cursor: pointer; transition: background 0.1s;
}
.kb-ls-item:hover { background: #F4F0E9; }
.kb-ls-item-icon { font-size: 14px; width: 20px; text-align: center; flex-shrink: 0; }
.kb-ls-item-info { flex: 1; min-width: 0; }
.kb-ls-item-title { font-size: 14px; font-weight: 500; color: #231F20; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kb-ls-item-meta { font-size: 11px; color: #9ca3af; margin-top: 1px; }
.kb-ls-highlight { background: #fef08a; color: #231F20; padding: 0 1px; border-radius: 2px; }
.kb-ls-more {
    padding: 6px 16px 10px; font-size: 12px; color: #1E6332;
    cursor: pointer; font-weight: 500;
}
.kb-ls-more:hover { text-decoration: underline; }
.kb-ls-footer {
    padding: 10px 16px; text-align: center; font-size: 13px; font-weight: 600;
    color: #1E6332; cursor: pointer; border-top: 1px solid #f0ede8;
    transition: background 0.1s;
}
.kb-ls-footer:hover { background: #F4F0E9; }
.kb-ls-footer i { margin-right: 6px; }
.kb-ls-empty {
    padding: 24px 16px; text-align: center; color: #9ca3af; font-size: 14px;
}
.kb-ls-empty i { margin-right: 6px; }
.kb-search-wrap-lg .kb-search-input { border: 1.5px solid #e5e1da; box-shadow: 0 2px 8px rgba(0,0,0,0.05); }

/* ── Featured Articles ── */
.kb-featured-row {
    display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
    margin: -28px 24px 24px;
}
.kb-featured {
    display: flex; align-items: center; gap: 0;
    padding: 0;
    background: #fff; border: 1px solid #e5e1da; border-radius: 14px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.06);
    cursor: pointer; transition: all 0.2s ease; position: relative; overflow: hidden;
}
.kb-featured:hover { border-color: #1E6332; box-shadow: 0 6px 24px rgba(30,99,50,0.1); transform: translateY(-1px); }
.kb-featured-left {
    width: 6px; flex-shrink: 0; align-self: stretch;
    background: linear-gradient(180deg, #C19A6B 0%, #a07d52 100%);
    border-radius: 14px 0 0 14px;
}
.kb-featured-icon { display: none; }
.kb-featured-body { flex: 1; padding: 20px 24px; }
.kb-featured-label {
    font-family: 'Futura PT', 'Jost', sans-serif;
    font-size: 11px; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.8px; color: #C19A6B; margin-bottom: 4px;
}
.kb-featured-title { font-family: 'Futura PT', 'Jost', sans-serif; font-size: 20px; font-weight: 700; color: #231F20; margin: 0 0 8px; }
.kb-featured-summary { color: #6b7280; font-size: 14px; margin: 0 0 12px; line-height: 1.5; }
.kb-featured-meta { display: flex; flex-wrap: wrap; gap: 14px; font-size: 13px; color: #9ca3af; align-items: center; }
.kb-featured-meta i { margin-right: 4px; }
.kb-featured-arrow {
    width: 44px; height: 44px; border-radius: 50%; background: #F4F0E9;
    display: flex; align-items: center; justify-content: center;
    color: #1E6332; font-size: 16px; flex-shrink: 0; transition: all 0.2s;
    margin-right: 20px;
}
.kb-featured:hover .kb-featured-arrow { background: #1E6332; color: #fff; transform: translateX(4px); }

/* ── Sections ── */
.kb-section { padding: 0 24px; margin-bottom: 28px; }
.kb-section-title {
    font-family: 'Futura PT', 'Jost', sans-serif;
    font-size: 17px; font-weight: 600; color: #231F20; margin: 0 0 16px;
    display: flex; align-items: center; gap: 8px;
}
.kb-section-title i { color: #1E6332; font-size: 15px; }

/* ── Category Grid ── */
.kb-categories-grid {
    /* Always a 2×2 layout (two columns) on normal screens; collapses to a single
       column only when the screen is too narrow (see the 768px media query). */
    display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px;
}
.kb-category-card {
    display: flex; flex-direction: column; min-width: 0;
    padding: 22px 24px; background: #fff; border: 1px solid #e5e1da;
    border-radius: 12px; cursor: pointer; transition: all 0.2s ease;
}
.kb-category-card:hover {
    border-color: #1E6332; box-shadow: 0 6px 20px rgba(30,99,50,0.08);
    transform: translateY(-2px);
}
.kb-category-header { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.kb-category-header-text { flex: 1; }
.kb-category-icon {
    width: 44px; height: 44px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 18px; flex-shrink: 0;
}
.kb-category-name { font-family: 'Futura PT', 'Jost', sans-serif; font-size: 16px; font-weight: 600; color: #231F20; margin: 0; }
.kb-category-count { font-size: 12px; color: #9ca3af; }
.kb-category-desc { font-size: 13px; color: #6b7280; margin: 0 0 12px; line-height: 1.5; }
.kb-category-articles {
    list-style: none; margin: 0 0 12px; padding: 0;
    border-top: 1px solid #f0ede8; padding-top: 10px;
}
.kb-category-articles li {
    padding: 5px 0; font-size: 13px; color: #374151;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.kb-category-articles li i { margin-right: 6px; font-size: 11px; }
.kb-category-footer { margin-top: auto; }
.kb-category-explore {
    font-size: 13px; font-weight: 600; color: #1E6332;
    display: inline-flex; align-items: center; gap: 6px;
}
.kb-category-explore i { font-size: 11px; transition: transform 0.2s; }
.kb-category-card:hover .kb-category-explore i { transform: translateX(4px); }

/* ── Home Layout (categories left + sidebar right) ── */
.kb-home-layout {
    display: grid; grid-template-columns: 1fr 280px; gap: 24px;
    padding: 0 24px; margin-bottom: 24px; align-items: start;
}
.kb-home-main { min-width: 0; }
.kb-home-main .kb-section { padding: 0; }
.kb-home-sidebar { min-width: 0; }
.kb-recently-added {
    /* Its height is set in JS (_syncRecentlyAddedHeight) to exactly match the 2×2
       category grid, so its top and bottom line up with the cards. The list
       scrolls inside rather than running past the bottom of the grid. */
    display: flex; flex-direction: column;
}
.kb-recently-added .kb-sidebar-title { flex: 0 0 auto; }
.kb-recently-added-list {
    flex: 1 1 auto; min-height: 0; overflow-y: auto;
    margin: 0 -6px; padding: 0 6px;
}
.kb-sidebar-section {
    background: #fff; border: 1px solid #e5e1da; border-radius: 12px;
    padding: 16px;
}
.kb-sidebar-title {
    font-family: 'Futura PT', 'Jost', sans-serif;
    font-size: 14px; font-weight: 600; color: #231F20;
    margin: 0 0 10px; display: flex; align-items: center; gap: 7px;
}
.kb-sidebar-title i { color: #1E6332; font-size: 13px; }
.kb-sidebar-section .kb-list-item { padding: 8px 10px; }
.kb-sidebar-section .kb-list-item-title { font-size: 13px; }
.kb-sidebar-section .kb-list-item-meta { font-size: 11px; }
.kb-sidebar-section .kb-list-item-rank { width: 24px; height: 24px; font-size: 11px; border-radius: 6px; }
.kb-sidebar-section .kb-list-item-icon { font-size: 14px; width: 24px; }
.kb-sidebar-section .kb-empty-state-sm { padding: 20px 8px; }
.kb-sidebar-section .kb-empty-state-sm i { font-size: 20px; }
.kb-sidebar-section .kb-empty-state-sm p { font-size: 12px; }

/* ── Compact List ── */
.kb-list-compact { display: flex; flex-direction: column; gap: 2px; }
.kb-list-item {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 14px; border-radius: 10px; cursor: pointer;
    transition: background 0.15s;
}
.kb-list-item:hover { background: #F4F0E9; }
.kb-list-item-icon { font-size: 16px; width: 28px; text-align: center; flex-shrink: 0; }
.kb-list-item-rank {
    width: 28px; height: 28px; border-radius: 8px;
    background: #F4F0E9; color: #C19A6B; font-weight: 700; font-size: 13px;
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.kb-list-item-info { flex: 1; min-width: 0; }
.kb-list-item-title { font-size: 14px; font-weight: 500; color: #231F20; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kb-list-item-meta { font-size: 12px; color: #9ca3af; margin-top: 2px; }
.kb-list-item-meta i { margin-right: 3px; }

/* ── Empty State ── */
.kb-empty-state { text-align: center; padding: 60px 20px; color: #9ca3af; }
.kb-empty-state i { font-size: 36px; margin-bottom: 12px; display: block; color: #d5d0c8; }
.kb-empty-state p { margin: 0 0 6px; font-size: 15px; }
.kb-empty-hint { font-size: 13px; color: #b0ada8; }
.kb-empty-state-sm { text-align: center; padding: 32px 16px; color: #b0ada8; }
.kb-empty-state-sm i { font-size: 24px; margin-bottom: 8px; display: block; color: #d5d0c8; }
.kb-empty-state-sm p { margin: 0; font-size: 13px; }

/* ── Type Chip ── */
.kb-type-chip {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 3px 10px; border-radius: 6px; font-size: 11px; font-weight: 600;
    border: 1px solid; text-transform: uppercase; letter-spacing: 0.3px;
}
.kb-type-chip i { font-size: 10px; }
.kb-type-chip-sm { font-size: 10px; padding: 2px 7px; }

/* ── Category Badge (shared component) ── */
.kb-cat-badge {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 3px 10px; border-radius: 6px; font-size: 11px; font-weight: 600;
    border: 1px solid; white-space: nowrap;
}
.kb-cat-badge i { font-size: 10px; }
.kb-card-badges { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }

/* ── Tags ── */
.kb-tag {
    display: inline-block; padding: 2px 8px; border-radius: 5px;
    background: #F4F0E9; color: #8a8580; font-size: 11px; font-weight: 500;
}

/* ── Breadcrumb ── */
.kb-breadcrumb {
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
    padding: 14px 24px; font-size: 13px; color: #9ca3af;
    border-bottom: 1px solid #eee;
}
.kb-back-btn {
    width: 30px; height: 30px; border-radius: 8px; border: 1px solid #e5e1da;
    background: #fff; color: #6b7280; cursor: pointer; font-size: 13px;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.15s; margin-right: 4px; flex-shrink: 0;
}
.kb-back-btn:hover { border-color: #1E6332; color: #1E6332; background: #1E633208; }
.kb-bc-link { color: #1E6332; cursor: pointer; text-decoration: none; font-weight: 500; }
.kb-bc-link:hover { text-decoration: underline; }
.kb-bc-sep { font-size: 9px; color: #ccc; }
.kb-bc-current { color: #6b7280; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 300px; }

/* ── Category View Header ── */
.kb-cat-header {
    display: flex; align-items: center; gap: 18px;
    padding: 24px 28px; margin: 0;
    background: linear-gradient(135deg, #1E6332 0%, #214A3E 60%, #2F8542 100%);
    border-bottom: none; border-left: none;
}
.kb-cat-header-icon {
    width: 52px; height: 52px; border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    font-size: 22px; flex-shrink: 0;
    background: rgba(255,255,255,0.15) !important; color: #fff !important;
}
.kb-cat-header-title { font-family: 'Futura PT', 'Jost', sans-serif; font-size: 22px; font-weight: 700; color: #fff; margin: 0 0 4px; }
.kb-cat-header-desc { font-size: 14px; color: rgba(255,255,255,0.8); margin: 0 0 6px; line-height: 1.4; }
.kb-cat-article-count { font-size: 12px; color: rgba(255,255,255,0.6); font-weight: 500; }

/* ── Filter Bar ── */
.kb-filter-bar {
    display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
    padding: 12px 24px; border-bottom: 1px solid #eee; background: #fafaf8;
}
.kb-filter-left { }
.kb-filter-right { display: flex; align-items: center; gap: 8px; }
.kb-sort-btns { display: flex; gap: 4px; }
.kb-sort-btn {
    padding: 6px 12px; border: 1px solid #e5e1da; border-radius: 8px;
    background: #fff; color: #6b7280; font-size: 12px; font-weight: 500;
    cursor: pointer; transition: all 0.15s; font-family: 'Futura PT', 'Jost', sans-serif;
}
.kb-sort-btn:hover { border-color: #1E6332; color: #1E6332; }
.kb-sort-btn i { margin-right: 4px; }
.kb-sort-active { background: #1E6332; color: #fff; border-color: #1E6332; }
.kb-sort-active:hover { background: #214A3E; color: #fff; }

/* ── Article Cards (Grid) ── */
.kb-article-list {
    padding: 16px 24px;
    display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px;
}
.kb-article-card {
    display: flex; flex-direction: column; gap: 0;
    padding: 20px; background: #fff; border: 1px solid #e5e1da;
    border-radius: 12px; cursor: pointer; transition: all 0.2s ease;
}
.kb-article-card:hover { border-color: #1E6332; box-shadow: 0 6px 20px rgba(30,99,50,0.08); transform: translateY(-3px); }
.kb-card-left { flex: 1; min-width: 0; }
.kb-card-title { font-family: 'Futura PT', 'Jost', sans-serif; font-size: 15px; font-weight: 600; color: #231F20; margin: 8px 0 8px; line-height: 1.3; }
.kb-card-summary { font-size: 13px; color: #6b7280; margin: 0 0 12px; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; flex: 1; }
.kb-card-meta {
    display: flex; flex-wrap: wrap; gap: 10px; font-size: 11px; color: #9ca3af; align-items: center;
    padding-top: 12px; border-top: 1px solid #f0ede8; margin-top: auto;
}
.kb-card-meta i { margin-right: 3px; }
.kb-card-tags { display: inline-flex; gap: 4px; margin-left: 0; }
.kb-card-arrow { display: none; }

/* ── Article View ── */
.kb-article-layout {
    display: grid; grid-template-columns: 1fr 300px; gap: 20px;
    padding: 20px 24px 40px; align-items: flex-start;
}
.kb-article-main { min-width: 0; }
.kb-article-card-wrap {
    background: #fff; border: 1px solid #e5e1da; border-radius: 14px;
    padding: 28px 32px 32px; box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.kb-article-sidebar {
    display: flex; flex-direction: column; gap: 16px;
    position: sticky; top: 16px;
}
.kb-article-sidebar .kb-sidebar-section { padding: 14px; }
.kb-article-sidebar .kb-related-card { margin-bottom: 8px; padding: 10px 12px; }
.kb-article-sidebar .kb-related-title { font-size: 13px; margin: 6px 0 4px; }
.kb-article-sidebar .kb-related-meta { font-size: 11px; }
.kb-article-sidebar .kb-comment-form { gap: 8px; }
.kb-article-sidebar .kb-comment-avatar { width: 28px; height: 28px; font-size: 11px; }
.kb-article-sidebar .kb-comment-textarea { padding: 8px 38px 8px 10px; font-size: 13px; min-height: 38px; }
.kb-article-sidebar .kb-comment-submit {
    padding: 0 !important; width: 28px; height: 28px; min-width: 0;
    font-size: 12px !important; right: 5px; top: 50%; transform: translateY(-50%); bottom: auto;
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
}
.kb-article-sidebar .kb-comment { padding: 10px 0; }
.kb-article-sidebar .kb-comment-pinned { padding: 10px 10px; margin: 0 -10px; }
.kb-article-sidebar .kb-comment-author { font-size: 12px; }
.kb-article-sidebar .kb-comment-text { font-size: 13px; line-height: 1.4; }
.kb-article-sidebar .kb-comment-time { font-size: 11px; }
.kb-article-sidebar .kb-role-badge { font-size: 9px; padding: 1px 5px; }
.kb-article-sidebar .kb-pinned-badge { font-size: 10px; }
.kb-article-sidebar .kb-comments-count { font-size: 11px; padding: 1px 6px; }

/* Article Header */
.kb-article-header { margin-bottom: 24px; }
.kb-article-title { font-family: 'Futura PT', 'Jost', sans-serif; font-size: 28px; font-weight: 700; color: #231F20; margin: 10px 0 14px; line-height: 1.3; }
.kb-article-meta-bar { display: flex; flex-wrap: wrap; gap: 16px; font-size: 13px; color: #9ca3af; margin-bottom: 10px; }
.kb-article-meta-bar i { margin-right: 4px; }
.kb-article-tags { display: flex; gap: 6px; flex-wrap: wrap; }

/* Video Embed */
.kb-video-embed {
    position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden;
    border-radius: 12px; margin-bottom: 24px; background: #000;
}
.kb-video-embed iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }

/* Article Body */
.kb-article-body {
    font-size: 15px; line-height: 1.75; color: #374151;
}
.kb-article-body h2 {
    font-family: 'Futura PT', 'Jost', sans-serif;
    font-size: 20px; font-weight: 700; color: #231F20;
    margin: 32px 0 12px; padding-top: 16px;
    border-top: 1px solid #eee;
}
.kb-article-body h2:first-child { border-top: none; margin-top: 0; padding-top: 0; }
.kb-article-body h3 {
    font-family: 'Futura PT', 'Jost', sans-serif;
    font-size: 16px; font-weight: 600; color: #374151;
    margin: 20px 0 8px;
}
.kb-article-body p { margin: 0 0 14px; }
.kb-article-body ul, .kb-article-body ol { margin: 0 0 14px; padding-left: 24px; }
.kb-article-body li { margin-bottom: 6px; }
.kb-article-body strong { color: #231F20; }

/* FAQ Items */
.kb-faq-item {
    border: 1px solid #e5e1da; border-radius: 10px;
    margin-bottom: 10px; overflow: hidden;
}
.kb-faq-item h3 {
    margin: 0; padding: 14px 18px;
    background: #fafaf8; font-size: 15px; font-weight: 600; color: #231F20;
    border-bottom: 1px solid #e5e1da; cursor: default;
}
.kb-faq-item p { padding: 14px 18px; margin: 0; font-size: 14px; }


/* ── Attachments ── */
.kb-attachments { margin: 28px 0; padding: 20px; background: #fafaf8; border: 1px solid #e5e1da; border-radius: 12px; }
.kb-attachments h3 { font-family: 'Futura PT', 'Jost', sans-serif; font-size: 15px; color: #231F20; margin: 0 0 14px; }
.kb-attachments h3 i { color: #1E6332; margin-right: 6px; }
.kb-att-grid { display: flex; flex-direction: column; gap: 8px; }
.kb-att-item {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 14px; background: #fff; border: 1px solid #e5e1da;
    border-radius: 8px; transition: border-color 0.15s;
}
.kb-att-item:hover { border-color: #1E6332; }
.kb-att-info { flex: 1; min-width: 0; }
.kb-att-name { display: block; font-size: 13px; font-weight: 500; color: #231F20; }
.kb-att-size { font-size: 11px; color: #9ca3af; }
.kb-att-download {
    width: 32px; height: 32px; border-radius: 8px; border: 1px solid #e5e1da;
    background: #fff; color: #1E6332; cursor: pointer; transition: all 0.15s;
    display: flex; align-items: center; justify-content: center; font-size: 13px;
}
.kb-att-download:hover { background: #1E6332; color: #fff; border-color: #1E6332; }

/* ── Feedback ── */
.kb-feedback {
    margin: 28px 0; padding: 24px; text-align: center;
    background: #fafaf8; border: 1px solid #e5e1da; border-radius: 12px;
}
.kb-feedback-question {
    font-family: 'Futura PT', 'Jost', sans-serif;
    font-size: 16px; font-weight: 600; color: #231F20; margin-bottom: 14px;
}
.kb-feedback-btns { display: flex; gap: 12px; justify-content: center; }
.kb-feedback-btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 10px 28px; border-radius: 10px; font-size: 14px; font-weight: 600;
    border: 1.5px solid; cursor: pointer; transition: all 0.2s;
    font-family: 'Futura PT', 'Jost', sans-serif;
}
.kb-feedback-yes {
    color: #1E6332; border-color: #1E6332; background: #fff;
}
.kb-feedback-yes:hover { background: #1E6332; color: #fff; transform: translateY(-1px); box-shadow: 0 3px 10px rgba(30,99,50,0.2); }
.kb-feedback-no {
    color: #9ca3af; border-color: #d5d0c8; background: #fff;
}
.kb-feedback-no:hover { border-color: #dc2626; color: #dc2626; }
.kb-feedback-yes.kb-feedback-selected { background: #1E6332; color: #fff; border-color: #1E6332; }
.kb-feedback-no.kb-feedback-selected { background: #dc2626; color: #fff; border-color: #dc2626; }
.kb-feedback-thanks { color: #1E6332; font-size: 14px; font-weight: 500; margin-top: 10px; }
.kb-feedback-thanks i { margin-right: 6px; }
.kb-feedback-flash { animation: kbFeedbackFlash 0.4s ease; }
@keyframes kbFeedbackFlash {
    0% { opacity: 0; transform: translateY(6px); }
    100% { opacity: 1; transform: translateY(0); }
}

/* ── Related Articles ── */
.kb-related-card {
    padding: 14px 16px; background: #fff; border: 1px solid #e5e1da;
    border-radius: 10px; cursor: pointer; transition: all 0.2s;
}
.kb-related-card:hover { border-color: #1E6332; box-shadow: 0 3px 12px rgba(30,99,50,0.06); transform: translateY(-1px); }
.kb-related-title { font-size: 14px; font-weight: 600; color: #231F20; margin: 8px 0 6px; line-height: 1.3; }
.kb-related-meta { font-size: 12px; color: #9ca3af; }

/* ── Comments ── */
.kb-comments { margin: 32px 0 0; }
.kb-comments h3 { font-family: 'Futura PT', 'Jost', sans-serif; font-size: 16px; color: #231F20; margin: 0 0 18px; display: flex; align-items: center; gap: 8px; }
.kb-comments h3 i { color: #1E6332; }
.kb-comments-count {
    background: #F4F0E9; color: #8a8580; font-size: 12px; font-weight: 600;
    padding: 2px 8px; border-radius: 10px;
}

/* Comment Form */
.kb-comment-form { display: flex; gap: 12px; margin-bottom: 20px; align-items: flex-start; }
.kb-comment-avatar {
    width: 36px; height: 36px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 13px; font-weight: 700; flex-shrink: 0;
}
.kb-comment-input-wrap { flex: 1; position: relative; }
.kb-comment-textarea {
    width: 100%; padding: 12px 80px 12px 14px; border: 1.5px solid #e5e1da;
    border-radius: 10px; font-size: 14px; font-family: 'Futura PT', 'Jost', sans-serif;
    resize: vertical; min-height: 52px; color: #231F20; outline: none;
    transition: border-color 0.2s;
}
.kb-comment-textarea:focus { border-color: #1E6332; }
.kb-comment-submit {
    position: absolute; right: 8px; bottom: 8px;
    padding: 6px 14px !important; font-size: 13px !important;
}

/* Comment List */
.kb-comment-list { display: flex; flex-direction: column; gap: 0; }
.kb-comment {
    display: flex; gap: 12px; padding: 14px 0;
    border-top: 1px solid #f0ede8;
}
.kb-comment-pinned { background: #fefce8; margin: 0 -16px; padding: 14px 16px; border-radius: 8px; border-top: none; }
.kb-comment-body { flex: 1; min-width: 0; }
.kb-comment-header { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; }
.kb-comment-author { font-size: 13px; font-weight: 600; color: #231F20; }
.kb-comment-time { font-size: 12px; color: #9ca3af; }
.kb-comment-text { font-size: 14px; color: #374151; line-height: 1.5; }

/* Role Badges */
.kb-role-badge {
    display: inline-flex; align-items: center; padding: 1px 7px;
    border-radius: 4px; font-size: 10px; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.3px;
}
.kb-role-employee { background: #1E633215; color: #1E6332; }
.kb-role-admin { background: #d9770615; color: #d97706; }
.kb-pinned-badge { font-size: 11px; color: #d97706; font-weight: 500; }
.kb-pinned-badge i { margin-right: 3px; font-size: 10px; }

/* ── Search Results ── */
.kb-search-header { padding: 20px 24px 0; }
.kb-search-count { font-size: 14px; color: #6b7280; margin: 12px 0 0; }

/* ── Buttons ── */
.kb-btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 10px 20px; border-radius: 10px; font-size: 14px; font-weight: 600;
    font-family: 'Futura PT', 'Jost', sans-serif;
    border: 1.5px solid transparent; cursor: pointer; transition: all 0.2s;
}
.kb-btn-primary {
    background: #1E6332; color: #fff; border-color: #1E6332;
}
.kb-btn-primary:hover { background: #214A3E; transform: translateY(-1px); box-shadow: 0 3px 10px rgba(30,99,50,0.2); }

/* ── IC Logo Preview on Home Cards ── */
.kb-cat-ic-logos { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; padding-top: 10px; border-top: 1px solid #f0ede8; }
.kb-cat-ic-logo {
    width: 36px; height: 36px; border-radius: 8px; border: 1px solid #e5e1da;
    background: #fff; display: flex; align-items: center; justify-content: center;
    overflow: hidden; font-size: 14px; color: #d97706;
}
.kb-cat-ic-logo img { width: 100%; height: 100%; object-fit: contain; padding: 3px; }
.kb-cat-ic-more { font-size: 11px; font-weight: 600; color: #9ca3af; background: #f0ede8; border-color: transparent; }

/* ==================== FORMS & RESOURCES (Document Repository) ==================== */
.kb-docs-grid {
    padding: 16px 24px;
    display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px;
}
.kb-doc-card {
    display: flex; flex-direction: column;
    background: #fff; border: 1px solid #e5e1da; border-radius: 12px;
    cursor: pointer; transition: all 0.2s; overflow: hidden;
}
.kb-doc-card:hover { border-color: #2563eb40; box-shadow: 0 6px 20px rgba(37,99,235,0.08); transform: translateY(-2px); }

/* Mini document preview thumbnail */
.kb-doc-thumb {
    height: 120px; background: #f8f7f5; position: relative;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    border-bottom: 2px solid;
}
.kb-doc-thumb-icon { font-size: 36px; }
.kb-doc-thumb-img { width: 100%; height: 100%; object-fit: cover; object-position: top center; }
/* Generated first-page previews: show the top of the page (like a file explorer's
   large-icon view) on a clean white "page", fading in when ready. */
.kb-doc-thumb-gen { background: #fff; animation: kbThumbFade 0.25s ease; }
@keyframes kbThumbFade { from { opacity: 0; } to { opacity: 1; } }
.kb-doc-type-badge {
    position: absolute; top: 10px; right: 10px;
    padding: 2px 8px; border-radius: 4px; font-size: 10px; font-weight: 700;
    letter-spacing: 0.5px;
}

/* Card body */
.kb-doc-card-body { padding: 14px 16px; flex: 1; }
.kb-doc-title { font-family: 'Futura PT', 'Jost', sans-serif; font-size: 14px; font-weight: 600; color: #231F20; margin: 0 0 6px; line-height: 1.3; }
.kb-doc-desc {
    font-size: 12px; color: #6b7280; margin: 0 0 10px; line-height: 1.4;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.kb-doc-meta { display: flex; gap: 10px; font-size: 11px; color: #9ca3af; align-items: center; }
.kb-doc-meta i { margin-right: 2px; }

/* Card footer actions */
.kb-doc-card-footer {
    display: flex; border-top: 1px solid #f0ede8;
}
.kb-doc-action-btn {
    flex: 1; padding: 10px; border: none; background: none;
    font-size: 12px; font-weight: 600; cursor: pointer; transition: all 0.15s;
    font-family: 'Futura PT', 'Jost', sans-serif;
    display: flex; align-items: center; justify-content: center; gap: 5px;
    color: #6b7280;
}
.kb-doc-action-btn:first-child { border-right: 1px solid #f0ede8; }
.kb-doc-action-btn:hover { background: #f8f7f5; color: #2563eb; }
.kb-doc-action-dl:hover { color: #1E6332; }

/* Document Preview Modal */
.kb-doc-preview-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 10200;
    display: flex; align-items: center; justify-content: center;
    opacity: 0; transition: opacity 0.2s;
}
.kb-doc-preview-overlay.active { opacity: 1; }
.kb-doc-preview-modal {
    background: #fff; border-radius: 14px; width: 80vw; min-width: 80vw; max-width: 92vw; height: 90vh; max-height: 90vh;
    display: flex; flex-direction: column; overflow: hidden;
    box-shadow: 0 24px 80px rgba(0,0,0,0.2); transform: scale(0.95); transition: transform 0.2s;
}
.kb-doc-preview-overlay.active .kb-doc-preview-modal { transform: scale(1); }
/* On small screens, use near-full width instead of the cramped 80vw. */
@media (max-width: 768px) {
    .kb-doc-preview-modal { width: 96vw; min-width: 0; max-width: 96vw; }
}
.kb-doc-preview-header {
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
    padding: 16px 20px; border-bottom: 1px solid #eee;
}
.kb-doc-preview-header-left { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; }
.kb-doc-preview-name { font-family: 'Futura PT', 'Jost', sans-serif; font-size: 16px; font-weight: 600; color: #231F20; }
.kb-doc-preview-meta { font-size: 12px; color: #9ca3af; }
.kb-doc-preview-actions { display: flex; gap: 8px; align-items: center; }
.kb-doc-preview-close {
    width: 32px; height: 32px; border-radius: 8px; border: 1px solid #e5e1da;
    background: #fff; color: #6b7280; cursor: pointer; font-size: 14px;
    display: flex; align-items: center; justify-content: center; transition: all 0.15s;
}
.kb-doc-preview-close:hover { background: #f0ede8; color: #231F20; }
.kb-doc-preview-body { flex: 1; overflow-y: auto; padding: 40px; }
.kb-doc-preview-placeholder { text-align: center; color: #6b7280; }
.kb-doc-preview-placeholder h3 { margin: 16px 0 8px; color: #231F20; font-size: 18px; }
.kb-doc-preview-placeholder p { margin: 0 0 8px; font-size: 14px; line-height: 1.5; }
.kb-doc-preview-note { font-size: 12px; color: #9ca3af; font-style: italic; margin-top: 16px !important; }
.kb-doc-preview-placeholder .kb-loading-spinner { margin: 0 auto 4px; }
/* Real file preview (signed URL from kb-documents bucket) */
.kb-doc-preview-frame { width: 100%; height: 100%; min-height: 60vh; border: none; background: #fff; }
.kb-doc-preview-imgwrap { display: flex; align-items: center; justify-content: center; min-height: 100%; }
.kb-doc-preview-imgwrap img { max-width: 100%; max-height: 72vh; object-fit: contain; border-radius: 6px; box-shadow: 0 4px 20px rgba(0,0,0,0.12); }

/* ==================== INSURANCE KNOWLEDGE BASE ==================== */
.kb-ic-table-wrap { padding: 0 24px 24px; overflow-x: auto; }
.kb-ic-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.kb-ic-table thead th {
    padding: 10px 12px; text-align: left; font-size: 11px; font-weight: 600;
    color: #9ca3af; text-transform: uppercase; letter-spacing: 0.3px;
    border-bottom: 2px solid #eee; white-space: nowrap;
    position: sticky; top: 0; background: #fff; z-index: 1;
}
.kb-ic-row { border-bottom: 1px solid #f0ede8; transition: background 0.1s; background: #fff; }
.kb-ic-row:hover { background: #fafaf8; }
.kb-ic-table td { padding: 10px 12px; vertical-align: middle; font-size: 13px; color: #374151; }
.kb-ic-name-cell { display: flex; align-items: center; gap: 10px; min-width: 220px; }
.kb-ic-row-logo {
    width: 32px; height: 32px; border-radius: 8px; flex-shrink: 0;
    background: #fafaf8; border: 1px solid #e5e1da;
    display: flex; align-items: center; justify-content: center; overflow: hidden;
    font-size: 14px; color: #d97706;
}
.kb-ic-row-logo img { width: 100%; height: 100%; object-fit: contain; padding: 3px; }
.kb-ic-row-name { font-weight: 600; color: #231F20; white-space: nowrap; }
.kb-ic-loc-cell { font-size: 12px; color: #6b7280; white-space: nowrap; }
.kb-ic-yes {
    display: inline-flex; align-items: center; justify-content: center;
    width: 26px; height: 26px; border-radius: 6px; font-size: 11px;
}
.kb-ic-yes-warn { background: #fef3c7; color: #92400e; }
.kb-ic-yes-green { background: #dcfce7; color: #166534; }
.kb-ic-yes-blue { background: #dbeafe; color: #1e40af; }
.kb-ic-no { color: #d5d0c8; font-size: 12px; }
.kb-ic-view-btn {
    padding: 5px 14px; border-radius: 6px; border: 1px solid #e5e1da;
    background: #fff; color: #1E6332; font-size: 12px; font-weight: 600;
    cursor: pointer; transition: all 0.15s; font-family: 'Futura PT', 'Jost', sans-serif;
    white-space: nowrap;
}
.kb-ic-view-btn:hover { background: #1E6332; color: #fff; border-color: #1E6332; }
.kb-ic-view-btn i { margin-right: 4px; }

/* IC Detail Modal */
.kb-ic-detail-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 10200;
    display: flex; align-items: center; justify-content: center;
    opacity: 0; transition: opacity 0.2s;
}
.kb-ic-detail-overlay.active { opacity: 1; }
.kb-ic-detail-modal {
    background: #fff; border-radius: 14px; width: 90%; max-width: 640px; max-height: 90vh;
    overflow-y: auto; box-shadow: 0 24px 80px rgba(0,0,0,0.2);
    transform: scale(0.95); transition: transform 0.2s;
}
.kb-ic-detail-overlay.active .kb-ic-detail-modal { transform: scale(1); }
.kb-ic-detail-header {
    display: flex; align-items: center; gap: 16px; padding: 20px 24px;
    background: linear-gradient(135deg, #1E6332, #214A3E); color: #fff; position: relative;
    border-radius: 14px 14px 0 0;
}
.kb-ic-detail-header .kb-doc-preview-close { position: absolute; top: 16px; right: 16px; border-color: rgba(255,255,255,0.3); color: #fff; background: rgba(255,255,255,0.1); }
.kb-ic-detail-header .kb-doc-preview-close:hover { background: rgba(255,255,255,0.2); }
.kb-ic-detail-logo {
    width: 60px; height: 60px; border-radius: 12px; background: rgba(255,255,255,0.15);
    display: flex; align-items: center; justify-content: center; overflow: hidden; flex-shrink: 0;
}
.kb-ic-detail-logo img { width: 100%; height: 100%; object-fit: contain; padding: 6px; border-radius: 8px; background: #fff; }
.kb-ic-detail-title h2 { font-family: 'Futura PT', 'Jost', sans-serif; font-size: 20px; margin: 0 0 2px; }
.kb-ic-detail-title p { margin: 0; font-size: 13px; opacity: 0.7; }
.kb-ic-detail-badges { display: flex; gap: 8px; flex-wrap: wrap; padding: 16px 24px; border-bottom: 1px solid #eee; }
.kb-ic-detail-badge {
    display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px;
    border-radius: 8px; font-size: 12px; font-weight: 600;
}
.kb-ic-detail-badge i { font-size: 11px; }
.kb-ic-badge-ok { background: #dcfce7; color: #166534; }
.kb-ic-badge-warn { background: #fef3c7; color: #92400e; }
.kb-ic-badge-neutral { background: #f3f4f6; color: #6b7280; }
.kb-ic-detail-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 0; padding: 0 24px;
}
.kb-ic-detail-field { padding: 12px 0; border-bottom: 1px solid #f0ede8; }
.kb-ic-detail-field-label { font-size: 11px; font-weight: 600; color: #9ca3af; text-transform: uppercase; letter-spacing: 0.3px; margin-bottom: 3px; }
.kb-ic-detail-field-label i { margin-right: 4px; color: #1E6332; }
.kb-ic-detail-field-value { font-size: 14px; color: #231F20; word-break: break-word; }
.kb-ic-detail-section { padding: 16px 24px; border-top: 1px solid #eee; }
.kb-ic-detail-section h3 { font-family: 'Futura PT', 'Jost', sans-serif; font-size: 14px; font-weight: 600; color: #231F20; margin: 0 0 8px; }
.kb-ic-detail-section h3 i { color: #1E6332; margin-right: 6px; }
.kb-ic-detail-section p { font-size: 13px; color: #374151; line-height: 1.5; margin: 0 0 6px; }
.kb-ic-detail-sub { font-size: 12px; color: #6b7280; }
.kb-ic-doc-list { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.kb-ic-doc-item {
    display: flex; align-items: center; gap: 8px; padding: 8px 12px;
    background: #f8faf8; border: 1px solid #e5e1da; border-radius: 8px;
    font-size: 13px; color: #231F20;
}
.kb-ic-doc-item i { color: #1E6332; font-size: 12px; flex-shrink: 0; }
.kb-ic-doc-note {
    margin-top: 12px; padding: 10px 14px; background: #fefce8; border: 1px solid #fde68a;
    border-radius: 8px; font-size: 12px; color: #92400e; line-height: 1.5;
}
.kb-ic-doc-note i { margin-right: 5px; }
.kb-ic-extra-row {
    display: flex; justify-content: space-between; gap: 12px; padding: 8px 0;
    font-size: 13px; border-bottom: 1px solid #f0ede8;
}
.kb-ic-extra-row:last-child { border-bottom: none; }
.kb-ic-extra-label { font-weight: 600; color: #6b7280; flex-shrink: 0; }

/* ==================== UPDATES & FAQ ==================== */
.kb-uf-layout {
    display: grid; grid-template-columns: 1fr 1fr; gap: 0;
    padding: 0; align-items: flex-start;
}
.kb-uf-left {
    padding: 20px 24px; border-right: 1px solid #eee;
    position: sticky; top: 0; max-height: calc(100vh - 200px); overflow-y: auto;
}
.kb-uf-right { padding: 20px 24px; }
.kb-uf-section-title {
    font-family: 'Futura PT', 'Jost', sans-serif; font-size: 17px; font-weight: 600;
    color: #231F20; margin: 0 0 16px; display: flex; align-items: center; gap: 8px;
}
.kb-uf-section-title i { color: #7c3aed; }

/* Company Timeline (What's New) */
.kb-timeline { position: relative; padding-left: 160px; }
.kb-timeline::before {
    content: ''; position: absolute; left: 130px; top: 10px; bottom: 10px;
    width: 3px; border-radius: 3px; background: linear-gradient(180deg, #1E6332 0%, #2F8542 45%, #C19A6B 100%);
}
.kb-timeline-item { position: relative; margin-bottom: 26px; }
.kb-timeline-dot-wrap { position: absolute; left: -38px; top: 22px; }
/* Date label — sits in the column to the LEFT of the timeline line */
.kb-timeline-date-side {
    position: absolute; left: -160px; width: 118px; top: 22px; text-align: right;
    display: flex; align-items: center; justify-content: flex-end; gap: 6px;
    font-family: 'Futura PT', 'Jost', sans-serif; font-size: 13px; font-weight: 700;
    color: #1E6332; text-transform: uppercase; letter-spacing: 0.5px; line-height: 1.3;
}
.kb-timeline-date-side i { font-size: 11px; opacity: .75; }
/* Big year separator between groups */
.kb-timeline-year {
    display: flex; align-items: center; gap: 20px;
    margin: 46px 0 26px -160px;   /* full-width: cancels the 160px date column */
}
.kb-timeline-year:first-child { margin-top: 6px; }
.kb-timeline-year-num {
    font-family: 'Futura PT', 'Jost', sans-serif; font-size: 42px; font-weight: 800;
    line-height: 1; letter-spacing: -0.5px;
    background: linear-gradient(135deg, #1E6332, #2F8542);
    -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: #1E6332;
    flex-shrink: 0;
}
.kb-timeline-year-line {
    flex: 1; height: 2px; border-radius: 2px;
    background: linear-gradient(90deg, rgba(30,99,50,0.4) 0%, rgba(193,154,107,0.2) 55%, transparent 100%);
}
body.dark-theme .kb-timeline-year-num { -webkit-text-fill-color: transparent; }
body.dark-theme .kb-timeline-year-line { background: linear-gradient(90deg, rgba(110,231,183,0.35) 0%, rgba(193,154,107,0.2) 55%, transparent 100%); }
.kb-timeline-dot {
    width: 18px; height: 18px; border-radius: 50%;
    background: #fff; border: 4px solid #1E6332;
    box-shadow: 0 0 0 4px rgba(30,99,50,0.12);
    transition: transform .2s, box-shadow .2s, border-color .2s;
}
.kb-timeline-item:hover .kb-timeline-dot { transform: scale(1.15); border-color: #2F8542; box-shadow: 0 0 0 5px rgba(47,133,66,0.18); }

/* Card — text-only (no image) */
.kb-timeline-card {
    background: #fff; border: 1px solid #e8e3da; border-radius: 14px;
    padding: 22px 24px; cursor: pointer; overflow: hidden;
    box-shadow: 0 1px 2px rgba(35,31,32,0.04);
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.kb-timeline-card:hover {
    transform: translateY(-3px); border-color: rgba(30,99,50,0.35);
    box-shadow: 0 14px 32px rgba(30,99,50,0.12);
}
/* Card — with image → magazine-style horizontal split */
.kb-timeline-card.has-img { display: flex; padding: 0; }
.kb-timeline-img {
    width: 300px; flex-shrink: 0; align-self: stretch; min-height: 190px;
    overflow: hidden; background: #f0ede8; position: relative;
}
.kb-timeline-img::after {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(90deg, transparent 78%, rgba(30,99,50,0.06) 100%);
}
.kb-timeline-img img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .4s ease; }
.kb-timeline-card.has-img:hover .kb-timeline-img img { transform: scale(1.06); }
.kb-timeline-content { padding: 22px 26px; display: flex; flex-direction: column; align-items: flex-start; min-width: 0; }
.kb-timeline-card.has-img .kb-timeline-content { justify-content: center; }

.kb-timeline-date {
    display: inline-flex; align-items: center; gap: 6px;
    font-family: 'Futura PT', 'Jost', sans-serif; font-size: 11.5px; font-weight: 700;
    color: #1E6332; background: rgba(30,99,50,0.08); border-radius: 20px;
    padding: 4px 12px; margin-bottom: 12px; text-transform: uppercase; letter-spacing: 0.5px;
}
.kb-timeline-date i { font-size: 10px; opacity: .8; }
.kb-timeline-title {
    font-family: 'Futura PT', 'Jost', sans-serif; font-size: 18px; font-weight: 700;
    color: #231F20; margin: 0 0 8px; line-height: 1.3;
}
.kb-timeline-desc {
    font-size: 14px; color: #6b7280; line-height: 1.6; margin: 0 0 16px;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.kb-timeline-learn-more {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 8px 18px; border-radius: 8px; border: none;
    background: linear-gradient(135deg, #1E6332, #2F8542); color: #fff; font-size: 12.5px; font-weight: 600;
    cursor: pointer; font-family: 'Futura PT', 'Jost', sans-serif; transition: box-shadow .18s, transform .18s;
    box-shadow: 0 2px 8px rgba(30,99,50,0.22);
}
.kb-timeline-learn-more:hover { box-shadow: 0 6px 16px rgba(30,99,50,0.32); transform: translateY(-1px); }
.kb-timeline-learn-more i { font-size: 10px; transition: transform 0.18s; }
.kb-timeline-learn-more:hover i { transform: translateX(4px); }

/* ==================== Update Detail Modal ==================== */
.kb-update-overlay {
    position: fixed; inset: 0; background: rgba(20,16,14,0.55); z-index: 10200;
    display: flex; align-items: center; justify-content: center; padding: 24px;
    opacity: 0; transition: opacity 0.2s; -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
}
.kb-update-overlay.active { opacity: 1; }
.kb-update-modal {
    background: #fff; border-radius: 18px; width: 75vw; max-width: 1040px; min-width: 320px; max-height: 90vh;
    display: flex; flex-direction: column; overflow: hidden;
    box-shadow: 0 30px 90px rgba(0,0,0,0.35); transform: scale(0.96) translateY(8px); transition: transform 0.22s ease;
}
.kb-update-overlay.active .kb-update-modal { transform: scale(1) translateY(0); }

/* Hero banner (image version) */
.kb-update-hero { position: relative; height: 300px; flex-shrink: 0; background: #1E6332; overflow: hidden; }
.kb-update-hero-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.kb-update-hero-scrim {
    position: absolute; inset: 0;
    background: linear-gradient(180deg, rgba(20,16,14,0.15) 0%, rgba(20,16,14,0) 30%, rgba(20,16,14,0.35) 60%, rgba(20,16,14,0.82) 100%);
}
.kb-update-hero-text { position: absolute; left: 0; right: 0; bottom: 0; padding: 28px 34px; }
.kb-update-hero-date {
    font-family: 'Futura PT', 'Jost', sans-serif; font-size: 13px; font-weight: 700; letter-spacing: 0.6px;
    color: rgba(255,255,255,0.9); text-transform: uppercase; margin: 12px 0 8px;
    text-shadow: 0 1px 3px rgba(0,0,0,0.4);
}
.kb-update-hero-title {
    margin: 0; font-family: 'Futura PT', 'Jost', sans-serif; font-size: 30px; font-weight: 700;
    color: #fff; line-height: 1.2; max-width: 820px; text-shadow: 0 2px 10px rgba(0,0,0,0.4);
}

/* Plain header (no-image fallback) */
.kb-update-modal-header {
    position: relative; padding: 30px 34px; background: linear-gradient(135deg, #1E6332, #214A3E);
}
.kb-update-header-date {
    font-family: 'Futura PT', 'Jost', sans-serif; font-size: 13px; font-weight: 700; letter-spacing: 0.6px;
    color: rgba(255,255,255,0.75); text-transform: uppercase; margin: 12px 0 8px;
}
.kb-update-header-title {
    margin: 0; font-family: 'Futura PT', 'Jost', sans-serif; font-size: 26px; font-weight: 700; color: #fff; line-height: 1.25;
}

/* "What's New" badge (shared) */
.kb-update-badge {
    display: inline-flex; align-items: center; gap: 6px;
    background: rgba(255,255,255,0.18); color: #fff; border: 1px solid rgba(255,255,255,0.25);
    border-radius: 20px; padding: 4px 12px; font-size: 11px; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.5px; -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
}
.kb-update-badge i { font-size: 10px; }

/* Close button (works on hero image + green header) */
.kb-update-close {
    position: absolute; top: 18px; right: 18px; z-index: 3;
    width: 40px; height: 40px; border-radius: 50%;
    background: rgba(0,0,0,0.35); border: 1px solid rgba(255,255,255,0.3); color: #fff;
    display: flex; align-items: center; justify-content: center; cursor: pointer;
    font-size: 15px; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); transition: background .15s, transform .15s;
}
.kb-update-close:hover { background: rgba(0,0,0,0.6); transform: scale(1.08); }

/* Body */
.kb-update-modal-body { padding: 30px 40px 36px; overflow-y: auto; flex: 1; overscroll-behavior: contain; }
.kb-update-lead {
    font-size: 17px; line-height: 1.6; color: #374151; font-weight: 500;
    margin: 0 0 22px; padding-bottom: 22px; border-bottom: 1px solid #f0ede8;
}
.kb-update-article-body { font-size: 15px; line-height: 1.75; color: #374151; max-width: 760px; }
.kb-update-article-body p { margin: 0 0 16px; }
/* Inline media (images + video embeds) inside What's New / article content */
.kb-embed-wrap { position: relative; width: 100%; padding-top: 56.25%; margin: 16px 0; border-radius: 12px; overflow: hidden; background: #000; box-shadow: 0 4px 16px rgba(0,0,0,0.12); }
.kb-embed-wrap iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.kb-article-body img, .kb-update-article-body img { max-width: 100%; height: auto; border-radius: 10px; }
.kb-article-body video, .kb-update-article-body video { max-width: 100%; border-radius: 10px; display: block; margin: 16px 0; }

@media (max-width: 900px) {
    .kb-update-modal { width: 94vw; max-height: 92vh; }
    .kb-update-hero { height: 210px; }
    .kb-update-hero-title { font-size: 22px; }
    .kb-update-modal-body { padding: 22px 22px 28px; }
    .kb-update-lead { font-size: 15px; }
    .kb-timeline-card.has-img { display: block; }
    .kb-timeline-img { width: 100%; min-height: 0; height: 180px; }
    /* Collapse the left date column: line moves to the far left, date stacks above the card */
    .kb-timeline { padding-left: 26px; }
    .kb-timeline::before { left: 8px; }
    .kb-timeline-dot-wrap { left: -26px; top: 4px; }
    .kb-timeline-date-side {
        position: static; width: auto; text-align: left; justify-content: flex-start;
        margin: 0 0 10px; top: auto; left: auto;
    }
    .kb-timeline-year { margin: 32px 0 20px -26px; gap: 14px; }
    .kb-timeline-year-num { font-size: 32px; }
    .kb-updates-page { padding: 20px 14px 32px; }
}

/* Dark theme */
body.dark-theme .kb-timeline-card { background: var(--theme-card, #1f2937); border-color: var(--theme-border, #374151); }
body.dark-theme .kb-timeline-title { color: var(--theme-text, #f3f4f6); }
body.dark-theme .kb-timeline-desc { color: var(--theme-text-muted, #9ca3af); }
body.dark-theme .kb-timeline-dot { background: var(--theme-bg, #111827); }
body.dark-theme .kb-update-modal { background: var(--theme-card, #1f2937); }
body.dark-theme .kb-update-lead { color: var(--theme-text, #e5e7eb); border-color: var(--theme-border, #374151); }
body.dark-theme .kb-update-article-body { color: var(--theme-text-muted, #d1d5db); }

/* ── FAQ (Resource Center) — redesigned ── */
.kb-faq-searchbar { max-width: 1080px; margin: 22px auto 4px; padding: 0 24px; }
.kb-faq-searchbar .kb-search-wrap { width: 100%; position: relative; }
.kb-faq-searchbar .kb-local-input {
    width: 100%; height: 48px; border: 1.5px solid #e5e1da; border-radius: 12px;
    background: #fff; padding: 0 16px 0 46px; font-size: 14px; color: #231F20;
    font-family: 'Futura PT', 'Jost', sans-serif; transition: border-color .15s, box-shadow .15s;
}
.kb-faq-searchbar .kb-local-input:focus { outline: none; border-color: #1E6332; box-shadow: 0 0 0 3px rgba(30,99,50,.10); }
.kb-faq-searchbar .kb-search-icon { position: absolute; left: 18px; top: 50%; transform: translateY(-50%); color: #2F8542; }

.kb-faq-layout {
    display: grid; grid-template-columns: 232px 1fr; gap: 34px;
    max-width: 1080px; margin: 0 auto; padding: 18px 24px 48px; align-items: start;
}

/* Left: sticky category jump-nav (uses the empty space) */
.kb-faq-nav { position: sticky; top: 76px; }
.kb-faq-nav-title {
    font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px;
    color: #9ca3af; margin: 0 0 12px; padding-left: 14px;
}
.kb-faq-nav-link {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    padding: 9px 14px; border-radius: 10px; margin-bottom: 3px; cursor: pointer;
    color: #475453; font-size: 13.5px; font-weight: 600; text-decoration: none;
    transition: background .15s, color .15s;
}
.kb-faq-nav-link:hover { background: #F4F0E9; color: #1E6332; }
.kb-faq-nav-count {
    font-size: 11px; font-weight: 700; color: #6b7280; background: #f1eee8;
    border-radius: 20px; padding: 1px 9px; min-width: 22px; text-align: center;
}
.kb-faq-nav-link:hover .kb-faq-nav-count { background: #e3ddd0; color: #1E6332; }

/* Right: accordion column */
.kb-faq-main { min-width: 0; }
.kb-faq-group { margin-bottom: 26px; scroll-margin-top: 80px; border-radius: 14px; transition: box-shadow .35s; }
.kb-faq-group--flash { box-shadow: 0 0 0 3px rgba(47,133,66,.30); }
.kb-faq-group-head { display: flex; align-items: center; gap: 11px; margin: 0 0 13px; padding-left: 2px; }
.kb-faq-group-bar { width: 4px; height: 18px; border-radius: 4px; background: linear-gradient(180deg,#2F8542,#1E6332); flex-shrink: 0; }
.kb-faq-group-title { font-family: 'Futura PT','Jost',sans-serif; font-size: 15px; font-weight: 700; color: #214A3E; letter-spacing: .2px; }
.kb-faq-group-count { font-size: 11.5px; font-weight: 600; color: #9ca3af; background: #f1eee8; border-radius: 20px; padding: 1px 9px; }

/* Accordion card */
.kb-faq-detail {
    position: relative; background: #fff; border: 1px solid #e8e3da; border-radius: 12px;
    margin-bottom: 10px; overflow: hidden; transition: border-color .18s, box-shadow .18s;
}
.kb-faq-detail::before {
    content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
    background: linear-gradient(180deg,#2F8542,#1E6332); border-radius: 12px 0 0 12px;
    transform: scaleY(0); transform-origin: top; transition: transform .2s;
}
.kb-faq-detail:hover { border-color: #cbe0d2; box-shadow: 0 2px 12px rgba(0,0,0,.045); }
.kb-faq-detail[open] { border-color: #cbe0d2; box-shadow: 0 6px 20px rgba(30,99,50,.09); }
.kb-faq-detail[open]::before { transform: scaleY(1); }

.kb-faq-detail summary {
    padding: 16px 18px 16px 20px; cursor: pointer; list-style: none;
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.kb-faq-detail summary::-webkit-details-marker { display: none; }
.kb-faq-q {
    font-family: 'Futura PT','Jost',sans-serif; font-size: 14.5px; font-weight: 600;
    color: #231F20; line-height: 1.4; transition: color .15s;
}
.kb-faq-detail summary:hover .kb-faq-q,
.kb-faq-detail[open] .kb-faq-q { color: #1E6332; }
.kb-faq-detail summary::after {
    content: '\f078'; font-family: 'Font Awesome 6 Free'; font-weight: 900; font-size: 11px;
    color: #1E6332; width: 27px; height: 27px; border-radius: 50%; background: #F4F0E9;
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
    transition: transform .22s, background .18s, color .18s;
}
.kb-faq-detail[open] summary::after { transform: rotate(180deg); background: #1E6332; color: #fff; }

.kb-faq-answer {
    padding: 14px 20px 18px 20px; font-size: 14px; color: #475453; line-height: 1.65;
    border-top: 1px solid #f2efe9;
}

/* dark theme */
body.dark-theme .kb-faq-searchbar .kb-local-input { background: var(--theme-card,#1f2937); border-color: var(--theme-border,#374151); color: var(--theme-text,#e5e7eb); }
body.dark-theme .kb-faq-nav-link { color: var(--theme-text-muted,#cbd5e1); }
body.dark-theme .kb-faq-nav-link:hover { background: rgba(47,133,66,.15); color: #6ee7a8; }
body.dark-theme .kb-faq-nav-count { background: #374151; color: #cbd5e1; }
body.dark-theme .kb-faq-group-title { color: #a7f3c8; }
body.dark-theme .kb-faq-group-count { background: #374151; color: #9ca3af; }
body.dark-theme .kb-faq-detail { background: var(--theme-card,#1f2937); border-color: var(--theme-border,#374151); }
body.dark-theme .kb-faq-q { color: var(--theme-text,#e5e7eb); }
body.dark-theme .kb-faq-detail summary:hover .kb-faq-q,
body.dark-theme .kb-faq-detail[open] .kb-faq-q { color: #6ee7a8; }
body.dark-theme .kb-faq-detail summary::after { background: #374151; color: #6ee7a8; }
body.dark-theme .kb-faq-detail[open] summary::after { background: #1E6332; color: #fff; }
body.dark-theme .kb-faq-answer { color: var(--theme-text-muted,#cbd5e1); border-color: #374151; }

/* responsive: drop the side nav, single column */
@media (max-width: 860px) {
    .kb-faq-layout { grid-template-columns: 1fr; gap: 0; padding: 14px 16px 40px; }
    .kb-faq-nav { display: none; }
    .kb-faq-searchbar { padding: 0 16px; margin-top: 16px; }
}

/* ── Standalone Updates Page ── */
.kb-updates-page { padding: 28px 24px 40px; max-width: 1140px; margin: 0 auto; }

/* ── Standalone FAQ Page ── */
.kb-faq-page { padding: 20px 24px; max-width: 900px; margin: 0 auto; }

/* ── Responsive ── */
/* Resource Center home: drop the right column (Recently Viewed / Most Popular)
   below the categories on smaller screens so it never crowds or overlaps them.
   The categories then take the full width and reflow via auto-fill. */
@media (max-width: 1200px) {
    .kb-home-layout { grid-template-columns: 1fr; }
    /* Stacked below the categories: the Recently Added card flows at its natural
       height (JS clears the matched height here) with a capped, scrollable list. */
    .kb-home-sidebar { min-height: auto; }
    .kb-recently-added-list { max-height: 360px; }
}
@media (max-width: 900px) {
    .kb-article-layout { grid-template-columns: 1fr; padding: 16px; }
    .kb-article-sidebar { position: static; }
    .kb-article-card-wrap { padding: 20px; }
    .kb-uf-layout { grid-template-columns: 1fr; }
    .kb-uf-left { border-right: none; border-bottom: 1px solid #eee; position: static; max-height: none; }
}

@media (max-width: 768px) {
    .kb-hero { padding: 32px 16px 40px; }
    .kb-hero-title { font-size: 22px; }
    .kb-hero-subtitle { font-size: 13px; }
    .kb-search-input { padding: 12px 14px 12px 40px; font-size: 14px; }
    .kb-featured-row { margin: -20px 16px 20px; grid-template-columns: 1fr; }
    .kb-featured-body { padding: 14px 16px; }
    .kb-featured-arrow { display: none; }
    .kb-featured-title { font-size: 17px; }
    .kb-section { padding: 0 16px; }
    .kb-categories-grid { grid-template-columns: 1fr; }
    .kb-home-layout { padding: 0 16px; }
    .kb-home-sidebar { flex-direction: column; }
    .kb-categories-grid { grid-template-columns: 1fr; }
    .kb-breadcrumb { padding: 10px 16px; font-size: 12px; }
    .kb-cat-header { padding: 16px; gap: 12px; }
    .kb-cat-header-icon { width: 42px; height: 42px; font-size: 18px; }
    .kb-cat-header-title { font-size: 18px; }
    .kb-filter-bar { padding: 10px 16px; flex-direction: column; align-items: stretch; }
    .kb-search-wrap-sm { max-width: none; }
    .kb-article-list { padding: 12px 16px; }
    .kb-article-card { padding: 14px 16px; }
    .kb-card-title { font-size: 15px; }
    .kb-article-layout { padding: 12px; }
    .kb-article-card-wrap { padding: 16px; }
    .kb-article-title { font-size: 22px; }
    .kb-article-meta-bar { gap: 10px; font-size: 12px; }
    .kb-feedback-btns { flex-direction: column; gap: 8px; }
    .kb-feedback-btn { justify-content: center; }
    .kb-comment-form { gap: 8px; }
    .kb-comment-avatar { width: 32px; height: 32px; font-size: 12px; }
    .kb-home-sidebar { flex-direction: column; }
}
