

:root {
    --bg:            #0d1117;
    --bg-sidebar:    #010409;
    --bg-elevated:   #161b22;
    --bg-code:       #0d1117;
    --bg-hover:      rgba(177, 186, 196, 0.1);
    --bg-active:     rgba(56, 139, 253, 0.18);
    --bg-modal:      rgba(1, 4, 9, 0.8);

    --border:        #21262d;
    --border-muted:  #30363d;

    --text:          #e6edf3;
    --text-secondary:#c9d1d9;
    --text-muted:    #8b949e;
    --text-faint:    #6e7681;

    --accent:        #58a6ff;
    --accent-hover:  #79b8ff;
    --link:          #58a6ff;

    --success:       #3fb950;
    --warning:       #d29922;
    --danger:        #f85149;
    --info:          #58a6ff;

    --radius:        10px;
    --radius-sm:     6px;
    --sidebar-w:     260px;
    --toc-w:         210px;
    --content-w:     100%;

    --shadow:        0 16px 48px rgba(0,0,0,0.5);
    --transition:    0.15s ease;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html {
    font-size: 15.5px;
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.7;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}


.layout {
    display: flex;
    min-height: 100vh;
    width: 100%;
}


.sidebar {
    width: var(--sidebar-w);
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    flex-shrink: 0;
    z-index: 20;
}

.sidebar-header {
    padding: 1.15rem 1.2rem 0.75rem;
}

.logo {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text);
    text-decoration: none;
    letter-spacing: -0.02em;
    transition: color var(--transition);
}
.logo:hover { color: var(--accent); }

.search-trigger-wrap {
    padding: 0 0.85rem 0.9rem;
}

.search-trigger {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.48rem 0.7rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 0.84rem;
    cursor: pointer;
    transition: border-color var(--transition), background var(--transition), color var(--transition);
}
.search-trigger:hover {
    border-color: var(--border-muted);
    background: var(--bg-hover);
    color: var(--text-secondary);
}
.search-trigger span { flex: 1; text-align: left; }
.search-trigger kbd {
    font-size: 0.68rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 0.12em 0.4em;
    color: var(--text-faint);
    font-family: inherit;
}

.nav {
    flex: 1;
    padding: 0.35rem 0.7rem 1rem;
    overflow-y: auto;
}

.nav-section { margin-bottom: 1.1rem; }

.nav-section-title {
    font-size: 0.66rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text-faint);
    padding: 0.3rem 0.7rem;
    margin-bottom: 0.15rem;
}

.nav-link {
    display: block;
    padding: 0.38rem 0.7rem;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    transition: all var(--transition);
    margin-bottom: 1px;
}
.nav-link:hover {
    background: var(--bg-hover);
    color: var(--text);
}
.nav-link.active {
    background: var(--bg-active);
    color: var(--accent);
    font-weight: 500;
}

.sidebar-footer {
    padding: 0.85rem 1.15rem;
    border-top: 1px solid var(--border);
    color: var(--text-faint);
    font-size: 0.7rem;
}
.sidebar-footer code {
    font-size: 0.66rem;
    background: var(--bg-elevated);
    padding: 0.1em 0.3em;
    border-radius: 3px;
    color: var(--text-muted);
}


.main-area {
    flex: 1;
    display: flex;
    min-width: 0;
    width: 100%;
    max-width: 1400px; 
}

.content {
    flex: 1 1 auto;
    min-width: 0;
    max-width: 980px; 
    padding: 2.25rem 2.75rem 3.5rem 2.5rem;
    box-sizing: border-box;
}

.article {
    width: 100%;
    max-width: 100%;
    overflow-wrap: break-word;
    word-wrap: break-word;
}

.fade-in {
    animation: fadeIn 0.3s ease;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to   { opacity: 1; transform: translateY(0); }
}


.article h1 {
    font-size: 1.95rem;
    font-weight: 700;
    line-height: 1.25;
    margin: 0 0 0.9rem;
    letter-spacing: -0.03em;
    color: var(--text);
}

