/* Extremely compact list styles to save maximum space */

/* Make all lists inline by default */
.markdown-content ul,
.markdown-content ol {
    padding: 0;
    margin: 0;
    list-style-position: inside;
    display: block;
}

/* Minimal spacing for list items */
.markdown-content li {
    margin: 0;
    padding: 0;
    line-height: 1.1;
    display: block;
    white-space: normal;
}

/* No spacing between list items */
.markdown-content li+li {
    margin-top: 0;
}

/* Extremely compact bullets and numbers positioned to the left of text */
.markdown-content ul {
    list-style: none;
}

.markdown-content ul li {
    position: relative;
    padding-left: 0.7em;
    text-indent: 0;
}

.markdown-content ul li::before {
    content: "•";
    position: absolute;
    left: 0;
    top: 0.1em;
    font-size: 0.7em;
    line-height: inherit;
}

.markdown-content ol {
    list-style: none;
    counter-reset: item;
}

.markdown-content ol li {
    counter-increment: item;
    position: relative;
    padding-left: 1em;
    text-indent: 0;
}

.markdown-content ol li::before {
    content: counter(item) ".";
    position: absolute;
    left: 0;
    top: 0;
    font-size: 0.8em;
    line-height: inherit;
    text-align: left;
}

/* Fix alignment for multi-line list items */
.markdown-content li p {
    display: inline;
    margin: 0;
}

/* Nested lists with minimal indentation */
.markdown-content li>ul,
.markdown-content li>ol {
    margin: 0;
    padding-left: 0.5em;
}

/* Horizontal list option for extreme compactness */
.markdown-content ul.horizontal,
.markdown-content ol.horizontal {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5em;
}

.markdown-content ul.horizontal li,
.markdown-content ol.horizontal li {
    margin-right: 0.5em;
}

/* Ultra-compact description lists */
.markdown-content dl {
    margin: 0.1em 0;
}

.markdown-content dt {
    font-weight: bold;
    margin: 0;
    display: inline;
}

.markdown-content dt::after {
    content: ": ";
}

.markdown-content dd {
    margin: 0;
    padding: 0;
    line-height: 1.2;
    display: inline;
}

.markdown-content dd::after {
    content: "";
    display: block;
    margin-bottom: 0.1em;
}

/* Ultra-compact tables */
.markdown-content table {
    margin: 0.2em 0;
    border-collapse: collapse;
    font-size: 0.9em;
}

.markdown-content th,
.markdown-content td {
    padding: 0.1em 0.3em;
    border: 1px solid var(--jp-border-color2, #ddd);
}

/* Ultra-compact blockquotes */
.markdown-content blockquote {
    margin: 0.2em 0 0.2em 0.3em;
    padding: 0 0.3em;
    border-left: 2px solid var(--jp-border-color2, #ddd);
    font-size: 0.95em;
}

/* Ultra-compact paragraphs */
.markdown-content p {
    margin: 0.1em 0;
    line-height: 1.3;
}

/* Ultra-compact headings */
.markdown-content h1,
.markdown-content h2,
.markdown-content h3,
.markdown-content h4,
.markdown-content h5,
.markdown-content h6 {
    margin: 0.3em 0 0.1em 0;
    line-height: 1.1;
}

.markdown-content h1 {
    font-size: 1.3em;
}

.markdown-content h2 {
    font-size: 1.2em;
}

.markdown-content h3 {
    font-size: 1.1em;
}

.markdown-content h4,
.markdown-content h5,
.markdown-content h6 {
    font-size: 1em;
}

/* Ultra-compact code blocks */
.markdown-content pre {
    margin: 0.2em 0;
    padding: 0.3em;
    font-size: 0.9em;
}

.markdown-content code {
    padding: 0.05em 0.15em;
    font-size: 0.9em;
}

/* Reduce spacing between all elements */
.markdown-content>*+* {
    margin-top: 0.2em !important;
}