:root {
    --resources-ink: #111827;
    --resources-muted: #6b7280;
    --resources-border: #e5e7eb;
    --resources-soft: #f8fafc;
}

.wiki-container {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr) 280px;
    gap: 1.5rem;
    max-width: 1240px;
    margin: 2.5rem auto 0;
    padding: 0 1.5rem 2.5rem;
}

.resources-page {
    max-width: 1180px;
    margin: 2.5rem auto 0;
    padding: 0 1.5rem 2.5rem;
}

.tools-page .wiki-container,
.blog-page .wiki-container {
    grid-template-columns: 1fr;
    max-width: 1180px;
    margin: 2.5rem auto 0;
    padding: 0 1.5rem 2.5rem;
}

.tools-page .wiki-sidebar,
.blog-page .wiki-sidebar,
.blog-page .wiki-tools {
    display: none;
}

.tools-page .wiki-header,
.blog-page .wiki-header {
    background: linear-gradient(180deg, var(--resources-soft) 0%, #ffffff 100%);
    border: 1px solid #eef0f3;
    border-radius: 18px;
    padding: 2.5rem;
    margin-bottom: 1.5rem;
}

.tools-page .wiki-main {
    background: #ffffff;
    border: 1px solid var(--resources-border);
    border-radius: 18px;
    padding: 2rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.tools-page .wiki-card,
.tools-page .card {
    background: #ffffff;
    border: 1px solid var(--resources-border);
    border-radius: 16px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.tools-page .wiki-tool-card {
    background: #ffffff;
    border: 1px solid var(--resources-border);
    border-radius: 16px;
    padding: 1.5rem;
    height: 100%;
}

.tools-page .wiki-tool-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.tools-page .wiki-tool-header h3 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--resources-ink);
}

.tools-page .wiki-tool-body p {
    color: var(--resources-muted);
}

.tools-page .wiki-badge {
    background: var(--resources-soft);
    border: 1px solid var(--resources-border);
    color: var(--resources-ink);
    font-weight: 600;
    border-radius: 999px;
    padding: 0.2rem 0.65rem;
    font-size: 0.75rem;
}

.tools-page .btn-primary,
.blog-page .btn-primary,
.resources-page .btn-primary {
    background: #111827 !important;
    border: 1px solid #111827 !important;
    color: #ffffff !important;
    border-radius: 12px !important;
    font-weight: 600;
}

.tools-page .btn-primary:hover,
.blog-page .btn-primary:hover,
.resources-page .btn-primary:hover {
    background: #0b0f1a !important;
    border-color: #0b0f1a !important;
}

.tools-page .btn-secondary {
    background: #f1f5f9;
    border: 1px solid var(--resources-border);
    color: #111827;
    border-radius: 12px;
    font-weight: 600;
}

.tools-page .btn-secondary:hover {
    background: #e2e8f0;
}

.tools-page .form-control,
.tools-page .form-select,
.tools-page textarea {
    border-radius: 12px;
    border: 1px solid var(--resources-border);
    background: #ffffff;
}

.tools-page .form-control:focus,
.tools-page .form-select:focus,
.tools-page textarea:focus {
    border-color: #111827;
    box-shadow: 0 0 0 0.2rem rgba(17, 24, 39, 0.15);
}

.tools-page .wiki-stat-card {
    border: 1px solid var(--resources-border);
    border-radius: 16px;
    padding: 1rem;
    background: #ffffff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.tools-page .wiki-card,
.blog-page .wiki-card {
    background: #ffffff;
    border: 1px solid var(--resources-border);
    border-radius: 16px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.blog-page .post-meta {
    color: var(--resources-muted) !important;
}

.blog-page .post-meta i {
    color: #111827;
}

.resources-main {
    padding: 2.5rem;
}

.wiki-sidebar,
.wiki-main,
.wiki-tools {
    background: #ffffff;
    border: 1px solid var(--resources-border);
    border-radius: 18px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.wiki-main {
    padding: 2rem;
}

.resources-hero {
    background: linear-gradient(180deg, var(--resources-soft) 0%, #ffffff 100%);
    border: 1px solid #eef0f3;
    border-radius: 18px;
    padding: 2.5rem;
}

.hero-eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.2em;
    font-size: 0.7rem;
    color: var(--resources-muted);
    margin-bottom: 0.75rem;
}

.section-title {
    font-size: 1.85rem;
    letter-spacing: -0.02em;
    margin-bottom: 0.5rem;
    color: var(--resources-ink);
}

.section-subtitle {
    color: var(--resources-muted);
    max-width: 680px;
}

.card-soft {
    background: #ffffff;
    border: 1px solid var(--resources-border);
    border-radius: 16px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.resource-grid {
    display: grid;
    gap: 1.25rem;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.resource-grid--featured {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.resource-grid--compact {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.resource-card {
    padding: 1.5rem;
    height: 100%;
}

.resource-card--featured {
    border-left: 4px solid #111827;
    padding: 1.75rem;
}

.resource-card--compact {
    padding: 1.25rem;
}

.resource-card-top {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.resource-count {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--resources-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.resource-card h3,
.resource-card h4 {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--resources-ink);
    margin-bottom: 0.75rem;
}

.resource-card p {
    color: var(--resources-muted);
    margin-bottom: 1rem;
}

.wiki-category-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--resources-soft);
    border: 1px solid var(--resources-border);
    color: var(--resources-ink);
}

.wiki-category-icon i {
    font-size: 1.1rem;
}

.resource-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    color: var(--resources-muted);
    font-size: 0.9rem;
}

.resources-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.resources-filters {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-radius: 16px;
    border: 1px solid var(--resources-border);
    background: #ffffff;
}

.filter-label {
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 0.14em;
    color: var(--resources-muted);
    font-weight: 700;
}

.filter-pill {
    border: 1px solid var(--resources-border);
    background: #ffffff;
    color: var(--resources-ink);
    padding: 0.35rem 0.9rem;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

.filter-pill:hover,
.filter-pill.is-active {
    background: #111827;
    color: #ffffff;
    border-color: #111827;
}

.cta-panel {
    background: #ffffff;
    border: 1px solid var(--resources-border);
    border-radius: 16px;
    padding: 2rem;
    text-align: center;
}

.cta-panel .section-title,
.cta-panel .section-subtitle {
    text-align: center;
}

.cta-panel .section-subtitle {
    margin-left: auto;
    margin-right: auto;
}

.cta-dark {
    background: #111827;
    border: 1px solid #111827;
    color: #ffffff !important;
}

.cta-dark:hover {
    background: #0b0f1a;
    border-color: #0b0f1a;
}

.cta-outline {
    border: 1px solid #111827;
    color: #111827 !important;
}

.cta-outline:hover {
    background: #111827;
    color: #ffffff !important;
}

.wiki-nav-title {
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-size: 0.7rem;
    color: var(--resources-muted);
    border-bottom: 1px solid var(--resources-border);
    padding-bottom: 0.5rem;
    margin-bottom: 0.75rem;
}

.wiki-link {
    color: #374151;
    border-radius: 0.5rem;
    padding: 0.45rem 0.6rem;
}

.wiki-link:hover {
    color: #111827;
    background: var(--resources-soft);
    border-color: transparent;
}

.wiki-link.active {
    background: #111827;
    border-color: #111827;
    color: #ffffff;
}

.wiki-header .wiki-title {
    font-size: 2.1rem;
    font-weight: 700;
    color: var(--resources-ink);
}

.wiki-intro {
    color: var(--resources-muted);
    font-size: 1rem;
}

.resources-page .markdown-content code {
    background: #f1f5f9;
    border: 1px solid var(--resources-border);
    color: #0f172a;
    border-radius: 6px;
}

.resources-page .markdown-content pre {
    background: #0f172a;
    border: 1px solid #1f2937;
    color: #e2e8f0;
    border-radius: 12px;
}

.resources-page .markdown-content pre code {
    color: inherit;
}

.blog-page .markdown-content code {
    background: #f1f5f9;
    border: 1px solid var(--resources-border);
    color: #0f172a;
    border-radius: 6px;
}

.blog-page .markdown-content pre {
    background: #0f172a;
    border: 1px solid #1f2937;
    color: #e2e8f0;
    border-radius: 12px;
}

.blog-page .markdown-content pre code {
    color: inherit;
}

.resources-page .wiki-code pre {
    background: transparent;
    border: none;
    color: #e2e8f0;
    padding: 0;
}

.resources-page .wiki-code pre code {
    color: inherit;
}

.wiki-code {
    position: relative;
    margin-top: 1.5rem;
    border-radius: 12px;
    border: 1px solid var(--resources-border);
    background: #0f172a;
    color: #e2e8f0;
    padding: 1.25rem;
}

.tutorial-cta {
    margin-top: 2rem;
}

.tutorial-cta-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    flex-wrap: wrap;
    padding: 1.75rem;
    border-radius: 16px;
    border: 1px solid var(--resources-border);
    background: #ffffff;
}

.tutorial-cta-card h3 {
    margin-bottom: 0.4rem;
    font-size: 1.2rem;
    color: var(--resources-ink);
}

.tutorial-cta-card p {
    margin-bottom: 0;
    color: var(--resources-muted);
}

.legal-page {
    max-width: 920px;
    margin: 2.5rem auto 0;
    padding: 0 1.5rem 2.5rem;
}

.legal-main {
    padding: 2.25rem;
}

.legal-card {
    padding: 2rem;
}

.legal-content h2 {
    font-size: 1.4rem;
    margin-top: 1.75rem;
    color: var(--resources-ink);
}

.legal-content h3 {
    font-size: 1.05rem;
    margin-top: 1rem;
    color: var(--resources-ink);
}

.legal-content ul {
    padding-left: 1.1rem;
    color: var(--resources-muted);
}

.legal-content p {
    color: var(--resources-muted);
}

.legal-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.legal-links a {
    border: 1px solid var(--resources-border);
    border-radius: 999px;
    padding: 0.4rem 0.95rem;
    color: var(--resources-ink);
    text-decoration: none;
    font-size: 0.9rem;
}

.legal-links a:hover {
    background: #111827;
    color: #ffffff;
    border-color: #111827;
}

.wiki-code pre {
    margin: 0;
}

.copy-button {
    background: #111827;
}

.progress-bar {
    height: 6px;
    border-radius: 999px;
}

.progress-fill {
    border-radius: 999px;
}

.mobile-section-nav select {
    width: 100%;
    padding: 0.65rem 0.9rem;
    border-radius: 10px;
    border: 1px solid var(--resources-border);
    background: #ffffff;
}

.wiki-empty-state {
    text-align: center;
    padding: 2.5rem 1.5rem;
    border: 1px dashed var(--resources-border);
    border-radius: 16px;
    background: #ffffff;
    color: var(--resources-muted);
}

.wiki-empty-state h3 {
    color: var(--resources-ink);
    margin-top: 1rem;
}

@media (max-width: 1200px) {
    .wiki-container {
        grid-template-columns: 220px minmax(0, 1fr);
    }

    .wiki-tools {
        display: none;
    }
}

@media (max-width: 900px) {
    .wiki-container {
        grid-template-columns: 1fr;
        padding: 0 1rem 2rem;
    }

    .wiki-sidebar {
        display: none;
    }

    .wiki-main {
        padding: 1.5rem;
    }

    .resources-hero {
        padding: 2rem;
    }

    .resources-page {
        padding: 0 1rem 2rem;
    }

    .resources-main {
        padding: 1.5rem;
    }

    .resources-header {
        flex-direction: column;
        align-items: flex-start;
    }
}