.article h2 {
    font-size: 1.32rem;
    font-weight: 650;
    margin: 2.2rem 0 0.8rem;
    padding-bottom: 0.35rem;
    border-bottom: 1px solid var(--border);
    letter-spacing: -0.02em;
    position: relative;
    color: var(--text);
}

.article h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 1.6rem 0 0.55rem;
    position: relative;
    color: var(--text);
}

.article h4 {
    font-size: 0.98rem;
    font-weight: 600;
    margin: 1.3rem 0 0.4rem;
    color: var(--text-secondary);
}

.article .anchor {
    position: absolute;
    left: -1.3rem;
    top: 0; bottom: 0;
    width: 1.1rem;
    opacity: 0;
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 400;
    font-size: 0.85em;
    display: flex;
    align-items: center;
    transition: opacity var(--transition);
}
.article h2:hover .anchor,
.article h3:hover .anchor { opacity: 1; }

.article p {
    margin-bottom: 0.95rem;
    color: var(--text-secondary);
}

.article a {
    color: var(--link);
    text-decoration: none;
    transition: color var(--transition);
}
.article a:hover {
    text-decoration: underline;
    color: var(--accent-hover);
}

.article strong {
    color: var(--text);
    font-weight: 600;
}

.article ul, .article ol {
    margin: 0 0 1rem 1.3rem;
    color: var(--text-secondary);
}
.article li {
    margin-bottom: 0.25rem;
    padding-left: 0.15rem;
}
.article li > ul, .article li > ol {
    margin-top: 0.2rem;
    margin-bottom: 0.2rem;
}


.article code {
    font-family: ui-monospace, "SF Mono", "Cascadia Code", "Roboto Mono", Menlo, Consolas, monospace;
    font-size: 0.85em;
    background: rgba(110, 118, 129, 0.22);
    color: #ff7b72;
    padding: 0.14em 0.38em;
    border-radius: 5px;
}


.code-block {
    margin: 0 0 1.35rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--bg-code);
    box-shadow: 0 2px 12px rgba(0,0,0,0.2);
    max-width: 100%;
    min-width: 0;
    width: 100%;
}

.code-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.4rem 0.9rem;
    background: #161b22;
    border-bottom: 1px solid var(--border);
}

.code-lang {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    font-family: ui-monospace, monospace;
}

.code-block pre {
    margin: 0 !important;
    border: none !important;
    border-radius: 0 !important;
    background: transparent !important;
    padding: 1rem 1.15rem !important;
    overflow-x: auto;
    line-height: 1.55;
    max-width: 100%;
    min-width: 0;
    white-space: pre;
    tab-size: 4;
}

.code-block pre code,
.code-block .code-content {
    background: none !important;
    padding: 0 !important;
    color: var(--text-secondary) !important;
    font-size: 0.875rem !important;
    border-radius: 0 !important;
    font-family: ui-monospace, "SF Mono", "Cascadia Code", "Roboto Mono", Menlo, Consolas, monospace;
}


.article > pre,
.article p + pre {
    background: var(--bg-code);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.95rem 1.1rem;
    overflow-x: auto;
    margin: 0 0 1.25rem;
    line-height: 1.55;
}
.article > pre code {
    background: none;
    padding: 0;
    color: var(--text-secondary);
    font-size: 0.86rem;
}


.article figure.screenshot {
    margin: 1.3rem 0 1.5rem;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--bg-elevated);
    box-shadow: 0 4px 18px rgba(0,0,0,0.28);
    transition: border-color var(--transition), box-shadow var(--transition);
}
.article figure.screenshot:hover {
    border-color: var(--border-muted);
    box-shadow: 0 6px 24px rgba(0,0,0,0.38);
}
.article figure.screenshot img {
    display: block;
    width: 100%;
    height: auto;
    border: none;
    margin: 0;
    border-radius: 0;
}
.article figure.screenshot figcaption {
    padding: 0.5rem 0.95rem;
    font-size: 0.78rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border);
    background: var(--bg-elevated);
    text-align: center;
}

.article img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    margin: 1rem 0;
    display: block;
}


