@import url("https://repo.0x8e.net/tetratto-aux/utility.css");
@import url("https://repo.0x8e.net/tetratto-aux/lexend.css");

:root {
    color-scheme: light dark;

    --color-super-lowered: oklch(87.1% 0.006 286.286);
    --color-super-lowered-75: oklch(87.1% 0.006 286.286 / 75%);
    --color-lowered: oklch(96.7% 0.001 286.375);
    --color-surface: oklch(97% 0.001 106.424);
    --color-raised: oklch(98.4% 0.003 247.858);
    --color-raised-75: oklch(98.4% 0.003 247.858 / 75%);
    --color-super-raised: oklch(96.8% 0.007 247.896);
    --color-super-raised-75: oklch(96.8% 0.007 247.896 / 75%);
    --color-text: hsl(0, 0%, 5%);

    --color-primary: oklch(71.2% 0.194 13.428) !important;
    --color-primary-90: oklch(71.2% 0.194 13.428 / 90%) !important;
    --color-primary-lowered: oklch(0.672 0.194 13.428) !important;
    --color-primary-lowered-90: oklch(0.672 0.194 13.428 / 90%) !important;
    --color-primary-50: oklch(71.2% 0.194 13.428 / 50%) !important;
    --color-primary-25: oklch(71.2% 0.194 13.428 / 25%) !important;
    --color-text-primary: hsl(0, 0%, 5%);

    --radius: 10px;
    --nav-height: 48px;

    --color-link: #2949b2;
    --color-shadow: rgba(0, 0, 0, 0.08);
    --color-red: hsl(0, 84%, 40%);
    --color-green: hsl(100, 84%, 20%);
    --color-yellow: oklch(47% 0.157 37.304);
    --color-purple: hsl(284, 84%, 20%);
    --color-green-lowered: hsl(100, 84%, 15%);
    --color-red-lowered: hsl(0, 84%, 35%);

    --color-primary: hsl(5, 100%, 61%);
    --color-primary-lowered: hsl(5, 100%, 56%);
    --color-text-primary: hsl(0, 0%, 5%);

    --color-secondary: hsl(35, 100%, 61%);
    --color-secondary-lowered: hsl(35, 100%, 56%);
    --color-text-secondary: hsl(0, 0%, 5%);

    --shadow-x-offset: 0;
    --shadow-y-offset: 0.125rem;
    --shadow-size: var(--pad-1);

    --pad-1: 0.2rem;
    --pad-2: 0.35rem;
    --pad-3: 0.5rem;
    --pad-4: 1rem;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-size: 16px;
    font-family:
        "Lexend",
        "Inter",
        "Poppins",
        "Roboto",
        ui-sans-serif,
        -apple-system,
        BlinkMacSystemFont,
        system-ui,
        sans-serif,
        "Apple Color Emoji",
        "Segoe UI Emoji",
        "Segoe UI Symbol",
        "Noto Color Emoji";
}

.dark,
.dark * {
    --color-super-lowered: oklch(34.2% 0.017 285.786);
    --color-super-lowered-75: oklch(34.2% 0.017 285.786 / 75%);
    --color-lowered: oklch(27% 0.013 285.805);
    --color-surface: oklch(11% 0.006 285.885);
    --color-raised: oklch(17.4% 0.006 286.033);
    --color-raised-75: oklch(17.4% 0.006 286.033 / 75%);
    --color-super-raised: oklch(0.1948 0.0066 286.03);
    --color-super-raised-75: oklch(0.1948 0.0066 286.03 / 75%);
    --color-text: hsl(0, 0%, 95%);
    --color-link: hsl(212, 96%, 82%);

    --color-link: #93c5fd;
    --color-red: hsl(0, 94%, 82%);
    --color-green: hsl(100, 94%, 82%);
    --color-yellow: oklch(90.1% 0.076 70.697);
    --color-purple: hsl(284, 94%, 82%);
}

html,
body {
    line-height: 1.5;
    letter-spacing: 0.15px;
    color: var(--color-text);
    background: var(--color-surface);
    overflow: auto auto;
    height: 100dvh;
    scroll-behavior: smooth;
    overflow-x: hidden;
}

main {
    width: 80ch;
    margin: var(--pad-4) auto;
    padding: var(--pad-3) var(--pad-4);
}

article {
    margin: var(--pad-2) 0;
    height: calc(100dvh - var(--pad-4) - var(--nav-height) * 2);
}

.tab {
    /* flex: 1 0 auto; */
    flex: 0 0 auto;
    overflow: auto;
}

.tabs:not(.short) .tab {
    height: 100%;
}

.tabs {
    overflow: auto;
    width: 100%;
}

.fadein {
    animation: fadein ease-in-out 1 0.5s forwards running;
}

@media screen and (max-width: 900px) {
    main,
    article,
    nav,
    header,
    footer {
        width: 100%;
    }

    article {
        margin-top: 0;
    }

    main {
        padding: 0;
    }

    .flex_collapse_rev {
        flex-direction: column-reverse !important;
    }
}

.container {
    margin: 10px auto 0;
    width: 100%;
}

.container.small {
    margin: 0 auto;
    max-width: 42ch;
}

