body {
    /* Sidebar */
    --guide-nav-bg: #EFEFF1;
    --guide-nav-text: #000000;
    --guide-nav-text-faded: #000000aa;
    --guide-nav-border: #dbdbdb;
    --guide-link-hover-bg: #dadada;
    --guide-toc-link-active-bg: #76bec840;
    --guide-link-chevron-bg: #85858577;
    --guide-link-chevron-hover-bg: #85858599;
    --guide-nav-group-toc-left-marker: #8585854b;
    --guide-nav-title: #2C8C9C;
    --guide-nav-discord-btn: #453db6;
    --guide-nav-discord-btn-border: #4d44d177;
    --guide-nav-top-button-bg: #dbdbdb;
    --guide-nav-top-button-bg-hover: #c0c0c0;
    --guide-nav-scrollbar: #577272;

    /* Guide content */
    --guide-bg: #ffffff;
    --guide-text: #070707;
    --guide-text-faded: #07070799;
    --guide-links: #2575aa;
    --guide-links-external: #10a058;
    --guide-links-external-source: #699774;
    --guide-button-bg: #2C8C9C;
    --guide-button-border: #244C52;
    --guide-button-text: #ffffff;
    --guide-aside-bg: #ebf8f7;
    --guide-aside-lightbulb-bg: #fff9e6;
    --guide-aside-game-bg: #f4effc;
    --guide-aside-warning-bg: #fff5f5;
    --guide-aside-thing-bg: #faedf9;
    --guide-font-size: 16px;
    --guide-table-border: #dbdbdb;
    --guide-table-header-bg: #f5f5f5;
    --guide-blockquote-border: #88a3ac41;

    /* Top right controls */
    --guide-top-right-ctrl-border: #3b6161ab;
    --guide-top-right-ctrl-text: #1e2e2b;
    --guide-top-right-ctrl-bg: #ffffff;
    --guide-top-right-ctrl-hover-bg: #ddeff1;
    --guide-profile-box-dropdown-bg: #e4f2f8;
    --guide-profile-box-button-hover-bg: #bcdde2;

    /* Preview controls */
    --guide-preview-ctrl-bg: #f0f7f8;
    --guide-preview-ctrl-btn-bg: #c1e4e6;
    --guide-preview-ctrl-text: #1e2e2b;
    --guide-preview-ctrl-btn-bg-hover: #7dced1;
    --guide-preview-ctrl-selected-bg: #2C8C9C;
    --guide-preview-ctrl-selected-text: #ffffff;
}

body[data-theme="dark"] {
    /* Sidebar */
    --guide-nav-bg: #1f2e35;
    --guide-nav-text: #f1f1f1;
    --guide-nav-text-faded: #f1f1faa0;
    --guide-nav-border: #3a3a3a;
    --guide-link-hover-bg: #3d757944;
    --guide-toc-link-active-bg: #298f9249;
    --guide-link-chevron-bg: #85858577;
    --guide-link-chevron-hover-bg: #858585aa;
    --guide-nav-group-toc-left-marker: #8585854b;
    --guide-nav-title: #45e5da;
    --guide-nav-discord-btn: #8b85f7;
    --guide-nav-discord-btn-border: #6e65eaff;
    --guide-nav-top-button-bg: #15515357;
    --guide-nav-top-button-bg-hover: #154f53;
    --guide-nav-scrollbar: #77a3a396;

    /* Guide content */
    --guide-bg: #15161a;
    --guide-text: #f0f0f0;
    --guide-text-faded: #e1e1e199;
    --guide-links: #7dbff5;
    --guide-links-external: #47c466;
    --guide-links-external-source: #73a083;
    --guide-button-bg: #2C8C9C;
    --guide-button-border: #244C52;
    --guide-button-text: #ffffff;
    --guide-aside-bg: #1e2e35;
    --guide-aside-lightbulb-bg: #3b3d329f;
    --guide-aside-game-bg: #261e30ef;
    --guide-aside-warning-bg: #462525c0;
    --guide-aside-thing-bg: #3a2232;
    --guide-font-size: 16px;
    --guide-table-border: #3a3a3a;
    --guide-table-header-bg: #252525;
    --guide-blockquote-border: #88a3ac41;

    /* Top right controls */
    --guide-profile-box-dropdown-bg: #2a3a3a;
    --guide-profile-box-button-hover-bg: #4d7b80;
    --guide-top-right-ctrl-border: #5a7a7aab;
    --guide-top-right-ctrl-text: #dcf0f0;
    --guide-top-right-ctrl-bg: #1e1e1e;
    --guide-top-right-ctrl-hover-bg: #2a3a3a;

    /* Preview controls */
    --guide-preview-ctrl-bg: #1b292b;
    --guide-preview-ctrl-btn-bg: #35666e;
    --guide-preview-ctrl-text: #ecf7f7;
    --guide-preview-ctrl-btn-bg-hover: #379eb0;
    --guide-preview-ctrl-selected-bg: #2C8C9C;
}