.article blockquote {
    border-left: 3px solid var(--accent);
    background: rgba(56, 139, 253, 0.07);
    padding: 0.7rem 1rem;
    margin: 0 0 1.15rem;
    color: var(--text-muted);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.article blockquote p { margin: 0; }

.callout {
    border-radius: var(--radius);
    padding: 0.85rem 1.1rem;
    margin: 0 0 1.25rem;
    border: 1px solid var(--border);
    background: var(--bg-elevated);
}
.callout-title {
    font-weight: 600;
    font-size: 0.86rem;
    margin-bottom: 0.28rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.callout-icon { font-size: 0.95rem; }
.callout-body {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.callout-note, .callout-tip {
    border-color: rgba(56, 139, 253, 0.4);
    background: rgba(56, 139, 253, 0.08);
}
.callout-note .callout-title, .callout-tip .callout-title { color: var(--info); }

.callout-warning, .callout-caution {
    border-color: rgba(210, 153, 34, 0.45);
    background: rgba(210, 153, 34, 0.08);
}
.callout-warning .callout-title, .callout-caution .callout-title { color: var(--warning); }

.callout-important {
    border-color: rgba(248, 81, 73, 0.4);
    background: rgba(248, 81, 73, 0.08);
}
.callout-important .callout-title { color: var(--danger); }

.callout-success {
    border-color: rgba(63, 185, 80, 0.4);
    background: rgba(63, 185, 80, 0.08);
}
.callout-success .callout-title { color: var(--success); }


.table-wrap {
    overflow-x: auto;
    margin: 0 0 1.3rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    max-width: 100%;
    min-width: 0;
}
.article table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}
.article th, .article td {
    padding: 0.55rem 0.95rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}
.article th {
    background: var(--bg-elevated);
    font-weight: 600;
    color: var(--text);
}
.article td { color: var(--text-secondary); }
.article tr:last-child td { border-bottom: none; }

.article hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 2rem 0;
}


.page-nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.9rem;
    margin-top: 2.8rem;
    padding-top: 1.4rem;
    border-top: 1px solid var(--border);
}

.page-nav-link {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    padding: 0.95rem 1.15rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    text-decoration: none !important;
    background: var(--bg-elevated);
    transition: border-color var(--transition), background var(--transition), transform var(--transition);
}
.page-nav-link:hover {
    border-color: var(--accent);
    background: rgba(56, 139, 253, 0.1);
    transform: translateY(-1px);
}
.page-nav-link.next {
    text-align: right;
    align-items: flex-end;
}

.page-nav-label {
    font-size: 0.72rem;
    color: var(--text-muted) !important;
    font-weight: 500;
}
.page-nav-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text) !important;
}
.page-nav-link:hover .page-nav-title {
    color: var(--accent) !important;
}


.toc {
    flex: 0 0 240px;
    width: 240px;
    max-width: 240px;
    padding: 2.25rem 1.5rem 2rem 0.5rem;
    box-sizing: border-box;
    position: relative;
    margin-left: auto; 
}

.toc-inner {
    position: sticky;
    top: 2.4rem;
    max-height: calc(100vh - 4rem);
    overflow-y: auto;
}

.toc-title {
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-faint);
    margin-bottom: 0.65rem;
    padding-left: 0.7rem;
}

.toc-nav {
    display: flex;
    flex-direction: column;
    border-left: 1px solid var(--border);
}

.toc-link {
    display: block;
    padding: 0.25rem 0.7rem;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.78rem;
    line-height: 1.4;
    border-left: 2px solid transparent;
    margin-left: -1px;
    transition: all var(--transition);
}
.toc-link:hover { color: var(--text); }
.toc-link.active {
    color: var(--accent);
    border-left-color: var(--accent);
    font-weight: 500;
}
.toc-link.level-3 {
    padding-left: 1.25rem;
    font-size: 0.75rem;
}

/* ========== SEARCH MODAL ========== */
.search-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 14vh;
}
.search-modal[hidden] { display: none !important; }

