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

:root {
    color-scheme: light dark;
    --hue: 240.02;
    --sat: 24%;

    --color-super-lowered: hsl(var(--hue), var(--sat), 88%);
    --color-super-lowered-75: hsla(var(--hue), var(--sat), 88%, 0.75);
    --color-lowered: hsl(var(--hue), var(--sat), 92%);
    --color-surface: hsl(var(--hue), var(--sat), 94%);
    --color-raised: hsl(var(--hue), var(--sat), 98%);
    --color-raised-75: hsla(var(--hue), var(--sat), 98%, 0.75);
    --color-super-raised: hsl(var(--hue), var(--sat), 100%);
    --color-super-raised-75: hsla(var(--hue), var(--sat), 100%, 0.75);
    --color-text: hsl(0, 0%, 5%);

    --radius: 6px;

    --nav-height: 48px;
    --nav-width: 256px;
    --nav-background: var(--color-raised);
    --nav-super-background: var(--color-surface);
    --nav-color: var(--color-text);

    --color-link: #2949b2;
    --color-shadow: rgba(0, 0, 0, 0.1);
    --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-2);

    --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;
}

.dark,
.dark * {
    --sat: 12%;

    --color-super-lowered: hsl(var(--hue), var(--sat), 18%);
    --color-super-lowered-75: hsla(var(--hue), var(--sat), 18%, 0.75);
    --color-lowered: hsl(var(--hue), var(--sat), 14%);
    --color-surface: hsl(var(--hue), var(--sat), 12%);
    --color-raised: hsl(var(--hue), var(--sat), 8%);
    --color-raised-75: hsla(var(--hue), var(--sat), 8%, 0.75);
    --color-super-raised: hsl(var(--hue), var(--sat), 6%);
    --color-super-raised-75: hsla(var(--hue), var(--sat), 6%, 0.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%);
}

.strawberry,
.strawberry * {
    --hue: 0;
    --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%);
}

.orange,
.orange * {
    --hue: 32;
    --color-primary: oklch(75% 0.183 55.934) !important;
    --color-primary-90: oklch(75% 0.183 55.934 / 90%) !important;
    --color-primary-lowered: oklch(70.5% 0.213 47.604) !important;
    --color-primary-lowered-90: oklch(70.5% 0.213 47.604 / 90%) !important;
    --color-primary-50: oklch(75% 0.183 55.934 / 50%) !important;
    --color-primary-25: oklch(75% 0.183 55.934 / 25%) !important;
    --color-text-primary: hsl(0, 0%, 5%);
}

.blueberry,
.blueberry * {
    --hue: 211;
    --color-primary: oklch(70.7% 0.165 254.624) !important;
    --color-primary-90: oklch(70.7% 0.165 254.624 / 90%) !important;
    --color-primary-lowered: oklch(0.677 0.165 254.624) !important;
    --color-primary-lowered-90: oklch(0.677 0.165 254.624 / 90%) !important;
    --color-primary-50: oklch(70.7% 0.165 254.624 / 50%) !important;
    --color-primary-25: oklch(70.7% 0.165 254.624 / 25%) !important;
    --color-text-primary: hsl(0, 0%, 5%);
}

.dragonfruit,
.dragonfruit * {
    --hue: 315;
    --color-primary: oklch(71.8% 0.202 349.761) !important;
    --color-primary-90: oklch(71.8% 0.202 349.761 / 90%) !important;
    --color-primary-lowered: oklch(65.6% 0.241 354.308) !important;
    --color-primary-lowered-90: oklch(65.6% 0.241 354.308 / 90%) !important;
    --color-primary-50: oklch(71.8% 0.202 349.761 / 50%) !important;
    --color-primary-25: oklch(71.8% 0.202 349.761 / 25%) !important;
    --color-text-primary: hsl(0, 0%, 5%);
}

.grape,
.grape * {
    --hue: 280;
    --color-primary: oklch(0.654 0.203 305.504) !important;
    --color-primary-90: oklch(0.654 0.203 305.504 / 90%) !important;
    --color-primary-lowered: oklch(62.7% 0.265 303.9) !important;
    --color-primary-lowered-90: oklch(62.7% 0.265 303.9 / 90%) !important;
    --color-primary-50: oklch(0.654 0.203 305.504 / 50%) !important;
    --color-primary-25: oklch(0.654 0.203 305.504 / 25%) !important;
    --color-text-primary: hsl(0, 0%, 5%);
}