body[data-theme="sepia"] {
    /* Sidebar */
    --guide-nav-bg: #f7e9d9;
    --guide-nav-text: #5b4636;
    --guide-nav-text-faded: #5b4636;
    --guide-nav-border: #d8cbbd;
    --guide-link-hover-bg: #e3d7c9;
    --guide-toc-link-active-bg: #cfa78f80;
    --guide-link-chevron-bg: #a1887399;
    --guide-link-chevron-hover-bg: #a18873bb;
    --guide-nav-group-toc-left-marker: #a188734b;
    --guide-nav-title: #57646d;
    --guide-nav-discord-btn: #7b68ee;
    --guide-nav-discord-btn-border: #7b68ee77;
    --guide-nav-top-button-bg: #d4bfa877;
    --guide-nav-top-button-bg-hover: #c8bba8;
    --guide-nav-scrollbar: #8b6f5b94;

    /* Guide content */
    --guide-bg: #fbf0e6;
    --guide-text: #0e0c0b;
    --guide-text-faded: #1f1a1799;
    --guide-links: #0d64ac;
    --guide-links-external: #228b22;
    --guide-links-external-source: #4f8369;
    --guide-button-bg: #a0522d;
    --guide-button-border: #7b3e1b;
    --guide-button-text: #ffffff;
    --guide-aside-bg: #ebc69538;
    --guide-aside-lightbulb-bg: #facb833d;
    --guide-aside-game-bg: #e7d2e4a8;
    --guide-aside-warning-bg: #ffaeae46;
    --guide-aside-thing-bg: rgba(248, 207, 224, 0.527);
    --guide-font-size: 16px;
    --guide-table-border: #d8cbbd;
    --guide-table-header-bg: #e6d4c4;
    --guide-blockquote-border: #a1887341;

    /* Top right controls */
    --guide-profile-box-dropdown-bg: #e6d4c4;
    --guide-profile-box-button-hover-bg: #ccae96;
    --guide-top-right-ctrl-border: #8b6f5bab;
    --guide-top-right-ctrl-text: #2b221b;
    --guide-top-right-ctrl-bg: #fbf0e6;
    --guide-top-right-ctrl-hover-bg: #e6d4c4;

    /* Preview controls */
    --guide-preview-ctrl-bg: #f5e3d5;
    --guide-preview-ctrl-btn-bg: #e0c6ab;
    --guide-preview-ctrl-text: #352b23;
    --guide-preview-ctrl-btn-bg-hover: #c48f57;
    --guide-preview-ctrl-selected-bg: #a0522d;
}

html {
    overflow: hidden;
}

html,
body {
    height: 100%;
}

body {
    display: flex;
    flex-direction: row;
    font-size: 15px;
    background-color: var(--guide-nav-bg);
    gap: 0;
    width: 100%;
    overflow: hidden;
}

/* MARK: Preview controls
---------------------------------------------------------------------------- */

#preview-controls {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 320px;
    background-color: var(--guide-preview-ctrl-bg);
    border: 1px solid var(--guide-nav-border);
    color: var(--guide-text);
    border-radius: 8px;
    padding: 15px 20px;
    box-sizing: border-box;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    font-size: 14px;
    text-align: center;
    z-index: 1000;
}

#preview-controls .title {
    font-weight: 700;
    font-size: 15px;
    margin-bottom: 8px;
}

#preview-controls .description {
    font-size: 13px;
    margin-bottom: 12px;
    color: var(--guide-text);
    opacity: 0.8;
}

#preview-controls .mode-title {
    font-weight: 600;
    margin-bottom: 10px;
}

#preview-controls .subscription-levels {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: stretch;
    gap: 0;
}

#preview-controls .subscription-levels button {
    font-size: 13px;
    padding: 5px 12px;
    margin: 0;
    width: 100%;
    background: var(--guide-preview-ctrl-btn-bg);
    border: 1px solid var(--guide-button-border);
    color: var(--guide-preview-ctrl-text);
    border-radius: 0;
}

#preview-controls .subscription-levels button:hover {
    background: var(--guide-preview-ctrl-btn-bg-hover);
    transform: none;
}

