.rh-community-app {
    --rh-bg: #f4f6fa;
    --rh-card: #ffffff;
    --rh-border: #dbe1ea;
    --rh-text: #111827;
    --rh-muted: #6b7280;
    --rh-accent: #1d6ee7;
    --rh-shadow: 0 8px 24px rgba(19, 35, 63, 0.08);
    background: var(--rh-bg);
    border: 1px solid var(--rh-border);
    border-radius: 16px;
    padding: 16px;
    color: var(--rh-text);
    font-family: "Segoe UI", Arial, sans-serif;
}

.rh-community-app * {
    box-sizing: border-box;
}

.rh-community-grid {
    display: grid;
    grid-template-columns: 280px 1fr 300px;
    gap: 16px;
    align-items: start;
}

.rh-card {
    background: var(--rh-card);
    border: 1px solid var(--rh-border);
    border-radius: 14px;
    box-shadow: var(--rh-shadow);
}

.rh-left {
    overflow: hidden;
}

.rh-profile-cover {
    height: 78px;
    background: linear-gradient(120deg, #1e2022 0%, #1c2835 100%);
}

.rh-profile-head {
    text-align: center;
    padding: 0 14px 14px;
    margin-top: -60px;
}

.rh-profile-avatar-wrap {
    position: relative;
    display: inline-block;
}

.rh-profile-settings-btn {
    position: absolute;
    top: -10px;
    left: -14px;
    border: 0;
    border-radius: 999px;
    background: #e8f0ff;
    color: #1d4ed8;
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    font-size: 16px;
    font-weight: 700;
    padding: 0;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(29, 78, 216, 0.2);
}

.rh-profile-settings-btn:hover {
    background: #dbe8ff;
}

.rh-profile-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 4px solid #fff;
    object-fit: cover;
}

.rh-profile-head h3 {
    margin: 8px 0 4px;
    font-size: 24px;
}

.rh-profile-head p {
    margin: 0;
    color: var(--rh-muted);
}

.rh-profile-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin: 0 14px 12px;
}

.rh-profile-stats div {
    background: #f6f9ff;
    border: 1px solid #e6edf9;
    border-radius: 10px;
    padding: 10px 8px;
    text-align: center;
}

.rh-profile-stats strong {
    display: block;
    font-size: 18px;
}

.rh-profile-stats span {
    color: var(--rh-muted);
    font-size: 12px;
}

.rh-left-menu {
    margin: 0;
    padding: 8px 14px 16px;
    list-style: none;
    border-top: 1px solid var(--rh-border);
}

.rh-left-menu li {
    padding: 10px 4px;
    border-bottom: 1px solid #edf1f7;
    font-weight: 600;
    font-size: 13px;
}

.rh-left-menu a {
    color: #111827;
    text-decoration: none;
}

.rh-left-menu a.is-active {
    color: var(--rh-accent);
}

.rh-left-menu li:last-child {
    border-bottom: 0;
}

.rh-center {
    display: grid;
    gap: 14px;
}

.rh-stories {
    padding: 12px;
}

.rh-stories h3,
.rh-right h3 {
    margin: 0 0 10px;
    font-size: 22px;
}

