/* Knowledge Base Viewer Styles */
body.kb-page {
    --kb-page-bg: var(--background-primary);
    --kb-section-bg: var(--background-primary);
    --kb-section-alt-bg: var(--background-secondary);
    --kb-card-bg: var(--surface);
    --kb-card-border: rgba(226, 232, 240, 0.92);
    --kb-card-shadow: 0 16px 42px rgba(15, 23, 42, 0.08);
    --kb-card-hover-shadow: 0 24px 54px rgba(15, 23, 42, 0.14);
    --kb-text: var(--text-primary);
    --kb-muted: var(--text-secondary);
    --kb-soft: rgba(100, 116, 139, 0.12);
    --kb-hero-bg: linear-gradient(135deg, #F8FAFC 0%, #D4AF37 44%, #B8860B 100%);
    --kb-hero-text: #172033;
    --kb-hero-muted: rgba(23, 32, 51, 0.76);
    --kb-accent: #B8860B;
    --kb-accent-strong: #D4AF37;
    --kb-accent-soft: rgba(212, 175, 55, 0.14);
    --kb-control-bg: #FFFFFF;
    --kb-control-border: #E2E8F0;
    --kb-code-bg: #F8FAFC;
    --kb-code-text: #1E293B;
    --kb-feedback-btn-bg: #FFFFFF;
    --kb-feedback-btn-border: #E5E7EB;
    --kb-feedback-btn-text: #1F2937;
    --kb-feedback-btn-hover-bg: #F8FAFC;
    --kb-feedback-btn-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
    background: var(--kb-page-bg);
    color: var(--kb-text);
}

/* Shared article reader and staff preview, aligned with the refreshed KB index. */
html body.kb-page.kb-article-refresh {
    --kb-page-bg: #ffffff;
    --kb-section-alt-bg: #f3f5f6;
    --kb-card-bg: #ffffff;
    --kb-card-border: #cbdad6;
    --kb-card-shadow: none;
    --kb-text: #283c3b;
    --kb-muted: #536866;
    --kb-hero-bg: #edf4f2;
    --kb-hero-text: #283c3b;
    --kb-hero-muted: #536866;
    --kb-accent: #276854;
    --kb-accent-soft: #dfede6;
    --kb-code-bg: #f3f5f6;
    --kb-code-text: #283c3b;
}
html[data-theme="dark"] body.kb-page.kb-article-refresh {
    --kb-page-bg: #202725;
    --kb-section-alt-bg: #28312f;
    --kb-card-bg: #202725;
    --kb-card-border: #5a746a;
    --kb-text: #edf4f1;
    --kb-muted: #c0d1ca;
    --kb-hero-bg: #30413d;
    --kb-hero-text: #edf4f1;
    --kb-hero-muted: #c0d1ca;
    --kb-accent: #b0deca;
    --kb-accent-soft: #354f44;
    --kb-code-bg: #28312f;
    --kb-code-text: #edf4f1;
}
body.kb-article-refresh main *,
body.kb-article-refresh main *::before,
body.kb-article-refresh main *::after { box-sizing: border-box; letter-spacing: 0; }
html[data-nav-experiment="floating"] body.kb-article-refresh nav.site-nav:not(.is-scrolled) {
    --masthead-ink: var(--kb-hero-text);
    --masthead-muted: var(--kb-hero-muted);
    --masthead-line: var(--kb-card-border);
    --masthead-surface: var(--kb-hero-bg);
    --masthead-blur: none;
}
body.kb-article-refresh .kb-article-hero { padding: 156px 0 52px; border-bottom: 1px solid var(--kb-card-border); }
body.kb-article-refresh .kb-article-hero::before,
body.kb-article-refresh .kb-article-hero::after,
body.kb-article-refresh .hero-content::before,
body.kb-article-refresh .hero-content::after { display: none; }
body.kb-article-refresh .kb-article-hero .hero-content { text-align: left; padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; backdrop-filter: none; }
body.kb-article-refresh .kb-article-hero .container,
body.kb-article-refresh .kb-article .container { width: min(100% - 64px, 860px); max-width: 860px; margin-inline: auto; padding-inline: 0; }
body.kb-article-refresh .article-hero-title { font-size: 48px; font-weight: 400; line-height: 1.2; text-align: left; overflow-wrap: anywhere; margin: 24px 0; }
body.kb-article-refresh .kb-breadcrumb { flex-wrap: wrap; font: 14px/1.6 Inter, sans-serif; }
body.kb-article-refresh .kb-breadcrumb .current { overflow-wrap: anywhere; }
body.kb-article-refresh .article-hero-meta { margin-bottom: 0; gap: 16px 24px; }
body.kb-article-refresh .article-hero-meta .meta-item { font: 14px/1.6 Inter, sans-serif; }
body.kb-article-refresh .article-hero-tags { margin: 22px 0 0; }
body.kb-article-refresh .hero-tag,
body.kb-article-refresh .hero-edit-btn { background: var(--kb-accent-soft); color: var(--kb-accent); border: 1px solid var(--kb-card-border); border-radius: 4px; box-shadow: none; }
body.kb-article-refresh .kb-article { margin: 0; padding: 0; border: 0; border-radius: 0; box-shadow: none; }
body.kb-article-refresh .kb-article .container { padding-block: 48px; }
body.kb-article-refresh .kb-article-body { font: 18px/1.8 Inter, sans-serif; color: var(--kb-text); overflow-wrap: anywhere; }
body.kb-article-refresh .kb-article-body > :first-child { margin-top: 0; }
body.kb-article-refresh .kb-article-body :where(h1,h2,h3,h4) { font-family: "Avenir Next", Inter, sans-serif; font-weight: 500; line-height: 1.35; }
body.kb-article-refresh .kb-article-body :where(strong,b) { font-weight: 650; text-shadow: none; }
body.kb-article-refresh .kb-article-body a { color: var(--kb-accent); text-decoration: underline; text-underline-offset: 3px; }
body.kb-article-refresh .kb-article-body pre { max-width: 100%; overflow: auto; border: 1px solid var(--kb-card-border); border-radius: 6px; }
body.kb-article-refresh .kb-article-body table { display: block; width: 100%; max-width: 100%; overflow-x: auto; border-collapse: collapse; font-size: 16px; margin-block: 24px; }
body.kb-article-refresh .kb-article-body :where(th,td) { min-width: 150px; padding: 12px 16px; border: 1px solid var(--kb-card-border); text-align: left; vertical-align: top; }
body.kb-article-refresh .kb-article-body th { background: var(--kb-section-alt-bg); color: var(--kb-text); font-weight: 600; }
body.kb-article-refresh .kb-article-body img { border: 1px solid var(--kb-card-border); border-radius: 6px; box-shadow: none; }
body.kb-article-refresh .kb-article-feedback { border: 0; border-top: 1px solid var(--kb-card-border); border-radius: 0; box-shadow: none; padding-inline: 0; }
body.kb-article-refresh main [hidden] { display: none !important; }
@media (max-width: 640px) {
    body.kb-article-refresh .kb-article-hero { padding-block: 128px 40px; }
    body.kb-article-refresh .kb-article-hero .container,
    body.kb-article-refresh .kb-article .container { width: calc(100% - 40px); }
    body.kb-article-refresh .article-hero-title { font-size: 34px; }
    body.kb-article-refresh .kb-article-body { font-size: 17px; }
    body.kb-article-refresh .kb-article-body h2 { font-size: 27px; }
}

html[data-theme="dark"] body.kb-page {
    --kb-page-bg: #08111F;
    --kb-section-bg: #08111F;
    --kb-section-alt-bg: #0D1728;
    --kb-card-bg: rgba(17, 28, 50, 0.92);
    --kb-card-border: rgba(148, 163, 184, 0.18);
    --kb-card-shadow: 0 18px 46px rgba(2, 6, 23, 0.36);
    --kb-card-hover-shadow: 0 26px 64px rgba(2, 6, 23, 0.5);
    --kb-text: #F5F7FA;
    --kb-muted: #B8C4D4;
    --kb-soft: rgba(148, 163, 184, 0.12);
    --kb-hero-bg: linear-gradient(135deg, #07101F 0%, #111C32 48%, #59471A 100%);
    --kb-hero-text: #F8FAFC;
    --kb-hero-muted: rgba(226, 232, 240, 0.82);
    --kb-accent: #F3C969;
    --kb-accent-strong: #F7D983;
    --kb-accent-soft: rgba(247, 217, 131, 0.14);
    --kb-control-bg: rgba(15, 23, 42, 0.92);
    --kb-control-border: rgba(148, 163, 184, 0.22);
    --kb-code-bg: rgba(15, 23, 42, 0.88);
    --kb-code-text: #E5EDF7;
    --kb-feedback-btn-bg: rgba(15, 23, 42, 0.78);
    --kb-feedback-btn-border: rgba(148, 163, 184, 0.28);
    --kb-feedback-btn-text: #F8FAFC;
    --kb-feedback-btn-hover-bg: rgba(30, 41, 59, 0.96);
    --kb-feedback-btn-shadow: 0 12px 28px rgba(2, 6, 23, 0.24);
}

.kb-article-content,
.kb-home-content {
    /* Remove default padding/margin since we're using the knowledge-base.css styles */
}

/* Search suggestions dropdown (keep this as it's specific to kb-viewer) */

/* Keep search suggestions specific to kb-viewer */

/* Search Suggestions */
.search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 8px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    display: none;
    z-index: 100;
}

.suggestion-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    text-decoration: none;
    color: #1F2937;
    transition: background 0.2s ease;
}