#preview-controls .subscription-levels button:first-of-type {
    border-top-left-radius: 6px;
    border-bottom-left-radius: 6px;
    border-right: none;
}

#preview-controls .subscription-levels button:last-of-type {
    border-top-right-radius: 6px;
    border-bottom-right-radius: 6px;
}

#preview-controls .subscription-levels button.active {
    background: var(--guide-preview-ctrl-selected-bg);
    border-color: var(--guide-button-border);
    color: var(--guide-preview-ctrl-selected-text);
    font-weight: 600;
    pointer-events: none;
}

#preview-controls .subscription-levels button.active:before {
    content: "✓";
    margin-right: 6px;
}

#preview-controls .back-to-admin {
    display: block;
    margin-top: 15px;
    font-size: 12px;
    color: var(--guide-links);
    text-decoration: none;
}

#preview-controls .close-btn {
    position: absolute;
    top: 8px;
    right: 10px;
    width: 20px;
    height: 20px;
    font-size: 20px;
    line-height: 20px;
    text-align: center;
    color: var(--guide-text);
    cursor: pointer;
    border-radius: 4px;
    transition: background-color 0.2s ease-in-out;
}

/** MARK: Sidebar
---------------------------------------------------------------------------- */

nav {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    flex: 0 0 clamp(260px, 20%, 310px);
    background-color: var(--guide-nav-bg);
    color: var(--guide-nav-text);
    height: 100%;
    box-sizing: border-box;
    user-select: none;
    padding: 0px;
    font-size: 13.5px;
    overflow-y: auto;
    scrollbar-width: thin;
    position: relative;
    border-right: 1px solid var(--guide-nav-border);
    transition: flex 0.25s ease, opacity 0.25s ease;
    z-index: 1001;
    scrollbar-color: var(--guide-nav-scrollbar) transparent;
}

body.closed-nav nav {
    flex: 0 0 0px;
    opacity: 0;
    border: none;
    pointer-events: none;
}

body.closed-nav nav .nav-top-part {
    visibility: hidden;
    user-select: none;
}

nav a,
nav a:visited,
nav a:hover,
nav a:active {
    color: var(--guide-nav-text);
    text-decoration: none;
}

nav a[disabled],
nav a:disabled {
    pointer-events: none;
    color: var(--guide-nav-text-faded);
    cursor: normal;
    opacity: 0.6;
}

nav .middle-spacer {
    flex: 0 0 10px;
}

nav .flex-fill {
    flex: 1 1 auto;
}

nav #outline-unfold-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    margin-top: 5px;
    margin-bottom: 12px;
    padding: 2px 6px;
    box-sizing: border-box;
    color: var(--guide-nav-text-faded);
    width: fit-content;
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
    user-select: none;
    transition: 0.1s all ease;
    opacity: 0.8;
}

nav #outline-unfold-button:hover {
    background-color: var(--guide-nav-top-button-bg-hover);
    color: var(--guide-nav-text);
    opacity: 1.0;
}

nav #outline-unfold-button svg {
    width: 10px;
    height: 10px;
    display: block;
    transition: 0.25s all ease;
}

nav #outline-unfold-button.defold svg {
    transform: rotate(180deg);
}

nav #outline-unfold-button svg g path {
    fill: var(--guide-nav-text);
}

nav #pages-outline {
    padding: 8px;
    margin-bottom: 50px;
}

nav #pages-outline .toc-level {
    padding-left: 25px;
    box-sizing: border-box;
}

nav #pages-outline>.toc-level {
    padding-left: 0;
}

nav #pages-outline .toc-level a {
    position: relative;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    margin: 2px;
    padding-left: 6px;
    padding-right: 8px;
    box-sizing: border-box;
    overflow: hidden;
    border-radius: 4px;
    height: 28px;
    transition: 0.15s ease;
}

nav #pages-outline .toc-level a .external-link-icon {
    margin-left: 6px;
    font-size: 12px;
    color: var(--guide-nav-text-faded);
}

nav #pages-outline .toc-level a.active {
    font-weight: 600;
    background-color: var(--guide-toc-link-active-bg);
}

nav #pages-outline .toc-level a.error {
    outline: 1px solid red;
    background-color: #ff000033;
    overflow: visible;
}

nav #pages-outline .toc-level a.error::after {
    content: "⚠️ Lien non valide";
    position: absolute;
    right: -10px;
    top: -8px;
    transform: translateY(-50%);
    background-color: #ff5555;
    border-radius: 4px;
    padding: 2px 10px;
}