.content_container {
    margin: 0 auto var(--pad-2);
    width: 100%;
}

@media screen and (min-width: 500px) {
    .content_container {
        max-width: 540px;
    }
}

@media (min-width: 768px) {
    .content_container {
        max-width: 720px;
    }
}

@media (min-width: 900px) {
    .content_container {
        max-width: 960px;
    }

    @media (min-width: 1200px) {
        article {
            padding: 0;
        }

        .content_container {
            max-width: 1100px;
        }
    }
}

video {
    max-width: 100%;
    border-radius: var(--radius);
}

/* card */
.card {
    padding: var(--pad-4);
    background: var(--color-raised-75);
    backdrop-filter: blur(5px);
    color: var(--color-text);
    border: solid 1px var(--color-super-lowered);
}

.card.hero {
    background: var(--color-primary);
    color: var(--color-text-primary);
}

.card.thick {
    padding: calc(var(--pad-4) * 2);
}

.card.small {
    padding: calc(var(--pad-4) * 0.5) var(--pad-4);
}

.card.wide {
    min-width: 35rem;
    max-width: 100dvw;

    @media screen and (max-width: 899px) {
        & {
            min-width: 100%;
        }
    }
}

.card_nest:not(.reverse) > .card:nth-child(1) {
    background: var(--color-super-raised);
    padding: var(--pad-2) var(--pad-4);
}

.card_nest.reverse > .card:nth-child(2) {
    background: var(--color-super-raised);
    padding: var(--pad-2) var(--pad-4);
}

.card.surface {
    background: var(--color-surface);
}

.card .card {
    border-radius: var(--radius);
}

.card_nest {
    --r: var(--radius);
    border-radius: var(--r) !important;

    &.round_lg {
        --r: calc(var(--radius) * 2);
    }
}

.card_nest.round > .card:not(:first-child) {
    border-top: none;
}

.card_nest.round > .card:not(:last-child) {
    border-radius: 0;
    border-bottom: solid 1px var(--color-super-lowered) !important;
}

.card_nest.round > .card:first-child {
    border-radius: var(--r) var(--r) 0 0;
}

.card_nest.round > .card:last-child {
    border-radius: 0 0 var(--r) var(--r);
}

@media screen and (max-width: 900px) {
    .card:not(dialog *, .card *, .page_header *) {
        border-radius: 0 !important;
    }
}

/* button */
.button {
    --h: 34px;
    display: flex;
    justify-content: center;
    align-items: center;
    appearance: none;
    outline: none;
    border: none;
    color: var(--color-text-button);
    transition:
        background 0.15s,
        border-color 0.15s;
    cursor: pointer;
    border-radius: var(--radius);
    width: max-content;
    height: var(--h);
    padding: 0 var(--pad-4);
    background: var(--color-raised);
    border: solid 1px var(--color-super-lowered);
    text-decoration: none !important;
    gap: var(--pad-2);
    position: relative;
    overflow: hidden;
    min-width: max-content;
    white-space: pre;

    &:hover {
        background: var(--color-super-raised);
    }

    &.small {
        padding: 0 var(--pad-2);
        height: 24px;
        font-size: 0.8rem;
    }

    &.icon_only {
        width: var(--h);
        max-width: var(--h);
    }

    &.camo {
        background: none;
        color: inherit;
        border-color: transparent;

        &:not(.tab_button, .faux_tab_button):hover {
            background: var(--color-raised);
            border-color: var(--color-super-lowered);
        }
    }
}

.button.primary {
    color: var(--color-text-primary);
    border: solid 1px var(--color-primary-lowered);
    background: var(--color-primary);

    &:hover {
        border: solid 1px var(--color-primary);
        background: var(--color-primary-lowered);
    }
}

.button.green {
    color: hsl(100, 86%, 14%);
    border: solid 1px hsla(100, 75%, 37%, 50%);
    background: hsla(100, 75%, 37%, 25%);

    &:hover {
        border: solid 1px hsla(100, 75%, 37%, 60%);
        background: hsla(100, 75%, 37%, 30%);
    }

    &:is(.dark *) {
        color: hsl(100, 86%, 80%);
        border-color: oklch(72.3% 0.219 149.579 / 50%);
        background: oklch(79.2% 0.209 151.711 / 25%);

        &:hover {
            border-color: oklch(72.3% 0.219 149.579 / 60%);
            background: oklch(79.2% 0.209 151.711 / 30%);
        }
    }
}

.button.red {
    color: hsl(0, 86%, 14%);
    border: solid 1px hsla(0, 75%, 37%, 50%);
    background: hsla(0, 75%, 37%, 15%);

    &:hover {
        border: solid 1px hsla(0, 75%, 37%, 60%);
        background: hsla(0, 75%, 37%, 20%);
    }

    &:is(.dark *) {
        color: hsl(0, 86%, 80%);
        border-color: oklch(0.723 0.1209 0 / 50%);
        background: oklch(71.2% 0.194 13.428 / 15%);

        &:hover {
            border-color: oklch(0.723 0.1209 0 / 60%);
            background: oklch(71.2% 0.194 13.428 / 20%);
        }
    }
}

