:root {
    --color-mimosa: #89a041;
    --color-mimosa--light: #b3c675;
    --color-mimosa--dark: #6e832e;

    --color-mimosa-second: #2297d5;
    --color-mimosa-second--light: #81c5e9;
    --color-mimosa-second--dark: #1d7eb2;

    --md-primary-fg-color: var(--color-mimosa);
    --md-primary-fg-color--light: var(--color-mimosa--light);
    --md-primary-fg-color--dark: var(--color-mimosa--dark);

    --md-accent-fg-color: var(--color-mimosa-second);
    --md-accent-fg-color--light: var(--color-mimosa-second--light);
    --md-accent-fg-color--dark: var(--color-mimosa-second--dark);
    --md-external-link-icon: url('data:image/svg+xml;charset=utf-8,<svg viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"><path d="M3.75 2h3.5a.75.75 0 0 1 0 1.5h-3.5a.25.25 0 0 0-.25.25v8.5c0 .138.112.25.25.25h8.5a.25.25 0 0 0 .25-.25v-3.5a.75.75 0 0 1 1.5 0v3.5A1.75 1.75 0 0 1 12.25 14h-8.5A1.75 1.75 0 0 1 2 12.25v-8.5C2 2.784 2.784 2 3.75 2Zm6.854-1h4.146a.25.25 0 0 1 .25.25v4.146a.25.25 0 0 1-.427.177L13.03 4.03 9.28 7.78a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042l3.75-3.75-1.543-1.543A.25.25 0 0 1 10.604 1Z"></path></svg>')
}

.md-typeset .md-button {
    margin: 2px 0;
}

nav.md-nav a[target=_blank]::after {
    background-color: gray;
    -webkit-mask-image: var(--md-external-link-icon);
    mask-image: var(--md-external-link-icon);
    width: 16px;
    height: 16px;
    margin-top: 1px;
    margin-left: -2px;
    content: ""
}

.md-nav__link svg {
    width: 20px;
}

.param_group .param_content {
    padding-left: 30px;
    border-left: 3px solid #f0f0f0;
}

.param_group .param_group_breadcrumbs {
    color: #CCC;
}

[data-md-color-scheme="slate"] {
    .param_group {
        .param_content {
            border-left-color: #555;
        }

        .param_group_breadcrumbs {
            color: #666;
        }
    }
}

.param_anchor {
    margin-top: -3em;
    padding-top: 2em;
    display: block;
}

.param-enum-option {
    display: inline-flex;
    align-items: center;
    gap: 0.35em;
}

.param-enum-option > .md-clipboard {
    opacity: 0;
    transition: opacity 0.15s, color 0.25s;
}

.param-enum-option:hover > .md-clipboard,
.param-enum-option:focus-within > .md-clipboard {
    opacity: 1;
}

/* Match the theme's :target specificity and leave room for the entry title. */
.md-typeset .variable_anchor {
    display: block;
    scroll-margin-top: 6rem;
}

.modebar {
    display: none !important;
}

.md-typeset h5.no-nav {
    margin-top: -7px;
}

