:root {
    --sidebar-width: 230px;

    --content-width: 640px;
    --titlebar-height: 72px;
    --tab-bar-height: 64px;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Google Sans Flex', sans-serif;

    background-color: var(--md-sys-color-background);
    color: var(--md-sys-color-on-surface);

    width: 100vw;
    height: 100%;
}

a {
    text-decoration: none;
    color: var(--md-sys-color-primary);
}

a:hover {
    text-decoration: underline;
}

a.no-highlight {
    color: inherit;
}

img {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

ul,
ol {
    padding-left: 20px;
    margin: 0;
}

button {
    font-family: inherit;
    font-size: 1em;
    border: none;
}

#app {
    /* position: fixed;
    top: 0;
    left: 0; */
    width: 100%;
    min-height: 100vh;
    height: 100%;

    display: flex;
}

#nav {
    height: var(--nav-height);
    padding: env(safe-area-inset-top) 0 0 0;
    display: flex;
    align-items: center;

    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 100;
}

#main {
    height: 100%;
    padding-top: env(safe-area-inset-top);
    /* padding-left: var(--sidebar-width); */
    box-sizing: border-box;
    margin: 0 auto;

    width: min(100%, var(--content-width));
}

/* Sidebar */

.sidebar-wrapper {
    flex: 1;
}

.sidebar {
    width: var(--sidebar-width);
    position: fixed;
    left: 0;
    top: 0;
    padding: 1.5rem;
    box-sizing: border-box;
    height: 100%;

    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 1.5rem;
}

.widget-area {
    width: 100%;
    max-width: 360px;
    padding: 1.5rem;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 1.5rem;
    position: sticky;
    top: var(--titlebar-height);
}

.sidebar-items {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 2px;
    flex: 1;
}

.sidebar-item-icon {
    width: 24px;
    height: 24px;
    border-radius: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-item {
    width: 100%;

    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.5rem;
    padding: 0.25rem 0.5rem;
    cursor: pointer;
    font-size: 0.85rem;

    user-select: none;
    border-radius: 100px;
    position: relative;
    overflow: hidden;

    text-decoration: none !important;
    color: unset;
}

.sidebar-item-title {
    font-weight: 500;
    font-size: 0.85rem;
    font-variation-settings: "OPSZ" 18;
}

.sidebar-item.active {
    font-variation-settings: "GRAD" 125;
    color: var(--md-sys-color-on-surface-variant);
    background: var(--md-sys-color-surface-variant);
}

.sidebar-item-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.1rem 0.5rem;
    border-radius: 100px;
    background: var(--md-sys-color-error);
    color: var(--md-sys-color-on-error);
    font-size: 0.8rem;
    font-weight: 600;
    font-variation-settings: "OPSZ" 18;
}

.user-area {
    width: 100%;

    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.25rem;
    font-size: 0.85rem;

    user-select: none;
}

.ua-inner {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.5rem;
    padding-top: 8px;
    flex: 1;
    position: relative;
    overflow: hidden;
}

.ua-solid {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.5rem;

    border-radius: 100px;
    padding: 0.25rem;
}

.user-actions {
    width: 100%;

    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
    padding-top: 8px;
    flex: 0;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    /* overflow: hidden; */
    position: relative;
}

.user-avatar img {
    width: 100%;
    height: 100%;

    border-radius: 100px;
    object-fit: cover;
    box-sizing: border-box;

    user-select: none;
    -webkit-user-select: none;
}

.user-avatar.online::after {
    content: '';
    position: absolute;
    bottom: 0px;
    right: 0px;
    width: 12px;
    height: 12px;
    border-radius: 100px;
    background-color: #29cd8e;
    box-shadow: 0 0 0 3px var(--md-sys-color-surface);
}

.user-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 2px;

    flex: 1;
}

.user-username {
    font-weight: 600;
    font-size: 0.85rem;
    font-variation-settings: "OPSZ" 18;
}

.icon-button {
    border-radius: 100px;
    padding: 8px;
    cursor: pointer;
    border: none;
    background: transparent;
    color: var(--md-sys-color-on-surface-container-high);
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
}

