/**
 * NT KERNEL Next - Documentation UI V1 Stylesheet
 * Scoped strictly under .ntk-docs to prevent any style leakage into the main site.
 *
 * @package NTKernelNext
 * @version 1.0.0
 */

/* ==========================================================================
   Documentation Layout Container
   ========================================================================== */
.ntk-docs-site-wrap {
    width: 100%;
    background-color: var(--color-surface-bg, #FFFFFF);
    min-height: calc(100vh - 180px);
}

.ntk-docs {
    max-width: 1340px;
    margin: 0 auto;
    padding: 1.5rem 1.5rem 4rem;
    font-family: var(--font-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);
    color: var(--color-text-secondary, #334155);
    line-height: 1.6;
    box-sizing: border-box;
}

article.docspress-single,
article.ntk-docs-article {
    display: block;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.ntk-docs-layout {
    display: flex;
    gap: 2.5rem;
    align-items: flex-start;
    position: relative;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.ntk-docs-main,
.ntk-docs-main.docspress-single-content {
    flex: 1 1 0%;
    min-width: 0;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 0;
}

/* ==========================================================================
   Mobile Action Bar (Visible <= 1024px)
   ========================================================================== */
.ntk-docs-mobile-bar {
    display: none;
    gap: 0.75rem;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    margin-bottom: 1.5rem;
    background: var(--color-surface-subtle, #F8FAFC);
    border: 1px solid var(--color-border-subtle, #E2E8F0);
    border-radius: var(--radius-md, 6px);
}

.ntk-docs-drawer-btn,
.ntk-docs-search-trigger-mobile {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.85rem;
    background: #FFFFFF;
    border: 1px solid var(--color-border-strong, #CBD5E1);
    border-radius: var(--radius-sm, 4px);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-text-primary, #0F172A);
    cursor: pointer;
    transition: all 0.15s ease;
}

.ntk-docs-drawer-btn:hover,
.ntk-docs-search-trigger-mobile:hover {
    border-color: var(--color-accent-primary, #0284C7);
    color: var(--color-accent-hover, #0369A1);
    background: var(--color-accent-subtle, #F0F9FF);
}

.ntk-docs-drawer-btn svg,
.ntk-docs-search-trigger-mobile svg {
    color: var(--color-text-muted, #64748B);
    flex-shrink: 0;
}

/* ==========================================================================
   Sidebar Navigation Column
   ========================================================================== */
.ntk-docs-sidebar {
    width: 280px;
    flex: 0 0 280px;
    max-width: 280px;
    position: sticky;
    top: 80px;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 0.75rem;
    border-right: 1px solid var(--color-border-subtle, #E2E8F0);
}

/* Custom subtle scrollbar */
.ntk-docs-sidebar::-webkit-scrollbar {
    width: 5px;
}
.ntk-docs-sidebar::-webkit-scrollbar-track {
    background: transparent;
}
.ntk-docs-sidebar::-webkit-scrollbar-thumb {
    background: var(--color-border-strong, #CBD5E1);
    border-radius: 3px;
}
.ntk-docs-sidebar::-webkit-scrollbar-thumb:hover {
    background: var(--color-text-muted, #64748B);
}

.ntk-docs-drawer-header {
    display: none;
}

/* Sidebar Brand / Identity */
.ntk-docs-sidebar-brand {
    padding-bottom: 0.85rem;
    margin-bottom: 0.85rem;
    border-bottom: 1px solid var(--color-border-subtle, #E2E8F0);
}

.ntk-docs-brand-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    text-decoration: none;
    color: var(--color-text-primary, #0F172A);
    font-weight: 600;
    font-size: 0.9375rem; /* ~15px */
    line-height: 1.4;
}

.ntk-docs-brand-link:hover {
    color: var(--color-accent-hover, #0369A1);
    text-decoration: none;
}

.ntk-docs-badge-version {
    font-size: 0.71875rem; /* ~11.5px */
    font-family: var(--font-mono, monospace);
    font-weight: 600;
    padding: 0.15rem 0.45rem;
    background: var(--color-accent-subtle, #F0F9FF);
    color: var(--color-accent-hover, #0369A1);
    border: 1px solid var(--color-accent-badge-border, #BAE6FD);
    border-radius: var(--radius-pill, 9999px);
}

/* Search Trigger Button */
.ntk-docs-search-trigger-box {
    margin-bottom: 1rem;
}

.ntk-docs-search-trigger {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.75rem;
    background: var(--color-surface-subtle, #F8FAFC);
    border: 1px solid var(--color-border-subtle, #E2E8F0);
    border-radius: var(--radius-sm, 4px);
    color: var(--color-text-muted, #64748B);
    font-size: 0.875rem; /* 14px */
    line-height: 1.4;
    cursor: pointer;
    text-align: left;
    transition: all 0.15s ease;
}

.ntk-docs-search-trigger:hover {
    background: #FFFFFF;
    border-color: var(--color-accent-primary, #0284C7);
    color: var(--color-text-secondary, #334155);
}

.ntk-docs-search-trigger:focus-visible {
    outline: 2px solid var(--color-accent-primary, #0284C7);
    outline-offset: -1px;
}

.ntk-docs-search-label {
    flex: 1;
    font-size: 0.875rem; /* 14px */
}

.ntk-docs-kbd {
    font-family: var(--font-mono, monospace);
    font-size: 0.6875rem; /* 11px */
    background: #FFFFFF;
    border: 1px solid var(--color-border-strong, #CBD5E1);
    border-radius: 3px;
    padding: 0.1rem 0.35rem;
    color: var(--color-text-muted, #64748B);
    box-shadow: 0 1px 1px rgba(0,0,0,0.05);
}

/* Fallback search */
.ntk-docs-fallback-search {
    display: none;
}
.no-js .ntk-docs-fallback-search {
    display: block;
    margin-bottom: 1rem;
}
.no-js .ntk-docs-search-trigger-box {
    display: none;
}
.docspress-search-field {
    font-size: 0.875rem; /* 14px */
    padding: 0.45rem 0.75rem;
    border-radius: var(--radius-sm, 4px);
    border: 1px solid var(--color-border-subtle, #E2E8F0);
}

/* ==========================================================================
   Navigation Tree
   ========================================================================== */
.ntk-docs-nav-tree {
    --docspress--navigation--font-size: 14px;
    font-size: 14px; /* 0.875rem */
    line-height: 1.5;
}

.ntk-nav-list,
.ntk-nav-list ul {
    list-style: none;
    margin: 0;
    padding: 0;
    font-size: 14px;
    line-height: 1.5;
}

.ntk-nav-list > li {
    margin-bottom: 0.35rem;
}

/* Section Header / Parent Item */
.ntk-nav-list > li > a {
    display: block;
    padding: 0.35rem 0.5rem;
    font-size: 0.875rem; /* 14px */
    line-height: 1.5;
    font-weight: 500;
    color: var(--color-text-primary, #0F172A);
    border-radius: var(--radius-sm, 4px);
    text-decoration: none;
    transition: background 0.15s ease, color 0.15s ease;
}

/* Parent sections with children get semibold weight */
.ntk-nav-list > li.page_item_has_children > a {
    font-weight: 600;
}

/* Section/group label (Windows Packet Filter) */
.ntk-nav-list > li.page-item-9899 > a {
    font-size: 0.8125rem; /* ~13px */
    font-weight: 600;
    color: var(--color-text-secondary, #475569);
    letter-spacing: 0.01em;
}

.ntk-nav-list > li > a:hover {
    background: var(--color-surface-subtle, #F8FAFC);
    color: var(--color-accent-hover, #0369A1);
    text-decoration: none;
}

.ntk-nav-list a:focus-visible {
    outline: 2px solid var(--color-accent-primary, #0284C7);
    outline-offset: -1px;
}

/* Sub-items (Child pages) */
.ntk-nav-list .children {
    padding-left: 0.75rem;
    margin-top: 0.25rem;
    margin-bottom: 0.5rem;
    border-left: 1px solid var(--color-border-subtle, #E2E8F0);
}

.ntk-nav-list .children li {
    margin: 0.2rem 0;
}

.ntk-nav-list .children a {
    display: block;
    padding: 0.28rem 0.5rem;
    color: var(--color-text-secondary, #334155);
    text-decoration: none;
    border-radius: var(--radius-sm, 4px);
    font-family: var(--font-mono, monospace);
    font-size: 0.84375rem; /* 13.5px */
    line-height: 1.5;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: background 0.15s ease, color 0.15s ease;
}

.ntk-nav-list .children a:hover {
    background: var(--color-surface-subtle, #F8FAFC);
    color: var(--color-accent-hover, #0369A1);
    text-decoration: none;
}

/* Active Page in Navigation */
.ntk-nav-list li.current_page_item > a {
    background: var(--color-accent-subtle, #F0F9FF);
    color: var(--color-accent-hover, #0369A1);
    font-weight: 600;
    border-left: 3px solid var(--color-accent-primary, #0284C7);
    padding-left: calc(0.5rem - 3px);
}

/* Active Parent Section */
.ntk-nav-list li.current_page_ancestor > a {
    color: var(--color-accent-hover, #0369A1);
    font-weight: 600;
}

/* Child counts superscript */
.ntk-nav-list sup {
    font-size: 0.6875rem; /* 11px */
    color: var(--color-text-muted, #64748B);
    font-weight: 400;
    margin-left: 0.25rem;
    vertical-align: baseline;
    position: relative;
    top: -0.15em;
}

/* Sidebar Footer Links */
.ntk-docs-sidebar-footer {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--color-border-subtle, #E2E8F0);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.ntk-docs-footer-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.84375rem; /* 13.5px */
    line-height: 1.5;
    color: var(--color-text-secondary, #475569);
    text-decoration: none;
    padding: 0.3rem 0;
    transition: color 0.15s ease;
}

.ntk-docs-footer-link:hover {
    color: var(--color-accent-hover, #0369A1);
    text-decoration: none;
}

.ntk-docs-footer-link:focus-visible {
    outline: 2px solid var(--color-accent-primary, #0284C7);
    outline-offset: 1px;
}

.ntk-docs-footer-link svg {
    flex-shrink: 0;
    width: 15px;
    height: 15px;
    color: var(--color-text-muted, #64748B);
    transition: color 0.15s ease;
}

.ntk-docs-footer-link:hover svg {
    color: var(--color-accent-hover, #0369A1);
}

/* ==========================================================================
   Main Content Column
   ========================================================================== */
.ntk-docs-main {
    flex: 1;
    min-width: 0; /* Prevents overflow from code/tables */
}

/* Context & Breadcrumbs Row */
.ntk-docs-header-context {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

.ntk-breadcrumbs {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.35rem;
    list-style: none;
    margin: 0;
    padding: 0;
    font-size: 0.82rem;
    color: var(--color-text-muted, #64748B);
}

.ntk-breadcrumb-item {
    display: inline-flex;
    align-items: center;
}

.ntk-breadcrumb-link {
    color: var(--color-text-muted, #64748B);
    text-decoration: none;
}

.ntk-breadcrumb-link:hover {
    color: var(--color-accent-hover, #0369A1);
    text-decoration: underline;
}

.ntk-breadcrumbs .delimiter {
    color: var(--color-border-strong, #CBD5E1);
    user-select: none;
}

/* Interface Badges */
.ntk-interface-badge {
    display: inline-block;
    padding: 0.2rem 0.55rem;
    font-size: 0.75rem;
    font-family: var(--font-mono, monospace);
    font-weight: 600;
    border-radius: var(--radius-sm, 4px);
    letter-spacing: 0.02em;
}

.ntk-badge-c {
    background: #EFF6FF;
    color: #1D4ED8;
    border: 1px solid #BFDBFE;
}

.ntk-badge-cpp {
    background: #EEF2FF;
    color: #4338CA;
    border: 1px solid #C7D2FE;
}

.ntk-badge-struct {
    background: #F0FDFA;
    color: #0F766E;
    border: 1px solid #99F6E4;
}

.ntk-badge-rust {
    background: #FFFBEB;
    color: #B45309;
    border: 1px solid #FDE68A;
}

.ntk-badge-dotnet {
    background: #FAF5FF;
    color: #7E22CE;
    border: 1px solid #E9D5FF;
}

.ntk-badge-guide,
.ntk-badge-overview {
    background: #F1F5F9;
    color: #334155;
    border: 1px solid #CBD5E1;
}

/* Title & Version Row */
.ntk-docs-title-row {
    display: flex;
    align-items: baseline;
    gap: 0.85rem;
    flex-wrap: wrap;
    margin-bottom: 1.25rem;
    padding-bottom: 0.85rem;
    border-bottom: 1px solid var(--color-border-subtle, #E2E8F0);
}

.ntk-docs-title {
    font-size: 1.85rem;
    font-weight: 700;
    color: var(--color-text-primary, #0F172A);
    margin: 0;
    line-height: 1.25;
    word-break: break-word;
}

.ntk-version-tag {
    font-size: 0.75rem;
    font-family: var(--font-mono, monospace);
    font-weight: 600;
    color: #047857;
    background: #ECFDF5;
    border: 1px solid #A7F3D0;
    border-radius: var(--radius-pill, 9999px);
    padding: 0.15rem 0.5rem;
}

/* ==========================================================================
   Article Entry Content Typography
   ========================================================================== */
.ntk-docs-entry-content {
    font-size: 0.95rem;
    line-height: 1.65;
    color: var(--color-text-secondary, #334155);
}

.ntk-docs-entry-content p,
.ntk-docs-entry-content ul,
.ntk-docs-entry-content ol {
    max-width: 860px;
    margin-top: 0;
    margin-bottom: 1.15rem;
}

.ntk-docs-entry-content h2 {
    font-size: 1.35rem;
    font-weight: 600;
    color: var(--color-text-primary, #0F172A);
    margin-top: 2rem;
    margin-bottom: 0.75rem;
    padding-bottom: 0.35rem;
    border-bottom: 1px solid var(--color-border-subtle, #E2E8F0);
}

.ntk-docs-entry-content h3 {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--color-text-primary, #0F172A);
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}

/* Common API pseudo-headings: Parameters, Return Value, Remarks, Requirements */
.ntk-docs-entry-content p strong:first-child {
    color: var(--color-text-primary, #0F172A);
}

/* Highlight parameter terms */
.ntk-docs-entry-content dl dt,
.ntk-docs-entry-content li strong {
    color: var(--color-text-primary, #0F172A);
}

/* Monospace terms in body prose */
.ntk-docs-entry-content code:not([class*="language-"]) {
    font-family: var(--font-mono, monospace);
    font-size: 0.85em;
    background: var(--color-surface-subtle, #F8FAFC);
    color: var(--color-text-primary, #0F172A);
    padding: 0.15em 0.35em;
    border: 1px solid var(--color-border-subtle, #E2E8F0);
    border-radius: 3px;
    word-break: break-word;
}

/* ==========================================================================
   Code Blocks & Copy Controls
   ========================================================================== */
.ntk-docs-entry-content pre,
.ntk-docs-entry-content pre.wp-block-code {
    position: relative;
    background-color: var(--color-surface-code, #0F172A);
    color: #F8FAFC;
    border: 1px solid var(--color-surface-code-header, #1E293B);
    border-radius: var(--radius-md, 6px);
    padding: 1.15rem 1.25rem;
    margin: 1.25rem 0 1.75rem;
    overflow-x: auto;
    font-family: var(--font-mono, monospace);
    font-size: 0.875rem;
    line-height: 1.55;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
}

.ntk-docs-entry-content pre code {
    background: transparent;
    border: none;
    padding: 0;
    color: inherit;
    font-size: inherit;
    font-family: inherit;
    white-space: pre;
    word-break: normal;
    word-wrap: normal;
}

/* Injected Code Copy Button */
.ntk-code-copy-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.55rem;
    background: rgba(30, 41, 59, 0.85);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: var(--radius-sm, 4px);
    color: #94A3B8;
    font-size: 0.72rem;
    font-family: var(--font-ui, sans-serif);
    font-weight: 500;
    cursor: pointer;
    backdrop-filter: blur(4px);
    transition: all 0.15s ease;
    z-index: 10;
}

.ntk-code-copy-btn:hover {
    background: rgba(51, 65, 85, 0.95);
    color: #F8FAFC;
    border-color: rgba(148, 163, 184, 0.4);
}

.ntk-code-copy-btn svg {
    width: 12px;
    height: 12px;
}

.ntk-code-copy-btn.copied {
    background: rgba(6, 78, 59, 0.9);
    color: #34D399;
    border-color: rgba(52, 211, 153, 0.4);
}

/* ==========================================================================
   Tables
   ========================================================================== */
.ntk-table-wrapper {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 1.5rem 0 2rem;
    border: 1px solid var(--color-border-subtle, #E2E8F0);
    border-radius: var(--radius-md, 6px);
    background: #FFFFFF;
}

.ntk-docs-entry-content table,
.wp-block-table table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
    text-align: left;
    margin: 0;
}

.ntk-docs-entry-content th,
.wp-block-table th {
    background-color: var(--color-surface-subtle, #F8FAFC);
    color: var(--color-text-primary, #0F172A);
    font-weight: 600;
    padding: 0.75rem 1rem;
    border-bottom: 2px solid var(--color-border-subtle, #E2E8F0);
    white-space: nowrap;
}

.ntk-docs-entry-content td,
.wp-block-table td {
    padding: 0.65rem 1rem;
    border-bottom: 1px solid var(--color-border-subtle, #E2E8F0);
    vertical-align: top;
}

.ntk-docs-entry-content tr:last-child td,
.wp-block-table tr:last-child td {
    border-bottom: none;
}

.ntk-docs-entry-content tr:hover td,
.wp-block-table tr:hover td {
    background-color: #FAFAFA;
}

.ntk-docs-entry-content td code {
    white-space: nowrap;
}

/* ==========================================================================
   Adjacent Document Navigation Cards
   ========================================================================== */
.ntk-docs-adjacent-nav {
    margin-top: 3rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--color-border-subtle, #E2E8F0);
}

.ntk-docs-adjacent-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
}

.ntk-docs-nav-card {
    display: flex;
    flex-direction: column;
    padding: 1rem 1.25rem;
    background: var(--color-surface-subtle, #F8FAFC);
    border: 1px solid var(--color-border-subtle, #E2E8F0);
    border-radius: var(--radius-md, 6px);
    text-decoration: none;
    transition: all 0.15s ease;
}

.ntk-docs-nav-card:hover {
    background: #FFFFFF;
    border-color: var(--color-accent-primary, #0284C7);
    box-shadow: 0 4px 12px rgba(2, 132, 199, 0.08);
    text-decoration: none;
}

.ntk-nav-card-dir {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--color-text-muted, #64748B);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.35rem;
}

.ntk-docs-nav-next .ntk-nav-card-dir {
    justify-content: flex-end;
}

.ntk-nav-card-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--color-text-primary, #0F172A);
    font-family: var(--font-mono, monospace);
    word-break: break-word;
}

.ntk-docs-nav-next {
    text-align: right;
}

.ntk-docs-nav-placeholder {
    visibility: hidden;
}

/* ==========================================================================
   Root Documentation Portal Layout
   ========================================================================== */
.ntk-docs-portal {
    margin-top: 0.5rem;
}

.ntk-docs-portal-intro {
    background: var(--color-surface-subtle, #F8FAFC);
    border: 1px solid var(--color-border-subtle, #E2E8F0);
    border-radius: var(--radius-lg, 8px);
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.ntk-docs-portal-version-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    padding-bottom: 1rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--color-border-subtle, #E2E8F0);
}

.ntk-version-badge-group {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.ntk-version-label {
    font-size: 0.85rem;
    color: var(--color-text-muted, #64748B);
    font-weight: 500;
}

.ntk-version-number {
    font-family: var(--font-mono, monospace);
    font-weight: 700;
    color: var(--color-accent-hover, #0369A1);
    font-size: 0.9rem;
}

.ntk-version-state {
    font-size: 0.72rem;
    padding: 0.15rem 0.5rem;
    background: #ECFDF5;
    color: #047857;
    border: 1px solid #A7F3D0;
    border-radius: var(--radius-pill, 9999px);
    font-weight: 600;
}

.ntk-docs-portal-links {
    display: flex;
    gap: 0.85rem;
    flex-wrap: wrap;
}

.ntk-portal-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--color-accent-primary, #0284C7);
    text-decoration: none;
}

.ntk-portal-link:hover {
    color: var(--color-accent-hover, #0369A1);
    text-decoration: underline;
}

.ntk-docs-lead {
    font-size: 1.05rem;
    line-height: 1.6;
    color: var(--color-text-secondary, #334155);
    margin: 0;
}

.ntk-docs-section-heading {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--color-text-primary, #0F172A);
    margin: 2rem 0 1rem;
}

.ntk-portal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2.5rem;
}

.ntk-portal-card {
    display: flex;
    flex-direction: column;
    padding: 1.35rem;
    background: #FFFFFF;
    border: 1px solid var(--color-border-subtle, #E2E8F0);
    border-radius: var(--radius-md, 6px);
    text-decoration: none;
    transition: all 0.2s ease;
}

.ntk-portal-card:hover {
    border-color: var(--color-accent-primary, #0284C7);
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.06);
    transform: translateY(-2px);
    text-decoration: none;
}

.ntk-portal-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.ntk-portal-badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    font-size: 0.72rem;
    font-family: var(--font-mono, monospace);
    font-weight: 600;
    border-radius: var(--radius-sm, 4px);
}

.ntk-portal-count {
    font-size: 0.78rem;
    color: var(--color-text-muted, #64748B);
    font-family: var(--font-mono, monospace);
}

.ntk-portal-card-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--color-text-primary, #0F172A);
    margin: 0 0 0.5rem;
}

.ntk-portal-card-desc {
    font-size: 0.85rem;
    color: var(--color-text-muted, #64748B);
    line-height: 1.5;
    margin: 0 0 1rem;
    flex: 1;
}

.ntk-portal-card-action {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--color-accent-primary, #0284C7);
}

/* ==========================================================================
   Symbol Search Modal Dialog
   ========================================================================== */
.ntk-docs-search-modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 5rem 1rem 1rem;
}

.ntk-docs-search-modal[hidden] {
    display: none;
}

.ntk-docs-search-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
}

.ntk-docs-search-window {
    position: relative;
    width: 640px;
    max-width: 100%;
    background: #FFFFFF;
    border: 1px solid var(--color-border-strong, #CBD5E1);
    border-radius: var(--radius-lg, 8px);
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.25);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: ntkModalFadeIn 0.15s ease-out;
}

@keyframes ntkModalFadeIn {
    from { opacity: 0; transform: scale(0.98) translateY(-10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.ntk-docs-search-input-wrap {
    display: flex;
    align-items: center;
    padding: 0.85rem 1.15rem;
    border-bottom: 1px solid var(--color-border-subtle, #E2E8F0);
    gap: 0.75rem;
    background: #FFFFFF;
}

.ntk-docs-search-icon {
    color: var(--color-text-muted, #64748B);
    flex-shrink: 0;
}

.ntk-docs-search-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 1.05rem;
    font-family: inherit;
    color: var(--color-text-primary, #0F172A);
    background: transparent;
}

.ntk-docs-search-close {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
}

.ntk-docs-search-close kbd {
    font-family: var(--font-mono, monospace);
    font-size: 0.7rem;
    background: var(--color-surface-subtle, #F8FAFC);
    border: 1px solid var(--color-border-strong, #CBD5E1);
    border-radius: 3px;
    padding: 0.15rem 0.4rem;
    color: var(--color-text-muted, #64748B);
}

.ntk-docs-search-results-area {
    max-height: 380px;
    overflow-y: auto;
    padding: 0.5rem 0;
}

.ntk-docs-search-meta {
    display: flex;
    justify-content: space-between;
    padding: 0.35rem 1.15rem;
    font-size: 0.72rem;
    color: var(--color-text-muted, #64748B);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 500;
}

.ntk-docs-search-results {
    list-style: none;
    margin: 0;
    padding: 0;
}

.ntk-search-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.65rem 1.15rem;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.1s ease;
}

.ntk-search-item:hover,
.ntk-search-item.selected {
    background: var(--color-surface-muted, #F1F5F9);
}

.ntk-search-item-left {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
}

.ntk-search-item-title {
    font-size: 0.92rem;
    font-weight: 600;
    font-family: var(--font-mono, monospace);
    color: var(--color-text-primary, #0F172A);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ntk-search-item-path {
    font-size: 0.75rem;
    color: var(--color-text-muted, #64748B);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ntk-search-item-badge {
    flex-shrink: 0;
    margin-left: 0.75rem;
}

.ntk-docs-search-empty {
    padding: 2rem 1.15rem;
    text-align: center;
    color: var(--color-text-muted, #64748B);
    font-size: 0.9rem;
}

.ntk-docs-search-footer {
    display: flex;
    gap: 1.25rem;
    padding: 0.65rem 1.15rem;
    background: var(--color-surface-subtle, #F8FAFC);
    border-top: 1px solid var(--color-border-subtle, #E2E8F0);
    font-size: 0.72rem;
    color: var(--color-text-muted, #64748B);
}

.ntk-search-hint kbd {
    font-family: var(--font-mono, monospace);
    background: #FFFFFF;
    border: 1px solid var(--color-border-strong, #CBD5E1);
    border-radius: 3px;
    padding: 0.1rem 0.3rem;
    color: var(--color-text-secondary, #334155);
    margin-right: 0.25rem;
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */
@media (max-width: 1024px) {
    .ntk-docs {
        padding: 1rem 1rem 3rem;
        box-sizing: border-box;
    }

    .ntk-docs-layout {
        display: block;
        gap: 0;
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }

    .ntk-docs-main,
    .ntk-docs-main.docspress-single-content {
        padding: 0;
        width: 100%;
        max-width: 100%;
        min-width: 0;
        box-sizing: border-box;
    }

    .ntk-docs-mobile-bar {
        display: flex;
    }

    .ntk-docs-sidebar {
        display: none;
    }

    /* Off-canvas mobile drawer state */
    body.ntk-drawer-open {
        overflow: hidden;
    }

    body.ntk-drawer-open .ntk-docs-sidebar {
        display: block;
        position: fixed;
        top: 0;
        left: 0;
        width: 320px;
        max-width: 85vw;
        height: 100vh;
        max-height: 100vh;
        z-index: 1000;
        background: #FFFFFF;
        box-shadow: 4px 0 24px rgba(15, 23, 42, 0.18);
        padding: 1rem;
        border-right: none;
        animation: ntkDrawerSlideIn 0.2s ease-out;
    }

    @keyframes ntkDrawerSlideIn {
        from { transform: translateX(-100%); }
        to { transform: translateX(0); }
    }

    .ntk-docs-drawer-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding-bottom: 0.75rem;
        margin-bottom: 0.75rem;
        border-bottom: 1px solid var(--color-border-subtle, #E2E8F0);
    }

    .ntk-docs-drawer-title {
        font-size: 0.95rem;
        font-weight: 600;
        color: var(--color-text-primary, #0F172A);
    }

    .ntk-docs-drawer-close {
        background: transparent;
        border: none;
        color: var(--color-text-muted, #64748B);
        cursor: pointer;
        padding: 0.25rem;
        display: flex;
        align-items: center;
    }

    .ntk-docs-drawer-close:hover {
        color: var(--color-text-primary, #0F172A);
    }

    /* Drawer backdrop */
    .ntk-drawer-backdrop {
        position: fixed;
        inset: 0;
        background: rgba(15, 23, 42, 0.5);
        backdrop-filter: blur(2px);
        z-index: 999;
    }
}

@media (max-width: 768px) {
    .ntk-docs-entry-content {
        max-width: 100%;
        min-width: 0;
        overflow-wrap: break-word;
        word-break: break-word;
    }

    .ntk-docs-entry-content pre,
    .ntk-docs-entry-content pre.wp-block-code {
        max-width: 100%;
        box-sizing: border-box;
        overflow-x: auto;
    }

    .ntk-docs-adjacent-cards {
        grid-template-columns: 1fr;
        max-width: 100%;
    }

    .ntk-docs-nav-next {
        text-align: left;
    }

    .ntk-docs-nav-next .ntk-nav-card-dir {
        justify-content: flex-start;
    }

    .ntk-docs-title {
        font-size: 1.5rem;
    }

    .ntk-portal-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 390px) {
    .ntk-docs {
        padding: 0.75rem 0.75rem 2.5rem;
        box-sizing: border-box;
        max-width: 100vw;
    }

    .ntk-docs-main,
    .ntk-docs-main.docspress-single-content {
        padding: 0;
        max-width: 100%;
        min-width: 0;
    }

    .ntk-docs-title {
        font-size: 1.35rem;
    }

    .ntk-docs-entry-content pre,
    .ntk-docs-entry-content pre.wp-block-code {
        padding: 0.85rem;
        font-size: 0.8rem;
    }

    .ntk-docs-portal-intro {
        padding: 1rem;
    }
}