/********** Custom admonition **********/
:root {
    --md-admonition-icon--variable: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" ><path d="M16 12a4 4 0 1 1-8 0 4 4 0 0 1 8 0Zm-1.5 0a2.5 2.5 0 1 0-5 0 2.5 2.5 0 0 0 5 0Z" /><path d="M12 1c.266 0 .532.009.797.028.763.055 1.345.617 1.512 1.304l.352 1.45c.019.078.09.171.225.221.247.089.49.19.728.302.13.061.246.044.315.002l1.275-.776c.603-.368 1.411-.353 1.99.147.402.349.78.726 1.128 1.129.501.578.515 1.386.147 1.99l-.776 1.274c-.042.069-.058.185.002.315.112.238.213.481.303.728.048.135.142.205.22.225l1.45.352c.687.167 1.249.749 1.303 1.512.038.531.038 1.063 0 1.594-.054.763-.616 1.345-1.303 1.512l-1.45.352c-.078.019-.171.09-.221.225-.089.248-.19.491-.302.728-.061.13-.044.246-.002.315l.776 1.275c.368.603.353 1.411-.147 1.99-.349.402-.726.78-1.129 1.128-.578.501-1.386.515-1.99.147l-1.274-.776c-.069-.042-.185-.058-.314.002a8.606 8.606 0 0 1-.729.303c-.135.048-.205.142-.225.22l-.352 1.45c-.167.687-.749 1.249-1.512 1.303-.531.038-1.063.038-1.594 0-.763-.054-1.345-.616-1.512-1.303l-.352-1.45c-.019-.078-.09-.171-.225-.221a8.138 8.138 0 0 1-.728-.302c-.13-.061-.246-.044-.315-.002l-1.275.776c-.603.368-1.411.353-1.99-.147-.402-.349-.78-.726-1.128-1.129-.501-.578-.515-1.386-.147-1.99l.776-1.274c.042-.069.058-.185-.002-.314a8.606 8.606 0 0 1-.303-.729c-.048-.135-.142-.205-.22-.225l-1.45-.352c-.687-.167-1.249-.749-1.304-1.512a11.158 11.158 0 0 1 0-1.594c.055-.763.617-1.345 1.304-1.512l1.45-.352c.078-.019.171-.09.221-.225.089-.248.19-.491.302-.728.061-.13.044-.246.002-.315l-.776-1.275c-.368-.603-.353-1.411.147-1.99.349-.402.726-.78 1.129-1.128.578-.501 1.386-.515 1.99-.147l1.274.776c.069.042.185.058.315-.002.238-.112.481-.213.728-.303.135-.048.205-.142.225-.22l.352-1.45c.167-.687.749-1.249 1.512-1.304C11.466 1.01 11.732 1 12 1Zm-.69 1.525c-.055.004-.135.05-.161.161l-.353 1.45a1.832 1.832 0 0 1-1.172 1.277 7.147 7.147 0 0 0-.6.249 1.833 1.833 0 0 1-1.734-.074l-1.274-.776c-.098-.06-.186-.036-.228 0a9.774 9.774 0 0 0-.976.976c-.036.042-.06.131 0 .228l.776 1.274c.314.529.342 1.18.074 1.734a7.147 7.147 0 0 0-.249.6 1.831 1.831 0 0 1-1.278 1.173l-1.45.351c-.11.027-.156.107-.16.162a9.63 9.63 0 0 0 0 1.38c.004.055.05.135.161.161l1.45.353a1.832 1.832 0 0 1 1.277 1.172c.074.204.157.404.249.6.268.553.24 1.204-.074 1.733l-.776 1.275c-.06.098-.036.186 0 .228.301.348.628.675.976.976.042.036.131.06.228 0l1.274-.776a1.83 1.83 0 0 1 1.734-.075c.196.093.396.176.6.25a1.831 1.831 0 0 1 1.173 1.278l.351 1.45c.027.11.107.156.162.16a9.63 9.63 0 0 0 1.38 0c.055-.004.135-.05.161-.161l.353-1.45a1.834 1.834 0 0 1 1.172-1.278 6.82 6.82 0 0 0 .6-.248 1.831 1.831 0 0 1 1.733.074l1.275.776c.098.06.186.036.228 0 .348-.301.675-.628.976-.976.036-.042.06-.131 0-.228l-.776-1.275a1.834 1.834 0 0 1-.075-1.733c.093-.196.176-.396.25-.6a1.831 1.831 0 0 1 1.278-1.173l1.45-.351c.11-.027.156-.107.16-.162a9.63 9.63 0 0 0 0-1.38c-.004-.055-.05-.135-.161-.161l-1.45-.353c-.626-.152-1.08-.625-1.278-1.172a6.576 6.576 0 0 0-.248-.6 1.833 1.833 0 0 1 .074-1.734l.776-1.274c.06-.098.036-.186 0-.228a9.774 9.774 0 0 0-.976-.976c-.042-.036-.131-.06-.228 0l-1.275.776a1.831 1.831 0 0 1-1.733.074 6.88 6.88 0 0 0-.6-.249 1.835 1.835 0 0 1-1.173-1.278l-.351-1.45c-.027-.11-.107-.156-.162-.16a9.63 9.63 0 0 0-1.38 0Z" /></svg>');
    --md-admonition-icon--parameter: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M8 13c-1.86 0-3.41 1.28-3.86 3H2v2h2.14c.45 1.72 2 3 3.86 3s3.41-1.28 3.86-3H22v-2H11.86c-.45-1.72-2-3-3.86-3m0 6c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2M19.86 6c-.45-1.72-2-3-3.86-3s-3.41 1.28-3.86 3H2v2h10.14c.45 1.72 2 3 3.86 3s3.41-1.28 3.86-3H22V6zM16 9c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2"/></svg>');
    --md-admonition-icon--regional-fct: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><!--! Font Awesome Free 7.1.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2025 Fonticons, Inc.--><path d="m55.7 199.7 30.9 30.9c6 6 14.1 9.4 22.6 9.4h21.5c8.5 0 16.6 3.4 22.6 9.4l29.3 29.3c6 6 9.4 14.1 9.4 22.6v37.5c0 8.5 3.4 16.6 9.4 22.6l13.3 13.3c6 6 9.4 14.1 9.4 22.6V416c0 17.7 14.3 32 32 32s32-14.3 32-32v-2.7c0-8.5 3.4-16.6 9.4-22.6l45.3-45.3c6-6 9.4-14.1 9.4-22.6v-34.7c0-17.7-14.3-32-32-32h-82.7c-8.5 0-16.6-3.4-22.6-9.4l-16-16c-4.2-4.2-6.6-10-6.6-16 0-12.5 10.1-22.6 22.6-22.6h34.7c12.5 0 22.6-10.1 22.6-22.6 0-6-2.4-11.8-6.6-16l-19.7-19.7c-3.9-3.8-5.9-8.7-5.9-13.8s2-10 5.7-13.7L263 89c5.8-5.8 9.1-13.7 9.1-21.9 0-7.2-2.4-13.7-6.4-18.9-3.2-.1-6.4-.2-9.6-.2-95.4 0-175.7 64.2-200.3 151.7zM464 256c0-34.6-8.4-67.2-23.4-95.8-6.4.9-12.7 3.9-17.9 9.1l-13.4 13.4c-6 6-9.4 14.1-9.4 22.6V240c0 17.7 14.3 32 32 32H456c2.5 0 5-.3 7.3-.8.4-5 .5-10.1.5-15.2zM0 256a256 256 0 1 1 512 0 256 256 0 1 1-512 0"/></svg>');
}