.widget {
    background: var(--md-sys-color-surface-container);
    color: var(--md-sys-color-on-surface);
    padding: 0.5rem;
    box-sizing: border-box;
    border-radius: 16px;

    width: 100%;
}

.widget-title {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 0.5rem;
    margin: 0;
    padding: 0.5rem;

    font-size: 1rem;
    font-weight: 600;

    user-select: none;
    -webkit-user-select: none;
}

.back-btn {
    border: none;
    padding: 0.25rem;
    border-radius: 35px;
    background: var(--md-sys-color-background);
    color: var(--md-sys-color-on-background);

    cursor: pointer;
}

.back-btn:hover {
    background-color: var(--md-sys-color-surface-container);
}

/* Content */

.content {
    /* border-radius: 24px; */
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 2px;

    padding: calc(env(safe-area-inset-top) + var(--titlebar-height)) 0 calc(env(safe-area-inset-bottom) + 36px) 0;
    max-width: var(--content-width);
    width: 100%;

}

/* Post */

.post {
    background-color: var(--md-sys-color-surface-container);
    color: var(--md-sys-color-on-surface);
    padding: 1rem;
    box-sizing: border-box;
    display: flex;
    flex-direction: row;
    gap: 8px;

    border-radius: 4px;

    user-select: none;
    -webkit-user-select: none;
}

/* .post:hover {
    background: var(--md-sys-color-surface-container-low);
} */

.post.unfocused {
    cursor: pointer;
}

.post-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.load-more-post {
    appearance: none;
    border: none;
    width: 100%;
    justify-content: center;
    align-items: center;
    min-height: 72px;
    font: inherit;
    color: var(--md-sys-color-on-surface);
    position: relative;
    overflow: hidden;
}

.load-more-post:disabled {
    cursor: default;
}

.load-more-label {
    margin: auto;
}

.user-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 1.5rem;
    border-radius: 4px;
    position: relative;
    overflow: hidden;
    background: var(--md-sys-color-surface-container);
    color: var(--md-sys-color-on-surface) !important;
    text-decoration: none !important;
}

.user-row-pfp {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
}

.user-row-info {
    min-width: 0;
}

.user-row-name {
    font-weight: 600;
}