nav #pages-outline .toc-level a .text {
    flex: 1 1 auto;
    overflow: hidden;
    text-wrap: nowrap;
    text-overflow: ellipsis;
    box-sizing: border-box;
}

nav #pages-outline .toc-level a .icon {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--emoji-font);
    font-weight: normal;
    text-decoration: none;
    font-style: normal;
    margin-right: 3px;
    width: 20px;
    height: 20px;
    text-align: center;
    font-size: 15px;
}

nav #pages-outline .toc-level.has-children>a .icon .emoji {
    transition: opacity 0.1s ease;
    opacity: 1;
}

nav #pages-outline .toc-level.has-children>a:hover .icon .emoji {
    opacity: 0;
}

nav #pages-outline .toc-level.has-children>a .icon .chevron {
    position: absolute;
    top: 5%;
    left: 5%;
    transform: rotate(0deg);
    transition: all 0.1s ease;
    background-color: var(--guide-link-chevron-bg);
    background-image: url('/img/chevron-right-b.svg');
    background-size: 35%;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 4px;
    width: 90%;
    height: 90%;
    font-size: 12px;
    color: var(--guide-nav-text-faded);
    opacity: 0;
}

body[data-theme="dark"] nav #pages-outline .toc-level.has-children>a .icon .chevron {
    background-image: url('/img/chevron-right-w.svg');
}

nav #pages-outline .toc-level.has-children>a:hover .icon .chevron {
    background-color: var(--guide-link-chevron-bg);
    opacity: 0.7;
}
body[data-theme="dark"] .toc-level.has-children>a:hover .icon .chevron {
    opacity: 0.8;
}

nav #pages-outline .toc-level.has-children>a:hover .icon .chevron:hover {
    background-color: var(--guide-link-chevron-hover-bg);
    opacity: 1.0;
}

nav #pages-outline .toc-level.has-children>a {
    height: 30px;
}

nav #pages-outline .toc-level.has-children>a:before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 1px;
    background-color: var(--guide-nav-group-toc-left-marker);
    transition: opacity 0.1s ease;
}

nav #pages-outline .toc-level.has-children>a:hover:before {
    opacity: 0;
}

nav #pages-outline .toc-level.has-children>.toc-level {
    display: none;
}

nav #pages-outline .toc-level.has-children.expanded>a .icon .chevron {
    transform: rotate(90deg);
}

nav #pages-outline .toc-level.has-children.expanded>.toc-level {
    display: block;
}

nav #pages-outline .toc-level a:hover {
    background-color: var(--guide-link-hover-bg);
    transition: 0.02s ease;
}

nav #pages-outline .toc-level a.disabled,
nav #pages-outline .toc-level a.disabled:hover {
    pointer-events: none;
    color: var(--guide-nav-text-faded);
    cursor: normal;
    opacity: 0.6;
}

.nav-top-part {
    width: 100%;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    box-sizing: border-box;
    gap: 6px;
    margin-bottom: 8px;
}

.nav-top-part #pane-close-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 25px;
    height: 25px;
    background-color: var(--guide-nav-top-button-bg);
    border-radius: 4px;
    cursor: pointer;
}

.nav-top-part #pane-close-btn:hover {
    background-color: var(--guide-nav-top-button-bg-hover);
    transform: scale(1.15);
}

.nav-top-part #pane-close-btn .icon {
    display: block;
    width: 14px;
    height: 14px;
}

.nav-top-part #pane-close-btn .icon path {
    fill: var(--guide-nav-text-faded);
}

.nav-top-part #back-to-site {
    display: flex;
    align-items: center;
    height: 25px;
    gap: 6px;
    font-size: 12px;
    padding: 4px 10px;
    box-sizing: border-box;
    color: var(--guide-nav-text);
    background-color: var(--guide-nav-top-button-bg);
    border-radius: 4px;
    color: var(--guide-nav-text);
}

.nav-top-part #back-to-site .icon {
    display: block;
    width: 12px;
    height: 12px;
    opacity: 0.8;
}

.nav-top-part #back-to-site .icon path {
    fill: var(--guide-nav-text-faded);
}

.nav-top-part #back-to-site:hover {
    background-color: var(--guide-nav-top-button-bg-hover);
    transform: scale(1.05);
}

.nav-top-part #back-to-site:hover .icon {
    opacity: 1.0;
}

#nav-title {
    width: min(250px, 90%);
    margin: 30px auto 20px auto;
    text-align: center;
}

#nav-title .logo {
    height: 38px;
    width: 100%;
    background-image: url('/img/jvais-logo-dark.svg');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    cursor: pointer;
}