/* Parameter admonition */
.md-typeset .admonition.parameter,
.md-typeset details.parameter,
.md-typeset .admonition.variable,
.md-typeset details.variable {
    border-color: rgba(120, 155, 43, 0.1);
}

.md-typeset .parameter>.admonition-title,
.md-typeset .parameter>summary,
.md-typeset .variable>.admonition-title,
.md-typeset .variable>summary {
    background-color: rgba(120, 155, 43, 0.1);
}

.md-typeset .parameter>.admonition-title::before,
.md-typeset .parameter>summary::before,
.md-typeset .variable>.admonition-title::before,
.md-typeset .variable>summary::before {
    background-color: var(--color-mimosa);
    -webkit-mask-image: var(--md-admonition-icon--parameter);
    mask-image: var(--md-admonition-icon--parameter);
}

.md-typeset .admonition.parameter:focus-within,
.md-typeset details.parameter:focus-within,
.md-typeset .admonition.variable:focus-within,
.md-typeset details.variable:focus-within {
    box-shadow: 0 0 0 .2rem rgba(120, 155, 43, 0.05)
}

.md-typeset .variable>.admonition-title::before,
.md-typeset .variable>summary::before {
    background-color: var(--color-mimosa);
    -webkit-mask-image: var(--md-admonition-icon--variable);
    mask-image: var(--md-admonition-icon--variable);
}