.button.yellow {
    color: hsl(25, 86%, 14%);
    border: solid 1px hsla(25, 75%, 37%, 50%);
    background: hsla(25, 75%, 37%, 15%);

    &:hover {
        border: solid 1px hsla(25, 75%, 37%, 60%);
        background: hsla(25, 75%, 37%, 20%);
    }

    &:is(.dark *) {
        color: hsl(25, 86%, 80%);
        border-color: oklch(0.723 0.1882 49.77 / 50%);
        background: oklch(0.723 0.1882 49.77 / 15%);

        &:hover {
            border-color: oklch(0.723 0.1882 49.77 / 60%);
            background: oklch(0.723 0.1882 49.77 / 20%);
        }
    }
}

.button:not(.tab, .dropdown .inner *, .square, menu *) {
    border-radius: var(--radius);
}

.button:disabled {
    opacity: 50%;
    cursor: not-allowed;
}

.button.big {
    --h: 48px;
    width: 100%;
}

.button.padded {
    padding: 0 var(--pad-4);

    &.big {
        padding: 0 calc(var(--pad-4) * 2);
    }
}

.button.simple {
    --size: 18px;
    font-weight: 600;
    padding: var(--pad-2) !important;
    border-radius: var(--radius);
    width: var(--size);
    height: var(--size);
    aspect-ratio: 1 / 1;
    font-size: 12px;
}

.button.tab_button,
.button.faux_tab_button {
    border-bottom-left-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
    border-bottom: none !important;
    overflow: visible;
}

.button.tab_button:not(.camo, .tab_normal *),
.button.faux_tab_button:not(.camo) {
    background: var(--color-raised) !important;
    border-color: var(--color-super-lowered);
}

.bar {
    position: relative;
    top: 1px;
    margin-top: -5px;
    z-index: 1;

    & .button.camo:hover {
        color: var(--color-link);
    }
}

.bar:has(> :not(.camo):first-child) + * > .card {
    border-top-left-radius: 0 !important;
}

@media screen and (max-width: 900px) {
    .bar:not(.has_padding) .button:not(.camo):first-child {
        border-left: none;
    }
}

.tab_button:not(.tab_normal *) {
    outline: none !important;
    box-shadow: none !important;
}

.button_nest {
    display: flex;
    align-items: center;
    height: max-content;
}