.user-row-bio {
    color: var(--md-sys-color-on-surface-container-variant);
    font-size: 0.9em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.post-container {
    display: flex;
    flex-direction: column;
    /* gap: 4px; */
    flex-grow: 1;
    overflow: hidden;

    text-wrap: wrap;
    word-wrap: anywhere;
}

.post-content {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding-top: 2px;

    font-size: 0.9em;
}

.post-content>p,
.post-content>span,
.post-content>pre,
.post-content>blockquote>p,
.post-content li {
    font-size: 1em;
    line-height: 1.3;
}

.post-content>pre {
    margin: 0;
    padding: .75rem;
    background: #000;
    color: #fff;
    border-radius: 8px;
    overflow: scroll
}

.post-content>p,
.post-content>span,
.post-content>blockquote>p,
.post-content>h1,
.post-content>h2,
.post-content>h3,
.post-content>h4,
.post-content>h5,
.post-content>h6,
.post-content li {
    margin: 0
}

.post-content li {
    word-wrap: normal
}

.post-content mark {
    padding: 2px 4px;
    border-radius: 4px;
    color: #fff86f;
    background-color: #58510b
}

.post-content mark a {
    color: #fff86f;
    text-decoration: unset;
}

.post-content>img {
    border-radius: 8px;
    max-height: 400px;
    object-fit: cover;
    box-sizing: border-box;
    width: fit-content;
    max-width: 100%
}

.post-content a {
    text-decoration: underline;
    color: var(--md-sys-color-primary);
}

.post-content blockquote {
    border-left: 3px solid var(--md-sys-color-outline);
    padding: 0 5px;
    margin: 2px 0;
}

.post-content li {
    word-wrap: normal;
}

.post-header {
    display: flex;
    flex-direction: row;
    gap: 5px;
    margin-bottom: 2px;
    font-weight: 500;
    align-items: baseline;
}

.post-author {
    font-weight: 600;
}

.post-author a {
    color: var(--md-sys-color-on-surface-container-high);
}

.post-date {
    font-size: 0.8em;
    color: var(--md-sys-color-on-surface-variant);
}

.post-actions {
    display: flex;
    gap: 12px;
    margin-top: 8px;
}

.post-action {
    display: flex;
    gap: 5px;
    align-items: flex-end;
    font-weight: 600;
    position: relative;
    z-index: 0;
    padding: 4px 10px 6px 10px;
    border-radius: 100px;
    justify-content: center;
}

.post-action.disabled {
    cursor: not-allowed;
    opacity: 0.45;
}

.count {
    user-select: none;
    -webkit-user-select: none;
    font-size: .8rem;
}

.action-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.loved {
    color: var(--love-color);
}

.love {
    fill: none;
    stroke: currentColor;
}

.loved .love {
    color: var(--love-color);
    fill: currentColor;
    stroke: currentColor;
}

.pfp-container {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
}

.pfp {
    width: 100%;
    height: 100%;

    border-radius: 100px;
    object-fit: cover;
    box-sizing: border-box;

    user-select: none;
    -webkit-user-select: none;
}

.post.repost {
    background: var(--md-sys-color-surface-container-high);
    padding: 0.5rem;
    margin-top: 0.25rem;
    border-radius: 10px;
}

.unfocused .post.repost {
    pointer-events: none;
}

.repost .post-author {
    font-size: 1rem;
}

.post.repost>.pfp-container {
    width: 24px;
    height: 24px;
}

.mention,
.hashtag {
    font-weight: 500;
}

.mention:hover,
.hashtag:hover {
    text-decoration: underline;
    cursor: pointer;
}

/* Titlebar */

.titlebar {
    padding: 0 1rem;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    /* gap: 1rem; */
    background: var(--md-sys-color-background);

    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: var(--content-width);
    height: var(--titlebar-height);
    z-index: 1000;
}

.titlebar.transparent {
    color: transparent;
}

.titlebar-title {
    margin-left: 8px;
    flex: 1;
}

.titlebar-title-label {
    font-size: 1.25rem;
    font-weight: 500;
    font-variation-settings: "ROND" 100;
    font-feature-settings: "ss02" on, "liga" off, "clig" off;
    user-select: none;
}

.titlebar-trailing {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Mask */

.content-mask {
    top: 0;
    left: 0;
    width: 100%;
    position: absolute;
    pointer-events: none;
    -webkit-user-select: none;
    user-select: none;
}

.mask-left-outer {
    width: 60px;
    height: 60px;
    top: calc(0px + var(--titlebar-height));
    left: 0;
    overflow: hidden;
    z-index: 1;
    position: absolute
}

.mask-left {
    height: 60px;
    width: 60px;
    top: 12px;
    box-shadow: 0 0 0 48px var(--md-sys-color-background);
    inset-inline-start: 12px;
    border-start-start-radius: 30px;
}

.mask-right-outer {
    width: 60px;
    height: 60px;
    top: calc(0px + var(--titlebar-height));
    right: 0;
    overflow: hidden;
    z-index: 1;
    position: absolute
}

.mask-right {
    height: 60px;
    width: 60px;
    top: 12px;
    box-shadow: 0 0 0 48px var(--md-sys-color-background);
    inset-inline-end: 12px;
    border-start-end-radius: 30px;
}

/* Modals */

#modal-outer {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 10000;

    pointer-events: none;
}

.modal-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;

    background-color: transparent;
    pointer-events: none;
}

.modal-wrapper.open {
    /* background-color: rgba(0, 0, 0, 0.5); */
    pointer-events: all;
}

.modal-wrapper::before {
    content: '';
    pointer-events: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #000;
    opacity: 0;
    transition: opacity 0.2s cubic-bezier(.2, 0, 0, 1);
}

.modal-wrapper.open::before {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #000;
    opacity: 0.5;
}