.suggestion-item:hover {
    background: #F3F4F6;
}

.suggestion-item:first-child {
    border-radius: 12px 12px 0 0;
}

.suggestion-item:last-child {
    border-radius: 0 0 12px 12px;
}

.suggestion-type {
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 500;
}

.suggestion-article .suggestion-type {
    background: #DBEAFE;
    color: #1E40AF;
}

.suggestion-category .suggestion-type {
    background: #E0E7FF;
    color: #4338CA;
}

.suggestion-tag .suggestion-type {
    background: #FEF3C7;
    color: #B45309;
}

/* Categories Grid */
.kb-categories {
    margin-bottom: 60px;
}

.kb-categories h2 {
    font-size: 32px;
    margin-bottom: 32px;
    color: #1F2937;
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
}

.category-card {
    background: white;
    border-radius: 12px;
    padding: 32px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.category-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(135deg, #1E3A8A, #7C3AED);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.category-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.category-card:hover::before {
    transform: scaleX(1);
}

.category-icon {
    font-size: 48px;
    display: block;
    margin-bottom: 16px;
}

.category-card h3 {
    font-size: 24px;
    margin-bottom: 8px;
    color: #1F2937;
}

.category-card p {
    color: #6B7280;
    margin-bottom: 16px;
}

.article-count {
    font-size: 14px;
    color: #9CA3AF;
    font-weight: 500;
}

/* Articles List */
.articles-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.article-item {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease;
}

.article-item:hover {
    transform: translateX(8px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.article-item h3 {
    font-size: 20px;
    margin-bottom: 8px;
    color: #1F2937;
}

.article-item p {
    color: #6B7280;
    margin-bottom: 12px;
    line-height: 1.6;
}

.article-meta {
    display: flex;
    gap: 16px;
    font-size: 14px;
    color: #9CA3AF;
}

.article-meta .category {
    color: #7C3AED;
    font-weight: 500;
}

/* Tags Cloud */
.kb-popular-tags {
    margin-top: 60px;
}

.tags-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    padding: 40px;
    background: white;
    border-radius: 12px;
}

.tag-item {
    padding: 8px 16px;
    background: #F3F4F6;
    border-radius: 20px;
    text-decoration: none;
    color: #4B5563;
    transition: all 0.2s ease;
}

.tag-item:hover {
    background: #7C3AED;
    color: white;
    transform: scale(1.1);
}

/* Article View */
.kb-article {
    background: white;
    border-radius: 16px;
    padding: 48px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.kb-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 24px;
    font-size: 14px;
}

.kb-breadcrumb a {
    color: #6B7280;
    text-decoration: none;
}

.kb-breadcrumb a:hover {
    color: #7C3AED;
}

.kb-breadcrumb .separator {
    color: #D1D5DB;
}

.kb-breadcrumb .current {
    color: #1F2937;
    font-weight: 500;
}

.kb-article-title {
    font-size: 48px;
    font-weight: 700;
    color: #1F2937;
    margin-bottom: 24px;
    line-height: 1.2;
}

.kb-article-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    color: #6B7280;
    font-size: 14px;
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid #E5E7EB;
}

.kb-article-tags {
    display: flex;
    gap: 8px;
    margin-top: 16px;
}

.kb-tag {
    padding: 6px 12px;
    background: #EEF2FF;
    color: #4338CA;
    border-radius: 16px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.kb-tag:hover {
    background: #4338CA;
    color: white;
}

/* Article Body */
.kb-article-body {
    font-size: 18px;
    line-height: 1.8;
    color: #374151;
    margin-bottom: 48px;
}

.kb-article-body h1,
.kb-article-body h2,
.kb-article-body h3,
.kb-article-body h4 {
    margin-top: 32px;
    margin-bottom: 16px;
    color: #1F2937;
}

.kb-article-body h2 {
    font-size: 32px;
    padding-bottom: 8px;
    border-bottom: 2px solid #E5E7EB;
}

.kb-article-body h3 {
    font-size: 24px;
}

.kb-article-body p {
    margin-bottom: 16px;
}

.kb-article-body strong,
.kb-article-body b {
    font-weight: 800;
    color: #111827;
    text-shadow: 0.5px 0 0 currentColor;
}

.kb-article-body em,
.kb-article-body i {
    font-style: italic;
}

.kb-article-body img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 24px auto;
    display: block;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

/* Image size classes */
.kb-article-body img[alt*="width:25%"],
.kb-article-body img.w-25 {
    max-width: 25%;
}

.kb-article-body img[alt*="width:50%"],
.kb-article-body img.w-50 {
    max-width: 50%;
}

.kb-article-body img[alt*="width:75%"],
.kb-article-body img.w-75 {
    max-width: 75%;
}

.kb-article-body img[alt*="width:100%"],
.kb-article-body img.w-100 {
    max-width: 100%;
}

/* Allow custom width in alt text */
.kb-article-body img[alt*="width:"] {
    /* This will be overridden by inline styles from the renderer */
}

.kb-article-body ul,
.kb-article-body ol {
    margin-bottom: 16px;
    padding-left: 32px;
}

.kb-article-body li {
    margin-bottom: 8px;
}

.kb-article-body code {
    background: #F3F4F6;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Fira Code', monospace;
    font-size: 0.9em;
}

.kb-article-body pre {
    background: #1F2937;
    color: #E5E7EB;
    padding: 24px;
    border-radius: 8px;
    overflow-x: auto;
    margin-bottom: 24px;
}

.kb-article-body .code-block-wrapper {
    margin: 24px 0;
}

.kb-article-body .code-block-wrapper pre {
    margin: 0;
}

.kb-article-body pre code {
    background: none;
    padding: 0;
    color: inherit;
}

.kb-article-body blockquote {
    border-left: 4px solid #7C3AED;
    padding-left: 24px;
    margin: 24px 0;
    font-style: italic;
    color: #6B7280;
}

.kb-article-body a {
    color: #7C3AED;
    text-decoration: none;
    border-bottom: 2px solid transparent;
    transition: border-color 0.2s ease;
}

.kb-article-body a:hover {
    border-bottom-color: #7C3AED;
}

/* Related Articles */
.kb-related-articles {
    margin-top: 48px;
    padding-top: 48px;
    border-top: 1px solid #E5E7EB;
}

.kb-related-articles h3 {
    font-size: 24px;
    margin-bottom: 24px;
    color: #1F2937;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
}

.related-item {
    background: #F9FAFB;
    padding: 24px;
    border-radius: 12px;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease;
}

.related-item:hover {
    background: #F3F4F6;
    transform: translateY(-2px);
}

.related-item h4 {
    font-size: 18px;
    margin-bottom: 8px;
    color: #1F2937;
}

.related-item p {
    color: #6B7280;
    font-size: 14px;
    line-height: 1.6;
}

/* Feedback Section */
.kb-article-feedback {
    margin-top: 48px;
    padding: 32px;
    background: #F9FAFB;
    border-radius: 12px;
    text-align: center;
}

.kb-article-feedback h3 {
    font-size: 20px;
    margin-bottom: 16px;
    color: #1F2937;
}

.feedback-buttons {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

.feedback-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 128px;
    min-height: 48px;
    padding: 12px 24px;
    border: 1px solid var(--kb-feedback-btn-border);
    background: var(--kb-feedback-btn-bg);
    color: var(--kb-feedback-btn-text);
    border-radius: 10px;
    font-size: 16px;
    font-weight: 500;
    line-height: 1;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: var(--kb-feedback-btn-shadow);
}

.feedback-btn:hover {
    background: var(--kb-feedback-btn-hover-bg);
    transform: translateY(-2px);
}

.feedback-btn:focus-visible {
    outline: 3px solid var(--kb-accent-soft);
    outline-offset: 3px;
}

.feedback-btn.helpful:hover {
    background: #10B981;
    color: white;
    border-color: #10B981;
}

.feedback-btn.not-helpful:hover {
    background: #EF4444;
    color: white;
    border-color: #EF4444;
}

.feedback-thanks {
    color: #10B981;
    font-size: 18px;
    font-weight: 500;
}

/* KB Home Hero Section */
.kb-hero {
    padding: 120px 0 80px;
    background: linear-gradient(135deg, #D4AF37 0%, #B8860B 100%);
    color: white;
    position: relative;
    overflow: hidden;
}

.kb-hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 100%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.15) 0%, transparent 70%);
    animation: rotate 30s linear infinite;
}

