:root {
    /* Light Mode Colors (Default) */
    --accent-dark: hsl(255, 60%, 40%);
    --accent-light: hsl(255, 100%, 60%);
    --accent-lighter: hsl(255, 60%, 80%);
    --mute-dark: #ccc;
    --mute-light: #eee;
    --main-text: #17252A;
    --light-text: #fff;
    --problem-body: hsl(32, 70%, 90%);
    --problem-accent: hsl(32, 70%, 50%);
    --code-bg: #e0e0e0;
    --code-body: #c7254e;

    /* Semantic Colors - Light Mode */
    --bg-primary: #ffffff;
    --bg-secondary: #f5f5f5;
    --text-primary: #17252A;
    --text-secondary: #555;
    --text-muted: #999;
    --border-primary: #000000;
    --border-secondary: #ccc;
    --border-light: #eee;
    --selection-bg: hsl(255, 60%, 80%);
    --selection-text: #000000;
    --copy-btn-bg: rgba(255, 255, 255, 0.9);
    --copy-btn-hover: #f5f5f5;
    --copy-btn-active: #e0e0e0;
    --copy-btn-success: #d4edda;
    --copy-btn-success-border: #28a745;
    --code-editor-bg: #2e3440;
    --code-editor-text: #d8dee9;
    --thead-bg: #999;
    --img-inversion: 0%;

    /* Fonts */
    --head-font: 'Arial Black', 'Gadget', 'Roboto-Black', sans-serif;
    --thin-font: Arial, Helvetica, sans-serif;
    --body-font: 'Times New Roman', Times, serif;
    --mono-font: 'Courier New', Courier, monospace;
}

[data-theme="dark"] {
    /* Dark Mode Color Overrides */
    --accent-dark: hsl(255, 70%, 65%);
    --accent-light: hsl(255, 80%, 70%);
    --accent-lighter: hsl(255, 50%, 45%);
    --mute-dark: #555;
    --mute-light: #3a3a3a;
    --main-text: #e0e0e0;
    --light-text: #1a1a1a;
    --problem-body: hsl(32, 30%, 20%);
    --problem-accent: hsl(32, 60%, 55%);
    --code-bg: #333333;
    --code-body: #ffc107;

    /* Semantic Colors - Dark Mode */
    --bg-primary: #1a1a1a;
    --bg-secondary: #252525;
    --text-primary: #e0e0e0;
    --text-secondary: #b0b0b0;
    --text-muted: #888;
    --border-primary: #555;
    --border-secondary: #666;
    --border-light: #3a3a3a;
    --selection-bg: hsl(255, 50%, 35%);
    --selection-text: #ffffff;
    --copy-btn-bg: rgba(42, 42, 42, 0.9);
    --copy-btn-hover: #3a3a3a;
    --copy-btn-active: #252525;
    --copy-btn-success: #1e4620;
    --copy-btn-success-border: #28a745;
    --code-editor-bg: #1e1e1e;
    --code-editor-text: #d8dee9;
    --thead-bg: #4a4a4a;
    --img-inversion: 90%;
}

::selection {
    color: var(--selection-text);
    background-color: var(--selection-bg);
}


/* Default elements */

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

html {
    transition: background-color 0.3s ease, color 0.3s ease;
}

html,
body {
    height: 100%;
    font-size: 18px;
    color: var(--text-primary);
    font-family: var(--body-font);
    background-color: var(--bg-primary);
}

h1,
h2,
h3,
h4,
h5,
h6 {
    margin-top: 30px;
    padding: 10px 0px;
    font-weight: 700;
    font-family: var(--head-font);
    text-transform: uppercase;
}

h1 {
    font-size: 1.6rem;
}

h2 {
    font-size: 1.4rem;
}

h3 {
    font-size: 1.2rem;
}

h4 {
    font-size: 1.0rem;
}

p {
    margin-bottom: 20px;
}

a {
    color: var(--accent-light);
    text-decoration: none;
}

ul,
ol {
    margin-bottom: 30px;
}

ul li,
ol li {
    margin: 10px 0px 0px 30px;
}

ul li:last-of-type,
ol li:last-of-type {
    margin-bottom: 10px;
}

a:hover,
a:focus,
a:active {
    color: var(--accent-dark);
    text-decoration: none;
}

a:focus {
    outline: none;
}