body[data-theme="dark"] #nav-title .logo {
    background-image: url('/img/jvais-logo.svg');
}

#nav-title h1 {
    font-size: 17px;
    margin: 5px 0;
    padding: 0;
    text-transform: uppercase;
    font-weight: 900;
    color: var(--guide-nav-title);
}

#unlock-separator {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 32px;
    position: relative;
    margin-block: 12px;
}

#unlock-separator .line {
    position: absolute;
    top: 50%;
    left: 10px;
    right: 10px;
    height: 1px;
    background-color: var(--guide-nav-border);
    z-index: 1;
}

#unlock-guide-btn {
    position: relative;
    z-index: 2;
    color: var(--guide-button-text);
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
}


#discord-btn-area {
    width: 100%;
    padding: 5px 15px;
    box-sizing: border-box;
    display: none;
}

#discord-btn-link {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    width: 100%;
    gap: 12px;
    text-align: left;
    background-color: transparent;
    border: 1px solid var(--guide-nav-discord-btn-border);
    color: var(--guide-nav-discord-btn);
    border-radius: 6px;
    box-sizing: border-box;
    font-size: 14px;
    text-decoration: none;
    transition: background-color 0.2s ease-in-out, transform 0.2s ease-in-out;
    padding: 4px 12px;
    opacity: 0.8;
    transition: 0.1s all ease-in-out;
}

#discord-btn-link:hover {
    transform: none;
    border-color: var(--guide-nav-discord-btn);
    opacity: 1.0;
}

#discord-btn-link .discord-icon {
    flex: 0 0 22px;
    height: 22px;
    font-size: 12px;
    line-height: 1em;
    width: 1.5em;
    display: flex;
    align-items: center;
    justify-content: center;
}

#discord-btn-link .discord-icon path {
    fill: var(--guide-nav-discord-btn);
}

#discord-btn-link .text {
    padding: 2px 0;
    flex: 1 1 100%;
}

#discord-btn-link .text strong {
    display: block;
    font-size: 13px;
    margin-bottom: -1px;
}

#discord-btn-link .text small {
    display: block;
    font-size: 11.5px;
    opacity: 0.8;
}

/** MARK: Main content
---------------------------------------------------------------------------- */

main {
    flex: 1 1 auto;
    height: 100%;
    min-width: 320px;
    box-sizing: border-box;
    overflow-y: auto;
    background-color: var(--guide-bg);
    color: var(--guide-text);
    scrollbar-width: thin;
}

main #cover {
    width: 100%;
    height: 350px;
    background-color: #0a263c;
    margin-bottom: -50px;
    background-image: url('/img/guide-cover.jpg');
    background-size: cover;
    background-repeat: repeat-x;
    background-position: center;
}

body[data-theme="sepia"] main #cover {
    filter: sepia(0.15);
    opacity: 0.90;
}

main #content-container {
    width: 100%;
    padding-right: 2%;
    box-sizing: border-box;
}

main #content {
    width: calc(min(45rem, 90%) - 20px);
    margin: 100px auto;
    font-size: var(--guide-font-size);
    text-align: justify;
    line-height: 1.5;
}

main a {
    color: var(--guide-links);
    font-weight: 500;
}

main a.external {
    text-decoration: underline;
    color: var(--guide-links-external);
    font-weight: 500;
}

main a.text-is-url {
    word-wrap: break-word;
    text-wrap: wrap;
}

main a.text-is-url-long {
    font-size: 0.85em;
}

main a .link-emoji {
    text-decoration: none;
    font-family: var(--emoji-font);
}

main a .link-text {
    text-decoration: underline;
}

main .internal-links-title {
    color: var(--guide-links);
}

main .external-links-title {
    color: var(--guide-links-external);
}

main p.source-tag {
    font-size: 13.5px;
    color: var(--guide-text-faded);
}

main p.source-tag a.external {
    color: var(--guide-links-external-source);
}

main img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 15px auto;
    max-height: 600px;
}

main img.logo-image {
    max-height: 120px;
    margin: 25px auto 10px auto;
}

main h1,
main h2,
main h3,
main h4,
main h5,
main h6 {
    text-align: left;
    scroll-margin-block: 100px;
}

main img {
    margin-block: 35px;
}

main p {
    margin: 15px 0;
}

main p.page-link-line {
    margin: 8px 0;
    width: fit-content;
}

main p.page-link-line .link-emoji {
    margin-right: 1px;
    margin-left: -4px;
}

main p.page-link-line a em,
main p.page-link-line a strong,
main p.page-link-line a {
    font-weight: 500;
    font-style: normal;
}