.kb-hero::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        linear-gradient(rgba(0, 0, 0, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 0, 0, 0.02) 1px, transparent 1px);
    background-size: 50px 50px;
}

.kb-hero .container {
    position: relative;
    z-index: 2;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.kb-hero .hero-content {
    text-align: center;
}

.kb-hero .hero-title {
    font-size: 56px;
    font-weight: 100; /* Ultra-thin weight */
    font-family: 'Avenir Next', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    margin-bottom: 24px;
    line-height: 1.2;
    letter-spacing: -0.03em;
}

.kb-hero .hero-subtitle {
    font-size: 24px;
    font-weight: 300;
    margin-bottom: 48px;
    opacity: 0.9;
}

/* KB Search Box */
.kb-search {
    position: relative;
    max-width: 600px;
    margin: 0 auto;
}

.kb-search-input {
    width: 100%;
    padding: 16px 24px 16px 56px;
    font-size: 18px;
    border: none;
    border-radius: 50px;
    background: white;
    color: #1F2937;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.3s ease;
}

.kb-search-input:focus {
    outline: none;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
}

.kb-search-input::placeholder {
    color: #9CA3AF;
}

.kb-search .search-icon {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: #6B7280;
    pointer-events: none;
}

/* Article Hero Section */
.kb-article-hero {
    padding: 120px 0 80px;
    background: linear-gradient(135deg, #D4AF37 0%, #B8860B 100%);
    color: white;
    position: relative;
    overflow: hidden;
}

.kb-article-hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 100%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.15) 0%, transparent 70%);
    animation: rotate 30s linear infinite;
}