.rh-stories-row {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 122px;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.rh-story-add,
.rh-story-item {
    border: 1px dashed #cfd8e5;
    border-radius: 12px;
    background: #f8fbff;
    min-height: 130px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 8px;
    padding: 10px;
}

.rh-story-add {
    cursor: pointer;
    border-style: solid;
}

.rh-story-add span {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #e6efff;
    color: var(--rh-accent);
    display: grid;
    place-items: center;
    font-size: 30px;
}

.rh-story-item img {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    object-fit: cover;
}

.rh-story-item span {
    text-align: center;
    font-size: 13px;
    font-weight: 600;
}

.rh-user-link {
    color: inherit;
    text-decoration: none;
}

.rh-composer {
    padding: 12px;
}

.rh-composer-top {
    display: grid;
    grid-template-columns: 44px 1fr;
    gap: 10px;
    align-items: center;
}

.rh-composer-top img {
    width: 44px;
    height: 44px;
    border-radius: 50%;
}

.rh-composer-input {
    border: 1px solid #d3dbe8;
    border-radius: 999px;
    background: #f8fafc;
    color: #6b7280;
    text-align: left;
    padding: 12px 14px;
    cursor: pointer;
}

.rh-composer-login {
    margin: 10px 0 0;
    font-size: 14px;
    color: var(--rh-muted);
}

.rh-composer-login a {
    color: var(--rh-accent);
    text-decoration: none;
}

.rh-feed {
    display: grid;
    gap: 14px;
}

.rh-post {
    padding: 14px;
}

.rh-post-head {
    margin-bottom: 10px;
}

.rh-post-user {
    display: grid;
    grid-template-columns: 56px 1fr;
    gap: 10px;
    align-items: center;
}

.rh-post-user img {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: cover;
}

.rh-post-head h4 {
    margin: 0;
    font-size: 18px;
}

.rh-post-head p {
    margin: 2px 0 0;
    color: var(--rh-muted);
    font-size: 13px;
}

.rh-post-body h5 {
    margin: 0 0 8px;
    font-size: 18px;
}

.rh-post-group {
    display: inline-block;
    margin-bottom: 8px;
    padding: 4px 8px;
    border-radius: 999px;
    background: #e8f0ff;
    color: #1d4ed8;
    font-size: 12px;
    font-weight: 700;
}

.rh-post-body p {
    margin: 0;
    color: #374151;
    line-height: 1.5;
}

.rh-post-images {
    margin-top: 12px;
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.rh-post-images img {
    width: 100%;
    aspect-ratio: 1 / 1;
    height: auto;
    object-fit: cover;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    cursor: zoom-in;
}

.rh-right {
    display: grid;
    gap: 14px;
}

.rh-right .rh-card {
    padding: 14px;
}

.rh-member-list,
.rh-news-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.rh-member-list li {
    padding: 8px 0;
    border-bottom: 1px solid #edf1f7;
}

.rh-member-list li:last-child,
.rh-news-list li:last-child {
    border-bottom: 0;
}

.rh-member-link {
    display: grid;
    grid-template-columns: 44px 1fr;
    gap: 10px;
    align-items: center;
}

.rh-member-list img {
    width: 44px;
    height: 44px;
    border-radius: 50%;
}

.rh-news-list li {
    padding: 10px 0;
    border-bottom: 1px solid #edf1f7;
}

.rh-news-list a {
    color: #111827;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    line-height: 1.35;
    display: block;
    margin-bottom: 4px;
}

.rh-news-list small {
    color: var(--rh-muted);
    font-size: 12px;
}

.rh-comments {
    margin-top: 12px;
    border-top: 1px solid #e5eaf1;
    padding-top: 10px;
    margin-left: 44px;
    padding-left: 12px;
}

.rh-comments h6 {
    margin: 0 0 8px;
    font-size: 13px;
    text-transform: uppercase;
    color: #475569;
}

.rh-comments-list {
    display: grid;
    gap: 8px;
}

.rh-comments-list .rh-empty {
    font-size: 12px;
    color: #94a3b8;
}

.rh-comment-item {
    display: grid;
    grid-template-columns: 36px 1fr;
    gap: 8px;
    align-items: start;
}

.rh-comment-item img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
}

.rh-comment-item strong {
    display: block;
    font-size: 13px;
    margin-bottom: 2px;
}

.rh-comment-item p {
    margin: 0;
    font-size: 14px;
    color: #1f2937;
}

.rh-comment-form {
    margin-top: 10px;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
}

.rh-comment-form input {
    border: 1px solid #d2d9e7;
    border-radius: 999px;
    padding: 8px 12px;
    font-size: 14px;
}

.rh-comment-form button {
    border: 0;
    border-radius: 999px;
    background: #1d6ee7;
    color: #fff;
    padding: 8px 12px;
    font-weight: 700;
    cursor: pointer;
}

.rh-comment-notice,
.rh-comment-login {
    margin: 8px 0 0;
    font-size: 12px;
    color: #64748b;
}

.rh-empty {
    margin: 0;
    color: var(--rh-muted);
}

.rh-community-modal[hidden] {
    display: none;
}

.rh-community-modal {
    position: fixed;
    inset: 0;
    z-index: 100000;
}

.rh-community-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(10, 20, 36, 0.58);
}