.button_nest .button:first-child {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.button_nest .button:last-child {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    background: var(--color-surface) !important;
    border-left: none;
}

.button.solid {
    background: var(--color-raised) !important;
    color: var(--color-text) !important;

    &:hover {
        background: var(--color-super-raised) !important;
    }
}

.button.small {
    --h: 32px;
}

/* dropdown */
.dropdown {
    position: relative;
}

.dropdown .inner {
    display: none;
    flex-direction: column;
    box-shadow: var(--shadow-x-offset) var(--shadow-y-offset) var(--shadow-size)
        var(--color-shadow);
    background: var(--color-raised);
    color: inherit;
    position: absolute;
    z-index: 2;
    top: calc(100% + 5px);
    right: 0;
    width: max-content;
    max-width: 15rem;
    min-width: 15rem;
    border-radius: calc(var(--radius) * 2);
    overflow: hidden;
}

.dropdown .inner.surface {
    background: var(--color-surface);
}

.dropdown .inner.left {
    right: unset;
    left: 0;
}

.dropdown .inner.open {
    display: flex;
}

.dropdown .inner .button,
.dropdown .inner .title {
    padding: var(--pad-3) var(--pad-4);
    justify-content: flex-start;
    width: 100%;
}

.dropdown .inner .title {
    font-weight: 600;
    font-size: 14px;
}

.dropdown:has(.inner.open) .button:nth-child(1):not(.inner *) {
    background: var(--color-raised);
}

.dropdown .inner.top {
    top: unset;
    bottom: 100%;
}

.dropdown .inner.left {
    left: 0;
    right: unset;
}

nav .dropdown .inner {
    top: calc(100% + var(--pad-3));
}

.dropdown .dropdown_arrow {
    transition: transform 0.15s;
}

.dropdown:has(.inner.open) .dropdown_arrow {
    transform: rotateZ(180deg);
}

.dropdown .inner {
    border: solid 1px var(--color-super-lowered);

    & .button {
        --h: 36px;
        border: none;
        border-radius: 0;

        &:not(.red, .green) {
            background: var(--color-raised);

            &:hover {
                background: var(--color-super-raised);
            }
        }
    }
}

/* input */
input,
textarea,
select {
    --h: 36px;
    padding: var(--pad-2) calc(var(--pad-3) * 1.5);
    background: var(--color-raised);
    color: var(--color-text);
    outline: none;
    width: max-content;
    border: solid 1px var(--color-super-lowered-75);
    transition:
        background 0.15s,
        border 0.15s;
    height: var(--h);
    line-height: inherit;
    width: 100%;
    resize: vertical;
    border-radius: var(--radius);
}

input.surface,
textarea.surface,
select.surface {
    background: var(--color-surface);
}

input:not([type="checkbox"]):focus,
textarea:focus,
select:focus {
    background: var(--color-super-raised);
}

input:focus,
textarea:focus,
select:focus,
.button:not(.dropdown *):focus {
    outline: solid 2px var(--color-primary);
    box-shadow: 0 0 0 4px oklch(80.8% 0.114 19.571 / 25%);
}

input:user-invalid,
input[data-invalid] {
    outline: solid 2px var(--color-red);
}

input[type="checkbox"] {
    height: max-content;
}

textarea {
    font-family: inherit;
    resize: vertical;
    min-height: 15rem;
}

/* inputs */
:is(input, textarea, select, .button:not(.dropdown .inner *), ):focus {
    border-color: var(--color-primary) !important;
    outline: solid 2px var(--color-primary-25) !important;
    box-shadow: none !important;
}

input:disabled {
    opacity: 50%;
}

/* typo */
a {
    text-decoration: none;
    color: var(--color-link);

    &.flush {
        color: inherit;
    }

    &:hover {
        text-decoration: underline dotted currentColor;
    }
}

p,
ul,
ol {
    margin-bottom: var(--pad-4) !important;

    &:last-child {
        margin-bottom: 0 !important;
    }
}

ul,
ol {
    margin: var(--pad-2) 0 var(--pad-2) var(--pad-4);
    padding-left: 2rem;
}

pre {
    padding: var(--pad-2) var(--pad-4);
    border-left: solid 5px var(--color-primary);
    background: var(--color-surface);
    border-radius: var(--radius);
    margin-bottom: var(--pad-4);
}

code {
    padding: 0;
}

pre,
code {
    font-family: "Jetbrains Mono", "Fire Code", monospace;
    width: 100%;
    max-width: 100%;
    overflow: auto;
    border-radius: var(--radius);
    font-size: 0.8rem !important;
    color: inherit;
}

code * {
    font-size: 0.8rem !important;
}

code:not(pre *) {
    padding: var(--pad-1) var(--pad-2);
    background: oklch(98% 0.016 73.684 / 25%);
    color: oklch(90.1% 0.076 70.697);
    border-radius: var(--radius);
    white-space: break-spaces;
}

code:not(pre *):not(.dark *) {
    background: oklch(83.7% 0.128 66.29 / 25%);
    color: oklch(47% 0.157 37.304);
}

mark {
    padding: var(--pad-1) var(--pad-2);
    border-radius: 2px;
    color: oklch(42.1% 0.095 57.708);
    background: oklch(94.5% 0.129 101.54 / 50%);
    line-height: 3ch;

    &:is(.dark *) {
        color: oklch(97.3% 0.071 103.193);
        background: oklch(68.1% 0.162 75.834 / 25%);
    }
}

svg.icon {
    stroke: currentColor;
    width: 18px;
    height: 1em;
}

svg.icon.filled {
    fill: currentColor;
}

.no_fill svg.icon {
    fill: transparent;
}

.big_icon svg.icon {
    width: 18px;
    height: 18px;
    position: absolute;
}

button svg {
    pointer-events: none;
}

hr {
    border-top: solid 1px var(--color-super-lowered) !important;
    border-left: 0;
    border-bottom: 0;
    border-right: 0;
}

hr.margin,
.container hr {
    margin: var(--pad-4) 0;
}

span.img_sizer {
    display: inline-block;
}

.color_block a {
    color: inherit;
}

:is(h1, h2, h3, h4, h5, h6) :is(p, p *) {
    font-variation-settings: inherit !important;
    font-size: inherit !important;
}

:is(h1, h2, h3, h4, h5, h6) {
    width: 100%;
    font-weight: 900 !important;
}

img {
    display: inline;
    max-width: 100%;
    vertical-align: middle;
}

.img_sizer img {
    width: 100%;
    height: 100%;
}

.avatar {
    --size: 18px;
    width: var(--size);
    height: var(--size);
    aspect-ratio: 1 / 1;
}

blockquote {
    padding-left: 1rem;
    border-left: solid 5px var(--color-green);
    color: var(--color-green);
    opacity: 75%;
}

p,
span {
    font-size: inherit;
}

p,
li,
span,
code {
    max-width: 100%;
    overflow-wrap: normal;
    text-wrap: stable;
    word-wrap: break-word;
}

h1 {
    font-size: 2rem;
}

h2 {
    font-size: 1.75rem;
}

h3 {
    font-size: 1.5rem;
}

h4 {
    font-size: 1.25rem;
}

h5 {
    font-size: var(--pad-4);
}

h6 {
    font-size: var(--pad-3);
}

h1,
h2,
h3,
h4,
h5,
h6 {
    margin: var(--pad-4) 0;
    font-weight: 700;
    width: -moz-max-content;
    position: relative;
    max-width: 100%;

    & * {
        font-size: inherit;
    }
}

h1 {
    text-align: center;
    margin: 2rem 0;
    width: 100%;
}

/* extra */
@keyframes fadein {
    from {
        opacity: 0%;
    }

    to {
        opacity: 100%;
    }
}

.loader {
    animation: spin linear infinite 2s forwards running;
    display: flex;
    justify-content: center;
    align-items: center;
}

@keyframes spin {
    from {
        transform: rotateZ(0deg);
    }

    to {
        transform: rotateZ(360deg);
    }
}

.items-end {
    align-items: flex-end;
}

.gap_ch {
    gap: 1ch;
}

@keyframes pulse {
    0% {
        transform: scale(0.9);
    }

    50% {
        transform: scale(1.05);
    }

    100% {
        transform: scale(0.9);
    }
}

.pulse {
    animation: pulse ease-in-out infinite 2s forwards running;
}

.spin {
    animation: spin ease-in-out infinite 2s forwards running;
}

/* table */
table {
    width: 100%;
    table-layout: auto;
    margin: var(--pad-4) 0;
    border-collapse: separate;
    border-spacing: 0;
}

table td,
table th {
    padding: var(--pad-2) var(--pad-4);
}

table tr:not(thead *):nth-child(odd) {
    background: var(--color-super-raised);
}

table thead th {
    text-align: left;
}

table {
    border: solid 1px var(--color-super-lowered) !important;
    margin: 0;

    & th {
        background: var(--color-super-raised) !important;
    }

    & tr {
        background: var(--color-super-raised) !important;

        & td {
            border-top: solid 1px var(--color-super-lowered) !important;
        }
    }

    & tr:hover {
        background: var(--color-raised) !important;
    }
}

.table_wrapper {
    width: 100%;
    overflow: auto;
    z-index: 1;
}

.table_wrapper:has(.dropdown .inner.open) {
    overflow: visible;

    & table {
        table-layout: fixed;
    }

    & table td:not(.actions),
    & table th:not(.actions) {
        display: none;
    }

    & table td.actions:not(:has(.dropdown)) {
        overflow: hidden;
        text-overflow: ellipsis;
    }

    & table th.actions_right {
        text-align: right;
    }

    & table td.actions_right {
        justify-content: flex-end;
    }
}

/* dialog */
dialog {
    background: var(--color-surface);
    color: var(--color-text);
    box-shadow: var(--shadow-x-offset) var(--shadow-y-offset) var(--shadow-size)
        var(--color-shadow);
    animation: fadein ease-in-out 1 0.25s forwards running;
    max-width: 95%;
    width: 30rem;
    margin: auto;
    padding: var(--pad-4);
    border-radius: var(--radius);
    border: 0;
}

dialog .inner {
    display: flex;
    flex-direction: column;
    gap: var(--pad-2);
}

dialog::backdrop {
    background: hsla(0, 0%, 0%, 25%);
    backdrop-filter: blur(2px);
}

dialog:is(.dark *)::backdrop {
    background: hsla(0, 0%, 100%, 15%);
}

/* more misc */
article:not(.minus_nav) {
    height: max-content;
}

main {
    margin-top: 0;
}

.date {
    display: none;
}

.date:hover {
    text-decoration: underline dotted;
}

/* avatar */
.avatar {
    border-radius: 4px;
}

.avatar_icon .icon {
    width: 24px;
    height: 24px;
}

/* menu */
menu {
    display: flex;
    flex-direction: column;
    width: 20rem;
    max-width: 100%;
    height: max-content;
    border-radius: var(--radius);
    box-shadow: var(--shadow-x-offset) var(--shadow-y-offset) var(--shadow-size)
        var(--color-shadow);
}

menu .item {
    --h: 42px;
    user-select: none;
    border-radius: 0;
    justify-content: flex-start;
    width: 100%;

    &:not(.row *):not(:last-child) {
        border-bottom: none;
    }

    &:is(.row *):not(:last-child) {
        border-right: none;
    }
}

menu .item:hover {
    text-decoration: none;
    background: var(--color-super-raised);
}

menu:not(.row) a:first-child {
    border-radius: var(--radius) var(--radius) 0 0;
}

menu:not(.row) a:last-child {
    border-radius: 0 0 var(--radius) var(--radius);

    &:is(:first-child) {
        border-radius: var(--radius) !important;
    }
}

menu.row {
    flex-direction: row;
    width: 100%;
}

menu.row a:first-child {
    border-radius: var(--radius) 0 0 var(--radius);
}

menu.row a:last-child {
    border-radius: 0 var(--radius) var(--radius) 0;
}

menu.row .item {
    justify-content: center;
    width: 100%;
}

@media screen and (max-width: 900px) {
    menu {
        width: 100%;
        flex-wrap: wrap;
        flex-direction: row;
    }

    menu .item {
        border-radius: 0 !important;
        justify-content: center;
        width: 100%;
        border-left: none;
        border-right: none;

        &:not(:last-child) {
            border-bottom: none;
        }
    }
}

menu .item.active {
    background: var(--color-primary);
    color: var(--color-text-primary);

    &:hover {
        background: var(--color-primary-lowered);
    }
}

/* chip */
.chip {
    border-radius: var(--radius);
    padding: var(--pad-1) calc(var(--pad-3) * 1.5);
    border: solid 1px var(--color-super-lowered);
    background: var(--color-lowered);
    color: var(--color-text-lowered);
    height: 24px;
    font-size: 14px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: 600;
    transition:
        background 0.15s,
        border-color 0.15s;

    &:is(a):hover {
        background: var(--color-primary-25);
        border-color: var(--color-primary-90);
    }

    & b {
        white-space: nowrap;
        text-overflow: ellipsis;
        overflow: hidden;
        display: inline-block;
    }
}

.chip.small {
    height: 20px;
    font-size: 12px;
}

.chip.primary {
    background: var(--color-primary-50);
    border-color: var(--color-primary-90);
}

.chip.secondary {
    background: var(--color-secondary);
    color: var(--color-text-secondary);
}

/* buttons */
.button.tight {
    max-width: 10rem;
}

.button.icon_only img {
    position: absolute;
}

/* lists */
.inline_list {
    margin: 0;
    padding: 0;

    & li:first-child {
        list-style: none;
    }

    & li:not(:first-child) {
        list-style: "•" inside;

        & > * {
            margin-left: 1ch;
        }
    }
}

/* cards */
.card_nest .card:nth-child(1).full {
    padding: var(--pad-4);
}

/* card */
.card,
.card_nest {
    /* border-radius: var(--radius); */
    border-radius: 0;
    width: 100%;

    &:not(.card .card) {
        box-shadow: var(--shadow-x-offset) var(--shadow-y-offset)
            var(--shadow-size) var(--color-shadow);
    }

    &.round {
        border-radius: var(--radius);
    }

    &.overflow {
        overflow: auto;
    }
}

.card_nest > .card:first-child {
    border-bottom: none;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

.card_nest > .card:last-child {
    border-top-left-radius: 0;
    border-top-right-radius: 0;
}

@media screen and (max-width: 900px) {
    .card:not(.card *, .page_header *) {
        border-left: none !important;
        border-right: none !important;
    }
}

.limited_size {
    max-width: 25rem;
}

@media screen and (max-width: 900px) {
    .card:not(.card *),
    .card_nest {
        border-radius: 0 !important;
    }
}

/* details */
details {
    width: 100%;
}

details summary {
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    gap: 0.5ch;
    transition:
        border-radius 0.15s,
        background 0.15s,
        color 0.15s;
    background: var(--color-super-raised);
    padding: var(--pad-2) var(--pad-4);
    cursor: pointer;
    border: solid 1px var(--color-super-lowered);
    border-radius: var(--radius);

    &::marker,
    &::-webkit-details-marker {
        display: none;
        content: "";
    }

    & .marker {
        transition: transform 0.15s;
        width: max-content;
        display: flex;
        justify-content: center;
        align-items: center;
    }
}

details[open] > summary {
    border-radius: var(--radius) var(--radius) 0 0;

    & .marker {
        transform: rotateZ(90deg);
    }
}

details .inner {
    border-radius: 0 0 var(--radius) var(--radius);
    border: solid 1px var(--color-super-lowered);
    background: var(--color-surface);
    color: var(--color-text);
    padding: var(--pad-4);

    &.raised {
        background: var(--color-raised);
    }
}

details[open] > summary {
    border-radius: var(--radius) var(--radius) 0 0;
    border-bottom: none;
}

/* progress bar */
.progress_bar {
    background: var(--color-super-lowered);
    border-radius: var(--radius);
    position: relative;
    overflow: hidden;
    height: 14px;
}

.progress_bar .progress {
    height: 14px;
    position: absolute;
    background-color: var(--color-primary);
}

/* toc */
.table_of_contents_wrapper {
    margin: 10px 0 0 !important;
    width: 15rem;
    height: max-content;
    position: sticky;
    top: calc(var(--nav-height) + 1ch);
    border-right: none !important;
    border-radius: var(--radius) 0 0 var(--radius) !important;
}

body:has(.table_of_contents_wrapper:not(.hidden)) #content_rect {
    border-top-left-radius: 0;
}

.table_of_contents .item {
    opacity: 50%;
    font-variation-settings: "wght" 400;
    transition:
        opacity 0.15s,
        font-variation-settings 0.15s;
    padding: var(--pad-1) var(--pad-3);
    border-radius: var(--radius);
    position: relative;
}

.table_of_contents .item.in_view {
    opacity: 100%;
    font-variation-settings: "wght" 600;
}

@media screen and (width < 900px) {
    .table_of_contents_wrapper {
        border-bottom: solid 1px var(--color-super-lowered);
        border-top: none !important;
        box-shadow: var(--shadow-x-offset) var(--shadow-y-offset)
            var(--shadow-size) var(--color-shadow);
        border-left: none !important;
        top: var(--nav-height);
        margin: 0 !important;
        position: absolute;
        width: 100dvw;
        z-index: 1;

        & .item {
            border-right: none;
        }
    }
}

/* codemirror/hljs */
.CodeMirror {
    color: var(--color-text) !important;
}

.CodeMirror {
    background: transparent !important;
    font-family: inherit !important;
    height: 10rem !important;
    min-height: 100%;
    max-height: 100%;
    cursor: text;
}

.CodeMirror-gutters,
.CodeMirror-gutter {
    background: var(--color-surface);
    border-color: var(--color-super-lowered) !important;
}

.CodeMirror-linenumber {
    user-select: none;
    pointer-events: none;
}

.CodeMirror:has(.CodeMirror-gutter) {
    border: solid 1px var(--color-super-lowered);
    border-radius: var(--radius);

    & .CodeMirror-line {
        margin-left: 5px;
    }
}

.CodeMirror-cursor {
    border-color: rgb(0, 0, 0) !important;
}

.cm-fat-cursor-mark {
    color: white;
    background-color: rgb(0, 0, 0) !important;
}

.CodeMirror-cursor:is(.dark *) {
    border-color: rgb(255, 255, 255) !important;
}

.cm-fat-cursor-mark:is(.dark *) {
    color: black;
    background-color: rgb(255, 255, 255) !important;
}

.CodeMirror-cursor {
    height: 22px !important;
}

.CodeMirror-dialog {
    position: absolute;
    bottom: 5px;
    width: 100%;
    background: var(--color-surface);
    padding: 0 var(--pad-2);
    top: 1;
}

.CodeMirror-dialog input {
    --h: max-content;
    padding: 0;
    background: transparent !important;
    box-shadow: none !important;
    outline: none !important;
}

[role="presentation"]::-moz-selection,
[role="presentation"] *::-moz-selection {
    background-color: rgb(191, 219, 254) !important;
}

[role="presentation"]::selection,
[role="presentation"] *::selection,
.CodeMirror-selected {
    background-color: rgb(191, 219, 254) !important;
}

[role="presentation"]:is(.dark *)::-moz-selection,
[role="presentation"] *:is(.dark *)::-moz-selection {
    background-color: rgb(64, 64, 64) !important;
}

[role="presentation"]:is(.dark *)::selection,
[role="presentation"] *:is(.dark *)::selection,
.CodeMirror-selected:is(.dark *) {
    background-color: rgb(64, 64, 64) !important;
}

.cm-header,
.cm-strong {
    color: inherit !important;
    font-variation-settings: "wght" 500 !important;
}

.cm-variable-2,
.cm-quote,
.cm-keyword,
.cm-string,
.cm-atom,
.hljs-string,
.cm-positive {
    color: rgb(63, 98, 18) !important;
}

.cm-variable-2:is(.dark *),
.cm-quote:is(.dark *),
.cm-keyword:is(.dark *),
.cm-string:is(.dark *),
.cm-atom:is(.dark *),
.hljs-string:is(.dark *),
.cm-positive:is(.dark *) {
    color: rgb(217, 249, 157) !important;
}

.cm-comment,
.hljs-keyword,
.cm-negative,
.cm-builtin {
    color: oklch(47% 0.157 37.304) !important;
}

.cm-comment:is(.dark *),
.hljs-keyword:is(.dark *),
.cm-negative:is(.dark *),
.cm-builtin:is(.dark *) {
    color: oklch(90.1% 0.076 70.697) !important;
}

.cm-link {
    color: var(--color-link) !important;
}

.cm-url,
.cm-property,
.cm-qualifier,
.hljs-title,
.cm-variable {
    color: rgb(29, 78, 216) !important;
}

.cm-url:is(.dark *),
.cm-property:is(.dark *),
.cm-qualifier:is(.dark *),
.hljs-title:is(.dark *),
.cm-variable:is(.dark *) {
    color: rgb(191, 219, 254) !important;
}

.cm-variable-3,
.cm-tag,
.cm-def,
.cm-attribute,
.cm-number,
.hljs-type,
.cm-meta {
    color: rgb(91, 33, 182) !important;
}

.cm-variable-3:is(.dark *),
.cm-tag:is(.dark *),
.cm-def:is(.dark *),
.cm-attribute:is(.dark *),
.cm-number:is(.dark *),
.hljs-type:is(.dark *),
.cm-meta:is(.dark *) {
    color: rgb(221, 214, 254) !important;
}

.hljs-built_in {
    color: var(--color-purple) !important;
}

.hljs-variable {
    color: var(--color-link) !important;
}

.hljs-number {
    color: var(--color-green) !important;
}

.hljs-link {
    color: var(--color-link) !important;
}

.CodeMirror-scroll {
    height: 100% !important;
}

.CodeMirror-line {
    padding-left: 0 !important;
    font-size: 16px !important;
}

.CodeMirror-focused .CodeMirror-placeholder {
    opacity: 50%;
}

.hljs {
    background: transparent !important;
    color: inherit !important;
    padding: 0 !important;
}

/* misc layout */
.container {
    margin: 0 !important;
    width: 100%;
}

#content_rect {
    margin: 10px auto 0 !important;
}