.kb-article-hero::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        linear-gradient(rgba(0, 0, 0, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 0, 0, 0.02) 1px, transparent 1px);
    background-size: 50px 50px;
}

@keyframes rotate {
    to { transform: rotate(360deg); }
}

.kb-article-hero .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.kb-article-hero .hero-content {
    position: relative;
    z-index: 2;
}

.kb-article-hero .kb-breadcrumb {
    opacity: 0.9;
}

.kb-article-hero .kb-breadcrumb a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    transition: color 0.2s ease;
}

.kb-article-hero .kb-breadcrumb a:hover {
    color: white;
}

.kb-article-hero .kb-breadcrumb .separator {
    color: rgba(255, 255, 255, 0.6);
    margin: 0 8px;
}

.kb-article-hero .kb-breadcrumb .current {
    color: rgba(255, 255, 255, 0.8);
}

.article-hero-title {
    font-size: 48px;
    font-weight: 100; /* Ultra-thin weight */
    font-family: 'Avenir Next', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    margin-bottom: 32px;
    line-height: 1.2;
    letter-spacing: -0.03em;
}

.article-hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    margin-bottom: 24px;
}

.article-hero-meta .meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 16px;
}

.article-hero-meta svg {
    opacity: 0.8;
}

.article-hero-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 24px;
}