.modal {
    background-color: var(--md-sys-color-surface-container);
    border-radius: 28px;

    display: flex;
    flex-direction: column;

    overflow: hidden;

    transform: scale(0.8);
    opacity: 0;
    transition: transform cubic-bezier(0, -.25, 0, 1) 0.2s, opacity cubic-bezier(0, -.25, 0, 1) 0.2s;
}

.modal-wrapper.open .modal {
    transform: scale(1);
    opacity: 1;
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 400;
    color: var(--md-sys-color-on-surface);
}

.modal-content {
    padding: 24px 24px 0px;
    box-sizing: border-box;
    flex-grow: 1;
    color: var(--md-sys-color-on-surface-container);
}

.modal-options {
    padding: 16px 24px 24px;
    background-color: var(--md-sys-color-surface-container);
    display: flex;
    gap: 4px;
    justify-content: flex-end;
}

.modal .headline {
    align-items: center;
    box-sizing: border-box;
    display: flex;
    gap: 8px;
}

/* Loader */

.loader {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    padding: 1rem;

    color: var(--md-sys-color-on-surface);
}

/* Skeleton */

.skeleton {
    background: linear-gradient(90deg, var(--md-sys-color-surface-container-highest) 25%, var(--md-sys-color-surface-variant) 50%, var(--md-sys-color-surface-container-highest) 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite linear;
    color: transparent !important;
    pointer-events: none;
    user-select: none;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* Command Palette */

.command-palette-outer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;

    visibility: hidden;
}

.command-palette-outer.open::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #000;
    opacity: 0.5;
}

.cmd-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;

    height: 65%;
}

.command-palette {
    position: relative;
    width: 100%;
    max-width: 600px;

    border-radius: 12px;
    overflow: hidden;
    background: var(--md-sys-color-surface-container-low);
    border: 1px solid var(--md-sys-color-surface-container-high);
}

.command-palette-outer.open {
    visibility: visible;
}

.command-palette input {
    width: 100%;
    height: 100%;
    box-sizing: border-box;
    padding: 0.75rem 1.25rem;
    border: none;

    height: 58px;
    font-size: 1.2rem !important;
    background-color: transparent;
    color: var(--md-sys-color-on-surface-container);
    font-family: inherit;
    font-size: inherit;
    /* box-shadow: 0 15px 20px #00000066; */


    outline: none;
}

.command-palette .cmd-text-input {
    background-color: transparent;
    border: none;
    padding: 0;
}

/* Splash */

.splash {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: var(--md-sys-color-background);
    z-index: 9999;
    opacity: 0;
    transform: scale(1.1);
    transition: opacity .3s cubic-bezier(0.4, 0, 0.2, 1), transform .3s cubic-bezier(0.4, 0, 0.2, 1);
}

.splash.open {
    opacity: 1;
    transform: scale(1);
}

.splash-logo {
    width: 128px;
    height: 128px;
    color: var(--md-sys-color-primary);
    position: relative;
}

.splash-logo svg {
    width: 100%;
    height: 100%;
}

.splash.hidden {
    display: none;
}

#mobile-tab-bar {
    display: none;
}

/* Mobile */