/* Regional functions admonition */
.md-typeset .admonition.regional-fct,
.md-typeset details.regional-fct {
  border-color: #BBB;
}
.md-typeset .regional-fct > .admonition-title,
.md-typeset .regional-fct > summary {
  background-color: rgba(80, 80, 80, 0.05);
}
.md-typeset .regional-fct > .admonition-title::before,
.md-typeset .regional-fct > summary::before {
  background-color: #999;
  -webkit-mask-image: var(--md-admonition-icon--regional-fct);
          mask-image: var(--md-admonition-icon--regional-fct);
}


a[href*="parameters/#"] code,
a[href*="parameters/#"]:not(:has(code)),
a[href*="param__"] code,
a[href*="param__"]:not(:has(code)),
a[href*="variables/#"] code,
a[href*="variables/#"]:not(:has(code)),
a[href^="#var__"] code,
a[href^="#var__"]:not(:has(code)) {
    position: relative;
    padding: 0.1rem .2rem 0.1rem 1.3rem;
    white-space: nowrap;
}

a[href*="parameters/#"] code::before,
a[href*="parameters/#"]:not(:has(code))::before,
a[href*="param__"] code::before,
a[href*="param__"]:not(:has(code))::before {
    content: "";
    height: .9rem;
    width: .9rem;
    mask-size: contain;
    position: absolute;
    top: .1em;
    left: 0.3em;
    background-color: currentcolor;
    mask-image: var(--md-admonition-icon--parameter)
}

a[href*="variables/#"] code::before,
a[href*="variables/#"]:not(:has(code))::before,
a[href^="#var__"] code::before,
a[href^="#var__"]:not(:has(code))::before {
    content: "";
    height: .9rem;
    width: .9rem;
    mask-size: contain;
    position: absolute;
    top: .1em;
    left: 0.3em;
    background-color: currentcolor;
    mask-image: var(--md-admonition-icon--variable)
}

/* Equation links keep their mathematical spacing, without reference icons. */
mjx-container a[href*="#var__"],
mjx-container a[href*="param__"],
mjx-container a[href*="parameters/#"] {
    padding: 0;
    &::before { content: none; }
}

.center_align_plotly .plot-container.plotly .svg-container {
    margin: 0 auto;
}

/* Tiny table: less margins */
.regional-parameter-values table {
    white-space: nowrap;
}

.tiny_table {

    table th,
    table td {
        padding-top: .3em !important;
        padding-bottom: .3em !important;
    }
}

.table_first_col_header {
    table td:first-child {
        font-weight: bold;
    }
}

.table_scrollable {
    overflow-y: auto;
    max-height: 300px;
    --top-mask-size: 40px;
    --bottom-mask-size: 40px;

    /* Use one scroll container so the header sticks to this table's viewport. */
    .md-typeset__scrollwrap {
        overflow: visible;
        margin: 0;
    }

    .md-typeset__table {
        display: block;
        padding: 0;
    }

    thead {
        position: sticky;
        top: 0;
        z-index: 1;
        background: var(--md-default-bg-color);
    }

    /* Fade the rows below the header, keeping the header itself readable. */
    thead::after {
        content: "";
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        height: var(--top-mask-size);
        background: linear-gradient(var(--md-default-bg-color), transparent);
        pointer-events: none;
        opacity: 0;
    }

    &.is-scrolled thead::after {
        opacity: 1;
    }

    &::after {
        content: "";
        display: block;
        position: sticky;
        bottom: 0;
        height: var(--bottom-mask-size);
        margin-top: calc(-1 * var(--bottom-mask-size));
        background: linear-gradient(transparent, var(--md-default-bg-color));
        pointer-events: none;
        opacity: 0;
    }

    &.has-more-below::after {
        opacity: 1;
    }

    &.extra_small {
        max-height: 200px;
    }
}