.hero-tag {
    padding: 6px 16px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    color: white;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.hero-tag:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-1px);
}

.article-hero-actions {
    margin-top: 32px;
}

.hero-edit-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
}

.hero-edit-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-2px);
}

/* Update article container */
.kb-article {
    background: white;
    margin-top: -40px;
    position: relative;
    z-index: 2;
    border-radius: 24px 24px 0 0;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
}

.kb-article .container {
    max-width: 800px;
    margin: 0 auto;
    padding: 60px 40px;
}

/* Remove old header styles */
.kb-article-header {
    display: none;
}

/* Error States */
.kb-error {
    text-align: center;
    padding: 80px 20px;
}

.kb-error h1 {
    font-size: 36px;
    color: #1F2937;
    margin-bottom: 16px;
}

.kb-error p {
    font-size: 18px;
    color: #6B7280;
    margin-bottom: 32px;
}

.kb-error .btn {
    display: inline-block;
    padding: 12px 32px;
    background: #7C3AED;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.kb-error .btn:hover {
    background: #6D28D9;
    transform: translateY(-2px);
}

/* Articles Section */
.kb-articles-section {
    padding: 80px 0;
    background: #F9FAFB;
}

.kb-articles-section .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.kb-articles-section .section-title {
    font-size: 36px;
    font-weight: 700;
    color: #1F2937;
    margin-bottom: 48px;
    text-align: center;
}