.rh-community-modal__dialog {
    position: relative;
    margin: 8vh auto;
    width: min(92vw, 620px);
    border-radius: 14px;
    background: #fff;
    padding: 16px;
    border: 1px solid var(--rh-border);
    box-shadow: var(--rh-shadow);
    z-index: 1;
}

.rh-community-modal__close {
    position: absolute;
    right: 10px;
    top: 10px;
    width: 30px;
    height: 30px;
    border-radius: 999px;
    border: 0;
    background: #e8edf5;
    cursor: pointer;
}

.rh-community-modal__form {
    display: grid;
    gap: 10px;
}

.rh-community-modal__form label {
    display: grid;
    gap: 6px;
    font-size: 14px;
    font-weight: 600;
}

.rh-community-modal__form input,
.rh-community-modal__form select,
.rh-community-modal__form textarea {
    border: 1px solid #d2d9e7;
    border-radius: 10px;
    padding: 10px;
    font-size: 14px;
    font-family: inherit;
}

.rh-community-modal__submit {
    border: 0;
    border-radius: 10px;
    background: var(--rh-accent);
    color: #fff;
    padding: 11px;
    font-weight: 700;
    cursor: pointer;
}

.rh-community-modal__notice {
    margin: 0;
    font-size: 13px;
    color: #334155;
}

.rh-story-modal {
    width: min(92vw, 520px);
    text-align: center;
    padding: 34px 20px;
}

.rh-story-modal h3 {
    margin: 10px 0 6px;
    font-family: 'VT323', monospace;
    font-size: 30px;
    letter-spacing: 1.2px;
    line-height: 1.1;
    font-weight: 800;
    color: #1d4ed8;
}

.rh-image-viewer[hidden] {
    display: none;
}

.rh-image-viewer {
    position: fixed;
    inset: 0;
    z-index: 120000;
}

.rh-image-viewer__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(5, 10, 18, 0.86);
}

.rh-image-viewer img {
    position: absolute;
    inset: 0;
    margin: auto;
    max-width: min(94vw, 1400px);
    max-height: 90vh;
    width: auto;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
}

.rh-image-viewer__close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.92);
    color: #0f172a;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
}

.rh-profile-page {
    padding: 0;
    overflow: hidden;
    background: linear-gradient(180deg, #0b1326 0%, #101a35 100%);
    border-color: #1d2a4a;
    color: #f8fafc;
}

.rh-profile-page .rh-empty {
    color: #c0c9dd;
}

.rh-profile-page-cover {
    height: 160px;
    background:
        linear-gradient(120deg, rgba(49, 130, 246, 0.55), rgba(30, 64, 175, 0.75)),
        radial-gradient(circle at 10% 20%, rgba(255,255,255,0.25), transparent 45%);
}

.rh-profile-page-head {
    display: grid;
    grid-template-columns: 130px 1fr;
    gap: 14px;
    align-items: center;
    margin: -48px 16px 16px;
}

.rh-profile-page-head img {
    width: 130px;
    height: 130px;
    border-radius: 50%;
    border: 4px solid #0f1b34;
    object-fit: cover;
}

.rh-profile-page-meta h2 {
    margin: 0 0 4px;
    color: #ffffff;
}

.rh-profile-page-handle {
    margin: 0 0 8px;
    color: #c6d0e9;
    font-size: 14px;
}

.rh-profile-page-bio {
    margin: 0 0 10px;
    color: #e2e8f0;
    font-size: 14px;
}

.rh-profile-page-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
}

.rh-profile-page-stats span {
    display: inline-flex;
    gap: 5px;
    align-items: baseline;
    font-size: 13px;
    color: #c6d0e9;
}

.rh-profile-page-stats strong {
    color: #ffffff;
}

.rh-profile-posts {
    display: grid;
    gap: 12px;
    padding: 0 16px 16px;
}

.rh-profile-page h3 {
    margin: 0 16px 12px;
    color: #ffffff;
    font-size: 18px;
}

