html, body {
    height: 100%;
    margin: 0;
}
body {
    font-family: 'Berkeley Mono', monospace;
    background-color: #f8f9fa;
}
/* Container for left sidebar, main content, and right sidebar */
#container {
    display: flex;
    height: 100vh;
    overflow: hidden;
    width: 100%;
}
/* Left sidebar for table of contents */
#left-sidebar {
    width: 450px;
    background-color: #f8f9fa;
    overflow: auto;
    padding: 40px 15px 0 15px;
    border-right: 1px solid #dee2e6;
    resize: horizontal;
    position: relative;
    min-width: 350px;
    max-width: 600px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
}

#menu-container {
    flex: 1;
    overflow-y: auto;
}

#menu-container:empty {
    visibility: hidden;
}

#left-sidebar > ol {
    flex: 1;
}

#left-sidebar .left-sidebar-footer {
    margin-top: auto;
    padding: 20px 0 15px 0;
    font-size: 14px;
}

#left-sidebar-width-indicator {
    position: absolute;
    bottom: 5px;
    right: 10px;
    color: #666;
    font-size: 11px;
    display: none;
    z-index: 9999;
    pointer-events: none;
    font-family: 'Berkeley Mono', monospace;
    background: rgba(248, 249, 250, 0.9);
    padding: 2px 5px;
}

/* Main content area */
#content {
    flex: 1;
    min-width: 0;
    overflow-y: scroll;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    position: relative;
}

#content:focus {
    outline: none !important;
    border: none !important;
    box-shadow: none !important;
}

/* Title styling */
#content h1 {
    font-family: 'VT323', monospace !important;
    font-size: 2.5em;
    line-height: 1.2;
    margin-top: 1.5em;
    margin-bottom: 1.5em;
    margin-left: 0;  /* Explicitly no indentation */
    padding: 0 0 0.5em 0;
    border-bottom: 1px solid #e0e0e0;
    color: #c2410c !important;
    text-align: left;
    word-wrap: break-word;
}

#content h1::before {
    content: ":: ";
    color: #004c4c;
}

#content h1 a {
    color: #c2410c !important;
    text-decoration: none;
}

#content-inner {
    width: 90% !important;
    max-width: 1400px !important;
    margin: 0 auto !important;
    padding: 40px 20px 20px 20px !important;
    flex: 1;
    display: flex;
    flex-direction: column;
}
#content-inner article,
#content-inner .markdown-content,
#content-inner main {
    width: 100% !important;
    max-width: none !important;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.content-footer {
    margin-top: auto;
    background: #f8f9fa;
}

.content-footer div {
    font-size: 14px !important;
}

.markdown-content {
    flex: 1;
}

/* First heading should have less top margin since content-inner has padding */
#content-inner h1:first-of-type {
    margin-top: 0 !important;
}
/* Numbered headings and paragraphs */
h2 {
    font-family: 'VT323', monospace !important;
    font-size: 2.0em;
    line-height: 1.2;
    margin-top: 1em;
    margin-bottom: 0.5em;
    padding-left: 0 !important;
}
h3 {
    font-size: 1.6em;
    margin-top: 0.8em;
    margin-bottom: 0.4em;
    padding-left: 0 !important;
}
.section-number {
    font-weight: bold;
    color: #343a40;
}
/* Reduced spacing for main text */
p, li {
    font-size: 1em;
    line-height: 1.2em; /* Reduced line spacing */
    margin-bottom: 0.8em; /* Reduced spacing between paragraphs */
    color: #212529;
}
/* Reduced padding and background for inline code */
code.inline-code {
    font-family: 'Berkeley Mono', monospace;
    background-color: #e9ecef;
    padding: 2px 4px;
    border-radius: 4px;
    border: 1px solid #ced4da;
    cursor: pointer; /* Change cursor to pointer to indicate interactivity */
    user-select: all; /* Allows easy manual selection if needed */
}
a {
    text-decoration: underline;
    color: #166534;
    transition: color 0.2s;
}
a:visited {
    color: #166534;
}
a:hover {
    color: var(--accent-color);
}
/* Sidebar styling */
#sidebar {
    background-color: #ffffff;
    display: flex;
    flex-direction: column;
    position: relative;
}
/* Fixed header in sidebar */
#sidebar .fixed-header {
    flex-shrink: 0;
    background-color: #ffffff;
    padding: 15px;
    border-top: 1px solid #dee2e6;
    border-bottom: 1px solid #dee2e6;
    width: 100%;
    box-sizing: border-box;
}
#sidebar .fixed-header h2 {
    margin-top: 0;
    margin-bottom: 5px;
    font-size: 1.2em;
    color: #004c4c;
}
#sidebar .fixed-header p {
    font-size: 0.85em;
    color: #6c757d;
    margin-bottom: 0;
    line-height: 1.2em;
}
/* Scrollable menu content */
#sidebar .menu-content {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    position: relative;
    z-index: 1;
    background-color: transparent;
    pointer-events: none;
}