.apple,
.apple * {
    --hue: 128;
    --color-primary: oklch(84.1% 0.238 128.85) !important;
    --color-primary-90: oklch(84.1% 0.238 128.85 / 90%) !important;
    --color-primary-lowered: oklch(76.8% 0.233 130.85) !important;
    --color-primary-lowered-90: oklch(76.8% 0.233 130.85 / 90%) !important;
    --color-primary-50: oklch(84.1% 0.238 128.85 / 50%) !important;
    --color-primary-25: oklch(84.1% 0.238 128.85 / 25%) !important;
    --color-text-primary: hsl(0, 0%, 5%);
}

.mango,
.mango * {
    --hue: 47;
    --color-primary: oklch(85.2% 0.199 91.936) !important;
    --color-primary-90: oklch(85.2% 0.199 91.936 / 90%) !important;
    --color-primary-lowered: oklch(0.792 0.199 91.936) !important;
    --color-primary-lowered-90: oklch(0.792 0.199 91.936 / 90%) !important;
    --color-primary-50: oklch(85.2% 0.199 91.936 / 50%) !important;
    --color-primary-25: oklch(85.2% 0.199 91.936 / 25%) !important;
    --color-text-primary: hsl(0, 0%, 5%);
}

.coconut,
.coconut * {
    --hue: 0;
    --sat: 0% !important;
    --color-primary: oklch(0.1579 0 0) !important;
    --color-primary-90: oklch(0.1579 0 0 / 90%) !important;
    --color-primary-lowered: oklch(0.2379 0 0) !important;
    --color-primary-lowered-90: oklch(0.2379 0 0 / 90%) !important;
    --color-primary-50: oklch(0.1579 0 0 / 50%) !important;
    --color-primary-25: oklch(0.1579 0 0 / 25%) !important;
    --color-text-primary: hsl(0, 0%, 95%);

    &:is(.dark, .dark *) {
        --color-primary: oklch(1 0 0) !important;
        --color-primary-90: oklch(1 0 0 / 90%) !important;
        --color-primary-lowered: oklch(0.94 0 0) !important;
        --color-primary-lowered-90: oklch(0.94 0 0 / 90%) !important;
        --color-primary-50: oklch(1 0 0 / 50%) !important;
        --color-primary-25: oklch(1 0 0 / 25%) !important;
        --color-text-primary: hsl(0, 0%, 5%);
    }
}

html,
body {
    line-height: 1.5;
    letter-spacing: 0.15px;
    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";
    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 {
    height: calc(100dvh - var(--nav-height));
}

.round_lg {
    border-radius: calc(var(--radius) * 2) !important;
}

.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;
    padding-top: var(--pad-2);
    width: 100%;
}

.page_content {
    width: calc(100dvw - var(--pad-2) - var(--nav-width));
}

@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);
    color: var(--color-text);
    border: solid 1px var(--color-super-lowered);
}

.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: 0;
    border-radius: var(--r) !important;

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

    &.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: 36px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--pad-2);
    padding: var(--pad-2) calc(var(--pad-3) * 1.5);
    cursor: pointer;
    width: max-content;
    height: var(--h);
    line-height: var(--h);
    text-decoration: none !important;
    font-family: inherit !important;
    user-select: none;
    appearance: none;
    overflow: hidden;
    position: relative;
    outline: solid 2px transparent;
    border: solid 1px var(--color-super-lowered-75);
    color: var(--color-text);
    transition:
        background 0.15s,
        border 0.15s,
        outline 0.15s;
    background: var(--color-raised);

    &:is(nav *, .dropdown .inner *):not(
            .red:not(.dark *),
            .green:not(.dark *)
        ) {
        background: var(--color-raised);

        &:not(.dropdown > button):hover {
            background: var(--color-super-raised) !important;
        }
    }

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

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

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

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

.button.long {
    min-width: 10rem;
}

.button.icon_only {
    width: var(--h) !important;
}

.dropdown .inner .button {
    border: none;
    box-shadow: none;
}

.button.camo {
    background: inherit;

    &.simple {
        border: none;
        border-radius: 360px;
        transition:
            background 0.15s,
            border-color 0.15s,
            transform 0.15s;

        &:hover {
            background: var(--color-primary-25);
            transform: scale(1.05);
        }
    }
}