a:hover,
a:active {
    outline: 0;
}

img {
    display: block;
    max-width: 100%;
    margin: 0px auto;
    filter: invert(var(--img-inversion));
}

img.emoji {
    display: inline;
    margin-bottom: -2px;
}

figure {
    max-width: 100%;
    margin: 20px auto;
    text-align: center;
}


/* Top level elements */

.site-body {
    width: 100%;
    display: flex;
    flex-direction: column;
}

.site-header,
.site-main,
.site-footer {
    width: 100%;
    padding: 0px 20px;
    margin: 0px auto;
}

.site-header {
    font-family: var(--body-font);
    text-align: center;
    border-bottom: 1px solid var(--mute-dark);
}

.site-header nav {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    padding: 5px 0;
}

.site-header .nav-left {
    grid-column: 2;
    text-align: center;
    white-space: nowrap;
}

/* Theme Toggle Button */
.theme-toggle {
    grid-column: 3;
    justify-self: end;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.theme-toggle:hover {
    background-color: var(--bg-secondary);
}

.theme-toggle svg {
    color: var(--text-primary);
    transition: transform 0.3s ease;
}

.theme-toggle:hover svg {
    transform: rotate(15deg);
}

.theme-toggle .moon-icon {
    display: none;
}

[data-theme="dark"] .theme-toggle .sun-icon {
    display: none;
}

[data-theme="dark"] .theme-toggle .moon-icon {
    display: inline;
}

.site-main {
    flex: 1 0 auto;
}

.site-footer {
    flex-shrink: 0;
    padding: 10px;
    font-family: var(--body-font);
    text-align: center;
    font-size: 0.8em;
    border-top: 1px solid var(--mute-dark);
}


/* Customizations */

.site-header h1 {
    margin-top: unset;
    padding-top: 5px;
    padding-bottom: 30px;
    text-transform: none;
}

.site-header nav {
    padding-bottom: 5px;
    margin-top: 10px;
    font-weight: 700;
    font-family: var(--head-font);
}

.article-content {
    margin-bottom: 60px;
}

.article-content h4+h5 {
    margin-top: 0px;
}

.article-footer {
    margin: 20px auto;
    text-align: center;
}

.article-footer-message {
    padding-bottom: 26px;
}

.article-nav {
    display: flex;
    flex-flow: row nowrap;
    align-items: center;
    justify-content: space-between;
    padding: 20px 0px;
    border-top: 1px solid var(--mute-light);
    border-bottom: 1px solid var(--mute-light);
    font-family: var(--head-font);
    font-size: 0.8em;
}

.article-nav>div {
    display: flex;
}

.article-nav-left {
    text-align: left;
    flex-direction: column;
}

.article-nav-middle {
    font-size: 1.2em;
}

.article-nav-right {
    flex-direction: column-reverse;
    text-align: right;
}

.article-nav>div>span {
    min-width: 72px;
    padding-top: 6px;
    font-family: var(--thin-font);
}

hr {
    border: 0;
    height: 1px;
    width: 100%;
    margin: 30px 0;
    background-color: var(--mute-light);
    background-image: none;
}

.article-content blockquote,
.page-content blockquote {
    margin: 20px auto;
    padding: 5px 0px 5px 15px;
    border-left: 5px solid var(--main-text);
}

.article-content blockquote:first-of-type {
    margin: 20px auto;
    padding: 10px 20px;
    font-size: 1.05em;
    background: var(--problem-body);
    border-left: 5px solid var(--problem-accent);
}

.article-content blockquote:first-of-type p {
    margin: 20px auto;
}

.article-content blockquote:first-of-type ol {
    margin-bottom: 0px;
}

.article-content blockquote:first-of-type ol {
    list-style: lower-alpha;
}

.article-content blockquote:first-of-type ol>li::marker {
    font-style: italic;
    font-weight: 700;
}

.article-content blockquote:first-of-type ol.numeric-list {
    margin-bottom: 30px;
}

.article-content blockquote:first-of-type ol.numeric-list>li::marker {
    font-style: normal;
    font-weight: normal;
}

.article-content blockquote ol li .katex-display,
.article-content blockquote ol li .katex-display>.katex,
.article-content blockquote ol li .katex-display>.katex>.katex-html {
    display: inline;
}

blockquote p {
    margin: 5px auto;
}

.indented {
    padding-left: 30px;
}

.article-content blockquote blockquote {
    border-left: unset !important;
    padding: 0 !important;
    padding-left: 30px !important;
}

/* aside */

aside {
    margin: 30px auto;
}

aside h4 {
    margin-top: 0;
    padding: 10px;
    font-size: 0.9em;
}

aside div {
    padding: 10px;
    padding-bottom: 0px;
}

aside.info h4 {
    color: var(--light-text);
    background-color: var(--main-text);
    border: 1px solid var(--main-text);
}

aside.info div {
    border: 1px solid var(--main-text);
}


/* Disqus archive */

.disqus-archive {
    margin: 20px 0 40px;
    padding: 0 20px;
}

.disqus-archive-title {
    font-family: var(--thin-font);
    font-size: 0.75em;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin: 0 0 4px;
}

.disqus-archive-note {
    font-family: var(--thin-font);
    font-size: 0.75em;
    color: var(--text-muted);
    font-style: italic;
    margin: 0 0 12px;
}

.disqus-archive-comment {
    padding: 10px 0;
    border-bottom: 1px solid var(--border-light);
}

.disqus-archive-comment:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.disqus-archive-meta {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 4px;
}

.disqus-archive-author {
    font-family: var(--thin-font);
    font-size: 0.8em;
    font-weight: bold;
    color: var(--text-primary);
}

.disqus-archive-date {
    font-family: var(--thin-font);
    font-size: 0.7em;
    color: var(--text-muted);
}

.disqus-archive-body {
    font-family: var(--thin-font);
    font-size: 0.82em;
    line-height: 1.5;
    color: var(--text-secondary);
}

/* KaTeX override */

.katex-display.fleqn>.katex {
    padding-left: 0.4em;
}

.katex {
    font-size: 1em !important;
}

.katex-display {
    width: 0;
    min-width: 100%;
    overflow: auto;
    overflow-x: auto;
    overflow-y: hidden;
    outline: none;
}

h3 .katex,
h4 .katex,
h5 .katex {
    text-transform: initial;
}


/* CLRS pseudo code */

.latex-pseudo-code,
.highlight {
    width: 0;
    min-width: 100%;
    margin: 30px auto;
    font-size: 0.9em;
    text-align: left;
    overflow-x: auto;
}

.latex-pseudo-code {
    position: relative;
    border-top: 2px solid var(--border-primary);
    border-bottom: 2px solid var(--border-primary);
}

blockquote .latex-pseudo-code {
    border-top: none;
    border-bottom: none;
}

code {
    font-family: 'JetBrains Mono', 'Courier New', Courier, monospace;
    font-size: 0.7em;
    padding: 0.2em 0.4em;
    border-radius: 3px;
    color: var(--code-body);
    background-color: var(--code-bg);
}

.latex-pseudo-code .katex-display {
    margin: 0.5em 0;
}

/* Copy button for pseudo-code */

.copy-code-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 6px 8px;
    background-color: var(--copy-btn-bg);
    border: 1px solid var(--border-secondary);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.copy-code-btn:hover {
    background-color: var(--copy-btn-hover);
    border-color: var(--text-muted);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.copy-code-btn:active {
    background-color: var(--copy-btn-active);
    transform: translateY(1px);
}

.copy-code-btn.copied {
    background-color: var(--copy-btn-success);
    border-color: var(--copy-btn-success-border);
}

.copy-code-btn .check-icon {
    display: none;
    color: var(--copy-btn-success-border);
}

.copy-code-btn .copy-icon {
    display: inline;
    color: var(--text-primary);
}

/* Ensure button is accessible and doesn't interfere with code */
.latex-pseudo-code:hover .copy-code-btn {
    opacity: 1;
}

/* ============================================
   Print Styles
   ============================================ */

@media print {
    /* Reset to light mode colors for print */
    :root,
    [data-theme="dark"] {
        --bg-primary: #ffffff;
        --bg-secondary: #f5f5f5;
        --text-primary: #000000;
        --text-secondary: #333333;
        --text-muted: #666666;
        --border-primary: #000000;
        --border-secondary: #cccccc;
        --main-text: #000000;
        --light-text: #ffffff;
        --thead-bg: #e0e0e0;
        --code-editor-bg: #f5f5f5;
        --code-editor-text: #000000;
    }

    /* General print settings */
    * {
        background: transparent !important;
        color: #000 !important;
        box-shadow: none !important;
        text-shadow: none !important;
    }

    body {
        font-size: 12pt;
        line-height: 1.5;
        background: white;
        color: black;
    }

    /* Hide interactive and navigation elements */
    .theme-toggle,
    .copy-code-btn,
    .site-footer,
    .article-nav,
    .article-footer-message,
    .support-message,
    #disqus_thread,
    .disqus,
    [id^="disqus"],
    [class*="disqus"],
    .comment,
    .comments,
    .disqus-archive,
    .code-editor-button,
    .code-editor-wrapper,
    #python-implementation,
    #code-implementation,
    #implementation,
    .chapter-title:not(.ignore),
    nav {
        display: none !important;
    }

    /* Hide Disqus iframes and embeds */
    iframe[src*="disqus"] {
        display: none !important;
    }

    /* Header - simplified for print */
    .site-header {
        border-bottom: 2px solid #000;
        padding-bottom: 10pt;
        margin-bottom: 20pt;
    }

    .site-header h1 {
        font-size: 18pt;
        margin: 0;
        padding: 0;
    }

    /* Page title */
    .page-title {
        font-size: 16pt;
        margin-top: 10pt;
    }

    /* Headings */
    h2 {
        font-size: 14pt;
        margin-top: 16pt;
        margin-bottom: 8pt;
        page-break-after: avoid;
    }

    h3 {
        font-size: 13pt;
        margin-top: 12pt;
        margin-bottom: 6pt;
        page-break-after: avoid;
    }

    h4 {
        font-size: 12pt;
        margin-top: 10pt;
        margin-bottom: 5pt;
        page-break-after: avoid;
    }

    h5 {
        font-size: 11pt;
        margin-top: 8pt;
        margin-bottom: 4pt;
        page-break-after: avoid;
    }

    /* Prevent orphans and widows */
    p,
    li {
        orphans: 3;
        widows: 3;
    }

    /* Links - show URLs for external links */
    a {
        color: #000;
        text-decoration: underline;
    }

    a[href^="http"]:after {
        content: " (" attr(href) ")";
        font-size: 90%;
        font-style: italic;
    }

    /* Don't show URLs for internal navigation */
    a[href^="#"]:after,
    a[href^="/"]:after {
        content: "";
    }

    /* Pseudo-code blocks */
    .latex-pseudo-code {
        border: 2px solid #000;
        padding: 10pt;
        page-break-inside: avoid;
        margin: 10pt 0;
        background: white !important;
    }

    .latex-pseudo-code .katex {
        font-size: 11pt;
    }

    /* Code blocks */
    pre,
    code {
        border: 1px solid #000;
        page-break-inside: avoid;
        background: #f5f5f5 !important;
        font-size: 10pt;
    }

    .highlight {
        page-break-inside: avoid;
    }

    /* Aside boxes */
    aside {
        border: 2px solid #000;
        padding: 10pt;
        margin: 10pt 0;
        page-break-inside: avoid;
        background: white !important;
    }

    aside h4 {
        background: #e0e0e0 !important;
        color: #000 !important;
        border: none !important;
        padding: 5pt;
        margin: -10pt -10pt 10pt -10pt;
    }

    aside div {
        background: white !important;
        border: none !important;
        padding: 0 !important;
    }

    /* Tables */
    table {
        border-collapse: collapse;
        page-break-inside: avoid;
        margin: 10pt 0;
        font-size: 10pt;
    }

    th,
    td {
        border: 1px solid #000;
        padding: 4pt 8pt;
    }

    thead {
        background: #e0e0e0 !important;
        font-weight: bold;
    }

    /* Images */
    img {
        max-width: 100% !important;
        page-break-inside: avoid;
    }

    figure {
        page-break-inside: avoid;
    }


    /* Blockquotes */
    blockquote {
        border-left: 4px solid #000;
        padding-left: 10pt;
        margin-left: 0;
        page-break-inside: avoid;
    }

    /* Lists */
    ul,
    ol {
        page-break-inside: avoid;
    }

    /* KaTeX math - ensure visibility */
    .katex {
        font-size: 11pt;
    }

    .katex-display {
        margin: 10pt 0;
        page-break-inside: avoid;
    }

    /* Remove all shadows and transitions */
    * {
        transition: none !important;
        animation: none !important;
    }

    /* Page breaks */
    .article-content > h2,
    .article-content > h3 {
        page-break-before: auto;
    }

    /* Prevent breaking after headings */
    h1, h2, h3, h4, h5, h6 {
        page-break-after: avoid;
    }

    /* Keep related content together */
    .latex-pseudo-code,
    pre,
    aside,
    table,
    figure,
    blockquote {
        page-break-inside: avoid;
    }

    /* Add page header */
    @page {
        margin: 2cm;
        font-weight: bold;
        @top-center {
            content: "CLRS Solutions";
        }
    }
}


/* Table */

table {
    margin: 10px auto;
    margin-bottom: 20px;
}

table,
th,
td {
    border-collapse: collapse;
    border: 1px solid var(--main-text);
}

th,
td {
    padding: 2px 10px;
}

thead {
    background-color: var(--thead-bg);
}


/* Graph stuff */

.graph-box {
    margin: 20px auto;
    max-width: calc(100vw - 40px);
    height: 400px;
    border: 1px solid var(--mute-dark);
}

.graph-credit {
    position: relative;
    margin: -36px 0 15px 0;
    text-align: center;
    font-size: 0.6em;
}


/* Code editor */

.code-editor-wrapper {
    padding: 0px;
    overflow-x: auto;
    max-width: 100vw;
    margin: 0px -20px;
}

.code-editor-output {
    overflow-x: auto;
    min-height: 64px;
    max-height: 128px;
    max-width: 100%;
    border: 0px;
    padding: 10px;
    border-radius: unset;
    border-top: 2px solid var(--text-muted);
    color: var(--code-editor-text);
    background-color: var(--code-editor-bg);
    font-size: 16px;
}

.code-editor-buttons {
    margin: 5px auto;
    width: 206px;
}

.code-editor-button {
    min-width: 100px;
    text-align: center;
    text-decoration: none;
    padding: 10px 0px;
    text-transform: uppercase;
    background-color: var(--border-secondary);
    color: var(--text-primary);
    border: unset;
    font-family: var(--head-font);
    transition: all 0.2s ease;
}

.code-editor-button:hover {
    color: var(--bg-primary);
    background-color: var(--text-primary);
    box-shadow: 0 5px 5px 0 rgba(0, 0, 0, .3);
}


/* Disqus */

#disqus_thread {
    min-height: 100px;
    font-family: var(--thin-font);
}


/* Table of Content */

.clrs-toc {
    display: flex;
    flex-direction: column;
    margin-top: 10px;
    margin-bottom: 50px;
}

.clrs-chapter {
    width: 100%;
    margin: 5px auto;
}

.chapter-title {
    padding-left: 10px;
    background-color: var(--mute-light);
}

.chapter-title:not(.ignore) {
    cursor: pointer;
}

.chapter-title h4 {
    margin: 0;
}

.chapter-title-active:not(.ignore),
.chapter-title:not(.ignore):hover {
    color: var(--mute-light);
    background-color: var(--main-text);
}

.chapter-entry {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.2s ease-out;
}

.clrs-section {
    display: grid;
    grid-row-gap: 5px;
    grid-template-rows: auto;
    grid-template-columns: 36px 1fr;
    grid-template-areas: "section-id section-title" ".          problem-list";
    padding: 10px;
}

.section-id {
    grid-area: section-id;
    font-weight: 700;
}

.section-title {
    grid-area: section-title;
    font-weight: 700;
}

.problem-list {
    grid-area: problem-list;
    display: flex;
    flex-flow: row wrap;
}

.problem-list>span {
    min-width: 72px;
}


/* Extra stuff */

.rainbow {
    background-image: -webkit-gradient( linear, left top, right top, color-stop(0, #f22), color-stop(0.15, #f2f), color-stop(0.3, #22f), color-stop(0.45, #2ff), color-stop(0.6, #2f2), color-stop(0.75, #2f2), color-stop(0.9, #ff2), color-stop(1, #f22));
    background-image: gradient( linear, left top, right top, color-stop(0, #f22), color-stop(0.15, #f2f), color-stop(0.3, #22f), color-stop(0.45, #2ff), color-stop(0.6, #2f2), color-stop(0.75, #2f2), color-stop(0.9, #ff2), color-stop(1, #f22));
    color: transparent;
    -webkit-background-clip: text;
    background-clip: text;
}

.support-message {
    display: none;
    text-align: center;
    font-size: 0.8em;
    border: 1px dashed var(--border-primary);
    padding: 16px;
}

.support-message header {
    font-family: var(--head-font);
    margin-bottom: 5px;
}

.support-message section p:last-of-type {
    margin-bottom: 0px;
}


/* Extra small devices (phones, 600px and down) */

@media only screen and (max-width: 600px) {
    /* Reduce font size for smaller screens */
    body {
        font-size: 16px;
    }

    /* Header optimizations */
    .site-header h1 {
        font-size: 1.5em;
        padding-bottom: 15px;
    }

    .site-header nav {
        font-size: 0.85em;
    }

    .site-header .nav-left {
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* Larger touch target for theme toggle */
    .theme-toggle {
        padding: 12px;
        min-width: 44px;
        min-height: 44px;
    }

    /* Article navigation - wrap layout on mobile */
    .article-nav {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 15px;
        padding: 15px 0;
        justify-content: space-between;
    }

    .article-nav-middle {
        order: -1;
        width: 100%;
        font-size: 1.5em;
        justify-content: center;
        text-align: center;
    }

    .article-nav-left,
    .article-nav-right {
        flex: 1;
        flex-direction: row;
        justify-content: center;
        align-items: center;
        gap: 8px;
        min-width: 0;
    }

    .article-nav-left {
        justify-content: flex-start;
    }

    .article-nav-right {
        justify-content: flex-end;
    }

    .article-nav>div>span {
        min-width: 50px;
        text-align: center;
    }

    /* Pseudo-code optimizations */
    .latex-pseudo-code {
        font-size: 0.85em;
    }

    .copy-code-btn {
        padding: 8px 10px;
        min-width: 44px;
        min-height: 44px;
        right: 4px;
        top: 4px;
    }

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

    /* Aside boxes - reduce padding */
    aside h4 {
        padding: 8px;
        font-size: 0.85em;
    }

    aside div {
        padding: 8px;
    }

    /* Tables - improve scrolling */
    table {
        font-size: 0.9em;
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }

    th,
    td {
        padding: 4px 8px;
    }

    /* Chapter navigation - adjust grid */
    .clrs-section {
        grid-template-columns: 30px 1fr;
        padding: 8px;
        font-size: 0.95em;
    }

    .chapter-title {
        padding-left: 8px;
    }

    .chapter-title h4 {
        font-size: 1em;
    }

    /* Code editor - prevent overflow */
    .code-editor-wrapper {
        margin: 0px -10px;
    }

    .code-editor-button {
        min-width: 80px;
        padding: 12px 8px;
        font-size: 0.9em;
    }

    /* Reduce vertical spacing */
    .article-content {
        margin-bottom: 40px;
    }

    h2 {
        font-size: 1.5em;
    }

    h3 {
        font-size: 1.3em;
    }

    h4 {
        font-size: 1.1em;
    }

    h5 {
        font-size: 1em;
    }
}


/* Small devices (portrait tablets and large phones, 600px and up) */

@media only screen and (min-width: 600px) {
    /* Slightly larger touch targets than mobile but smaller than desktop */
    .theme-toggle {
        min-width: 40px;
        min-height: 40px;
    }

    .copy-code-btn {
        min-width: 40px;
        min-height: 40px;
    }
}


/* Medium devices (landscape tablets, 768px and up) */

@media only screen and (min-width: 768px) {
    body {
        font-size: 20px;
    }
    .latex-pseudo-code,
    figure.highlight {
        font-size: 1em;
    }
    .graph-box {
        max-width: 400px;
    }
    .section-title,
    .problem-list>span {
        min-width: 100px;
    }
    img {
        max-width: 600px;
    }
}


/* Large devices (laptops/desktops, 992px and up) */

@media only screen and (min-width: 992px) {
    .site-main,
    .site-header,
    .site-footer {
        width: 992px;
    }
    .clrs-toc {
        width: calc(992px - 40px);
    }
    img {
        max-width: 600px;
    }
}


/* Extra large devices (large laptops and desktops, 1200px and up) */

@media only screen and (min-width: 1200px) {}