main aside,
main .page-toc {
    display: block;
    position: relative;
    font-size: 15px;
    background-color: var(--guide-aside-bg);
    border-radius: 8px;
    padding: 26px 35px 26px 63px;
    box-sizing: border-box;
    margin: 20px 0;
    text-align: left;
    line-height: 1.55;
    box-sizing: border-box;
}

main aside[data-icon="💡"] { background-color: var(--guide-aside-lightbulb-bg); }
main aside[data-icon="🎮"] { background-color: var(--guide-aside-game-bg); }
main aside[data-icon="❗"] { background-color: var(--guide-aside-warning-bg); }
main aside.thing-emoji { background-color: var(--guide-aside-thing-bg); }

main aside .aside-icon {
    position: absolute;
    top: 25px;
    left: 20px;
    font-size: 22px;
    line-height: 22px;
    height: 22px;
}

main aside p:last-child {
    margin-bottom: 5px;
}

main aside ul {
    padding-left: 16px;
}

main .page-toc {
    padding-bottom: 35px;
}

main .page-toc a {
    display: block;
    margin: 2px 0;
    color: var(--guide-links);
    text-decoration: none;
    box-sizing: border-box;
}

main .page-toc .toc-title {
    font-weight: 900;
    font-size: 26px;
    margin-bottom: 12px;
    margin-top: -7px;
}

main .page-toc a.toc-level-1,
main .page-toc a.toc-level-2 {
    font-weight: 500;
}

/* main .page-toc a.toc-level-2 { 
    margin-left: 20px;
}

main .page-toc a.toc-level-2:nth-child(2) {
    margin-left: 0px;
} */