.rh-profile-post-card {
    background: #111f3d;
    border-color: #243456;
}

.rh-profile-post-card .rh-post-body h5,
.rh-profile-post-card .rh-post-body p {
    color: #e8eefc;
}

.rh-profile-post-date {
    margin: 0 0 8px;
    font-size: 12px;
    color: #9fb1d9;
}

.rh-upload {
    display: grid;
    gap: 8px;
}

.rh-dropzone {
    border: 2px dashed #c7d2e5;
    border-radius: 12px;
    background: #f8fbff;
    padding: 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.rh-dropzone.is-dragover {
    border-color: #1d6ee7;
    background: #eef4ff;
}

.rh-dropzone p {
    margin: 0;
    color: #475569;
    font-size: 14px;
}

.rh-dropzone input[type="file"] {
    display: none;
}

.rh-upload-preview {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
}

.rh-register-card {
    max-width: 520px;
    margin: 20px auto;
    padding: 16px;
    background: #0f172a;
    border-color: #26324a;
    color: #e5edf9;
}

.rh-register-card h3 {
    margin: 0 0 12px;
    font-size: 24px;
    color: #ffffff;
}

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

.rh-register-form label {
    display: grid;
    gap: 6px;
    font-size: 14px;
    color: #dbe7ff;
    font-weight: 600;
}

.rh-register-form input[type="text"],
.rh-register-form input[type="email"],
.rh-register-form input[type="password"] {
    width: 100%;
    border: 1px solid #334155;
    border-radius: 10px;
    padding: 10px;
    font-size: 14px;
    box-sizing: border-box;
    background: #111c33;
    color: #f8fafc;
}

.rh-register-trap {
    position: absolute !important;
    left: -9999px !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

.rh-password-input-wrap {
    position: relative;
}

.rh-password-input-wrap input {
    padding-right: 44px;
}

.rh-password-toggle {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 30px;
    height: 30px;
    border: 0;
    border-radius: 999px;
    background: #23314d;
    color: #e5edf9;
    cursor: pointer;
    line-height: 1;
}

.rh-register-notice {
    margin-bottom: 12px;
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 14px;
}

.rh-register-notice p {
    margin: 0 0 4px;
}

.rh-register-notice p:last-child {
    margin-bottom: 0;
}

.rh-register-card a {
    color: #7dd3fc;
}

.rh-register-notice--success {
    background: #ecfdf3;
    border: 1px solid #86efac;
    color: #166534;
}

.rh-register-notice--error {
    background: #fef2f2;
    border: 1px solid #fca5a5;
    color: #991b1b;
}

.rh-upload-item {
    position: relative;
}

.rh-upload-item img {
    width: 100%;
    height: 80px;
    object-fit: cover;
    border-radius: 10px;
    border: 1px solid #d1d9e6;
}

.rh-upload-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    border: 0;
    width: 20px;
    height: 20px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.85);
    color: #fff;
    font-size: 11px;
    line-height: 1;
    cursor: pointer;
}

@media (max-width: 1200px) {
    .rh-community-grid {
        grid-template-columns: 250px 1fr;
    }

    .rh-right {
        grid-column: span 2;
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 860px) {
    .rh-community-grid {
        grid-template-columns: 1fr;
    }

    .rh-center {
        order: 1;
    }

    .rh-left {
        order: 2;
    }

    .rh-right {
        order: 3;
        grid-column: auto;
        grid-template-columns: 1fr;
    }

    .rh-feed {
        order: 1;
    }

    .rh-composer {
        order: 2;
    }

    .rh-stories {
        order: 3;
    }

    .rh-profile-head h3,
    .rh-stories h3,
    .rh-right h3 {
        font-size: 20px;
    }

    .rh-profile-page-head {
        grid-template-columns: 1fr;
        text-align: center;
        margin: -48px 14px 14px;
    }

    .rh-profile-page-stats {
        justify-content: center;
    }

    .rh-post-images {
        grid-template-columns: 1fr;
    }

    .rh-comments {
        margin-left: 20px;
        padding-left: 8px;
    }

    .rh-upload-preview {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}
