main {
    max-width: 840px;
    margin: 0 auto;
    padding-top: 0;
    padding: 8px;
    padding-top: 0;
    box-sizing: border-box;
    min-height: 100vh;
}

header {
    position: relative;
    height: 26px;
    box-sizing: border-box;
    width: 840px;
    padding: 4px 18px;
    align-items: center;
    color: #FFF;
    background-color: #333333;
    margin-bottom: 14px;
    margin-top: 4px;
    z-index: 1;
}

header::before {
    content: '';
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    height: 6px;
    background-size: 6px 100%, 6px 100%, calc(100% - 12px) 100%;
    background-position: 0 0, 100% 0, 6px 0;
    background-repeat: no-repeat;
    background-image:
        linear-gradient(to top right, transparent 50%, #2a2a2a 50%),
        linear-gradient(to top left, transparent 50%, #2a2a2a 50%),
        linear-gradient(to right, #2a2a2a, #2a2a2a);
    z-index: -1;
}


@media (max-width: 530px) {
    .footer {
        display: none !important;
    }

    main {
        padding: 0;
    }
}

@media (max-width: 857px) {
    header {
        width: 100%;
        margin-left: 4px;
        margin-right: 10px;
    }
}

.dropdown.held {
    opacity: 1 !important;
    filter: brightness(0.9);
    z-index: 9;
}

.dropdown.hidden-opacity {
    z-index: 9;
}

.hidden-display {
    display: none !important;
}

.hidden-opacity {
    opacity: 0 !important;
    pointer-events: none !important;
}

.dropdown-container {
    position: relative;
}

.dropdown {
    position: absolute;
    background: white;
    top: 50%;
    left: 50%;
    transform: translate(-50%, 28px);
    width: min-content;
    height: 80px;
    border: 1px solid #ccc;
    padding: 4px;
    z-index: 10;
    transition: opacity 0.2s linear, height 0.15s ease, width 0.15s ease, filter 0.15s linear, transform 0.05s linear;
}

.dropdown.hidden-opacity {
    height: 0px !important;
}

.dropdown-cont {
    max-height: 100%;
    width: 100%;
    height: 100%;
    overflow-y: auto;
}

.dropdown-cont::-webkit-scrollbar {
    display: none;
}

.dropdown-down::before {
    content: '';
    position: absolute;
    top: -7px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-bottom: 7px solid #ccc;
    border-left: 7px solid transparent;
    border-right: 7px solid transparent;
}

.dropdown-down::after {
    content: '';
    position: absolute;
    top: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-bottom: 6px solid #FFF;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
}

.dropdown-up {
    top: 50%;
    left: 50%;
    transform: translate(-50%, calc(-100% + -28px));
}

.dropdown-up::before {
    content: '';
    position: absolute;
    bottom: -7px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-top: 7px solid #ccc;
    border-left: 7px solid transparent;
    border-right: 7px solid transparent;
}

.dropdown-up::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-top: 6px solid #FFF;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
}

.autocomplete-dropdown {
    position: absolute;
    background: white;
    border: 1px solid #ccc;
    z-index: 10;
    overflow: visible;
    padding: 2px;
    transition: opacity 0.2s linear, height 0.15s ease, max-height 0.15s ease;
    color: black !important;
}

.autocomplete-item {
    cursor: pointer;
    padding: 2px;
    transition: background-color 0.2s ease-in-out;
}

.autocomplete-item:hover, .autocomplete-item.highlighted {
    background-color: #f0f0f0;
}

.autocomplete-dropdown::before {
    content: '';
    position: absolute;
    top: -7px;
    left: 4px;
    width: 0;
    height: 0;
    border-bottom: 7px solid #ccc;
    border-left: 7px solid transparent;
    border-right: 7px solid transparent;
}

.autocomplete-dropdown::after {
    content: '';
    position: absolute;
    top: -6px;
    left: 5px;
    width: 0;
    height: 0;
    border-bottom: 6px solid #FFF;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
}

.autocomplete-container {
    overflow: hidden;
    height: 100%;
}

.footer {
    display: flex;
    gap: 14px;
    flex-direction: column;
    background-color: #333;
    color: #FFF;
    padding: 24px 0;
    padding-bottom: 0;
    font-size: 12px;
    color: #999;
}

.footer-container {
    width: 100%;
    max-width: 840px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 0px 8px;
    box-sizing: border-box;
}

.footer-top {
    flex-grow: 1;
    display: flex;
    gap: 24px;
    height: 52px;
    align-items: center;
}

.footer-left {
    display: flex;
    flex-direction: column;
    height: 36px;
}

.footer-logo {
    flex-grow: 1;
    display: flex;
    gap: 12px;
}

.footer-logo-link {
    display: flex;
    flex-direction: column;
    color: #FFF;
}

.footer-logo-img {
    flex-grow: 1;
}

.footer-info-text {
    color: #FFF;
}

.footer-mona-info {
    padding-left: 12px;
}

.footer-mona-info > .dropdown-container > span {
    color: #555;
    cursor: pointer;
}

.footer-mona-info  > .dropdown-container > span:hover {
    color: #999;
    text-decoration: underline;
}

.footer-divi {
    border-right: #222 1px dashed;
    height: 100%;
}

@media screen and (max-width: 864px) {
    .footer {
        padding: 24px;
        padding-bottom: 4px;
    }

    .footer-right {
        display: none;
    }

    .footer-top > .footer-divi ~ .footer-divi {
        display: none;
    }
}

.footer-right {
    width: 320px;
    height: 36px;
}

.footer-center {
    flex-grow: 1;
    height: 36px;
}

.footer-dono-grid {
    display: flex;
    flex-wrap: wrap;
}

.footer-dono-grid > a {
    display: flex;
    gap: 1px;
    flex: 1 1 50%;
    text-decoration: none;
}

.footer-dono-grid > a::after {
    content: "";
    border-bottom: #999 1px dotted;
    flex-grow: 1;
}

.footer-dono-grid > a:hover {
    text-decoration: underline;
}

.footer-bottom-text {
    display: flex;
    justify-content: space-between;
}

.ping {
    color: #3F7BAC;
}

.pagination > a,
.post-content > span > a {
    color: #3F7BAC;
}

.action-button,
.action-button-gray,
.button {
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 3px;
    border: 1px solid #CCC;
    text-decoration: none;
}

.action-button {
    background: linear-gradient(180deg, rgba(254, 254, 209, 1), rgba(239, 197, 44, 1));
    height: 100%;
    color: #906219;
    border: #EFCD56 1px solid;
}

.action-button:hover {
    background: linear-gradient(180deg, rgba(255, 225, 99, 1), rgba(234, 183, 42, 1));
    color: #5a3c13;
    border: #e0b21a 1px solid;
}

.action-button-gray {
    background: linear-gradient(180deg, rgb(255, 255, 255), rgb(236, 236, 236));
    height: 100%;
    color: #888;
}

.action-button-gray:hover {
    background: linear-gradient(180deg, rgb(240, 240, 240), rgb(220, 220, 220));
    color: #555;
    border: #888 1px solid;
}

.button {
    background: linear-gradient(180deg, rgb(255, 255, 255), rgb(236, 236, 236));
    color: #888;
    padding: 4px;
    cursor: pointer;
}

.button:disabled, .button.disabled {
    cursor: auto;
    background: linear-gradient(180deg, rgb(230, 230, 230), rgb(210, 210, 210)) !important;
    color: #bbb !important;
    border: #ddd 1px solid !important;
}

.button:hover,
.action-button-gray:hover {
    background: linear-gradient(180deg, rgb(240, 240, 240), rgb(220, 220, 220));
    color: #555;
    border: #888 1px solid;
}

.posts {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 100%;
}

.post {
    display: flex;
    gap: 8px;
}

.post-header {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.post-content {
    flex-grow: 1;
    background-color: #F2F2F2;
    padding: 4px;
    box-sizing: border-box;
}

.post-content > span {
    overflow-wrap: break-word;
    word-wrap: break-word;
    word-break: break-word;
}

.avatar-small {
    box-sizing: border-box;
    border: 1px solid #CCC;
    padding: 2px;
    background-clip: content-box;
    width: 61px;
    height: 61px;
    z-index: 2;
    position: relative;
}

.live-ring {
    width: 61px;
    height: 61px;
    position: absolute; 
    top: 0;
    left: 0;
    border: 2px solid #D02222;
    box-sizing: border-box;
    animation: pulse 1s infinite;
    z-index: 1;
}

@keyframes pulse {
    0% {
        scale: 0;
        opacity: 0;
    }
    20% {
        scale: 1;
        opacity: 1;
    }
    80% {
        scale: 1.3;
        opacity: 0;
    }
    100% {
        scale: 1.3;
        opacity: 0;
    }
}

.post-button,
.post-name {
    color: #000;
}

.post-actions {
    font-size: 12px;
    padding-top: 4px;
}

.inactive {
    filter: grayscale(100%);
    transition: filter 0.3s;
}

.inactive:hover {
    filter: grayscale(0%);
}

.code-block {
    padding: 4px;
    border: 1px dashed #ccc;
    overflow-x: auto;
    margin: 0;
    font-size: 12px;
    white-space: pre-wrap;
    word-wrap: break-word;
}

code {
  font-family: "NSimSun", "MS Gothic", monospace !important;
}

/* DARK THEME */

body.dark {
    color: #fff;
}

body.dark header {
    border-bottom-color: #CCC;
}

body.dark .action-button-gray {
    background: linear-gradient(180deg, #444, #333);
    color: #fff;
    border-color: #555;
}

body.dark .action-button-gray:hover {
    background: linear-gradient(180deg, #333, #252525);
    color: #fff;
    border-color: #454545;
}

body.dark .action-button {
    color: #906219;
}

body.dark .post-header,
body.dark .post-content,
body.dark .post-button,
body.dark .post-name,
body.dark a {
    color: #fff;
}

body.dark .post-content {
    background-color: #333;
}