main .page-toc::before {
    content: '';
    display: block;
    position: absolute;
    top: 25px;
    left: 23px;
    height: 26px;
    width: 26px;
    background-image: url('/img/custom-emoji-jvais.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

main .page-toc .sub-pages {
    margin-top: 15px;
    border-top: 1px solid var(--guide-nav-border);
    padding-top: 15px;
}

main .page-toc .sub-pages .sub-pages-title {
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 13px;
}

body[data-theme="dark"] main .page-toc::before {
    background-image: url('/img/custom-emoji-jvais-light.png');
}

main aside.thing-emoji::before {
    content: '';
    display: block;
    position: absolute;
    top: 23px;
    left: 20px;
    height: 26px;
    width: 26px;
    background-image: url('/img/custom-emoji-thing.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

main aside>*:first-child {
    margin-top: 0px;
}

main aside>*:first-child>h2:first-child,
main aside>*:first-child>h3:first-child {
    margin-top: 0;
}

main aside>p:has(+ .aside-icon) {
    margin-bottom: 3px;
}

main aside>blockquote:first-child {
    margin-top: 15px;
}

main aside>h3:first-child {
    margin-top: -2px;
}

main aside .aside-line-break {
    height: 12px;
}

main blockquote {
    border-left: 4px solid var(--guide-blockquote-border);
    margin: 20px 0;
    padding-left: 25px;
    font-size: 15px;
    opacity: 0.9;
    text-align: left;
}

main h1,
main h2,
main h3,
main h4,
main h5,
main h6 {
    text-align: left;
}

main h1 {
    font-weight: 900;
    font-size: 27px;
    vertical-align: baseline;
}

main h1.main-title {
    font-size: 42px;
    line-height: 1.2;
    letter-spacing: -0.5px;
}

main h1 .emoji,
main h2 .emoji,
main h3 .emoji,
main h4 .emoji,
main h5 .emoji {
    display: inline-block;
    margin-left: -8px;
    margin-right: 4px;
    transform: translateY(-2px);
    vertical-align: baseline;
    width: 1.2em;
    
}

main h1.main-title .emoji {
    margin-left: -12px;
    margin-right: 5px;
}

main h2 {
    font-weight: 800;
    font-size: 22px;
    margin-top: 30px;
    margin-bottom: 15px;
    letter-spacing: -0.2px;
}

main h3 {
    font-weight: 700;
    font-size: 19px;
    margin-top: 30px;
    margin-bottom: 12px;
}

main hr {
    margin-block: 40px;
    border: none;
    border-bottom: 1px solid var(--guide-nav-border);
}

main hr:last-of-type {
    margin-bottom: 10px;
}

main .updated-at {
    font-size: 14px;
    font-style: italic;
    color: var(--guide-text-faded);
    margin-bottom: 25px;
}

main .table-container {
    display: block;
    overflow-x: visible;
    box-sizing: border-box;
    width: 880px;
    transform: translateX(-90px);
    padding: 0;
    margin-block: 25px;
}

main table {
    width: 100%;
    border-collapse: collapse;
    box-sizing: border-box;
    margin: 0;
    font-size: 14px;
}

@media screen and (max-width: 1250px) {
    main .table-container {
        overflow-x: auto;
        transform: translateX(0);
        width: 100%;
        border: 1px solid #00000050;
        box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.15);
        border-radius: 5px;
        padding: 25px 20px 35px 20px;
    }

    main table {
        width: 900px;
        margin-block: 0;
    }
}

main table th,
main table td {
    border: 1px solid var(--guide-table-border);
    padding: 4px 10px;
    text-align: left;
}

main table th {
    background-color: var(--guide-table-header-bg);
    font-weight: 900;
}

main #content li {
    text-align: left;
    margin-block: 3px;
}

main #content li p:first-child:has(+ p a:first-child:last-child) {
    margin-bottom: -12px;
}

main span.emoji-thing {
    display: inline-block;
    width: 1em;
    height: 1em;
    background-image: url('/img/custom-emoji-thing.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    vertical-align: -0.15em;
    margin-inline: 8px;
}

main span.emoji-thing:first-child {
    margin-left: 0;
}

main .link-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 5px 10px;
    margin-block: 30px;
}

main .link-grid-item {
    box-sizing: border-box;
    text-align: left;
}


/* MARK: Top right controls
---------------------------------------------------------------------------- */

.top-right-controls {
    position: fixed;
    top: 10px;
    left: calc(clamp(250px, 16%, 320px) + 16px);
    right: 16px;
    z-index: 100;
    height: 28px;
    display: flex;
    flex-direction: row-reverse;
    justify-content: flex-start;
    align-items: center;
    box-sizing: border-box;
    gap: 8px;
    transition: left 0.25s ease;
}

body.closed-nav .top-right-controls {
    left: 15px;
}

.profile-zone {
    height: 28px;
    display: flex;
    flex-direction: row;
    justify-content: flex-end;
}


.profile-box {
    padding: 5px 10px 5px 3px;
    background-color: var(--guide-top-right-ctrl-bg);
    border: 1px solid var(--guide-top-right-ctrl-border);
    border-radius: 14px;
    height: 28px;
    display: flex;
    flex-direction: row;
    justify-content: flex-start;
    align-items: center;
    gap: 8px;
    box-sizing: border-box;
    min-width: 80px;
    max-width: 130px;
    font-size: 13px;
    color: var(--guide-top-right-ctrl-text);
    user-select: none;
    width: fit-content;
    cursor: pointer;
    position: relative;
}

.profile-box:hover {
    background-color: var(--guide-top-right-ctrl-hover-bg);
}

.profile-box .name {
    flex: 1 1 auto;
    max-width: 120px;
    text-wrap: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
}

.profile-box img {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    object-fit: cover;
    outline: 1px solid var(--guide-top-right-ctrl-border);
    margin: 0;
}

.profile-options {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background-color: var(--guide-profile-box-dropdown-bg);
    border: 1px solid var(--guide-top-right-ctrl-border);
    border-radius: 8px;
    padding: 8px 0;
    min-width: 160px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    display: none;
    flex-direction: column;
    z-index: 1000;
}

.profile-box.active .profile-options {
    display: flex;
}

.profile-options a {
    padding: 10px 16px;
    color: var(--guide-top-right-ctrl-text);
    text-decoration: none;
    font-size: 14px;
    transition: background-color 0.2s;
    text-transform: none;
    font-weight: 400;
}

.profile-options a:hover {
    background-color: var(--guide-profile-box-button-hover-bg);
}

/* last minute fix with important everywhere, it is what it is */
/* You'd have to remove the 'btn' class and check it again to fix it properly */
.btn-signup, .btn-signin {
    box-sizing: border-box !important;
    height: 28px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 12px !important;
    background-color: var(--guide-top-right-ctrl-bg) !important;
    border: 1px solid var(--guide-top-right-ctrl-border) !important;
    color: var(--guide-top-right-ctrl-text) !important;
    border-radius: 13px !important;
    font-size: 13px !important;
    text-decoration: none !important;
}

.btn-signup:hover, .btn-signin:hover {
    background-color: var(--guide-top-right-ctrl-hover-bg) !important;
}

.theme-control {
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    border: 1px solid var(--guide-top-right-ctrl-border);
    border-radius: 14px;
    color: var(--guide-top-right-ctrl-text);
    font-size: 13px;
    background-color: var(--guide-top-right-ctrl-bg);
    accent-color: var(--guide-top-right-ctrl-text);
    box-shadow: none;
    outline: none !important;
    cursor: pointer;
    width: fit-content;
}

.theme-control select {
    height: 28px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none !important;
    color: var(--guide-top-right-ctrl-text);
    font-size: 13px;
    background-color: var(--guide-top-right-ctrl-bg);
    accent-color: var(--guide-top-right-ctrl-text);
    box-shadow: none;
    outline: none !important;
    cursor: pointer;
}

.theme-control select::-ms-expand {
    display: none;
}

.theme-control select:hover {
    background-color: var(--guide-top-right-ctrl-bg);
}

.theme-control select option {
    color: var(--guide-top-right-ctrl-text);
    background-color: var(--guide-bg);
    cursor: pointer;
}

.top-right-controls .fill {
    flex: 1 1 auto;
}

body.closed-nav #pane-open-btn {
    opacity: 1.0;
    pointer-events: auto;
}