.md-typeset .admonition.question,
.md-typeset details.question {
    border-color: var(--color-mimosa);
}

.md-typeset .question>.admonition-title:before,
.md-typeset .question>summary:before {
    background-color: var(--color-mimosa);
}

.md-typeset .question>.admonition-title,
.md-typeset .question>summary {
    background-color: #89a0411a;
}

.md-typeset .admonition.tip,
.md-typeset details.tip {
    border-color: var(--color-mimosa-second);
}

.md-typeset .tip>.admonition-title:before,
.md-typeset .tip>summary:before {
    background-color: var(--color-mimosa-second);
}

.md-typeset .tip>.admonition-title,
.md-typeset .tip>summary {
    background-color: color-mix(in srgb, var(--color-mimosa-second) 10%, transparent);
}

.grey-bg {
    background: #f5f5f5;
    padding: 5px 5px;
}

.dependency-graph-modal {
    width: calc(100vw - 2rem);
    max-width: 90rem;
    height: 90vh;
    max-height: 90vh;
    padding: 1rem;
    border: 1px solid var(--md-default-fg-color--lightest);
    border-radius: .4rem;
    background: var(--md-default-bg-color);
    color: var(--md-default-fg-color);

    &[open] { display: flex; flex-direction: column; }
    &::backdrop { background: rgb(0 0 0 / 55%); }
    header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 1rem;
        margin-bottom: .8rem;
        h2 { margin: 0; font-size: 1rem; }
        button { cursor: pointer; font-size: 1.4rem; padding: 0 .4rem; }
    }
    .dependency-graph {
        display: flex;
        flex-direction: column;
        flex: 1;
        min-height: 0;
        border: 0;
        padding: 0;
    }
    .dependency-graph-viewport { flex: 1; height: auto; min-height: 0; }
}

.slr-coefficient-anchor {
    display: inline-block;
    scroll-margin-top: 4rem;
}

.slr-coefficient-card {
    padding: .5rem;
    table { margin: 0 !important; }
}

.reference-tooltip {
    position: fixed;
    z-index: 10;
    width: min(30rem, calc(100vw - 3rem));
    max-height: min(65vh, 32rem);
    overflow: auto;
    border-radius: .3rem;
    background: var(--md-default-bg-color);
    box-shadow: 0 .2rem .8rem rgb(0 0 0 / 25%);
    user-select: text;

    .admonition, details { margin: 0; }
}