.button.green:not(.dark *, nav *) {
    background: oklch(62.7% 0.194 149.214 / 90%);
    border-color: oklch(44.8% 0.119 151.328 / 50%);
    color: white !important;

    &:hover {
        background: oklch(62.7% 0.194 149.214);
    }
}

.button.red:not(.dark *, nav *) {
    background: oklch(58.6% 0.253 17.585 / 90%);
    border-color: oklch(45.5% 0.188 13.697 / 50%);
    color: white !important;

    &:hover {
        background: oklch(58.6% 0.253 17.585);
    }
}

.button.primary {
    background: var(--color-primary);
    border-color: var(--color-primary-90);
    color: var(--color-text-primary);

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

    &.camo {
        border: solid 1px var(--color-primary-90);
        background: var(--color-primary-25);
        border-radius: 360px;
        color: inherit;

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

.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;
}

/* 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;

        &:not(.red:not(.dark *), .green:not(.dark *)) {
            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 */
p,
ul,
ol {
    margin-bottom: var(--pad-4) !important;

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

.post_right:not(.repost) {
    max-width: calc(100% - 52px);
}

.rhs {
    width: 100% !important;
}

.name {
    max-width: 250px;
    overflow: hidden;
    /* overflow-wrap: break-word; */
    overflow-wrap: anywhere;
    text-overflow: ellipsis;
}

@media screen and (min-width: 901px) {
    .name.shorter {
        max-width: 200px;
    }

    .name.lg\:long {
        max-width: unset;
    }

    .rhs {
        width: calc(100% - 23rem) !important;
    }

    #page_content {
        max-width: calc(100dvw - var(--nav-width));
        padding: 0 var(--pad-4);
    }
}

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

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);
}

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

.filled svg.icon {
    fill: currentColor;
}

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

.icon_wrapper:not(.hidden) {
    display: contents;
}

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;
}

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%;
}

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

.color_block a {
    color: inherit;
}

a.flush {
    color: inherit;
}

a:hover {
    text-decoration: underline wavy currentColor;
}

img {
    display: inline;
    max-width: 100%;
    vertical-align: middle;
    border-radius: var(--radius);
}

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

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

p,
span {
    font-size: inherit;

    &.small {
        font-size: 14px;
    }
}

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

    to {
        opacity: 100%;
    }
}

@keyframes popin {
    from {
        opacity: 0%;
        transform: scale(0.5);
    }

    to {
        opacity: 100%;
        transform: scale(1);
    }
}

.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);
    }
}

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

.popin {
    animation: popin ease-in-out 1 0.15s forwards running;
}

.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;
    }
}

/* details */
details {
    width: 100%;
    margin: var(--pad-4) 0;
}

details summary {
    background: var(--color-super-raised);
    padding: var(--pad-2) var(--pad-4);
    cursor: pointer;
}

details .content {
    padding: var(--pad-4);
    background: var(--color-surface);
}

/* 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_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.active::after {
    content: "";
    position: absolute;
    bottom: 0;
    height: 2px;
    width: 100%;
    background: var(--color-primary);
}

menu:not(.row) .item.active::after {
    height: 100%;
    width: 2px;
    left: 0;
}

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;
        }
    }
}

/* 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-50);
        border-color: var(--color-primary-90);
    }
}

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

.chip.green:not(.dark *) {
    background: var(--color-green);
    color: white !important;
}

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

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

.button.icon_only img {
    position: absolute;
}

.flavor_button {
    border-radius: 360px;
    width: 42px;
    height: 42px;
    display: block;
    border: none;
    outline: none;
    cursor: pointer;
}

.flavor_button.active {
    outline: solid 2px var(--color-primary);
    outline-offset: 2px;
}

/* 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 {
    box-shadow: var(--shadow-x-offset) var(--shadow-y-offset) var(--shadow-size)
        var(--color-shadow);
    /* border-radius: var(--radius); */
    border-radius: 0;
    width: 100%;
    overflow: hidden;

    &.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;
    }
}

.banner_card {
    background-size: cover !important;
    background-position: center !important;
    aspect-ratio: 5 / 1;
}

.banner_card:is(.limited_size *) {
    aspect-ratio: 5 / 2;
}

.info_card {
    overflow: visible;
}

.space_card {
    outline: solid 2px transparent;
    transition:
        outline 0.15s,
        outline-offset 0.15s;

    & .avatar {
        margin: calc(-1 * var(--size) / 1.25) 0 0 !important;

        @media screen and (max-width: 899px) {
            & {
                --size: 80px !important;
            }
        }
    }

    &:hover {
        outline: solid 2px var(--color-primary) !important;
        outline-offset: 2px;
    }
}