body #pane-open-btn {
    height: 28px;
    width: 28px;
    background-color: var(--guide-top-right-ctrl-bg);
    border: 1px solid var(--guide-top-right-ctrl-border);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1000;
    transition: opacity 0.15s ease;
    pointer-events: none;
    opacity: 0.0;
}

#pane-open-btn .icon {
    display: block;
    width: 16px;
    height: 16px;
}

#pane-open-btn .icon path {
    fill: var(--guide-nav-text);
}

#pane-open-btn:hover {
    transform: scale(1.15);
    background-color: var(--guide-top-right-ctrl-hover-bg);
}



/** MARK: Image Lightbox
---------------------------------------------------------------------------- */

#image-lightbox {
    position: fixed;
    display: flex;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    align-items: center;
    justify-content: center;
    z-index: 2000;
    cursor: zoom-out;
    transition: background-color 0.3s ease, opacity 0.3s ease;
}

#image-lightbox.lightbox-hidden {
    background-color: rgba(0, 0, 0, 0);
    opacity: 0;
    pointer-events: none;
    user-select: none;
}

#image-lightbox img {
    display: block;
    object-fit: contain;
    max-width: calc(100% - 40px);
    max-height: calc(100% - 40px);
    box-shadow: 0 3px 18px rgba(0,0,0,1.0);
    border-radius: 6px;
    outline: 5px white solid;
    transform: scale(1);
    opacity: 1;
    transition: transform 0.2s ease, opacity 0.3s ease;
    background-color: var(--guide-bg);
}

#image-lightbox.lightbox-hidden img {
    transition: transform 1.0s ease, opacity 0.3s ease;
    transform: scale(0.8);
    opacity: 0;
}


/** MARK: Loading Overlays
---------------------------------------------------------------------------- */

#loading-overlay-main {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--guide-bg);
    z-index: 10;
    user-select: none;
    pointer-events: none;
    transition: opacity 0.5s ease;
    opacity: 1;
}

#loading-overlay-nav {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--guide-nav-bg);
    z-index: 10;
    user-select: none;
    pointer-events: none;
    transition: opacity 0.1s ease;
    opacity: 1;
}

.loading-overlay-hidden {
    opacity: 0 !important;
}

.loading-overlay-hidden-fast {
    transition: opacity 0.15s ease 0.05s !important;
    opacity: 0 !important;
}

#loading-overlay-nav.loading-overlay-hidden-fast {
    display: none !important;
    opacity: 0 !important;
}


/** MARK: Media Queries
---------------------------------------------------------------------------- */

@media (max-width: 850px) {
    main #content-container {
        padding: 0;
    }

    main #content {
        width: calc(95% - 20px);
        margin: 80px auto;
    }

    nav {
        flex: 0 0 clamp(220px, 29%, 250px);
    }
}

@media (max-width: 680px) {
    main h1.main-title {
        font-size: 30px;
    }
    main h1 {
        font-size: 25px;
    }
    main h2 {
        font-size: 20px;
    }
    main h3 {
        font-size: 18px;
    }
    main .page-toc .toc-title {
        font-size: 24px;
    }
}

@media (max-width: 500px) {
    main aside {
        padding: 20px 25px 20px 50px;
    }
    main aside .aside-icon {
        top: 19px;
        left: 15px;
        font-size: 20px;
        height: 20px;
    }

    body main .top-right-controls {
        opacity: 0.0;
        transition: opacity 0.25s ease;
    }

    body main {
        min-width: 90vw;
    }

    body.closed-nav main .top-right-controls {
        opacity: 1.0;
        transition: opacity 0.25s ease;
    }
}