.content_container {
    margin: 0 auto var(--pad-2);
    width: 100%;
}

article.content_container:has(.page_header) {
    margin: 0;
    max-width: unset;
    width: 100dvw;
}

.content_container.no_margin {
    margin: 0 auto !important;
}

.tab {
    flex: 1 0 auto;
    overflow: auto;
    position: relative;
}

.tabs .tab {
    height: 100%;
}

.fadein {
    animation: fadein ease-in-out 1 0.5s forwards running;
}

ul,
ol {
    margin: var(--pad-2) 0 var(--pad-2) var(--pad-4);
}

#messages {
    margin-bottom: 0 !important;
}

#messages:has(+ .bar) {
    margin-bottom: 1rem !important;
}

pre {
    padding: var(--pad-2) var(--pad-4);
    border-left: solid 5px var(--color-primary);
    background: var(--color-surface);
    border-radius: var(--radius);
    margin-bottom: var(--pad-4);
}

code {
    padding: 0;
}

pre,
code {
    font-family: "Jetbrains Mono", "Fire Code", monospace;
    width: 100%;
    max-width: 100%;
    overflow: auto;
    border-radius: var(--radius);
    font-size: 0.8rem !important;
    color: inherit;
}

code * {
    font-size: 0.8rem !important;
}

code:not(pre *) {
    padding: var(--pad-1) var(--pad-3);
    background: oklch(98% 0.016 73.684 / 25%);
    color: oklch(90.1% 0.076 70.697);
    border-radius: var(--radius);
    white-space: break-spaces;
}