/* Articles Grid */
.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 32px;
}

/* Article Card */
.article-card {
    background: white;
    border-radius: 16px;
    padding: 32px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.article-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1);
}

.article-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    font-size: 14px;
    color: #6B7280;
}

.article-category {
    background: #F3F4F6;
    color: #4B5563;
    padding: 4px 12px;
    border-radius: 12px;
    font-weight: 500;
}

.article-date {
    color: #9CA3AF;
}

.article-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 16px;
    line-height: 1.3;
}

.article-title a {
    color: #1F2937;
    text-decoration: none;
    transition: color 0.2s ease;
}

.article-title a:hover {
    color: #7C3AED;
}

.article-excerpt {
    color: #4B5563;
    line-height: 1.6;
    margin-bottom: 24px;
    flex-grow: 1;
}

.article-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #7C3AED;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s ease;
}

.article-link:hover {
    gap: 12px;
    color: #6B21A8;
}

.article-link svg {
    transition: transform 0.2s ease;
}

.article-link:hover svg {
    transform: translateX(4px);
}

/* Popular Tags Section */
.kb-popular-tags {
    padding: 60px 0;
    text-align: center;
    max-width: 1200px;
    margin: 0 auto;
    padding-left: 24px;
    padding-right: 24px;
}

.kb-popular-tags h2 {
    font-size: 32px;
    font-weight: 700;
    color: #1F2937;
    margin-bottom: 32px;
}

.tags-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    justify-content: center;
}

.tag-item {
    display: inline-block;
    padding: 8px 20px;
    background: #F3F4F6;
    color: #4B5563;
    border-radius: 24px;
    text-decoration: none;
    transition: all 0.3s ease;
    font-weight: 500;
}

.tag-item:hover {
    background: #7C3AED;
    color: white;
    transform: scale(1.05);
}

/* Theme-aware KB viewer */
body.kb-page .kb-main,
body.kb-page .kb-home-content,
body.kb-page .kb-article-content {
    background: var(--kb-page-bg);
    color: var(--kb-text);
}

body.kb-page .kb-hero,
body.kb-page .kb-article-hero {
    background: var(--kb-hero-bg);
    color: var(--kb-hero-text);
}

body.kb-page .kb-hero .hero-title,
body.kb-page .article-hero-title {
    color: var(--kb-hero-text);
}

body.kb-page .kb-hero .hero-subtitle,
body.kb-page .article-hero-meta .meta-item,
body.kb-page .kb-article-hero .kb-breadcrumb a,
body.kb-page .kb-article-hero .kb-breadcrumb .separator,
body.kb-page .kb-article-hero .kb-breadcrumb .current,
body.kb-page .kb-hero .kb-breadcrumb a,
body.kb-page .kb-hero .kb-breadcrumb .separator,
body.kb-page .kb-hero .kb-breadcrumb .current,
body.kb-page .hero-back-link {
    color: var(--kb-hero-muted);
}

body.kb-page .kb-categories,
body.kb-page .kb-popular-tags {
    color: var(--kb-text);
}

body.kb-page .kb-articles-section {
    background: var(--kb-section-alt-bg);
}

body.kb-page .category-card,
body.kb-page .article-item,
body.kb-page .tags-cloud,
body.kb-page .kb-article,
body.kb-page .related-item,
body.kb-page .kb-article-feedback,
body.kb-page .article-card,
body.kb-page .search-suggestions {
    background: var(--kb-card-bg);
    border: 1px solid var(--kb-card-border);
    box-shadow: var(--kb-card-shadow);
}