@media screen and (max-width: 900px) {
    :root {
        --titlebar-height: 48px;

        --md-sys-ripple-hover-color: transparent !important;
        /*no hover on mobile*/
    }

    a {
        text-decoration: none !important;
    }

    #main {
        width: 100%;
    }

    .content {
        box-sizing: border-box;
        padding: calc(env(safe-area-inset-top) + var(--titlebar-height)) 0 calc(var(--tab-bar-height) + env(safe-area-inset-bottom) + 2px) 0;

        width: 100%;
        max-width: 100%;
    }

    .sidebar-wrapper {
        display: none;
    }

    .titlebar {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: var(--titlebar-height);
        transform: unset;
        padding: 0 0.5rem;
    }

    .titlebar.transparent {
        background: transparent;
        color: transparent;
    }

    .back-btn {
        padding: 0.5rem;
    }

    .titlebar-title-label {
        font-size: 1rem;
    }

    .content-mask {
        display: none;
    }

    #mobile-tab-bar {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        height: var(--tab-bar-height);
        padding-bottom: env(safe-area-inset-bottom);
        background-color: var(--md-sys-color-surface-container);
        z-index: 9999;

        --md-sys-ripple-hover-color: transparent;
    }

    .mobile-tab-bar {
        width: 100%;
        padding-bottom: env(safe-area-inset-bottom);
    }

    .mobile-tab-bar .tab-items {
        display: flex;
        justify-content: space-around;
        align-items: center;
        height: 100%;
        width: 100%;
        padding: 0 8px;
        box-sizing: border-box;
    }

    .mobile-tab-bar .tab-item {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        height: 100%;
        width: 100%;

        background-color: transparent;
        color: var(--md-sys-color-on-surface-variant);
        font-weight: 500;
        font-size: 12px;
        transition: color 0.2s cubic-bezier(.4, 0, .2, 1);
    }

    .tab-item.active {
        color: var(--md-sys-color-on-secondary-container);
        font-variation-settings: "GRAD" 125;
    }

    .mobile-tab-bar .tab-item-icon {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 30px;
        height: 30px;
    }

    .mobile-tab-bar .tab-item img {
        width: 24px;
        height: 24px;
        border-radius: 100px;
    }

    .mobile-tab-bar .tab-item-title {
        font-size: 12px;
    }

    .tab-icon-wrapper {
        position: relative;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        height: 32px;
        width: 56px;
        border-radius: 100px;
        margin-bottom: 4px;
        box-sizing: border-box;
        -webkit-tap-highlight-color: transparent;
        user-select: none;
    }

    .tab-icon-wrapper::before {
        content: "";
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        transform: scaleX(.9);
        border-radius: 100px;
        background-color: transparent;
        transition: background-color 0.1s ease, transform 0.2s ease;
        z-index: -1;
    }

    .tab-item.active .tab-icon-wrapper::before {
        transform: scaleX(1);
        background-color: var(--md-sys-color-secondary-container);
    }

    .tab-item-badge {
        position: absolute;
        top: -4px;
        right: -4px;
        background-color: var(--md-sys-color-error);
        color: var(--md-sys-color-on-error);
        border-radius: 100px;
        padding: 0.1rem 0.5rem;
        font-size: 0.75rem;
        font-weight: 600;
        font-variation-settings: "OPSZ" 18;
    }

    .back-btn:hover {
        background-color: var(--md-sys-color-background);
    }

    .post {
        background: var(--md-sys-color-surface);
        padding: 0.75rem 1rem;
    }

    .post.repost {
        background: var(--md-sys-color-surface-container);
    }
}

@media screen and (max-width: 1100px) and (min-width: 901px) {
    .sidebar-item {
        padding: 0.75rem 1rem;
    }

    #main {
        padding-right: 2px;
    }

    .titlebar {
        left: unset;
        transform: unset;
    }

    .mask-right-outer {
        display: none;
    }

    #sidebar-right {
        display: none;
    }
}

/* Checkbox Animation */

.mark.long {
    height: 2px;
    transition-property: transform, width;
    width: 0px;
}

.mark.short {
    height: 2px;
    transition-property: transform, height;
    width: 0px;
}

.mark {
    fill: currentColor;
    transform: scaleY(-1) translate(7px, -14px) rotate(45deg);
}

.selected .mark.long {
    animation-duration: 350ms;
    animation-timing-function: cubic-bezier(0.05, 0.7, 0.1, 1);
    transition-duration: 350ms;
    transition-timing-function: cubic-bezier(0.05, 0.7, 0.1, 1);
}

.selected .mark.short {
    width: 2px;
    height: 5.6568542495px;
}

.selected .mark.long {
    width: 11.313708499px;
}

/* Context Menu */

.context-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: all;
    z-index: 12000;
}

.context {
    position: fixed;
    background: var(--md-sys-color-surface-container);
    color: var(--md-sys-color-on-surface);

    z-index: 13000;
    padding: 4px;
    min-width: 150px;
    border-radius: 16px;
    font-weight: 500;
    display: flex;
    flex-direction: column;
    gap: 2px;
    box-sizing: border-box;
}