code:not(pre *):not(.dark *) {
    background: oklch(83.7% 0.128 66.29 / 25%);
    color: oklch(47% 0.157 37.304);
}

hr {
    border-top: solid 1px var(--color-super-lowered) !important;
    border-left: 0;
    border-bottom: 0;
    border-right: 0;
}

hr.margin,
.container hr {
    margin: var(--pad-4) 0;
}

span.img_sizer {
    display: inline-block;
}

.color_block a {
    color: inherit;
    background: transparent;
    padding: 0;
}

:is(h1, h2, h3, h4, h5, h6) p {
    font-variation-settings: inherit !important;
}

img {
    display: inline;
    max-width: 100%;
    vertical-align: middle;
}

.img_sizer img {
    width: 100%;
    height: 100%;
}

.avatar {
    --size: 18px;
    width: var(--size);
    height: var(--size);
    aspect-ratio: 1 / 1;
}

blockquote {
    padding-left: 1rem;
    border-left: solid 5px var(--color-green);
    color: var(--color-green);
    opacity: 75%;
}

p,
span {
    font-size: inherit;
}

a.big_link {
    background: oklch(80.9% 0.105 251.813 / 25%);
    padding: var(--pad-1) var(--pad-3);
    font-variation-settings: "wght" 400;
    text-decoration: none;
    border-radius: var(--radius);
    transition: background 0.15s;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: var(--pad-2);

    &:hover {
        background: oklch(80.9% 0.105 251.813 / 30%);
    }

    &.red {
        background: oklch(94.1% 0.03 12.58 / 45%);

        &:hover {
            background: oklch(94.1% 0.03 12.58 / 50%);
        }
    }

    &.red:is(.dark *) {
        background: oklch(94.1% 0.03 12.58 / 15%);

        &:hover {
            background: oklch(94.1% 0.03 12.58 / 20%);
        }
    }
}

