/* Light Mic Mute/Unmute Switch for DM Calls (from Uiverse.io, adapted) */
.dm-mic-switch {
    position: relative;
    width: 48px;
    height: 48px;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #f5f5f5;
    color: #444;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 1px 4px rgba(0,0,0,0.07);
    border: 1.5px solid #e0d39c;
    transition: all .3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Classic profile page rebuild */
body.theme-anime.portal-page[data-page="profile"] .profile-card {
    padding-top: 0;
}

body.theme-anime.portal-page[data-page="profile"] .profile-archive-shell {
    display: grid;
    gap: 0;
}

body.theme-anime.portal-page[data-page="profile"] #item-header {
    overflow: hidden;
    padding: 0 0 18px;
}

body.theme-anime.portal-page[data-page="profile"] #item-header-avatar {
    float: left;
    width: 165px;
}

body.theme-anime.portal-page[data-page="profile"] #item-header-avatar a {
    display: block;
}

body.theme-anime.portal-page[data-page="profile"] #item-header-avatar img.avatar {
    float: none;
    width: 150px;
    height: 150px;
    border: 2px solid #eee;
    background: #fff;
    object-fit: cover;
}

body.theme-anime.portal-page[data-page="profile"] #item-header-content {
    margin-left: 170px;
    min-height: 150px;
}

body.theme-anime.portal-page[data-page="profile"] #item-header-content h2 {
    margin: 0 0 5px;
    font-size: 28px;
    line-height: 120%;
}

body.theme-anime.portal-page[data-page="profile"] #item-header-content h2 a {
    color: #777;
    text-decoration: none;
}

body.theme-anime.portal-page[data-page="profile"] .user-nicename {
    display: block;
    margin-bottom: 4px;
    color: #777;
    font-size: 14px;
}

body.theme-anime.portal-page[data-page="profile"] #item-header-content > span.activity {
    margin-top: 0;
}

body.theme-anime.portal-page[data-page="profile"] #item-meta {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin: 15px 0 5px;
    padding-bottom: 10px;
    overflow: hidden;
    color: #aaa;
    font-size: 14px;
}

body.theme-anime.portal-page[data-page="profile"] #latest-update {
    flex: 1 1 auto;
    min-width: 0;
}

body.theme-anime.portal-page[data-page="profile"] #latest-update p {
    margin: 0 0 10px;
    color: #666;
    line-height: 1.6;
}

body.theme-anime.portal-page[data-page="profile"] #item-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

body.theme-anime.portal-page[data-page="profile"] #item-buttons form {
    margin: 0;
}

body.theme-anime.portal-page[data-page="profile"] #item-nav {
    margin-top: 6px;
}

body.theme-anime.portal-page[data-page="profile"] #object-nav,
body.theme-anime.portal-page[data-page="profile"] #subnav {
    clear: left;
    overflow: hidden;
    display: flow-root;
    margin-left: -19px;
    margin-right: -19px;
}

body.theme-anime.portal-page[data-page="profile"] #object-nav {
    margin-top: 0;
    margin-bottom: 0;
    background: #eaeaea;
}

body.theme-anime.portal-page[data-page="profile"] #subnav {
    margin-top: -15px;
    margin-bottom: 20px;
    min-height: 35px;
    background: #fff;
    border-bottom: 1px solid #eaeaea;
}

body.theme-anime.portal-page[data-page="profile"] #object-nav ul,
body.theme-anime.portal-page[data-page="profile"] #subnav ul {
    width: 100%;
    margin: 0;
    padding: 0;
    list-style: none;
    overflow: hidden;
}

body.theme-anime.portal-page[data-page="profile"] #object-nav li,
body.theme-anime.portal-page[data-page="profile"] #subnav li {
    float: left;
    margin: 5px 0 0 5px;
}

body.theme-anime.portal-page[data-page="profile"] #object-nav li:first-child,
body.theme-anime.portal-page[data-page="profile"] #subnav li:first-child {
    margin-left: 20px;
}

body.theme-anime.portal-page[data-page="profile"] #subnav li {
    margin-top: 0;
}

body.theme-anime.portal-page[data-page="profile"] #subnav li.last {
    float: right;
    margin: 4px 20px 0 0;
}

body.theme-anime.portal-page[data-page="profile"] #object-nav a,
body.theme-anime.portal-page[data-page="profile"] #subnav a,
body.theme-anime.portal-page[data-page="profile"] #subnav span {
    display: block;
    padding: 5px 10px;
    text-decoration: none;
}

body.theme-anime.portal-page[data-page="profile"] #subnav span {
    color: #aaa;
}

body.theme-anime.portal-page[data-page="profile"] #object-nav a span {
    display: inline-block;
    padding: 1px 6px;
    margin-left: 2px;
    border-radius: 3px;
    background: #1fb3dd;
    color: #fff;
    font-size: 90%;
}

body.theme-anime.portal-page[data-page="profile"] #object-nav li.current a,
body.theme-anime.portal-page[data-page="profile"] #object-nav li.selected a,
body.theme-anime.portal-page[data-page="profile"] #subnav li.current a,
body.theme-anime.portal-page[data-page="profile"] #subnav li.selected a {
    border-top-left-radius: 3px;
    border-top-right-radius: 3px;
    background: #fff;
    color: #555;
    font-weight: bold;
}

body.theme-anime.portal-page[data-page="profile"] #item-body {
    margin-top: 0;
    clear: both;
}

body.theme-anime.portal-page[data-page="profile"] .profile-edit-panel {
    display: block;
    margin: 0 0 20px;
}

body.theme-anime.portal-page[data-page="profile"] .profile-edit-panel summary {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 12px 14px;
    cursor: pointer;
    list-style: none;
    user-select: none;
    border: 1px solid #ddd6c4;
    background: linear-gradient(180deg, #f4f1e8, #ebe4d3);
}

body.theme-anime.portal-page[data-page="profile"] .profile-edit-panel summary::-webkit-details-marker {
    display: none;
}

body.theme-anime.portal-page[data-page="profile"] .profile-edit-panel summary::after {
    content: '+';
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border: 1px solid #7ebf52;
    border-radius: 999px;
    background: linear-gradient(180deg, #fcfff8, #e7f4d9);
    color: #478e2f;
    font-size: 13px;
    font-weight: 700;
}

body.theme-anime.portal-page[data-page="profile"] .profile-edit-panel[open] summary::after {
    content: '-';
}

body.theme-anime.portal-page[data-page="profile"] .profile-edit-form {
    margin-top: 0;
    padding: 16px;
    border: 1px solid #ddd6c4;
    border-top: 0;
    background: #fbfaf6;
}

body.theme-anime.portal-page[data-page="profile"] .profile-activity-shell,
body.theme-anime.portal-page[data-page="profile"] .profile-discussion-shell {
    border: 1px solid #dfd0af;
    background: #fffdfa;
}

body.theme-anime.portal-page[data-page="profile"] .profile-activity-shell {
    margin-bottom: 24px;
}

body.theme-anime.portal-page[data-page="profile"] .profile-activity-shell .pagination {
    margin: 0;
    padding: 8px 15px;
    border: 0;
    border-bottom: 1px solid #eaeaea;
    background: #f8f8f8;
}

body.theme-anime.portal-page[data-page="profile"] .profile-activity-shell .pag-count {
    float: none;
}

body.theme-anime.portal-page[data-page="profile"] #activity-stream {
    margin: 0;
    padding: 0 18px 8px;
    list-style: none;
}

body.theme-anime.portal-page[data-page="profile"] #activity-stream > li {
    overflow: hidden;
    padding: 20px 0 0;
    border-bottom: 1px solid #eaeaea;
}

body.theme-anime.portal-page[data-page="profile"] #activity-stream > li:last-child {
    padding-bottom: 18px;
    border-bottom: 0;
}

body.theme-anime.portal-page[data-page="profile"] #activity-stream .activity-avatar {
    float: left;
}

body.theme-anime.portal-page[data-page="profile"] #activity-stream .activity-avatar .avatar {
    width: 50px;
    height: 50px;
    margin: 0 10px 10px 0;
    border: 2px solid #eee;
    background: #fff;
    object-fit: cover;
}

body.theme-anime.portal-page[data-page="profile"] #activity-stream .activity-content {
    margin-left: 70px;
}

body.theme-anime.portal-page[data-page="profile"] #activity-stream .activity-header {
    font-size: 11px;
    color: #888;
    line-height: 220%;
}

body.theme-anime.portal-page[data-page="profile"] #activity-stream .activity-header a:first-child {
    display: inline-block;
    margin-right: 3px;
    padding: 3px 8px;
    border-right: 1px solid #a1dcfa;
    border-bottom: 1px solid #a1dcfa;
    border-radius: 4px;
    background: #ebf7ff;
    color: #059ae7;
    text-decoration: none;
}

body.theme-anime.portal-page[data-page="profile"] #activity-stream .activity-header a:first-child:hover {
    background: #059ae7;
    color: #fff !important;
}

body.theme-anime.portal-page[data-page="profile"] #activity-stream .activity-header .view {
    margin-left: 4px;
    padding: 0;
    border: 0;
    background: none;
    color: #aaa;
    text-decoration: underline;
}

body.theme-anime.portal-page[data-page="profile"] #activity-stream .activity-header .time-since {
    color: #bbb;
}

body.theme-anime.portal-page[data-page="profile"] #activity-stream .profile-activity-empty .activity-content {
    margin-left: 0;
}

body.theme-anime.portal-page[data-page="profile"] #activity-stream .activity-inner {
    margin: 0;
    color: #666;
    line-height: 1.6;
}

body.theme-anime.portal-page[data-page="profile"] .profile-discussion-shell {
    margin-top: 0;
    padding: 0;
    border-radius: 0;
}

body.theme-anime.portal-page[data-page="profile"] .profile-discussion-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin: 0;
    padding: 18px 18px 12px;
}

body.theme-anime.portal-page[data-page="profile"] .profile-discussion-head h2 {
    margin: 0 0 4px;
    font-size: 20px;
}

body.theme-anime.portal-page[data-page="profile"] .profile-discussion-head p {
    margin: 0;
    color: #6b6355;
}

body.theme-anime.portal-page[data-page="profile"] .profile-comment-count {
    padding: 8px 12px;
    border-radius: 999px;
    background: #efe5cf;
    color: #6d5230;
    font-weight: 700;
    white-space: nowrap;
}

body.theme-anime.portal-page[data-page="profile"] .profile-comment-form.composer {
    margin-bottom: 0;
    padding: 0 18px 18px;
    border-bottom: 1px solid #eadfc9;
}

body.theme-anime.portal-page[data-page="profile"] .profile-comment-login-note {
    margin: 0 18px 18px;
}

body.theme-anime.portal-page[data-page="profile"] .profile-comment-list {
    display: grid;
    gap: 14px;
    padding: 18px;
}

body.theme-anime.portal-page[data-page="profile"] .profile-comment-card {
    margin-left: calc(var(--comment-depth, 0) * 18px);
    padding: 14px 0 0;
    border-top: 1px solid #eadfc9;
    background: transparent;
    border-radius: 0;
    box-shadow: none;
}

body.theme-anime.portal-page[data-page="profile"] .profile-comment-list > .profile-comment-card:first-child {
    padding-top: 0;
    border-top: 0;
}

body.theme-anime.portal-page[data-page="profile"] .profile-comment-head {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

body.theme-anime.portal-page[data-page="profile"] .profile-comment-avatar {
    flex: 0 0 40px;
}

body.theme-anime.portal-page[data-page="profile"] .profile-comment-avatar img {
    display: block;
    width: 40px;
    height: 40px;
    border: 2px solid #eee;
    background: #fff;
    object-fit: cover;
}

body.theme-anime.portal-page[data-page="profile"] .profile-comment-main {
    flex: 1 1 auto;
    min-width: 0;
}

body.theme-anime.portal-page[data-page="profile"] .profile-comment-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px 10px;
    margin-bottom: 8px;
    font-size: 11px;
    color: #888;
}

body.theme-anime.portal-page[data-page="profile"] .profile-comment-meta strong {
    font-size: 12px;
    color: #444;
}

body.theme-anime.portal-page[data-page="profile"] .profile-comment-meta strong a {
    color: #059ae7;
    text-decoration: none;
}

body.theme-anime.portal-page[data-page="profile"] .profile-comment-text {
    margin-top: 0;
    color: #4e463a;
    line-height: 1.6;
    word-break: break-word;
}

body.theme-anime.portal-page[data-page="profile"] .profile-reply-box {
    margin-top: 10px;
}

body.theme-anime.portal-page[data-page="profile"] .profile-comment-form.inline {
    margin-top: 10px;
}

body.theme-anime.portal-page[data-page="profile"] .profile-comment-children {
    display: grid;
    gap: 12px;
    margin-top: 14px;
}

body.theme-anime.portal-page[data-page="profile"] .profile-summary-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    margin-top: 24px;
}

body.theme-anime.portal-page[data-page="profile"] .profile-sidebar-card {
    margin: 0;
    padding: 14px;
    border: 1px solid #ddd4bd;
    background: #f9f6ee;
}

body.theme-anime.portal-page[data-page="profile"] .profile-sidebar-card-wide {
    grid-column: 1 / -1;
}

body.theme-anime.portal-page[data-page="profile"] .profile-facts {
    display: grid;
    gap: 12px;
    margin: 0;
}

body.theme-anime.portal-page[data-page="profile"] .profile-facts div {
    padding-top: 12px;
    border-top: 1px solid #e8dfc9;
}

body.theme-anime.portal-page[data-page="profile"] .profile-facts div:first-child {
    padding-top: 0;
    border-top: 0;
}

body.theme-anime.portal-page[data-page="profile"] .profile-facts dt {
    font-size: 11px;
    color: #948a78;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

body.theme-anime.portal-page[data-page="profile"] .profile-facts dd {
    margin: 4px 0 0;
    color: #4e463b;
    font-size: 14px;
}

@media (max-width: 860px) {
    body.theme-anime.portal-page[data-page="profile"] #item-header-avatar {
        float: none;
        width: auto;
        margin-bottom: 14px;
    }

    body.theme-anime.portal-page[data-page="profile"] #item-header-content {
        margin-left: 0;
        min-height: 0;
    }

    body.theme-anime.portal-page[data-page="profile"] #item-meta {
        flex-direction: column;
    }

    body.theme-anime.portal-page[data-page="profile"] #item-buttons {
        justify-content: flex-start;
    }

    body.theme-anime.portal-page[data-page="profile"] #subnav li.last {
        float: left;
        margin-left: 5px;
    }

    body.theme-anime.portal-page[data-page="profile"] .profile-summary-grid {
        grid-template-columns: 1fr;
    }

    body.theme-anime.portal-page[data-page="profile"] .profile-sidebar-card-wide {
        grid-column: auto;
    }
}

@media (max-width: 640px) {
    body.theme-anime.portal-page[data-page="profile"] #item-header-avatar img.avatar {
        width: 120px;
        height: 120px;
    }

    body.theme-anime.portal-page[data-page="profile"] #item-header-content h2 {
        font-size: 24px;
    }

    body.theme-anime.portal-page[data-page="profile"] #object-nav li,
    body.theme-anime.portal-page[data-page="profile"] #subnav li {
        margin-left: 4px;
    }

    body.theme-anime.portal-page[data-page="profile"] #object-nav li:first-child,
    body.theme-anime.portal-page[data-page="profile"] #subnav li:first-child {
        margin-left: 14px;
    }

    body.theme-anime.portal-page[data-page="profile"] #subnav li.last {
        margin-left: 14px;
    }

    body.theme-anime.portal-page[data-page="profile"] #activity-stream {
        padding: 0 14px 6px;
    }

    body.theme-anime.portal-page[data-page="profile"] #activity-stream .activity-avatar {
        float: none;
        margin-bottom: 8px;
    }

    body.theme-anime.portal-page[data-page="profile"] #activity-stream .activity-content {
        margin-left: 0;
    }

    body.theme-anime.portal-page[data-page="profile"] .profile-discussion-head {
        flex-direction: column;
    }

    body.theme-anime.portal-page[data-page="profile"] .profile-comment-card {
        margin-left: calc(var(--comment-depth, 0) * 10px);
    }

    body.theme-anime.portal-page[data-page="profile"] .profile-comment-head {
        gap: 10px;
    }
}

body.theme-anime.portal-page[data-page="profile"] .profile-tab-shell {
    border: 1px solid #dfd0af;
    background: #fffdfa;
}

body.theme-anime.portal-page[data-page="profile"] .profile-tab-shell .pagination {
    margin: 0;
    padding: 8px 15px;
    border: 0;
    border-bottom: 1px solid #eaeaea;
    background: #f8f8f8;
}

body.theme-anime.portal-page[data-page="profile"] .profile-tab-shell .pag-count {
    float: none;
}

body.theme-anime.portal-page[data-page="profile"] .profile-tab-shell .member-list,
body.theme-anime.portal-page[data-page="profile"] .profile-tab-shell .group-list {
    padding: 0 18px 18px;
}

body.theme-anime.portal-page[data-page="profile"] .profile-tab-shell .portal-table {
    margin-bottom: 0;
}

body.theme-anime.portal-page[data-page="profile"] .profile-locked-state {
    margin: 18px;
}

.dm-mic-switch .mic-on, .dm-mic-switch .mic-off {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all .3s ease-in-out;
    font-size: 1.7em;
}

.dm-mic-switch .mic-on {
    z-index: 4;
}

.dm-mic-switch .mic-off {
    position: absolute;
    inset: 0;
    z-index: 5;
    opacity: 0;
    color: #e74c3c;
}

.dm-mic-switch:hover {
    background-color: #f9f7e8;
}

.dm-mic-checkbox {
    display: none;
}

.dm-mic-checkbox:checked + .dm-mic-switch {
    background-color: #ffeaea;
    border-color: #e74c3c;
}

.dm-mic-checkbox:checked + .dm-mic-switch .mic-off {
    opacity: 1;
}

.dm-mic-checkbox:active + .dm-mic-switch {
    scale: 1.08;
}

.dm-speaker-switch .mic-off {
    color: #d07a3d;
}

body.theme-anime.portal-page[data-page="settings"] .settings-page-shell {
    display: grid;
    gap: 22px;
    border-radius: 30px;
    border: 1px solid rgba(105, 89, 53, 0.2);
    background:
        radial-gradient(circle at top left, rgba(244, 235, 205, 0.92), rgba(255, 255, 255, 0) 32%),
        linear-gradient(180deg, rgba(255, 252, 244, 0.98), rgba(243, 247, 236, 0.98));
    box-shadow:
        0 24px 60px rgba(66, 51, 24, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

body.theme-anime.portal-page[data-page="settings"] .settings-page-hero,
body.theme-anime.portal-page[data-page="settings"] .settings-section {
    border-radius: 24px;
    border: 1px solid rgba(108, 90, 54, 0.14);
    background: rgba(255, 255, 255, 0.82);
    box-shadow: 0 14px 32px rgba(68, 54, 27, 0.06);
}

body.theme-anime.portal-page[data-page="settings"] .settings-page-hero {
    padding: 22px 24px;
    background:
        linear-gradient(135deg, rgba(128, 163, 89, 0.14), rgba(255, 255, 255, 0) 55%),
        rgba(255, 255, 255, 0.82);
}

body.theme-anime.portal-page[data-page="settings"] .settings-page-hero .portal-page-title {
    margin-bottom: 6px;
}

body.theme-anime.portal-page[data-page="settings"] .settings-page-hero .portal-lead {
    margin: 0;
    color: #6c6048;
}

body.theme-anime.portal-page[data-page="settings"] .settings-page-grid {
    display: grid;
    grid-template-columns: minmax(300px, 360px) minmax(0, 1fr);
    gap: 22px;
    align-items: start;
}

body.theme-anime.portal-page[data-page="settings"] .settings-section {
    display: grid;
    gap: 16px;
    padding: 20px;
}

body.theme-anime.portal-page[data-page="settings"] .settings-section-account {
    grid-row: span 2;
}

body.theme-anime.portal-page[data-page="settings"] .settings-section-head h3,
body.theme-anime.portal-page[data-page="settings"] .settings-card-subsection h4 {
    margin: 0;
    color: #413727;
}

body.theme-anime.portal-page[data-page="settings"] .settings-section-head p {
    margin: 6px 0 0;
    color: #73664d;
    line-height: 1.55;
}

body.theme-anime.portal-page[data-page="settings"] .settings-avatar-stack,
body.theme-anime.portal-page[data-page="settings"] .settings-form,
body.theme-anime.portal-page[data-page="settings"] .settings-form-grid {
    display: grid;
    gap: 16px;
}

body.theme-anime.portal-page[data-page="settings"] .settings-card-subsection,
body.theme-anime.portal-page[data-page="settings"] .settings-danger-box {
    display: grid;
    gap: 12px;
    padding: 16px;
    border-radius: 20px;
    border: 1px solid rgba(108, 90, 54, 0.12);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(247, 243, 230, 0.98));
}

body.theme-anime.portal-page[data-page="settings"] .settings-section-avatars .settings-card-subsection:last-child {
    max-height: 370px;
}

body.theme-anime.portal-page[data-page="settings"] .settings-danger-box {
    background: linear-gradient(180deg, rgba(255, 248, 246, 0.98), rgba(255, 237, 231, 0.98));
    border-color: rgba(188, 93, 72, 0.2);
}

body.theme-anime.portal-page[data-page="settings"] .settings-upload-form,
body.theme-anime.portal-page[data-page="settings"] .settings-inline-control,
body.theme-anime.portal-page[data-page="settings"] .settings-current-avatar {
    display: flex;
    gap: 10px;
    align-items: center;
}

body.theme-anime.portal-page[data-page="settings"] .settings-file-input,
body.theme-anime.portal-page[data-page="settings"] .settings-field input,
body.theme-anime.portal-page[data-page="settings"] .settings-field textarea,
body.theme-anime.portal-page[data-page="settings"] .settings-field select {
    width: 100%;
    padding: 11px 13px;
    border-radius: 14px;
    border: 1px solid rgba(110, 93, 58, 0.16);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(245, 244, 237, 0.98));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

body.theme-anime.portal-page[data-page="settings"] .settings-field {
    display: grid;
    gap: 6px;
    color: #5a4c35;
    font-size: 13px;
    font-weight: 700;
}

body.theme-anime.portal-page[data-page="settings"] .settings-field-full {
    grid-column: 1 / -1;
}

body.theme-anime.portal-page[data-page="settings"] .settings-field textarea {
    min-height: 110px;
    resize: vertical;
}

body.theme-anime.portal-page[data-page="settings"] .settings-option-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 14px;
}

body.theme-anime.portal-page[data-page="settings"] .settings-inline-control select {
    flex: 1;
}

body.theme-anime.portal-page[data-page="settings"] .settings-current-avatar img {
    width: 92px;
    height: 92px;
    object-fit: cover;
    border-radius: 20px;
    border: 1px solid rgba(108, 90, 54, 0.14);
    box-shadow: 0 10px 28px rgba(60, 46, 21, 0.08);
}

body.theme-anime.portal-page[data-page="settings"] .settings-profile-picture {
    display: grid;
    gap: 12px;
}

body.theme-anime.portal-page[data-page="settings"] .settings-upload-form.stacked {
    display: grid;
    gap: 10px;
    align-items: stretch;
}

body.theme-anime.portal-page[data-page="settings"] .settings-upload-form.stacked .green-btn {
    justify-self: start;
}

body.theme-anime.portal-page[data-page="settings"] .settings-avatar-gallery {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    grid-auto-rows: 72px;
    gap: 8px;
    max-height: 232px;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 6px;
}

body.theme-anime.portal-page[data-page="settings"] .settings-avatar-item {
    position: relative;
    overflow: hidden;
    border-radius: 14px;
    border: 1px solid rgba(108, 90, 54, 0.14);
    background: #f8f3e7;
    box-shadow: 0 10px 24px rgba(68, 54, 27, 0.05);
}

.profile-user-id {
    display: inline-flex;
    margin-top: 6px;
    padding: 3px 10px;
    border-radius: 999px;
    background: rgba(70, 102, 148, 0.1);
    color: #466694;
    font-size: 12px;
    font-weight: 700;
}

body.theme-anime.portal-page[data-page="settings"] .settings-avatar-item img {
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
}

body.theme-anime.portal-page[data-page="settings"] .settings-avatar-delete {
    position: absolute;
    top: 2px;
    right: 4px;
}

body.theme-anime.portal-page[data-page="settings"] .settings-delete-pill {
    width: auto;
    height: auto;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: #b54634;
    font-size: 12px;
    font-weight: 800;
    line-height: 1;
    cursor: pointer;
    display: inline-block;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.9);
    box-shadow: none;
}

body.theme-anime.portal-page[data-page="settings"] .settings-subcopy {
    margin: 0;
    color: #75684e;
    line-height: 1.55;
}

body.theme-anime.portal-page[data-page="settings"] .settings-username-form {
    display: grid;
    gap: 12px;
}

body.theme-anime.portal-page[data-page="settings"] .settings-username-actions {
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
}

body.theme-anime.portal-page[data-page="settings"] .settings-ap-cost {
    color: #7a653a;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

body.theme-anime.portal-page[data-page="settings"] .settings-note {
    padding: 10px 12px;
}

body.theme-anime.portal-page[data-page="settings"] .settings-save-btn {
    justify-self: start;
}

@media (max-width: 980px) {
    body.theme-anime.portal-page[data-page="settings"] .settings-page-grid {
        grid-template-columns: 1fr;
    }

    body.theme-anime.portal-page[data-page="settings"] .settings-section-account {
        grid-row: auto;
    }
}

@media (max-width: 640px) {
    body.theme-anime.portal-page[data-page="settings"] .settings-page-shell {
        gap: 16px;
    }

    body.theme-anime.portal-page[data-page="settings"] .settings-page-hero,
    body.theme-anime.portal-page[data-page="settings"] .settings-section {
        padding: 16px;
        border-radius: 20px;
    }

    body.theme-anime.portal-page[data-page="settings"] .settings-upload-form,
    body.theme-anime.portal-page[data-page="settings"] .settings-inline-control,
    body.theme-anime.portal-page[data-page="settings"] .settings-current-avatar,
    body.theme-anime.portal-page[data-page="settings"] .settings-username-actions {
        flex-direction: column;
        align-items: stretch;
    }
}
/* /dm/ page rebuild: stronger split layout, cleaner history rail, calmer thread stage. */
body.theme-anime.portal-page[data-page="dm"] .portal-card.dm-page-grid {
    grid-template-columns: minmax(320px, 350px) minmax(0, 1fr);
    gap: 24px;
    border-radius: 30px;
    border: 1px solid rgba(105, 89, 53, 0.22);
    background:
        radial-gradient(circle at top left, rgba(246, 239, 208, 0.96), rgba(255, 255, 255, 0) 30%),
        linear-gradient(180deg, rgba(255, 252, 243, 0.98), rgba(244, 247, 235, 0.98));
    box-shadow:
        0 24px 60px rgba(66, 51, 24, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

body.theme-anime.portal-page[data-page="dm"] .dm-page-sidebar,
body.theme-anime.portal-page[data-page="dm"] .dm-page-thread {
    border-radius: 26px;
    border: 1px solid rgba(108, 90, 54, 0.16);
    box-shadow: none;
}

body.theme-anime.portal-page[data-page="dm"] .dm-page-sidebar {
    display: grid;
    gap: 16px;
    align-content: start;
    background:
        linear-gradient(180deg, rgba(120, 153, 86, 0.14), rgba(255, 255, 255, 0) 24%),
        rgba(250, 247, 237, 0.94);
    padding: 18px;
}

body.theme-anime.portal-page[data-page="dm"] .dm-sidebar-hero,
body.theme-anime.portal-page[data-page="dm"] .dm-sidebar-block {
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid rgba(108, 90, 54, 0.12);
    border-radius: 22px;
    padding: 16px;
    box-shadow: 0 12px 30px rgba(68, 54, 27, 0.06);
}

body.theme-anime.portal-page[data-page="dm"] .dm-sidebar-hero .portal-page-title {
    margin-bottom: 6px;
}

body.theme-anime.portal-page[data-page="dm"] .dm-sidebar-hero .portal-lead {
    margin: 0;
    color: #66593f;
    line-height: 1.55;
}

body.theme-anime.portal-page[data-page="dm"] .dm-sidebar-block {
    display: grid;
    gap: 12px;
}

body.theme-anime.portal-page[data-page="dm"] .dm-section-title {
    margin: 0;
    color: #6f5e38;
    font-size: 11px;
    letter-spacing: 0.16em;
}

body.theme-anime.portal-page[data-page="dm"] .dm-search-row,
body.theme-anime.portal-page[data-page="dm"] .dm-group-manage-row {
    gap: 10px;
}

body.theme-anime.portal-page[data-page="dm"] .dm-search-row .text-input,
body.theme-anime.portal-page[data-page="dm"] .dm-group-create-form .text-input,
body.theme-anime.portal-page[data-page="dm"] .dm-group-manage-row .text-input,
body.theme-anime.portal-page[data-page="dm"] #portalDmInput.text-input.small.textarea-input {
    border: 1px solid rgba(110, 93, 58, 0.16);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(245, 244, 237, 0.98));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

body.theme-anime.portal-page[data-page="dm"] .dm-history-block {
    min-height: 0;
}

body.theme-anime.portal-page[data-page="dm"] .dm-history-shell {
    display: grid;
    gap: 14px;
    min-height: 0;
}

body.theme-anime.portal-page[data-page="dm"] .dm-history-group {
    display: grid;
    gap: 10px;
    min-height: 0;
}

body.theme-anime.portal-page[data-page="dm"] .dm-history-label {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #8a7650;
}

body.theme-anime.portal-page[data-page="dm"] .dm-direct-conversations,
body.theme-anime.portal-page[data-page="dm"] .dm-group-conversations,
body.theme-anime.portal-page[data-page="dm"] .dm-page-search-results,
body.theme-anime.portal-page[data-page="dm"] .dm-group-selection {
    display: grid;
    gap: 10px;
}

body.theme-anime.portal-page[data-page="dm"] .dm-direct-conversations,
body.theme-anime.portal-page[data-page="dm"] .dm-group-conversations {
    max-height: 252px;
    overflow: auto;
    padding-right: 4px;
}

body.theme-anime.portal-page[data-page="dm"] .dm-page-search-results,
body.theme-anime.portal-page[data-page="dm"] #portalDmManageSearchResults {
    max-height: 190px;
    overflow: auto;
    padding-right: 4px;
}

body.theme-anime.portal-page[data-page="dm"] .dm-conversation-item,
body.theme-anime.portal-page[data-page="dm"] .dm-user-result {
    grid-template-columns: 50px minmax(0, 1fr) auto;
    gap: 12px;
    padding: 12px;
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(247, 243, 229, 0.98));
    border: 1px solid rgba(114, 95, 55, 0.12);
    box-shadow: 0 8px 24px rgba(63, 49, 24, 0.05);
}

body.theme-anime.portal-page[data-page="dm"] .dm-conversation-item:hover,
body.theme-anime.portal-page[data-page="dm"] .dm-user-result:hover {
    transform: translateY(-1px);
    border-color: rgba(114, 95, 55, 0.22);
}

body.theme-anime.portal-page[data-page="dm"] .dm-conversation-item.active {
    background: linear-gradient(180deg, rgba(225, 239, 209, 0.98), rgba(242, 248, 233, 0.98));
    border-color: rgba(84, 134, 63, 0.28);
    box-shadow: 0 14px 28px rgba(73, 110, 48, 0.14);
}

body.theme-anime.portal-page[data-page="dm"] .dm-conversation-item img,
body.theme-anime.portal-page[data-page="dm"] .dm-user-result img,
body.theme-anime.portal-page[data-page="dm"] .dm-thread-identity img {
    width: 50px;
    height: 50px;
    border-radius: 16px;
    border: 1px solid rgba(114, 95, 55, 0.14);
    box-shadow: 0 8px 20px rgba(53, 41, 18, 0.08);
}

body.theme-anime.portal-page[data-page="dm"] .dm-conversation-meta strong,
body.theme-anime.portal-page[data-page="dm"] .dm-user-result-meta strong {
    font-size: 15px;
    color: #3d3526;
}

body.theme-anime.portal-page[data-page="dm"] .dm-conversation-meta span,
body.theme-anime.portal-page[data-page="dm"] .dm-user-result-meta span {
    margin-top: 3px;
    color: #7c6e56;
}

body.theme-anime.portal-page[data-page="dm"] .dm-conversation-meta .dm-conversation-time {
    font-size: 11px;
    color: #8d7c63;
}

body.theme-anime.portal-page[data-page="dm"] .dm-page-thread {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    gap: 18px;
    min-height: 760px;
    background:
        radial-gradient(circle at top, rgba(210, 233, 194, 0.22), rgba(255, 255, 255, 0) 28%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(246, 244, 236, 0.98));
}

body.theme-anime.portal-page[data-page="dm"] .dm-page-thread-head {
    margin-bottom: 0;
    align-items: center;
}

body.theme-anime.portal-page[data-page="dm"] .dm-thread-identity {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 14px;
    min-width: 0;
}

body.theme-anime.portal-page[data-page="dm"] .dm-thread-copy {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
}

body.theme-anime.portal-page[data-page="dm"] .dm-thread-copy strong {
    display: block;
    margin: 0;
    font-size: clamp(22px, 2vw, 28px);
    line-height: 1.1;
    color: #302919;
    letter-spacing: -0.02em;
}

body.theme-anime.portal-page[data-page="dm"] .dm-thread-copy .group-feed-time,
body.theme-anime.portal-page[data-page="dm"] .dm-thread-copy .status-line {
    margin-top: 4px;
}

body.theme-anime.portal-page[data-page="dm"] .dm-call-controls {
    gap: 10px;
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
}

body.theme-anime.portal-page[data-page="dm"] .dm-call-action-btn {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 60px;
    height: 60px;
    padding: 0;
    border-radius: 100%;
    border: none;
    box-shadow: 0 12px 28px rgba(60, 46, 21, 0.14);
    transition: background-color 0.2s ease, transform 0.2s ease;
}

body.theme-anime.portal-page[data-page="dm"] .dm-call-action-btn:hover {
    transform: translateY(-1px);
}

body.theme-anime.portal-page[data-page="dm"] .dm-call-action-btn .svg-icon {
    display: block;
}

body.theme-anime.portal-page[data-page="dm"] .dm-call-action-start {
    background-color: #4fa15a;
}

body.theme-anime.portal-page[data-page="dm"] .dm-call-action-start:hover {
    background-color: #458f4f;
}

body.theme-anime.portal-page[data-page="dm"] .dm-call-action-end {
    background-color: #FF2849;
}

body.theme-anime.portal-page[data-page="dm"] .dm-call-action-end:hover {
    background-color: #e52441;
}

body.theme-anime.portal-page[data-page="dm"] .dm-call-controls > .dm-call-action-btn,
body.theme-anime.portal-page[data-page="dm"] .dm-call-controls > .dm-call-action-btn:hover,
body.theme-anime.portal-page[data-page="dm"] .dm-call-controls > .dm-call-action-btn:active,
body.theme-anime.portal-page[data-page="dm"] .dm-call-controls > .dm-call-action-btn:focus {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    width: 48px !important;
    height: 48px !important;
    min-width: 48px !important;
    min-height: 48px !important;
    padding: 0 !important;
    border-radius: 999px !important;
    border: none !important;
    background-image: none !important;
    color: #fff !important;
    text-shadow: none !important;
    box-sizing: border-box !important;
    flex: 0 0 48px !important;
    -webkit-appearance: none !important;
    appearance: none !important;
}

body.theme-anime.portal-page[data-page="dm"] .dm-call-controls > .dm-call-action-start,
body.theme-anime.portal-page[data-page="dm"] .dm-call-controls > .dm-call-action-start:focus,
body.theme-anime.portal-page[data-page="dm"] .dm-call-controls > .dm-call-action-start:active {
    background: #30C04F !important;
}

body.theme-anime.portal-page[data-page="dm"] .dm-call-controls > .dm-call-action-start:hover {
    background: #2bac47 !important;
}

body.theme-anime.portal-page[data-page="dm"] .dm-call-controls > .dm-call-action-end,
body.theme-anime.portal-page[data-page="dm"] .dm-call-controls > .dm-call-action-end:focus,
body.theme-anime.portal-page[data-page="dm"] .dm-call-controls > .dm-call-action-end:active {
    background: #FF2849 !important;
}

body.theme-anime.portal-page[data-page="dm"] .dm-call-controls > .dm-call-action-end:hover {
    background: #e52441 !important;
}

body.theme-anime.portal-page[data-page="dm"] .dm-call-controls > .dm-call-action-btn .svg-icon {
    width: 24px;
    height: 24px;
    flex: 0 0 auto;
}

body.theme-anime.portal-page[data-page="dm"] .dm-thread-stack {
    display: grid;
    gap: 14px;
    min-height: 0;
    align-content: start;
}

body.theme-anime.portal-page[data-page="dm"] #portalDmCallBanner,
body.theme-anime.portal-page[data-page="dm"] .dm-call-panel,
body.theme-anime.portal-page[data-page="dm"] .group-dm-shell,
body.theme-anime.portal-page[data-page="dm"] #portalDmMessageList,
body.theme-anime.portal-page[data-page="dm"] .dm-page-composer {
    border-radius: 24px;
    border: 1px solid rgba(113, 95, 57, 0.12);
    box-shadow: 0 14px 34px rgba(63, 49, 24, 0.06);
}

body.theme-anime.portal-page[data-page="dm"] #portalDmCallBanner,
body.theme-anime.portal-page[data-page="dm"] .dm-call-panel,
body.theme-anime.portal-page[data-page="dm"] .group-dm-shell {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(245, 247, 237, 0.98));
}

body.theme-anime.portal-page[data-page="dm"] #portalDmMessageList {
    min-height: 420px;
    max-height: none;
    overflow: auto;
    gap: 14px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(244, 244, 239, 0.98));
    padding-top: 18px;
    padding-bottom: 18px;
    padding-left: 18px;
}

body.theme-anime.portal-page[data-page="dm"] .dm-message-bubble {
    max-width: min(78%, 620px);
    margin: 0;
    padding: 14px 16px;
    border-radius: 22px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(244, 241, 231, 0.98));
    border: 1px solid rgba(113, 95, 57, 0.12);
    box-shadow: 0 12px 28px rgba(60, 46, 21, 0.08);
}

body.theme-anime.portal-page[data-page="dm"] .dm-message-bubble::after {
    display: none;
}

body.theme-anime.portal-page[data-page="dm"] .dm-message-bubble.self {
    background: linear-gradient(180deg, rgba(219, 241, 200, 0.98), rgba(198, 232, 176, 0.98));
    border-color: rgba(83, 132, 62, 0.18);
    color: #21411f;
}

body.theme-anime.portal-page[data-page="dm"] .dm-message-meta {
    margin-bottom: 8px;
    color: #7a6a52;
    font-size: 11px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

body.theme-anime.portal-page[data-page="dm"] .dm-message-bubble.self .dm-message-meta,
body.theme-anime.portal-page[data-page="dm"] .dm-message-bubble.self .dm-message-file,
body.theme-anime.portal-page[data-page="dm"] .dm-message-bubble.self .dm-receipt.delivered,
body.theme-anime.portal-page[data-page="dm"] .dm-message-bubble.self .dm-receipt.read {
    color: #2b5127;
}

body.theme-anime.portal-page[data-page="dm"] .dm-empty-state {
    border-radius: 20px;
    border: 1px dashed rgba(114, 95, 55, 0.2);
    background: rgba(255, 255, 255, 0.76);
    color: #7a6b53;
    padding: 18px;
}

body.theme-anime.portal-page[data-page="dm"] .dm-page-composer {
    display: grid;
    grid-template-columns: 50px 40px minmax(32px, 64px) minmax(0, 1fr) 72px;
    align-items: center;
    gap: 8px;
    padding-top: 12px;
    padding-right: 12px;
    padding-bottom: 12px;
    padding-left: 12px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(245, 243, 235, 0.98));
}

body.theme-anime.portal-page[data-page="dm"] .dm-page-composer > * {
    min-width: 0;
}

body.theme-anime.portal-page[data-page="dm"] .dm-page-composer .green-btn,
body.theme-anime.portal-page[data-page="dm"] .dm-page-composer .file-btn {
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}

body.theme-anime.portal-page[data-page="dm"] .dm-page-composer .dm-attach-btn {
    width: 56px;
    min-width: 56px;
    height: 42px;
    min-height: 42px;
    padding: 0 8px;
    font-size: 12px;
}

body.theme-anime.portal-page[data-page="dm"] #portalDmVoiceRecordBtn {
    width: 42px;
    min-width: 42px;
    height: 42px;
    min-height: 42px;
    padding: 0;
}

body.theme-anime.portal-page[data-page="dm"] #portalDmSendBtn {
    width: 72px;
    min-width: 72px;
    height: 42px;
    min-height: 42px;
    padding: 0 10px;
    font-size: 13px;
}

body.theme-anime.portal-page[data-page="dm"] #portalDmInput.text-input.small.textarea-input {
    min-width: 0;
    width: 100%;
    min-height: 46px;
    height: 46px;
    max-height: 126px;
    margin: 0;
    padding: 10px 25px;
    border: 2px solid rgba(94, 150, 62, 0.92);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.08);
    color: #2f4627;
    font-size: 15px;
    line-height: 1.45;
    resize: vertical;
    box-sizing: border-box;
    box-shadow: none;
    transition: box-shadow 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}

body.theme-anime.portal-page[data-page="dm"] #portalDmInput.text-input.small.textarea-input::placeholder {
    color: rgba(74, 99, 60, 0.72);
}

body.theme-anime.portal-page[data-page="dm"] #portalDmInput.text-input.small.textarea-input:focus,
body.theme-anime.portal-page[data-page="dm"] #portalDmInput.text-input.small.textarea-input:active {
    outline: none;
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(94, 150, 62, 1);
    box-shadow: inset 2px 2px 15px rgba(94, 150, 62, 0.28);
}

body.theme-anime.portal-page[data-page="dm"] .dm-page-composer .file-btn input[type="file"] {
    min-width: 0;
    min-height: 0;
}

body.theme-anime.portal-page[data-page="dm"] .dm-voice-status {
    grid-column: auto;
    min-width: 0;
    margin: 0;
    font-size: 12px;
    line-height: 1.35;
    color: #6d675b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

body.theme-anime.portal-page[data-page="dm"] .dm-voice-playback {
    width: 100%;
    margin: 0;
}

body.theme-anime.portal-page[data-page="dm"] .dm-attachment-status {
    color: #71624c;
    padding-left: 4px;
}

@media (max-width: 1100px) {
    body.theme-anime.portal-page[data-page="dm"] .portal-card.dm-page-grid {
        grid-template-columns: 1fr;
    }

    body.theme-anime.portal-page[data-page="dm"] .dm-page-thread {
        min-height: 680px;
    }
}

@media (max-width: 760px) {
    body.theme-anime.portal-page[data-page="dm"] .portal-card.dm-page-grid {
        gap: 14px;
        border-radius: 24px;
    }

    body.theme-anime.portal-page[data-page="dm"] .dm-page-sidebar,
    body.theme-anime.portal-page[data-page="dm"] .dm-page-thread {
        border-radius: 20px;
    }

    body.theme-anime.portal-page[data-page="dm"] .dm-page-sidebar {
        gap: 12px;
        padding: 12px;
    }

    body.theme-anime.portal-page[data-page="dm"] .dm-sidebar-hero {
        order: 1;
        padding: 16px;
    }

    body.theme-anime.portal-page[data-page="dm"] .dm-sidebar-hero .portal-page-title {
        font-size: clamp(22px, 7vw, 28px);
    }

    body.theme-anime.portal-page[data-page="dm"] .dm-sidebar-hero .portal-lead {
        font-size: 13px;
        line-height: 1.5;
    }

    body.theme-anime.portal-page[data-page="dm"] .dm-history-block {
        order: 2;
    }

    body.theme-anime.portal-page[data-page="dm"] .dm-page-sidebar > .dm-sidebar-block:not(.dm-history-block) {
        order: 3;
        padding: 14px;
    }

    body.theme-anime.portal-page[data-page="dm"] .dm-section-title,
    body.theme-anime.portal-page[data-page="dm"] .dm-history-label {
        font-size: 10px;
        letter-spacing: 0.18em;
    }

    body.theme-anime.portal-page[data-page="dm"] .dm-direct-conversations,
    body.theme-anime.portal-page[data-page="dm"] .dm-group-conversations {
        max-height: 220px;
        padding-right: 2px;
    }

    body.theme-anime.portal-page[data-page="dm"] .dm-page-search-results,
    body.theme-anime.portal-page[data-page="dm"] #portalDmManageSearchResults {
        max-height: 160px;
        padding-right: 2px;
    }

    body.theme-anime.portal-page[data-page="dm"] .dm-conversation-item,
    body.theme-anime.portal-page[data-page="dm"] .dm-user-result {
        grid-template-columns: 46px minmax(0, 1fr) auto;
        gap: 10px;
        padding: 11px;
        border-radius: 17px;
    }

    body.theme-anime.portal-page[data-page="dm"] .dm-conversation-item img,
    body.theme-anime.portal-page[data-page="dm"] .dm-user-result img,
    body.theme-anime.portal-page[data-page="dm"] .dm-thread-identity img {
        width: 46px;
        height: 46px;
        border-radius: 14px;
    }

    body.theme-anime.portal-page[data-page="dm"] .dm-conversation-meta strong,
    body.theme-anime.portal-page[data-page="dm"] .dm-user-result-meta strong {
        font-size: 14px;
    }

    body.theme-anime.portal-page[data-page="dm"] .dm-page-thread {
        min-height: auto;
        gap: 12px;
        padding: 12px;
        background:
            radial-gradient(circle at top, rgba(210, 233, 194, 0.18), rgba(255, 255, 255, 0) 28%),
            linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(246, 244, 236, 0.98));
    }

    body.theme-anime.portal-page[data-page="dm"] .dm-page-thread-head {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 12px;
        align-items: center;
        padding: 2px;
    }

    body.theme-anime.portal-page[data-page="dm"] .dm-thread-identity {
        gap: 12px;
    }

    body.theme-anime.portal-page[data-page="dm"] .dm-thread-copy strong {
        font-size: clamp(19px, 5.6vw, 24px);
    }

    body.theme-anime.portal-page[data-page="dm"] .dm-thread-copy .group-feed-time,
    body.theme-anime.portal-page[data-page="dm"] .dm-thread-copy .status-line {
        font-size: 12px;
    }

    body.theme-anime.portal-page[data-page="dm"] .dm-call-controls {
        width: auto;
        justify-content: flex-end;
        gap: 8px;
    }

    body.theme-anime.portal-page[data-page="dm"] .dm-call-controls .green-btn {
        flex: 0 1 auto;
        min-width: 96px;
    }

    body.theme-anime.portal-page[data-page="dm"] .dm-call-controls .dm-call-action-btn {
        flex: 0 0 auto;
    }

    body.theme-anime.portal-page[data-page="dm"] #portalDmCallBanner,
    body.theme-anime.portal-page[data-page="dm"] .dm-call-panel,
    body.theme-anime.portal-page[data-page="dm"] .group-dm-shell,
    body.theme-anime.portal-page[data-page="dm"] #portalDmMessageList,
    body.theme-anime.portal-page[data-page="dm"] .dm-page-composer {
        border-radius: 20px;
    }

    body.theme-anime.portal-page[data-page="dm"] #portalDmMessageList {
        min-height: 52vh;
        max-height: 58vh;
        padding-top: 16px;
        padding-right: 12px;
        padding-bottom: 92px;
        padding-left: 12px;
        background:
            radial-gradient(circle at top, rgba(212, 231, 198, 0.28), rgba(255, 255, 255, 0) 30%),
            linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(243, 244, 237, 0.98));
    }

    body.theme-anime.portal-page[data-page="dm"] .dm-message-bubble {
        max-width: 94%;
        border-radius: 20px;
        padding: 12px 14px;
    }

    body.theme-anime.portal-page[data-page="dm"] .dm-message-meta {
        font-size: 10px;
    }

    body.theme-anime.portal-page[data-page="dm"] .dm-page-composer {
        position: sticky;
        bottom: 0;
        z-index: 4;
        grid-template-columns: 44px 38px minmax(28px, 48px) minmax(0, 1fr) 64px;
        gap: 8px;
        padding: 10px;
        background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(247, 244, 236, 0.96));
        backdrop-filter: blur(14px);
        box-shadow: 0 12px 36px rgba(60, 46, 21, 0.12);
    }

    body.theme-anime.portal-page[data-page="dm"] .dm-page-composer .dm-attach-btn {
        width: 44px;
        min-width: 44px;
        height: 44px;
        min-height: 44px;
        padding: 0 6px;
    }

    body.theme-anime.portal-page[data-page="dm"] #portalDmVoiceRecordBtn {
        width: 38px;
        min-width: 38px;
        height: 38px;
        min-height: 38px;
    }

    body.theme-anime.portal-page[data-page="dm"] #portalDmInput.text-input.small.textarea-input {
        min-height: 46px;
        height: 46px;
        max-height: 132px;
        padding: 9px 18px;
    }

    body.theme-anime.portal-page[data-page="dm"] #portalDmSendBtn {
        grid-column: auto;
        width: 64px;
        min-width: 64px;
        height: 40px;
        min-height: 40px;
    }

    body.theme-anime.portal-page[data-page="dm"] .dm-voice-status {
        font-size: 11px;
    }
}

@media (max-width: 560px) {
    body.theme-anime.portal-page[data-page="dm"] .portal-card.dm-page-grid {
        gap: 12px;
        border-radius: 20px;
    }

    body.theme-anime.portal-page[data-page="dm"] .dm-page-thread-head {
        grid-template-columns: 1fr;
        align-items: stretch;
    }

    body.theme-anime.portal-page[data-page="dm"] .dm-call-controls {
        width: 100%;
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    body.theme-anime.portal-page[data-page="dm"] .dm-call-controls .green-btn {
        flex: 1 1 calc(50% - 6px);
        min-width: 0;
    }

    body.theme-anime.portal-page[data-page="dm"] #portalDmMessageList {
        min-height: 46vh;
        max-height: 54vh;
        padding-bottom: 86px;
    }

    body.theme-anime.portal-page[data-page="dm"] .dm-page-composer {
        grid-template-columns: 42px 36px minmax(0, 42px) minmax(0, 1fr) 58px;
        gap: 6px;
        padding: 9px;
    }

    body.theme-anime.portal-page[data-page="dm"] .dm-page-composer .dm-attach-btn {
        width: 42px;
        min-width: 42px;
        height: 42px;
        min-height: 42px;
        font-size: 11px;
    }

    body.theme-anime.portal-page[data-page="dm"] #portalDmVoiceRecordBtn {
        width: 36px;
        min-width: 36px;
        height: 36px;
        min-height: 36px;
    }

    body.theme-anime.portal-page[data-page="dm"] #portalDmSendBtn {
        width: 58px;
        min-width: 58px;
    }

    body.theme-anime.portal-page[data-page="dm"] #portalDmInput.text-input.small.textarea-input {
        padding: 8px 14px;
    }
}
/* Registration Captcha Button Styling */
.register-captcha-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

#register-captcha-refresh {
    min-width: 96px;
    min-height: 40px;
    font-size: 14px;
    padding: 0 16px;
    border: 3px solid var(--green-line, #bcbcbc);
    background: #effbd8;
    color: var(--green-dark, #42a217);
    font-weight: 700;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
}
#register-captcha-refresh:hover {
    background: #dbf2b4;
}
.side-btn {
    position: relative;
}

.side-badge {
    position: absolute;
    top: -3px;
    right: -5px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: #b52020;
    color: #fff;
    font-size: 11px;
    line-height: 18px;
    text-align: center;
}

.side-badge.hidden {
    display: none;
}

.side-icon-text {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.dm-panel {
    width: 760px;
    max-width: calc(100% - 40px);
}

.dm-panel-body {
    display: grid;
    grid-template-columns: 250px minmax(0, 1fr);
    gap: 16px;
    min-height: 420px;
}

.dm-sidebar,
.dm-thread-shell,
.dm-page-sidebar,
.dm-page-thread {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(73, 61, 43, 0.18);
    border-radius: 16px;
    padding: 14px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.dm-section-title {
    margin-bottom: 8px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #6f563b;
}

.dm-search-row,
.dm-thread-input-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.dm-search-row .text-input,
.dm-thread-input-row .text-input {
    flex: 1;
}

.dm-search-results,
.dm-conversation-list,
.dm-message-list,
.dm-page-conversations,
.dm-page-search-results,
.dm-page-messages {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.dm-search-results,
.dm-conversation-list,
.dm-page-conversations,
.dm-page-search-results {
    max-height: 190px;
    overflow: auto;
}

.dm-message-list,
.dm-page-messages {
    min-height: 280px;
    max-height: 420px;
    overflow: auto;
    padding-right: 4px;
}

.dm-conversation-item,
.dm-user-result {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    width: 100%;
    padding: 10px;
    border-radius: 12px;
    background: #fffdf7;
    border: 1px solid rgba(73, 61, 43, 0.14);
    cursor: pointer;
    text-align: left;
    appearance: none;
}

.dm-conversation-item.active {
    border-color: #8b6a42;
    background: #f8f0df;
}

.moderator-panel {
    width: min(620px, 88vw);
    min-height: 360px;
    max-width: calc(100vw - 16px);
    max-height: calc(100vh - 24px);
    overflow: auto;
}

.moderator-panel .panel-body {
    padding: 10px;
}

.moderator-panel-body {
    display: grid;
    grid-template-columns: minmax(190px, 220px) minmax(0, 1fr);
    gap: 10px;
    min-height: 300px;
    align-items: start;
    overflow: hidden;
}

.moderator-column {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(73, 61, 43, 0.18);
    border-radius: 12px;
    padding: 8px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
    min-height: 0;
}

.moderator-search-column,
.moderator-detail-column {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.moderator-user-list {
    max-height: 100%;
    min-height: 210px;
}

.moderator-user-row,
.moderator-log-row,
.moderator-target-card {
    border: 1px solid rgba(73, 61, 43, 0.14);
    border-radius: 12px;
    background: #fffdf7;
}

.moderator-user-row {
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr) auto;
    gap: 6px;
    align-items: center;
    padding: 6px;
    width: 100%;
    color: inherit;
    text-align: left;
    cursor: pointer;
}

.moderator-user-row.active {
    border-color: #8b6a42;
    background: #f8f0df;
}

.moderator-user-row img,
.moderator-target-head img {
    width: 32px;
    height: 32px;
    object-fit: cover;
    border-radius: 8px;
}

.moderator-user-meta,
.moderator-target-meta {
    min-width: 0;
}

.moderator-user-meta strong,
.moderator-target-meta strong {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.moderator-user-sub,
.moderator-target-sub,
.moderator-target-extra,
.moderator-log-meta {
    font-size: 10px;
    color: #6d675b;
}

.moderator-target-card {
    padding: 8px;
}

.moderator-target-head {
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr);
    gap: 6px;
    align-items: center;
}

.moderator-state-row,
.moderator-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.moderator-state-row {
    align-items: center;
}

.moderator-actions .green-btn.tiny {
    padding: 4px 7px;
    min-height: 24px;
    min-width: 56px;
    font-size: 11px;
}

.moderator-form {
    gap: 4px;
}

.moderator-form .textarea-input {
    min-height: 62px;
}

.moderator-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 6px;
    border-radius: 999px;
    font-size: 9px;
    font-weight: 700;
}

.moderator-badge.online {
    background: #dff2df;
    color: #275f27;
}

.moderator-badge.warning {
    background: #fff0cf;
    color: #8a5b00;
}

.moderator-badge.danger {
    background: #f7d7d7;
    color: #8a1f1f;
}

.moderator-log-list {
    min-height: 84px;
    max-height: 120px;
    overflow-y: auto;
}

.moderator-log-row {
    padding: 6px;
}

body.theme-anime[data-page="chat"] .moderator-panel {
    width: 520px;
    min-height: 300px;
}

body.theme-anime[data-page="chat"] .moderator-panel .panel-body {
    padding: 6px;
}

body.theme-anime[data-page="chat"] .moderator-panel-body {
    grid-template-columns: minmax(168px, 190px) minmax(0, 1fr);
    gap: 8px;
    min-height: 250px;
}

.moderator-log-title {
    margin-top: 4px;
}

.dm-conversation-item img,
.dm-user-result img,
.dm-page-thread-head img {
    width: 42px;
    height: 42px;
    object-fit: cover;
    border-radius: 12px;
}

.dm-conversation-meta,
.dm-user-result-meta {
    min-width: 0;
}

.dm-conversation-meta strong,
.dm-user-result-meta strong {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dm-conversation-meta span,
.dm-user-result-meta span {
    display: block;
    color: #6d675b;
    font-size: 12px;
}

.dm-result-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
}

.dm-unread-pill,
.dm-key-pill {
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
}

.dm-unread-pill {
    background: #b52020;
    color: #fff;
}

.dm-key-pill.missing {
    background: #f7d7d7;
    color: #8a1f1f;
}

.dm-key-pill.ready {
    background: #dff2df;
    color: #275f27;
}

.dm-thread-head,
.dm-page-thread-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.dm-page-thread-head {
    justify-content: flex-start;
}

.dm-message-bubble {
    max-width: 80%;
    padding: 10px 15px;
    border-radius: 20px;
    background: #dedede;
    border: none;
    align-self: flex-start;
    position: relative;
    clear: both;
    margin: 5px 0;
}

.dm-message-bubble::after {
    content: " ";
    position: absolute;
    bottom: 0;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    z-index: -1;
}

.dm-message-bubble:not(.self)::after {
    left: -19px;
    box-shadow: inset 1px 9px 0 4px rgba(255,255,255,.9),
                inset -9px 0 0 2px #dedede,
                0 0 0 1px rgba(255,255,255,.9);
}

.dm-message-bubble.self {
    align-self: flex-end;
    background: var(--green-dark, #4ea03f);
    color: #fff;
}

.dm-message-bubble.self::after {
    right: -19px;
    box-shadow: inset -1px 9px 0 4px rgba(255,255,255,.9),
                inset 9px 1px 0 2px var(--green-dark, #4ea03f),
                0 0 0 1px rgba(255,255,255,.9);
}

.dm-message-meta {
    margin-bottom: 4px;
    color: #6d675b;
    font-size: 12px;
}

.dm-message-bubble.self .dm-message-meta {
    color: rgba(255,255,255,.7);
}

.dm-message-bubble.self .dm-message-file {
    color: rgba(255,255,255,.7);
}

.dm-message-bubble.self .dm-receipt.delivered {
    color: rgba(255,255,255,.7);
}

.dm-message-bubble.self .dm-receipt.read {
    color: #fff;
}

.dm-message-text {
    white-space: pre-wrap;
    word-break: break-word;
}

.dm-message-image img {
    display: block;
    max-width: min(280px, 100%);
    max-height: 260px;
    border-radius: 12px;
    object-fit: cover;
    background: rgba(255, 255, 255, 0.75);
}

.dm-message-file {
    margin-top: 6px;
    font-size: 12px;
    color: #6d675b;
}

.dm-receipt {
    margin-left: 6px;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.dm-receipt.delivered {
    color: #6d675b;
}

.dm-receipt.read {
    color: #2371c7;
}

.dm-attach-btn {
    flex: 0 0 auto;
}

.dm-composer,
.dm-page-composer {
    display: flex;
    gap: 8px;
    align-items: flex-end;
    margin-top: 12px;
}

.dm-composer textarea,
.dm-page-composer textarea {
    flex: 1;
    resize: vertical;
}

.dm-page-grid {
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr);
    gap: 18px;
}

.dm-group-create-form,
.dm-group-selection {
    display: grid;
    gap: 8px;
}

.dm-group-selection {
    max-height: 120px;
    overflow: auto;
}

.dm-call-controls {
    margin-left: auto;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.dm-call-panel {
    margin-top: 12px;
    padding: 14px;
    border-radius: 16px;
    background: linear-gradient(180deg, #f5fbff, #eef6fb);
    border: 1px solid #c8d9e7;
    display: grid;
    gap: 12px;
}

.dm-call-panel-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.dm-call-panel-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.dm-call-participants {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.dm-call-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 999px;
    background: rgba(255,255,255,.8);
    border: 1px solid rgba(73, 61, 43, 0.14);
    font-size: 12px;
    color: #455463;
}

.dm-call-chip.ready {
    background: #e8f6e8;
    color: #2a5d2a;
}

.dm-call-chip.connecting {
    background: #fff6e3;
    color: #7c5a18;
}

.dm-call-chip.ended {
    background: #f7e7e7;
    color: #8a3c3c;
}

.dm-call-audio-mount {
    display: none;
}

.room-call-panel {
    width: 430px;
    max-width: min(calc(100vw - 96px), 430px);
}

.room-call-panel-body {
    display: grid;
    gap: 10px;
}

.room-call-summary {
    display: grid;
    gap: 4px;
}

.room-call-meta {
    color: #5a6273;
    font-size: 12px;
    line-height: 1.45;
}

.room-call-restriction {
    margin-top: 2px;
}

.room-call-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.room-call-participants {
    display: grid;
    gap: 8px;
}

.room-call-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 12px;
    background: linear-gradient(180deg, #f7fbff, #eef4fb);
    border: 1px solid rgba(73, 61, 43, 0.14);
}

.room-call-chip img {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    object-fit: cover;
    flex: none;
}

.room-call-chip-meta {
    min-width: 0;
    display: grid;
    gap: 2px;
    flex: 1;
}

.room-call-chip-meta strong,
.room-call-chip-meta span {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.room-call-chip-meta span {
    color: #5f6878;
    font-size: 12px;
}

.room-call-chip.ready {
    background: linear-gradient(180deg, #eefae9, #dff4d9);
}

.room-call-chip.connecting {
    background: linear-gradient(180deg, #fffaf0, #fff1d6);
}

.room-call-user-toggle {
    flex: none;
    padding: 6px 10px;
    border: 1px solid rgba(64, 110, 30, 0.26);
    border-radius: 999px;
    background: #f4fbeb;
    color: #3f7020;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
}

.room-call-user-toggle.is-muted,
.room-call-actions .green-btn.is-active {
    background: #f8e3e3;
    border-color: rgba(140, 60, 60, 0.28);
    color: #8a3c3c;
}

.room-call-audio-mount {
    display: none;
}

.dm-safety-panel {
    display: grid;
    gap: 8px;
}

.dm-safety-card {
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(255,255,255,.82);
    border: 1px solid rgba(73, 61, 43, 0.12);
}

.dm-safety-card strong {
    display: block;
    margin-bottom: 4px;
}

.dm-safety-number {
    font-family: Consolas, Monaco, monospace;
    font-size: 12px;
    letter-spacing: 0.08em;
    color: #35506a;
    word-break: break-word;
}

.dm-group-manage {
    display: grid;
    gap: 8px;
}

.dm-group-manage-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.dm-group-manage-row .text-input {
    flex: 1;
}

body[data-page="chat"] .dm-panel {
    width: 620px;
    max-width: min(calc(100vw - 90px), 620px);
}

body[data-page="chat"] .dm-panel-body {
    grid-template-columns: 210px minmax(0, 1fr);
    gap: 12px;
    min-height: 340px;
}

body[data-page="chat"] .dm-sidebar,
body[data-page="chat"] .dm-thread-shell {
    padding: 10px;
    border-radius: 12px;
}

body[data-page="chat"] .dm-search-results,
body[data-page="chat"] .dm-conversation-list {
    max-height: 150px;
}

body[data-page="chat"] .dm-message-list {
    min-height: 210px;
    max-height: 280px;
}

body[data-page="chat"] .dm-conversation-item,
body[data-page="chat"] .dm-user-result {
    grid-template-columns: 34px minmax(0, 1fr) auto;
    gap: 8px;
    padding: 8px;
    border-radius: 10px;
}

body[data-page="chat"] .dm-conversation-item img,
body[data-page="chat"] .dm-user-result img {
    width: 34px;
    height: 34px;
    border-radius: 10px;
}

body[data-page="chat"] .dm-conversation-meta strong,
body[data-page="chat"] .dm-user-result-meta strong {
    font-size: 13px;
}

body[data-page="chat"] .dm-conversation-meta span,
body[data-page="chat"] .dm-user-result-meta span,
body[data-page="chat"] .dm-message-meta {
    font-size: 11px;
}

body[data-page="chat"] .dm-message-bubble {
    max-width: 88%;
    padding: 8px 10px;
    border-radius: 12px;
}

body[data-page="chat"] .dm-composer {
    gap: 6px;
    margin-top: 10px;
}

body[data-page="chat"] .dm-composer textarea {
    min-height: 72px;
}

.dm-page-sidebar .portal-page-title {
    margin-bottom: 10px;
}

.group-dm-shell {
    display: grid;
    gap: 12px;
    margin-top: 18px;
    padding: 14px;
    border-radius: 16px;
    background: #fbfff5;
    border: 1px solid #dbe9c9;
}

.group-dm-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.group-dm-meta {
    font-size: 12px;
    color: #6d675b;
}

.group-dm-members {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.group-dm-member {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 999px;
    background: #fffdf7;
    border: 1px solid rgba(73, 61, 43, 0.14);
    font-size: 12px;
    color: #5f5648;
}

.group-member-action {
    border: 0;
    background: transparent;
    color: #9a3f3f;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
}

.group-dm-member.missing {
    background: #f7d7d7;
    color: #8a1f1f;
}

.group-dm-messages {
    min-height: 260px;
    max-height: 420px;
}

.group-dm-composer textarea {
    min-height: 96px;
}

.group-profile-head {
    display: grid;
    grid-template-columns: 108px minmax(0, 1fr);
    gap: 16px;
    align-items: start;
}

.group-profile-picture {
    width: 108px;
    height: 108px;
    border-radius: 24px;
    background-size: cover;
    background-position: center;
    border: 1px solid rgba(73, 61, 43, 0.18);
}

.group-profile-copy {
    display: grid;
    gap: 10px;
}

.group-bio-block {
    padding: 12px;
    border-radius: 12px;
    border: 1px solid rgba(0,0,0,.08);
    background: rgba(255,255,255,.65);
    white-space: pre-wrap;
}

.group-cost-note {
    margin-bottom: 10px;
}

.group-feed-stack {
    display: grid;
    gap: 12px;
}

.group-feed-card {
    display: grid;
    gap: 12px;
}

.group-feed-head {
    display: flex;
    align-items: center;
    gap: 10px;
}

.group-feed-head img {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    object-fit: cover;
}

.group-feed-head.small img {
    width: 30px;
    height: 30px;
}

.group-feed-time {
    font-size: 12px;
    color: #6d675b;
}

.group-feed-body {
    white-space: pre-wrap;
    word-break: break-word;
}

.group-comment-stack {
    gap: 8px;
}

.group-comment-card {
    background: rgba(255,255,255,.52);
}

.dm-empty-state {
    padding: 16px;
    border-radius: 12px;
    background: #fffdf7;
    border: 1px dashed rgba(73, 61, 43, 0.2);
    color: #6d675b;
}

@media (max-width: 900px) {
    .dm-panel-body,
    .dm-page-grid {
        grid-template-columns: 1fr;
    }

    .moderator-panel-body {
        grid-template-columns: 1fr;
    }

    .dm-panel {
        width: min(100%, 92vw);
    }

    .moderator-panel {
        width: min(100%, 96vw);
    }

    .dm-message-bubble {
        max-width: 100%;
    }
}
* {
    box-sizing: border-box;
}

:root {
    --green-bg: #b9ea74;
    --green-line: #7dc24b;
    --green-dark: #4ea03f;
    --green-soft: #ecf9d7;
    --panel-bg: rgba(255,255,255,.95);
    --panel-shadow: 0 18px 45px rgba(39, 77, 24, .18);
    --text-dark: #4a5c3c;
    --text-soft: #7a8b69;
    --white: #fff;
    --border-strong: #8ecf63;
    --bubble: rgba(255,255,255,.95);
}

html, body {
    margin: 0;
    min-height: 100%;
    font-family: "Trebuchet MS", Verdana, Arial, sans-serif;
    background: var(--green-bg);
    color: var(--text-dark);
}

body.theme-anime {
    background:
        radial-gradient(circle at 20% 10%, rgba(255,255,255,.25), transparent 28%),
        radial-gradient(circle at 75% 8%, rgba(255,255,255,.18), transparent 22%),
        radial-gradient(circle at 10% 90%, rgba(255,255,255,.15), transparent 24%),
        var(--green-bg);
}

a {
    color: inherit;
    text-decoration: none;
}

#wp-admin-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 40;
}

#wp-admin-bar .padder {
    position: relative;
    padding: 0;
    width: 100%;
    margin: 0 auto;
    background: rgba(0, 0, 0, .62);
    height: 25px;
    min-width: 0;
    max-width: none;
}

#admin-bar-logo {
    float: left;
    height: 25px;
    padding: 0 10px;
    line-height: 25px;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
}

#wp-admin-bar .main-nav,
#wp-admin-bar .random-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

#wp-admin-bar .main-nav {
    float: right;
    display: flex;
    align-items: stretch;
}

#wp-admin-bar .main-nav > li {
    position: relative;
}

#wp-admin-bar .main-nav > li > a {
    display: block;
    height: 25px;
    padding: 0 10px;
    line-height: 25px;
    color: #fff;
    font-size: 12px;
}

#wp-admin-bar .main-nav > li > a:hover,
#wp-admin-bar .random-list a:hover {
    background: rgba(255,255,255,.12);
}

#wp-admin-bar .random-list {
    position: absolute;
    top: 25px;
    right: 0;
    min-width: 140px;
    display: none;
    background: rgba(0, 0, 0, .82);
}

#wp-admin-bar .random-list li a {
    display: block;
    padding: 6px 10px;
    color: #fff;
    font-size: 12px;
}

#bp-adminbar-visitrandom-menu:hover .random-list {
    display: block;
}

.app-wrap {
    min-height: 100vh;
    display: flex;
    padding: 43px 18px 28px 18px;
    gap: 16px;
    position: relative;
}

body[data-page="chat"] .app-wrap {
    padding-bottom: 190px;
}

#footer {
    position: fixed;
    left: 0;
    margin-left: 0;
    bottom: 0;
    height: 110px;
    width: 100%;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 0 10px 14px;
    text-align: center;
    font-size: 1.1em;
    background: transparent;
    border-top: 0;
    color: #0ca209;
    z-index: 35;
}

#footer p {
    margin: 0;
    color: inherit;
    white-space: nowrap;
    padding: 8px 18px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.1);
}


.sidebar {
    z-index: 20;
}

.floating-sidebar,
#toolbar {
    position: fixed;
    left: 0;
    top: 58px;
    transform: none;
    width: 44px;
    min-width: 40px;
    min-height: 160px;
    padding: 0;
    cursor: move;
    z-index: 96;
    border: 1px solid #0ca209;
    background: rgba(255,255,255,.88);
    box-shadow: 0 8px 18px rgba(42, 90, 17, .16);
    overflow: visible;
}

.toolbar-handle {
    height: 14px;
    display: grid;
    place-items: center;
    color: #2f8f16;
    font-size: 8px;
    line-height: 1;
    border-bottom: 1px solid #0ca209;
    background: linear-gradient(180deg, #fbfff6, #e6f5d7);
    cursor: move;
    user-select: none;
    -webkit-user-select: none;
}

.toolbar-list {
    margin: 1px 0 0;
    padding: 0;
    list-style-type: none;
    z-index: 20;
    border-bottom: 1px solid #0ca209;
    user-select: none;
    -webkit-user-select: none;
}

.toolbar-list li {
    margin: 0 1px 1px;
    position: relative;
    padding: 0;
    cursor: pointer;
    float: left;
    list-style: none;
    z-index: 20;
    user-select: none;
    -webkit-user-select: none;
}

.toolbar-list::after {
    content: "";
    display: block;
    clear: both;
}

.sidebar.decorative {
    opacity: .88;
}

.side-btn {
    width: 28px;
    height: 28px;
    border: 1px solid #7ebf52;
    background: linear-gradient(180deg, #fcfff8, #e7f4d9);
    color: #478e2f;
    display: grid;
    place-items: center;
    border-radius: 0;
    cursor: pointer;
    font-size: 13px;
    padding: 0;
    box-shadow: none;
    transition: background .14s ease, color .14s ease;
}

.side-btn:hover,
.side-btn.active {
    background: #dff6be;
    color: #2f7f1e;
}

.side-icon {
    display: block;
    line-height: 1;
    font-size: 12px;
}

#btnToggleNews .side-icon {
    font-size: 8px;
    font-weight: 700;
}

.main-stage {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    width: 100%;
    padding-left: 82px;
    gap: 8px;
}

.chat-scene {
    position: relative;
    width: min(1260px, calc(100vw - 120px));
    max-width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    margin: 0;
    overflow: visible;
    border: 3px solid var(--green-line);
    background-color: #d2efb1;
    background-size: cover;
    background-position: center center;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.75);
    z-index: 2;
}

.login-scene {
    height: 110px;
}

.scene-title {
    position: absolute;
    background-size: auto 110px;
    top: 12px;
    right: 28px;
    color: rgba(255,255,255,.92);
    font-size: clamp(30px, 4vw, 44px);
    letter-spacing: 2px;
    text-shadow: 0 2px 10px rgba(0,0,0,.18);
    z-index: 2;
}

.room-badge {
    user-select: none;
    -webkit-user-select: none;
    position: absolute;
    top: 18px;
    left: 20px;
    z-index: 3;
    padding: 8px 14px;
    border: 2px solid var(--green-line);
    background: rgba(255,255,255,.78);
    font-size: 14px;
    border-radius: 4px;
}

.bottom-bar {
    display: flex;
    gap: 10px;
    position: relative;
    width: min(760px, calc(100vw - 160px));
    max-width: min(760px, calc(100% - 160px));
    margin: 0;
}

.fake-bar {
    margin-top: 0;
}

.chat-line {
    flex: 1;
    min-height: 52px;
    padding: 0 14px;
    font-size: 20px;
    border: 3px solid var(--green-line);
    outline: none;
    background: rgba(255,255,255,.94);
    color: var(--text-dark);
}

.chat-line:disabled {
    background: rgba(255,255,255,.85);
}

.send-btn,
.green-btn {
    min-width: 138px;
    padding: 0 16px;
    border: 3px solid var(--green-line);
    background: #effbd8;
    color: var(--green-dark);
    font-weight: 700;
    cursor: pointer;
    font-size: 18px;
}

.green-btn.tiny {
    min-width: 96px;
    min-height: 40px;
    font-size: 14px;
}

.green-btn:hover,
.send-btn:hover {
    background: #dbf2b4;
}

.window-layer {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 90;
}

.blue-btn {
    min-width: 138px;
    padding: 0 16px;
    border: 3px solid #4a90e2;
    background: #d4e8f7;
    color: #1a5fb4;
    font-weight: 700;
    cursor: pointer;
    font-size: 18px;
}

.blue-btn.tiny {
    min-width: 96px;
    min-height: 40px;
    font-size: 14px;
}

.blue-btn:hover {
    background: #bbddf5;
}

.window-panel {
    position: absolute;
    border: 3px solid var(--green-line);
    background: var(--panel-bg);
    box-shadow: var(--panel-shadow);
    min-width: 260px;
    z-index: 120;
}

.floating-window {
    pointer-events: auto;
}

.window-title {
    position: relative;
    background: #edf7db;
    border-bottom: 3px solid var(--green-line);
    padding: 8px 18px;
    font-size: 22px;
    font-weight: 700;
    text-align: center;
    color: var(--green-dark);
    user-select: none;
}

.window-close {
    position: absolute;
    right: 10px;
    top: 3px;
    font-size: 28px;
    cursor: pointer;
    color: var(--green-dark);
}

.resize-handle {
    position: absolute;
    bottom: 0;
    left: 0;
    font-size: 14px;
    cursor: sw-resize;
    color: var(--green-dark);
    user-select: none;
}

.panel-resize-handle {
    left: auto;
    right: 4px;
    bottom: 4px;
    width: 14px;
    height: 14px;
    cursor: nwse-resize;
    background:
        linear-gradient(135deg, transparent 0 52%, rgba(78, 160, 63, 0.7) 52% 60%, transparent 60% 100%),
        linear-gradient(135deg, transparent 0 68%, rgba(78, 160, 63, 0.45) 68% 76%, transparent 76% 100%);
}

.window-panel:not(.history-panel) .ui-resizable-handle {
    position: absolute;
    display: block;
}

.window-panel:not(.history-panel) .ui-resizable-se {
    right: 4px;
    bottom: 4px;
    width: 14px;
    height: 14px;
    cursor: se-resize;
}

.window-panel:not(.history-panel) .ui-icon-gripsmall-diagonal-se::before {
    content: "◢";
    position: absolute;
    right: 0;
    bottom: -1px;
    color: rgba(78, 160, 63, 0.9);
    font-size: 10px;
    line-height: 1;
}

.chat-history-resize {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-top: 2px solid rgba(111, 160, 65, .28);
    border-right: 2px solid rgba(111, 160, 65, .18);
    border-top-right-radius: 8px;
    background: rgba(255,255,255,.76);
    z-index: 2;
}

.panel-body {
    padding: 16px;
}

.profile-panel {
    width: min(480px, 92%);
    left: 50%;
    top: 118px;
    transform: translateX(-50%);
}

.intro-panel .panel-body {
    padding-bottom: 10px;
}

.history-panel {
    position: absolute;
    left: auto;
    right: 12px;
    top: 238px;
    z-index: 130;
    width: 300px;
    height: 190px;
    min-width: 220px;
    min-height: 140px;
    max-width: none;
    max-height: none;
    padding: 5px 7px 5px 5px;
    box-sizing: border-box;
    font-family: "Segoe UI", Tahoma, Verdana, sans-serif;
    font-size: 10px;
    background: #fff;
    border: 0;
    box-shadow: none;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.history-panel * {
    box-sizing: border-box;
    font-family: inherit;
}

.login-history {
    top: 130px;
    width: 300px;
    min-height: 410px;
}

.info-panel {
    left: 50%;
    top: 140px;
    transform: translateX(-50%);
    width: min(340px, 92%);
    min-height: 280px;
}

.rooms-panel {
    width: min(360px, 92%);
}

.news-panel {
    width: min(420px, 92%);
    max-height: 460px;
    overflow: hidden;
}

.tutorial-panel {
    left: 40px;
    bottom: 70px;
    width: 370px;
}

.profile-panel {
    left: 340px;
    top: 90px;
    width: min(560px, 96%);
    transform: none;
}

.profile-body {
    max-height: min(78vh, 720px);
    overflow-y: auto;
    padding-right: 4px;
}

.profile-topline {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    margin-bottom: 18px;
}

.profile-avatar-preview {
    width: 128px;
    height: 128px;
    flex: 0 0 128px;
    object-fit: cover;
    border: 2px solid #d7efba;
    background: rgba(255,255,255,.96);
    padding: 3px;
    border-radius: 18px;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.14);
}

.profile-stats {
    font-size: 14px;
    line-height: 1.5;
}

.profile-form {
    display: grid;
    gap: 10px;
}

.profile-gallery-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.profile-gallery-note {
    font-size: 12px;
    color: #6e8260;
}

.profile-avatar-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(78px, 1fr));
    gap: 10px;
    padding: 10px;
    border: 1px solid #dcecc8;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.86);
}

.profile-avatar-card {
    position: relative;
    border: 2px solid transparent;
    border-radius: 14px;
    overflow: hidden;
    background: #f8fdf0;
    transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.profile-avatar-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 16px rgba(57, 87, 28, 0.12);
}

.profile-avatar-card.selected {
    border-color: var(--green-line);
    box-shadow: 0 0 0 2px rgba(125, 174, 73, 0.18);
}

.profile-avatar-select {
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    padding: 8px;
    border: 0;
    background: transparent;
    cursor: pointer;
}

.profile-avatar-select img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 10px;
    background: #fff;
}

.profile-avatar-tag {
    position: absolute;
    left: 6px;
    bottom: 6px;
    padding: 2px 6px;
    border-radius: 999px;
    background: rgba(34, 48, 20, 0.75);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .02em;
}

.profile-avatar-remove {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 22px;
    height: 22px;
    border: 0;
    border-radius: 50%;
    background: rgba(145, 43, 43, 0.92);
    color: #fff;
    font-size: 15px;
    line-height: 1;
    cursor: pointer;
    display: grid;
    place-items: center;
}

.profile-gallery-empty {
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px dashed #cdddbb;
    color: #6e8260;
    background: rgba(255,255,255,.72);
}

.hidden {
    display: none !important;
}

.upload-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.file-btn {
    position: relative;
    overflow: hidden;
}

.mini-status {
    padding: 0;
    min-height: 18px;
}

.movable {
    cursor: default;
}

.window-panel,
.floating-sidebar,
.me-card {
    will-change: left, top, transform;
}

.drag-handle {
    cursor: move;
}

.hidden {
    display: none !important;
}

.visible {
    display: block;
}

.history-panel.visible {
    display: flex;
}

.history-title {
    margin: 0 0 6px 0;
    padding: 3px 18px 3px 6px;
    width: auto;
    min-height: 27px;
    position: relative;
    background: #fff;
    border: 1px solid #0ca209;
    color: #0ca209;
    text-align: center;
    cursor: move;
    font-size: 1.2em;
    font-weight: 700;
    line-height: 1.55;
}

.history-panel .window-close,
.history-panel .ui-icon-close {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: none;
    width: auto;
    height: auto;
    display: inline;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: #0ca209;
    cursor: pointer;
    line-height: 1;
    font-style: normal;
    font-size: 1.2em;
    font-weight: 700;
    margin-top: -0.5em;
}

.history-body {
    width: auto;
    height: auto;
    min-height: 190px;
    max-height: none;
    flex: 1 1 190px;
    min-width: 0;
    min-height: 0;
    padding: 4px;
    overflow: auto;
    overflow-x: hidden;
    border: 1px solid #0ca209;
    background: #fff;
    color: #000;
}

.history-footer {
    margin: 4px 0 0 0;
    padding: 0 0 2px;
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    width: 100%;
    gap: 6px;
    color: #000;
    font-size: 1em;
    line-height: 1.2;
    white-space: nowrap;
    background: #fff;
}

.history-footer #clearLocalHistory {
    margin-right: auto;
}

.history-panel .ui-resizable-handle {
    position: absolute;
    display: block;
}

.history-panel .ui-resizable-e {
    top: 0;
    bottom: 0;
    right: 0;
    width: 7px;
    height: auto;
    cursor: e-resize;
}

.history-panel .ui-resizable-s {
    left: 0;
    right: 0;
    bottom: 0;
    width: auto;
    height: 7px;
    cursor: s-resize;
}

.history-panel .ui-resizable-se {
    right: 0;
    bottom: 0;
    width: 12px;
    height: 12px;
    cursor: se-resize;
    background: transparent;
}

.history-panel .ui-icon-gripsmall-diagonal-se::before {
    content: "◢";
    position: absolute;
    right: 0;
    bottom: -1px;
    color: #7e7e7e;
    font-size: 10px;
    line-height: 1;
}

.history-footer-sep {
    color: #000;
}

.system-line,
.history-message {
    margin: 0 0 8px 0;
    font-size: 1.1em;
    color: #000;
    line-height: 1.4;
    word-break: break-word;
}

.system-line {
    color: #0ca209;
}

.history-body p {
    margin: 0 0 8px 0;
    font-size: 1.1em;
    line-height: 1.4;
}

.history-body p * {
    word-wrap: break-word;
}

.history-body .status {
    color: #0ca209;
}

.history-body .me {
    font-style: italic;
}

.history-body .self {
    color: #666666;
}

.history-body .roomjoin,
.history-body .roomleave {
    color: #bf75f3;
    font-style: italic;
}

.history-body .namechange {
    color: #75a1f3;
    font-style: italic;
}

.history-body .highlight {
    color: #366AAB;
}

.history-body .warning {
    color: #d21f34;
}

.history-body .moderator-alert {
    display: block;
    font-style: italic;
    font-weight: 700;
}

.history-body .username {
    font-weight: 700;
}

.history-body .welcome-block {
    display: block;
    background: #EBF7FF;
    color: #059AE7;
}

.history-body .welcome-block a {
    color: #059AE7;
}

.history-body .group-welcome {
    display: block;
    margin-left: 50px;
    padding: 12px;
    background-repeat: no-repeat;
}

.history-body .avatar {
    height: 50px;
    width: 50px;
    float: left;
    margin: 0;
    padding: 0;
}

.history-message .meta {
    color: #999;
    font-size: 0.95em;
    display: inline-block;
    margin-right: 4px;
}

.history-notice-meta {
    margin-bottom: 2px;
}

.history-notice-meta .meta {
    display: block;
    margin-right: 0;
}

.history-notice-text {
    display: block;
    padding-left: 2px;
}

.history-message .name {
    font-weight: 700;
    color: #000;
}

.history-panel a,
.text-link {
    color: #0ca209;
    text-decoration: none;
}

.history-panel a:hover,
.text-link:hover {
    text-decoration: underline;
}

.panel-label {
    display: block;
    font-weight: 700;
    margin-bottom: 6px;
    font-size: 16px;
}

.text-input {
    width: 100%;
    height: 46px;
    border: 3px solid #e0d39c;
    padding: 0 12px;
    outline: none;
    font-size: 18px;
    background: rgba(255,255,255,.98);
}

.text-input.small {
    height: 42px;
    font-size: 16px;
}

.textarea-input {
    min-height: 90px;
    resize: vertical;
    padding-top: 10px;
    font-family: inherit;
}

.avatar-chooser {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.avatar-choice {
    width: 64px;
    height: 84px;
    border: 3px solid transparent;
    background: transparent;
    cursor: pointer;
    display: grid;
    place-items: center;
}

.avatar-choice.selected {
    border-color: var(--green-line);
    background: #eefad8;
}

.avatar-choice img,
.me-card img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.dual-buttons,
.login-row {
    display: flex;
    align-items: center;
    gap: 16px;
}

.auth-divider {
    padding: 0 16px;
    margin-top: 2px;
    font-size: 15px;
    font-weight: 700;
    color: #687e54;
}

.compact-login {
    padding-top: 10px;
}

.remember-row {
    font-size: 15px;
    display: flex;
    gap: 8px;
    align-items: center;
}

.status-line {
    padding: 0 16px 16px;
    min-height: 22px;
    font-size: 14px;
    color: #5f7d43;
}

.scene-character {
    position: absolute;
    left: 90px;
    top: 215px;
    z-index: 2;
    text-align: center;
}

.guest-left {
    left: 84px;
    top: 230px;
}

.ghost-avatar.large {
    width: 128px;
    height: 180px;
}

.ghost-avatar img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.avatar-caption {
    margin-top: 4px;
    color: rgba(66, 81, 52, .78);
    text-shadow: 0 1px 2px rgba(255,255,255,.55);
    font-size: 16px;
}

.field-overlay,
.youtube-layer {
    position: absolute;
    inset: 0;
}

.youtube-layer {
    z-index: 0;
    overflow: hidden;
    background: transparent;
    opacity: 0;
    visibility: hidden;
    transition: opacity .18s ease;
    pointer-events: auto;
}

.youtube-layer.active {
    background: #000;
    opacity: 1;
    visibility: visible;
}

.field-overlay {
    pointer-events: none;
    z-index: 1;
}

.field-overlay {
    z-index: 1;
}

.youtube-layer iframe {
    width: 100%;
    height: 100%;
    opacity: 1;
    pointer-events: auto;
    border: 0;
}

.youtube-layer video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 1;
    pointer-events: auto;
    display: block;
    background: #000;
}

.youtube-embed-host {
    position: absolute;
    inset: 0;
}

.youtube-fallback-overlay {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(10, 10, 10, 0.7);
}

.youtube-fallback-card {
    max-width: 520px;
    padding: 18px 20px;
    border: 2px solid rgba(255,255,255,0.22);
    border-radius: 18px;
    background: rgba(18, 20, 24, 0.9);
    color: #fff;
    text-align: center;
    box-shadow: 0 16px 34px rgba(0,0,0,0.28);
}

.youtube-fallback-card strong {
    display: block;
    margin-bottom: 10px;
    font-size: 18px;
}

.youtube-fallback-card p {
    margin: 0 0 12px;
    line-height: 1.45;
}

.youtube-fallback-btn {
    min-width: 180px;
}

.youtube-fallback-note {
    margin-top: 10px;
    font-size: 12px;
    color: rgba(255,255,255,0.76);
}


.field-overlay {
    background: linear-gradient(180deg, rgba(255,255,255,.03), rgba(255,255,255,.015));
    pointer-events: none;
}

.avatar-item {
    user-select: none;
    -webkit-user-select: none;
    pointer-events: none;
    position: absolute;
    width: 182px;
    height: 182px;
    overflow: visible;
    transition: left 1.2s cubic-bezier(.22,.61,.36,1), top 1.2s cubic-bezier(.22,.61,.36,1);
    user-select: none;
    z-index: 2;
}

.avatar-item .avatar-sprite {
    pointer-events: none;
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100%;
    width: max-content;
    object-fit: cover;
    object-position: center bottom;
    display: block;
    filter: drop-shadow(0 8px 10px rgba(0,0,0,.15));
    user-select: none;
    -webkit-user-drag: none;
}

.avatar-item .avatar-name {
    user-select: none;
    -webkit-user-select: none;
    pointer-events: none;
    position: absolute;
    left: 50%;
    bottom: 13px;
    transform: translateX(-50%);
    width: max-content;
    max-width: 150px;
    text-align: center;
    color: #fff;
    font-weight: 800;
    font-size: 22px;
    letter-spacing: .3px;
    line-height: 1;
    padding: 0 4px;
    border-radius: 6px;
    z-index: 20;
    -webkit-text-stroke: 2px #111;
    paint-order: stroke fill;
    text-shadow:
        2px 0 0 #111,
        -2px 0 0 #111,
        0 2px 0 #111,
        0 -2px 0 #111,
        2px 2px 0 #111,
        -2px 2px 0 #111,
        2px -2px 0 #111,
        -2px -2px 0 #111,
        0 3px 8px rgba(0,0,0,.35);
    pointer-events: auto;
    display: block;
    background: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.avatar-item .avatar-name.compact {
    font-size: 19px;
}

.avatar-item .avatar-name.tight {
    font-size: 17px;
}

.chat-bubble {
    position: absolute;
    left: 108px;
    top: 4px;
    max-width: 220px;
    background: var(--user-bubble);
    border: 2px solid var(--green-line);
    border-radius: 16px;
    padding: 8px 12px;
    font-size: 14px;
    box-shadow: 0 12px 28px rgba(0,0,0,.09);
    color: #567245;
}

.chat-bubble::after {
    content: "";
    position: absolute;
    left: -8px;
    top: 18px;
    width: 14px;
    height: 14px;
    background: var(--user-bubble);
    border-left: 2px solid var(--green-line);
    border-bottom: 2px solid var(--green-line);
    transform: rotate(45deg);
}

.simple-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 300px;
    overflow-y: auto;
}

.simple-row,
.room-row,
.news-card,
.comment-row {
    border: 2px solid #d7efba;
    background: rgba(250,255,245,.96);
    padding: 10px;
}

.simple-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.simple-row img {
    width: 38px;
    height: 38px;
    object-fit: contain;
}

.simple-role,
.simple-ap {
    font-size: 12px;
    color: var(--text-soft);
}

.room-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.room-row .room-name {
    font-weight: 700;
}

.room-row .room-meta {
    font-size: 12px;
    color: var(--text-soft);
}

.room-row button {
    min-width: 90px;
}

.news-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 260px;
    overflow-y: auto;
    margin-top: 12px;
}

.news-card .news-title {
    font-weight: 700;
    margin-bottom: 6px;
    color: var(--green-dark);
}

.news-card .news-meta {
    font-size: 12px;
    color: var(--text-soft);
    margin-bottom: 8px;
}

.news-card .news-content {
    white-space: pre-wrap;
    font-size: 14px;
    line-height: 1.45;
}

.news-card .news-comments {
    margin-top: 10px;
    border-top: 1px dashed #bddf92;
    padding-top: 10px;
}

.comment-row {
    padding: 8px;
    margin-bottom: 8px;
    font-size: 13px;
}

.comment-form {
    display: flex;
    gap: 6px;
    margin-top: 8px;
}

.comment-form input {
    flex: 1;
    height: 38px;
    font-size: 14px;
}

.mini-form {
    display: flex;
    gap: 8px;
    align-items: center;
}

.mini-form.stacked {
    display: grid;
    grid-template-columns: 1fr;
}

.mini-form + .mini-form {
    margin-top: 8px;
}

.moderator-form .textarea-input {
    min-height: 86px;
}

.user-corner {
    position: fixed;
    left: 12px;
    top: 42px;
    width: 240px;
    height: 96px;
    z-index: 21;
}

.video-bottom-control {
    position: fixed;
    left: 50%;
    bottom: 72px;
    transform: translateX(-50%);
    z-index: 36;
    width: min(760px, calc(100vw - 320px));
    min-width: 420px;
    padding: 8px 12px;
    border: 2px solid var(--green-line);
    border-radius: 14px;
    background: rgba(255,255,255,.92);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
}

.video-bottom-main {
    display: grid;
    gap: 8px;
}

.video-bottom-head,
.video-bottom-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.video-bottom-title {
    font-size: 12px;
    font-weight: 800;
    color: var(--green-dark);
    letter-spacing: .03em;
    text-transform: uppercase;
}

.video-bottom-state,
.video-time-label {
    font-size: 12px;
    color: var(--text-soft);
    white-space: nowrap;
}

.video-progress {
    width: 100%;
    margin: 0;
}

.video-bottom-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: nowrap;
}

.video-bottom-actions .green-btn {
    min-width: 68px;
    justify-content: center;
}

.video-volume-panel {
    display: grid;
    grid-template-columns: auto minmax(140px, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 2px 2px 0;
}

.video-volume-label,
.video-volume-value {
    font-size: 12px;
    color: var(--text-soft);
    white-space: nowrap;
}

.video-volume-slider {
    width: 100%;
    margin: 0;
}

.me-card {
    position: absolute;
    left: 0;
    top: 0;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border: 2px solid var(--green-line);
    background: rgba(255,255,255,.88);
    min-width: 210px;
}

.me-card img {
    width: 52px;
    height: 52px;
    object-fit: contain;
}

.me-name {
    font-weight: 700;
    color: var(--green-dark);
}

.me-meta {
    font-size: 13px;
    color: var(--text-soft);
}

.mini-drag {
    align-self: stretch;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #7ba557;
    padding: 0 2px;
    cursor: move;
    user-select: none;
}

.avatar-item.moving .avatar-sprite {
    animation: avatarWalk .42s ease-in-out infinite alternate;
}

@keyframes avatarWalk {
    from {
        transform: translateY(0) rotate(-1.25deg) scaleX(1);
    }
    to {
        transform: translateY(-2px) rotate(1.25deg) scaleX(1.01);
    }
}

.toast {
    position: absolute;
    top: 18px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9;
    padding: 12px 16px;
    border: 2px solid var(--green-line);
    background: rgba(255,255,255,.94);
    color: var(--green-dark);
    min-width: 200px;
    text-align: center;
    box-shadow: 0 14px 32px rgba(0,0,0,.08);
}

.tutorial-line {
    margin: 0 0 10px;
    line-height: 1.45;
}

@media (max-width: 1160px) {
    .chat-scene {
        width: calc(100vw - 90px);
    }

    .history-panel {
        width: 300px;
    }
}

@media (max-width: 920px) {
    .app-wrap {
        padding: 10px;
        gap: 8px;
    }

    .chat-scene {
        width: calc(100vw - 78px);
    }

    .chat-scene,
    .login-scene {
        height: 72vh;
        min-height: 540px;
    }

    .history-panel {
        width: 270px;
        top: 84px;
        min-height: 430px;
    }

    .profile-panel {
        top: 80px;
        width: 92%;
    }

    .tutorial-panel {
        width: 300px;
    }
}

@media (max-width: 760px) {
    .app-wrap {
        flex-direction: column;
    }

    .sidebar {
        width: auto;
        flex-direction: row;
        justify-content: center;
        flex-wrap: wrap;
    }

    .floating-sidebar {
        position: static;
        transform: none;
        margin: 0 auto 8px;
        width: auto;
        flex-direction: row;
        align-items: center;
    }

    .sidebar-handle {
        width: 24px;
        height: 48px;
        margin: 0 4px 0 0;
    }

    .main-stage {
        width: 100%;
        padding-left: 0;
    }

    .chat-scene {
        width: 100%;
    }

    .history-panel,
    .info-panel,
    .tutorial-panel {
        position: absolute;
        inset: auto 10px 70px 10px;
        width: auto;
        transform: none;
        max-height: none;
    }

    .video-bottom-control {
        min-width: 0;
        width: calc(100vw - 24px);
    }

    .scene-character {
        display: none;
    }

    .bottom-bar {
        flex-direction: column;
    }

    .send-btn,
    .green-btn {
        min-height: 48px;
        width: 100%;
    }
}

/* =========================
   Portal pages (screenshots-inspired theme)
   ========================= */

body.portal-page,
body.portal-home {
    min-height: 100vh;
    background: #b4e664;
}

.portal-shell {
    width: min(1240px, calc(100vw - 40px));
    margin: 22px auto 28px;
}

.portal-header {
    margin-bottom: 18px;
}

.portal-banner {
    position: relative;
    min-height: 125px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    padding: 22px 18px 16px;
    border-radius: 4px 4px 0 0;
    background:
        linear-gradient(180deg, rgba(0,0,0,.08), rgba(0,0,0,.18)),
        url("../../images/website assets/portal-banner.jpg") center center / 100% 100% no-repeat;
    overflow: hidden;
    box-shadow: 0 3px 0 rgba(84, 143, 43, .45);
}

.portal-banner::before,
.portal-banner::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(90deg, rgba(255,255,255,.08), rgba(255,255,255,0));
    opacity: .55;
}

.portal-banner::after {
    display: none;
}

.portal-logo {
    position: relative;
    z-index: 1;
    color: #fff;
    font-size: 24px;
    font-weight: 700;
    line-height: 1;
    text-shadow: 0 1px 3px rgba(0,0,0,.15);
}

.header-search-form {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 6px;
}

.header-search-input,
.header-search-scope,
.header-search-button,
.portal-search-input,
.portal-select,
.sidebar-input {
    border: 1px solid #a3a3a3;
    background: #fff;
    height: 28px;
    padding: 0 8px;
    font-size: 12px;
    color: #3e4932;
}

.header-search-input {
    width: 176px;
}

.header-search-button {
    cursor: pointer;
}

.portal-nav {
    display: flex;
    align-items: stretch;
    gap: 1px;
    padding-left: 12px;
    background: rgba(0,0,0,.08);
}

.portal-nav-link {
    position: relative;
    min-width: 58px;
    padding: 9px 13px 8px;
    text-align: center;
    font-size: 12px;
    color: #fff;
    background: linear-gradient(180deg, rgba(255,255,255,.12), rgba(255,255,255,.04));
}

.portal-nav-link.active {
    color: #4b5d3e;
    background: linear-gradient(180deg, #fbfbfb, #efefef);
}

.portal-main {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: 0;
    align-items: start;
}

.portal-content {
    background: #f0f0f0;
    border-right: 1px solid #d5d5d5;
    padding: 0;
}

.portal-sidebar {
    background: #f0f0f0;
}

.portal-section,
.sidebar-box {
    background: #f4f4f4;
    border-bottom: 1px solid #d7d7d7;
}

.portal-card,
.sidebar-box {
    padding: 18px 18px 16px;
}

.portal-page-title {
    margin: 0 0 10px;
    font-size: 22px;
    line-height: 1.2;
    color: #555;
}

.portal-lead,
.portal-card p,
.help-section p,
.help-section li,
.activity-text,
.member-active,
.group-card p,
.news-post-content p,
.shop-meta,
.shop-stock,
.market-time,
.market-seller,
.profile-status-line,
.profile-status-note,
.profile-handle,
.table-subline,
.news-post-meta,
.news-post-footer,
.group-active,
.pagination-line,
.marketplace-links,
.sidebar-box,
.sidebar-intro,
.sidebar-counter,
.portal-inline-status {
    font-size: 12px;
    line-height: 1.65;
    color: #666;
}

.portal-feature-card {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) 360px;
    gap: 22px;
    padding: 18px;
    background: #f4f4f4;
    border-bottom: 1px solid #d8d8d8;
}

.guest-entry-card {
    padding: 16px;
    border: 1px solid #d8eac2;
    background: #fbfff5;
}

.guest-entry-title {
    margin-bottom: 10px;
    font-size: 16px;
    font-weight: 700;
    color: #66804e;
}

.portal-avatar-grid {
    max-height: 210px;
    overflow: auto;
    padding: 2px;
    background: #fff;
    border: 1px solid #dcecc8;
}

.secondary-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 138px;
    text-decoration: none;
}

.portal-status {
    padding: 8px 0 0;
}

.news-post-card {
    display: grid;
    grid-template-columns: 86px minmax(0, 1fr);
    gap: 12px;
    padding: 18px;
    border-top: 1px solid #e0e0e0;
    background: #f4f4f4;
}

.news-post-card h2 {
    margin: 0 0 6px;
    font-size: 22px;
    color: #555;
}

.news-post-card h2 a,
.group-card h3 a,
.member-card h3 a,
.topic-link,
.news-post-meta a,
.news-post-footer a,
.marketplace-links a,
.sidebar-links a,
.help-section a,
.profile-status-line a {
    color: #2f9a1a;
    text-decoration: underline;
}

.news-post-thumb {
    width: 72px;
    height: 96px;
    background: #ececec;
    border: 1px solid #ddd;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.embedded-feature {
    height: 240px;
    margin: 16px auto 12px;
    border: 1px solid #ddd;
    background: linear-gradient(180deg, #fbf7f8, #f6eced);
}

.embedded-feature.feature-valentine {
    position: relative;
    max-width: 390px;
    background:
        radial-gradient(circle at 16% 22%, rgba(243,196,211,.65) 0 34px, transparent 35px),
        radial-gradient(circle at 82% 28%, rgba(243,196,211,.55) 0 32px, transparent 33px),
        radial-gradient(circle at 76% 74%, rgba(243,196,211,.45) 0 52px, transparent 53px),
        linear-gradient(180deg, #fff9fb, #f7ecef);
}

.embedded-feature.feature-valentine::before {
    content: "";
    position: absolute;
    left: 104px;
    top: 16px;
    width: 180px;
    height: 210px;
    background:
        radial-gradient(circle at 45% 22%, #f7edd0 0 44px, transparent 45px),
        radial-gradient(circle at 35% 18%, #d4c88d 0 8px, transparent 9px),
        radial-gradient(circle at 58% 18%, #d4c88d 0 8px, transparent 9px),
        radial-gradient(circle at 43% 21%, #2e6431 0 5px, transparent 6px),
        radial-gradient(circle at 57% 21%, #2e6431 0 5px, transparent 6px),
        radial-gradient(circle at 48% 33%, #ffb7b2 0 10px, transparent 11px),
        linear-gradient(180deg, #efe0f3 0 47%, #f8e0e2 47% 100%),
        radial-gradient(circle at 18% 78%, #b44f2e 0 30px, transparent 31px),
        linear-gradient(140deg, transparent 0 53%, #9a2430 54% 59%, transparent 60%),
        linear-gradient(35deg, transparent 0 47%, #9a2430 48% 53%, transparent 54%);
    filter: drop-shadow(0 6px 8px rgba(0,0,0,.08));
}

.embedded-feature.feature-pokemon {
    background:
        radial-gradient(circle at 18% 18%, rgba(255,255,255,.55) 0 36px, transparent 37px),
        linear-gradient(180deg, #78b6ff 0 42%, #fff 42% 58%, #ff5858 58% 100%);
}

.news-post-footer {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.compact-top-gap {
    border-top: 1px solid #e0e0e0;
}

.soft-card {
    background: #f4f8ef;
}

.feature-bullets {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.feature-bullets span {
    padding: 6px 10px;
    border: 1px solid #d4e7bd;
    background: #fff;
    font-size: 12px;
    color: #64804b;
}

.sidebar-title {
    margin: -18px -18px 14px;
    padding: 7px 10px;
    font-size: 12px;
    color: #555;
    background: #dcdcdc;
}

.sidebar-user {
    display: flex;
    gap: 10px;
    align-items: center;
}

.sidebar-user img {
    width: 46px;
    height: 46px;
    object-fit: contain;
    background: #fff;
    border: 1px solid #ddd;
}

.sidebar-actions.stack {
    display: grid;
    gap: 8px;
    margin-top: 12px;
}

.full-btn {
    width: 100%;
}

.sidebar-links {
    display: grid;
    gap: 4px;
}

.top-chatters-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2px;
}

.top-chatter-slot {
    width: 44px;
    height: 44px;
    background: #eee;
    border: 1px solid #ddd;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    text-decoration: none;
    color: #628340;
    font-weight: 700;
}

.top-chatter-slot img {
    width: 44px;
    height: 44px;
    display: block;
    flex: 0 0 44px;
    object-fit: fill;
}

.partner-card,
.error-card {
    min-height: 82px;
    border: 1px solid #d1d1d1;
    background: #fff;
    display: grid;
    place-items: center;
    font-weight: 700;
    color: #444;
}

.error-card {
    font-size: 18px;
    line-height: 1.3;
}

.login-box label {
    display: block;
    margin-bottom: 4px;
    font-size: 12px;
    color: #444;
}

.sidebar-form {
    display: grid;
    gap: 8px;
}

.remember-row.compact {
    margin: 0;
}

.shop-grid,
.market-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 22px 28px;
}

.shop-card,
.market-card {
    text-align: center;
}

.shop-icon,
.market-avatar {
    height: 112px;
    border: 1px solid #d2d2d2;
    background: #fff;
    display: grid;
    place-items: center;
    font-size: 52px;
    margin-bottom: 10px;
}

.market-avatar img {
    max-width: 82%;
    max-height: 82%;
    object-fit: contain;
}

.shop-card h3,
.market-price,
.market-time,
.market-seller,
.group-card h3,
.member-card h3,
.activity-meta,
.topic-link,
.profile-handle {
    margin: 0 0 6px;
}

.shop-price,
.market-price {
    display: inline-block;
    padding: 0 4px;
    background: #d9f0c0;
    color: #2f9a1a;
    text-decoration: underline;
    font-size: 12px;
}

.marketplace-topbar,
.activity-header-row,
.directory-header-row {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: flex-start;
    margin-bottom: 8px;
}

.inline-search {
    display: flex;
    gap: 6px;
    align-items: center;
}

.portal-search-input {
    min-width: 180px;
}

.pagination-line {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin: 6px 0 14px;
}

.pagination-line a {
    color: #2f9a1a;
    text-decoration: underline;
}

.pagination-line a.active {
    font-weight: 700;
}

.pagination-line.muted {
    color: #888;
}

.activity-filter-bar,
.profile-filter {
    display: flex;
    gap: 8px;
    align-items: center;
}

.notification-section {
    display: grid;
    gap: 10px;
}

.notification-row {
    align-items: center;
}

.notification-row-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.notification-row-actions form {
    margin: 0;
}

.activity-feed,
.group-list,
.member-list,
.profile-activity-feed {
    display: grid;
    gap: 10px;
}

.activity-row,
.group-card,
.member-card,
.profile-activity-item {
    display: grid;
    gap: 12px;
    align-items: start;
    padding: 12px 0;
    border-top: 1px solid #e1e1e1;
}

.activity-row {
    grid-template-columns: 34px minmax(0, 1fr);
}

.activity-icon,
.group-thumb,
.profile-avatar-large {
    border: 1px solid #e1e1e1;
    background: #f7f7f7;
}

.activity-icon,
.group-thumb {
    width: 32px;
    height: 32px;
}

.portal-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.portal-table th,
.portal-table td {
    padding: 10px 6px;
    border-top: 1px solid #e2e2e2;
    text-align: left;
    vertical-align: top;
    color: #555;
}

.portal-table th:nth-child(2),
.portal-table td:nth-child(2) {
    width: 110px;
}

.portal-table th:nth-child(3),
.portal-table td:nth-child(3) {
    width: 190px;
}

.topic-link {
    font-weight: 700;
    text-decoration: none;
}

.group-card {
    grid-template-columns: 34px minmax(0, 1fr) 170px;
}

.group-meta,
.member-preview-link {
    font-size: 12px;
    color: #777;
    text-align: right;
}

.member-card {
    grid-template-columns: 34px minmax(0, 1fr) 80px;
}

.member-avatar {
    width: 34px;
    height: 34px;
    border: 1px solid #ddd;
    background: #fff;
    display: grid;
    place-items: center;
}

.member-avatar img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.member-quote {
    margin-bottom: 6px;
    font-size: 12px;
    color: #777;
}

.help-card {
    padding-bottom: 26px;
}

.help-section {
    margin-top: 16px;
}

.help-section h2 {
    margin: 0 0 8px;
    font-size: 18px;
    color: #555;
}

.help-section ul {
    margin: 0;
    padding-left: 18px;
}

.profile-card {
    padding-top: 12px;
}

.profile-hero {
    display: grid;
    grid-template-columns: 90px minmax(0, 1fr);
    gap: 18px;
    padding-bottom: 16px;
    border-bottom: 1px solid #dedede;
}

.profile-avatar-large {
    width: 350px;
    height: 350px;
}

.profile-hero-main .portal-page-title {
    margin-bottom: 6px;
}

.profile-handle span {
    display: inline-block;
    margin-left: 8px;
    padding: 1px 6px;
    background: #e8eccb;
    color: #809060;
    font-size: 11px;
}

.profile-tabs,
.profile-subtabs {
    display: flex;
    gap: 2px;
    flex-wrap: wrap;
    margin-top: 12px;
}

.profile-tabs a,
.profile-subtabs a {
    padding: 7px 10px;
    font-size: 12px;
    background: #f4f4f4;
    color: #3e8f1c;
    border: 1px solid #e2e2e2;
}

.profile-tabs a.active,
.profile-subtabs a.active {
    background: #fff;
    color: #5a5a5a;
}

.profile-tabs span {
    display: inline-block;
    min-width: 14px;
    text-align: center;
    padding: 0 3px;
    border-radius: 8px;
    background: #1b8fd5;
    color: #fff;
    font-size: 10px;
}

.profile-subtabs {
    align-items: center;
    justify-content: space-between;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.profile-discussion-shell {
    margin-top: 24px;
    padding: 18px;
    background: linear-gradient(180deg, #fffdf8, #f8f3e7);
    border: 1px solid #e3d8bf;
    border-radius: 18px;
}

.profile-discussion-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.profile-discussion-head h2 {
    margin: 0 0 4px;
    font-size: 22px;
}

.profile-discussion-head p {
    margin: 0;
    color: #6b6355;
}

.profile-comment-count {
    padding: 8px 12px;
    border-radius: 999px;
    background: #efe5cf;
    color: #6d5230;
    font-weight: 700;
    white-space: nowrap;
}

.profile-comment-form {
    display: grid;
    gap: 10px;
}

.profile-comment-form.composer {
    margin-bottom: 18px;
}

.profile-comment-form.inline {
    margin-top: 12px;
}

.profile-comment-login-note {
    margin-bottom: 18px;
    padding: 12px 14px;
    border-radius: 14px;
    background: #fff7dd;
    border: 1px solid #e4d09d;
    color: #73571c;
}

.profile-comment-list {
    display: grid;
    gap: 14px;
}

.profile-comment-card {
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr);
    gap: 12px;
    padding: 14px;
    margin-left: calc(var(--comment-depth, 0) * 18px);
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #e5dac2;
    border-radius: 16px;
    box-shadow: 0 10px 24px rgba(93, 66, 26, 0.08);
}

.profile-comment-vote {
    display: grid;
    align-content: start;
    justify-items: center;
    gap: 6px;
    color: #8f7a56;
    font-size: 13px;
    font-weight: 700;
}

.profile-comment-vote strong {
    color: #5b4424;
}

.profile-comment-main {
    min-width: 0;
}

.profile-comment-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 12px;
    color: #72695c;
}

.profile-comment-meta img {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
}

.profile-comment-meta strong {
    color: #2d2d2d;
}

.profile-comment-text {
    color: #322a20;
    line-height: 1.55;
    word-break: break-word;
}

.profile-reply-box {
    margin-top: 10px;
}

.profile-reply-box summary {
    cursor: pointer;
    color: #287f30;
    font-weight: 700;
}

.profile-comment-children {
    display: grid;
    gap: 12px;
    margin-top: 12px;
}

.profile-activity-item {
    padding-top: 16px;
}

.profile-activity-item.media-item {
    padding-top: 14px;
}

.profile-media-preview {
    position: relative;
    height: 220px;
    margin-top: 10px;
    background:
        linear-gradient(180deg, rgba(255,255,255,.08), rgba(255,255,255,0)),
        linear-gradient(180deg, #c8b8e2, #8c9dd3);
    border: 1px solid #d0d0d0;
}

.profile-media-preview::before {
    content: "";
    position: absolute;
    inset: 24px 28px 38px 28px;
    background:
        radial-gradient(circle at 36% 36%, #fce8d4 0 16px, transparent 17px),
        radial-gradient(circle at 42% 36%, #fce8d4 0 16px, transparent 17px),
        radial-gradient(circle at 38% 43%, #b63c45 0 28px, transparent 29px),
        radial-gradient(circle at 62% 78%, #f7f7f7 0 18px, transparent 19px),
        linear-gradient(180deg, #f4cbdb, #f1c7df);
    border: 1px solid rgba(255,255,255,.45);
}

.play-button {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 74px;
    height: 52px;
    border-radius: 10px;
    background: rgba(0,0,0,.7);
    color: #fff;
    display: grid;
    place-items: center;
    font-size: 26px;
}

.portal-toast-holder {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 1000;
    display: grid;
    gap: 8px;
}

.portal-toast {
    min-width: 220px;
    padding: 10px 12px;
    border: 1px solid #8ecf63;
    background: rgba(255,255,255,.98);
    color: #557642;
    box-shadow: 0 12px 20px rgba(0,0,0,.08);
    opacity: 0;
    transform: translateY(10px);
    transition: opacity .18s ease, transform .18s ease;
    font-size: 12px;
}

.portal-toast.show {
    opacity: 1;
    transform: translateY(0);
}

@media (max-width: 1100px) {
    .portal-shell {
        width: calc(100vw - 24px);
        margin: 12px auto 20px;
    }

    .portal-main {
        grid-template-columns: 1fr;
    }

    .portal-content {
        border-right: 0;
    }

    .shop-grid,
    .market-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .portal-banner {
        flex-direction: column;
        align-items: flex-start;
        padding-right: 12px;
    }

    .portal-banner::after {
        opacity: .35;
        transform: scale(.72);
        transform-origin: top left;
    }

    .portal-nav {
        flex-wrap: wrap;
    }

    .portal-feature-card,
    .group-card,
    .member-card,
    .profile-hero {
        grid-template-columns: 1fr;
    }

    .news-post-card {
        grid-template-columns: 1fr;
    }

    .news-post-thumb {
        display: none;
    }

    .shop-grid,
    .market-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dm-page-grid,
    .group-profile-head {
        grid-template-columns: 1fr;
    }

    .dm-call-panel-head {
        align-items: stretch;
    }

    .directory-header-row,
    .activity-header-row,
    .marketplace-topbar,
    .inline-search,
    .header-search-form,
    .profile-subtabs {
        flex-direction: column;
        align-items: stretch;
    }

    .header-search-input,
    .portal-search-input {
        width: 100%;
    }
}

.portal-alert {
    margin: 16px 18px 0;
    padding: 12px 14px;
    border: 1px solid #9acf7d;
    background: #f7fff1;
    color: #577544;
    border-radius: 12px;
    font-size: 13px;
}

.portal-alert.error {
    border-color: #e7b0b0;
    background: #fff4f4;
    color: #8a4444;
}

.portal-empty-state {
    padding: 14px;
    border: 1px dashed #d4d4d4;
    border-radius: 12px;
    background: rgba(255,255,255,.55);
    color: #666;
    font-size: 13px;
}

.portal-empty-state.soft {
    padding: 10px 12px;
    margin-top: 8px;
}

.sidebar-empty-note {
    display: block;
    font-size: 12px;
    color: #767676;
}

.portal-split-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(300px, .9fr);
    gap: 16px;
}

.portal-form-grid {
    display: grid;
    gap: 8px;
}

.inline-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.compact-gap {
    margin-top: 8px;
}

.inline-badge,
.badge-row span {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    border-radius: 999px;
    background: #f1f7eb;
    border: 1px solid #d1e2c2;
    color: #5a7348;
    font-size: 12px;
}

.detail-stack {
    display: grid;
    gap: 12px;
}

.badge-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.portal-divider {
    border: 0;
    border-top: 1px solid rgba(0,0,0,.08);
    margin: 16px 0;
}

.section-title,
.small-title {
    margin-bottom: 10px;
}

.topic-thread-card,
.reply-card {
    padding: 12px;
    border-radius: 12px;
    border: 1px solid rgba(0,0,0,.08);
    background: rgba(255,255,255,.7);
}

.reply-stack {
    display: grid;
    gap: 10px;
}

.profile-edit-form {
    margin-top: 14px;
}

@media (max-width: 1100px) {
    .portal-split-grid {
        grid-template-columns: 1fr;
    }
}


.auth-accordion {
    margin-top: 10px;
    border: 1px solid #d7d7d7;
    background: #fafafa;
}

.auth-accordion summary {
    display: block;
    cursor: pointer;
    list-style: none;
    padding: 8px 10px;
    font-size: 12px;
    font-weight: 700;
    color: #4f6940;
    background: linear-gradient(180deg, #fbfff7, #eef7e2);
}

.auth-accordion summary::-webkit-details-marker {
    display: none;
}

.auth-accordion summary::after {
    content: '▾';
    float: right;
    color: #6f8c58;
}

.auth-accordion[open] summary::after {
    content: '▴';
}

.auth-accordion-body {
    padding: 10px;
}

.shop-card-rich {
    display: grid;
    gap: 6px;
    align-content: start;
}

.shop-choice {
    margin-top: 6px;
    text-align: left;
}

.shop-choice summary {
    display: block;
    list-style: none;
}

.shop-choice summary::-webkit-details-marker {
    display: none;
}

.shop-choice-body {
    margin-top: 10px;
    padding: 10px;
    border: 1px solid #d8e7cb;
    border-radius: 12px;
    background: rgba(255,255,255,.8);
}

.shop-choice-body p {
    margin: 0 0 10px;
    font-size: 12px;
    line-height: 1.6;
    color: #666;
}

.profile-bg-preview {
    position: relative;
    border: 1px solid #d8e4ca;
    border-radius: 14px;
    padding: 12px;
    background: linear-gradient(180deg, rgba(255,255,255,.94), rgba(247,251,241,.92));
    background-size: cover;
    background-position: center center;
    overflow: hidden;
}

.profile-bg-preview::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(255,255,255,.18), rgba(255,255,255,.62));
    pointer-events: none;
}

.profile-bg-preview > * {
    position: relative;
    z-index: 1;
}

.profile-color-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px 12px;
    align-items: center;
    padding: 10px 12px;
    border: 1px solid #d8e4ca;
    border-radius: 12px;
    background: rgba(255,255,255,.72);
}

.profile-color-grid .panel-label {
    margin: 0;
}

.profile-color-grid input[type="color"] {
    width: 52px;
    height: 34px;
    padding: 2px;
    border: 1px solid #cfdcc2;
    background: #fff;
    cursor: pointer;
}

.bubble-wrap {
    position: absolute;
    right: -12px;
    top: -38px;
    width: 240px;
    min-height: 1px;
    display: flex;
    justify-content: flex-end;
    pointer-events: none;
    z-index: 12;
}

.chat-bubble {
    position: relative;
    z-index: 2;
    left: auto;
    top: auto;
    max-width: 220px;
    background: var(--user-bubble);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 18px;
    padding: 10px 18px;
    font-size: 15px;
    line-height: 1.35;
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.2);
    color: #4a5c39;
    word-break: break-word;
    font-family: 'Segoe UI', 'Arial', sans-serif;
    font-weight: 500;
    letter-spacing: 0.01em;
    margin-bottom: 4px;
    backdrop-filter: blur(10px);
    transition: transform 120ms ease, opacity 120ms ease;
}

.chat-bubble::after {
    content: '';
    position: absolute;
    left: -12px;
    top: 18px;
    width: 18px;
    height: 18px;
    background: var(--user-bubble);
    border-left: 1px solid rgba(255, 255, 255, 0.18);
    border-bottom: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 3px;
    transform: rotate(45deg);
    z-index: 1;
}

.chat-bubble.typing {
    opacity: .94;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-width: 58px;
}

.chat-bubble.typing span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(74, 92, 57, 0.82);
    animation: chatTypingPulse 1s ease-in-out infinite;
}

.chat-bubble.typing span:nth-child(2) {
    animation-delay: .16s;
}

.chat-bubble.typing span:nth-child(3) {
    animation-delay: .32s;
}

@keyframes chatTypingPulse {
    0%, 80%, 100% {
        transform: translateY(0) scale(.85);
        opacity: .45;
    }

    40% {
        transform: translateY(-2px) scale(1);
        opacity: 1;
    }
}

.avatar-item {
    width: 152px;
    height: 152px;
}

.avatar-item .avatar-name {
    bottom: 3px;
}

.avatar-premium {
    position: absolute;
    left: 50%;
    bottom: -24px;
    transform: translateX(-50%);
    padding: 2px 8px;
    border-radius: 999px;
    background: linear-gradient(180deg, #fff7bf, #f5cf5f);
    border: 1px solid #d5aa34;
    color: #6e5110;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(0,0,0,.08);
}

@media (max-width: 920px) {
    .bubble-wrap {
        right: -74px;
        width: 180px;
    }

    .chat-bubble {
        max-width: 176px;
        font-size: 13px;
    }
}

/* =========================
   Classic portal theme
   ========================= */

body.theme-anime.portal-page,
body.theme-anime.portal-home {
    background-color: #eaeaea;
    background-image: linear-gradient(180deg, #d8d8d8 0, #efefef 170px, #eaeaea 171px);
    background-repeat: repeat-x;
    background-position: top left;
    color: #555;
    font-size: 12px;
    font-family: Arial, Tahoma, Verdana, sans-serif;
    line-height: 170%;
    width: 95%;
    max-width: 1250px;
    margin: 0 auto;
}

body.theme-anime.portal-page a,
body.theme-anime.portal-home a {
    color: #1fb3dd;
}

body.theme-anime.portal-page a:hover,
body.theme-anime.portal-page a:active,
body.theme-anime.portal-home a:hover,
body.theme-anime.portal-home a:active {
    color: #888;
}

body.theme-anime.portal-page .portal-shell,
body.theme-anime.portal-home .portal-shell {
    width: 100%;
    margin: 0 auto;
    padding: 19px 0 20px;
}

body.theme-anime.portal-page .padder,
body.theme-anime.portal-home .padder {
    padding: 19px;
}

body.theme-anime.portal-page #container,
body.theme-anime.portal-home #container {
    background: #fff;
    border-right: 1px solid #e0e0e0;
    border-bottom: 1px solid #e0e0e0;
    border-radius: 6px;
    overflow: hidden;
    position: relative;
    width: 100%;
}

body.theme-anime.portal-page #header,
body.theme-anime.portal-home #header {
    background:
        linear-gradient(180deg, rgba(31, 179, 221, 0.12), rgba(57, 76, 121, 0.2)),
        url("../../images/website assets/portal-banner.jpg") center center / 100% 100% no-repeat;
    border-bottom-left-radius: 6px;
    border-bottom-right-radius: 6px;
    color: #fff;
    margin-bottom: 20px;
    padding-top: 25px;
    position: relative;
    z-index: 1000;
}

body.theme-anime.portal-page .portal-header,
body.theme-anime.portal-home .portal-header,
body.theme-anime.portal-page .portal-banner,
body.theme-anime.portal-home .portal-banner {
    margin: 0;
    min-height: 0;
    box-shadow: none;
    border-radius: 0;
    background: transparent;
}

body.theme-anime.portal-page .portal-banner,
body.theme-anime.portal-home .portal-banner {
    display: block;
    padding-top: 0;
    padding-bottom: 0;
}

body.theme-anime.portal-page .portal-banner::before,
body.theme-anime.portal-page .portal-banner::after,
body.theme-anime.portal-home .portal-banner::before,
body.theme-anime.portal-home .portal-banner::after {
    display: none;
}

body.theme-anime.portal-page #header h1,
body.theme-anime.portal-home #header h1 {
    float: left;
    margin: 0;
}

body.theme-anime.portal-page .portal-logo,
body.theme-anime.portal-home .portal-logo {
    color: #fff;
    font-size: 26px;
    font-weight: normal;
    text-decoration: none;
    text-shadow: none;
}

body.theme-anime.portal-page #search-bar,
body.theme-anime.portal-home #search-bar {
    margin-top: 5px;
    text-align: right;
    width: 100%;
}

body.theme-anime.portal-page #search-bar .padder,
body.theme-anime.portal-home #search-bar .padder {
    padding: 10px 15px 0 20px;
    height: auto;
}

body.theme-anime.portal-page .header-search-form,
body.theme-anime.portal-home .header-search-form {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

body.theme-anime.portal-page .header-search-input,
body.theme-anime.portal-page .header-search-scope,
body.theme-anime.portal-home .header-search-input,
body.theme-anime.portal-home .header-search-scope {
    border: 1px inset #888;
    border-radius: 3px;
    margin-right: 4px;
    padding: 2px 6px;
    height: 24px;
    color: #555;
}

body.theme-anime.portal-page .header-search-form .header-search-button,
body.theme-anime.portal-home .header-search-form .header-search-button {
    font-size: 11px;
    padding: 1px 4px;
    margin-left: 4px;
}

body.theme-anime.portal-page #navigation,
body.theme-anime.portal-home #navigation {
    position: relative;
    width: 100%;
}

body.theme-anime.portal-page #navigation::after,
body.theme-anime.portal-home #navigation::after {
    content: "";
    display: block;
    clear: both;
}

body.theme-anime.portal-page #nav,
body.theme-anime.portal-home #nav {
    margin: 40px 20px 0 0;
    padding: 0;
    list-style: none;
    float: right;
    background: transparent;
    display: block;
}

body.theme-anime.portal-page #nav > li,
body.theme-anime.portal-home #nav > li {
    margin-left: 5px;
    display: inline-block;
    float: left;
}

body.theme-anime.portal-page #nav > li > a,
body.theme-anime.portal-home #nav > li > a {
    display: block;
    padding: 5px 15px;
    background: rgba(0, 0, 0, 0.38);
    color: #fff;
    text-decoration: none;
    text-align: left;
    border-top-left-radius: 3px;
    border-top-right-radius: 3px;
}

body.theme-anime.portal-page #nav > li.selected > a,
body.theme-anime.portal-page #nav > li > a.active,
body.theme-anime.portal-home #nav > li.selected > a,
body.theme-anime.portal-home #nav > li > a.active {
    background: #f5f5f5;
    color: #4d4d4d;
}

body.theme-anime.portal-page .portal-main,
body.theme-anime.portal-home .portal-main {
    display: block;
    align-items: unset;
    gap: 0;
}

body.theme-anime.portal-page #content,
body.theme-anime.portal-home #content {
    float: left;
    width: 100%;
    background: transparent;
    border-radius: 6px 6px 0 0;
    border-right: 0;
    padding: 0;
}

body.theme-anime.portal-page #content > .padder,
body.theme-anime.portal-home #content > .padder {
    border-right: 1px solid #ddd;
    border-top-left-radius: 6px;
    border-bottom-left-radius: 6px;
    margin-right: 225px;
}

body.theme-anime.portal-page #sidebar,
body.theme-anime.portal-home #sidebar {
    float: left;
    width: 224px;
    margin-left: -226px;
    margin-top: 1px;
    border-left: 1px solid #ddd;
    border-top-right-radius: 3px;
    background: transparent;
}

body.theme-anime.portal-page #sidebar > .padder,
body.theme-anime.portal-home #sidebar > .padder {
    padding: 0 19px 19px;
}

body.theme-anime.portal-page .portal-section,
body.theme-anime.portal-home .portal-section,
body.theme-anime.portal-page .portal-card,
body.theme-anime.portal-home .portal-card {
    background: transparent;
    border: 0;
    padding: 0;
}

body.theme-anime.portal-page .portal-section + .portal-section,
body.theme-anime.portal-home .portal-section + .portal-section {
    margin-top: 19px;
}

body.theme-anime.portal-page .sidebar-box,
body.theme-anime.portal-home .sidebar-box {
    background: transparent;
    border: 0;
    padding: 19px 0 0;
}

body.theme-anime.portal-page .sidebar-box:first-child,
body.theme-anime.portal-home .sidebar-box:first-child {
    padding-top: 0;
}

body.theme-anime.portal-page .sidebar-title,
body.theme-anime.portal-home .sidebar-title {
    background: #eaeaea;
    clear: left;
    padding: 5px 15px;
    font-size: 12px;
    margin: 0 0 10px;
    color: #555;
}

body.theme-anime.portal-page .portal-page-title,
body.theme-anime.portal-home .portal-page-title {
    color: #555;
    font-size: 28px;
    margin: 5px 0 25px;
    line-height: 1.2;
}

body.theme-anime.portal-page h2,
body.theme-anime.portal-home h2 {
    font-size: 24px;
    margin: 5px 0 20px;
    color: #555;
}

body.theme-anime.portal-page h3,
body.theme-anime.portal-home h3 {
    font-size: 20px;
    margin: 5px 0 15px;
}

body.theme-anime.portal-page h4,
body.theme-anime.portal-home h4 {
    font-size: 16px;
    margin: 5px 0 15px;
}

body.theme-anime.portal-page p,
body.theme-anime.portal-home p {
    margin-bottom: 15px;
}

body.theme-anime.portal-page p:last-child,
body.theme-anime.portal-home p:last-child {
    margin-bottom: 0;
}

body.theme-anime.portal-page .portal-lead,
body.theme-anime.portal-page .portal-card p,
body.theme-anime.portal-page .help-section p,
body.theme-anime.portal-page .help-section li,
body.theme-anime.portal-page .activity-text,
body.theme-anime.portal-page .member-active,
body.theme-anime.portal-page .group-card p,
body.theme-anime.portal-page .news-post-content p,
body.theme-anime.portal-page .shop-meta,
body.theme-anime.portal-page .shop-stock,
body.theme-anime.portal-page .market-time,
body.theme-anime.portal-page .market-seller,
body.theme-anime.portal-page .profile-status-line,
body.theme-anime.portal-page .profile-status-note,
body.theme-anime.portal-page .profile-handle,
body.theme-anime.portal-page .table-subline,
body.theme-anime.portal-page .news-post-meta,
body.theme-anime.portal-page .news-post-footer,
body.theme-anime.portal-page .group-active,
body.theme-anime.portal-page .pagination-line,
body.theme-anime.portal-page .marketplace-links,
body.theme-anime.portal-page .sidebar-box,
body.theme-anime.portal-page .sidebar-intro,
body.theme-anime.portal-page .sidebar-counter,
body.theme-anime.portal-page .portal-inline-status,
body.theme-anime.portal-home .portal-lead,
body.theme-anime.portal-home .portal-card p,
body.theme-anime.portal-home .help-section p,
body.theme-anime.portal-home .help-section li,
body.theme-anime.portal-home .activity-text,
body.theme-anime.portal-home .member-active,
body.theme-anime.portal-home .group-card p,
body.theme-anime.portal-home .news-post-content p,
body.theme-anime.portal-home .shop-meta,
body.theme-anime.portal-home .shop-stock,
body.theme-anime.portal-home .market-time,
body.theme-anime.portal-home .market-seller,
body.theme-anime.portal-home .profile-status-line,
body.theme-anime.portal-home .profile-status-note,
body.theme-anime.portal-home .profile-handle,
body.theme-anime.portal-home .table-subline,
body.theme-anime.portal-home .news-post-meta,
body.theme-anime.portal-home .news-post-footer,
body.theme-anime.portal-home .group-active,
body.theme-anime.portal-home .pagination-line,
body.theme-anime.portal-home .marketplace-links,
body.theme-anime.portal-home .sidebar-box,
body.theme-anime.portal-home .sidebar-intro,
body.theme-anime.portal-home .sidebar-counter,
body.theme-anime.portal-home .portal-inline-status {
    font-size: 12px;
    line-height: 170%;
    color: #555;
}

body.theme-anime.portal-page .portal-alert,
body.theme-anime.portal-home .portal-alert,
body.theme-anime.portal-page span.activity,
body.theme-anime.portal-home span.activity {
    border: 1px solid #e1ca82;
    border-radius: 3px;
    font-weight: normal;
    text-decoration: none;
    background: linear-gradient(180deg, rgba(255,255,255,.5), rgba(255,255,255,0)), #ffeaa6;
}

body.theme-anime.portal-page .portal-alert,
body.theme-anime.portal-home .portal-alert {
    margin: 0 0 15px;
    padding: 10px 15px;
    color: #6d5a22;
    border-radius: 3px;
}

body.theme-anime.portal-page .portal-alert.error,
body.theme-anime.portal-home .portal-alert.error {
    background: #db1717;
    border-color: #a71a1a;
    color: #fff;
}

body.theme-anime.portal-page .directory-header-row,
body.theme-anime.portal-page .activity-header-row,
body.theme-anime.portal-page .marketplace-topbar,
body.theme-anime.portal-page .inline-search,
body.theme-anime.portal-home .directory-header-row,
body.theme-anime.portal-home .activity-header-row,
body.theme-anime.portal-home .marketplace-topbar,
body.theme-anime.portal-home .inline-search {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: flex-start;
    margin-bottom: 8px;
}

body.theme-anime.portal-page .portal-search-input,
body.theme-anime.portal-page .portal-select,
body.theme-anime.portal-page .sidebar-input,
body.theme-anime.portal-page .text-input,
body.theme-anime.portal-page input[type="file"],
body.theme-anime.portal-home .portal-search-input,
body.theme-anime.portal-home .portal-select,
body.theme-anime.portal-home .sidebar-input,
body.theme-anime.portal-home .text-input,
body.theme-anime.portal-home input[type="file"] {
    border: 1px inset #ccc;
    border-radius: 3px;
    color: #888;
    font: inherit;
    font-size: 14px;
    padding: 6px;
    background: #fff;
}

body.theme-anime.portal-page .text-input,
body.theme-anime.portal-home .text-input {
    height: auto;
}

body.theme-anime.portal-page .textarea-input,
body.theme-anime.portal-home .textarea-input {
    min-height: 120px;
    resize: vertical;
}

body.theme-anime.portal-page .panel-label,
body.theme-anime.portal-home .panel-label,
body.theme-anime.portal-page .login-box label,
body.theme-anime.portal-home .login-box label {
    display: block;
    font-weight: bold;
    margin: 15px 0 5px;
    font-size: 12px;
    color: #555;
}

body.theme-anime.portal-page .green-btn,
body.theme-anime.portal-page .secondary-btn,
body.theme-anime.portal-page button,
body.theme-anime.portal-home .green-btn,
body.theme-anime.portal-home .secondary-btn,
body.theme-anime.portal-home button {
    background: linear-gradient(180deg, #ffffff 0%, #ededed 100%);
    border: 1px solid #ccc;
    border-radius: 3px;
    color: #777;
    cursor: pointer;
    font: normal 12px/20px Arial, Tahoma, Verdana, sans-serif;
    outline: none;
    padding: 4px 10px;
    text-align: center;
    text-decoration: none;
    line-height: 14px;
    min-width: 0;
    min-height: 0;
    box-shadow: none;
}

body.theme-anime.portal-page .green-btn:hover,
body.theme-anime.portal-page .secondary-btn:hover,
body.theme-anime.portal-page button:hover,
body.theme-anime.portal-home .green-btn:hover,
body.theme-anime.portal-home .secondary-btn:hover,
body.theme-anime.portal-home button:hover {
    background: linear-gradient(180deg, #ffffff 0%, #e0e0e0 100%);
    border-color: #bbb;
    color: #555;
}

body.theme-anime.portal-page .full-btn,
body.theme-anime.portal-home .full-btn {
    width: 100%;
}

body.theme-anime.portal-page .sidebar-user,
body.theme-anime.portal-home .sidebar-user {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

body.theme-anime.portal-page .sidebar-user img,
body.theme-anime.portal-home .sidebar-user img {
    float: left;
    width: 50px;
    height: 50px;
    margin: 0 10px 15px 0;
    border: 2px solid #eee;
    object-fit: cover;
}

body.theme-anime.portal-page .sidebar-actions.stack,
body.theme-anime.portal-home .sidebar-actions.stack {
    display: grid;
    gap: 8px;
    margin-top: 10px;
}

body.theme-anime.portal-page .sidebar-link,
body.theme-anime.portal-home .sidebar-link {
    display: inline-block;
    margin-top: 12px;
}

body.theme-anime.portal-page .top-chatters-grid,
body.theme-anime.portal-home .top-chatters-grid {
    display: grid;
    grid-template-columns: repeat(4, 44px);
    gap: 4px;
}

body.theme-anime.portal-page .top-chatter-slot,
body.theme-anime.portal-home .top-chatter-slot {
    width: 44px;
    height: 44px;
    border: 1px solid #ddd;
    background: #fff;
    color: #628340;
    font-weight: bold;
}

body.theme-anime.portal-page .top-chatter-slot img,
body.theme-anime.portal-home .top-chatter-slot img {
    width: 40px;
    height: 40px;
    margin: 1px;
    object-fit: cover;
}

body.theme-anime.portal-page .partner-card,
body.theme-anime.portal-page .error-card,
body.theme-anime.portal-home .partner-card,
body.theme-anime.portal-home .error-card {
    min-height: 82px;
    border: 1px solid #d1d1d1;
    background: #fff;
    display: grid;
    place-items: center;
    font-weight: bold;
    color: #444;
}

body.theme-anime.portal-page .member-list,
body.theme-anime.portal-page .group-list,
body.theme-anime.portal-page .activity-feed,
body.theme-anime.portal-page .profile-activity-feed,
body.theme-anime.portal-home .member-list,
body.theme-anime.portal-home .group-list,
body.theme-anime.portal-home .activity-feed,
body.theme-anime.portal-home .profile-activity-feed {
    display: grid;
    gap: 0;
}

body.theme-anime.portal-page .member-card,
body.theme-anime.portal-page .group-card,
body.theme-anime.portal-page .activity-row,
body.theme-anime.portal-page .profile-activity-item,
body.theme-anime.portal-home .member-card,
body.theme-anime.portal-home .group-card,
body.theme-anime.portal-home .activity-row,
body.theme-anime.portal-home .profile-activity-item {
    border-top: 1px solid #eaeaea;
    padding: 15px 0;
    background: transparent;
}

body.theme-anime.portal-page .member-card,
body.theme-anime.portal-home .member-card {
    grid-template-columns: 34px minmax(0, 1fr) 80px;
}

body.theme-anime.portal-page .group-card,
body.theme-anime.portal-home .group-card {
    grid-template-columns: 34px minmax(0, 1fr) 170px;
}

body.theme-anime.portal-page .member-avatar,
body.theme-anime.portal-page .group-thumb,
body.theme-anime.portal-page .activity-icon,
body.theme-anime.portal-home .member-avatar,
body.theme-anime.portal-home .group-thumb,
body.theme-anime.portal-home .activity-icon {
    border: 1px solid #ddd;
    background: #fff;
}

body.theme-anime.portal-page .member-avatar img,
body.theme-anime.portal-home .member-avatar img {
    max-width: 100%;
    max-height: 100%;
    object-fit: cover;
}

body.theme-anime.portal-page .profile-card,
body.theme-anime.portal-home .profile-card {
    padding-top: 0;
}

body.theme-anime.portal-page .profile-classic-shell,
body.theme-anime.portal-home .profile-classic-shell {
    display: grid;
    gap: 18px;
}

body.theme-anime.portal-page .profile-hero,
body.theme-anime.portal-home .profile-hero {
    display: grid;
    grid-template-columns: 170px minmax(0, 1fr);
    gap: 18px;
    padding: 18px 18px 16px;
    border: 1px solid #ddd6c4;
    background: linear-gradient(180deg, #fbfbf7 0%, #f3efe4 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

body.theme-anime.portal-page .profile-hero-avatar,
body.theme-anime.portal-home .profile-hero-avatar {
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

body.theme-anime.portal-page .profile-avatar-large,
body.theme-anime.portal-home .profile-avatar-large {
    width: 150px;
    height: 150px;
    border: 4px solid #f8f6ef;
    box-shadow: 0 0 0 1px #d2c8b0;
}

body.theme-anime.portal-page .profile-classic-title,
body.theme-anime.portal-home .profile-classic-title {
    margin-bottom: 6px;
    font-family: Georgia, Times, serif;
    font-size: 31px;
    line-height: 1.05;
}

body.theme-anime.portal-page .profile-hero-main,
body.theme-anime.portal-home .profile-hero-main {
    min-width: 0;
}

body.theme-anime.portal-page .profile-handle,
body.theme-anime.portal-home .profile-handle {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    color: #777;
    font-size: 14px;
}

body.theme-anime.portal-page .profile-status-line,
body.theme-anime.portal-home .profile-status-line {
    margin-top: 10px;
    color: #4a443a;
    font-size: 15px;
    line-height: 1.5;
}

body.theme-anime.portal-page .profile-status-note,
body.theme-anime.portal-home .profile-status-note {
    margin-top: 8px;
    color: #756d60;
    font-size: 13px;
    line-height: 1.55;
}

body.theme-anime.portal-page .profile-hero-meta,
body.theme-anime.portal-home .profile-hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 14px;
    margin-top: 12px;
    color: #8a816f;
    font-size: 12px;
}

body.theme-anime.portal-page .profile-hero-actions,
body.theme-anime.portal-home .profile-hero-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 14px;
}

body.theme-anime.portal-page .hero-count,
body.theme-anime.portal-home .hero-count {
    margin-top: 12px;
}

body.theme-anime.portal-page .profile-tabs,
body.theme-anime.portal-page .profile-subtabs,
body.theme-anime.portal-home .profile-tabs,
body.theme-anime.portal-home .profile-subtabs {
    display: flex;
    gap: 0;
    flex-wrap: wrap;
    margin-top: 20px;
    background: #eaeaea;
    clear: left;
    overflow: hidden;
}

body.theme-anime.portal-page .profile-tabs a,
body.theme-anime.portal-page .profile-subtabs a,
body.theme-anime.portal-home .profile-tabs a,
body.theme-anime.portal-home .profile-subtabs a {
    display: block;
    padding: 5px 10px;
    text-decoration: none;
    background: transparent;
    border: 0;
    color: #1fb3dd;
}

body.theme-anime.portal-page .profile-tabs a.active,
body.theme-anime.portal-page .profile-subtabs a.active,
body.theme-anime.portal-home .profile-tabs a.active,
body.theme-anime.portal-home .profile-subtabs a.active {
    background: #fff;
    color: #555;
    font-weight: bold;
}

body.theme-anime.portal-page .profile-tabs span,
body.theme-anime.portal-home .profile-tabs span {
    background: #1fb3dd;
    border-radius: 3px;
    color: #fff;
    display: inline;
    font-size: 90%;
    margin-left: 2px;
    padding: 1px 6px;
}

body.theme-anime.portal-page .profile-classic-layout,
body.theme-anime.portal-home .profile-classic-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 250px;
    gap: 20px;
    align-items: start;
}

body.theme-anime.portal-page .profile-classic-main,
body.theme-anime.portal-home .profile-classic-main,
body.theme-anime.portal-page .profile-classic-sidebar,
body.theme-anime.portal-home .profile-classic-sidebar {
    min-width: 0;
}

body.theme-anime.portal-page .profile-sidebar-card,
body.theme-anime.portal-home .profile-sidebar-card {
    margin-bottom: 16px;
    padding: 14px;
    border: 1px solid #ddd4bd;
    background: #f9f6ee;
}

body.theme-anime.portal-page .profile-sidebar-card h2,
body.theme-anime.portal-home .profile-sidebar-card h2 {
    margin-bottom: 10px;
}

body.theme-anime.portal-page .profile-sidebar-card p,
body.theme-anime.portal-home .profile-sidebar-card p {
    margin: 0;
    color: #5f5648;
    font-size: 13px;
    line-height: 1.55;
}

body.theme-anime.portal-page .profile-sidebar-card p + p,
body.theme-anime.portal-home .profile-sidebar-card p + p {
    margin-top: 10px;
}

body.theme-anime.portal-page .profile-facts,
body.theme-anime.portal-home .profile-facts {
    margin: 0;
    display: grid;
    gap: 12px;
}

body.theme-anime.portal-page .profile-facts div,
body.theme-anime.portal-home .profile-facts div {
    padding-top: 12px;
    border-top: 1px solid #e8dfc9;
}

body.theme-anime.portal-page .profile-facts div:first-child,
body.theme-anime.portal-home .profile-facts div:first-child {
    padding-top: 0;
    border-top: 0;
}

body.theme-anime.portal-page .profile-facts dt,
body.theme-anime.portal-home .profile-facts dt {
    color: #948a78;
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

body.theme-anime.portal-page .profile-facts dd,
body.theme-anime.portal-home .profile-facts dd {
    margin: 4px 0 0;
    color: #4e463b;
    font-size: 14px;
}

body.theme-anime.portal-page .profile-edit-form,
body.theme-anime.portal-home .profile-edit-form {
    margin-top: 0;
    padding: 16px;
    border: 1px solid #ddd6c4;
    border-top: 0;
    background: #fbfaf6;
}

body.theme-anime.portal-page[data-page="profile"] .profile-edit-panel {
    display: block;
    margin-top: 0;
}

body.theme-anime.portal-page[data-page="profile"] .profile-edit-panel summary {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 12px 14px;
    cursor: pointer;
    list-style: none;
    user-select: none;
    border: 1px solid #ddd6c4;
    background: linear-gradient(180deg, #f4f1e8, #ebe4d3);
}

body.theme-anime.portal-page[data-page="profile"] .profile-edit-panel summary::-webkit-details-marker {
    display: none;
}

body.theme-anime.portal-page[data-page="profile"] .profile-edit-panel summary::after {
    content: '+';
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border: 1px solid #7ebf52;
    border-radius: 999px;
    background: linear-gradient(180deg, #fcfff8, #e7f4d9);
    color: #478e2f;
    font-size: 13px;
    font-weight: 700;
}

body.theme-anime.portal-page[data-page="profile"] .profile-edit-panel[open] summary::after {
    content: '-';
}

body.theme-anime.portal-page .profile-discussion-shell,
body.theme-anime.portal-home .profile-discussion-shell {
    background: #fffdfa;
    border: 1px solid #dfd0af;
}

body.theme-anime.portal-page .profile-comment-card,
body.theme-anime.portal-home .profile-comment-card {
    background: transparent;
    border: 0;
    border-top: 1px solid #eadfc9;
    border-radius: 0;
    box-shadow: none;
    padding: 16px 0;
}

body.theme-anime.portal-page .profile-comment-list,
body.theme-anime.portal-home .profile-comment-list {
    padding: 0 18px 18px;
}

body.theme-anime.portal-page .profile-discussion-head,
body.theme-anime.portal-home .profile-discussion-head,
body.theme-anime.portal-page .profile-comment-form.composer,
body.theme-anime.portal-home .profile-comment-form.composer {
    padding-left: 18px;
    padding-right: 18px;
}

body.theme-anime.portal-page .profile-comment-form.composer,
body.theme-anime.portal-home .profile-comment-form.composer {
    padding-bottom: 18px;
    border-bottom: 1px solid #eadfc9;
}

body.theme-anime.portal-page .profile-comment-list > .profile-comment-card:first-child,
body.theme-anime.portal-home .profile-comment-list > .profile-comment-card:first-child {
    border-top: 0;
}

body.theme-anime.portal-page .profile-comment-main,
body.theme-anime.portal-home .profile-comment-main {
    min-width: 0;
}

body.theme-anime.portal-page .profile-comment-meta,
body.theme-anime.portal-home .profile-comment-meta {
    align-items: center;
}

body.theme-anime.portal-page .profile-comment-meta strong,
body.theme-anime.portal-home .profile-comment-meta strong {
    font-size: 14px;
}

body.theme-anime.portal-page .profile-comment-text,
body.theme-anime.portal-home .profile-comment-text {
    margin-top: 8px;
    color: #4e463a;
    line-height: 1.6;
}

body.theme-anime.portal-page .profile-comment-children,
body.theme-anime.portal-home .profile-comment-children {
    margin-top: 14px;
}

body.theme-anime.portal-page .profile-comment-login-note,
body.theme-anime.portal-home .profile-comment-login-note {
    margin: 0 18px 18px;
}

@media (max-width: 900px) {
    body.theme-anime.portal-page .profile-classic-layout,
    body.theme-anime.portal-home .profile-classic-layout {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 680px) {
    body.theme-anime.portal-page .profile-hero,
    body.theme-anime.portal-home .profile-hero {
        grid-template-columns: minmax(0, 1fr);
    }

    body.theme-anime.portal-page .profile-hero-avatar,
    body.theme-anime.portal-home .profile-hero-avatar {
        justify-content: flex-start;
    }
}

body.theme-anime.portal-page .help-section,
body.theme-anime.portal-home .help-section {
    margin-top: 16px;
}

body.theme-anime.portal-page .help-section ul,
body.theme-anime.portal-home .help-section ul {
    margin: 0 0 18px 1.5em;
    list-style: square;
}

body.theme-anime.portal-page .pagination-line,
body.theme-anime.portal-home .pagination-line {
    background: #f4f4f4;
    border: none;
    color: #888;
    font-size: 11px;
    min-height: 19px;
    margin: 0 0 15px;
    padding: 8px 12px;
}

body.theme-anime.portal-page .portal-table,
body.theme-anime.portal-home .portal-table {
    width: 100%;
    border-collapse: collapse;
}

body.theme-anime.portal-page .portal-table thead tr,
body.theme-anime.portal-home .portal-table thead tr {
    background: #eaeaea;
}

body.theme-anime.portal-page .portal-table th,
body.theme-anime.portal-page .portal-table td,
body.theme-anime.portal-home .portal-table th,
body.theme-anime.portal-home .portal-table td {
    padding: 8px;
    vertical-align: middle;
    border-top: 1px solid #eee;
}

body.theme-anime.portal-page .news-classic-page,
body.theme-anime.portal-home .news-classic-page {
    overflow: hidden;
}

body.theme-anime.portal-page .news-classic-nav,
body.theme-anime.portal-home .news-classic-nav {
    overflow: hidden;
    font-family: Georgia, Times, serif;
    font-size: 14px;
    font-style: italic;
    margin: 5px 0 25px;
    padding: 5px 0;
}

body.theme-anime.portal-page .alignleft,
body.theme-anime.portal-home .alignleft {
    float: left;
}

body.theme-anime.portal-page .alignright,
body.theme-anime.portal-home .alignright {
    float: right;
}

body.theme-anime.portal-page .news-classic-post,
body.theme-anime.portal-home .news-classic-post {
    margin: 0 0 15px;
    overflow: hidden;
}

body.theme-anime.portal-page .author-box,
body.theme-anime.portal-home .author-box {
    background: #f0f0f0;
    border-radius: 3px;
    float: left;
    font-family: Georgia, Times, serif;
    font-style: italic;
    margin: 0 15px 15px 0;
    padding: 10px;
    text-align: center;
    width: 70px;
}

body.theme-anime.portal-page .author-box img,
body.theme-anime.portal-home .author-box img {
    float: none;
    width: 50px;
    height: 50px;
    border: 4px solid #fff;
    margin: 0;
    object-fit: cover;
}

body.theme-anime.portal-page .author-box p,
body.theme-anime.portal-home .author-box p {
    margin: 5px 0 0;
    word-wrap: break-word;
}

body.theme-anime.portal-page .news-post-content,
body.theme-anime.portal-home .news-post-content {
    margin-left: 105px;
}

body.theme-anime.portal-page .posttitle,
body.theme-anime.portal-home .posttitle {
    line-height: 120%;
    margin: 0;
    font-size: 24px;
}

body.theme-anime.portal-page .posttitle a,
body.theme-anime.portal-home .posttitle a {
    color: #666;
    text-decoration: none;
}

body.theme-anime.portal-page .date,
body.theme-anime.portal-page .postmetadata,
body.theme-anime.portal-home .date,
body.theme-anime.portal-home .postmetadata {
    border-bottom: 1px solid #e4e4e4;
    border-top: 1px solid #e4e4e4;
    color: #888;
    font-family: Georgia, Times, serif;
    font-size: 12px;
    margin: 10px 0;
    padding: 3px 0;
}

body.theme-anime.portal-page .postmetadata,
body.theme-anime.portal-home .postmetadata {
    clear: left;
    overflow: hidden;
}

body.theme-anime.portal-page .comments,
body.theme-anime.portal-home .comments {
    float: right;
}

body.theme-anime.portal-page .classic-post-actions,
body.theme-anime.portal-home .classic-post-actions {
    margin: 10px 0;
}

body.theme-anime.portal-page .classic-comment-form,
body.theme-anime.portal-home .classic-comment-form {
    display: grid;
    gap: 8px;
    margin-top: 12px;
    background: #fafafa;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    padding: 15px;
}

body.theme-anime.portal-page .classic-comment-form textarea,
body.theme-anime.portal-home .classic-comment-form textarea {
    width: 100%;
    min-height: 90px;
}

@media (max-width: 980px) {
    body.theme-anime.portal-page,
    body.theme-anime.portal-home {
        width: auto;
        max-width: none;
        margin: 0;
        padding: 0 12px;
    }

    body.theme-anime.portal-page #content > .padder,
    body.theme-anime.portal-home #content > .padder {
        margin-right: 0;
        border-right: 0;
    }

    body.theme-anime.portal-page #sidebar,
    body.theme-anime.portal-home #sidebar {
        float: none;
        width: auto;
        margin: 20px 0 0;
        border-left: 0;
    }

    body.theme-anime.portal-page .portal-main,
    body.theme-anime.portal-home .portal-main {
        display: block;
    }
}

@media (max-width: 760px) {
    body.theme-anime.portal-page #header h1,
    body.theme-anime.portal-home #header h1,
    body.theme-anime.portal-page #nav,
    body.theme-anime.portal-home #nav {
        float: none;
    }

    body.theme-anime.portal-page #nav,
    body.theme-anime.portal-home #nav {
        margin: 20px 0 0;
    }

    body.theme-anime.portal-page #nav > li,
    body.theme-anime.portal-home #nav > li {
        margin: 0 5px 5px 0;
    }

    body.theme-anime.portal-page .header-search-form,
    body.theme-anime.portal-home .header-search-form,
    body.theme-anime.portal-page .inline-search,
    body.theme-anime.portal-home .inline-search,
    body.theme-anime.portal-page .directory-header-row,
    body.theme-anime.portal-home .directory-header-row,
    body.theme-anime.portal-page .activity-header-row,
    body.theme-anime.portal-home .activity-header-row,
    body.theme-anime.portal-page .marketplace-topbar,
    body.theme-anime.portal-home .marketplace-topbar,
    body.theme-anime.portal-page .profile-subtabs,
    body.theme-anime.portal-home .profile-subtabs {
        flex-direction: column;
        align-items: stretch;
    }

    body.theme-anime.portal-page .news-post-content,
    body.theme-anime.portal-home .news-post-content {
        margin-left: 0;
    }

    body.theme-anime.portal-page .author-box,
    body.theme-anime.portal-home .author-box {
        float: none;
        width: auto;
        margin-right: 0;
    }

    body.theme-anime.portal-page .member-card,
    body.theme-anime.portal-page .group-card,
    body.theme-anime.portal-page .profile-hero,
    body.theme-anime.portal-home .member-card,
    body.theme-anime.portal-home .group-card,
    body.theme-anime.portal-home .profile-hero {
        grid-template-columns: 1fr;
    }

    .profile-discussion-head {
        flex-direction: column;
    }

    .profile-comment-card {
        grid-template-columns: 1fr;
        margin-left: calc(var(--comment-depth, 0) * 10px);
    }

    .profile-comment-vote {
        grid-auto-flow: column;
        justify-content: start;
    }
}

/* =========================
   Portal refresh: retro green homepage
   ========================= */

body.theme-anime.portal-page,
body.theme-anime.portal-home {
    background:
        radial-gradient(circle at top left, rgba(232, 255, 196, 0.55) 0 180px, transparent 181px),
        linear-gradient(180deg, #b8ec6a 0%, #b2e664 100%);
    color: #555;
}

body.theme-anime.portal-page #container,
body.theme-anime.portal-home #container {
    border-radius: 0 0 4px 4px;
    box-shadow: 0 0 0 1px rgba(148, 188, 84, 0.32);
}

body.theme-anime.portal-page #header,
body.theme-anime.portal-home #header {
    padding-top: 18px;
    margin-bottom: 14px;
    background:
        linear-gradient(180deg, rgba(8, 138, 5, 0.2), rgba(13, 104, 18, 0.12)),
        url("../../images/website assets/portal-banner.jpg") center center / cover no-repeat;
}

body.theme-anime.portal-page .portal-banner,
body.theme-anime.portal-home .portal-banner {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    padding: 0;
}

body.theme-anime.portal-page .portal-branding,
body.theme-anime.portal-home .portal-branding {
    float: left;
    max-width: 420px;
}

body.theme-anime.portal-page .portal-logo,
body.theme-anime.portal-home .portal-logo {
    display: inline-block;
    font-family: "Trebuchet MS", Verdana, sans-serif;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

body.theme-anime.portal-page .portal-tagline,
body.theme-anime.portal-home .portal-tagline {
    margin: 8px 0 0;
    color: rgba(242, 255, 227, 0.92);
    font-size: 12px;
    line-height: 1.5;
    text-shadow: 0 1px 0 rgba(0, 0, 0, 0.18);
}

body.theme-anime.portal-page .portal-search-shell,
body.theme-anime.portal-home .portal-search-shell {
    margin-top: 0;
    text-align: right;
}

body.theme-anime.portal-page #search-bar .padder,
body.theme-anime.portal-home #search-bar .padder {
    padding: 0;
}

body.theme-anime.portal-page .header-search-form,
body.theme-anime.portal-home .header-search-form {
    gap: 5px;
}

body.theme-anime.portal-page .header-search-input,
body.theme-anime.portal-page .header-search-scope,
body.theme-anime.portal-home .header-search-input,
body.theme-anime.portal-home .header-search-scope {
    height: 22px;
    border: 1px solid #a2a2a2;
    border-radius: 0;
    box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.16);
}

body.theme-anime.portal-page .header-search-button,
body.theme-anime.portal-home .header-search-button {
    height: 22px;
    padding: 0 7px;
    border: 1px solid #b7b7b7;
    background: linear-gradient(180deg, #fefefe, #dedede);
    color: #666;
}

body.theme-anime.portal-page #nav,
body.theme-anime.portal-home #nav {
    margin: 28px 14px 0 0;
}

body.theme-anime.portal-page #nav > li,
body.theme-anime.portal-home #nav > li {
    margin-left: 3px;
}

body.theme-anime.portal-page #nav > li > a,
body.theme-anime.portal-home #nav > li > a {
    padding: 8px 13px 7px;
    background: rgba(31, 120, 28, 0.82);
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-bottom: 0;
    font-size: 12px;
    font-weight: 700;
    text-shadow: 0 1px 0 rgba(0, 0, 0, 0.16);
}

body.theme-anime.portal-page #nav > li.selected > a,
body.theme-anime.portal-page #nav > li > a.active,
body.theme-anime.portal-home #nav > li.selected > a,
body.theme-anime.portal-home #nav > li > a.active {
    background: #f5f5f5;
    color: #5c5c5c;
    border-color: rgba(0, 0, 0, 0.08);
    text-shadow: none;
}

body.theme-anime.portal-page #content > .padder,
body.theme-anime.portal-home #content > .padder {
    margin-right: 205px;
    padding: 0 16px 20px;
}

body.theme-anime.portal-page #sidebar,
body.theme-anime.portal-home #sidebar {
    width: 204px;
    margin-left: -205px;
}

body.theme-anime.portal-page #sidebar > .padder,
body.theme-anime.portal-home #sidebar > .padder {
    padding: 0 14px 18px;
}

body.theme-anime.portal-page .sidebar-box,
body.theme-anime.portal-home .sidebar-box {
    padding-top: 12px;
}

body.theme-anime.portal-page .sidebar-title,
body.theme-anime.portal-home .sidebar-title {
    margin: 0 0 9px;
    padding: 5px 12px;
    background: #dfdfdf;
    font-family: "Trebuchet MS", Verdana, sans-serif;
    font-weight: 700;
}

body.theme-anime.portal-page .sidebar-intro,
body.theme-anime.portal-home .sidebar-intro,
body.theme-anime.portal-page .sidebar-links,
body.theme-anime.portal-home .sidebar-links {
    font-size: 12px;
    line-height: 1.55;
}

body.theme-anime.portal-page .sidebar-user img,
body.theme-anime.portal-home .sidebar-user img {
    width: 52px;
    height: 52px;
    border: 4px solid #fff;
    object-fit: cover;
}

body.theme-anime.portal-page .sidebar-form label,
body.theme-anime.portal-home .sidebar-form label,
body.theme-anime.portal-page .auth-accordion summary,
body.theme-anime.portal-home .auth-accordion summary {
    font-size: 12px;
    color: #666;
}

body.theme-anime.portal-page .sidebar-input,
body.theme-anime.portal-home .sidebar-input {
    height: 26px;
    border-radius: 0;
    margin-bottom: 6px;
}

body.theme-anime.portal-page .remember-row.compact,
body.theme-anime.portal-home .remember-row.compact {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 6px 0 10px;
}

body.theme-anime.portal-page .sidebar-signup-link,
body.theme-anime.portal-home .sidebar-signup-link,
body.theme-anime.portal-page .sidebar-link,
body.theme-anime.portal-home .sidebar-link {
    display: inline-block;
    margin-top: 8px;
    color: #42a217;
    text-decoration: underline;
}

body.theme-anime.portal-page .green-btn.tiny,
body.theme-anime.portal-home .green-btn.tiny {
    min-height: 0;
    width: auto;
    padding: 5px 10px;
    border: 1px solid #bcbcbc;
    border-radius: 0;
    background: linear-gradient(180deg, #ffffff, #dedede);
    color: #666;
    box-shadow: none;
}

body.theme-anime.portal-page .full-btn,
body.theme-anime.portal-home .full-btn {
    width: 100%;
}

body.theme-anime.portal-page .sidebar-counter,
body.theme-anime.portal-home .sidebar-counter {
    min-height: 44px;
    padding: 8px 0;
    border: 1px solid #ebebeb;
    background: #fbfbfb;
    font-size: 28px;
    line-height: 1;
    text-align: center;
    color: #6a6a6a;
}

body.theme-anime.portal-page .top-chatters-grid,
body.theme-anime.portal-home .top-chatters-grid {
    gap: 4px;
}

body.theme-anime.portal-page .top-chatter-slot,
body.theme-anime.portal-home .top-chatter-slot {
    width: 40px;
    height: 40px;
    background: #f2f2f2;
}

body.theme-anime.portal-page .top-chatter-slot img,
body.theme-anime.portal-home .top-chatter-slot img {
    width: 40px;
    height: 40px;
    flex-basis: 40px;
    object-fit: cover;
}

body.theme-anime.portal-home .classic-news-tools {
    margin-top: 2px;
    margin-bottom: 16px;
    padding: 0;
}

body.theme-anime.portal-home .news-create-form {
    display: grid;
    gap: 8px;
    max-width: 560px;
    padding: 14px;
    border: 1px solid #e0e0e0;
    background: #fafafa;
}

body.theme-anime.portal-home .news-upload-label,
body.theme-anime.portal-home .news-upload-hint {
    margin: 0;
    font-size: 12px;
    color: #6a6a6a;
}

body.theme-anime.portal-home .news-home-intro {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
    margin: 4px 0 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid #e1e1e1;
}

body.theme-anime.portal-home .news-home-intro .portal-page-title {
    margin: 0 0 6px;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 24px;
}

body.theme-anime.portal-home .news-home-intro .portal-lead {
    margin: 0;
    max-width: 720px;
}

body.theme-anime.portal-home .news-home-stamp {
    padding: 8px 12px;
    border: 1px solid #d8decf;
    background: #f7f9f2;
    font-family: Georgia, "Times New Roman", serif;
    font-style: italic;
    color: #68834a;
    white-space: nowrap;
}

body.theme-anime.portal-home .news-classic-post {
    margin: 0 0 28px;
    padding-bottom: 18px;
    border-bottom: 1px solid #dfdfdf;
}

body.theme-anime.portal-home .author-box {
    width: 72px;
    padding: 12px 8px;
    background: #f3f3f3;
}

body.theme-anime.portal-home .author-box p {
    font-size: 12px;
    line-height: 1.45;
}

body.theme-anime.portal-home .news-post-content {
    margin-left: 100px;
}

body.theme-anime.portal-home .posttitle {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 23px;
}

body.theme-anime.portal-home .news-classic-visual {
    margin: 16px 0 12px;
    border: 1px solid #d9d9d9;
    background: #f4f4f4;
}

body.theme-anime.portal-home .news-classic-image {
    display: block;
    width: 100%;
    max-height: 420px;
    object-fit: contain;
    object-position: center center;
}

body.theme-anime.portal-home .news-classic-placeholder {
    display: grid;
    place-items: center;
    min-height: 300px;
    background:
        radial-gradient(circle at 22% 24%, rgba(255, 255, 255, 0.45) 0 18px, transparent 19px),
        radial-gradient(circle at 80% 18%, rgba(255, 255, 255, 0.28) 0 30px, transparent 31px),
        linear-gradient(135deg, #0e0e0e 0%, #101010 54%, #352d45 100%);
    color: #f5f5f5;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 30px;
    font-style: italic;
    letter-spacing: 0.04em;
    text-align: center;
}

body.theme-anime.portal-home .entry {
    font-size: 13px;
    line-height: 1.72;
}

body.theme-anime.portal-home .news-readmore {
    margin: 14px 0 0;
}

body.theme-anime.portal-home .news-readmore summary {
    cursor: pointer;
    color: #3f9d16;
    font-size: 12px;
    list-style: none;
}

body.theme-anime.portal-home .news-readmore summary::-webkit-details-marker {
    display: none;
}

body.theme-anime.portal-home .news-readmore-copy {
    margin-top: 10px;
    padding: 12px 14px;
    border: 1px solid #ececec;
    background: #fcfcfc;
}

body.theme-anime.portal-home .postmetadata {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

body.theme-anime.portal-home .read-more-inline a,
body.theme-anime.portal-home .comments a,
body.theme-anime.portal-home .sidebar-links a {
    color: #3f9d16;
    text-decoration: underline;
}

body.theme-anime.portal-home .classic-post-actions {
    margin-top: 10px;
}

body.theme-anime.portal-home .classic-comment-form {
    margin-top: 14px;
    border-radius: 0;
    background: #fafafa;
}

@media (max-width: 1100px) {
    body.theme-anime.portal-page #content > .padder,
    body.theme-anime.portal-home #content > .padder {
        margin-right: 0;
        padding-right: 0;
    }

    body.theme-anime.portal-page #sidebar,
    body.theme-anime.portal-home #sidebar {
        width: auto;
        margin-left: 0;
    }

    body.theme-anime.portal-home .news-home-intro {
        align-items: flex-start;
        flex-direction: column;
    }
}

@media (max-width: 760px) {
    body.theme-anime.portal-page .portal-banner,
    body.theme-anime.portal-home .portal-banner {
        flex-direction: column;
    }

    body.theme-anime.portal-page .portal-search-shell,
    body.theme-anime.portal-home .portal-search-shell {
        width: 100%;
        text-align: left;
    }

    body.theme-anime.portal-page .header-search-input,
    body.theme-anime.portal-home .header-search-input,
    body.theme-anime.portal-page .header-search-scope,
    body.theme-anime.portal-home .header-search-scope,
    body.theme-anime.portal-page .header-search-button,
    body.theme-anime.portal-home .header-search-button {
        width: 100%;
        height: 28px;
    }

    body.theme-anime.portal-home .author-box,
    body.theme-anime.portal-home .news-post-content {
        width: auto;
        margin-left: 0;
    }

    body.theme-anime.portal-home .news-classic-placeholder {
        min-height: 210px;
        font-size: 22px;
    }

    body.theme-anime.portal-home .postmetadata {
        align-items: flex-start;
        flex-direction: column;
    }
}



/* =========================
   Wayback style retrofit
   Keep #chatHistoryPanel unchanged
   ========================= */

body.theme-anime[data-page="chat"] {
    background: #baf375;
    color: #4a5c3c;
    font-family: Segoe UI, Tahoma, Verdana, sans-serif;
}

body.theme-anime[data-page="chat"] .app-wrap {
    min-height: 100vh;
    padding: 45px 0 170px;
    gap: 0;
}

body.theme-anime[data-page="chat"] .main-stage {
    padding-left: 0;
    width: 100%;
    align-items: center;
    justify-content: center;
}

body.theme-anime[data-page="chat"] .chat-scene {
    width: min(1120px, calc(100vw - 28px));
    height: auto;
    aspect-ratio: 16 / 9;
    margin: 0;
    border: 1px solid #0ca209;
    box-shadow: none;
    background-color: #dff0c4;
}

body.theme-anime[data-page="chat"] .field-overlay {
    background: transparent;
}

body.theme-anime[data-page="chat"] .room-badge {
    top: 8px;
    left: 8px;
    z-index: 3;
    padding: 3px 8px;
    border: 1px solid #0ca209;
    border-radius: 0;
    background: rgba(255,255,255,.86);
    color: #111;
    font-size: 11px;
}

body.theme-anime[data-page="chat"] .bottom-bar {
    width: 722px;
    margin: 0;
    gap: 10px;
}

body.theme-anime[data-page="chat"] .chat-line {
    flex: 1;
    min-height: 56px;
    height: 56px;
    padding: 0 18px;
    border: none;
    border-radius: 1rem;
    background-color: #eef5e9;
    box-shadow: 0 0.4rem 0 #c7d9bd;
    font-size: 16px;
    color: #2f9a1a;
    cursor: text;
}

body.theme-anime[data-page="chat"] .chat-line:focus {
    outline: 2px solid #2f9a1a;
    outline-offset: 1px;
}

body.theme-anime[data-page="chat"] .chat-line::placeholder {
    color: #5ca24e;
}

body.theme-anime[data-page="chat"] .send-btn,
body.theme-anime[data-page="chat"] .green-btn,
body.theme-anime[data-page="chat"] .blue-btn {
    min-width: 80px;
    min-height: 22px;
    padding: 0 10px;
    border: 1px solid #0ca209;
    background: #ffffff;
    color: #0ca209;
    font-size: 13px;
    font-weight: 600;
    box-shadow: none;
    border-radius: 0;
}

body.theme-anime[data-page="chat"] .green-btn.tiny,
body.theme-anime[data-page="chat"] .blue-btn.tiny {
    min-width: 72px;
    min-height: 24px;
    font-size: 12px;
}

body.theme-anime[data-page="chat"] .send-btn:hover,
body.theme-anime[data-page="chat"] .green-btn:hover,
body.theme-anime[data-page="chat"] .blue-btn:hover {
    background: #0ca209;
    color: #ffffff;
}

body.theme-anime[data-page="chat"] #toolbar {
    position: fixed;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    z-index: 36;
}

body.theme-anime[data-page="chat"] .toolbar-handle {
    display: grid;
    height: 12px;
    margin: 0 0 1px;
    border: 1px solid #0ca209;
    background: rgba(255,255,255,.88);
    color: #0ca209;
}

body.theme-anime[data-page="chat"] .toolbar-list {
    margin: 0;
    border: 1px solid #0ca209;
    background: rgba(255,255,255,.82);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-bottom: 10px;
}

body.theme-anime[data-page="chat"] .toolbar-list li {
    float: none;
    margin: 2px;
}

body.theme-anime[data-page="chat"] .side-btn {
    width: var(--toolbar-btn-size, 28px);
    height: var(--toolbar-btn-size, 28px);
    border: 1px solid #0ca209;
    background: #e8f7d3;
    color: #2d8c1d;
    font-size: var(--toolbar-icon-size, 16px);
}

body.theme-anime[data-page="chat"] .side-btn:hover,
body.theme-anime[data-page="chat"] .side-btn.active {
    background: #d9f0b9;
    color: #1f6e14;
}

body.theme-anime[data-page="chat"] .side-icon {
    font-size: var(--toolbar-icon-size, 16px);
    line-height: 1;
}

body.theme-anime[data-page="chat"] .side-icon-text {
    font-size: var(--toolbar-text-size, 10px);
}

body.theme-anime[data-page="chat"] .side-badge {
    top: -4px;
    right: -6px;
    min-width: 14px;
    height: 14px;
    padding: 0 4px;
    font-size: 9px;
    line-height: 14px;
}

body.theme-anime[data-page="chat"] #toolbar,
body.theme-anime[data-page="chat"] #toolbar *,
body.theme-anime[data-page="chat"] .side-btn,
body.theme-anime[data-page="chat"] .side-icon,
body.theme-anime[data-page="chat"] .side-icon-text {
    user-select: none;
    -webkit-user-select: none;
}

body.theme-anime[data-page="chat"] .window-panel:not(.history-panel) {
    border: 1px solid #0ca209;
    background: #ffffff;
    box-shadow: none;
    border-radius: 0;
    padding: 0 0 5px;
    font-size: 12px;
}

body.theme-anime[data-page="chat"] .panel-resize-handle {
    right: 3px;
    bottom: 3px;
    width: 12px;
    height: 12px;
    background:
        linear-gradient(135deg, transparent 0 54%, rgba(12, 162, 9, 0.8) 54% 61%, transparent 61% 100%),
        linear-gradient(135deg, transparent 0 70%, rgba(12, 162, 9, 0.5) 70% 77%, transparent 77% 100%);
}

body.theme-anime[data-page="chat"] .window-panel:not(.history-panel) .window-title {
    margin: 0 0 6px 0;
    padding: 3px 18px 3px 6px;
    min-height: 23px;
    background: #ffffff;
    border-bottom: 1px solid #0ca209;
    color: #0ca209;
    font-size: 13px;
    line-height: 1.35;
}

body.theme-anime[data-page="chat"] .window-panel:not(.history-panel) .window-close {
    right: 6px;
    top: 1px;
    font-size: 16px;
    color: #0ca209;
}

body.theme-anime[data-page="chat"] .window-panel:not(.history-panel) .panel-body {
    padding: 8px;
}

body.theme-anime[data-page="chat"] #onlinePanel,
body.theme-anime[data-page="chat"] #roomsPanel,
body.theme-anime[data-page="chat"] #newsPanel {
    width: 184px;
    min-height: 250px;
}

body.theme-anime[data-page="chat"] #createRoomModal {
    width: 385px;
    min-height: 350px;
}

body.theme-anime[data-page="chat"] #profilePanel {
    width: 320px;
    min-height: 320px;
}

body.theme-anime[data-page="chat"] .panel-label,
body.theme-anime[data-page="chat"] .dm-section-title {
    margin-bottom: 4px;
    font-size: 12px;
    color: #555;
    letter-spacing: 0;
    text-transform: none;
}

body.theme-anime[data-page="chat"] .text-input,
body.theme-anime[data-page="chat"] .textarea-input,
body.theme-anime[data-page="chat"] select {
    border: 1px solid #0ca209;
    border-radius: 0;
    background: #ffffff;
    box-shadow: none;
    font-size: 12px;
    color: #333;
}

body.theme-anime[data-page="chat"] .simple-row,
body.theme-anime[data-page="chat"] .room-row,
body.theme-anime[data-page="chat"] .news-card,
body.theme-anime[data-page="chat"] .comment-row,
body.theme-anime[data-page="chat"] .dm-conversation-item,
body.theme-anime[data-page="chat"] .dm-user-result,
body.theme-anime[data-page="chat"] .moderator-user-row,
body.theme-anime[data-page="chat"] .moderator-log-row,
body.theme-anime[data-page="chat"] .moderator-target-card,
body.theme-anime[data-page="chat"] .dm-sidebar,
body.theme-anime[data-page="chat"] .dm-thread-shell,
body.theme-anime[data-page="chat"] .moderator-column {
    border: 1px solid #d6ebc7;
    border-radius: 0;
    background: #fbfff7;
    box-shadow: none;
}

body.theme-anime[data-page="chat"] .dm-conversation-item-group {
    border-left: 3px solid #8fcf5f;
}

body.theme-anime[data-page="chat"] .simple-list,
body.theme-anime[data-page="chat"] .news-list,
body.theme-anime[data-page="chat"] .dm-message-list,
body.theme-anime[data-page="chat"] .dm-conversation-list,
body.theme-anime[data-page="chat"] .dm-search-results,
body.theme-anime[data-page="chat"] .moderator-user-list,
body.theme-anime[data-page="chat"] .moderator-log-list {
    scrollbar-width: thin;
    scrollbar-color: #8fcf5f #eef8df;
}

body.theme-anime[data-page="chat"] .profile-avatar-preview {
    border: 1px solid #0ca209;
    border-radius: 0;
    box-shadow: none;
    padding: 2px;
}

body.theme-anime[data-page="chat"] .profile-avatar-gallery {
    border: 1px solid #dcecc8;
    border-radius: 0;
    background: #ffffff;
}

body.theme-anime[data-page="chat"] .profile-avatar-card,
body.theme-anime[data-page="chat"] .profile-avatar-card.selected {
    border-radius: 0;
    box-shadow: none;
}

body.theme-anime[data-page="chat"] .profile-avatar-card.selected {
    border-color: #0ca209;
}

body.theme-anime[data-page="chat"] .avatar-item .avatar-name {
    bottom: 10px;
    font-size: 18px;
}

/* bubble styling moved to final fidelity block */

body.theme-anime[data-page="chat"] .user-corner {
    left: auto;
    right: 16px;
    top: 52px;
    bottom: auto;
    z-index: 5;
}

body.theme-anime[data-page="chat"] .me-card {
    border: 1px solid #0ca209;
    border-radius: 0;
    background: rgba(255,255,255,.9);
    box-shadow: none;
    padding: 6px 8px;
}

body.theme-anime[data-page="chat"] .me-card,
body.theme-anime[data-page="chat"] .me-card * {
    user-select: none !important;
    -webkit-user-select: none !important;
}

body.theme-anime[data-page="chat"] .me-card img {
    width: 36px;
    height: 36px;
}

body.theme-anime[data-page="chat"] #videoBottomControl {
    width: 722px;
    left: 50%;
    transform: translateX(-50%);
    bottom: 52px;
}

body.theme-anime[data-page="chat"] .video-bottom-main {
    border: 1px solid #0ca209;
    border-radius: 0;
    background: rgba(255,255,255,.96);
    box-shadow: none;
}

body.theme-anime.portal-page,
body.theme-anime.portal-home {
    background: #baf375;
    color: #555555;
    width: auto;
    max-width: none;
    margin: 0;
    font-family: Arial, Tahoma, Verdana, sans-serif;
    font-size: 12px;
    line-height: 170%;
}

body.theme-anime.portal-page .portal-shell,
body.theme-anime.portal-home .portal-shell {
    width: min(1120px, calc(100% - 48px));
    margin: 0 auto;
    padding: 24px 0 30px;
}

body.theme-anime.portal-page .padder,
body.theme-anime.portal-home .padder {
    padding: 0;
}

body.theme-anime.portal-page #container,
body.theme-anime.portal-home #container {
    background: #ffffff;
    border: 1px solid rgba(0,0,0,.08);
    border-radius: 3px;
    box-shadow: none;
}

body.theme-anime.portal-page #header,
body.theme-anime.portal-home #header {
    min-height: 110px;
    margin-bottom: 0;
    padding-top: 0;
    background: url("../../images/website assets/portal-banner.jpg") center center / cover no-repeat;
    border-radius: 0;
}

body.theme-anime.portal-page .portal-banner,
body.theme-anime.portal-home .portal-banner {
    position: relative;
    min-height: 110px;
    padding: 0 16px;
}

body.theme-anime.portal-page .portal-branding,
body.theme-anime.portal-home .portal-branding {
    position: absolute;
    left: 18px;
    top: 18px;
}

body.theme-anime.portal-page .portal-tagline,
body.theme-anime.portal-home .portal-tagline {
    display: none;
}

body.theme-anime.portal-page .portal-logo,
body.theme-anime.portal-home .portal-logo {
    color: #ffffff;
    font-size: 24px;
    font-weight: 700;
    text-shadow: 0 1px 0 rgba(0,0,0,.25);
}

body.theme-anime.portal-page .portal-search-shell,
body.theme-anime.portal-home .portal-search-shell {
    position: absolute;
    right: 8px;
    top: 12px;
    width: auto;
}

body.theme-anime.portal-page #search-bar,
body.theme-anime.portal-home #search-bar {
    margin-top: 0;
    width: auto;
    text-align: right;
}

body.theme-anime.portal-page #search-bar .padder,
body.theme-anime.portal-home #search-bar .padder {
    padding: 0;
}

body.theme-anime.portal-page .header-search-form,
body.theme-anime.portal-home .header-search-form {
    gap: 4px;
}

body.theme-anime.portal-page .header-search-input,
body.theme-anime.portal-page .header-search-scope,
body.theme-anime.portal-home .header-search-input,
body.theme-anime.portal-home .header-search-scope {
    height: 22px;
    border: 1px solid #c6c6c6;
    border-radius: 0;
    padding: 2px 6px;
    color: #555;
}

body.theme-anime.portal-page .header-search-input,
body.theme-anime.portal-home .header-search-input {
    width: 150px;
}

body.theme-anime.portal-page .header-search-button,
body.theme-anime.portal-home .header-search-button {
    height: 22px;
    padding: 0 6px;
    border: 1px solid #bcbcbc;
    background: #f3f3f3;
    color: #555;
    font-size: 11px;
}

body.theme-anime.portal-page #navigation,
body.theme-anime.portal-home #navigation {
    position: absolute;
    right: 8px;
    bottom: 0;
    width: auto;
}

body.theme-anime.portal-page #nav,
body.theme-anime.portal-home #nav {
    display: flex;
    gap: 2px;
    float: none;
    margin: 0;
    padding: 0;
}

body.theme-anime.portal-page #nav > li,
body.theme-anime.portal-home #nav > li {
    float: none;
    margin: 0;
}

body.theme-anime.portal-page #nav > li > a,
body.theme-anime.portal-home #nav > li > a {
    padding: 7px 12px;
    background: rgba(16, 133, 12, .78);
    color: #ffffff;
    border-top-left-radius: 0;
    border-top-right-radius: 0;
}

body.theme-anime.portal-page #nav > li.selected > a,
body.theme-anime.portal-page #nav > li > a.active,
body.theme-anime.portal-home #nav > li.selected > a,
body.theme-anime.portal-home #nav > li > a.active {
    background: #ffffff;
    color: #444444;
}

body.theme-anime.portal-page .portal-main,
body.theme-anime.portal-home .portal-main {
    display: flex;
    align-items: flex-start;
    gap: 0;
}

body.theme-anime.portal-page #content,
body.theme-anime.portal-home #content {
    float: none;
    width: calc(100% - 225px);
}

body.theme-anime.portal-page #content > .padder,
body.theme-anime.portal-home #content > .padder {
    margin-right: 0;
    padding: 14px 16px 22px;
    border-right: 1px solid #dddddd;
}

body.theme-anime.portal-page #sidebar,
body.theme-anime.portal-home #sidebar {
    float: none;
    width: 225px;
    margin-left: 0;
    margin-top: 0;
    border-left: 0;
    background: #ffffff;
}

body.theme-anime.portal-page #sidebar > .padder,
body.theme-anime.portal-home #sidebar > .padder {
    padding: 14px 0 18px;
}

body.theme-anime.portal-page a,
body.theme-anime.portal-home a {
    color: #0ca209;
}

body.theme-anime.portal-page a:hover,
body.theme-anime.portal-page a:active,
body.theme-anime.portal-home a:hover,
body.theme-anime.portal-home a:active {
    color: #5b8a3c;
}

body.theme-anime.portal-page .sidebar-title,
body.theme-anime.portal-home .sidebar-title {
    background: #eaeaea;
    padding: 6px 12px;
    margin: 0 0 10px;
    font-size: 12px;
    color: #555;
}

body.theme-anime.portal-page .sidebar-box,
body.theme-anime.portal-home .sidebar-box {
    padding: 0 0 16px;
}

body.theme-anime.portal-page .sidebar-box:first-child,
body.theme-anime.portal-home .sidebar-box:first-child {
    padding-top: 0;
}

body.theme-anime.portal-page .portal-page-title,
body.theme-anime.portal-home .portal-page-title {
    margin: 0 0 14px;
    font-size: 24px;
    color: #555;
}

body.theme-anime.portal-page .sidebar-user,
body.theme-anime.portal-home .sidebar-user {
    padding: 0 12px;
}

body.theme-anime.portal-page .sidebar-actions,
body.theme-anime.portal-home .sidebar-actions,
body.theme-anime.portal-page .sidebar-form,
body.theme-anime.portal-home .sidebar-form,
body.theme-anime.portal-page .sidebar-link,
body.theme-anime.portal-home .sidebar-link,
body.theme-anime.portal-page .sidebar-intro,
body.theme-anime.portal-home .sidebar-intro,
body.theme-anime.portal-page .sidebar-counter,
body.theme-anime.portal-home .sidebar-counter,
body.theme-anime.portal-page .sidebar-links,
body.theme-anime.portal-home .sidebar-links,
body.theme-anime.portal-page .partner-card,
body.theme-anime.portal-home .partner-card,
body.theme-anime.portal-page .top-chatters-grid,
body.theme-anime.portal-home .top-chatters-grid,
body.theme-anime.portal-page .sidebar-empty-note,
body.theme-anime.portal-home .sidebar-empty-note {
    padding-left: 12px;
    padding-right: 12px;
}

body.theme-anime.portal-page .sidebar-input,
body.theme-anime.portal-home .sidebar-input,
body.theme-anime.portal-page .portal-login-form input,
body.theme-anime.portal-home .portal-login-form input,
body.theme-anime.portal-page .portal-register-form input,
body.theme-anime.portal-home .portal-register-form input,
body.theme-anime.portal-page .portal-guest-form input,
body.theme-anime.portal-home .portal-guest-form input,
body.theme-anime.portal-page .portal-guest-form select,
body.theme-anime.portal-home .portal-guest-form select {
    border: 1px solid #cfcfcf;
    border-radius: 0;
    min-height: 26px;
    background: #ffffff;
}

body.theme-anime.portal-page .green-btn,
body.theme-anime.portal-home .green-btn,
body.theme-anime.portal-page .blue-btn,
body.theme-anime.portal-home .blue-btn {
    min-width: 0;
    min-height: 28px;
    padding: 0 10px;
    border: 1px solid #c5d9b6;
    border-radius: 3px;
    background: #f3fae8;
    color: #6d9445;
    font-size: 12px;
    box-shadow: none;
}

body.theme-anime.portal-page .green-btn:hover,
body.theme-anime.portal-home .green-btn:hover,
body.theme-anime.portal-page .blue-btn:hover,
body.theme-anime.portal-home .blue-btn:hover {
    background: #e9f5d7;
    color: #50762f;
}

@media (max-width: 1180px) {
    body.theme-anime.portal-page .portal-shell,
    body.theme-anime.portal-home .portal-shell {
        width: calc(100% - 24px);
    }
}

@media (max-width: 920px) {
    body.theme-anime.portal-page .portal-main,
    body.theme-anime.portal-home .portal-main {
        display: block;
    }

    body.theme-anime.portal-page #content,
    body.theme-anime.portal-home #content,
    body.theme-anime.portal-page #sidebar,
    body.theme-anime.portal-home #sidebar {
        width: 100%;
    }

    body.theme-anime.portal-page #content > .padder,
    body.theme-anime.portal-home #content > .padder {
        border-right: 0;
    }

    body.theme-anime.portal-page .portal-search-shell,
    body.theme-anime.portal-home .portal-search-shell,
    body.theme-anime.portal-page #navigation,
    body.theme-anime.portal-home #navigation {
        position: static;
    }

    body.theme-anime.portal-page .portal-banner,
    body.theme-anime.portal-home .portal-banner {
        padding: 14px 16px;
    }

    body.theme-anime.portal-page .portal-branding,
    body.theme-anime.portal-home .portal-branding {
        position: static;
        margin-bottom: 12px;
    }

    body.theme-anime.portal-page #nav,
    body.theme-anime.portal-home #nav {
        flex-wrap: wrap;
    }
}

/* =========================
   Screenshot fidelity pass
   ========================= */

body.theme-anime[data-page="chat"] #onlinePanel {
    left: 18px;
    top: 58px;
}

body.theme-anime[data-page="chat"] #roomsPanel {
    left: 18px;
    top: 58px;
}

body.theme-anime[data-page="chat"] #newsPanel {
    left: 18px;
    top: 58px;
}

body.theme-anime[data-page="chat"] #profilePanel {
    left: 120px;
    top: 86px;
}

body.theme-anime[data-page="chat"] #createRoomModal {
    left: 82px;
    top: 46px;
}

body.theme-anime[data-page="chat"] .classic-rooms-body {
    display: block;
}

body.theme-anime[data-page="chat"] .classic-room-list {
    height: 150px;
    overflow: auto;
    border: 1px solid #0ca209;
    padding: 4px;
    background: #fff;
}

body.theme-anime[data-page="chat"] .room-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 2px 4px;
    margin: 0;
    border: 0;
    background: transparent;
}

body.theme-anime[data-page="chat"] .room-row:hover,
body.theme-anime[data-page="chat"] .room-row.selected {
    background: #baf375;
}

body.theme-anime[data-page="chat"] .room-row .green-btn {
    min-width: 58px;
    min-height: 20px;
    font-size: 11px;
    padding: 0 6px;
}

body.theme-anime[data-page="chat"] .room-row .room-name {
    font-weight: 600;
    color: #333;
    font-size: 12px;
}

body.theme-anime[data-page="chat"] .room-row .room-meta {
    display: none;
}

body.theme-anime[data-page="chat"] .classic-room-info {
    padding-top: 10px;
}

body.theme-anime[data-page="chat"] .classic-room-info h4 {
    margin: 0 0 6px;
    font-size: 12px;
    color: #333;
}

body.theme-anime[data-page="chat"] .classic-room-info p {
    margin: 0 0 4px;
    font-size: 12px;
    color: #333;
}

body.theme-anime[data-page="chat"] .classic-room-info a {
    color: #0ca209;
    text-decoration: underline;
}

body.theme-anime[data-page="chat"] #createRoomModal .panel-body {
    padding: 8px 10px 10px;
}

body.theme-anime[data-page="chat"] #createRoomModal .stacked {
    display: block;
}

body.theme-anime[data-page="chat"] #createRoomModal .text-input.small {
    width: calc(100% - 10px);
    margin-bottom: 8px;
}

body.theme-anime[data-page="chat"] .classic-subline {
    margin-top: 8px;
}

body.theme-anime[data-page="chat"] .bg-selector-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1px;
    height: 205px;
    overflow: auto;
    margin: 6px 0 10px;
    border: 1px solid #0ca209;
    background: #ffffff;
    padding: 1px;
}

body.theme-anime[data-page="chat"] .bg-option {
    position: relative;
    display: block;
    height: 100px;
    margin: 0;
    cursor: pointer;
    border: 1px solid #fff;
    background: #fff;
}

body.theme-anime[data-page="chat"] .bg-option input {
    position: absolute;
    inset: 0;
    opacity: 0;
    pointer-events: none;
}

body.theme-anime[data-page="chat"] .bg-option:has(input:checked) {
    border-color: #0ca209;
}

body.theme-anime[data-page="chat"] .bg-preview {
    height: 100%;
    width: 100%;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
}

body.theme-anime[data-page="chat"] .room-upload-note {
    margin: 4px 0 10px;
    color: #333;
    font-size: 11px;
    line-height: 1.35;
}

body.theme-anime[data-page="chat"] .room-upload-preview {
    height: 100px;
    margin: 6px 0 8px;
    border: 1px solid #0ca209;
}

body.theme-anime[data-page="chat"] .rental-options {
    display: grid;
    gap: 4px;
    margin: 4px 0 10px;
}

body.theme-anime[data-page="chat"] .rental-option {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: #444;
}

body.theme-anime[data-page="chat"] .classic-submit-btn {
    display: block;
    min-width: 0;
    width: 88px;
    margin: 8px auto 0;
}

body.theme-anime[data-page="chat"] #profilePanel .panel-body {
    padding: 8px 9px 10px;
}

body.theme-anime[data-page="chat"] .legacy-profile-body {
    max-height: min(74vh, 560px);
    overflow-y: auto;
}

body.theme-anime[data-page="chat"] .legacy-profile-form {
    display: block;
}

body.theme-anime[data-page="chat"] #profilecontent h4,
body.theme-anime[data-page="chat"] .legacy-profile-auth-heading {
    margin: 0 0 6px;
    color: #333333;
    font-size: 12px;
    font-weight: 700;
}

body.theme-anime[data-page="chat"] .legacy-profile-name-block {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-bottom: 12px;
}

body.theme-anime[data-page="chat"] .legacy-profile-form p,
body.theme-anime[data-page="chat"] .legacy-profile-login {
    margin: 0;
}

body.theme-anime[data-page="chat"] #nickname {
    width: 100%;
    height: 28px;
    padding: 4px 6px;
    border: 1px solid #0ca209;
    background: #ffffff;
    color: #333333;
    font-size: 12px;
    box-sizing: border-box;
}

body.theme-anime[data-page="chat"] .all_colors {
    position: static;
    width: 24px;
    height: 22px;
    padding: 0;
    border: 1px solid #0ca209;
    color: #ffffff;
    font-size: 12px;
    font-weight: 700;
    line-height: 20px;
    text-align: center;
    cursor: pointer;
}

body.theme-anime[data-page="chat"] .legacy-profile-name-block p {
    order: 1;
    flex: 0 0 100%;
}

body.theme-anime[data-page="chat"] #choosecolor,
body.theme-anime[data-page="chat"] #choosebubblecolor,
body.theme-anime[data-page="chat"] #choosebubbleedgecolor,
body.theme-anime[data-page="chat"] #choosebubbletextcolor {
    order: 2;
}

body.theme-anime[data-page="chat"] .all_colors:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

body.theme-anime[data-page="chat"] .legacy-color-btn {
    min-width: 28px;
    width: 28px;
    height: 28px;
    padding: 0;
    font-weight: 700;
    border-width: 2px;
}

body.theme-anime[data-page="chat"] .legacy-color-btn.bubble {
    color: #4d5f80;
    border-color: #6c7895;
    background: #ffffff;
}

body.theme-anime[data-page="chat"] .legacy-color-btn.bubble-edge {
    color: #fff7dc;
    border-color: #8b6432;
    background: #8b6432;
}

body.theme-anime[data-page="chat"] .legacy-color-btn.bubble-text {
    color: #fff7dc;
    border-color: #6f4d21;
    background: #a16f34;
}

body.theme-anime[data-page="chat"] .legacy-color-btn.name {
    color: #ffffff;
    border-color: #cc7200;
    background: #f59000;
}

body.theme-anime[data-page="chat"] .profile-avatar-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(64px, 64px));
    justify-content: center;
    align-content: start;
    gap: 8px;
    height: 196px;
    padding: 8px;
    overflow-x: hidden;
    overflow-y: auto;
    border: 1px solid #0ca209;
    background: #fff;
}

body.theme-anime[data-page="chat"] .profile-avatar-card {
    position: relative;
    width: 64px;
    min-height: 0;
    aspect-ratio: 1 / 1;
    border: 1px solid transparent;
    background: #fff;
    display: flex;
    align-items: stretch;
    justify-content: stretch;
}

body.theme-anime[data-page="chat"] .profile-avatar-card:hover,
body.theme-anime[data-page="chat"] .profile-avatar-card.selected {
    border-color: #0ca209;
    background: #eef9df;
}

body.theme-anime[data-page="chat"] .profile-avatar-select {
    display: grid;
    place-items: center;
    width: 100%;
    min-height: 0;
    height: 100%;
    padding: 4px;
    background: transparent;
    border: 0;
}

body.theme-anime[data-page="chat"] .profile-avatar-select img {
    width: 100%;
    height: 100%;
    max-width: 54px;
    max-height: 54px;
    object-fit: contain;
    display: block;
    margin: 0 auto;
}

body.theme-anime[data-page="chat"] .profile-avatar-tag {
    position: absolute;
    left: 50%;
    bottom: 3px;
    transform: translateX(-50%);
    padding: 1px 4px;
    border-radius: 0;
    font-size: 9px;
    white-space: nowrap;
}

body.theme-anime[data-page="chat"] .profile-avatar-remove {
    top: 2px;
    right: 2px;
    width: 14px;
    height: 14px;
    border-radius: 0;
    background: #c62828;
    color: #fff;
    border: 1px solid #8e1d1d;
    font-size: 10px;
    line-height: 12px;
}

body.theme-anime[data-page="chat"] .profile-gallery-note {
    color: #444;
    font-size: 11px;
}

body.theme-anime[data-page="chat"] .legacy-profile-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
    margin-top: 10px;
}

body.theme-anime[data-page="chat"] .file-btn {
    display: inline-flex;
    justify-content: center;
    align-items: center;
}

body.theme-anime[data-page="chat"] .legacy-profile-note {
    margin-top: 6px;
    color: #666666;
    font-size: 11px;
    line-height: 1.35;
}

body.theme-anime[data-page="chat"] .legacy-profile-form .button {
    margin: 22px 0 0;
    text-align: center;
}

body.theme-anime[data-page="chat"] .legacy-profile-form .button a {
    color: #0ca209;
    font-weight: 700;
    text-decoration: underline;
}

body.theme-anime[data-page="chat"] .legacy-profile-auth-heading {
    margin-top: 14px;
}

body.theme-anime[data-page="chat"] .legacy-profile-auth-heading a {
    color: #0ca209;
}

body.theme-anime[data-page="chat"] .legacy-profile-login {
    margin-top: 4px;
}

body.theme-anime[data-page="chat"] .legacy-profile-login table {
    width: 100%;
    border-collapse: collapse;
}

body.theme-anime[data-page="chat"] .legacy-profile-login td {
    padding: 3px 4px 3px 0;
    vertical-align: middle;
    color: #333333;
    font-size: 12px;
}

body.theme-anime[data-page="chat"] .legacy-profile-login .labelrow {
    width: 96px;
}

body.theme-anime[data-page="chat"] .legacy-profile-login input[type="text"],
body.theme-anime[data-page="chat"] .legacy-profile-login input[type="password"] {
    width: 100%;
    height: 26px;
    padding: 4px 6px;
    border: 1px solid #0ca209;
    background: #ffffff;
    color: #333333;
    box-sizing: border-box;
}

body.theme-anime[data-page="chat"] .legacy-profile-login input[type="submit"] {
    min-width: 88px;
    height: 26px;
    border: 1px solid #0ca209;
    background: #d9f4b5;
    color: #0b6607;
    cursor: pointer;
}

body.theme-anime[data-page="chat"] #profileStatus,
body.theme-anime[data-page="chat"] #profileAuthStatus {
    margin-top: 8px;
}

body.theme-anime[data-page="chat"] .bubble-wrap {
    right: -48px;
    top: -26px;
    width: 200px;
}

/* bubble styling moved to final fidelity block */

body.theme-anime[data-page="chat"] .avatar-item {
    width: 132px;
    height: 132px;
    transition: none;
    will-change: left, top;
}

body.theme-anime[data-page="chat"] .avatar-sprite {
    object-fit: contain;
    transform: translateY(1px);
}

body.theme-anime[data-page="chat"] .avatar-item .avatar-name {
    left: 50%;
    transform: translateX(-50%);
    width: max-content;
    max-width: 130px;
    padding: 0 4px;
    text-align: center;
    text-shadow: 0 1px 0 rgba(255,255,255,.9), 0 0 4px rgba(255,255,255,.9);
}

body.theme-anime[data-page="chat"] .premium-tag {
    top: auto;
    bottom: -12px;
    right: 6px;
    padding: 1px 4px;
    border-radius: 0;
    font-size: 9px;
}

body.theme-anime.portal-page .portal-footer-classic,
body.theme-anime.portal-home .portal-footer-classic {
    padding: 8px 14px 10px;
    color: #7e7e7e;
    font-size: 11px;
}

body.theme-anime.portal-page .portal-footer-classic p,
body.theme-anime.portal-home .portal-footer-classic p {
    margin: 0;
}

body.theme-anime.portal-page .portal-footer-classic a,
body.theme-anime.portal-home .portal-footer-classic a {
    color: #7e7e7e;
}

body.theme-anime.portal-page .sidebar-intro,
body.theme-anime.portal-home .sidebar-intro {
    margin: 0 0 8px;
}

body.theme-anime.portal-page .portal-login-form .green-btn.tiny,
body.theme-anime.portal-home .portal-login-form .green-btn.tiny {
    width: 68px;
    min-width: 68px;
    min-height: 34px;
    padding: 6px 12px;
    font-size: 12px;
    border-radius: 22px;
}

body.theme-anime.portal-page .portal-register-form,
body.theme-anime.portal-home .portal-register-form {
    display: grid;
    gap: 0;
}

body.theme-anime.portal-page .portal-register-form .green-btn.tiny,
body.theme-anime.portal-page .portal-guest-form .green-btn.tiny,
body.theme-anime.portal-home .portal-register-form .green-btn.tiny,
body.theme-anime.portal-home .portal-guest-form .green-btn.tiny {
    min-width: 0;
    min-height: 36px;
    padding: 7px 14px;
    font-size: 12px;
    border-radius: 22px;
}

body.theme-anime.portal-page[data-page="shop"] .portal-split-grid,
body.theme-anime.portal-page[data-page="marketplace"] .portal-split-grid,
body.theme-anime.portal-page[data-page="groups"] .portal-split-grid,
body.theme-anime.portal-page[data-page="forums"] .portal-split-grid,
body.theme-anime.portal-page[data-page="members"] .portal-section,
body.theme-anime.portal-page[data-page="help"] .portal-section,
body.theme-anime.portal-page[data-page="profile"] .portal-section,
body.theme-anime.portal-page[data-page="register"] .portal-section,
body.theme-anime.portal-home .news-stream {
    padding-top: 2px;
}

body.theme-anime.portal-page[data-page="shop"] .portal-split-grid,
body.theme-anime.portal-page[data-page="marketplace"] .portal-split-grid,
body.theme-anime.portal-page[data-page="groups"] .portal-split-grid,
body.theme-anime.portal-page[data-page="forums"] .portal-split-grid {
    grid-template-columns: minmax(0, 1fr);
}

body.theme-anime.portal-page[data-page="shop"] .portal-card + .portal-card,
body.theme-anime.portal-page[data-page="marketplace"] .portal-card + .portal-card,
body.theme-anime.portal-page[data-page="groups"] .portal-card + .portal-card,
body.theme-anime.portal-page[data-page="forums"] .portal-card + .portal-card {
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid #e4e4e4;
}

body.theme-anime.portal-page[data-page="shop"] .portal-page-title,
body.theme-anime.portal-page[data-page="marketplace"] .portal-page-title,
body.theme-anime.portal-page[data-page="groups"] .portal-page-title,
body.theme-anime.portal-page[data-page="forums"] .portal-page-title,
body.theme-anime.portal-page[data-page="members"] .portal-page-title,
body.theme-anime.portal-page[data-page="help"] .portal-page-title,
body.theme-anime.portal-page[data-page="register"] .portal-page-title {
    font-size: 22px;
    margin-bottom: 10px;
}

body.theme-anime.portal-page[data-page="shop"] .shop-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 18px 16px;
    margin-top: 18px;
}

body.theme-anime.portal-page[data-page="shop"] .shop-card {
    display: grid;
    justify-items: center;
    align-content: start;
    text-align: center;
    padding: 0;
    border: 0;
    background: transparent;
}

body.theme-anime.portal-page[data-page="shop"] .shop-icon {
    width: 130px;
    height: 130px;
    display: grid;
    place-items: center;
    border: 1px solid #d9d9d9;
    background: #f2f2f2;
    margin-bottom: 8px;
    border-radius: 2px;
}

body.theme-anime.portal-page[data-page="shop"] .shop-icon span {
    font-size: 64px;
    line-height: 1;
}

body.theme-anime.portal-page[data-page="shop"] .shop-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    padding: 10px;
}

body.theme-anime.portal-page[data-page="shop"] .shop-card h3 {
    margin: 0 0 3px;
    font-size: 13px;
    color: #666;
    min-height: 34px;
}

body.theme-anime.portal-page[data-page="shop"] .shop-price {
    display: inline-block;
    margin: 4px 0 2px;
    padding: 2px 8px;
    border: 1px solid #d5e8bf;
    background: #eff9e2;
    color: #64a339;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 700;
}

body.theme-anime.portal-page[data-page="shop"] .shop-meta,
body.theme-anime.portal-page[data-page="shop"] .shop-stock {
    color: #666;
    font-size: 12px;
    margin-top: 2px;
    min-height: 16px;
}

body.theme-anime.portal-page[data-page="shop"] .shop-choice {
    width: auto;
    margin-top: 6px;
    align-self: start;
    justify-self: center;
}

body.theme-anime.portal-page[data-page="shop"] .shop-choice summary {
    list-style: none;
}

body.theme-anime.portal-page[data-page="shop"] .shop-choice .full-btn,
body.theme-anime.portal-page[data-page="shop"] .shop-choice summary.green-btn.tiny {
    width: auto;
    min-width: 112px;
}

body.theme-anime.portal-page[data-page="shop"] .shop-choice summary::-webkit-details-marker {
    display: none;
}

body.theme-anime.portal-page[data-page="shop"] .shop-choice-body {
    margin-top: 8px;
    padding: 8px;
    border: 1px solid #ebebeb;
    background: #fafafa;
    text-align: left;
}

body.theme-anime.portal-page[data-page="marketplace"] .market-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 18px 14px;
}

body.theme-anime.portal-page[data-page="marketplace"] .market-card {
    display: grid;
    justify-items: center;
    align-content: start;
    row-gap: 2px;
    text-align: center;
    padding: 0;
    border: 0;
    background: transparent;
}

body.theme-anime.portal-page[data-page="marketplace"] .market-avatar {
    width: 100px;
    height: 100px;
    display: block;
    overflow: hidden;
    border: 1px solid #ddd;
    background: #fff;
    margin-bottom: 2px;
}

body.theme-anime.portal-page[data-page="marketplace"] .market-avatar img {
    display: block;
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    object-fit: fill;
}

body.theme-anime.portal-page[data-page="marketplace"] .market-card h3 {
    font-size: 12px;
    margin: 0 0 2px;
    color: #666;
    line-height: 1.2;
}

body.theme-anime.portal-page[data-page="marketplace"] .market-time {
    color: #777;
    font-size: 11px;
    line-height: 1.2;
    min-height: 0;
}

body.theme-anime.portal-page[data-page="marketplace"] .market-price {
    display: inline-block;
    margin-top: 1px;
    padding: 2px 8px;
    border: 1px solid #d5e8bf;
    background: #eff9e2;
    color: #64a339;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 700;
}

body.theme-anime.portal-page[data-page="marketplace"] .market-seller {
    margin-top: 1px;
    font-size: 12px;
    line-height: 1.2;
    color: #666;
}

body.theme-anime.portal-page[data-page="marketplace"] .market-rent-copy {
    margin-top: 1px;
    font-size: 11px;
    line-height: 1.2;
    color: #666;
}

body.theme-anime.portal-page[data-page="marketplace"] .market-action-form {
    display: grid;
    gap: 2px;
    margin-top: 1px;
}

body.theme-anime.portal-page[data-page="marketplace"] .market-card .portal-empty-state.soft {
    margin-top: 2px;
    padding: 4px 8px;
}

body.theme-anime.portal-page[data-page="marketplace"] .marketplace-avatar-picker {
    display: grid;
    grid-template-columns: repeat(5, 100px);
    grid-auto-rows: 100px;
    gap: 8px;
    max-height: 316px;
    overflow-y: auto;
    overflow-x: auto;
    padding-right: 6px;
    align-items: stretch;
    justify-items: stretch;
}

body.theme-anime.portal-page[data-page="marketplace"] .marketplace-avatar-radio {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

body.theme-anime.portal-page[data-page="marketplace"] .marketplace-avatar-option {
    display: block;
    width: 100%;
    height: 100%;
    overflow: hidden;
    aspect-ratio: 1 / 1;
    border-radius: 14px;
    border: 1px solid rgba(108, 90, 54, 0.16);
    background: #f8f3e7;
    box-shadow: 0 10px 24px rgba(68, 54, 27, 0.05);
    cursor: pointer;
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

body.theme-anime.portal-page[data-page="marketplace"] .marketplace-avatar-option img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: fill;
}

body.theme-anime.portal-page[data-page="marketplace"] .marketplace-avatar-option:hover {
    transform: translateY(-1px);
    border-color: rgba(89, 148, 42, 0.38);
}

body.theme-anime.portal-page[data-page="marketplace"] .marketplace-avatar-radio:checked + .marketplace-avatar-option {
    border-color: rgba(89, 148, 42, 0.72);
    box-shadow: 0 0 0 2px rgba(107, 171, 58, 0.22), 0 12px 24px rgba(68, 54, 27, 0.08);
}

body.theme-anime.portal-page[data-page="marketplace"] .marketplace-create-panel {
    display: block;
}

body.theme-anime.portal-page[data-page="marketplace"] .marketplace-create-panel summary {
    margin: 0;
    list-style: none;
    cursor: pointer;
    user-select: none;
}

body.theme-anime.portal-page[data-page="marketplace"] .marketplace-create-panel summary::-webkit-details-marker {
    display: none;
}

body.theme-anime.portal-page[data-page="marketplace"] .marketplace-create-panel summary::after {
    content: '+';
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    margin-left: 8px;
    border: 1px solid #7ebf52;
    border-radius: 999px;
    background: linear-gradient(180deg, #fcfff8, #e7f4d9);
    color: #478e2f;
    font-size: 13px;
    font-weight: 700;
    vertical-align: middle;
}

body.theme-anime.portal-page[data-page="marketplace"] .marketplace-create-panel[open] summary::after {
    content: '-';
}

body.theme-anime.portal-page[data-page="marketplace"] .marketplace-create-panel > :not(summary) {
    margin-top: 14px;
}

body.theme-anime.portal-page[data-page="marketplace"] .market-card .green-btn,
body.theme-anime.portal-page[data-page="marketplace"] .market-card .blue-btn {
    display: block;
    min-width: 0;
    min-height: 22px;
    width: 88px;
    padding: 0 10px;
    border: 1px solid #0ca209;
    background: #ffffff;
    color: #0ca209;
    font-size: 13px;
    font-weight: 600;
    box-shadow: none;
    border-radius: 0;
    margin: 8px auto 0;
}

body.theme-anime.portal-page[data-page="marketplace"] .market-card .green-btn:hover,
body.theme-anime.portal-page[data-page="marketplace"] .market-card .green-btn:active,
body.theme-anime.portal-page[data-page="marketplace"] .market-card .green-btn:focus,
body.theme-anime.portal-page[data-page="marketplace"] .market-card .blue-btn:hover,
body.theme-anime.portal-page[data-page="marketplace"] .market-card .blue-btn:active,
body.theme-anime.portal-page[data-page="marketplace"] .market-card .blue-btn:focus {
    background: #0ca209;
    color: #ffffff;
}

body.theme-anime.portal-page[data-page="homepage-chat"] .homepage-chat-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(300px, 380px);
    gap: 18px;
    align-items: start;
}

body.theme-anime.portal-page[data-page="homepage-chat"] .homepage-chat-preview {
    display: grid;
    gap: 12px;
}

body.theme-anime.portal-page[data-page="bugsreport"] .bug-report-form-shell {
    max-width: 760px;
}

body.theme-anime.portal-page[data-page="bugsreport"] .bug-report-note {
    margin-bottom: 14px;
}

body.theme-anime.portal-page[data-page="bugsreport"] .bug-report-admin-list {
    display: grid;
    gap: 14px;
    margin-top: 28px;
}

body.theme-anime.portal-page[data-page="bugsreport"] .bug-report-entry {
    padding: 16px 18px;
    border: 1px solid #dddddd;
    background: #faf8f1;
}

body.theme-anime.portal-page[data-page="bugsreport"] .bug-report-entry-head {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: flex-start;
    margin-bottom: 12px;
}

body.theme-anime.portal-page[data-page="bugsreport"] .bug-report-entry h3 {
    margin: 0 0 6px;
    font-size: 18px;
    color: #555;
}

body.theme-anime.portal-page[data-page="bugsreport"] .bug-report-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
    align-items: center;
    color: #6f6f6f;
    font-size: 12px;
}

body.theme-anime.portal-page[data-page="bugsreport"] .bug-report-meta img {
    width: 28px;
    height: 28px;
    border-radius: 999px;
    object-fit: cover;
    border: 1px solid #d9d9d9;
    background: #fff;
}

body.theme-anime.portal-page[data-page="bugsreport"] .bug-report-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 88px;
    padding: 5px 10px;
    border: 1px solid #d4d4d4;
    background: #ffffff;
    color: #666;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

body.theme-anime.portal-page[data-page="bugsreport"] .bug-report-status.is-open {
    border-color: #c6ddb5;
    color: #5a8d34;
    background: #eef8e4;
}

body.theme-anime.portal-page[data-page="bugsreport"] .bug-report-status.is-resolved {
    border-color: #d5d5d5;
    color: #6f6f6f;
    background: #f1f1f1;
}

body.theme-anime.portal-page[data-page="bugsreport"] .bug-report-body {
    display: grid;
    gap: 10px;
}

body.theme-anime.portal-page[data-page="bugsreport"] .bug-report-section strong {
    display: block;
    margin-bottom: 4px;
    color: #555;
}

body.theme-anime.portal-page[data-page="bugsreport"] .bug-report-section p {
    margin: 0;
    color: #666;
    line-height: 1.55;
}

body.theme-anime.portal-page[data-page="bugsreport"] .bug-report-admin-actions {
    margin-top: 14px;
}

body.theme-anime.portal-page[data-page="impressum"] .legal-note {
    margin-bottom: 18px;
}

body.theme-anime.portal-page[data-page="homepage-chat"] .homepage-chat-code {
    min-height: 168px;
    font-family: Consolas, "Courier New", monospace;
    font-size: 12px;
}

body.theme-anime.portal-page[data-page="homepage-chat"] .homepage-chat-preview-shell {
    overflow: hidden;
    border: 1px solid #d8d8d8;
    background: #fdfdfd;
    box-shadow: inset 0 0 0 1px #ffffff;
}

body.theme-anime.portal-page[data-page="homepage-chat"] .homepage-chat-preview-shell iframe {
    display: block;
    width: 100%;
    min-height: 720px;
    border: 0;
    background: #ffffff;
}

body.theme-anime.portal-page[data-page="rss"] .rss-feed-list {
    display: grid;
    gap: 14px;
}

body.theme-anime.portal-page[data-page="rss"] .rss-feed-card {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    padding: 14px 16px;
    border: 1px solid #dfdfdf;
    background: #faf8f1;
}

body.theme-anime.portal-page[data-page="rss"] .rss-feed-card p {
    margin: 0 0 8px;
}

body.theme-anime.portal-page[data-page="rss"] .rss-feed-card code {
    display: inline-block;
    padding: 4px 6px;
    background: #fff;
    border: 1px solid #e0e0e0;
    color: #555;
}

body.theme-anime.portal-page[data-page="rss"] .rss-feed-actions {
    flex: 0 0 auto;
}

@media (max-width: 880px) {
    body.theme-anime.portal-page[data-page="homepage-chat"] .homepage-chat-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    body.theme-anime.portal-page[data-page="rss"] .rss-feed-card {
        flex-direction: column;
        align-items: stretch;
    }

    body.theme-anime.portal-page[data-page="bugsreport"] .bug-report-entry-head {
        flex-direction: column;
    }
}

body.theme-anime.portal-page[data-page="members"] .member-list {
    display: grid;
}

body.theme-anime.portal-page[data-page="members"] .member-card {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) auto;
    gap: 12px;
    align-items: start;
    padding: 10px 0;
}

body.theme-anime.portal-page[data-page="members"] .member-avatar {
    width: 42px;
    height: 42px;
}

body.theme-anime.portal-page[data-page="members"] .member-main h3 {
    margin: 0 0 3px;
    font-size: 18px;
}

body.theme-anime.portal-page[data-page="members"] .member-active {
    display: inline-block;
    padding: 2px 8px;
    border: 1px solid #e3d39e;
    background: #f9efb7;
    color: #7f6d2d;
    font-size: 11px;
    border-radius: 2px;
}

body.theme-anime.portal-page[data-page="members"] .member-preview-link {
    color: #0ca209;
    font-size: 12px;
    text-decoration: underline;
}

body.theme-anime.portal-page[data-page="forums"] .portal-table th {
    font-weight: 700;
    color: #666;
    font-size: 11px;
}

body.theme-anime.portal-page[data-page="forums"] .portal-table tbody tr:nth-child(odd) {
    background: #f8f4db;
}

body.theme-anime.portal-page[data-page="forums"] .topic-link {
    font-size: 13px;
    font-weight: 700;
    text-decoration: underline;
}

body.theme-anime.portal-page[data-page="forums"] .topic-thread-card,
body.theme-anime.portal-page[data-page="forums"] .reply-card {
    border: 1px solid #ececec;
    background: #fff;
    border-radius: 0;
}

body.theme-anime.portal-page[data-page="groups"] .group-list {
    display: grid;
}

body.theme-anime.portal-page[data-page="groups"] .group-card {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr) auto;
    gap: 12px;
    align-items: start;
    padding: 10px 0;
}

body.theme-anime.portal-page[data-page="groups"] .group-thumb {
    width: 40px;
    height: 40px;
    background-size: cover;
    background-position: center;
}

body.theme-anime.portal-page[data-page="groups"] .group-main h3 {
    margin: 0 0 3px;
    font-size: 18px;
}

body.theme-anime.portal-page[data-page="groups"] .group-active {
    display: inline-block;
    padding: 2px 8px;
    border: 1px solid #e3d39e;
    background: #f9efb7;
    color: #7f6d2d;
    font-size: 11px;
    border-radius: 2px;
}

body.theme-anime.portal-page[data-page="groups"] .group-meta {
    font-size: 11px;
    color: #777;
    text-align: right;
}

body.theme-anime.portal-page[data-page="groups"] .group-detail-classic {
    padding-top: 6px;
}

body.theme-anime.portal-page[data-page="groups"] .group-detail-tabs {
    display: flex;
    gap: 0;
    margin: 0 0 12px;
    background: #eaeaea;
}

body.theme-anime.portal-page[data-page="groups"] .group-detail-tabs a {
    display: block;
    padding: 5px 10px;
    color: #0ca209;
    text-decoration: none;
}

body.theme-anime.portal-page[data-page="groups"] .group-detail-tabs a.active {
    background: #fff;
    color: #555;
    font-weight: 700;
}

body.theme-anime.portal-page[data-page="groups"] .group-detail-tabs span {
    background: #2db6dd;
    color: #fff;
    padding: 1px 6px;
    border-radius: 3px;
    margin-left: 2px;
    font-size: 11px;
}

body.theme-anime.portal-page[data-page="groups"] .group-detail-head {
    display: grid;
    grid-template-columns: 110px minmax(0, 1fr) 90px;
    gap: 12px;
    align-items: start;
    border-bottom: 1px solid #e5e5e5;
    padding-bottom: 12px;
}

body.theme-anime.portal-page[data-page="groups"] .group-profile-picture {
    width: 94px;
    height: 94px;
    border: 1px solid #ddd;
}

body.theme-anime.portal-page[data-page="groups"] .group-feed-card {
    border-radius: 0;
    border: 1px solid #ececec;
    background: #fff;
}

body.theme-anime.portal-page[data-page="register"] .register-classic-form {
    display: grid;
    gap: 16px;
}

body.theme-anime.portal-page[data-page="register"] .register-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
}

body.theme-anime.portal-page[data-page="register"] .register-heading {
    font-size: 22px;
    margin: 0 0 12px;
    color: #555;
}

body.theme-anime.portal-page[data-page="register"] .register-note {
    margin: 6px 0 12px;
    color: #888;
    font-size: 12px;
}

body.theme-anime.portal-page[data-page="register"] .register-radio-list {
    display: grid;
    gap: 6px;
    margin-top: 6px;
}

body.theme-anime.portal-page[data-page="register"] .register-captcha-placeholder {
    min-height: 120px;
    border: 1px solid #e6e6e6;
    background: #fafafa;
}

body.theme-anime.portal-page[data-page="register"] .register-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 14px;
}

@media (max-width: 1100px) {
    body.theme-anime.portal-page[data-page="shop"] .shop-grid,
    body.theme-anime.portal-page[data-page="marketplace"] .market-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    body.theme-anime.portal-page[data-page="shop"] .shop-grid,
    body.theme-anime.portal-page[data-page="marketplace"] .market-grid,
    body.theme-anime.portal-page[data-page="register"] .register-columns {
        grid-template-columns: 1fr;
    }
}
/* ===== Fidelity update: speech bubbles, rooms, forums, groups, classic buttons ===== */
body.theme-anime[data-page="chat"] .bubble-wrap {
    position: absolute;
    left: 50%;
    top: -8px;
    width: 220px;
    max-width: min(220px, calc(100vw - 16px));
    padding-bottom: 34px;
    transform: translateX(-34%);
    pointer-events: none;
    overflow: visible;
}

body.theme-anime[data-page="chat"] .bubble-wrap.bubble-edge-left {
    left: 4px;
    right: auto;
    transform: none;
}

body.theme-anime[data-page="chat"] .bubble-wrap.bubble-edge-right {
    left: auto;
    right: 4px;
    transform: none;
}

body.theme-anime[data-page="chat"] .chat-bubble {
    position: relative;
    display: inline-block;
    min-width: 54px;
    max-width: 200px;
    padding: 10px 16px 9px;
    border: 3px solid var(--bubble-stroke, #000000);
    border-radius: 10px;
    background: var(--user-bubble, #f7f7ee);
    color: var(--bubble-text, #000000);
    font-family: "Arial Rounded MT Bold", "Trebuchet MS", Verdana, sans-serif;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.35;
    letter-spacing: 0.1px;
    text-rendering: geometricPrecision;
    text-align: center;
    z-index: 2;
    box-sizing: content-box;
    word-break: break-word;
    backdrop-filter: none;
    box-shadow: none;
    margin-bottom: 0;
    transition: none;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    outline: 1px solid transparent;
    backface-visibility: hidden;
    transform: translateZ(0);
}

/* curved comic tail via box-shadow */
body.theme-anime[data-page="chat"] .chat-bubble::before {
    content: '';
    position: absolute;
    bottom: -30px;
    left: 0;
    height: 30px;
    width: 50px;
    border-radius: 0 0 100%;
    box-shadow:
        -2px -2px 0 0 var(--bubble-stroke, #000000) inset,
        -13px 0 0 0 var(--user-bubble, #f7f7ee) inset,
        -15px -2px 0 0 var(--bubble-stroke, #000000) inset;
}

body.theme-anime[data-page="chat"] .chat-bubble::after {
    content: none;
    display: none;
    width: 0;
    height: 0;
    border: none;
    background: none;
    box-shadow: none;
    transform: none;
}

/* ---- think bubble (triggered by /denkt) ---- */
body.theme-anime[data-page="chat"] .chat-bubble.think::before {
    height: 3px;
    width: 3px;
    bottom: -14px;
    left: 28px;
    border-radius: 100%;
    background: var(--user-bubble, #f7f7ee);
    box-shadow:
        0 0 0 5px var(--user-bubble, #f7f7ee),
        0 0 0 7px var(--bubble-stroke, #000000),
        -12px 9px 0 3px var(--user-bubble, #f7f7ee),
        -12px 9px 0 5px var(--bubble-stroke, #000000),
        -24px 14px 0 1px var(--user-bubble, #f7f7ee),
        -24px 14px 0 3px var(--bubble-stroke, #000000);
}

body.theme-anime[data-page="chat"] .chat-bubble.typing {
    min-width: 58px;
    text-align: center;
}

body.theme-anime[data-page="chat"] .chat-bubble.typing span {
    display: inline-block;
    width: 6px;
    height: 6px;
    margin: 0 1px;
    border-radius: 50%;
    background: var(--bubble-text, #444);
    animation: bubbleBlink 1s infinite ease-in-out;
}

body.theme-anime[data-page="chat"] .chat-bubble.typing span:nth-child(2) { animation-delay: .15s; }
body.theme-anime[data-page="chat"] .chat-bubble.typing span:nth-child(3) { animation-delay: .3s; }

@keyframes bubbleBlink {
    0%, 80%, 100% { opacity: .35; transform: translateY(0); }
    40% { opacity: 1; transform: translateY(-2px); }
}

body.theme-anime[data-page="chat"] .avatar-item {
    width: 160px;
    height: 160px;
}

body.theme-anime[data-page="chat"] .avatar-item.self .bubble-wrap {
    transform: translateX(-42%);
}

body.theme-anime[data-page="chat"] .avatar-item.self .bubble-wrap.bubble-edge-left,
body.theme-anime[data-page="chat"] .avatar-item.self .bubble-wrap.bubble-edge-right {
    transform: none;
}

body.theme-anime[data-page="chat"] .avatar-item .avatar-name {
    left: 50%;
    bottom: 10px;
    transform: translateX(-50%);
    width: max-content;
    max-width: 142px;
    padding: 0 4px;
    color: var(--avatar-name-fill, #000000);
    font-size: 17px;
    font-family: "Arial Rounded MT Bold", "Trebuchet MS", Verdana, sans-serif;
    font-weight: 400;
    letter-spacing: 0.15px;
    line-height: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    z-index: 26;
    -webkit-text-stroke: 1.8px #ffffff;
    paint-order: stroke fill;
    text-shadow:
        0 0 4px rgba(255, 255, 255, .34),
        0 3px 6px rgba(0, 0, 0, .22);
}

body.theme-anime[data-page="chat"] .avatar-item .avatar-name.compact {
    font-size: 15px;
}

body.theme-anime[data-page="chat"] .avatar-item .avatar-name.tight {
    font-size: 13px;
}

body.theme-anime[data-page="chat"] .avatar-item .avatar-rank,
body.theme-anime[data-page="chat"] .avatar-item .avatar-premium {
    position: absolute;
    left: 50%;
    bottom: 3px;
    transform: translateX(-50%);
    max-width: 128px;
    padding: 0 4px;
    background: none;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    color: #ffffff;
    font-family: Tahoma, Verdana, sans-serif;
    font-size: 8px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0.35px;
    text-transform: uppercase;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    z-index: 27;
    -webkit-text-stroke: 1.7px #73a8ff;
    paint-order: stroke fill;
    text-shadow:
        0 0 6px rgba(115, 168, 255, .95),
        0 0 12px rgba(115, 168, 255, .86),
        0 0 20px rgba(115, 168, 255, .7),
        0 0 30px rgba(115, 168, 255, .52),
        0 0 42px rgba(115, 168, 255, .34),
        0 1px 3px rgba(46, 95, 186, .62);
}

body.theme-anime[data-page="chat"] .classic-room-list {
    height: 154px;
    padding: 3px;
    border: 1px solid #0ca209;
    background: #fff;
    overflow-y: auto;
}

body.theme-anime[data-page="chat"] .classic-room-entry {
    display: block;
    width: 100%;
    padding: 1px 4px;
    border: 0;
    background: transparent;
    color: #333;
    text-align: left;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.55;
    cursor: pointer;
}

body.theme-anime[data-page="chat"] .classic-room-entry:hover,
body.theme-anime[data-page="chat"] .classic-room-entry.selected {
    background: #baf375;
}

body.theme-anime[data-page="chat"] .classic-room-entry .room-name {
    font-size: 11px;
    font-weight: 700;
}

body.theme-anime[data-page="chat"] .classic-online-list {
    height: 154px;
}

body.theme-anime[data-page="chat"] .classic-online-entry {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 3px 4px;
}

body.theme-anime[data-page="chat"] .classic-online-entry img {
    width: 24px;
    height: 24px;
    flex: 0 0 24px;
    object-fit: contain;
}

body.theme-anime[data-page="chat"] .classic-online-meta {
    min-width: 0;
}

body.theme-anime[data-page="chat"] .classic-online-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.25;
}

body.theme-anime[data-page="chat"] .classic-online-sub {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #555;
    font-size: 10px;
    line-height: 1.2;
}

body.theme-anime[data-page="chat"] .classic-room-info {
    padding-top: 10px;
}

body.theme-anime[data-page="chat"] .classic-room-info h4 {
    margin: 0 0 5px;
    font-size: 12px;
    color: #333;
}

body.theme-anime[data-page="chat"] .classic-room-info p {
    margin: 0 0 2px;
    color: #333;
    font-size: 12px;
}

body.theme-anime[data-page="chat"] .classic-room-info a {
    color: #333;
    text-decoration: underline;
}

body.theme-anime[data-page="chat"] .green-btn,
body.theme-anime[data-page="chat"] .blue-btn,
body.theme-anime[data-page="chat"] .file-btn,
body.theme-anime[data-page="chat"] .legacy-color-btn {
    border-width: 1px;
    border-style: solid;
    border-color: #0ca209;
    border-radius: 0;
    min-height: 22px;
    padding: 0 10px;
    font-family: Arial, Tahoma, Verdana, sans-serif;
    font-size: 11px;
    font-weight: 700;
    line-height: 20px;
    color: #0ca209;
    text-decoration: none;
    cursor: pointer;
    background: #ffffff;
    box-shadow: none;
    transition: none;
}

body.theme-anime[data-page="chat"] .send-btn,
body.theme-anime[data-page="chat"] .bottom-bar .send-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-width: 80px;
    height: 56px;
    min-height: 56px;
    padding: 0 26px;
    border: 0;
    border-radius: 1rem;
    background-color: #2f9a1a;
    color: #ffffff;
    letter-spacing: 0.06em;
    font-size: 13px;
    line-height: 1.1;
    box-sizing: border-box;
    box-shadow: #1f6f12 0 10px 0 0;
    transition: transform 0.2s ease, box-shadow 0.3s ease, background-color 0.3s ease;
}

body.theme-anime[data-page="chat"] .green-btn.tiny,
body.theme-anime[data-page="chat"] .blue-btn.tiny {
    min-width: 72px;
    min-height: 24px;
    font-size: 11px;
}

body.theme-anime[data-page="chat"] .green-btn:hover,
body.theme-anime[data-page="chat"] .blue-btn:hover,
body.theme-anime[data-page="chat"] .file-btn:hover,
body.theme-anime[data-page="chat"] .legacy-color-btn:hover,
body.theme-anime[data-page="chat"] .green-btn:active,
body.theme-anime[data-page="chat"] .blue-btn:active,
body.theme-anime[data-page="chat"] .file-btn:active,
body.theme-anime[data-page="chat"] .legacy-color-btn:active {
    background: #0ca209;
    color: #fff;
    box-shadow: none;
    transform: none;
}

body.theme-anime[data-page="chat"] .send-btn:active,
body.theme-anime[data-page="chat"] .bottom-bar .send-btn:hover {
    background-color: #35a91f;
    color: #fff;
    box-shadow: #1f6f12 0 7px 0 0;
}

body.theme-anime[data-page="chat"] .bottom-bar .send-btn:active {
    background-color: #2f9a1a;
    box-shadow: #1f6f12 0 0 0 0;
    transform: translateY(5px);
}

body.theme-anime[data-page="chat"] .send-btn:focus,
body.theme-anime[data-page="chat"] .green-btn:focus,
body.theme-anime[data-page="chat"] .blue-btn:focus,
body.theme-anime[data-page="chat"] .file-btn:focus,
body.theme-anime[data-page="chat"] .legacy-color-btn:focus {
    outline: none;
}

body.theme-anime.portal-page .green-btn,
body.theme-anime.portal-page .blue-btn,
body.theme-anime.portal-home .green-btn,
body.theme-anime.portal-home .blue-btn,
body.theme-anime.portal-page .header-search-button,
body.theme-anime.portal-home .header-search-button {
    border: 1px solid #c8c8c8;
    border-radius: 2px;
    background: linear-gradient(180deg, #fbfbfb, #ececec);
    color: #666;
    min-height: 24px;
    padding: 0 8px;
    font-size: 11px;
    font-weight: 700;
}

body.theme-anime.portal-page .green-btn:hover,
body.theme-anime.portal-page .blue-btn:hover,
body.theme-anime.portal-home .green-btn:hover,
body.theme-anime.portal-home .blue-btn:hover,
body.theme-anime.portal-page .header-search-button:hover,
body.theme-anime.portal-home .header-search-button:hover {
    background: linear-gradient(180deg, #ffffff, #f2f2f2);
    color: #444;
}

/* Incoming call card (light mode) */
#incomingCallCard {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    pointer-events: none;
}

#incomingCallCard.visible {
    pointer-events: auto;
}

#incomingCallCard .card {
    width: 190px;
    height: 254px;
    border-radius: 1em;
    flex-direction: column;
    justify-content: space-evenly;
    background-color: #ffffff;
    box-shadow: 0 0 2rem rgba(0, 0, 0, 0.2);
    cursor: pointer;
    transition: 0.2s ease-in-out;
    padding: 5px;
    color: #222;
    display: flex;
}

#incomingCallCard .card:hover {
    rotate: 1deg;
    scale: 1.05;
}

#incomingCallCard .card, #incomingCallCard .imgBox, #incomingCallCard .caller {
    display: flex;
    align-items: center;
}

#incomingCallCard .imgBox {
    width: 6em;
    height: 6em;
    box-shadow: 0px 0.25em 1rem rgba(0, 0, 0, 0.12);
    border-radius: 50%;
    justify-content: center;
}

#incomingCallCard .imgBox svg {
    width: 100%;
    height: 100%;
}

#incomingCallCard .name {
    width: 100%;
    text-align: center;
    font-weight: 900;
    transition: 1s ease-in-out;
}

#incomingCallCard .name .p1 {
    font-size: 1.2em;
}

#incomingCallCard .name .p2 {
    font-size: 0.8em;
    color: rgb(50, 146, 255);
}

#incomingCallCard .caller {
    width: 100%;
    flex-direction: row;
    justify-content: space-evenly;
}

#incomingCallCard .callerBtn {
    width: 2em;
    height: 2em;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
    transition: 0.1s ease-in-out;
    animation: animate linear infinite 2s;
}

#incomingCallCard .callerBtn:hover {
    scale: 1.1;
}

#incomingCallCard #incomingCallPick {
    background-color: #28ff28;
    box-shadow: 0px 3px 10px #28ff28;
}

#incomingCallCard #incomingCallEnd {
    background-color: #ff2828;
    box-shadow: 0px 3px 10px #ff2828;
}

#incomingCallCard #incomingCallEnd svg {
    rotate: 135deg;
}

@keyframes animate {
    0% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(3px) rotate(-10deg);
    }

    100% {
        transform: translateY(0px);
    }
}

body.theme-anime.portal-page[data-page="forums"] .portal-card,
body.theme-anime.portal-page[data-page="groups"] .portal-card {
    padding: 14px 12px 12px;
}

body.theme-anime.portal-page[data-page="forums"] .forum-directory-classic,
body.theme-anime.portal-page[data-page="groups"] .group-directory-classic,
body.theme-anime.portal-page[data-page="groups"] .group-profile-classic {
    background: #f3f3f3;
}

.forum-directory-top,
.group-directory-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.forum-filter-strip,
.group-filter-strip {
    margin: 0 0 10px;
    padding: 7px 10px;
    background: #e5e5e5;
    border-top: 1px solid #f7f7f7;
    border-bottom: 1px solid #d4d4d4;
    font-size: 11px;
    color: #666;
}

.directory-chip {
    display: inline-block;
    padding: 2px 7px;
    background: #f4f4f4;
    border: 1px solid #d0d0d0;
    font-size: 11px;
    font-weight: 700;
    color: #666;
}

.directory-chip b {
    display: inline-block;
    margin-left: 4px;
    padding: 0 4px;
    background: #666;
    color: #fff;
    font-size: 10px;
    border-radius: 2px;
}

.forum-order-row,
.group-order-row {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
    font-size: 11px;
    color: #777;
}

.classic-directory-meta {
    margin: 0 0 8px;
    color: #9a9a9a;
    font-size: 10px;
}

body.theme-anime.portal-page[data-page="forums"] .portal-table,
body.theme-anime.portal-page[data-page="groups"] .group-feed-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 11px;
}

body.theme-anime.portal-page[data-page="forums"] .portal-table th,
body.theme-anime.portal-page[data-page="forums"] .portal-table td {
    padding: 8px 8px;
    border-top: 1px solid #e3e3e3;
    color: #666;
    vertical-align: top;
}

body.theme-anime.portal-page[data-page="forums"] .portal-table thead th {
    background: #ededed;
    font-size: 11px;
    font-weight: 700;
}

body.theme-anime.portal-page[data-page="forums"] .portal-table tbody tr:nth-child(odd) {
    background: #f4eed0;
}

body.theme-anime.portal-page[data-page="forums"] .portal-table tbody tr:nth-child(even) {
    background: #f7f7f7;
}

body.theme-anime.portal-page[data-page="forums"] .portal-table tbody tr.selected-topic-row {
    background: #efe6b8;
}

body.theme-anime.portal-page[data-page="forums"] .topic-link {
    display: inline-block;
    margin-bottom: 2px;
    color: #4fa42f;
    font-size: 12px;
    font-weight: 700;
    text-decoration: underline;
}

body.theme-anime.portal-page[data-page="forums"] .table-subline,
body.theme-anime.portal-page[data-page="forums"] .forum-userline {
    color: #7e7e7e;
    font-size: 10px;
    line-height: 1.4;
}

body.theme-anime.portal-page[data-page="forums"] .topic-thread-card,
body.theme-anime.portal-page[data-page="forums"] .reply-card,
body.theme-anime.portal-page[data-page="groups"] .group-feed-card,
body.theme-anime.portal-page[data-page="groups"] .group-comment-card {
    border: 1px solid #e3e3e3;
    background: #fff;
    border-radius: 0;
    box-shadow: none;
}

body.theme-anime.portal-page[data-page="forums"] .classic-thread-wrap {
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid #e2e2e2;
}

body.theme-anime.portal-page[data-page="forums"] .classic-thread-head {
    margin-bottom: 12px;
}

body.theme-anime.portal-page[data-page="forums"] .small-title {
    font-size: 19px;
}

.sidebar-tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 5px 8px;
    padding: 0 12px 12px;
}

.sidebar-tag-cloud a {
    color: #47a62e;
    font-size: 12px;
    line-height: 1.1;
    text-decoration: underline;
}

body.theme-anime.portal-page[data-page="groups"] .group-directory-list {
    display: grid;
    gap: 0;
}

body.theme-anime.portal-page[data-page="groups"] .group-card.classic-group-card {
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr) 170px;
    gap: 14px;
    padding: 12px 0;
    border-top: 1px solid #e3e3e3;
}

body.theme-anime.portal-page[data-page="groups"] .group-card.classic-group-card:first-child {
    border-top: 0;
}

body.theme-anime.portal-page[data-page="groups"] .group-thumb {
    width: 46px;
    height: 46px;
    border: 1px solid #ddd;
    background: #fff center / cover no-repeat;
}

body.theme-anime.portal-page[data-page="groups"] .group-main h3 {
    margin: 0 0 2px;
    font-size: 16px;
    color: #4fa42f;
}

body.theme-anime.portal-page[data-page="groups"] .group-main h3 a {
    color: #4fa42f;
    text-decoration: underline;
}

body.theme-anime.portal-page[data-page="groups"] .group-active {
    display: inline-block;
    margin-bottom: 5px;
    padding: 2px 7px;
    border: 1px solid #e6d59d;
    background: #f8efbb;
    color: #7c6f3d;
    font-size: 10px;
    border-radius: 2px;
}

body.theme-anime.portal-page[data-page="groups"] .group-excerpt {
    font-size: 11px;
    color: #777;
    line-height: 1.5;
}

body.theme-anime.portal-page[data-page="groups"] .group-meta {
    text-align: right;
    font-size: 11px;
    color: #777;
}

body.theme-anime.portal-page[data-page="groups"] .group-meta .inline-actions {
    justify-content: flex-end;
    margin-top: 6px;
}

body.theme-anime.portal-page[data-page="groups"] .group-profile-classic .group-hero {
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr) 110px;
    gap: 12px;
    margin-bottom: 12px;
}

body.theme-anime.portal-page[data-page="groups"] .group-profile-classic .group-profile-picture {
    width: 86px;
    height: 86px;
    border: 1px solid #ddd;
    background: #fff center / cover no-repeat;
}

body.theme-anime.portal-page[data-page="groups"] .group-admin-box {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 4px;
}

body.theme-anime.portal-page[data-page="groups"] .group-admin-slot {
    width: 30px;
    height: 30px;
    border: 1px solid #e1e1e1;
    background: #fafafa;
}

body.theme-anime.portal-page[data-page="groups"] .group-admin-slot img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

body.theme-anime.portal-page[data-page="groups"] .group-type-line,
body.theme-anime.portal-page[data-page="groups"] .group-slug-line,
body.theme-anime.portal-page[data-page="groups"] .group-description-copy,
body.theme-anime.portal-page[data-page="groups"] .group-description-copy p,
body.theme-anime.portal-page[data-page="groups"] .group-feed-body,
body.theme-anime.portal-page[data-page="groups"] .group-feed-time,
body.theme-anime.portal-page[data-page="groups"] .group-members-strip {
    font-size: 11px;
    color: #777;
    line-height: 1.5;
}

body.theme-anime.portal-page[data-page="groups"] .group-nav-strip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin: 0 0 10px;
    padding: 0;
    background: #e6e6e6;
}

body.theme-anime.portal-page[data-page="groups"] .group-detail-tabs {
    display: flex;
    gap: 0;
    margin: 0;
    background: transparent;
}

body.theme-anime.portal-page[data-page="groups"] .group-detail-tabs a {
    display: block;
    padding: 5px 10px;
    color: #4fa42f;
    text-decoration: none;
    font-size: 11px;
}

body.theme-anime.portal-page[data-page="groups"] .group-detail-tabs a.active {
    background: #fff;
    color: #555;
    font-weight: 700;
}

body.theme-anime.portal-page[data-page="groups"] .group-detail-tabs span {
    display: inline-block;
    margin-left: 4px;
    padding: 0 4px;
    background: #29b2da;
    color: #fff;
    border-radius: 2px;
    font-size: 10px;
}

body.theme-anime.portal-page[data-page="groups"] .group-rss-label {
    margin: 0 0 10px;
    color: #4fa42f;
    font-size: 11px;
    font-weight: 700;
}

body.theme-anime.portal-page[data-page="groups"] .group-feed-stack {
    gap: 0;
}

body.theme-anime.portal-page[data-page="groups"] .group-feed-card {
    border: 0;
    border-top: 1px solid #e5e5e5;
    background: transparent;
    padding: 12px 0;
}

body.theme-anime.portal-page[data-page="groups"] .group-feed-card:first-child {
    border-top: 0;
}

body.theme-anime.portal-page[data-page="groups"] .group-feed-head {
    grid-template-columns: 26px minmax(0, 1fr);
    gap: 10px;
}

body.theme-anime.portal-page[data-page="groups"] .group-feed-head img,
body.theme-anime.portal-page[data-page="groups"] .group-feed-head.small img {
    width: 26px;
    height: 26px;
    border: 1px solid #e1e1e1;
    object-fit: cover;
    background: #fff;
}

body.theme-anime.portal-page[data-page="groups"] .group-feed-join {
    display: grid;
    grid-template-columns: 26px minmax(0, 1fr);
    gap: 10px;
    align-items: start;
}

body.theme-anime.portal-page[data-page="groups"] .group-feed-join .group-join-empty {
    width: 26px;
    height: 26px;
    border: 1px solid #e1e1e1;
    background: #fafafa;
}

body.theme-anime.portal-page[data-page="groups"] .group-feed-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    font-size: 11px;
    color: #777;
}

body.theme-anime.portal-page[data-page="groups"] .group-members-list {
    display: grid;
    gap: 0;
}

body.theme-anime.portal-page[data-page="groups"] .group-member-row {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    padding: 10px 0;
    border-top: 1px solid #e5e5e5;
}

body.theme-anime.portal-page[data-page="groups"] .group-member-row:first-child {
    border-top: 0;
}

body.theme-anime.portal-page[data-page="groups"] .group-member-row .member-avatar {
    width: 34px;
    height: 34px;
}

body.theme-anime.portal-page[data-page="groups"] .group-member-meta {
    font-size: 11px;
    color: #777;
}

body.theme-anime.portal-page[data-page="groups"] .load-more-classic {
    display: block;
    width: 100%;
    margin-top: 12px;
    text-align: center;
    padding: 6px 10px;
    border: 1px solid #d4d4d4;
    background: #ececec;
    color: #777;
    font-size: 11px;
}

/* ===== NEW: Group roles sidebar ===== */
body.theme-anime.portal-page[data-page="groups"] .group-sidebar-roles {
    min-width: 110px;
}

body.theme-anime.portal-page[data-page="groups"] .group-sidebar-roles .group-admin-box {
    justify-items: end;
}

/* ===== Portal button refresh ===== */
body.theme-anime.portal-page .green-btn,
body.theme-anime.portal-page .blue-btn,
body.theme-anime.portal-page .red-btn,
body.theme-anime.portal-page .secondary-btn,
body.theme-anime.portal-page .header-search-button,
body.theme-anime.portal-page button,
body.theme-anime.portal-page a.green-btn,
body.theme-anime.portal-page a.blue-btn,
body.theme-anime.portal-page a.red-btn,
body.theme-anime.portal-page a.secondary-btn,
body.theme-anime.portal-page summary.green-btn,
body.theme-anime.portal-page summary.blue-btn,
body.theme-anime.portal-page summary.red-btn,
body.theme-anime.portal-page summary.secondary-btn,
body.theme-anime.portal-home .green-btn,
body.theme-anime.portal-home .blue-btn,
body.theme-anime.portal-home .red-btn,
body.theme-anime.portal-home .secondary-btn,
body.theme-anime.portal-home .header-search-button,
body.theme-anime.portal-home button,
body.theme-anime.portal-home a.green-btn,
body.theme-anime.portal-home a.blue-btn,
body.theme-anime.portal-home a.red-btn,
body.theme-anime.portal-home a.secondary-btn,
body.theme-anime.portal-home summary.green-btn,
body.theme-anime.portal-home summary.blue-btn,
body.theme-anime.portal-home summary.red-btn,
body.theme-anime.portal-home summary.secondary-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 150px;
    min-height: 50px;
    padding: 10px 20px;
    box-sizing: border-box;
    background-image: linear-gradient(to top, #d8d9db 0%, #ffffff 80%, #fdfdfd 100%);
    border: 1px solid #8f9092;
    border-radius: 30px;
    color: #606060;
    cursor: pointer;
    font-family: "Source Sans Pro", sans-serif;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
    text-shadow: 0 1px #ffffff;
    outline: none;
    box-shadow: none;
    transition: box-shadow 0.2s ease, transform 0.2s ease, color 0.2s ease, border-color 0.2s ease;
    -webkit-appearance: none;
    appearance: none;
}

body.theme-anime.portal-page .green-btn:hover,
body.theme-anime.portal-page .blue-btn:hover,
body.theme-anime.portal-page .red-btn:hover,
body.theme-anime.portal-page .secondary-btn:hover,
body.theme-anime.portal-page .header-search-button:hover,
body.theme-anime.portal-page button:hover,
body.theme-anime.portal-page a.green-btn:hover,
body.theme-anime.portal-page a.blue-btn:hover,
body.theme-anime.portal-page a.red-btn:hover,
body.theme-anime.portal-page a.secondary-btn:hover,
body.theme-anime.portal-page summary.green-btn:hover,
body.theme-anime.portal-page summary.blue-btn:hover,
body.theme-anime.portal-page summary.red-btn:hover,
body.theme-anime.portal-page summary.secondary-btn:hover,
body.theme-anime.portal-home .green-btn:hover,
body.theme-anime.portal-home .blue-btn:hover,
body.theme-anime.portal-home .red-btn:hover,
body.theme-anime.portal-home .secondary-btn:hover,
body.theme-anime.portal-home .header-search-button:hover,
body.theme-anime.portal-home button:hover,
body.theme-anime.portal-home a.green-btn:hover,
body.theme-anime.portal-home a.blue-btn:hover,
body.theme-anime.portal-home a.red-btn:hover,
body.theme-anime.portal-home a.secondary-btn:hover,
body.theme-anime.portal-home summary.green-btn:hover,
body.theme-anime.portal-home summary.blue-btn:hover,
body.theme-anime.portal-home summary.red-btn:hover,
body.theme-anime.portal-home summary.secondary-btn:hover {
    color: #555555;
    box-shadow: 0 4px 3px 1px #fcfcfc, 0 6px 8px #d6d7d9, 0 -4px 4px #cecfd1, 0 -6px 4px #fefefe, inset 0 0 3px 3px #cecfd1;
}

body.theme-anime.portal-page .green-btn:active,
body.theme-anime.portal-page .green-btn:focus,
body.theme-anime.portal-page .blue-btn:active,
body.theme-anime.portal-page .blue-btn:focus,
body.theme-anime.portal-page .red-btn:active,
body.theme-anime.portal-page .red-btn:focus,
body.theme-anime.portal-page .secondary-btn:active,
body.theme-anime.portal-page .secondary-btn:focus,
body.theme-anime.portal-page .header-search-button:active,
body.theme-anime.portal-page .header-search-button:focus,
body.theme-anime.portal-page button:active,
body.theme-anime.portal-page button:focus,
body.theme-anime.portal-page a.green-btn:focus,
body.theme-anime.portal-page a.blue-btn:focus,
body.theme-anime.portal-page a.red-btn:focus,
body.theme-anime.portal-page a.secondary-btn:focus,
body.theme-anime.portal-page summary.green-btn:focus,
body.theme-anime.portal-page summary.blue-btn:focus,
body.theme-anime.portal-page summary.red-btn:focus,
body.theme-anime.portal-page summary.secondary-btn:focus,
body.theme-anime.portal-home .green-btn:active,
body.theme-anime.portal-home .green-btn:focus,
body.theme-anime.portal-home .blue-btn:active,
body.theme-anime.portal-home .blue-btn:focus,
body.theme-anime.portal-home .red-btn:active,
body.theme-anime.portal-home .red-btn:focus,
body.theme-anime.portal-home .secondary-btn:active,
body.theme-anime.portal-home .secondary-btn:focus,
body.theme-anime.portal-home .header-search-button:active,
body.theme-anime.portal-home .header-search-button:focus,
body.theme-anime.portal-home button:active,
body.theme-anime.portal-home button:focus,
body.theme-anime.portal-home a.green-btn:focus,
body.theme-anime.portal-home a.blue-btn:focus,
body.theme-anime.portal-home a.red-btn:focus,
body.theme-anime.portal-home a.secondary-btn:focus,
body.theme-anime.portal-home summary.green-btn:focus,
body.theme-anime.portal-home summary.blue-btn:focus,
body.theme-anime.portal-home summary.red-btn:focus,
body.theme-anime.portal-home summary.secondary-btn:focus {
    color: #565656;
    box-shadow: 0 4px 3px 1px #fcfcfc, 0 6px 8px #d6d7d9, 0 -4px 4px #cecfd1, 0 -6px 4px #fefefe, inset 0 0 5px 3px #999999, inset 0 0 30px #aaaaaa;
}

body.theme-anime.portal-page .green-btn.tiny,
body.theme-anime.portal-page .blue-btn.tiny,
body.theme-anime.portal-page .red-btn.tiny,
body.theme-anime.portal-page .secondary-btn.tiny,
body.theme-anime.portal-home .green-btn.tiny,
body.theme-anime.portal-home .blue-btn.tiny,
body.theme-anime.portal-home .red-btn.tiny,
body.theme-anime.portal-home .secondary-btn.tiny {
    min-width: 108px;
    min-height: 40px;
    padding: 8px 16px;
    font-size: 13px;
}

body.theme-anime.portal-page .full-btn,
body.theme-anime.portal-home .full-btn {
    width: 100%;
}

body.theme-anime.portal-page .header-search-button,
body.theme-anime.portal-home .header-search-button {
    min-width: 120px;
}

body.theme-anime.portal-page .danger-btn,
body.theme-anime.portal-page .red-btn,
body.theme-anime.portal-home .danger-btn,
body.theme-anime.portal-home .red-btn {
    border-color: #9d7d7d;
    color: #7a4f4f;
}

body.theme-anime.portal-page .danger-btn:hover,
body.theme-anime.portal-page .red-btn:hover,
body.theme-anime.portal-home .danger-btn:hover,
body.theme-anime.portal-home .red-btn:hover {
    color: #6c3f3f;
}

body.theme-anime.portal-page .delete-btn,
body.theme-anime.portal-home .delete-btn {
    min-width: 24px;
    width: 24px;
    min-height: 24px;
    height: 24px;
    padding: 0;
    border-radius: 999px;
    font-size: 16px;
    line-height: 1;
}

@media (max-width: 640px) {
    body.theme-anime.portal-page .green-btn,
    body.theme-anime.portal-page .blue-btn,
    body.theme-anime.portal-page .red-btn,
    body.theme-anime.portal-page .secondary-btn,
    body.theme-anime.portal-page .header-search-button,
    body.theme-anime.portal-page button,
    body.theme-anime.portal-page a.green-btn,
    body.theme-anime.portal-page a.blue-btn,
    body.theme-anime.portal-page a.red-btn,
    body.theme-anime.portal-page a.secondary-btn,
    body.theme-anime.portal-page summary.green-btn,
    body.theme-anime.portal-page summary.blue-btn,
    body.theme-anime.portal-page summary.red-btn,
    body.theme-anime.portal-page summary.secondary-btn,
    body.theme-anime.portal-home .green-btn,
    body.theme-anime.portal-home .blue-btn,
    body.theme-anime.portal-home .red-btn,
    body.theme-anime.portal-home .secondary-btn,
    body.theme-anime.portal-home .header-search-button,
    body.theme-anime.portal-home button,
    body.theme-anime.portal-home a.green-btn,
    body.theme-anime.portal-home a.blue-btn,
    body.theme-anime.portal-home a.red-btn,
    body.theme-anime.portal-home a.secondary-btn,
    body.theme-anime.portal-home summary.green-btn,
    body.theme-anime.portal-home summary.blue-btn,
    body.theme-anime.portal-home summary.red-btn,
    body.theme-anime.portal-home summary.secondary-btn {
        min-width: 100%;
    }

    body.theme-anime.portal-page .portal-inline-form .green-btn,
    body.theme-anime.portal-page .portal-inline-form .blue-btn,
    body.theme-anime.portal-page .portal-inline-form .red-btn,
    body.theme-anime.portal-page .portal-inline-form .secondary-btn,
    body.theme-anime.portal-page .header-search-button,
    body.theme-anime.portal-home .portal-inline-form .green-btn,
    body.theme-anime.portal-home .portal-inline-form .blue-btn,
    body.theme-anime.portal-home .portal-inline-form .red-btn,
    body.theme-anime.portal-home .portal-inline-form .secondary-btn,
    body.theme-anime.portal-home .header-search-button {
        min-width: 120px;
    }
}

body.theme-anime.portal-page .header-search-button,
body.theme-anime.portal-home .header-search-button {
    display: inline-block;
    min-width: 0;
    width: auto;
    min-height: 24px;
    height: 28px;
    padding: 0 8px;
    border: 1px solid #c8c8c8;
    border-radius: 2px;
    background: linear-gradient(180deg, #fbfbfb, #ececec);
    color: #666666;
    font-family: Arial, Tahoma, Verdana, sans-serif;
    font-size: 11px;
    font-weight: 700;
    line-height: 26px;
    text-shadow: none;
    box-shadow: none;
}

body.theme-anime.portal-page .header-search-form .header-search-button:hover,
body.theme-anime.portal-home .header-search-form .header-search-button:hover,
body.theme-anime.portal-page .inline-search .header-search-button:hover,
body.theme-anime.portal-page .header-search-form .header-search-button:active,
body.theme-anime.portal-home .header-search-form .header-search-button:active,
body.theme-anime.portal-page .inline-search .header-search-button:active,
body.theme-anime.portal-page .header-search-form .header-search-button:focus,
body.theme-anime.portal-home .header-search-form .header-search-button:focus,
body.theme-anime.portal-page .inline-search .header-search-button:focus {
    background: linear-gradient(180deg, #ffffff, #f2f2f2);
    color: #444444;
    box-shadow: none;
}

body.theme-anime.portal-page .header-search-input,
body.theme-anime.portal-home .header-search-input {
    box-sizing: border-box;
    width: 150px;
    height: 22px;
    padding: 0 6px 0 10px;
    border: 2px solid transparent;
    border-radius: 10px;
    outline: none;
    overflow: hidden;
    background-color: #f3f3f3;
    color: #4d5a40;
    transition: border-color 0.5s ease, box-shadow 0.5s ease, background-color 0.5s ease;
}

body.theme-anime.portal-page .header-search-input:hover,
body.theme-anime.portal-page .header-search-input:focus,
body.theme-anime.portal-home .header-search-input:hover,
body.theme-anime.portal-home .header-search-input:focus {
    border-color: var(--green-line);
    background-color: #ffffff;
    box-shadow: 0 0 0 7px rgba(125, 194, 75, 0.2);
}

body.theme-anime.portal-page .inline-search .portal-search-input,
body.theme-anime.portal-home .inline-search .portal-search-input {
    box-sizing: border-box;
    min-width: 180px;
    height: 26px;
    padding: 0 8px 0 10px;
    border: 2px solid transparent;
    border-radius: 10px;
    outline: none;
    overflow: hidden;
    background-color: #f3f3f3;
    color: #4d5a40;
    transition: border-color 0.5s ease, box-shadow 0.5s ease, background-color 0.5s ease;
}

body.theme-anime.portal-page .inline-search .portal-search-input:hover,
body.theme-anime.portal-page .inline-search .portal-search-input:focus,
body.theme-anime.portal-home .inline-search .portal-search-input:hover,
body.theme-anime.portal-home .inline-search .portal-search-input:focus {
    border-color: var(--green-line);
    background-color: #ffffff;
    box-shadow: 0 0 0 7px rgba(125, 194, 75, 0.2);
}

body.theme-anime.portal-page .portal-login-form label:not(.remember-toggle),
body.theme-anime.portal-page .portal-register-form label,
body.theme-anime.portal-home .portal-login-form label:not(.remember-toggle),
body.theme-anime.portal-home .portal-register-form label {
    display: block;
    margin-bottom: 0.3rem;
    font-size: 0.9rem;
    font-weight: 700;
    color: rgba(78, 160, 63, 0.68);
    transition: color 0.3s cubic-bezier(.25, .01, .25, 1);
}

body.theme-anime.portal-page .portal-login-form .sidebar-input,
body.theme-anime.portal-page .portal-register-form .sidebar-input,
body.theme-anime.portal-home .portal-login-form .sidebar-input,
body.theme-anime.portal-home .portal-register-form .sidebar-input {
    box-sizing: border-box;
    width: 100%;
    height: 26px;
    min-height: 26px;
    margin-bottom: 6px;
    max-width: none;
    padding: 0 1rem;
    border: 2px solid transparent;
    outline: none;
    border-radius: 0.5rem;
    background-color: rgba(125, 194, 75, 0.08);
    color: #3e4932;
    font-size: 12px;
    box-shadow: none;
    transition: border-color 0.3s cubic-bezier(.25, .01, .25, 1), color 0.3s cubic-bezier(.25, .01, .25, 1), background-color 0.2s cubic-bezier(.25, .01, .25, 1), box-shadow 0.2s ease;
}

body.theme-anime.portal-page .portal-login-form .sidebar-input:hover,
body.theme-anime.portal-page .portal-login-form .sidebar-input:focus,
body.theme-anime.portal-page .portal-register-form .sidebar-input:hover,
body.theme-anime.portal-page .portal-register-form .sidebar-input:focus,
body.theme-anime.portal-home .portal-login-form .sidebar-input:hover,
body.theme-anime.portal-home .portal-login-form .sidebar-input:focus,
body.theme-anime.portal-home .portal-register-form .sidebar-input:hover,
body.theme-anime.portal-home .portal-register-form .sidebar-input:focus {
    outline: none;
    border-color: var(--green-line);
    background-color: #ffffff;
    color: var(--green-dark);
    box-shadow: 0 0 0 3px rgba(125, 194, 75, 0.12);
}

body.theme-anime.portal-page .portal-login-form:focus-within label:not(.remember-toggle),
body.theme-anime.portal-page .portal-register-form:focus-within label,
body.theme-anime.portal-home .portal-login-form:focus-within label:not(.remember-toggle),
body.theme-anime.portal-home .portal-register-form:focus-within label {
    color: rgba(78, 160, 63, 0.9);
}

body.theme-anime.portal-page .cntr,
body.theme-anime.portal-home .cntr {
    position: relative;
}

body.theme-anime.portal-page .remember-row.compact,
body.theme-anime.portal-home .remember-row.compact {
    display: flex;
    align-items: center;
    gap: 0;
    margin: 6px 0 10px;
}

body.theme-anime.portal-page .hidden-xs-up,
body.theme-anime.portal-home .hidden-xs-up {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

body.theme-anime.portal-page .remember-toggle,
body.theme-anime.portal-home .remember-toggle {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

body.theme-anime.portal-page .cbx,
body.theme-anime.portal-home .cbx {
    position: relative;
    top: 1px;
    width: 16px;
    height: 16px;
    border: 1px solid #c8ccd4;
    border-radius: 3px;
    vertical-align: middle;
    transition: background 0.1s ease, border-color 0.1s ease, box-shadow 0.2s ease;
    cursor: pointer;
    display: block;
    background: #ffffff;
    flex: 0 0 16px;
}

body.theme-anime.portal-page .cbx::after,
body.theme-anime.portal-home .cbx::after {
    content: '';
    position: absolute;
    top: 1px;
    left: 4px;
    width: 4px;
    height: 9px;
    opacity: 0;
    transform: rotate(45deg) scale(0);
    border-right: 2px solid #fff;
    border-bottom: 2px solid #fff;
    transition: all 0.3s ease;
    transition-delay: 0.15s;
}

body.theme-anime.portal-page .lbl,
body.theme-anime.portal-home .lbl {
    margin-left: 6px;
    vertical-align: middle;
    cursor: pointer;
    color: #666666;
    font-size: 12px;
    line-height: 1.2;
}

body.theme-anime.portal-page .remember-checkbox:checked + .remember-toggle .cbx,
body.theme-anime.portal-home .remember-checkbox:checked + .remember-toggle .cbx {
    border-color: transparent;
    background: var(--green-line);
    animation: portal-checkbox-jelly 0.6s ease;
}

body.theme-anime.portal-page .remember-checkbox:checked + .remember-toggle .cbx::after,
body.theme-anime.portal-home .remember-checkbox:checked + .remember-toggle .cbx::after {
    opacity: 1;
    transform: rotate(45deg) scale(1);
}

body.theme-anime.portal-page .remember-checkbox:focus-visible + .remember-toggle .cbx,
body.theme-anime.portal-home .remember-checkbox:focus-visible + .remember-toggle .cbx,
body.theme-anime.portal-page .remember-toggle:hover .cbx,
body.theme-anime.portal-home .remember-toggle:hover .cbx {
    box-shadow: 0 0 0 4px rgba(125, 194, 75, 0.18);
    border-color: var(--green-line);
}

@keyframes portal-checkbox-jelly {
    from {
        transform: scale(1, 1);
    }

    30% {
        transform: scale(1.25, 0.75);
    }

    40% {
        transform: scale(0.75, 1.25);
    }

    50% {
        transform: scale(1.15, 0.85);
    }

    65% {
        transform: scale(0.95, 1.05);
    }

    75% {
        transform: scale(1.05, 0.95);
    }

    to {
        transform: scale(1, 1);
    }
}

body.theme-anime.portal-page[data-page="groups"] .green-btn,
body.theme-anime.portal-page[data-page="groups"] .blue-btn,
body.theme-anime.portal-page[data-page="groups"] .red-btn,
body.theme-anime.portal-page[data-page="groups"] .secondary-btn,
body.theme-anime.portal-page[data-page="groups"] button,
body.theme-anime.portal-page[data-page="groups"] a.green-btn,
body.theme-anime.portal-page[data-page="groups"] a.blue-btn,
body.theme-anime.portal-page[data-page="groups"] a.red-btn,
body.theme-anime.portal-page[data-page="groups"] a.secondary-btn,
body.theme-anime.portal-page[data-page="members"] .green-btn,
body.theme-anime.portal-page[data-page="members"] .blue-btn,
body.theme-anime.portal-page[data-page="members"] .red-btn,
body.theme-anime.portal-page[data-page="members"] .secondary-btn,
body.theme-anime.portal-page[data-page="members"] button,
body.theme-anime.portal-page[data-page="members"] a.green-btn,
body.theme-anime.portal-page[data-page="members"] a.blue-btn,
body.theme-anime.portal-page[data-page="members"] a.red-btn,

body.theme-anime.portal-page[data-page="groups"] .inline-search > .green-btn.tiny,
body.theme-anime.portal-page[data-page="members"] .inline-search > .green-btn.tiny {
    display: inline-block;
    min-width: 0;
    width: auto;
    min-height: 24px;
    height: 28px;
    padding: 0 8px;
    border: 1px solid #c8c8c8;
    border-radius: 2px;
    background: linear-gradient(180deg, #fbfbfb, #ececec);
    color: #666666;
    font-family: Arial, Tahoma, Verdana, sans-serif;
    font-size: 11px;
    font-weight: 700;
    line-height: 26px;
    text-shadow: none;
    box-shadow: none;
}

body.theme-anime.portal-page[data-page="groups"] .inline-search > .green-btn.tiny:hover,
body.theme-anime.portal-page[data-page="groups"] .inline-search > .green-btn.tiny:active,
body.theme-anime.portal-page[data-page="groups"] .inline-search > .green-btn.tiny:focus,
body.theme-anime.portal-page[data-page="members"] .inline-search > .green-btn.tiny:hover,
body.theme-anime.portal-page[data-page="members"] .inline-search > .green-btn.tiny:active,
body.theme-anime.portal-page[data-page="members"] .inline-search > .green-btn.tiny:focus {
    background: linear-gradient(180deg, #ffffff, #f2f2f2);
    color: #444444;
    box-shadow: none;
}
body.theme-anime.portal-page[data-page="forums"] .inline-search > .green-btn.tiny {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    width: auto;
    min-height: 28px;
    height: 28px;
    padding: 0 14px;
    border: 1px solid #65aa31;
    border-radius: 14px;
    background: linear-gradient(180deg, #7fd03a, #66b82e);
    color: #fff;
    font-family: inherit;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    text-shadow: none;
    box-shadow: none;
}
body.theme-anime.portal-page[data-page="forums"] .inline-search > .green-btn.tiny:hover,
body.theme-anime.portal-page[data-page="forums"] .inline-search > .green-btn.tiny:active,
body.theme-anime.portal-page[data-page="forums"] .inline-search > .green-btn.tiny:focus {
    background: linear-gradient(180deg, #8bd84c, #70c532);
    color: #fff;
    box-shadow: none;
}
body.theme-anime.portal-page[data-page="members"] a.secondary-btn,
body.theme-anime.portal-page[data-page="forums"] .green-btn,
body.theme-anime.portal-page[data-page="forums"] .blue-btn,
body.theme-anime.portal-page[data-page="forums"] .red-btn,
body.theme-anime.portal-page[data-page="forums"] .secondary-btn,
body.theme-anime.portal-page[data-page="forums"] button,
body.theme-anime.portal-page[data-page="forums"] a.green-btn,
body.theme-anime.portal-page[data-page="forums"] a.blue-btn,
body.theme-anime.portal-page[data-page="forums"] a.red-btn,
body.theme-anime.portal-page[data-page="forums"] a.secondary-btn {
    min-width: 132px;
    min-height: 42px;
    padding: 8px 16px;
    font-size: 13px;
    border-radius: 24px;
}

body.theme-anime.portal-page[data-page="groups"] .green-btn.tiny,
body.theme-anime.portal-page[data-page="groups"] .blue-btn.tiny,
body.theme-anime.portal-page[data-page="groups"] .red-btn.tiny,
body.theme-anime.portal-page[data-page="groups"] .secondary-btn.tiny,
body.theme-anime.portal-page[data-page="members"] .green-btn.tiny,
body.theme-anime.portal-page[data-page="members"] .blue-btn.tiny,
body.theme-anime.portal-page[data-page="members"] .red-btn.tiny,
body.theme-anime.portal-page[data-page="members"] .secondary-btn.tiny,
body.theme-anime.portal-page[data-page="forums"] .green-btn.tiny,
body.theme-anime.portal-page[data-page="forums"] .blue-btn.tiny,
body.theme-anime.portal-page[data-page="forums"] .red-btn.tiny,
body.theme-anime.portal-page[data-page="forums"] .secondary-btn.tiny {
    min-width: 92px;
    min-height: 34px;
    padding: 6px 12px;
    font-size: 12px;
    border-radius: 20px;
}

/* ===== NEW: Group member actions area ===== */
body.theme-anime.portal-page[data-page="groups"] .group-member-actions {
    display: flex;
    gap: 4px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
}

/* ===== NEW: Group forum table inside group profile ===== */
body.theme-anime.portal-page[data-page="groups"] .group-forum-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 11px;
    margin-bottom: 12px;
}

body.theme-anime.portal-page[data-page="groups"] .group-forum-table th,
body.theme-anime.portal-page[data-page="groups"] .group-forum-table td {
    padding: 8px;
    border-top: 1px solid #e3e3e3;
    color: #666;
    vertical-align: top;
}

body.theme-anime.portal-page[data-page="groups"] .group-forum-table thead th {
    background: #ededed;
    font-size: 11px;
    font-weight: 700;
}

body.theme-anime.portal-page[data-page="groups"] .group-forum-table tbody tr:nth-child(odd) {
    background: #f4eed0;
}

body.theme-anime.portal-page[data-page="groups"] .group-forum-table tbody tr:nth-child(even) {
    background: #f7f7f7;
}

body.theme-anime.portal-page[data-page="groups"] .group-forum-table .topic-link {
    display: inline-block;
    margin-bottom: 2px;
    color: #4fa42f;
    font-size: 12px;
    font-weight: 700;
    text-decoration: underline;
}

body.theme-anime.portal-page[data-page="groups"] .group-forum-table .table-subline,
body.theme-anime.portal-page[data-page="groups"] .group-forum-table .forum-userline {
    color: #7e7e7e;
    font-size: 10px;
    line-height: 1.4;
}

/* ===== NEW: Group room info ===== */
body.theme-anime.portal-page[data-page="groups"] .group-room-info {
    margin-top: 6px;
    padding: 5px 8px;
    background: #e8f5e2;
    border: 1px solid #c8e0be;
    font-size: 11px;
    color: #3d7a2e;
}

body.theme-anime.portal-page[data-page="groups"] .group-room-info a {
    color: #4fa42f;
    font-weight: 700;
    text-decoration: underline;
}

body.theme-anime.portal-page[data-page="groups"] .group-room-expiry {
    color: #888;
    font-size: 10px;
    margin-left: 4px;
}

/* ===== NEW: Group bio block ===== */
body.theme-anime.portal-page[data-page="groups"] .group-bio-block {
    margin-top: 6px;
    padding: 6px 8px;
    background: #f7f7f7;
    border-left: 3px solid #ddd;
    font-size: 11px;
    color: #666;
    line-height: 1.5;
}

/* ===== NEW: Forum topic row with group thumbnail ===== */
.forum-topic-row-inner {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.forum-group-thumb {
    flex-shrink: 0;
    width: 30px;
    height: 30px;
    border: 1px solid #ddd;
    background: #fff center / cover no-repeat;
    display: block;
}

/* ===== NEW: Thread cards in group profile ===== */
body.theme-anime.portal-page[data-page="groups"] .topic-thread-card,
body.theme-anime.portal-page[data-page="groups"] .reply-card {
    border: 1px solid #e3e3e3;
    background: #fff;
    padding: 12px;
    margin-bottom: 0;
}

body.theme-anime.portal-page[data-page="groups"] .classic-thread-wrap {
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid #e2e2e2;
}

body.theme-anime.portal-page[data-page="groups"] .classic-thread-head {
    margin-bottom: 12px;
}

body.theme-anime.portal-page[data-page="groups"] .small-title {
    font-size: 19px;
}

body.theme-anime.portal-page[data-page="groups"] .activity-meta {
    font-size: 11px;
    color: #777;
}

body.theme-anime.portal-page[data-page="groups"] .reply-stack {
    display: grid;
    gap: 0;
}

body.theme-anime.portal-page[data-page="groups"] .compact-top-gap {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid #e2e2e2;
}

/* =========================
   Dedicated portal mobile UI
   ========================= */

body.theme-anime.portal-page .portal-mobile-topbar,
body.theme-anime.portal-page .portal-mobile-hero,
body.theme-anime.portal-page .portal-mobile-panel-head,
body.theme-anime.portal-page .portal-mobile-backdrop,
body.theme-anime.portal-home .portal-mobile-topbar,
body.theme-anime.portal-home .portal-mobile-hero,
body.theme-anime.portal-home .portal-mobile-panel-head,
body.theme-anime.portal-home .portal-mobile-backdrop {
    display: none;
}

html.portal-mobile-locked,
body.portal-mobile-locked {
    overflow: hidden;
}

@media (max-width: 920px) {
    body.theme-anime.portal-page,
    body.theme-anime.portal-home {
        background:
            radial-gradient(circle at top left, rgba(255, 255, 255, 0.32) 0 180px, transparent 181px),
            linear-gradient(180deg, #c3ef82 0%, #b8eb73 40%, #b2e664 100%);
    }

    body.theme-anime.portal-page #header,
    body.theme-anime.portal-home #header {
        z-index: auto;
    }

    body.theme-anime.portal-page .portal-shell,
    body.theme-anime.portal-home .portal-shell {
        width: 100%;
        padding: 0 0 calc(24px + env(safe-area-inset-bottom, 0px));
    }

    body.theme-anime.portal-page #container,
    body.theme-anime.portal-home #container {
        border: 0;
        border-radius: 0;
        background: transparent;
        box-shadow: none;
    }

    body.theme-anime.portal-page #header,
    body.theme-anime.portal-home #header {
        position: relative;
        min-height: 0;
        margin: 0;
        padding: 0;
        border-radius: 0 0 28px 28px;
        background:
            linear-gradient(180deg, rgba(17, 73, 15, 0.08), rgba(0, 0, 0, 0.22)),
            url("../../images/website assets/portal-banner.jpg") center center / cover no-repeat;
        box-shadow: 0 20px 38px rgba(72, 97, 35, 0.18);
        overflow: hidden;
    }

    body.theme-anime.portal-page .portal-banner,
    body.theme-anime.portal-home .portal-banner {
        display: block;
        min-height: 0;
        padding: 18px 16px 26px;
    }

    body.theme-anime.portal-page .portal-branding,
    body.theme-anime.portal-home .portal-branding {
        display: none;
    }

    body.theme-anime.portal-page .portal-mobile-topbar,
    body.theme-anime.portal-page .portal-mobile-hero,
    body.theme-anime.portal-page .portal-mobile-panel-head,
    body.theme-anime.portal-page .portal-mobile-backdrop,
    body.theme-anime.portal-home .portal-mobile-topbar,
    body.theme-anime.portal-home .portal-mobile-hero,
    body.theme-anime.portal-home .portal-mobile-panel-head,
    body.theme-anime.portal-home .portal-mobile-backdrop {
        display: block;
    }

    body.theme-anime.portal-page .portal-mobile-topbar,
    body.theme-anime.portal-home .portal-mobile-topbar {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 12px;
    }

    body.theme-anime.portal-page .portal-mobile-brand-lockup,
    body.theme-anime.portal-home .portal-mobile-brand-lockup {
        min-width: 0;
        display: grid;
        gap: 4px;
    }

    body.theme-anime.portal-page .portal-mobile-kicker,
    body.theme-anime.portal-page .portal-mobile-panel-kicker,
    body.theme-anime.portal-home .portal-mobile-kicker,
    body.theme-anime.portal-home .portal-mobile-panel-kicker {
        display: block;
        font-size: 10px;
        font-weight: 700;
        letter-spacing: 0.18em;
        text-transform: uppercase;
    }

    body.theme-anime.portal-page .portal-mobile-kicker,
    body.theme-anime.portal-home .portal-mobile-kicker {
        color: rgba(245, 255, 236, 0.78);
    }

    body.theme-anime.portal-page .portal-mobile-panel-kicker,
    body.theme-anime.portal-home .portal-mobile-panel-kicker {
        color: #839772;
    }

    body.theme-anime.portal-page .portal-mobile-home-link,
    body.theme-anime.portal-home .portal-mobile-home-link {
        color: #fff;
        font-size: 20px;
        font-weight: 700;
        line-height: 1.1;
        text-decoration: none;
        text-shadow: 0 1px 0 rgba(0, 0, 0, 0.18);
    }

    body.theme-anime.portal-page .portal-mobile-actions,
    body.theme-anime.portal-home .portal-mobile-actions {
        display: flex;
        gap: 8px;
        flex-wrap: wrap;
        justify-content: flex-end;
    }

    body.theme-anime.portal-page .portal-mobile-action,
    body.theme-anime.portal-page .portal-mobile-pill,
    body.theme-anime.portal-home .portal-mobile-action,
    body.theme-anime.portal-home .portal-mobile-pill {
        -webkit-backdrop-filter: blur(14px);
        backdrop-filter: blur(14px);
    }

    body.theme-anime.portal-page .portal-mobile-action,
    body.theme-anime.portal-home .portal-mobile-action {
        min-height: 40px;
        padding: 0 14px;
        border: 1px solid rgba(255, 255, 255, 0.24);
        border-radius: 14px;
        background: rgba(255, 255, 255, 0.17);
        color: #fff;
        font: inherit;
        font-size: 12px;
        font-weight: 700;
        cursor: pointer;
        text-shadow: 0 1px 0 rgba(0, 0, 0, 0.16);
    }

    body.theme-anime.portal-page .portal-mobile-hero,
    body.theme-anime.portal-home .portal-mobile-hero {
        display: grid;
        gap: 12px;
        margin-top: 18px;
        padding: 20px;
        border: 1px solid rgba(255, 255, 255, 0.18);
        border-radius: 24px;
        background: linear-gradient(180deg, rgba(12, 74, 18, 0.18), rgba(255, 255, 255, 0.08));
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16);
    }

    body.theme-anime.portal-page .portal-mobile-eyebrow,
    body.theme-anime.portal-home .portal-mobile-eyebrow {
        color: rgba(245, 255, 235, 0.86);
        font-size: 11px;
        font-weight: 700;
        letter-spacing: 0.18em;
        text-transform: uppercase;
    }

    body.theme-anime.portal-page .portal-mobile-title,
    body.theme-anime.portal-home .portal-mobile-title {
        margin: 0;
        color: #fff;
        font-size: clamp(28px, 7vw, 36px);
        line-height: 1.05;
        text-shadow: 0 1px 0 rgba(0, 0, 0, 0.2);
    }

    body.theme-anime.portal-page .portal-mobile-subtitle,
    body.theme-anime.portal-home .portal-mobile-subtitle {
        max-width: 32ch;
        margin: 0;
        color: rgba(245, 255, 235, 0.92);
        font-size: 13px;
        line-height: 1.65;
    }

    body.theme-anime.portal-page .portal-mobile-meta,
    body.theme-anime.portal-home .portal-mobile-meta {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }

    body.theme-anime.portal-page .portal-mobile-pill,
    body.theme-anime.portal-home .portal-mobile-pill {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-height: 36px;
        padding: 0 14px;
        border: 1px solid rgba(255, 255, 255, 0.16);
        border-radius: 999px;
        font-size: 12px;
        font-weight: 700;
        text-decoration: none;
    }

    body.theme-anime.portal-page .portal-mobile-pill:not(.is-soft),
    body.theme-anime.portal-home .portal-mobile-pill:not(.is-soft) {
        background: rgba(255, 255, 255, 0.96);
        color: #537137;
    }

    body.theme-anime.portal-page .portal-mobile-pill.is-soft,
    body.theme-anime.portal-home .portal-mobile-pill.is-soft {
        background: rgba(255, 255, 255, 0.16);
        color: #fff;
    }

    body.theme-anime.portal-page .portal-mobile-backdrop,
    body.theme-anime.portal-home .portal-mobile-backdrop {
        position: fixed;
        inset: 0;
        z-index: 980;
        border: 0;
        padding: 0;
        background: rgba(31, 43, 13, 0.42);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.2s ease;
    }

    body.theme-anime.portal-page.portal-mobile-panel-open .portal-mobile-backdrop,
    body.theme-anime.portal-home.portal-mobile-panel-open .portal-mobile-backdrop {
        opacity: 1;
        pointer-events: auto;
    }

    body.theme-anime.portal-page #search-bar,
    body.theme-anime.portal-page #navigation,
    body.theme-anime.portal-page #sidebar,
    body.theme-anime.portal-home #search-bar,
    body.theme-anime.portal-home #navigation,
    body.theme-anime.portal-home #sidebar {
        position: fixed;
        left: 14px;
        right: 14px;
        width: auto;
        margin: 0;
        z-index: 1200;
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        border: 1px solid rgba(145, 178, 103, 0.5);
        border-radius: 24px;
        background: rgba(253, 255, 250, 0.96);
        box-shadow: 0 28px 54px rgba(58, 79, 27, 0.22);
        overflow: hidden;
        overflow-y: auto;
        overscroll-behavior: contain;
        transition: transform 0.24s ease, opacity 0.22s ease, visibility 0s linear 0.24s;
    }

    body.theme-anime.portal-page #search-bar,
    body.theme-anime.portal-home #search-bar {
        top: 14px;
        max-height: calc(100dvh - 28px);
        transform: translateY(-16px);
    }

    body.theme-anime.portal-page #navigation,
    body.theme-anime.portal-home #navigation {
        top: 96px;
        bottom: 14px;
        max-height: calc(100dvh - 110px);
        transform: translateY(20px);
    }

    body.theme-anime.portal-page #sidebar,
    body.theme-anime.portal-home #sidebar {
        top: 72px;
        bottom: 14px;
        max-height: calc(100dvh - 86px);
        transform: translateY(20px);
    }

    body.theme-anime.portal-page[data-mobile-panel="search-bar"] #search-bar,
    body.theme-anime.portal-page[data-mobile-panel="navigation"] #navigation,
    body.theme-anime.portal-page[data-mobile-panel="sidebar"] #sidebar,
    body.theme-anime.portal-home[data-mobile-panel="search-bar"] #search-bar,
    body.theme-anime.portal-home[data-mobile-panel="navigation"] #navigation,
    body.theme-anime.portal-home[data-mobile-panel="sidebar"] #sidebar {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        transform: translateY(0);
        transition-delay: 0s;
    }

    body.theme-anime.portal-page .portal-mobile-panel-head,
    body.theme-anime.portal-home .portal-mobile-panel-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        padding: 16px 16px 12px;
        border-bottom: 1px solid rgba(168, 193, 132, 0.3);
    }

    body.theme-anime.portal-page .portal-mobile-panel-head strong,
    body.theme-anime.portal-home .portal-mobile-panel-head strong {
        color: #4a5f37;
        font-size: 18px;
        line-height: 1.15;
    }

    body.theme-anime.portal-page .portal-mobile-panel-close,
    body.theme-anime.portal-home .portal-mobile-panel-close {
        display: inline-grid;
        place-items: center;
        width: 40px;
        height: 40px;
        border: 1px solid rgba(150, 184, 106, 0.45);
        border-radius: 14px;
        background: #eef7df;
        color: #58743b;
        font-size: 22px;
        line-height: 1;
        cursor: pointer;
    }

    body.theme-anime.portal-page #search-bar .padder,
    body.theme-anime.portal-home #search-bar .padder {
        padding: 0 16px 18px;
    }

    body.theme-anime.portal-page #search-bar .header-search-form,
    body.theme-anime.portal-home #search-bar .header-search-form {
        display: grid;
        gap: 10px;
    }

    body.theme-anime.portal-page #search-bar .header-search-input,
    body.theme-anime.portal-page #search-bar .header-search-scope,
    body.theme-anime.portal-page #search-bar .header-search-button,
    body.theme-anime.portal-home #search-bar .header-search-input,
    body.theme-anime.portal-home #search-bar .header-search-scope,
    body.theme-anime.portal-home #search-bar .header-search-button {
        width: 100%;
        height: 46px;
        margin: 0;
        padding: 0 14px;
        border: 1px solid #d7e6c5;
        border-radius: 16px;
        font-size: 14px;
        color: #4e603d;
        background: #fff;
        box-shadow: none;
    }

    body.theme-anime.portal-page #search-bar .header-search-button,
    body.theme-anime.portal-home #search-bar .header-search-button {
        background: linear-gradient(180deg, #7fd03a, #66b82e);
        border-color: #65aa31;
        color: #fff;
    }

    body.theme-anime.portal-page #navigation,
    body.theme-anime.portal-home #navigation {
        padding-bottom: 6px;
    }

    body.theme-anime.portal-page #nav,
    body.theme-anime.portal-home #nav {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
        float: none;
        margin: 0;
        padding: 0 16px 18px;
        background: transparent;
        list-style: none;
    }

    body.theme-anime.portal-page #nav > li,
    body.theme-anime.portal-home #nav > li {
        float: none;
        margin: 0;
    }

    body.theme-anime.portal-page #nav > li > a,
    body.theme-anime.portal-home #nav > li > a {
        display: flex;
        align-items: center;
        min-height: 58px;
        padding: 0 16px;
        border: 1px solid #d9e8c9;
        border-radius: 18px;
        background: linear-gradient(180deg, #ffffff, #f4f9ed);
        color: #5a6c48;
        font-size: 13px;
        font-weight: 700;
        text-decoration: none;
        box-shadow: 0 12px 24px rgba(111, 133, 71, 0.08);
    }

    body.theme-anime.portal-page #nav > li.selected > a,
    body.theme-anime.portal-page #nav > li > a.active,
    body.theme-anime.portal-home #nav > li.selected > a,
    body.theme-anime.portal-home #nav > li > a.active {
        background: linear-gradient(180deg, #7ed137, #61b62b);
        border-color: transparent;
        color: #fff;
        text-shadow: 0 1px 0 rgba(0, 0, 0, 0.14);
        box-shadow: 0 18px 30px rgba(74, 123, 28, 0.22);
    }

    body.theme-anime.portal-page #sidebar,
    body.theme-anime.portal-home #sidebar {
        background: rgba(252, 255, 248, 0.98);
    }

    body.theme-anime.portal-page #sidebar > .padder,
    body.theme-anime.portal-home #sidebar > .padder {
        max-height: calc(100dvh - 172px);
        padding: 0 16px 20px;
        overflow: auto;
    }

    body.theme-anime.portal-page #sidebar .sidebar-box,
    body.theme-anime.portal-home #sidebar .sidebar-box {
        margin: 0 0 12px;
        padding: 16px;
        border: 1px solid #dfedd1;
        border-radius: 20px;
        background: linear-gradient(180deg, #ffffff, #f7fbf1);
        box-shadow: 0 14px 28px rgba(99, 121, 59, 0.08);
    }

    body.theme-anime.portal-page #sidebar .sidebar-box:first-child,
    body.theme-anime.portal-home #sidebar .sidebar-box:first-child {
        padding-top: 16px;
    }

    body.theme-anime.portal-page #sidebar .sidebar-title,
    body.theme-anime.portal-home #sidebar .sidebar-title {
        margin: 0 0 12px;
        padding: 0;
        background: transparent;
        color: #55664a;
        font-size: 13px;
    }

    body.theme-anime.portal-page #sidebar .sidebar-user,
    body.theme-anime.portal-home #sidebar .sidebar-user {
        padding: 0;
        align-items: center;
    }

    body.theme-anime.portal-page #sidebar .sidebar-user img,
    body.theme-anime.portal-home #sidebar .sidebar-user img {
        width: 58px;
        height: 58px;
        margin: 0;
        border: 0;
        border-radius: 18px;
        box-shadow: 0 10px 22px rgba(75, 96, 41, 0.18);
    }

    body.theme-anime.portal-page #sidebar .sidebar-actions.stack,
    body.theme-anime.portal-home #sidebar .sidebar-actions.stack {
        gap: 10px;
        margin-top: 14px;
    }

    body.theme-anime.portal-page #sidebar .sidebar-input,
    body.theme-anime.portal-page #sidebar .portal-login-form input,
    body.theme-anime.portal-page #sidebar .portal-register-form input,
    body.theme-anime.portal-page #sidebar .portal-guest-form input,
    body.theme-anime.portal-page #sidebar .portal-guest-form select,
    body.theme-anime.portal-page #sidebar .portal-search-input,
    body.theme-anime.portal-home #sidebar .sidebar-input,
    body.theme-anime.portal-home #sidebar .portal-login-form input,
    body.theme-anime.portal-home #sidebar .portal-register-form input,
    body.theme-anime.portal-home #sidebar .portal-guest-form input,
    body.theme-anime.portal-home #sidebar .portal-guest-form select,
    body.theme-anime.portal-home #sidebar .portal-search-input {
        width: 100%;
        min-height: 44px;
        margin-bottom: 0;
        padding: 0 14px;
        border: 1px solid #d7e6c5;
        border-radius: 14px;
        font-size: 14px;
        box-shadow: none;
    }

    body.theme-anime.portal-page #sidebar .green-btn,
    body.theme-anime.portal-page #sidebar .blue-btn,
    body.theme-anime.portal-page #sidebar .secondary-btn,
    body.theme-anime.portal-page #sidebar .red-btn,
    body.theme-anime.portal-home #sidebar .green-btn,
    body.theme-anime.portal-home #sidebar .blue-btn,
    body.theme-anime.portal-home #sidebar .secondary-btn,
    body.theme-anime.portal-home #sidebar .red-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        min-width: 0;
        min-height: 44px;
        padding: 0 14px;
        border-radius: 14px;
        font-weight: 700;
    }

    body.theme-anime.portal-page #sidebar .remember-row.compact,
    body.theme-anime.portal-home #sidebar .remember-row.compact {
        display: flex;
        align-items: center;
        flex-wrap: wrap;
        gap: 10px;
        margin: 8px 0 2px;
    }

    body.theme-anime.portal-page #sidebar .auth-accordion,
    body.theme-anime.portal-home #sidebar .auth-accordion {
        margin-top: 10px;
        padding-top: 10px;
        border-top: 1px solid #edf3e6;
    }

    body.theme-anime.portal-page #sidebar .auth-accordion summary,
    body.theme-anime.portal-home #sidebar .auth-accordion summary {
        cursor: pointer;
        color: #577141;
        font-weight: 700;
        list-style: none;
    }

    body.theme-anime.portal-page #sidebar .auth-accordion summary::-webkit-details-marker,
    body.theme-anime.portal-home #sidebar .auth-accordion summary::-webkit-details-marker {
        display: none;
    }

    body.theme-anime.portal-page #sidebar .auth-accordion[open] summary,
    body.theme-anime.portal-home #sidebar .auth-accordion[open] summary {
        margin-bottom: 12px;
    }

    body.theme-anime.portal-page #sidebar .portal-guest-form.sidebar-form.auth-accordion-body,
    body.theme-anime.portal-home #sidebar .portal-guest-form.sidebar-form.auth-accordion-body {
        gap: 4px;
        padding: 6px 8px;
    }

    body.theme-anime.portal-page #sidebar .register-captcha-row,
    body.theme-anime.portal-home #sidebar .register-captcha-row {
        display: flex;
        align-items: center;
        gap: 8px;
        flex-wrap: wrap;
    }

    body.theme-anime.portal-page #sidebar .guest-avatar-gallery,
    body.theme-anime.portal-home #sidebar .guest-avatar-gallery {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        justify-items: center;
        align-items: center;
        gap: 8px;
        margin: 8px 0 10px;
        width: 100%;
        max-width: 210px;
    }

    body.theme-anime.portal-page #sidebar .guest-avatar-radio,
    body.theme-anime.portal-home #sidebar .guest-avatar-radio {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border: 0;
    }

    body.theme-anime.portal-page #sidebar .guest-avatar-tile,
    body.theme-anime.portal-home #sidebar .guest-avatar-tile {
        display: flex;
        align-items: center;
        justify-content: center;
        flex: none;
        width: 56px;
        height: 56px;
        padding: 2px;
        border: 1px solid #d9e4cd;
        border-radius: 10px;
        background: linear-gradient(180deg, #fbfff8, #eef6e3);
        cursor: pointer;
        transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
        overflow: hidden;
    }

    body.theme-anime.portal-page #sidebar .guest-avatar-tile img,
    body.theme-anime.portal-home #sidebar .guest-avatar-tile img {
        display: block;
        width: 100%;
        height: 100%;
        object-fit: cover;
        border-radius: 8px;
        background: #fff;
    }

    body.theme-anime.portal-page #sidebar .guest-avatar-radio:checked + .guest-avatar-tile,
    body.theme-anime.portal-home #sidebar .guest-avatar-radio:checked + .guest-avatar-tile {
        border-color: #7ebf52;
        box-shadow: 0 0 0 2px rgba(126, 191, 82, 0.16);
        transform: translateY(-1px);
    }

    body.theme-anime.portal-page #sidebar .guest-avatar-radio:focus-visible + .guest-avatar-tile,
    body.theme-anime.portal-home #sidebar .guest-avatar-radio:focus-visible + .guest-avatar-tile {
        outline: 2px solid #7ebf52;
        outline-offset: 2px;
    }

    body.theme-anime.portal-page #sidebar .sidebar-counter,
    body.theme-anime.portal-home #sidebar .sidebar-counter {
        min-height: 0;
        padding: 16px;
        border-radius: 16px;
        background: linear-gradient(180deg, #f7fbf2, #eef7e1);
        font-size: 36px;
        line-height: 1;
    }

    body.theme-anime.portal-page #sidebar .top-chatters-grid,
    body.theme-anime.portal-home #sidebar .top-chatters-grid {
        grid-template-columns: repeat(auto-fit, minmax(52px, 1fr));
        gap: 8px;
    }

    body.theme-anime.portal-page #sidebar .top-chatter-slot,
    body.theme-anime.portal-home #sidebar .top-chatter-slot {
        width: 100%;
        height: auto;
        aspect-ratio: 1;
        border-radius: 16px;
        background: #f2f7ea;
    }

    body.theme-anime.portal-page #sidebar .top-chatter-slot img,
    body.theme-anime.portal-home #sidebar .top-chatter-slot img {
        width: 100%;
        height: 100%;
        flex-basis: 100%;
        object-fit: cover;
    }

    body.theme-anime.portal-page .portal-main,
    body.theme-anime.portal-home .portal-main {
        display: block;
    }

    body.theme-anime.portal-page #content,
    body.theme-anime.portal-home #content {
        float: none;
        width: 100%;
    }

    body.theme-anime.portal-page #content > .padder,
    body.theme-anime.portal-home #content > .padder {
        margin: 0;
        padding: 18px 16px 28px;
        border-right: 0;
    }

    body.theme-anime.portal-page .portal-alert,
    body.theme-anime.portal-home .portal-alert {
        margin: 0 0 14px;
        border-radius: 18px;
    }

    body.theme-anime.portal-page .portal-section,
    body.theme-anime.portal-home .portal-section {
        margin: 0 0 14px;
        padding: 0;
        background: transparent;
        border: 0;
    }

    body.theme-anime.portal-page:not([data-page="dm"]) .portal-card,
    body.theme-anime.portal-home .portal-card,
    body.theme-anime.portal-home .news-stream,
    body.theme-anime.portal-home .classic-news-tools {
        padding: 18px 16px;
        border: 1px solid rgba(164, 198, 122, 0.46);
        border-radius: 22px;
        background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 251, 243, 0.99));
        box-shadow: 0 18px 34px rgba(103, 125, 63, 0.12);
    }

    body.theme-anime.portal-page .portal-page-title,
    body.theme-anime.portal-home .portal-page-title {
        margin: 0 0 10px;
        font-size: clamp(24px, 6vw, 30px);
        line-height: 1.15;
    }

    body.theme-anime.portal-page .directory-header-row,
    body.theme-anime.portal-page .activity-header-row,
    body.theme-anime.portal-page .marketplace-topbar,
    body.theme-anime.portal-page .inline-search,
    body.theme-anime.portal-page .activity-filter-bar,
    body.theme-anime.portal-page .profile-filter,
    body.theme-anime.portal-page .profile-subtabs,
    body.theme-anime.portal-home .directory-header-row,
    body.theme-anime.portal-home .activity-header-row,
    body.theme-anime.portal-home .marketplace-topbar,
    body.theme-anime.portal-home .inline-search,
    body.theme-anime.portal-home .activity-filter-bar,
    body.theme-anime.portal-home .profile-filter,
    body.theme-anime.portal-home .profile-subtabs {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    body.theme-anime.portal-page .portal-search-input,
    body.theme-anime.portal-page .portal-select,
    body.theme-anime.portal-home .portal-search-input,
    body.theme-anime.portal-home .portal-select {
        width: 100%;
        min-width: 0;
        min-height: 44px;
        border-radius: 14px;
        font-size: 14px;
    }

    body.theme-anime.portal-page .portal-split-grid,
    body.theme-anime.portal-home .portal-split-grid,
    body.theme-anime.portal-page .profile-hero,
    body.theme-anime.portal-home .profile-hero,
    body.theme-anime.portal-page .member-card,
    body.theme-anime.portal-home .member-card,
    body.theme-anime.portal-page .group-card,
    body.theme-anime.portal-home .group-card {
        grid-template-columns: 1fr;
    }

    body.theme-anime.portal-page .member-card,
    body.theme-anime.portal-page .group-card,
    body.theme-anime.portal-page .activity-row,
    body.theme-anime.portal-page .profile-activity-item,
    body.theme-anime.portal-page .topic-thread-card,
    body.theme-anime.portal-page .reply-card,
    body.theme-anime.portal-home .member-card,
    body.theme-anime.portal-home .group-card,
    body.theme-anime.portal-home .activity-row,
    body.theme-anime.portal-home .profile-activity-item {
        padding: 16px;
        border: 1px solid #e1ecd4;
        border-radius: 18px;
        background: #fff;
        box-shadow: 0 10px 22px rgba(103, 125, 63, 0.08);
    }

    body.theme-anime.portal-page .member-preview-link,
    body.theme-anime.portal-page .group-meta,
    body.theme-anime.portal-home .member-preview-link,
    body.theme-anime.portal-home .group-meta {
        text-align: left;
    }

    body.theme-anime.portal-page .portal-table,
    body.theme-anime.portal-home .portal-table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
        border: 1px solid #e1ebd5;
        border-radius: 18px;
        background: #fff;
    }

    body.theme-anime.portal-page .shop-grid,
    body.theme-anime.portal-page .market-grid,
    body.theme-anime.portal-home .shop-grid,
    body.theme-anime.portal-home .market-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 14px;
    }

    body.theme-anime.portal-page .shop-card,
    body.theme-anime.portal-page .market-card,
    body.theme-anime.portal-home .shop-card,
    body.theme-anime.portal-home .market-card {
        padding: 16px;
        border: 1px solid #e0ead2;
        border-radius: 18px;
        background: #fff;
        box-shadow: 0 10px 22px rgba(102, 124, 61, 0.08);
    }

    body.theme-anime.portal-page .shop-icon,
    body.theme-anime.portal-page .market-avatar,
    body.theme-anime.portal-home .shop-icon,
    body.theme-anime.portal-home .market-avatar {
        margin-bottom: 12px;
        border-radius: 16px;
        background: linear-gradient(180deg, #ffffff, #f5f8ef);
    }

    body.theme-anime.portal-home .news-home-intro {
        align-items: flex-start;
        gap: 10px;
        padding-bottom: 16px;
    }

    body.theme-anime.portal-home .news-classic-post {
        padding: 16px;
        border: 1px solid #e0ead4;
        border-radius: 20px;
        background: #fff;
        box-shadow: 0 14px 28px rgba(102, 124, 61, 0.1);
    }

    body.theme-anime.portal-home .author-box {
        float: none;
        display: flex;
        align-items: center;
        gap: 12px;
        width: auto;
        margin: 0 0 14px;
        padding: 0;
        background: transparent;
    }

    body.theme-anime.portal-home .author-box img {
        width: 56px;
        height: 56px;
        border: 3px solid #fff;
        border-radius: 18px;
        box-shadow: 0 10px 20px rgba(81, 105, 44, 0.14);
    }

    body.theme-anime.portal-home .author-box p,
    body.theme-anime.portal-home .news-post-content {
        margin: 0;
        text-align: left;
    }

    body.theme-anime.portal-home .news-post-content {
        width: auto;
        margin-left: 0;
    }

    body.theme-anime.portal-home .posttitle {
        font-size: 22px;
    }

    body.theme-anime.portal-home .date,
    body.theme-anime.portal-home .postmetadata {
        display: flex;
        flex-direction: column;
        gap: 6px;
        padding: 8px 0;
    }

    body.theme-anime.portal-home .comments {
        float: none;
    }

    body.theme-anime.portal-home .news-classic-visual {
        border-radius: 18px;
        overflow: hidden;
    }

    body.theme-anime.portal-home .news-classic-placeholder {
        min-height: 220px;
        font-size: 24px;
    }

    body.theme-anime.portal-home .classic-comment-form {
        padding: 14px;
        border-radius: 18px;
    }

    body.theme-anime.portal-page .profile-avatar-large,
    body.theme-anime.portal-home .profile-avatar-large {
        width: min(100%, 240px);
        height: auto;
        aspect-ratio: 1 / 1;
    }

    body.theme-anime.portal-page .profile-discussion-head,
    body.theme-anime.portal-home .profile-discussion-head {
        flex-direction: column;
    }

    body.theme-anime.portal-page .profile-comment-card,
    body.theme-anime.portal-home .profile-comment-card {
        grid-template-columns: 1fr;
        gap: 10px;
        margin-left: calc(var(--comment-depth, 0) * 10px);
    }

    body.theme-anime.portal-page .profile-comment-vote,
    body.theme-anime.portal-home .profile-comment-vote {
        grid-auto-flow: column;
        justify-content: start;
    }

    body.theme-anime.portal-page .portal-footer-classic,
    body.theme-anime.portal-home .portal-footer-classic {
        padding: 8px 16px 26px;
        text-align: center;
    }
}

@media (max-width: 560px) {
    body.theme-anime.portal-page .portal-banner,
    body.theme-anime.portal-home .portal-banner {
        padding: 16px 12px 22px;
    }

    body.theme-anime.portal-page .portal-mobile-actions,
    body.theme-anime.portal-home .portal-mobile-actions {
        width: 100%;
        justify-content: stretch;
    }

    body.theme-anime.portal-page .portal-mobile-action,
    body.theme-anime.portal-home .portal-mobile-action {
        flex: 1 1 calc(33.333% - 6px);
        min-width: 0;
        padding: 0 10px;
    }

    body.theme-anime.portal-page #search-bar,
    body.theme-anime.portal-page #navigation,
    body.theme-anime.portal-page #sidebar,
    body.theme-anime.portal-home #search-bar,
    body.theme-anime.portal-home #navigation,
    body.theme-anime.portal-home #sidebar {
        left: 10px;
        right: 10px;
    }

    body.theme-anime.portal-page #nav,
    body.theme-anime.portal-home #nav {
        grid-template-columns: 1fr;
    }

    body.theme-anime.portal-page .shop-grid,
    body.theme-anime.portal-page .market-grid,
    body.theme-anime.portal-home .shop-grid,
    body.theme-anime.portal-home .market-grid {
        grid-template-columns: 1fr;
    }

    body.theme-anime.portal-home .news-home-stamp {
        width: 100%;
        text-align: center;
    }
}

@media (max-width: 920px) {
    body.theme-anime[data-page="chat"] .app-wrap {
        padding: 54px 0 230px;
    }

    body.theme-anime[data-page="chat"] .main-stage {
        width: 100%;
        padding: 0 12px 330px;
    }

    body.theme-anime[data-page="chat"] .chat-scene {
        width: calc(100vw - 24px);
        max-width: 100%;
    }

    body.theme-anime[data-page="chat"] .bottom-bar {
        position: fixed;
        left: 50%;
        bottom: calc(12px + env(safe-area-inset-bottom, 0px));
        transform: translateX(-50%);
        flex-direction: row;
        align-items: center;
        width: min(720px, calc(100vw - 24px));
        max-width: calc(100vw - 24px);
        padding: 12px;
        gap: 10px;
        border: 1px solid rgba(125, 174, 73, 0.5);
        border-radius: 24px;
        background: linear-gradient(180deg, rgba(251, 255, 246, 0.96), rgba(235, 246, 221, 0.96));
        box-shadow: 0 20px 42px rgba(42, 81, 16, 0.2);
        -webkit-backdrop-filter: blur(14px);
        backdrop-filter: blur(14px);
        z-index: 66;
    }

    body.theme-anime[data-page="chat"] .chat-line {
        min-width: 0;
        flex: 1 1 auto;
    }

    body.theme-anime[data-page="chat"] .bottom-bar .send-btn {
        flex: 0 0 auto;
        width: auto;
        min-width: 106px;
        padding: 0 22px;
    }

    body.theme-anime[data-page="chat"] .history-panel {
        position: fixed;
        left: 50% !important;
        right: auto !important;
        top: auto !important;
        bottom: calc(92px + env(safe-area-inset-bottom, 0px));
        transform: translateX(-50%) !important;
        width: min(860px, calc(100vw - 24px)) !important;
        min-width: 320px;
        height: min(46vh, 430px);
        min-height: 280px;
        max-height: 520px;
        padding: 12px;
        border: 1px solid rgba(125, 174, 73, 0.55);
        border-radius: 24px 24px 18px 18px;
        background: linear-gradient(180deg, rgba(252, 255, 248, 0.98), rgba(237, 247, 226, 0.98));
        box-shadow: 0 26px 50px rgba(45, 82, 19, 0.22);
        z-index: 65;
    }

    body.theme-anime[data-page="chat"] .history-title {
        margin: 0 0 10px;
        padding: 10px 44px 10px 14px;
        min-height: 0;
        border: 1px solid rgba(132, 177, 82, 0.45);
        border-radius: 16px;
        background: linear-gradient(180deg, #f8fdf2, #eaf5db);
        color: #44612a;
        text-align: left;
        font-size: 14px;
        line-height: 1.35;
        cursor: default;
    }

    body.theme-anime[data-page="chat"] .history-panel .window-close,
    body.theme-anime[data-page="chat"] .history-panel .ui-icon-close {
        right: 14px;
        color: #587538;
        font-size: 18px;
    }

    body.theme-anime[data-page="chat"] .history-body {
        min-height: 0;
        padding: 10px 12px;
        border: 1px solid #d7e8c7;
        border-radius: 16px;
        background: rgba(255, 255, 255, 0.96);
        font-size: 12px;
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
    }

    body.theme-anime[data-page="chat"] .history-footer {
        margin-top: 8px;
        padding: 0 4px 2px;
        background: transparent;
        color: #5f6e52;
        font-size: 11px;
        white-space: normal;
        flex-wrap: wrap;
    }

    body.theme-anime[data-page="chat"] .history-panel .ui-resizable-handle {
        display: none !important;
    }

    body.theme-anime[data-page="chat"] #videoBottomControl {
        width: calc(100vw - 24px);
        bottom: calc(372px + env(safe-area-inset-bottom, 0px));
    }
}

@media (max-width: 560px) {
    body.theme-anime[data-page="chat"] .app-wrap {
        padding-top: 48px;
    }

    body.theme-anime[data-page="chat"] .main-stage {
        padding: 0 10px 314px;
    }

    body.theme-anime[data-page="chat"] .chat-scene {
        width: calc(100vw - 20px);
    }

    body.theme-anime[data-page="chat"] .bottom-bar {
        width: calc(100vw - 20px);
        max-width: calc(100vw - 20px);
        padding: 10px;
        gap: 8px;
    }

    body.theme-anime[data-page="chat"] .bottom-bar .send-btn {
        min-width: 92px;
        padding: 0 16px;
    }

    body.theme-anime[data-page="chat"] .history-panel {
        width: calc(100vw - 20px) !important;
        height: min(40vh, 320px);
        bottom: calc(86px + env(safe-area-inset-bottom, 0px));
        padding: 10px;
        border-radius: 22px 22px 16px 16px;
    }

    body.theme-anime[data-page="chat"] .history-title {
        padding-right: 40px;
        font-size: 13px;
    }

    body.theme-anime[data-page="chat"] .history-body {
        padding: 9px 10px;
    }

    body.theme-anime[data-page="chat"] #videoBottomControl {
        width: calc(100vw - 20px);
        bottom: calc(332px + env(safe-area-inset-bottom, 0px));
    }
}

/* Classic profile page rebuild override */
body.theme-anime.portal-page[data-page="profile"] .profile-card {
    padding-top: 0;
}

body.theme-anime.portal-page[data-page="profile"] .profile-archive-shell {
    display: grid;
    gap: 0;
}

body.theme-anime.portal-page[data-page="profile"] #item-header {
    overflow: hidden;
    padding: 0 0 18px;
}

body.theme-anime.portal-page[data-page="profile"] #item-header-avatar {
    float: left;
    width: 165px;
}

body.theme-anime.portal-page[data-page="profile"] #item-header-avatar a {
    display: block;
}

body.theme-anime.portal-page[data-page="profile"] #item-header-avatar img.avatar {
    float: none;
    width: 150px;
    height: 150px;
    border: 2px solid #eee;
    background: #fff;
    object-fit: cover;
}

body.theme-anime.portal-page[data-page="profile"] #item-header-content {
    margin-left: 170px;
    min-height: 150px;
}

body.theme-anime.portal-page[data-page="profile"] #item-header-content h2 {
    margin: 0 0 5px;
    font-size: 28px;
    line-height: 120%;
}

body.theme-anime.portal-page[data-page="profile"] #item-header-content h2 a {
    color: #777;
    text-decoration: none;
}

body.theme-anime.portal-page[data-page="profile"] .user-nicename {
    display: block;
    margin-bottom: 4px;
    color: #777;
    font-size: 14px;
}

body.theme-anime.portal-page[data-page="profile"] #item-header-content > span.activity {
    margin-top: 0;
}

body.theme-anime.portal-page[data-page="profile"] #item-meta {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin: 15px 0 5px;
    padding-bottom: 10px;
    overflow: hidden;
    color: #aaa;
    font-size: 14px;
}

body.theme-anime.portal-page[data-page="profile"] #latest-update {
    flex: 1 1 auto;
    min-width: 0;
}

body.theme-anime.portal-page[data-page="profile"] #latest-update p {
    margin: 0 0 10px;
    color: #666;
    line-height: 1.6;
}

body.theme-anime.portal-page[data-page="profile"] #item-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

body.theme-anime.portal-page[data-page="profile"] #item-buttons form {
    margin: 0;
}

body.theme-anime.portal-page[data-page="profile"] #item-nav {
    margin-top: 6px;
}

body.theme-anime.portal-page[data-page="profile"] #object-nav,
body.theme-anime.portal-page[data-page="profile"] #subnav {
    clear: left;
    overflow: hidden;
    margin-left: -19px;
    margin-right: -19px;
}

body.theme-anime.portal-page[data-page="profile"] #object-nav {
    margin-top: 0;
    margin-bottom: 0;
    background: #eaeaea;
}

body.theme-anime.portal-page[data-page="profile"] #subnav {
    margin-top: 0;
    margin-bottom: 20px;
    min-height: 35px;
    background: #fff;
    border-bottom: 1px solid #eaeaea;
    position: relative;
    z-index: 3;
}

body.theme-anime.portal-page[data-page="profile"] #item-body {
    margin-top: 0;
    padding-top: 10px;
}

body.theme-anime.portal-page[data-page="profile"] #object-nav ul,
body.theme-anime.portal-page[data-page="profile"] #subnav ul {
    width: 100%;
    margin: 0;
    padding: 0;
    list-style: none;
}

body.theme-anime.portal-page[data-page="profile"] #object-nav li,
body.theme-anime.portal-page[data-page="profile"] #subnav li {
    float: left;
    margin: 5px 0 0 5px;
}

body.theme-anime.portal-page[data-page="profile"] #object-nav li:first-child,
body.theme-anime.portal-page[data-page="profile"] #subnav li:first-child {
    margin-left: 20px;
}

body.theme-anime.portal-page[data-page="profile"] #subnav li {
    margin-top: 0;
}

body.theme-anime.portal-page[data-page="profile"] #subnav li.last {
    float: right;
    margin: 4px 20px 0 0;
}

body.theme-anime.portal-page[data-page="profile"] #object-nav a,
body.theme-anime.portal-page[data-page="profile"] #subnav a,
body.theme-anime.portal-page[data-page="profile"] #subnav span {
    display: block;
    padding: 5px 10px;
    text-decoration: none;
}

body.theme-anime.portal-page[data-page="profile"] #subnav span {
    color: #aaa;
}

body.theme-anime.portal-page[data-page="profile"] #object-nav a span {
    display: inline-block;
    padding: 1px 6px;
    margin-left: 2px;
    border-radius: 3px;
    background: #1fb3dd;
    color: #fff;
    font-size: 90%;
}

body.theme-anime.portal-page[data-page="profile"] #object-nav li.current a,
body.theme-anime.portal-page[data-page="profile"] #object-nav li.selected a,
body.theme-anime.portal-page[data-page="profile"] #subnav li.current a,
body.theme-anime.portal-page[data-page="profile"] #subnav li.selected a {
    border-top-left-radius: 3px;
    border-top-right-radius: 3px;
    background: #fff;
    color: #555;
    font-weight: bold;
}

body.theme-anime.portal-page[data-page="profile"] #item-body {
    margin-top: 0;
}

body.theme-anime.portal-page[data-page="profile"] .profile-edit-panel {
    display: block;
    margin: 0 0 20px;
}

body.theme-anime.portal-page[data-page="profile"] .profile-edit-panel summary {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 12px 14px;
    cursor: pointer;
    list-style: none;
    user-select: none;
    border: 1px solid #ddd6c4;
    background: linear-gradient(180deg, #f4f1e8, #ebe4d3);
}

body.theme-anime.portal-page[data-page="profile"] .profile-edit-panel summary::-webkit-details-marker {
    display: none;
}

body.theme-anime.portal-page[data-page="profile"] .profile-edit-panel summary::after {
    content: '+';
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border: 1px solid #7ebf52;
    border-radius: 999px;
    background: linear-gradient(180deg, #fcfff8, #e7f4d9);
    color: #478e2f;
    font-size: 13px;
    font-weight: 700;
}

body.theme-anime.portal-page[data-page="profile"] .profile-edit-panel[open] summary::after {
    content: '-';
}

body.theme-anime.portal-page[data-page="profile"] .profile-edit-form {
    margin-top: 0;
    padding: 16px;
    border: 1px solid #ddd6c4;
    border-top: 0;
    background: #fbfaf6;
}

body.theme-anime.portal-page[data-page="profile"] .profile-activity-shell,
body.theme-anime.portal-page[data-page="profile"] .profile-discussion-shell {
    border: 1px solid #dfd0af;
    background: #fffdfa;
}

body.theme-anime.portal-page[data-page="profile"] .profile-activity-shell {
    margin-bottom: 24px;
}

body.theme-anime.portal-page[data-page="profile"] .profile-activity-shell .pagination {
    margin: 0;
    padding: 8px 15px;
    border: 0;
    border-bottom: 1px solid #eaeaea;
    background: #f8f8f8;
}

body.theme-anime.portal-page[data-page="profile"] .profile-activity-shell .pag-count {
    float: none;
}

body.theme-anime.portal-page[data-page="profile"] #activity-stream {
    margin: 0;
    padding: 0 18px 8px;
    list-style: none;
}

body.theme-anime.portal-page[data-page="profile"] #activity-stream > li {
    overflow: hidden;
    padding: 20px 0 0;
    border-bottom: 1px solid #eaeaea;
}

body.theme-anime.portal-page[data-page="profile"] #activity-stream > li:last-child {
    padding-bottom: 18px;
    border-bottom: 0;
}

body.theme-anime.portal-page[data-page="profile"] #activity-stream .activity-avatar {
    float: left;
}

body.theme-anime.portal-page[data-page="profile"] #activity-stream .activity-avatar .avatar {
    width: 50px;
    height: 50px;
    margin: 0 10px 10px 0;
    border: 2px solid #eee;
    background: #fff;
    object-fit: cover;
}

body.theme-anime.portal-page[data-page="profile"] #activity-stream .activity-content {
    margin-left: 70px;
}

body.theme-anime.portal-page[data-page="profile"] #activity-stream .activity-header {
    font-size: 11px;
    color: #888;
    line-height: 220%;
}

body.theme-anime.portal-page[data-page="profile"] #activity-stream .activity-header a:first-child {
    display: inline-block;
    margin-right: 3px;
    padding: 3px 8px;
    border-right: 1px solid #a1dcfa;
    border-bottom: 1px solid #a1dcfa;
    border-radius: 4px;
    background: #ebf7ff;
    color: #059ae7;
    text-decoration: none;
}

body.theme-anime.portal-page[data-page="profile"] #activity-stream .activity-header a:first-child:hover {
    background: #059ae7;
    color: #fff !important;
}

body.theme-anime.portal-page[data-page="profile"] #activity-stream .activity-header .view {
    margin-left: 4px;
    padding: 0;
    border: 0;
    background: none;
    color: #aaa;
    text-decoration: underline;
}

body.theme-anime.portal-page[data-page="profile"] #activity-stream .activity-header .time-since {
    color: #bbb;
}

body.theme-anime.portal-page[data-page="profile"] #activity-stream .profile-activity-empty .activity-content {
    margin-left: 0;
}

body.theme-anime.portal-page[data-page="profile"] #activity-stream .activity-inner {
    margin: 0;
    color: #666;
    line-height: 1.6;
}

body.theme-anime.portal-page[data-page="profile"] .profile-discussion-shell {
    margin-top: 0;
    padding: 0;
    border-radius: 0;
}

body.theme-anime.portal-page[data-page="profile"] .profile-discussion-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin: 0;
    padding: 18px 18px 12px;
}

body.theme-anime.portal-page[data-page="profile"] .profile-discussion-head h2 {
    margin: 0 0 4px;
    font-size: 20px;
}

body.theme-anime.portal-page[data-page="profile"] .profile-discussion-head p {
    margin: 0;
    color: #6b6355;
}

body.theme-anime.portal-page[data-page="profile"] .profile-comment-count {
    padding: 8px 12px;
    border-radius: 999px;
    background: #efe5cf;
    color: #6d5230;
    font-weight: 700;
    white-space: nowrap;
}

body.theme-anime.portal-page[data-page="profile"] .profile-comment-form.composer {
    margin-bottom: 0;
    padding: 0 18px 18px;
    border-bottom: 1px solid #eadfc9;
}

body.theme-anime.portal-page[data-page="profile"] .profile-comment-login-note {
    margin: 0 18px 18px;
}

body.theme-anime.portal-page[data-page="profile"] .profile-comment-list {
    display: grid;
    gap: 14px;
    padding: 18px;
}

body.theme-anime.portal-page[data-page="profile"] .profile-comment-card {
    margin-left: calc(var(--comment-depth, 0) * 18px);
    padding: 14px 0 0;
    border-top: 1px solid #eadfc9;
    background: transparent;
    border-radius: 0;
    box-shadow: none;
}

body.theme-anime.portal-page[data-page="profile"] .profile-comment-list > .profile-comment-card:first-child {
    padding-top: 0;
    border-top: 0;
}

body.theme-anime.portal-page[data-page="profile"] .profile-comment-head {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

body.theme-anime.portal-page[data-page="profile"] .profile-comment-avatar {
    flex: 0 0 40px;
}

body.theme-anime.portal-page[data-page="profile"] .profile-comment-avatar img {
    display: block;
    width: 40px;
    height: 40px;
    border: 2px solid #eee;
    background: #fff;
    object-fit: cover;
}

body.theme-anime.portal-page[data-page="profile"] .profile-comment-main {
    flex: 1 1 auto;
    min-width: 0;
}

body.theme-anime.portal-page[data-page="profile"] .profile-comment-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px 10px;
    margin-bottom: 8px;
    font-size: 11px;
    color: #888;
}

body.theme-anime.portal-page[data-page="profile"] .profile-comment-meta strong {
    font-size: 12px;
    color: #444;
}

body.theme-anime.portal-page[data-page="profile"] .profile-comment-meta strong a {
    color: #059ae7;
    text-decoration: none;
}

body.theme-anime.portal-page[data-page="profile"] .profile-comment-text {
    margin-top: 0;
    color: #4e463a;
    line-height: 1.6;
    word-break: break-word;
}

body.theme-anime.portal-page[data-page="profile"] .profile-reply-box {
    margin-top: 10px;
}

body.theme-anime.portal-page[data-page="profile"] .profile-comment-form.inline {
    margin-top: 10px;
}

body.theme-anime.portal-page[data-page="profile"] .profile-comment-children {
    display: grid;
    gap: 12px;
    margin-top: 14px;
}

body.theme-anime.portal-page[data-page="profile"] .profile-summary-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    margin-top: 24px;
}

body.theme-anime.portal-page[data-page="profile"] .profile-sidebar-card {
    margin: 0;
    padding: 14px;
    border: 1px solid #ddd4bd;
    background: #f9f6ee;
}

body.theme-anime.portal-page[data-page="profile"] .profile-sidebar-card-wide {
    grid-column: 1 / -1;
}

body.theme-anime.portal-page[data-page="profile"] .profile-facts {
    display: grid;
    gap: 12px;
    margin: 0;
}

body.theme-anime.portal-page[data-page="profile"] .profile-facts div {
    padding-top: 12px;
    border-top: 1px solid #e8dfc9;
}

body.theme-anime.portal-page[data-page="profile"] .profile-facts div:first-child {
    padding-top: 0;
    border-top: 0;
}

body.theme-anime.portal-page[data-page="profile"] .profile-facts dt {
    font-size: 11px;
    color: #948a78;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

body.theme-anime.portal-page[data-page="profile"] .profile-facts dd {
    margin: 4px 0 0;
    color: #4e463b;
    font-size: 14px;
}

@media (max-width: 860px) {
    body.theme-anime.portal-page[data-page="profile"] #item-header-avatar {
        float: none;
        width: auto;
        margin-bottom: 14px;
    }

    body.theme-anime.portal-page[data-page="profile"] #item-header-content {
        margin-left: 0;
        min-height: 0;
    }

    body.theme-anime.portal-page[data-page="profile"] #item-meta {
        flex-direction: column;
    }

    body.theme-anime.portal-page[data-page="profile"] #item-buttons {
        justify-content: flex-start;
    }

    body.theme-anime.portal-page[data-page="profile"] #subnav li.last {
        float: left;
        margin-left: 5px;
    }

    body.theme-anime.portal-page[data-page="profile"] .profile-summary-grid {
        grid-template-columns: 1fr;
    }

    body.theme-anime.portal-page[data-page="profile"] .profile-sidebar-card-wide {
        grid-column: auto;
    }
}

@media (max-width: 640px) {
    body.theme-anime.portal-page[data-page="profile"] #item-header-avatar img.avatar {
        width: 120px;
        height: 120px;
    }

    body.theme-anime.portal-page[data-page="profile"] #item-header-content h2 {
        font-size: 24px;
    }

    body.theme-anime.portal-page[data-page="profile"] #object-nav li,
    body.theme-anime.portal-page[data-page="profile"] #subnav li {
        margin-left: 4px;
    }

    body.theme-anime.portal-page[data-page="profile"] #object-nav li:first-child,
    body.theme-anime.portal-page[data-page="profile"] #subnav li:first-child {
        margin-left: 14px;
    }

    body.theme-anime.portal-page[data-page="profile"] #subnav li.last {
        margin-left: 14px;
    }

    body.theme-anime.portal-page[data-page="profile"] #activity-stream {
        padding: 0 14px 6px;
    }

    body.theme-anime.portal-page[data-page="profile"] #activity-stream .activity-avatar {
        float: none;
        margin-bottom: 8px;
    }

    body.theme-anime.portal-page[data-page="profile"] #activity-stream .activity-content {
        margin-left: 0;
    }

    body.theme-anime.portal-page[data-page="profile"] .profile-discussion-head {
        flex-direction: column;
    }

    body.theme-anime.portal-page[data-page="profile"] .profile-comment-card {
        margin-left: calc(var(--comment-depth, 0) * 10px);
    }

    body.theme-anime.portal-page[data-page="profile"] .profile-comment-head {
        gap: 10px;
    }
}

.room-meta-bar {
    position: absolute;
    top: 44px;
    left: 14px;
    right: 14px;
    z-index: 20;
    display: flex;
    flex-direction: column;
    gap: 6px;
    pointer-events: none;
}
.room-topic-bar,
.room-welcome-bar,
.room-pins-bar,
.composer-assist-bar,
.experience-reconnect-banner,
.experience-video-queue,
.experience-room-settings {
    pointer-events: auto;
    background: rgba(11, 16, 24, 0.82);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 10px;
    padding: 8px 10px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.22);
}
.room-pins-bar { display: flex; gap: 8px; flex-wrap: wrap; }
.pin-chip, .reaction-chip, .experience-message-actions button, .experience-mini-mod-btn, .experience-video-queue button, .experience-room-settings button, .room-rule-badge {
    border: 1px solid rgba(255,255,255,0.16);
    background: rgba(255,255,255,0.08);
    color: #fff;
    border-radius: 999px;
    padding: 4px 10px;
    cursor: pointer;
}
.pin-chip:hover, .reaction-chip:hover, .experience-message-actions button:hover, .experience-mini-mod-btn:hover, .experience-video-queue button:hover, .experience-room-settings button:hover {
    background: rgba(255,255,255,0.14);
}
.composer-assist-bar {
    margin: 8px 12px 0;
    font-size: 13px;
}
.jump-unread-btn {
    position: fixed;
    right: 20px;
    bottom: 96px;
    z-index: 50;
    border: 1px solid #1f6f12;
    border-radius: 999px;
    padding: 10px 16px;
    background: #2f9a1a;
    color: #fff;
    font-weight: 700;
    box-shadow: #1f6f12 0 8px 0 0;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.jump-unread-btn:hover,
.jump-unread-btn:focus {
    background: #37ad20;
    color: #fff;
}

.jump-unread-btn:active {
    transform: translateY(2px);
    box-shadow: #1f6f12 0 5px 0 0;
}
.history-message {
    position: relative;
    margin: 0 0 12px;
}
.history-card {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 8px 10px;
    border-radius: 10px;
    background: rgba(255,255,255,0.04);
}
.history-card.self {
    background: rgba(86, 175, 255, 0.08);
}
.message-reply-preview {
    display: grid;
    gap: 2px;
    font-size: 12px;
    opacity: 0.9;
    border-left: 3px solid rgba(255,255,255,0.22);
    padding-left: 8px;
    margin-bottom: 4px;
}
.message-reply-preview .reply-author {
    font-weight: 700;
}
.message-reply-preview .reply-text {
    opacity: 0.82;
}
.message-attachment img {
    display: block;
    max-width: min(320px, 100%);
    max-height: 280px;
    margin-top: 6px;
    border-radius: 10px;
}
.history-message.room-transition .history-notice-text {
    color: rgba(255,255,255,0.78);
    font-style: italic;
}

.message-trust-badge {
    display: inline-block;
    margin-left: 8px;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(255,255,255,0.12);
}
.experience-message-actions, .message-reactions, .experience-inline-reactions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 4px;
}
.experience-message-actions button {
    font-size: 11px;
    padding: 3px 7px;
    min-height: 0;
    line-height: 1.2;
}
.room-row { cursor: pointer; }
.news-rich-copy iframe,
.news-rich-copy img,
.news-content iframe,
.news-content img { max-width: 100%; border-radius: 10px; }
.news-inline-gallery { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; margin-top: 12px; }
.news-inline-gallery figure { margin: 0; }
.news-inline-gallery img { width: 100%; display: block; border-radius: 10px; }
.news-link-card { margin-top: 12px; padding: 12px; border: 1px solid rgba(0,0,0,0.12); border-radius: 12px; background: rgba(255,255,255,0.72); }
.advanced-news-editor { min-height: 240px; border: 1px solid rgba(0,0,0,0.18); border-radius: 12px; padding: 12px; background: #fff; }
.advanced-news-editor:empty:before { content: attr(data-placeholder); color: #6b7280; }
.news-editor-toolbar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; align-items: center; }
.news-editor-toolbar button, .news-editor-toolbar select, .news-editor-toolbar input { font: inherit; }
.news-comment-list { display: grid; gap: 10px; margin: 14px 0; }
.room-unread-badge {
    margin-left: auto;
    min-width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: #ff5c7a;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
}
.room-row-badges { display: flex; gap: 4px; flex-wrap: wrap; }
.room-rule-badge { font-size: 11px; }
.experience-room-settings summary {
    cursor: pointer;
    font-weight: 700;
    margin-bottom: 8px;
}
.experience-room-settings-grid {
    display: grid;
    gap: 10px;
}
.experience-room-settings label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 13px;
}
.experience-room-settings input,
.experience-room-settings textarea,
.experience-room-settings select {
    width: 100%;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.18);
    background: rgba(255,255,255,0.08);
    color: #fff;
    padding: 8px;
}
.experience-room-settings-actions,
.experience-video-queue-head,
.experience-video-queue-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
}
.experience-video-queue-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 8px;
}
.experience-video-queue-item {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: space-between;
}
.experience-reconnect-banner {
    position: fixed;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
}
.experience-mini-mod-btn {
    margin-top: 8px;
    font-size: 11px;
}
.flash-highlight {
    animation: flash-highlight 1.2s ease;
}
@keyframes flash-highlight {
    0% { box-shadow: 0 0 0 0 rgba(91, 195, 255, 0.7); }
    100% { box-shadow: 0 0 0 18px rgba(91, 195, 255, 0); }
}
:focus-visible {
    outline: 2px solid #7ec3ff;
    outline-offset: 2px;
}
@media (max-width: 900px) {
    body.experience-mobile .bottom-bar {
        position: sticky;
        bottom: 0;
        z-index: 35;
        display: grid;
        grid-template-columns: auto auto 1fr auto auto;
        gap: 8px;
        padding: 10px;
    }
    body.experience-mobile #chatInput {
        min-height: 42px;
        font-size: 16px;
    }
    body.experience-mobile .side-toolbar {
        width: 54px;
    }
    body.experience-mobile #roomsPanel {
        position: fixed;
        inset: 70px 12px auto 12px;
        z-index: 60;
    }
    body.experience-mobile .room-meta-bar {
        left: 8px;
        right: 8px;
        top: 40px;
    }
    body.experience-mobile .jump-unread-btn {
        right: 12px;
        bottom: 120px;
    }
}

/* v15 engagement, notifications, directory, admin */
.room-directory-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 18px;
}
.room-directory-card,
.admin-room-card,
.admin-user-card,
.admin-analytics-card,
.portal-card.soft-card {
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.96);
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}
.room-directory-card.is-announcement,
.admin-room-card.is-announcement,
body.current-room-announcement #chatStage {
    box-shadow: 0 0 0 1px rgba(151, 71, 255, 0.2), 0 12px 34px rgba(100, 51, 180, 0.18);
}
.room-directory-cover {
    min-height: 126px;
    background: linear-gradient(135deg, rgba(110, 92, 255, 0.25), rgba(255, 120, 220, 0.2));
    background-size: cover;
    background-position: center;
}
.room-directory-body {
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.room-directory-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.room-directory-count {
    font-size: 12px;
    font-weight: 700;
    color: #6a37b8;
    background: rgba(106, 55, 184, 0.08);
    border-radius: 999px;
    padding: 4px 9px;
}
.room-directory-topic {
    margin: 0;
    color: #43385d;
    line-height: 1.45;
}
.room-directory-topic.muted { color: #7e7593; }
.room-directory-badges,
.room-directory-actions,
.room-directory-events,
.room-mute-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.room-rule-badge.badge-announcement {
    background: rgba(140, 70, 255, 0.14);
    color: #5f2fa5;
    border-color: rgba(140, 70, 255, 0.18);
}
.room-event-chip {
    display: inline-flex;
    flex-direction: column;
    gap: 2px;
    padding: 8px 10px;
    border-radius: 10px;
    background: rgba(53, 147, 255, 0.08);
    border: 1px solid rgba(53, 147, 255, 0.14);
    font-size: 12px;
}
.room-event-chip.is-watch-party,
.room-event-row.is-watch-party {
    background: rgba(255, 81, 136, 0.08);
    border-color: rgba(255, 81, 136, 0.14);
}
.room-directory-manager-box {
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px dashed rgba(0, 0, 0, 0.12);
}
.room-directory-manager-box summary,
.admin-room-card summary,
.admin-user-card summary {
    cursor: pointer;
    font-weight: 700;
}
.notification-settings-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.notification-settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px 18px;
}
.room-mute-grid {
    margin-top: 10px;
}
.room-mute-row {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.04);
}
.room-mute-toggle {
    margin-left: auto;
    border: 0;
    background: rgba(0, 0, 0, 0.06);
    color: #57329e;
    border-radius: 999px;
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}
.room-mute-toggle:hover { background: rgba(0,0,0,0.1); }
.experience-upload-status {
    position: absolute;
    left: 18px;
    right: 18px;
    bottom: 86px;
    z-index: 36;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px 14px;
    border-radius: 12px;
    background: rgba(21, 18, 38, 0.92);
    color: #fff;
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.24);
}
.experience-upload-status.hidden { display: none; }
.experience-upload-progress {
    width: 100%;
    height: 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.16);
    overflow: hidden;
}
.experience-upload-progress-bar {
    width: 0%;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #7d5cff, #ff5aac);
    transition: width .18s ease;
}
.online-list-more-toggle {
    margin: 10px auto 2px;
    display: block;
}
.admin-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
    margin: 16px 0 20px;
}
.admin-stat-card {
    border-radius: 14px;
    background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(247,243,255,0.96));
    border: 1px solid rgba(102, 61, 171, 0.12);
    padding: 16px 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.admin-stat-card strong {
    font-size: 28px;
    line-height: 1;
    color: #5c35aa;
}
.admin-stat-card span {
    font-size: 12px;
    color: #6c6184;
}
.admin-dashboard-columns {
    display: grid;
    grid-template-columns: 1.05fr 0.95fr;
    gap: 18px;
    align-items: start;
}
.admin-column {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.admin-room-list,
.activity-feed.compact-feed {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.admin-room-card,
.admin-user-card {
    padding: 12px 14px;
}
.admin-analytics-card {
    padding: 14px;
}
body.current-room-announcement #roomBadge {
    background: linear-gradient(135deg, #6e3fd1, #b843da);
    border-color: rgba(255,255,255,0.36);
}
body.current-room-announcement #fieldOverlay {
    background: radial-gradient(circle at top, rgba(177, 89, 255, 0.16), transparent 38%), linear-gradient(180deg, rgba(255,255,255,0.04), rgba(31, 17, 59, 0.14));
}
@media (max-width: 980px) {
    .admin-dashboard-columns {
        grid-template-columns: 1fr;
    }
}
@media (max-width: 720px) {
    .room-directory-grid,
    .notification-settings-grid,
    .admin-stats-grid {
        grid-template-columns: 1fr;
    }
    .experience-upload-status {
        left: 10px;
        right: 10px;
        bottom: 94px;
    }
}


/* AnimeChat v7 fixes */
.experience-room-settings {
    background: #ecf9d7 !important;
    color: #243019 !important;
    border: 1px solid #b8d598 !important;
}
.experience-room-settings input,
.experience-room-settings textarea,
.experience-room-settings select {
    background: #f8ffef !important;
    color: #1e2814 !important;
    border-color: #b8d598 !important;
}
.experience-message-actions,
.experience-message-actions * {
    color: #111 !important;
}
.experience-message-actions {
    display: block;
    margin-top: 6px;
}
.experience-message-actions summary {
    cursor: pointer;
    list-style: none;
    font-size: 11px;
    font-weight: 700;
}
.experience-message-actions summary::-webkit-details-marker { display: none; }
.experience-message-actions-body {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 6px;
}
.room-unread-badge.chat-like-badge {
    position: absolute;
    top: 3px;
    right: 3px;
    min-width: 16px;
    min-height: 16px;
    padding: 1px 4px;
    border-radius: 999px;
    background: #c62828;
    color: #fff !important;
    font-size: 10px;
    line-height: 14px;
    border: 1px dotted #fff;
}
.room-mute-toggle,
#roomList .room-unread-badge:not(.chat-like-badge) {
    display: none !important;
}
.side-icon-text {
    font-size: 8px !important;
    line-height: 1 !important;
    letter-spacing: 0.2px;
}
#btnToggleRoomCall .side-icon-text,
#btnToggleRoomSettings .side-icon-text,
#btnToggleModerator .side-icon-text {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}
.chat-user-card .panel-body {
    background: #f7ffe9;
    color: #1d1d1d;
}
.chat-user-card-head {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 10px;
}
.chat-user-card-head img {
    width: 46px;
    height: 46px;
    object-fit: cover;
    border-radius: 10px;
}
.chat-user-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
#videoBottomControl,
#experienceVideoQueueBar {
    left: 16px;
    right: auto;
}
#videoBottomControl {
    bottom: 86px !important;
}
#experienceVideoQueueBar {
    position: fixed;
    bottom: 20px;
    left: 16px;
    max-width: 420px;
    z-index: 1600;
}
#guestProfileAuthBlock.hidden,
#memberProfileActions.hidden,
#profileApplyLink.hidden {
    display: none !important;
}


.experience-room-settings button,
.experience-room-settings .green-btn,
#expRoomSaveBtn,
#expRoomSlow15Btn {
    color: #111 !important;
}
.chat-user-card.user-dropdown-mode {
    width: 240px;
    max-width: min(240px, calc(100vw - 20px));
    min-height: 0;
    z-index: 2100;
}
.chat-user-card.user-dropdown-mode .window-title {
    font-size: 12px;
    padding: 6px 10px;
}
.chat-user-card.user-dropdown-mode .panel-body {
    padding: 10px;
}
.chat-user-card.user-dropdown-mode .chat-user-card-actions {
    flex-direction: column;
}
.chat-user-card.user-dropdown-mode .chat-user-card-actions .green-btn {
    width: 100%;
    justify-content: flex-start;
}
#btnToggleDm {
    position: relative;
}
#videoBottomControl.hidden + #experienceVideoQueueBar,
#experienceVideoQueueBar.hidden {
    display: none !important;
}


.avatar-gift-popup {
    width: min(320px, calc(100vw - 24px));
    background: rgba(255,255,255,0.98);
    color: #1f2937;
    border: 1px solid rgba(0,0,0,0.12);
    box-shadow: 0 18px 44px rgba(0,0,0,0.18);
}
.avatar-gift-preview-wrap {
    display: flex;
    justify-content: center;
    margin-bottom: 10px;
}
.avatar-gift-preview {
    width: 88px;
    height: 88px;
    border-radius: 14px;
    object-fit: cover;
    border: 1px solid rgba(0,0,0,0.1);
    background: #fff;
}
.message-text-action-toggle {
    cursor: pointer;
}
.message-text-action-toggle:hover {
    opacity: 0.92;
}
.experience-message-actions {
    display: block;
    margin-top: 4px;
}
.experience-message-actions-toggle {
    display: none;
}
.experience-message-actions-body {
    display: none;
    gap: 4px;
    flex-wrap: wrap;
    margin-top: 4px;
}
.experience-message-actions[open] .experience-message-actions-body {
    display: flex;
}
.experience-message-actions button {
    font-size: 10px;
    padding: 2px 6px;
    min-height: 0;
}


body.theme-anime.chat-embed-mode[data-page="chat"] .chat-scene {
    width: 100vw;
    max-width: 100vw;
    aspect-ratio: 16 / 9;
    border: 0 !important;
    box-shadow: none;
}

body.theme-anime.chat-embed-mode[data-page="chat"] .bottom-bar {
    width: auto;
    max-width: none;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

body.theme-anime.chat-embed-mode[data-page="chat"] .bottom-bar .send-btn {
    min-width: 110px;
}

body.theme-anime.chat-embed-mode[data-page="chat"] .chat-line {
    width: auto;
    min-width: 0;
}

@media (max-width: 560px) {
    body.theme-anime.chat-embed-mode[data-page="chat"] .bottom-bar {
        left: 10px;
        right: 10px;
        bottom: 10px;
        gap: 8px;
        padding: 0;
    }

    body.theme-anime.chat-embed-mode[data-page="chat"] .bottom-bar .send-btn {
        min-width: 92px;
        padding: 0 16px;
    }

    body.theme-anime.chat-embed-mode[data-page="chat"] .chat-line {
        min-height: 42px;
        height: 42px;
        padding: 0 12px;
        font-size: 14px;
    }
}

.history-message { position: relative; }
.history-message .message-time {
    position: absolute;
    right: 10px;
    bottom: 8px;
    opacity: 0;
    transition: opacity 0.15s ease;
    font-size: 10px;
    color: rgba(255,255,255,0.55);
    pointer-events: none;
}
.history-message:hover .message-time { opacity: 1; }
.history-message .message-head .meta { display: none !important; }
.history-message.system .message-time { bottom: 6px; right: 8px; }
.history-message.system .history-notice-text,
.history-message.room-transition .history-notice-text {
    color: rgba(188, 196, 206, 0.82) !important;
}

body.theme-anime[data-page="chat"] #videoBottomControl {
    background: #4EA03F;
    border: 1px solid rgba(112, 190, 68, 0.38);
    border-radius: 12px;
    box-shadow: 0 18px 34px rgba(0,0,0,0.34);
    color: #fff;
    overflow: visible;
}
body.theme-anime[data-page="chat"] #videoBottomControl .video-bottom-main {
    background: transparent;
    padding: 12px 12px 14px;
}
body.theme-anime[data-page="chat"] #videoBottomControl .video-bottom-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}
body.theme-anime[data-page="chat"] #videoBottomControl .video-bottom-title {
    font-size: 24px;
    font-weight: 800;
    letter-spacing: .03em;
    text-transform: uppercase;
}
body.theme-anime[data-page="chat"] #videoBottomControl .video-bottom-state {
    font-size: 12px;
    font-weight: 700;
    color: rgba(255,255,255,.86);
}
body.theme-anime[data-page="chat"] #videoBottomControl .video-bottom-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
body.theme-anime[data-page="chat"] #videoBottomControl .green-btn.tiny {
    border-radius: 999px;
    padding: 8px 12px;
    background: transparent;
    border: 1px solid rgba(255,255,255,.22);
    color: #fff;
    box-shadow: none;
}
body.theme-anime[data-page="chat"] #videoBottomControl .green-btn.tiny:hover {
    border-color: #6bc84b;
    color: #6bc84b;
}
body.theme-anime[data-page="chat"] #videoPlayBtn,
body.theme-anime[data-page="chat"] #videoSyncBtn {
    background: linear-gradient(180deg, #8fde4f, #69bf39);
    border-color: #76d143;
    color: #102007;
    font-weight: 800;
}
body.theme-anime[data-page="chat"] #videoProgress {
    height: 8px;
    border-radius: 999px;
    margin: 8px 0 14px;
}
body.theme-anime[data-page="chat"] #videoVolumePanel {
    background: #171313;
    border: 1px solid rgba(255,255,255,.18);
    border-radius: 10px;
    box-shadow: 0 16px 40px rgba(0,0,0,.34);
}


body.theme-anime[data-page="chat"] #roomBadge,
body.theme-anime[data-page="chat"] .room-badge,
body.theme-anime[data-page="chat"] .avatar-item,
body.theme-anime[data-page="chat"] .avatar-item .avatar-name,
body.theme-anime[data-page="chat"] .avatar-item .avatar-sprite,
body.theme-anime[data-page="chat"] .avatar-item .avatar-rank,
body.theme-anime[data-page="chat"] .avatar-item .avatar-premium {
    user-select: none !important;
    -webkit-user-select: none !important;
}
body.theme-anime[data-page="chat"] .avatar-item,
body.theme-anime[data-page="chat"] .avatar-item .avatar-name,
body.theme-anime[data-page="chat"] .avatar-item .avatar-sprite,
body.theme-anime[data-page="chat"] .avatar-item .avatar-rank,
body.theme-anime[data-page="chat"] .avatar-item .avatar-premium {
    pointer-events: none !important;
}
body.theme-anime[data-page="chat"] .youtube-layer,
body.theme-anime[data-page="chat"] .youtube-embed-host,
body.theme-anime[data-page="chat"] .youtube-layer iframe,
body.theme-anime[data-page="chat"] .youtube-layer video,
body.theme-anime[data-page="chat"] .youtube-layer .provider-embed-host {
    pointer-events: auto !important;
}
body.theme-anime[data-page="chat"] .youtube-layer .youtube-fallback-overlay,
body.theme-anime[data-page="chat"] .youtube-layer .youtube-fallback-overlay * {
    pointer-events: auto !important;
}
body.theme-anime[data-page="chat"] .youtube-layer {
    z-index: 6 !important;
}
body.theme-anime[data-page="chat"] .field-overlay {
    z-index: 5 !important;
}
body.theme-anime[data-page="chat"] .history-message.room-transition .history-notice-text,
body.theme-anime[data-page="chat"] .history-message.system .history-notice-text {
    color: rgba(184, 192, 200, 0.86) !important;
}


body.theme-anime[data-page="chat"] .avatar-item .bubble-wrap,
body.theme-anime[data-page="chat"] #roomBadge {
    pointer-events: none !important;
    user-select: none !important;
    -webkit-user-select: none !important;
}

.history-message .history-card,
.history-message .history-card-notice {
    position: relative;
    padding-right: 52px;
}
.history-message .message-time {
    position: absolute;
    right: 10px;
    bottom: 8px;
    opacity: 0;
    transition: opacity 0.15s ease;
    font-size: 10px;
    color: rgba(255,255,255,0.58);
    pointer-events: none;
}
.history-message:hover .message-time,
.history-message:focus-within .message-time {
    opacity: 1;
}
.history-message .message-head .meta,
.history-notice-meta {
    display: none !important;
}
.history-message.room-transition .history-notice-text,
.history-message.system .history-notice-text,
.history-message .history-card-notice .history-notice-text {
    color: rgba(184,192,200,0.86) !important;
}
.history-message .message-reactions {
    margin-top: 6px;
    gap: 4px;
}
.history-message .reaction-chip {
    padding: 3px 8px;
    margin-right: 0;
}
.history-message .reaction-chip.active {
    transform: translateY(1px);
}
.experience-room-settings-blacklist {
    margin-top: 12px;
    border-top: 1px solid rgba(255,255,255,0.08);
    padding-top: 12px;
}
.experience-room-blacklist-list {
    display: grid;
    gap: 6px;
    margin-top: 8px;
}
.experience-room-blacklist-row {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: center;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 8px;
    padding: 6px 8px;
}
.experience-room-blacklist-row small {
    color: rgba(255,255,255,0.56);
}
body.chat-embed-mode #chatStage::before,
body.chat-embed-mode #chatStage::after {
    box-shadow: none !important;
    border: 0 !important;
}
body.chat-embed-mode .main-stage,
body.chat-embed-mode .app-wrap {
    background: transparent !important;
}


body.theme-anime[data-page="chat"] #roomTopicBar,
body.theme-anime[data-page="chat"] #roomWelcomeBar {
    display: block !important;
}

.profile-avatar-gallery {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
}

body.theme-anime[data-page="chat"] .bubble-wrap {
    left: 0 !important;
    top: -10px !important;
    transform: none !important;
}

body.theme-anime[data-page="chat"] .bubble-wrap.bubble-edge-left {
    left: auto !important;
    right: 0 !important;
}

body.theme-anime[data-page="chat"] .bubble-wrap.bubble-edge-right {
    left: 0 !important;
    right: auto !important;
}

.history-message .message-head .message-trust-badge {
    display: none !important;
}

.history-message .history-card,
.history-message .history-card-notice {
    padding-right: 78px !important;
    padding-bottom: 22px !important;
}

.history-message .message-time {
    color: #8F9A94 !important;
}

.history-message .history-card-notice .history-notice-text,
.history-message.system .history-notice-text,
.history-message.room-transition .history-notice-text {
    color: #79BA8A !important;
}

.history-message.username-change .history-notice-text {
    color: #D2E2FB !important;
}

.history-message .experience-inline-reactions,
.history-message .message-reactions {
    position: absolute;
    right: 10px;
    bottom: 6px;
    margin-top: 0 !important;
}

.history-message .reaction-chip,
.history-message .reaction-chip.active {
    transform: none !important;
}

.history-message .reaction-chip {
    padding: 2px 7px;
    font-size: 11px;
}

body.theme-anime.portal-page[data-page="forums"] .forum-directory-top .header-search-button {
    min-height: 36px;
    border-radius: 999px;
    padding: 0 16px;
    background: linear-gradient(180deg, #9CE55A, #78C23D);
    color: #143109;
    border: 1px solid #5f9f33;
    font-weight: 700;
}

body.theme-anime[data-page="chat"] .classic-online-entry.role-admin .classic-online-name,
body.theme-anime[data-page="chat"] .classic-online-entry.role-admin .classic-online-sub,
body.theme-anime[data-page="chat"] .classic-online-entry.role-sensei .classic-online-name,
body.theme-anime[data-page="chat"] .classic-online-entry.role-sensei .classic-online-sub {
    color: #8a5cf6;
}

body.theme-anime[data-page="chat"] .classic-online-entry.role-moderator .classic-online-name,
body.theme-anime[data-page="chat"] .classic-online-entry.role-moderator .classic-online-sub {
    color: #4f8dff;
}


body.theme-anime[data-page="chat"] #roomTopicBar,
body.theme-anime[data-page="chat"] #roomWelcomeBar {
    display: block !important;
}

body.theme-anime[data-page="chat"] .avatar-item {
    z-index: 8 !important;
}

body.theme-anime[data-page="chat"] .avatar-item .bubble-wrap {
    top: -52px !important;
    z-index: 10 !important;
}

.history-message {
    margin: 0 0 8px !important;
}

.history-message .history-card,
.history-message .history-card-notice {
    padding: 6px 8px 18px 8px !important;
    border-radius: 9px !important;
    gap: 4px !important;
}

.history-message .message-body,
.history-message .history-notice-text {
    font-size: 12px !important;
    line-height: 1.28 !important;
}

.history-message .message-head {
    margin-bottom: 1px !important;
}

.history-message .message-time {
    font-size: 10px !important;
    right: 8px !important;
    bottom: 5px !important;
}

.history-message .message-reactions {
    left: 8px !important;
    right: auto !important;
    bottom: 4px !important;
}

.history-message .reaction-chip {
    padding: 1px 6px !important;
    font-size: 11px !important;
}

#videoBottomControl {
    overflow: visible !important;
}

#videoBottomControl .video-bottom-drag-handle {
    position: absolute;
    top: 8px;
    left: 10px;
    right: 34px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255,255,255,0.58);
    font-size: 12px;
    cursor: move;
    user-select: none;
    -webkit-user-select: none;
}

#videoBottomControl .video-bottom-drag-handle::before {
    content: '⋮⋮';
    letter-spacing: 6px;
}

#videoBottomControl .panel-resize-handle,
#videoBottomControl .ui-resizable-handle.ui-resizable-se {
    position: absolute;
    right: 4px;
    bottom: 4px;
    width: 18px;
    height: 18px;
    display: block;
    cursor: nwse-resize;
    color: rgba(255,255,255,0.58);
}

#videoBottomControl .panel-resize-handle::before,
#videoBottomControl .ui-resizable-handle.ui-resizable-se::before {
    content: '◢';
    position: absolute;
    right: 0;
    bottom: 0;
    font-size: 13px;
    line-height: 1;
}

.screen-share-status {
    position: absolute;
    left: 50%;
    bottom: 18px;
    transform: translateX(-50%);
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(15, 18, 24, 0.72);
    color: rgba(255,255,255,0.92);
    font-size: 12px;
    backdrop-filter: blur(8px);
    z-index: 7;
}

/* v3 targeted overrides: visible room meta, redesigned video control, compact history, avatar gallery */
body.theme-anime[data-page="chat"] #roomTopicBar,
body.theme-anime[data-page="chat"] #roomWelcomeBar {
    display: block !important;
}
body.theme-anime[data-page="chat"] #roomTopicBar[data-empty],
body.theme-anime[data-page="chat"] #roomWelcomeBar[data-empty] {
    display: none !important;
}

body.theme-anime[data-page="chat"] #videoBottomControl {
    width: min(760px, calc(100vw - 24px));
    min-height: 210px;
    padding: 10px;
    background: #191414 !important;
    border: 1px solid rgba(100, 167, 99, 0.42) !important;
    border-radius: 10px !important;
    box-shadow: 0 14px 28px rgba(0, 0, 0, 0.28) !important;
    overflow: visible !important;
}
body.theme-anime[data-page="chat"] #videoBottomControl .video-bottom-main {
    position: relative;
    padding: 28px 0 8px !important;
    background: transparent !important;
}
body.theme-anime[data-page="chat"] #videoBottomControl .video-bottom-drag-handle {
    position: absolute;
    inset: 0 24px auto 0;
    height: 28px;
    cursor: move;
    z-index: 3;
    color: transparent;
}
body.theme-anime[data-page="chat"] #videoBottomControl .video-bottom-drag-handle::before {
    content: '⋮⋮';
    position: absolute;
    top: 7px;
    left: 14px;
    color: rgba(255,255,255,.46);
    letter-spacing: 4px;
    font-size: 12px;
    line-height: 1;
}
body.theme-anime[data-page="chat"] #videoBottomControl .video-control-top {
    position: relative;
    display: flex;
    gap: 10px;
    align-items: flex-start;
}
body.theme-anime[data-page="chat"] #videoBottomControl .video-control-pfp {
    position: relative;
    top: 5px;
    left: 5px;
    width: 40px;
    height: 40px;
    border-radius: 5px;
    background: #d2d2d2;
    display: flex;
    justify-content: center;
    align-items: center;
    flex: 0 0 auto;
}
body.theme-anime[data-page="chat"] #videoBottomControl .video-control-playing {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 1px;
    width: 30px;
    height: 20px;
}
body.theme-anime[data-page="chat"] #videoBottomControl .video-control-line {
    width: 2px;
    height: 20px;
    background: #64A763;
    border-radius: 2px;
    transform-origin: bottom;
    animation: animechatVideoEqualizer 1s ease-in-out infinite;
}
body.theme-anime[data-page="chat"] #videoBottomControl .video-control-line.line-1 { animation-delay: .2s; }
body.theme-anime[data-page="chat"] #videoBottomControl .video-control-line.line-2 { animation-delay: .5s; }
body.theme-anime[data-page="chat"] #videoBottomControl .video-control-line.line-3 { animation-delay: .6s; }
body.theme-anime[data-page="chat"] #videoBottomControl .video-control-line.line-4 { animation-delay: 0s; }
body.theme-anime[data-page="chat"] #videoBottomControl .video-control-line.line-5 { animation-delay: .4s; }
@keyframes animechatVideoEqualizer {
    0% { transform: scaleY(0.1); }
    33% { transform: scaleY(0.6); }
    66% { transform: scaleY(0.9); }
    100% { transform: scaleY(0.1); }
}
body.theme-anime[data-page="chat"] #videoBottomControl .video-control-texts {
    flex: 1;
    min-width: 0;
    padding-top: 2px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-bottom: 0 !important;
}
body.theme-anime[data-page="chat"] #videoBottomControl .video-bottom-title {
    color: #fff;
    font-size: 25px;
    font-weight: 800;
    line-height: 1;
    text-transform: uppercase;
    letter-spacing: 0;
}
body.theme-anime[data-page="chat"] #videoBottomControl .video-bottom-state {
    color: rgba(255,255,255,.92);
    font-size: 12px;
    font-weight: 700;
}
body.theme-anime[data-page="chat"] #videoBottomControl .video-bottom-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 14px 0 0;
    padding: 0 4px;
}
body.theme-anime[data-page="chat"] #videoBottomControl .video-pill-btn {
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    border: 1px solid #5e5e5e;
    background: transparent;
    border-radius: 999px;
    padding: 8px 12px;
    cursor: pointer;
    transition: .12s ease;
    line-height: 1;
    box-shadow: none !important;
}
body.theme-anime[data-page="chat"] #videoBottomControl .video-pill-btn:hover:not(:disabled) {
    color: #64A763;
    border-color: #64A763;
}
body.theme-anime[data-page="chat"] #videoBottomControl .video-pill-btn:disabled {
    opacity: .48;
    cursor: default;
}
body.theme-anime[data-page="chat"] #videoBottomControl .video-pill-primary {
    background: #64A763;
    border-color: #64A763;
    color: #101b0f;
}
body.theme-anime[data-page="chat"] #videoBottomControl .video-pill-primary:hover:not(:disabled) {
    color: #0f180e;
    border-color: #7bc17a;
    background: #7bc17a;
}
body.theme-anime[data-page="chat"] #videoBottomControl .video-bottom-controls-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 10px 10px 0;
    color: #fff;
}
body.theme-anime[data-page="chat"] #videoBottomControl .video-bottom-spacer {
    width: 48px;
    flex: 0 0 48px;
}
body.theme-anime[data-page="chat"] #videoBottomControl .video-icon-btn {
    width: 30px;
    height: 30px;
    border: 0;
    background: transparent;
    color: currentColor;
    border-radius: 999px;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
}
body.theme-anime[data-page="chat"] #videoBottomControl .video-icon-btn:hover:not(:disabled) {
    color: #64A763;
}
body.theme-anime[data-page="chat"] #videoBottomControl .video-icon-btn:disabled {
    opacity: .4;
    cursor: default;
}
body.theme-anime[data-page="chat"] #videoBottomControl .video-progress {
    width: 90%;
    margin: 10px auto 0;
    display: block;
    height: 6px;
    border-radius: 999px;
    accent-color: #64A763;
}
body.theme-anime[data-page="chat"] #videoBottomControl .video-bottom-row {
    position: relative;
    min-height: 18px;
    margin-top: 6px;
}
body.theme-anime[data-page="chat"] #videoBottomControl .video-time-label {
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    opacity: .92;
    text-align: right;
    padding: 0 10px;
}
body.theme-anime[data-page="chat"] #videoBottomControl #videoVolumePanel {
    position: absolute;
    left: 14px;
    bottom: 48px;
    width: 120px;
    padding: 8px 8px 10px;
    border: 1px solid #5e5e5e;
    border-radius: 8px;
    background: #191414;
}
body.theme-anime[data-page="chat"] #videoBottomControl .video-volume-label,
body.theme-anime[data-page="chat"] #videoBottomControl .video-volume-value {
    color: #fff;
    font-size: 9px;
    font-weight: 700;
}
body.theme-anime[data-page="chat"] #videoBottomControl .video-volume-slider {
    width: 100%;
    accent-color: #64A763;
}
body.theme-anime[data-page="chat"] #videoBottomControl .video-playlist-popup {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translate(-50%, -100%);
    width: 430px;
    max-width: calc(100vw - 32px);
    background: #191414;
    border-radius: 10px;
    padding: 10px;
    border: 1px solid #5e5e5e;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.34);
    z-index: 20;
}
body.theme-anime[data-page="chat"] #videoBottomControl .video-playlist-top {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 10px;
}
body.theme-anime[data-page="chat"] #videoBottomControl .video-playlist-title {
    color: #fff;
    font-size: 25px;
    font-weight: 800;
    line-height: 1;
    flex: 1;
}
body.theme-anime[data-page="chat"] #videoBottomControl .video-playlist-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}
body.theme-anime[data-page="chat"] #videoBottomControl .video-playlist-input {
    width: 100%;
    border: 0;
    outline: 0;
    background: transparent;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    padding: 0 0 10px;
    border-bottom: 1px solid #5e5e5e;
    margin-bottom: 10px;
}
body.theme-anime[data-page="chat"] #videoBottomControl .video-playlist-input::placeholder {
    color: rgba(255,255,255,.65);
}
body.theme-anime[data-page="chat"] #videoBottomControl .video-playlist-box {
    width: 100%;
    background: #232323;
    border-radius: 8px;
    padding: 8px;
    border: 1px solid #353535;
}
body.theme-anime[data-page="chat"] #videoBottomControl .video-playlist-label {
    color: rgba(255,255,255,.76);
    font-size: 11px;
    font-weight: 700;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: .03em;
}
body.theme-anime[data-page="chat"] #videoBottomControl .video-playlist-current {
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.35;
    word-break: break-all;
}
body.theme-anime[data-page="chat"] #videoBottomControl .panel-resize-handle,
body.theme-anime[data-page="chat"] #videoBottomControl .ui-resizable-handle.ui-resizable-se {
    right: 4px;
    bottom: 4px;
    width: 18px;
    height: 18px;
    cursor: nwse-resize;
    color: rgba(255,255,255,.58);
}
body.theme-anime[data-page="chat"] #videoBottomControl .panel-resize-handle::before,
body.theme-anime[data-page="chat"] #videoBottomControl .ui-resizable-handle.ui-resizable-se::before {
    content: '◢';
    position: absolute;
    right: 0;
    bottom: 0;
    font-size: 13px;
    line-height: 1;
}

body.theme-anime[data-page="chat"] .history-message {
    display: flex;
    margin: 0 0 6px !important;
}
body.theme-anime[data-page="chat"] .history-message .history-card,
body.theme-anime[data-page="chat"] .history-message .history-card-notice {
    width: fit-content;
    max-width: min(78%, 520px);
    padding: 5px 8px 16px 8px !important;
    border-radius: 8px !important;
    gap: 3px !important;
}
body.theme-anime[data-page="chat"] .history-message .history-card.self {
    margin-left: auto;
}
body.theme-anime[data-page="chat"] .history-message .message-head,
body.theme-anime[data-page="chat"] .history-message .message-text,
body.theme-anime[data-page="chat"] .history-message .history-notice-text {
    font-size: 11px !important;
    line-height: 1.22 !important;
}
body.theme-anime[data-page="chat"] .history-message .message-reply-preview {
    font-size: 10px;
    gap: 1px;
    padding-left: 6px;
    margin-bottom: 2px;
}
body.theme-anime[data-page="chat"] .history-message .message-attachment img {
    max-width: min(220px, 100%);
    max-height: 180px;
    margin-top: 4px;
    border-radius: 8px;
}
body.theme-anime[data-page="chat"] .history-message .message-time {
    font-size: 9px !important;
    bottom: 4px !important;
    right: 6px !important;
}
body.theme-anime[data-page="chat"] .history-message .message-reactions,
body.theme-anime[data-page="chat"] .history-message .experience-inline-reactions {
    left: 6px !important;
    right: auto !important;
    bottom: 3px !important;
    gap: 4px !important;
}
body.theme-anime[data-page="chat"] .history-message .reaction-chip {
    padding: 1px 5px !important;
    font-size: 10px !important;
}
body.theme-anime[data-page="chat"] .history-message .history-card-notice .history-notice-text,
body.theme-anime[data-page="chat"] .history-message.system .history-notice-text,
body.theme-anime[data-page="chat"] .history-message.room-transition .history-notice-text {
    color: #79BA8A !important;
}
body.theme-anime[data-page="chat"] .history-message.username-change .history-notice-text {
    color: #D2E2FB !important;
}

body.theme-anime[data-page="chat"] .profile-avatar-gallery.legacy-avatar-matrix {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    grid-auto-rows: 88px !important;
    grid-auto-flow: row !important;
    justify-items: stretch !important;
    align-items: stretch !important;
    align-content: start !important;
    gap: 8px !important;
    padding: 8px !important;
    min-height: 0 !important;
    max-height: 292px !important;
    height: auto !important;
    overflow-y: auto;
    overflow-x: hidden;
    box-sizing: border-box;
    contain: layout paint;
}
body.theme-anime[data-page="chat"] .profile-avatar-gallery.legacy-avatar-matrix .profile-avatar-card {
    position: relative;
    width: 100% !important;
    min-width: 0;
    min-height: 0;
    height: 88px !important;
    aspect-ratio: auto !important;
    overflow: hidden;
    box-sizing: border-box;
}
body.theme-anime[data-page="chat"] .profile-avatar-gallery.legacy-avatar-matrix .profile-avatar-select {
    width: 100%;
    height: 100%;
    padding: 0 !important;
    display: block;
}
body.theme-anime[data-page="chat"] .profile-avatar-gallery.legacy-avatar-matrix .profile-avatar-select img {
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    max-height: none !important;
    object-fit: cover !important;
    display: block;
    margin: 0 !important;
}
body.theme-anime[data-page="chat"] .profile-avatar-gallery.legacy-avatar-matrix .profile-avatar-tag {
    left: 4px;
    bottom: 4px;
    transform: none;
    max-width: calc(100% - 8px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    z-index: 2;
}
body.theme-anime[data-page="chat"] .profile-avatar-gallery.legacy-avatar-matrix .profile-avatar-remove {
    top: 4px;
    right: 4px;
    z-index: 3;
}
@media (max-width: 520px) {
    body.theme-anime[data-page="chat"] .profile-avatar-gallery.legacy-avatar-matrix {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}

@media (max-width: 720px) {
    body.theme-anime[data-page="chat"] #videoBottomControl {
        min-height: 255px;
        width: calc(100vw - 24px);
    }
    body.theme-anime[data-page="chat"] #videoBottomControl .video-control-top {
        flex-wrap: wrap;
    }
    body.theme-anime[data-page="chat"] #videoBottomControl .videoPlaylistToggleBtn,
    body.theme-anime[data-page="chat"] #videoBottomControl #videoPlaylistToggleBtn {
        margin-left: 55px;
    }
    body.theme-anime[data-page="chat"] #videoBottomControl .video-playlist-popup {
        width: calc(100vw - 24px);
    }
    body.theme-anime[data-page="chat"] .history-message .history-card,
    body.theme-anime[data-page="chat"] .history-message .history-card-notice {
        max-width: min(88%, 420px);
    }
}


#toolbar .panel-resize-handle,
#toolbar .ui-resizable-handle.ui-resizable-se {
    position: absolute;
    right: 0;
    bottom: 0;
    width: 12px;
    height: 12px;
    display: block;
    cursor: nwse-resize;
    color: transparent;
}

#toolbar .panel-resize-handle::before,
#toolbar .ui-resizable-handle.ui-resizable-se::before {
    content: none;
    display: none;
}

#toolbar .ui-resizable-handle.ui-resizable-e,
#toolbar .panel-resize-east {
    position: absolute;
    top: 14px;
    right: 0;
    bottom: 10px;
    width: 8px;
    cursor: e-resize;
}

#toolbar .ui-resizable-handle.ui-resizable-s,
#toolbar .panel-resize-south {
    position: absolute;
    left: 10px;
    right: 10px;
    bottom: 0;
    height: 8px;
    cursor: s-resize;
}

#toolbar .ui-resizable-handle.ui-resizable-e::before,
#toolbar .panel-resize-east::before {
    content: none;
    display: none;
}

#toolbar .ui-resizable-handle.ui-resizable-s::before,
#toolbar .panel-resize-south::before {
    content: none;
    display: none;
}

body.theme-anime[data-page="chat"] #roomTopicBar,
body.theme-anime[data-page="chat"] #roomPinsBar,
body.theme-anime[data-page="chat"] .room-topic-bar,
body.theme-anime[data-page="chat"] .room-pins-bar {
    display: none !important;
}

body.theme-anime[data-page="chat"] .window-panel,
body.theme-anime[data-page="chat"] .floating-sidebar {
    z-index: 110;
}


body.theme-anime[data-page="chat"] #roomMetaBar,
body.theme-anime[data-page="chat"] #roomTopicBar,
body.theme-anime[data-page="chat"] #roomWelcomeBar,
body.theme-anime[data-page="chat"] #roomPinsBar,
body.theme-anime[data-page="chat"] .room-topic-bar,
body.theme-anime[data-page="chat"] .room-pins-bar {
    display: none !important;
}

body.theme-anime[data-page="chat"] #toolbar,
body.theme-anime[data-page="chat"] .floating-sidebar {
    min-width: 40px !important;
    min-height: 160px !important;
    overflow: visible !important;
}

body.theme-anime[data-page="chat"] .window-panel,
body.theme-anime[data-page="chat"] .history-panel {
    box-sizing: border-box;
}

body.theme-anime[data-page="chat"] .window-panel:not(.history-panel) {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

body.theme-anime[data-page="chat"] .window-panel:not(.history-panel) .panel-body,
body.theme-anime[data-page="chat"] .history-panel .history-body {
    min-height: 0;
    overflow: auto;
    box-sizing: border-box;
}

body.theme-anime[data-page="chat"] #chatHistoryPanel {
    width: 300px;
    height: 190px;
    min-width: 220px;
    min-height: 140px;
}

body.theme-anime[data-page="chat"] #chatHistoryPanel .history-footer {
    flex: 0 0 auto;
}

body.theme-anime[data-page="chat"] #roomList,
body.theme-anime[data-page="chat"] #onlineList,
body.theme-anime[data-page="chat"] .classic-room-list,
body.theme-anime[data-page="chat"] .classic-online-list {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    min-height: 180px;
}

body.theme-anime[data-page="chat"] .classic-online-entry {
    display: flex !important;
}

body.theme-anime[data-page="chat"] .avatar-item {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

body.theme-anime[data-page="chat"] .avatar-item .avatar-sprite {
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}


body.theme-anime[data-page="chat"] .avatar-item.is-afk {
    opacity: 0.5 !important;
}
body.theme-anime[data-page="chat"] .classic-online-entry.is-afk .classic-online-name,
body.theme-anime[data-page="chat"] .classic-online-entry.is-afk .classic-online-sub {
    opacity: 0.7;
}
body.theme-anime[data-page="chat"] .video-tap-unmute-overlay {
    position: absolute;
    left: 50%;
    bottom: 96px;
    transform: translateX(-50%);
    z-index: 32;
    pointer-events: auto !important;
    display: flex;
    align-items: center;
    justify-content: center;
}
body.theme-anime[data-page="chat"] .video-tap-unmute-overlay .video-tap-unmute-btn {
    border: 1px solid rgba(255,255,255,.24);
    background: rgba(14,16,22,.82);
    color: #fff;
    border-radius: 999px;
    padding: 10px 16px;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 14px 30px rgba(0,0,0,.28);
}
body.theme-anime[data-page="chat"] .video-tap-unmute-overlay .video-tap-unmute-btn:hover {
    border-color: #79ba8a;
    color: #79ba8a;
}
.room-directory-inline-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}
/* 🔥 YouTube Klick-Fix (GANZ UNTEN EINFÜGEN) */

#chatStage {
    position: relative;
}

#youtubeLayer {
    position: absolute;
    inset: 0;
    z-index: 50;
    pointer-events: auto;
}

#youtubeLayer iframe {
    width: 100%;
    height: 100%;
    pointer-events: auto;
}

/* ❗ DAS IST DER ENTSCHEIDENDE FIX */
#fieldOverlay {
    pointer-events: none !important;
}

body.theme-anime[data-page="chat"].youtube-avatar-clickthrough #youtubeLayer .youtube-embed-host,
body.theme-anime[data-page="chat"].youtube-avatar-clickthrough #youtubeLayer iframe,
body.theme-anime[data-page="chat"].youtube-avatar-clickthrough #youtubeLayer .room-video-embed,
body.theme-anime[data-page="chat"].youtube-avatar-clickthrough #youtubeLayer .room-video-player,
body.theme-anime[data-page="chat"].youtube-avatar-clickthrough #youtubeLayer .video-tap-unmute-btn {
    pointer-events: none !important;
}

body.theme-anime[data-page="chat"].youtube-avatar-clickthrough #youtubeLayer {
    pointer-events: auto !important;
}

/* Videoplayer-Container */
.room-video-player,
.room-video-embed,
.youtube-embed-host {
    position: relative;
}






body.theme-anime[data-page="chat"] #videoBottomControl .video-bottom-main::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;

    background-image:
        linear-gradient(
    90deg,
    rgba(78,160,63,0.85) 0%,
    rgba(78,160,63,0.75) 25%,
    rgba(78,160,63,0.60) 50%,
    rgba(78,160,63,0.75) 75%,
    rgba(78,160,63,0.85) 100%
),
        url("/images/website%20assets/videoplayer/yui.png");

    background-repeat: no-repeat, no-repeat;

    background-position:
        center center,
        left 34px center;

    background-size:
        cover,
        150px auto;

    opacity: 0.99;
}

body.theme-anime[data-page="chat"] #videoBottomControl,
body.theme-anime[data-page="chat"] #videoBottomControl .video-bottom-main {
    border-color: #4EA03F !important;
    box-shadow: none !important;
}

/* ❌ schwarzen Rahmen komplett killen */
body.theme-anime[data-page="chat"] #videoBottomControl {
    background: #4EA03F !important;
    border: 2px solid #4EA03F !important;
    box-shadow: none !important;
}

/* ❗ falls ein äußerer Wrapper den Schatten macht */
body.theme-anime[data-page="chat"] .room-video-player,
body.theme-anime[data-page="chat"] .room-video-embed,
body.theme-anime[data-page="chat"] .youtube-embed-host {
    box-shadow: none !important;
    border: none !important;
    background: transparent !important;
}

/* 🎀 Video Buttons - rosa Highlight */
body.theme-anime[data-page="chat"] #videoBottomControl button,
body.theme-anime[data-page="chat"] #videoBottomControl .green-btn {
    
    background: rgba(255, 182, 193, 0.18) !important; /* soft pink */
    border: 1px solid rgba(255, 182, 193, 0.45) !important;
    color: #ffffff !important;

    backdrop-filter: blur(6px);
    border-radius: 999px;
    transition: all 0.2s ease;
}

/* ✨ Hover Effekt */
body.theme-anime[data-page="chat"] #videoBottomControl button:hover,
body.theme-anime[data-page="chat"] #videoBottomControl .green-btn:hover {
    
    background: rgba(255, 182, 193, 0.35) !important;
    border-color: rgba(255, 182, 193, 0.7) !important;

    box-shadow: 0 0 10px rgba(255, 182, 193, 0.35);
    transform: translateY(-1px);
}

/* 🔘 Aktive Buttons (z.B. Pause aktiv) */
body.theme-anime[data-page="chat"] #videoBottomControl button:active {
    transform: scale(0.96);
}


.news-preview-box {
    margin-top: 20px;
    padding: 15px;
    background: #ffffff;
    border: 1px solid #ddd;
    border-radius: 12px;
}

.news-preview-box h3 {
    margin: 0 0 10px;
    font-size: 16px;
    opacity: 0.7;
}

/* Nur auf der Startseite: Teaser schöner machen */
body.theme-anime.portal-home:not(.news-single-page) .news-classic-post .news-rich-copy {
    font-size: 16px;
    line-height: 1.7;
    color: #4a4338;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Paragraph-Abstände nur für Startseiten-Teaser */
body.theme-anime.portal-home:not(.news-single-page) .news-classic-post .news-rich-copy p {
    margin: 0 0 10px;
}

/* Weiterlesen schöner */
body.theme-anime.portal-home:not(.news-single-page) .news-classic-post .read-more-inline a,
body.theme-anime.portal-home:not(.news-single-page) .news-classic-post .news-readmore summary {
    font-weight: 700;
    color: #4b8f2f;
}

/* Forum-Inhalte mehrzeilig und sauber */
body.theme-anime.portal-page[data-page="forums"] .forum-reply-body,
body.theme-anime.portal-page[data-page="groups"] .forum-reply-body,
body.theme-anime.portal-page[data-page="forums"] #topic-content-display,
body.theme-anime.portal-page[data-page="groups"] .forum-topic-body {
    display: block;
    max-width: 100%;
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
    word-break: break-word;
    overflow-wrap: anywhere;
    line-height: 1.6;
}

/* Absätze im Forum */
body.theme-anime.portal-page[data-page="forums"] .forum-reply-body p,
body.theme-anime.portal-page[data-page="forums"] .forum-reply-body div,
body.theme-anime.portal-page[data-page="groups"] .forum-reply-body p,
body.theme-anime.portal-page[data-page="groups"] .forum-reply-body div,
body.theme-anime.portal-page[data-page="forums"] #topic-content-display p,
body.theme-anime.portal-page[data-page="groups"] .forum-topic-body p {
    margin: 0 0 10px;
}

/* Bilder im Forum */
body.theme-anime.portal-page[data-page="forums"] .forum-reply-body img,
body.theme-anime.portal-page[data-page="groups"] .forum-reply-body img,
body.theme-anime.portal-page[data-page="forums"] #topic-content-display img,
body.theme-anime.portal-page[data-page="groups"] .forum-topic-body img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 10px 0;
    border-radius: 12px;
}

body.theme-anime.portal-page[data-page="forums"] .reply-card,
body.theme-anime.portal-page[data-page="groups"] .reply-card {
    white-space: normal !important;
}

body.theme-anime.portal-page[data-page="forums"] .reply-card *,
body.theme-anime.portal-page[data-page="groups"] .reply-card * {
    white-space: normal;
}
.reply-card {
    white-space: normal !important;
}

.reply-card * {
    white-space: normal !important;
}