body.kb-page .category-card:hover,
body.kb-page .article-item:hover,
body.kb-page .related-item:hover,
body.kb-page .article-card:hover {
    border-color: rgba(212, 175, 55, 0.55);
    box-shadow: var(--kb-card-hover-shadow);
}

body.kb-page .kb-categories h2,
body.kb-page .category-card h3,
body.kb-page .article-item h3,
body.kb-page .kb-breadcrumb .current,
body.kb-page .kb-article-title,
body.kb-page .kb-article-body,
body.kb-page .kb-article-body h1,
body.kb-page .kb-article-body h2,
body.kb-page .kb-article-body h3,
body.kb-page .kb-article-body h4,
body.kb-page .kb-article-body strong,
body.kb-page .kb-article-body b,
body.kb-page .kb-related-articles h3,
body.kb-page .related-item h4,
body.kb-page .kb-article-feedback h3,
body.kb-page .kb-error h1,
body.kb-page .kb-articles-section .section-title,
body.kb-page .article-title a,
body.kb-page .kb-popular-tags h2 {
    color: var(--kb-text);
}

body.kb-page .category-card p,
body.kb-page .article-item p,
body.kb-page .article-meta,
body.kb-page .kb-breadcrumb a,
body.kb-page .kb-breadcrumb .separator,
body.kb-page .kb-article-meta,
body.kb-page .kb-article-body,
body.kb-page .kb-article-body blockquote,
body.kb-page .related-item p,
body.kb-page .kb-error p,
body.kb-page .article-date,
body.kb-page .article-excerpt,
body.kb-page .tag-item {
    color: var(--kb-muted);
}

body.kb-page .hero-back-link {
    text-decoration: underline;
    text-underline-offset: 0.18em;
}

body.kb-page .hero-back-link:hover,
body.kb-page .kb-hero .kb-breadcrumb a:hover {
    color: var(--kb-hero-text);
}

body.kb-page .kb-empty-message {
    color: var(--kb-muted);
}

body.kb-page .kb-return-btn {
    display: inline-block;
    padding: 12px 24px;
    background: #1E3A8A;
    color: #FFFFFF;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
}

html[data-theme="dark"] body.kb-page .kb-return-btn {
    background: var(--kb-accent);
    color: #08111F;
}

body.kb-page .kb-search-input {
    background: var(--kb-control-bg);
    border: 1px solid var(--kb-control-border);
    color: var(--kb-text);
}

body.kb-page .kb-search-input::placeholder {
    color: var(--kb-muted);
}

body.kb-page .kb-search .search-icon {
    color: var(--kb-muted);
}

body.kb-page .suggestion-item {
    color: var(--kb-text);
}

body.kb-page .suggestion-item:hover,
body.kb-page .related-item:hover {
    background: var(--kb-section-alt-bg);
}

body.kb-page .article-meta .category,
body.kb-page .article-category,
body.kb-page .kb-tag,
body.kb-page .tag-item {
    background: var(--kb-accent-soft);
    color: var(--kb-accent);
}

body.kb-page .kb-tag:hover,
body.kb-page .tag-item:hover {
    background: var(--kb-accent);
    color: #08111F;
}

body.kb-page .kb-article-meta,
body.kb-page .kb-related-articles,
body.kb-page .kb-article-body h2 {
    border-color: var(--kb-card-border);
}

body.kb-page .kb-article-body code,
body.kb-page .kb-article-body pre {
    background: var(--kb-code-bg);
    color: var(--kb-code-text);
}

body.kb-page .kb-article-body blockquote {
    border-left-color: var(--kb-accent);
}

/* Responsive Design */
@media (max-width: 768px) {
    .kb-hero h1 {
        font-size: 36px;
    }
    
    .kb-hero p {
        font-size: 18px;
    }
    
    .articles-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    
    .article-card {
        padding: 24px;
    }
    
    .article-title {
        font-size: 20px;
    }
    
    .kb-articles-section .section-title {
        font-size: 28px;
    }
    
    .kb-article-hero {
        padding: 80px 0 60px;
    }
    
    .article-hero-title {
        font-size: 36px;
    }
    
    .article-hero-meta {
        font-size: 14px;
        gap: 16px;
    }
    
    .article-hero-meta .meta-item {
        font-size: 14px;
    }
    
    .kb-article .container {
        padding: 40px 24px;
    }
    
    .kb-article-body {
        font-size: 16px;
    }
    
    .categories-grid {
        grid-template-columns: 1fr;
    }
}