/* Interactive dependency graph. */
.dependency-graph {
    border: 1px solid var(--md-default-fg-color--lightest);
    border-radius: .4rem;
    padding: .8rem;
    background: var(--md-default-bg-color);

    .dependency-graph-header {
        display: flex;
        flex-wrap: wrap;
        flex-shrink: 0;
        align-items: flex-start;
        gap: .6rem 1rem;
    }
    .dependency-graph-toolbar,
    .dependency-graph-parameters {
        flex: 1 1 24rem;
        min-width: 0;
    }
    .dependency-graph-parameters-title {
        margin: 0 0 .25rem;
        font-size: .65rem;
        font-weight: 600;
    }
    .dependency-graph-configuration {
        margin: 0;
        font-size: .65rem;
        .highlight { margin: 0; }
        pre { margin: 0; max-height: 25vh; overflow: auto; }
    }
    .dependency-graph-message {
        margin-bottom: .6rem;
        padding: .5rem;
        border: 1px solid var(--md-default-fg-color--lighter);
        border-radius: .2rem;
        font-size: .7rem;
        p { margin: 0 0 .4rem; }
        select { max-width: 100%; }
        select, button {
            padding: .25rem;
            border: 1px solid var(--md-default-fg-color--lighter);
            background: var(--md-default-bg-color);
            color: var(--md-default-fg-color);
        }
        button { cursor: pointer; }
    }

    .dependency-graph-controls {
        display: flex;
        align-items: center;
        flex-wrap: wrap;
        gap: .3rem;
        margin-bottom: .6rem;
        font-size: .65rem;

        label { display: flex; align-items: center; gap: .3rem; max-width: 100%; }
        select, button {
            border: 1px solid var(--md-default-fg-color--lighter);
            border-radius: .2rem;
            background: var(--md-default-bg-color);
            color: var(--md-default-fg-color);
            padding: .25rem .4rem;
        }
        select { min-width: 0; max-width: min(16rem, 65vw); }
        button { cursor: pointer; }
        button:hover { border-color: var(--md-accent-fg-color); }
        button:disabled { opacity: .4; cursor: default; }
        output { min-width: 2rem; text-align: center; }
    }

    .dependency-graph-legend {
        display: flex;
        flex-wrap: wrap;
        gap: .4rem 1rem;
        font-size: .65rem;

        span::before {
            content: "";
            display: inline-block;
            width: .5rem;
            height: .5rem;
            margin-right: .3rem;
            border-radius: 50%;
            background: var(--color-mimosa);
        }

        .dependency-control-key::before { background: #ed6a2f; }
        .dependency-selected-key::before {
            background: transparent;
            border: 2px solid var(--md-default-fg-color);
        }
        .dependency-incoming-key::before,
        .dependency-outgoing-key::before,
        .dependency-previous-key::before {
            width: .8rem;
            height: 0;
            background: none;
            border-radius: 0;
            border-top: 2px solid #2297d5;
            vertical-align: middle;
        }
        .dependency-outgoing-key::before { border-color: #ed6a2f; }
        .dependency-previous-key::before { border-color: #999; border-top-style: dashed; }
    }

    .dependency-graph-viewport {
        overflow: auto;
        cursor: grab;
        user-select: none;
        height: min(65vh, 600px);
        margin-top: .5rem;
        border: 1px solid var(--md-default-fg-color--lightest);
        border-radius: .2rem;
        &.is-panning, &.is-panning * { cursor: grabbing; }
    }
    svg { display: block; max-width: none; }

    .dependency-edge {
        color: #999;
        opacity: .5;

        path { fill: none; stroke: currentColor; stroke-width: 1.5; }
        polygon { fill: currentColor; stroke: currentColor; }
    }

    .dependency-edge.is-muted { opacity: .15; }
    .dependency-edge.incoming { color: #2297d5; opacity: 1; }
    .dependency-edge.outgoing { color: #ed6a2f; opacity: 1; }
    .dependency-edge.incoming path, .dependency-edge.outgoing path { stroke-width: 2.5; }

    &.is-overview .dependency-edge.normal { opacity: .5; }
    &.is-overview .dependency-node.is-muted { opacity: 1; }

    .dependency-edge.previous-time,
    &.is-overview .dependency-edge.previous-time {
        opacity: .35;
        path { stroke-dasharray: 5 5; stroke-width: 1; }
    }
    .dependency-edge.previous-time.incoming,
    .dependency-edge.previous-time.outgoing { opacity: .4; }

    .dependency-node {
        cursor: pointer;

        path {
            fill: color-mix(in srgb, var(--color-mimosa) 18%, var(--md-default-bg-color));
            stroke: var(--color-mimosa);
            stroke-width: 2;
        }

        &.control path {
            fill: color-mix(in srgb, #ed6a2f 18%, var(--md-default-bg-color));
            stroke: #ed6a2f;
        }

        text {
            fill: var(--md-default-fg-color);
            font-family: sans-serif;
            font-size: 13px;
        }

        &.is-selected path {
            stroke: var(--md-default-fg-color);
            stroke-width: 4;
        }

        &.is-selected text { font-weight: bold; }
        &.is-incoming path { stroke: #2297d5; }
        &.is-outgoing path { stroke: #ed6a2f; }
        &.is-muted { opacity: .3; }
        &:hover path, &:focus-within path { stroke-width: 4; }
        a:focus-visible, a:focus { outline: none; }
    }

}