.hash {
    font-family: monospace;
    font-size: 14px;
    font-weight: 500;
}

.page_header {
    background: var(--color-surface);
    border-bottom: solid 1px var(--color-super-lowered);
    width: 100dvw;
    padding: var(--pad-4) var(--pad-4) 0;
}

.page_body {
    padding-top: var(--pad-2);
}

body:has(.page_header) {
    background: var(--color-raised);
}

#messages.full,
body:has(.page_header) #messages {
    margin: 0 !important;
    padding: 0 !important;
    list-style: none;
}

.card.message,
#messages.full li,
body:has(.page_header) #messages li {
    --border-color: transparent;
    padding: var(--pad-4);
    width: 100%;
    border-bottom: solid 1px var(--border-color);

    &:not(#messages *) {
        border-radius: var(--radius);
        border: solid 1px var(--border-color);
    }

    &.green {
        --border-color: oklch(72.3% 0.219 149.579 / 50%);
        background: oklch(79.2% 0.209 151.711 / 25%);
    }

    &.red {
        --border-color: oklch(64.5% 0.246 16.439 / 25%);
        background: oklch(71.2% 0.194 13.428 / 25%);
    }

    &.yellow {
        --border-color: oklch(82.8% 0.189 84.429 / 50%);
        background: oklch(87.9% 0.169 91.605 / 25%);
    }

    &.purple {
        --border-color: oklch(71.4% 0.203 305.504 / 25%);
        background: oklch(71.4% 0.203 305.504 / 25%);
    }
}