.search-backdrop {
    position: absolute;
    inset: 0;
    background: var(--bg-modal);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.search-box {
    position: relative;
    width: 100%;
    max-width: 540px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-muted);
    border-radius: 12px;
    box-shadow: var(--shadow);
    overflow: hidden;
    animation: slideDown 0.18s ease;
}
@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.search-input-wrap {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--border);
}
.search-input-wrap svg {
    color: var(--text-muted);
    flex-shrink: 0;
}
.search-input-wrap input {
    flex: 1;
    background: transparent !important;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    color: var(--text) !important;
    font-size: 1rem;
    font-family: inherit;
    padding: 0;
    margin: 0;
    -webkit-appearance: none;
    appearance: none;
}
.search-input-wrap input::placeholder {
    color: var(--text-faint);
}
.search-input-wrap kbd {
    font-size: 0.68rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 0.15em 0.4em;
    color: var(--text-faint);
    font-family: inherit;
}

.search-results {
    max-height: 340px;
    overflow-y: auto;
    padding: 0.35rem;
}

.search-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.6rem 0.85rem;
    border-radius: var(--radius-sm);
    text-decoration: none !important;
    color: var(--text);
    transition: background var(--transition);
}
.search-item:hover,
.search-item.active {
    background: var(--bg-active);
}
.search-item-title {
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--text);
}
.search-item-slug {
    font-size: 0.75rem;
    color: var(--text-faint);
    font-family: ui-monospace, monospace;
}
.search-empty {
    padding: 1.4rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.88rem;
}



/* ========== CODE COPY + HIGHLIGHT ========== */
.code-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.45rem 0.85rem;
    background: #010409;
    border-bottom: 1px solid var(--border);
}

.code-lang {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-faint);
}

.copy-btn {
    margin-left: auto;
    padding: 0.2rem 0.55rem;
    font-size: 0.72rem;
    font-weight: 500;
    font-family: inherit;
    color: var(--text-muted);
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 5px;
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.copy-btn:hover {
    color: var(--text);
    border-color: var(--border-muted);
    background: var(--bg-hover);
}
.copy-btn.copied {
    color: var(--success);
    border-color: rgba(63, 185, 80, 0.4);
}

/* highlight.js overrides for our dark theme */
.code-block pre code.hljs {
    background: transparent !important;
    padding: 0 !important;
}
.code-block pre {
    background: var(--bg-code) !important;
}

/* ========== PAGE TOOLBAR ========== */
.page-toolbar {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 0.35rem;
}
.btn-edit {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-decoration: none;
    padding: 0.28rem 0.65rem;
    border-radius: 6px;
    border: 1px solid transparent;
    transition: all 0.15s;
}
.btn-edit:hover {
    color: var(--accent);
    border-color: var(--border);
    background: var(--bg-elevated);
}

/* ========== FLASH ========== */
.flash {
    padding: 0.7rem 1rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1.25rem;
    font-size: 0.9rem;
}
.flash-success {
    background: rgba(63, 185, 80, 0.12);
    border: 1px solid rgba(63, 185, 80, 0.35);
    color: var(--success);
}

/* ========== EDITOR ========== */
.editor-wrap {
    max-width: 100%;
}
.editor-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
}
.editor-header h1 {
    font-size: 1.45rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin: 0;
}
.editor-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    margin: 0.9rem 0 0.4rem;
}
.editor-label .hint {
    font-weight: 400;
    color: var(--text-faint);
    margin-left: 0.4rem;
}
.editor-input {
    width: 100%;
    padding: 0.6rem 0.85rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 0.95rem;
    font-family: inherit;
    outline: none;
    transition: border-color 0.15s;
}
.editor-input:focus {
    border-color: var(--accent);
}
.editor-textarea {
    width: 100%;
    min-height: 62vh;
    padding: 1rem 1.1rem;
    background: #0a0e14;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-secondary);
    font-size: 0.88rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    line-height: 1.55;
    resize: vertical;
    outline: none;
    tab-size: 4;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.editor-textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(56, 139, 253, 0.15);
}
.editor-actions {
    display: flex;
    gap: 0.65rem;
    margin-top: 1rem;
    align-items: center;
}
.btn-primary {
    padding: 0.55rem 1.15rem;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
}
.btn-primary:hover { background: var(--accent-hover); }
.btn-primary:active { transform: scale(0.98); }
.btn-ghost {
    padding: 0.5rem 0.9rem;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.88rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: transparent;
    transition: color 0.15s, border-color 0.15s;
}
.btn-ghost:hover {
    color: var(--text);
    border-color: var(--border-muted);
}
.editor-cheatsheet {
    margin-top: 1.5rem;
    padding: 0.85rem 1rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    color: var(--text-muted);
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 0.85rem;
    align-items: center;
}
.editor-cheatsheet strong {
    color: var(--text-secondary);
    margin-right: 0.25rem;
}
.editor-cheatsheet code {
    font-size: 0.75rem;
    background: var(--bg);
    padding: 0.15em 0.4em;
    border-radius: 4px;
    color: var(--accent);
}