#sidebar .menu-content * {
    pointer-events: auto;
    position: relative;
    z-index: 10;
}
#sidebar ul {
    list-style-type: none;
    padding-left: 0;
}
#sidebar ul li {
    margin-bottom: 5px;
    line-height: 1.2em;
}
#sidebar ul li a {
    font-weight: bold;
}
/* Footer in sidebar */
#sidebar .footer {
    flex-shrink: 0;
    text-align: center;
    padding: 10px;
    font-size: 0.85em;
    color: #6c757d;
    border-top: 1px solid #dee2e6;
    position: relative;
    z-index: 1;
    background-color: #ffffff;
}

.space-preserving-block {
    font-family: 'Berkeley Mono', monospace;
    background-color: #f5f5f5;
    border: 0px solid #ddd;
    border-radius: 4px;
    padding: 0px;
    white-space: pre-wrap;
    word-wrap: break-word;
}
.status-line {
    display: flex;
    justify-content: space-between;
    font-family: 'Berkeley Mono', monospace;
    line-height: 1.6em;
}
.status-label {
    text-align: left;
}
.status-value {
    text-align: right;
}

#sidebar {
    width: 350px;
    border: 1px solid #ccc;
    padding: 0px;
    overflow: auto;
    overflow-x: hidden;
    position: relative;
    min-width: 350px;
    max-width: 600px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-sizing: border-box;
}

#sidebar::-webkit-resizer {
    display: none;
}

/* Make right sidebar content fill width */
#sidebar > * {
    width: 95%;
    max-width: 95%;
}

#sidebar h2,
#sidebar h3,
#sidebar h4,
#sidebar ul,
#sidebar ol,
#sidebar p {
    width: 95%;
}

#sidebar-resize-handle {
    position: absolute;
    left: 0;
    bottom: 0;
    width: 15px;
    height: 15px;
    cursor: nwse-resize;
    background: transparent;
    z-index: 100;
}

#sidebar-resize-handle:hover {
    background: rgba(0, 0, 0, 0.2);
}