/* details */
details {
    width: 100%;
    margin: var(--pad-4) 0;
}

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: auto !important;
    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%;
}

.CodeMirror-placeholder {
    font-size: inherit !important;
    font-family: inherit !important;
}

.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;
}

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%;
}

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;
    border-radius: 360px;
}

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: solid 1px var(--border-color);
    border-radius: var(--radius);

    &:not(#messages *) {
        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 {
    height: var(--nav-height);
    padding: var(--pad-1);
    background: var(--nav-background);
    color: var(--nav-color);

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

nav.sticky {
    position: sticky;
    z-index: 2;
    top: 0;
}

nav {
    padding: 0 var(--pad-4);
    box-shadow: none;
    z-index: 8 !important;
    --radius: 4px;

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

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

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

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

        & .sticky {
            display: none;
        }

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

    @media screen and (min-width: 900px) {
        &::after {
            content: "";
            position: absolute;
            bottom: 0;
            right: 0;
            border-bottom: solid 1px var(--color-super-lowered);
            width: calc(100dvw - var(--nav-width));
            box-shadow: var(--shadow-x-offset) var(--shadow-y-offset)
                var(--shadow-size) var(--color-shadow);
        }

        &:not(:has(#sidebar_button)) {
            border-bottom: solid 1px var(--color-super-lowered);

            &::after {
                content: unset;
            }
        }
    }

    @media screen and (max-width: 899px) {
        & {
            box-shadow: var(--shadow-x-offset) var(--shadow-y-offset)
                var(--shadow-size) var(--color-shadow);
        }
    }
}

nav:not(.sticky) .button {
    background: var(--color-raised);
    color: var(--color-text);
}

nav .button {
    --h: 36px;
}

.sidenav {
    width: var(--nav-width);
    min-width: var(--nav-width);
    background: var(--nav-background);
    color: var(--nav-color);
    position: fixed;
    top: var(--nav-height);
    height: 100%;
    padding: var(--pad-2);
    border-right: solid 1px var(--color-super-lowered);
    box-shadow: var(--shadow-x-offset) var(--shadow-y-offset) var(--shadow-size)
        var(--color-shadow);

    & .header {
        padding: 0 var(--pad-3);
    }

    & .button:not(.header *) {
        --h: 42px;
        border-radius: calc(var(--radius) * 2);
        background: var(--nav-background);
        color: var(--nav-color);
        justify-content: flex-start;
        padding: 0 var(--pad-4);
        color: inherit;
        border: none;
        width: 100%;

        &:hover,
        &.active {
            background: var(--nav-super-background);
            color: var(--nav-color);
        }
    }

    @media screen and (max-width: 899px) {
        &:not(.open) {
            display: none;
        }

        & {
            position: absolute;
            top: 0;
            left: 0;
            z-index: 400;
            width: 100dvw;
            height: 100dvh;
            overflow: auto;
            animation: fadein ease-in-out 1 0.25s forwards running;
        }
    }

    & .title {
        font-variation-settings: "wght" 400;
        padding: var(--pad-2) var(--pad-4);
        font-variant-caps: all-petite-caps;
        font-size: 16px;
        opacity: 75%;
    }
}

body:has(.sidenav.open) {
    overflow: hidden;
}

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

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

/* utils */
.flex_grow {
    flex: 1 0 auto;
}

.h_content {
    height: max-content !important;
}

@media screen and (max-width: 899px) {
    .sm\:w_full {
        width: 100% !important;
    }

    .sm\:flex_rev_col {
        flex-direction: column-reverse !important;
    }
}

/* quick find */
kbd {
    border-radius: var(--radius);
    padding: var(--pad-1) var(--pad-2);
    font-size: 12px;
    border: solid 1px var(--color-super-lowered);
    box-shadow: 1px 1px 0 var(--color-super-lowered);
    height: 24px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: inherit;

    @media screen and (max-width: 899px) {
        & {
            display: none;
        }
    }
}

.quick_find {
    justify-content: space-between !important;
    border-radius: 360px !important;
    margin-bottom: var(--pad-4);
    opacity: 75%;

    &:hover {
        opacity: 100%;
    }
}

#quick_find {
    padding: 0;
}

#quick_find_actions_box {
    max-height: 250px;
    overflow: auto;

    & .button {
        min-height: var(--h);
    }
}