/* Sidebar action buttons */
.sidebar-actions {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}
.btn-sidebar {
    display: block;
    text-align: center;
    padding: 0.4rem 0.6rem;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--accent);
    text-decoration: none;
    border: 1px solid rgba(56, 139, 253, 0.35);
    border-radius: var(--radius-sm);
    background: rgba(56, 139, 253, 0.08);
    transition: all 0.15s;
}
.btn-sidebar:hover {
    background: rgba(56, 139, 253, 0.18);
    border-color: var(--accent);
}
.btn-sidebar-muted {
    color: var(--text-muted);
    border-color: var(--border);
    background: transparent;
}
.btn-sidebar-muted:hover {
    color: var(--text);
    border-color: var(--border-muted);
    background: var(--bg-hover);
}

/* subtle design polish */
.article h2 {
    margin-top: 2.4rem;
}
.article h2:first-child {
    margin-top: 0;
}
.callout {
    box-shadow: 0 1px 0 rgba(255,255,255,0.03) inset;
}
.code-block {
    box-shadow: 0 4px 20px rgba(0,0,0,0.25);
}
.toc-inner {
    padding-left: 0.25rem;
}
.nav-link.active {
    box-shadow: inset 2px 0 0 var(--accent);
}

/* ========== RESPONSIVE ========== */
@media (max-width: 1100px) {
    .toc { display: none; }
    .content { max-width: 100%; }
}

@media (max-width: 800px) {
    html, body {
        overflow-x: hidden;
        max-width: 100vw;
    }

    .layout {
        flex-direction: column;
        overflow-x: hidden;
        max-width: 100vw;
    }

    .sidebar {
        width: 100%;
        max-width: 100%;
        height: auto;
        max-height: 42vh;
        position: relative;
        border-right: none;
        border-bottom: 1px solid var(--border);
        overflow: hidden;
        display: flex;
        flex-direction: column;
    }

    .nav {
        display: flex;
        flex-direction: column;   
        flex-wrap: nowrap;        
        gap: 6px;
        padding: 0.5rem 0.7rem 0.9rem;
        overflow-x: hidden;
        overflow-y: auto;
        flex: 1 1 auto;
        min-height: 0;
        width: 100%;
        max-width: 100%;
    }


    .nav-section {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        margin-bottom: 0;
        flex: 0 0 auto;
    }

    .nav-section-title,
    .nav-section-title.nav-section-toggle {
        width: 100%;
    }

    .nav-section .nav-link {
        display: block;
        width: 100%;
        max-width: 100%;
        white-space: normal;
        overflow-wrap: break-word;
        word-break: break-word;
    }

    .sidebar-footer { display: none; }

    .main-area {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        overflow-x: hidden;
    }

    .content {
        max-width: 100%;
        padding: 1.35rem 1.1rem 2.5rem;
        overflow-x: hidden;
    }

    .article {
        overflow-x: hidden;
        overflow-wrap: break-word;
    }

    .article h1 { font-size: 1.5rem; }
    .article h2 { font-size: 1.2rem; }
    .article .anchor { display: none; }

    .code-block pre {
        padding: 0.85rem 0.9rem !important;
        font-size: 0.8rem;
    }

    .page-nav {
        grid-template-columns: 1fr;
    }

    .search-box {
        margin: 0 0.75rem;
        max-width: none;
    }

    .toc {
        display: none;
    }
}
