@custom-media --viewport-desktop (width >=62.5rem);
@custom-media --viewport-mobile (width < 62.5rem);

:root {
    --main-width: 1000px;
    --main-background-color: #fdfdfe;
    --background-color: #f8f8f8;
    --border-color: #eee;
    --text-background-color: #fff;
    --text-color: #222;
    --link-color: #3c77aa;
    --dimmed-link-color: #88958d;
}
@media (prefers-color-scheme: dark) {
    :root {
        --main-background-color: #222;
        --background-color: #333;
        --text-background-color: #383838;
        --border-color: #4c4c4c;
        --text-color: #ccc;
        --link-color: #c38855;
        --dimmed-link-color: #88958d;
    }
}

* {
    box-sizing: border-box;
}

html,
body,
div,
h1,
h2,
ul,
li,
p,
form,
input,
textarea,
pre {
    margin: 0;
    padding: 0;
}

html,
body {
    width: 100%;
    height: 100%;
}

body {
    background: var(--main-background-color);
    text-size-adjust: 100%;
    word-wrap: break-word;
    color: var(--text-color);
    line-height: 1.4;
    -webkit-overflow-scrolling: touch;
}

html,
input,
textarea,
button {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;
    -webkit-font-smoothing: subpixel-antialiased;
}

input,
textarea,
button {
    font-size: 1em;
}

h1,
h2 {
    font-weight: normal;
    padding: 24px;
}

ul {
    list-style-type: none;
}

legend {
    color: var(--dimmed-link-color);
    margin: 0;
    padding: 12px;
    width: 100%;
}

fieldset {
    border: 0;
    padding: 12px;
    margin: 0;
    min-width: 0;
}

body:not(:-moz-handler-blocked) fieldset {
    display: table-cell;
}

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

img,
hr {
    border: none;
}

#app {
    height: 100%;
    width: 100%;
}

#header {
    background: var(--text-background-color);
    border-bottom: 1px solid var(--border-color);
    transition: transform 0.2s;
    z-index: 10;
    position: fixed;
    width: 100%;
    top: 0;
}

.header--hidden {
    transform: translateY(-100%);
}

#header_wrapper,
.footer_container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

#sidebar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 10;
}
#sidebar_wrapper {
    display: flex;
    flex-direction: row;
    justify-content: space-around;
}

.nav_content {
    padding: 10px;
}

#content {
    margin-top: 0;
    transition: margin-top 0.4s;
    padding-bottom: 64px;
}

.content--top {
    margin-top: 64px !important;
}

#footer {
    display: none;
    background: var(--background-color);
    border-top: 1px solid #ccc;
    color: var(--text-color);
    padding: 10px;
    transition: margin-left 0.4s;
}

.desktop {
    display: none;
}

.card {
    padding: 6px 24px;
}

#logo {
    height: 36px;
    width: 110px;
}

#logo a {
    background: url("./ui/assets/logo@2x.png") no-repeat;
    background-size: cover;
    border: 0;
    display: block;
    height: 36px;
    overflow: hidden;
    text-indent: 100%;
    white-space: nowrap;
    width: 110px;
}

#ctitle {
    display: flex;
}

#ctitle:first-child {
    margin-right: 5px;
    vertical-align: middle;
    max-width: 48px;
    max-height: 48px;
}

#global {
    display: flex;
}

.l {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
}

#global a,
#ctitle a {
    display: flex;
    align-items: center;
}

#global a {
    color: var(--dimmed-link-color);
    padding: 14px 16px;
}

#sidebar_wrapper > a,
.l > a {
    color: var(--dimmed-link-color);
    display: flex;
    padding: 14px;
    align-items: center;
    vertical-align: middle;
}

#sidebar_wrapper > a:hover {
    background-color: var(--background-color);
    border-top: 2px solid #ff339a;
    cursor: pointer;
}

#ctitle a {
    padding: 2px 20px;
}

#global a,
#ctitle a,
.l a,
.msg-button {
    border-bottom: 2px solid transparent;
}

#global a:hover,
#ctitle a:hover,
.l a:hover,
.msg-button:hover {
    background-color: var(--background-color);
    border-bottom: 2px solid #ff339a;
    cursor: pointer;
}

.icon {
    vertical-align: middle;
}

#search input {
    background: var(--main-background-color);
    border: 1px solid var(--border-color);
    outline: none !important;
    padding: 4px;
    -webkit-appearance: none;
    border-radius: 0;
}

.lds-ripple {
    display: inline-block;
    position: relative;
    width: 64px;
    height: 64px;
}

.lds-ripple div {
    position: absolute;
    border: 4px solid #ff339a;
    opacity: 1;
    border-radius: 50%;
    animation: lds-ripple 1s cubic-bezier(0, 0.2, 0.8, 1) infinite;
}

.lds-ripple div:nth-child(2) {
    animation-delay: -0.5s;
}

@keyframes lds-ripple {
    0% {
        top: 28px;
        left: 28px;
        width: 0;
        height: 0;
        opacity: 1;
    }
    100% {
        top: -1px;
        left: -1px;
        width: 58px;
        height: 58px;
        opacity: 0;
    }
}

.page {
    background: var(--main-background-color);
    border: 1px solid var(--border-color);
    margin-bottom: 12px;
    padding: 6px;
    text-align: center;
}

.page a {
    color: var(--dimmed-link-color);
}

@media (--viewport-mobile) {
    #content {
        margin-bottom: 12px;
    }
    #sidebar {
        background: var(--text-background-color);
    }
}

@media (--viewport-desktop) {
    .desktop {
        display: block;
    }
    .mobile {
        display: none;
    }
    #content {
        width: 100%;
        margin-bottom: 12px;
        padding-bottom: 12px;
    }
    #sidebar {
        position: sticky;
        padding: 12px;
        margin-top: 66px;
        height: 100%;
        z-index: auto;
        overflow-y: auto;
    }
    article,
    .page,
    .msg-cont {
        width: 640px;
    }
    #sidebar_wrapper {
        width: 300px;
        overflow-y: auto;
        height: 100%;
        flex-direction: column;
    }
    #sidebar_wrapper a,
    .l a {
        border-right: 2px solid transparent;
    }
    #sidebar_wrapper > a:hover {
        border-top: initial;
        border-right: 2px solid #ff339a;
    }
    #header_wrapper,
    #content_wrapper {
        width: 1000px;
        margin: 0 auto;
    }
    #content_wrapper {
        display: flex;
    }
}