#sidebar-width-indicator {
    position: absolute;
    bottom: 10px;
    left: 15px;
    color: #666;
    font-size: 11px;
    display: none;
    z-index: 1000;
    pointer-events: none;
    font-family: 'Berkeley Mono', monospace;
}
/* Table of contents in left sidebar */
#left-sidebar nav#TableOfContents ul {
    list-style-type: none;
    padding-left: 20px;
}
#left-sidebar ol.chapter a {
    text-decoration: none;
    color: #166534;
    display: inline;
    padding: 2px 0;
}
#left-sidebar ol.chapter li.chapter-item.expanded.active a {
    color: #c2410c !important;
}
#left-sidebar ol.chapter a:hover {
    color: #c2410c;
}
#left-sidebar nav#TableOfContents a:hover {
    color: #c2410c;
}
/* Code blocks styling to match gitolite.html */
.highlight {
    font-size: 0.95em !important;
    position: relative !important;
    width: fit-content !important;
    max-width: 100% !important;
}
.highlight pre {
    background-color: #f1f3f5 !important;
    padding: 15px 10px 5px 45px !important;
    border-radius: 5px !important;
    border: 1px solid #dee2e6 !important;
    font-size: 1em !important;
    margin-bottom: 1em !important;
    position: relative !important;
    font-family: 'Berkeley Mono', monospace !important;
    overflow-x: auto !important;
    width: 100ch !important;
    max-width: 100% !important;
}
.highlight pre code {
    background: none !important;
    padding: 0 !important;
    border: none !important;
    font-size: 1em !important;
}
/* 80 character vertical line - positioned on code cell, not whole table */
.highlight .lntable {
    position: relative;
}
.highlight .lntable .lntd:last-child {
    position: relative;
}
.highlight .lntable .lntd:last-child::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 80ch;
    width: 1px;
    background-color: #dee2e6;
    pointer-events: none;
    z-index: 0;
}
/* Line numbers in code blocks */
.highlight .lntable {
    border-spacing: 0 !important;
    border-collapse: collapse !important;
    width: auto !important;
}
.highlight .lntable .lntd {
    padding: 0 !important;
    vertical-align: top !important;
}
.highlight .lntable .lntd:first-child {
    background-color: #e9ecef !important;
    border-right: 1px solid #dee2e6 !important;
    width: 4ch !important;
}
.highlight .lntable .lntd:first-child pre {
    background: transparent !important;
    padding: 15px 5px 5px 5px !important;
    text-align: right !important;
    user-select: none !important;
    margin: 0 !important;
    height: 100% !important;
    box-sizing: border-box !important;
    width: 4ch !important;
}
.highlight .lntable .lntd:last-child {
    width: 100ch !important;
}
.highlight .lntable .lntd:last-child pre {
    padding: 15px 10px 5px 10px !important;
    margin: 0 !important;
    width: 100ch !important;
}
.highlight .lnt {
    color: #6c757d !important;
    line-height: 1.3em !important;
    font-size: 1em !important;
}
.highlight .chroma .line {
    line-height: 1.3em !important;
}
#left-sidebar ol.chapter {
    counter-reset: toc-chapter;
    list-style-type: none;
}
#left-sidebar ol.chapter > li.chapter-item {
    counter-increment: toc-chapter;
    margin-top: 15px;
    margin-bottom: 2px;
    display: flex;
    align-items: flex-start;
}
#left-sidebar ol.chapter > li.chapter-item:first-child {
    margin-top: 0;
}
#left-sidebar ol.chapter > li.chapter-item:before {
    content: counter(toc-chapter) ". ";
    font-weight: bold;
    flex-shrink: 0;
    margin-right: 5px;
    font-size: 1em;
    line-height: 1.5;
    width: 3ch;
    text-align: right;
    display: inline-block;
}
#left-sidebar ol.chapter > li:not(.chapter-item):before {
    content: none;
}
#left-sidebar ol.section {
    counter-reset: toc-section;
    list-style-type: none;
    padding-left: calc(3ch + 5px);
    margin-top: 3px;
}
#left-sidebar ol.section > li {
    counter-increment: toc-section;
    display: flex;
    align-items: flex-start;
    margin-bottom: 1px;
}
#left-sidebar ol.section > li:before {
    content: counter(toc-chapter) "." counter(toc-section) ". ";
    font-weight: bold;
    flex-shrink: 0;
    margin-right: 5px;
    font-size: 1em;
    line-height: 1.5;
}
#left-sidebar a {
    text-decoration: none;
    color: #166534;
    display: block;
    padding: 0;
    flex: 1;
    font-size: 1em;
    line-height: 1.5;
    font-weight: bold;
}
#left-sidebar a:hover {
    color: #c2410c;
}
#left-sidebar li.chapter-item.active a,
#left-sidebar li.active a,
#left-sidebar li.active a:link,
#left-sidebar li.active a:visited,
#left-sidebar li.active a:hover,
#left-sidebar ol.chapter li.chapter-item.active a,
#left-sidebar ol.chapter li.active a,
#left-sidebar ol.section li.active a {
    color: #c2410c !important;
}
#left-sidebar li.chapter-item.active {
    color: #c2410c !important;
}
#left-sidebar li.active:before {
    color: inherit;
}
#sidebar li.active a,
#sidebar li.active a:link,
#sidebar li.active a:visited,
#sidebar li.active a:hover {
    color: #c2410c !important;
}
#left-sidebar li.chapter-item:not(:has(a)) {
    color: #595959;
    cursor: default;
}
#left-sidebar ol.chapter span,
#left-sidebar ol.section span {
    font-size: 1em;
    line-height: 1.5;
}
.tab-button { 
    padding: 0px; 
    margin-right: 5px; 
    cursor: pointer;
    border: none;
}
.active-tab,
.active-tab:link,
.active-tab:visited,
.active-tab:hover { 
    color: #c2410c !important;
}
.tab-content {
    display: none;
    padding: 10px;
}
.active-content {
    display: block;
}
.contents-categories, .contents-quick-links, .contents-recent {
    list-style-type: none;
    padding-left: 0;
}
.contents-categories li, .contents-quick-links li {
    margin-bottom: 5px;
}
.category-link {
    color: #166534 !important;
}
.recently-opened-container {
    display: flex;
    align-items: center;
    gap: 5px;
}
.nav-arrow {
    background: none;
    border: 1px solid #166534;
    color: #166534;
    cursor: pointer;
    padding: 5px 10px;
    font-size: 0.9em;
    border-radius: 3px;
}
.nav-arrow:hover {
    background-color: #166534;
    color: white;
}
.nav-arrow:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}
.contents-recent {
    flex: 1;
    margin: 0;
}
.contents-recent li {
    font-size: 0.9em;
    margin-bottom: 3px;
}