/* nav */
nav.sticky {
    background: var(--color-raised);
    position: sticky;
    z-index: 2;
    top: 0;
}

nav {
    height: var(--nav-height);
    padding: 0 var(--pad-4);
    border-bottom: solid 1px var(--color-super-lowered);
    box-shadow: none;
    z-index: 4 !important;
    --radius: 4px;

    & .dropdown:has(.inner.open) .button:nth-child(1):not(.inner *) {
        background: var(--color-lowered);
        color: var(--color-text-lowered);
        opacity: 100% !important;
    }

    & .dropdown .inner {
        top: calc(var(--nav-height) * 0.75);
    }

    & .content_container {
        margin-bottom: 0 !important;
    }

    &:not(.sticky) {
        border: none;

        & .sticky {
            display: none;
        }

        & .button {
            background: transparent;
            color: inherit;
            border: none;
        }
    }

    & .button:not(.dropdown .inner *, .hover_state, :hover) {
        border: solid 1px transparent;
    }

    & .button:is(:hover, .hover_state) {
        background: var(--color-super-raised);
    }
}

nav .button:not(.icon_only) {
    --h: 28px;
}

/* icons */
.card.icon_focus svg.icon {
    width: 2em;
    height: 2em;
}

img.icon {
    width: 1em;
    height: 18px;
}