.context::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: inherit;

    background-color: transparent;
    opacity: 0.24;
    box-shadow: 0 0 3px var(--md-sys-color-shadow), 0 4px 12px var(--md-sys-color-shadow);
    z-index: -1;
}

.context-item {
    /* cursor: pointer; */
    font-size: 14px;
    padding: 10px 12px;
    border-radius: 6px;
    user-select: none;
    -webkit-user-select: none;
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;

    white-space: nowrap;
    font-weight: 400;
    color: inherit;
}

.context-item:first-child {
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
}

.context-item:last-child {
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 12px;
}

.context-item:hover,
.context-item.selected {
    background-color: var(--md-sys-color-secondary-container);
    color: var(--md-sys-color-on-secondary-container);
}

.context-item.red:hover,
.context-item.red.selected {
    background-color: var(--md-sys-color-error-container);
    color: var(--md-sys-color-on-error-container);
}

.context-item.disabled {
    opacity: 0.5;
    pointer-events: none;
}

.context-separator {
    /*! width: 100%; */
    height: 1px;
    background-color: var(--md-sys-color-surface-variant);
    margin: 0.25rem 2px;
    box-sizing: border-box;
}

.context-item>span {
    flex-grow: 1;
}

.context-icon {
    flex: 0 0 auto;
    width: 20px;
    height: 20px;
}

.context-image-icon {
    border-radius: 100px;
    object-fit: cover;
    background: var(--md-sys-color-surface-container-high);
}

.context-item>svg {
    position: absolute;
    left: 14px;
}

.context-item>svg {
    position: static;
    left: auto;
}

.submenu-arrow {
    opacity: 0.7;
    margin-left: auto;
}

.rtl .submenu-arrow {
    margin-left: unset;
    margin-right: auto;
}

/* Toast */

#toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 30000;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    pointer-events: none;

    user-select: none;
    -webkit-user-select: none;
}

.md-toast {
    background: var(--md-sys-color-inverse-surface);
    color: var(--md-sys-color-inverse-on-surface);

    padding: 0 16px;
    height: 48px;
    width: max-content;
    min-width: 200px;
    border-radius: 6px;
    box-sizing: border-box;
    box-shadow: 0px 4px 12px 0px rgba(0, 0, 0, 0.24);

    pointer-events: all;
    display: flex;
    align-items: center;
    gap: 8px;

    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.md-toast-btn {
    background: transparent;
    color: var(--md-sys-color-inverse-primary);
    padding: 8px 12px;
    font-size: 14px;
    border-radius: 4px;
    font-weight: 500;
}

.md-toast-close-btn {
    padding: 0;
    background: transparent;
    color: var(--md-sys-color-inverse-on-surface);
    width: 36px;
    height: 36px;
    margin-block: 12px;
    margin-right: -8px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 100px;
}

.md-toast-text {
    margin-right: auto;
}

.md-toast.open {
    opacity: 1;
    transform: translateY(0);
}

/* Keyboard key chip */

.key {
    padding: 2px 5px;
    font-size: 12px;
    font-family: inherit;
    background: var(--md-sys-color-surface-container-high);
    color: var(--md-sys-color-on-surface);
    border-radius: 3px;
    box-shadow: 0 0 1px var(--md-sys-color-outline);
    border-bottom: 3px solid var(--md-sys-color-outline-variant);
    min-width: 14px;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    user-select: none;
    -webkit-user-select: none;
}

@media (max-width: 600px) {
    #toast-container {
        bottom: calc(env(safe-area-inset-bottom) + 16px);
        right: 0;
        left: 0;
        align-items: center;
    }
}

/* User */

.user-popup {
    width: 224px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    box-sizing: border-box;
}

.user-popup .user-avatar {
    width: 64px;
    height: 64px;
}

.user-popup .user-username {
    font-size: 1rem;
    font-weight: 600;
    padding-bottom: 6px;
}