.community-page {
    max-width: 1040px;
    margin: 0 auto;
    padding: 0.5rem 0 2rem;
    color: var(--neon-foreground);
    display: grid;
    gap: 1.25rem;
}

.community-page__hero {
    display: grid;
    gap: 0.45rem;
    padding: 0 0 1rem;
    border-bottom: 1px solid var(--theme-border-faint);
}

.community-page__kicker {
    margin: 0;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--theme-ui-muted-text-75);
}

.community-page__title {
    margin: 0;
    font-size: clamp(1.55rem, 3vw, 2rem);
    line-height: 1.2;
    font-weight: 700;
    color: var(--neon-foreground);
}

.community-page__subtitle {
    margin: 0;
    max-width: 42rem;
    font-size: 0.9rem;
    line-height: 1.55;
    color: var(--theme-ui-muted-text-85);
}

.community-page__shell {
    padding: 1.1rem 1.15rem 1.25rem;
    border-radius: 1rem;
    border: 1px solid var(--neon-border-soft);
    background: var(--neon-surface-soft);
}

.community-page .community-feed {
    display: grid;
    gap: 1rem;
}

/* Reset global neon button styles inside community UI */
.community-page button:not(.community-reaction-btn):not(.community-reply-btn):not(.community-menu__trigger):not(.community-menu__item):not(.neon-btn),
.community-feed button:not(.community-reaction-btn):not(.community-reply-btn):not(.community-menu__trigger):not(.community-menu__item):not(.neon-btn),
.community-embed-section button:not(.community-reaction-btn):not(.community-reply-btn):not(.community-menu__trigger):not(.community-menu__item):not(.neon-btn),
.home-community-preview button:not(.community-reaction-btn):not(.community-reply-btn):not(.community-menu__trigger):not(.community-menu__item):not(.neon-btn),
.community-embed-mount button:not(.community-reaction-btn):not(.community-reply-btn):not(.community-menu__trigger):not(.community-menu__item):not(.neon-btn),
.community-thread-panel button:not(.community-reaction-btn):not(.community-reply-btn):not(.community-menu__trigger):not(.community-menu__item):not(.neon-btn) {
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 0;
    color: inherit;
    font-family: inherit;
    font-size: inherit;
    font-weight: inherit;
    line-height: inherit;
    cursor: pointer;
    box-shadow: none;
    transform: none;
    will-change: auto;
}

.community-page button:not(.community-reaction-btn):not(.community-reply-btn):not(.community-menu__trigger):not(.community-menu__item):not(.neon-btn):hover,
.community-page button:not(.community-reaction-btn):not(.community-reply-btn):not(.community-menu__trigger):not(.community-menu__item):not(.neon-btn):active,
.community-feed button:not(.community-reaction-btn):not(.community-reply-btn):not(.community-menu__trigger):not(.community-menu__item):not(.neon-btn):hover,
.community-feed button:not(.community-reaction-btn):not(.community-reply-btn):not(.community-menu__trigger):not(.community-menu__item):not(.neon-btn):active,
.community-embed-section button:not(.community-reaction-btn):not(.community-reply-btn):not(.community-menu__trigger):not(.community-menu__item):not(.neon-btn):hover,
.community-embed-section button:not(.community-reaction-btn):not(.community-reply-btn):not(.community-menu__trigger):not(.community-menu__item):not(.neon-btn):active,
.home-community-preview button:not(.community-reaction-btn):not(.community-reply-btn):not(.community-menu__trigger):not(.community-menu__item):not(.neon-btn):hover,
.home-community-preview button:not(.community-reaction-btn):not(.community-reply-btn):not(.community-menu__trigger):not(.community-menu__item):not(.neon-btn):active,
.community-embed-mount button:not(.community-reaction-btn):not(.community-reply-btn):not(.community-menu__trigger):not(.community-menu__item):not(.neon-btn):hover,
.community-embed-mount button:not(.community-reaction-btn):not(.community-reply-btn):not(.community-menu__trigger):not(.community-menu__item):not(.neon-btn):active,
.community-thread-panel button:not(.community-reaction-btn):not(.community-reply-btn):not(.community-menu__trigger):not(.community-menu__item):not(.neon-btn):hover,
.community-thread-panel button:not(.community-reaction-btn):not(.community-reply-btn):not(.community-menu__trigger):not(.community-menu__item):not(.neon-btn):active {
    transform: none;
    box-shadow: none;
}

.community-feed .neon-btn,
.community-embed-section .community-composer .neon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.55rem 1.1rem;
    border-radius: 0.65rem;
    border: 1px solid var(--neon-border-strong);
    background: var(--theme-control-bg);
    color: var(--neon-foreground);
    font-size: 0.92rem;
    font-weight: 500;
    line-height: 1.2;
    box-shadow: none;
    transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.community-feed .neon-btn--ghost {
    background: var(--theme-surface-overlay);
    border-color: var(--neon-border);
}

.community-feed .neon-btn--ghost:hover:not(:disabled) {
    background: var(--theme-surface-overlay);
    border-color: var(--neon-border-strong);
    color: var(--theme-primary-text);
}

.community-feed .neon-btn--load-more {
    min-width: 11rem;
    padding: 0.62rem 1.35rem;
    border-radius: 999px;
}

.community-feed__toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.community-feed__login {
    margin: 0;
    padding: 0.65rem 0.85rem;
    border-radius: 0.65rem;
    border: 1px dashed var(--neon-border-soft);
    background: var(--theme-surface-overlay);
    text-align: center;
    font-size: 0.88rem;
}

.community-feed__login a {
    color: var(--neon-primary);
    font-weight: 600;
    text-decoration: none;
}

.community-feed__empty,
.community-feed__loading {
    padding: 2rem 1rem;
    text-align: center;
    color: var(--theme-ui-muted-text-80);
    border-radius: 0.85rem;
    border: 1px dashed var(--neon-border-soft);
    background: var(--theme-surface-overlay);
}

.community-feed__tabs {
    display: inline-flex;
    align-self: flex-start;
    gap: 0.25rem;
    padding: 0.25rem;
    margin-bottom: 0.25rem;
    border-radius: 999px;
    border: 1px solid var(--neon-border-soft);
    background: var(--theme-surface-overlay);
}

.community-feed__tabs button {
    padding: 0.45rem 1rem;
    border-radius: 999px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--theme-ui-muted-text-85);
    font-size: 0.84rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.community-feed__tabs button.is-active {
    background: var(--neon-surface-soft);
    border-color: var(--neon-border-soft);
    color: var(--neon-foreground);
    font-weight: 600;
}

.community-feed__tabs button:hover:not(.is-active) {
    color: var(--neon-foreground);
    background: color-mix(in srgb, var(--neon-surface-soft) 60%, transparent);
}

.community-post-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    padding: 0.85rem 0.9rem;
    margin-bottom: 0;
    border-radius: 0.85rem;
    border: 1px solid var(--neon-border-soft);
    background: var(--neon-surface-soft);
    box-shadow: none;
    transition: border-color 0.2s ease;
    min-width: 0;
    width: 100%;
    color: var(--neon-foreground);
}

.community-feed__list .community-post-card {
    margin-bottom: 1rem;
}

.community-post-card:hover {
    border-color: var(--neon-border-strong);
}

.community-post-card--compact {
    min-height: 0;
    height: auto;
    padding: 0.75rem 0.8rem;
}

.community-post-card--compact:hover {
    transform: none;
}

.community-post-card.community-post-card--tile {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    align-self: stretch;
    height: 11rem;
    min-height: 11rem;
    max-height: 11rem;
    padding: 0.75rem 0.8rem;
    border-radius: 0.85rem;
    border: 1px solid var(--neon-border-soft);
    background: var(--neon-surface-soft);
    margin: 0;
    overflow: hidden;
    isolation: isolate;
    contain: layout paint;
    box-sizing: border-box;
    transition: border-color 0.2s ease;
    cursor: pointer;
}

.community-post-card.community-post-card--tile.is-menu-open {
    overflow: visible;
    z-index: 30;
    contain: layout style;
}

.community-post-card.community-post-card--tile:hover {
    border-color: var(--neon-border-strong);
    transform: none;
}

.community-post-card.community-post-card--tile .community-post-card__head {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex: 0 0 auto;
    min-width: 0;
}

.community-post-card.community-post-card--tile .community-post-card__identity {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    min-width: 0;
    flex: 1 1 auto;
}

.community-post-card.community-post-card--tile .community-post-card__avatar {
    width: 1.65rem;
    height: 1.65rem;
    font-size: 0.6rem;
    flex-shrink: 0;
}

.community-post-card.community-post-card--tile .community-post-card__meta {
    min-width: 0;
    flex: 1 1 auto;
}

.community-post-card.community-post-card--tile .community-post-card__meta-top {
    min-width: 0;
}

.community-post-card.community-post-card--tile .community-post-card__name {
    display: block;
    font-size: 0.78rem;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.community-post-card.community-post-card--tile .community-post-card__time {
    display: block;
    font-size: 0.64rem;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.community-post-card.community-post-card--tile .community-post-card__menu-compact {
    flex: 0 0 auto;
    margin-inline-start: 0.15rem;
}

.community-post-card.community-post-card--tile .community-post-card__body {
    flex: 1 1 auto;
    min-height: 0;
    margin: 0;
    font-size: 0.8rem;
    line-height: 1.4;
    color: var(--theme-ui-muted-text-85);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    white-space: normal;
}

.community-post-card.community-post-card--tile .community-post-card__foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex: 0 0 auto;
    gap: 0.25rem;
    margin: 0;
    margin-top: auto;
    padding: 0.35rem 0 0;
    border-top: 1px solid var(--theme-border-faint);
    min-height: 1.65rem;
    position: relative;
    z-index: 3;
}

.community-post-card.community-post-card--tile .community-reactions,
.community-post-card.community-post-card--tile .community-reaction-btn {
    position: relative;
    z-index: 4;
}

.community-post-card.community-post-card--tile .community-post-card__actions-left {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    min-width: 0;
    flex: 1;
    overflow: hidden;
}

.community-post-card.community-post-card--tile .community-reactions--compact {
    flex: 1 1 auto;
    overflow: hidden;
}

.community-post-card.community-post-card--tile .community-post-card__reply-stat {
    flex: 0 0 auto;
    margin-inline-start: 0.1rem;
}

.community-post-card.community-post-card--detail {
    gap: 0.55rem;
    padding: 0.85rem 0.9rem;
    overflow: visible;
}

.community-post-card.community-post-card--detail .community-post-card__head {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex: 0 0 auto;
    min-width: 0;
}

.community-post-card.community-post-card--detail .community-post-card__identity {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    min-width: 0;
    flex: 1 1 auto;
}

.community-post-card.community-post-card--detail .community-post-card__avatar {
    width: 1.85rem;
    height: 1.85rem;
    font-size: 0.65rem;
    flex-shrink: 0;
}

.community-post-card.community-post-card--detail .community-post-card__body {
    margin: 0;
    font-size: 0.88rem;
    line-height: 1.5;
    color: var(--theme-ui-muted-text-85);
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.community-post-card.community-post-card--detail .community-post-card__foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex: 0 0 auto;
    gap: 0.5rem;
    margin: 0;
    margin-top: 0.15rem;
    padding: 0.35rem 0 0;
    border-top: 1px solid var(--theme-border-faint);
    min-height: 1.35rem;
}

.community-post-card.community-post-card--detail .community-post-card__stat {
    font-size: 0.75rem;
    color: var(--theme-ui-muted-text-75);
}

.community-feed__list-grid,
.community-feed__embed-grid {
    width: 100%;
}

.community-post-card.is-pending {
    opacity: 0.88;
    border-style: dashed;
    border-color: color-mix(in srgb, var(--theme-status-warning-fg) 45%, transparent);
}

.community-post-card__head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.65rem;
}

.community-post-card__identity {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    min-width: 0;
    flex: 1;
}

.community-post-card__avatar {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: var(--theme-avatar-text);
    background: linear-gradient(135deg, var(--neon-accent) 0%, var(--neon-primary) 100%);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--neon-accent) 15%, transparent);
}

.community-post-card__meta {
    min-width: 0;
    display: grid;
    gap: 0.15rem;
}

.community-post-card__meta-top {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.community-post-card__name {
    font-weight: 600;
    font-size: 0.9rem;
    line-height: 1.2;
    color: var(--neon-foreground);
}

.community-post-card__time {
    font-size: 0.75rem;
    color: var(--theme-ui-muted-text-75);
}

.community-post-card__context {
    flex-shrink: 0;
    font-size: 0.75rem;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    border: 1px solid var(--neon-border);
    background: var(--theme-surface-overlay);
    text-decoration: none;
    color: var(--theme-ui-muted-text-85);
    white-space: nowrap;
}

.community-post-card__body-link {
    display: none;
}

.community-post-card__body {
    white-space: pre-wrap;
    line-height: 1.55;
    font-size: 0.92rem;
    color: var(--theme-ui-muted-text-90);
}

.community-post-card--compact .community-post-card__body {
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
    white-space: normal;
}

.community-post-card__foot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: auto;
    padding-top: 0.35rem;
    border-top: 1px solid var(--theme-border-faint);
}

.community-post-card__actions-left {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.4rem;
    min-width: 0;
    flex: 1;
}

.community-post-card__stat {
    font-size: 0.78rem;
    color: var(--theme-ui-muted-text-75);
}

.community-post-card__menu-compact {
    flex-shrink: 0;
}

.community-post-card__rejection {
    font-size: 0.82rem;
    color: var(--theme-status-danger-fg);
    margin: 0;
}

.community-badge {
    display: inline-block;
    font-size: 0.7rem;
    padding: 0.1rem 0.45rem;
    border-radius: 4px;
    margin-inline-start: 0.35rem;
}

.community-badge--pending {
    background: var(--theme-status-warning-bg);
    color: var(--theme-status-warning-fg);
}

.community-badge--rejected {
    background: var(--theme-status-danger-bg);
    color: var(--theme-status-danger-fg);
}

.community-composer {
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    padding: 1rem;
    margin-bottom: 0.75rem;
    border-radius: 0.85rem;
    border: 1px solid var(--neon-border-soft);
    background: var(--theme-surface-overlay);
    box-shadow: none;
    overflow: hidden;
}

.community-composer__warning {
    font-size: 0.85rem;
    color: var(--theme-status-warning-fg);
    margin: 0 0 0.65rem;
    line-height: 1.45;
}

.community-composer__textarea {
    box-sizing: border-box;
    display: block;
    width: 100%;
    max-width: 100%;
    resize: vertical;
    min-height: 88px;
    padding: 0.7rem 0.75rem;
    border-radius: 0.65rem;
    border: 1px solid var(--neon-border);
    background: var(--input-bg);
    color: var(--neon-foreground);
    font: inherit;
    line-height: 1.5;
}

.community-composer__textarea:focus {
    outline: none;
    border-color: var(--neon-border-strong);
}

.community-composer__footer {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 0.65rem 1rem;
    margin-top: 0.65rem;
}

.community-composer__media {
    display: grid;
    gap: 0.35rem;
    min-width: 0;
    flex: 1 1 12rem;
}

.community-composer__upload-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    width: fit-content;
    max-width: 100%;
    padding: 0.45rem 0.8rem;
    border-radius: 0.6rem;
    border: 1px dashed var(--neon-border);
    background: color-mix(in srgb, var(--theme-surface) 88%, transparent);
    color: var(--theme-ui-muted-text-85);
    font-size: 0.82rem;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.community-composer__upload-btn:hover {
    border-color: var(--neon-border-strong);
    background: var(--theme-surface);
    color: var(--theme-primary-text);
}

.community-composer__upload-icon {
    width: 1rem;
    height: 1rem;
    flex-shrink: 0;
    opacity: 0.85;
}

.community-composer__upload-label {
    white-space: nowrap;
}

.community-composer__upload-hint {
    margin: 0;
    font-size: 0.72rem;
    line-height: 1.45;
    color: var(--theme-ui-muted-text-75);
    word-break: break-word;
}

.community-composer__counter {
    flex-shrink: 0;
    font-size: 0.78rem;
    color: var(--theme-ui-muted-text-75);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.community-composer__meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--theme-ui-muted-text-75);
    margin: 0.4rem 0;
}

.community-composer__upload {
    cursor: pointer;
    text-decoration: underline;
    color: var(--neon-primary);
}

.community-composer__previews {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.65rem;
}

.community-composer__preview {
    position: relative;
}

.community-composer__preview img {
    width: 72px;
    height: 72px;
    object-fit: cover;
    border-radius: 6px;
}

.community-feed .neon-btn--primary {
    border-color: var(--neon-border-strong);
    background: var(--theme-control-bg);
}

.community-feed .neon-btn--primary:hover:not(:disabled) {
    background: var(--theme-surface-overlay);
    border-color: var(--neon-border-strong);
    color: var(--theme-primary-text);
}

.community-composer__preview button {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: none;
    background: var(--theme-status-danger-fg);
    color: var(--theme-on-primary);
    cursor: pointer;
    padding: 0;
    font-size: 0.75rem;
    line-height: 1;
}

.community-composer__actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.community-media-gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.community-media-gallery__item {
    padding: 0;
    border: none;
    background: none;
    cursor: pointer;
}

.community-media-gallery__item img {
    max-height: 200px;
    border-radius: 8px;
}

.community-media-gallery--compact .community-media-gallery__item img {
    max-height: 88px;
    width: 100%;
    object-fit: cover;
}

.community-menu {
    position: relative;
    z-index: 2;
}

.community-menu__trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    background: transparent;
    border: 1px solid transparent;
    color: var(--theme-ui-muted-text-80);
    cursor: pointer;
    font-size: 1.1rem;
    line-height: 1;
    padding: 0;
    border-radius: 999px;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.community-menu__trigger-icon {
    width: 1rem;
    height: 1rem;
    display: block;
}

.community-menu__trigger--gear .community-menu__trigger-icon {
    width: 0.95rem;
    height: 0.95rem;
}

.community-menu__trigger:hover,
.community-menu__trigger:active,
.community-menu__trigger[aria-expanded="true"] {
    background: var(--theme-surface-overlay);
    border-color: var(--neon-border-soft);
    color: var(--neon-foreground);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.community-menu__panel {
    position: absolute;
    top: calc(100% + 0.35rem);
    bottom: auto;
    inset-inline-end: 0;
    min-width: 11.5rem;
    padding: 0.35rem;
    background: var(--neon-surface-soft);
    border: 1px solid var(--neon-border-strong);
    border-radius: 0.75rem;
    z-index: 40;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.24);
    color: var(--neon-foreground);
    transform-origin: top;
}

.community-menu-drop-enter-active,
.community-menu-drop-leave-active {
    transition: opacity 0.16s ease, transform 0.16s ease;
}

.community-menu-drop-enter-from,
.community-menu-drop-leave-to {
    opacity: 0;
    transform: translateY(-4px) scale(0.98);
}

.community-menu__item {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    width: 100%;
    text-align: start;
    padding: 0.5rem 0.6rem;
    border: none;
    border-radius: 0.5rem;
    background: transparent;
    color: var(--neon-foreground);
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 500;
    line-height: 1.3;
    transition: background 0.15s ease, color 0.15s ease;
}

.community-menu__item-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.1rem;
    height: 1.1rem;
    flex-shrink: 0;
    color: var(--theme-ui-muted-text-75);
}

.community-menu__item-icon svg {
    width: 100%;
    height: 100%;
    display: block;
}

.community-menu__item-label {
    flex: 1 1 auto;
    min-width: 0;
}

.community-menu__item:hover,
.community-menu__item:active {
    background: var(--theme-surface-overlay);
    color: var(--neon-foreground);
}

.community-menu__item:hover .community-menu__item-icon,
.community-menu__item:active .community-menu__item-icon {
    color: var(--neon-foreground);
}

.community-menu__item--report .community-menu__item-icon {
    color: var(--theme-status-warning-fg, #d97706);
}

.community-menu__item--danger {
    color: var(--theme-status-danger-fg);
}

.community-menu__item--danger .community-menu__item-icon {
    color: var(--theme-status-danger-fg);
}

.community-menu__item--danger:hover,
.community-menu__item--danger:active {
    background: var(--theme-status-danger-bg);
    color: var(--theme-status-danger-fg);
}

.community-post-card--tile .community-menu__panel,
.community-post-card.is-menu-open .community-menu__panel {
    z-index: 50;
}

.community-action-menus {
    display: flex;
    gap: 0.25rem;
}

.community-reactions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
}

.community-reactions--compact {
    flex-wrap: nowrap;
    gap: 0.15rem;
    min-width: 0;
}

.reaction-icon {
    width: 1.05rem;
    height: 1.05rem;
    display: block;
    flex-shrink: 0;
}

.community-reactions--compact .reaction-icon {
    width: 0.88rem;
    height: 0.88rem;
}

.community-reaction-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.2rem;
    padding: 0.22rem 0.42rem;
    border-radius: 999px;
    border: 1px solid var(--neon-border-soft);
    background: transparent;
    color: var(--theme-ui-muted-text-80);
    cursor: pointer;
    line-height: 1;
    transition:
        border-color 0.18s ease,
        background 0.18s ease,
        color 0.18s ease,
        transform 0.18s ease,
        box-shadow 0.18s ease;
}

.community-reaction-btn.is-locked {
    cursor: default;
    opacity: 0.72;
    pointer-events: none;
}

.community-reactions--compact .community-reaction-btn {
    padding: 0.12rem 0.22rem;
    gap: 0.12rem;
}

.community-reaction-btn__count {
    font-size: 0.72rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    min-width: 0.65rem;
    text-align: center;
}

.community-reactions--compact .community-reaction-btn__count {
    font-size: 0.62rem;
    min-width: 0.55rem;
}

.community-reaction-btn:hover,
.community-reaction-btn:active {
    transform: translateY(-1px) scale(1.05);
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.12);
}

.community-reactions--compact .community-reaction-btn:hover,
.community-reactions--compact .community-reaction-btn:active {
    transform: translateY(-1px) scale(1.08);
}

.community-reaction-btn--like:hover,
.community-reaction-btn--like:active {
    background: color-mix(in srgb, #f43f5e 14%, var(--theme-surface-overlay));
    border-color: color-mix(in srgb, #f43f5e 42%, var(--neon-border-soft));
    color: #f43f5e;
}

.community-reaction-btn--bullish:hover,
.community-reaction-btn--bullish:active {
    background: color-mix(in srgb, var(--theme-status-success-fg, #22c55e) 14%, var(--theme-surface-overlay));
    border-color: color-mix(in srgb, var(--theme-status-success-fg, #22c55e) 42%, var(--neon-border-soft));
    color: var(--theme-status-success-fg, #22c55e);
}

.community-reaction-btn--bearish:hover,
.community-reaction-btn--bearish:active {
    background: color-mix(in srgb, var(--theme-status-danger-fg, #ef4444) 14%, var(--theme-surface-overlay));
    border-color: color-mix(in srgb, var(--theme-status-danger-fg, #ef4444) 42%, var(--neon-border-soft));
    color: var(--theme-status-danger-fg, #ef4444);
}

.community-reaction-btn--insightful:hover,
.community-reaction-btn--insightful:active {
    background: color-mix(in srgb, #f59e0b 14%, var(--theme-surface-overlay));
    border-color: color-mix(in srgb, #f59e0b 42%, var(--neon-border-soft));
    color: #f59e0b;
}

.community-reaction-btn:hover .community-reaction-btn__icon,
.community-reaction-btn:active .community-reaction-btn__icon {
    transform: scale(1.08);
}

.community-reaction-btn__icon {
    transition: transform 0.18s ease, color 0.18s ease, filter 0.18s ease;
}

.community-reaction-btn--like:hover .community-reaction-btn__icon,
.community-reaction-btn--like:active .community-reaction-btn__icon {
    color: #f43f5e;
    filter: drop-shadow(0 0 4px color-mix(in srgb, #f43f5e 45%, transparent));
}

.community-reaction-btn--bullish:hover .community-reaction-btn__icon,
.community-reaction-btn--bullish:active .community-reaction-btn__icon {
    color: var(--theme-status-success-fg, #22c55e);
    filter: drop-shadow(0 0 4px color-mix(in srgb, var(--theme-status-success-fg, #22c55e) 45%, transparent));
}

.community-reaction-btn--bearish:hover .community-reaction-btn__icon,
.community-reaction-btn--bearish:active .community-reaction-btn__icon {
    color: var(--theme-status-danger-fg, #ef4444);
    filter: drop-shadow(0 0 4px color-mix(in srgb, var(--theme-status-danger-fg, #ef4444) 45%, transparent));
}

.community-reaction-btn--insightful:hover .community-reaction-btn__icon,
.community-reaction-btn--insightful:active .community-reaction-btn__icon {
    color: #f59e0b;
    filter: drop-shadow(0 0 4px color-mix(in srgb, #f59e0b 45%, transparent));
}

.community-reaction-btn.is-locked,
.community-reaction-btn.is-locked:hover,
.community-reaction-btn.is-locked:active {
    background: transparent;
    border-color: var(--neon-border-soft);
    transform: none;
    box-shadow: none;
    filter: none;
    cursor: default;
    opacity: 0.72;
    pointer-events: none;
}

.community-reaction-btn.is-locked .community-reaction-btn__icon {
    transform: none;
    filter: none;
}

.community-post-card .community-menu__trigger:hover,
.community-post-card .community-menu__trigger:active,
.community-post-card .community-menu__trigger[aria-expanded="true"] {
    background: var(--theme-surface-overlay);
    transform: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.community-post-card .community-reply-btn:hover,
.community-post-card .community-reply-btn:active {
    background: var(--theme-surface-overlay);
    transform: none;
    box-shadow: none;
}

.community-reaction-btn--like .community-reaction-btn__icon {
    color: #f43f5e;
}

.community-reaction-btn--bullish .community-reaction-btn__icon {
    color: var(--theme-status-success-fg, #22c55e);
}

.community-reaction-btn--bearish .community-reaction-btn__icon {
    color: var(--theme-status-danger-fg, #ef4444);
}

.community-reaction-btn--insightful .community-reaction-btn__icon {
    color: #f59e0b;
}

.community-reaction-btn.is-active {
    border-color: var(--neon-border-strong);
    background: var(--theme-surface-overlay);
    font-weight: 600;
}

.community-reaction-btn--like.is-active {
    color: #f43f5e;
    border-color: color-mix(in srgb, #f43f5e 35%, var(--neon-border-soft));
}

.community-reaction-btn--bullish.is-active {
    color: var(--theme-status-success-fg, #22c55e);
    border-color: color-mix(in srgb, var(--theme-status-success-fg, #22c55e) 35%, var(--neon-border-soft));
}

.community-reaction-btn--bearish.is-active {
    color: var(--theme-status-danger-fg, #ef4444);
    border-color: color-mix(in srgb, var(--theme-status-danger-fg, #ef4444) 35%, var(--neon-border-soft));
}

.community-reaction-btn--insightful.is-active {
    color: #f59e0b;
    border-color: color-mix(in srgb, #f59e0b 35%, var(--neon-border-soft));
}

.community-reaction-btn--like.is-pulsing .community-reaction-btn__icon {
    animation: community-reaction-heartbeat 0.58s ease;
}

.community-reaction-btn--bullish.is-pulsing .community-reaction-btn__icon {
    animation: community-reaction-bull-rise 0.52s ease;
}

.community-reaction-btn--bearish.is-pulsing .community-reaction-btn__icon {
    animation: community-reaction-bear-drop 0.52s ease;
}

.community-reaction-btn--insightful.is-pulsing .community-reaction-btn__icon {
    animation: community-reaction-bulb-glow 0.58s ease;
}

@keyframes community-reaction-heartbeat {
    0%, 100% { transform: scale(1); }
    20% { transform: scale(1.32); }
    40% { transform: scale(1.08); }
    60% { transform: scale(1.22); }
    80% { transform: scale(1.02); }
}

@keyframes community-reaction-bull-rise {
    0%, 100% { transform: translateY(0) scale(1); }
    35% { transform: translateY(-3px) scale(1.15); }
    70% { transform: translateY(-1px) scale(1.05); }
}

@keyframes community-reaction-bear-drop {
    0%, 100% { transform: translateY(0) scale(1); }
    35% { transform: translateY(3px) scale(1.12); }
    70% { transform: translateY(1px) scale(1.04); }
}

@keyframes community-reaction-bulb-glow {
    0%, 100% { transform: scale(1); filter: drop-shadow(0 0 0 transparent); }
    45% { transform: scale(1.18); filter: drop-shadow(0 0 6px rgba(245, 158, 11, 0.55)); }
}

.community-post-card__reply-stat {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    flex-shrink: 0;
    padding: 0.12rem 0.3rem;
    border-radius: 999px;
    color: var(--theme-ui-muted-text-75);
    font-size: 0.68rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    line-height: 1;
}

.community-post-card__reply-stat--clickable {
    cursor: pointer;
    border: 1px solid transparent;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.community-post-card__reply-stat--clickable:hover,
.community-post-card__reply-stat--clickable:active {
    background: var(--theme-surface-overlay);
    border-color: var(--neon-border-soft);
    color: var(--neon-foreground);
}

.community-post-card__reply-icon {
    width: 0.85rem;
    height: 0.85rem;
    display: block;
    flex-shrink: 0;
}

.community-reaction-btn {
    font-size: 0.8rem;
}

.community-reaction-btn--like.is-active .reaction-icon--like path {
    fill: color-mix(in srgb, currentColor 22%, transparent);
}

.community-reply-btn,
.community-reply-link {
    font-size: 0.85rem;
    color: var(--theme-ui-muted-text-85);
    text-decoration: none;
    padding: 0.15rem 0.35rem;
    border: none;
    background: none;
    cursor: pointer;
    font-family: inherit;
    border-radius: 0.35rem;
    transition: color 0.2s ease, background 0.2s ease;
}

.community-reply-btn:hover,
.community-reply-btn:active {
    color: var(--theme-primary-text);
    background: var(--theme-surface-overlay);
}

.community-toast {
    position: fixed;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.65rem 1.2rem;
    background: var(--theme-toast-bg);
    border: 1px solid var(--neon-accent);
    border-radius: 8px;
    z-index: 100;
    font-size: 0.9rem;
    color: var(--neon-foreground);
    box-shadow: var(--theme-card-shadow);
}

.community-modal-backdrop {
    position: fixed;
    inset: 0;
    background: var(--theme-panel-backdrop);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1300;
    padding: 1rem;
}

.community-modal-fade-enter-active,
.community-modal-fade-leave-active {
    transition: opacity 0.2s ease;
}

.community-modal-fade-enter-active .community-modal,
.community-modal-fade-leave-active .community-modal {
    transition: transform 0.22s ease, opacity 0.22s ease;
}

.community-modal-fade-enter-from,
.community-modal-fade-leave-to {
    opacity: 0;
}

.community-modal-fade-enter-from .community-modal,
.community-modal-fade-leave-to .community-modal {
    transform: translateY(8px) scale(0.97);
    opacity: 0;
}

.community-modal {
    width: min(420px, 100%);
    padding: 1.25rem 1.35rem 1.35rem;
    border-radius: 1rem;
    background: var(--neon-surface-soft);
    border: 1px solid var(--neon-border-strong);
    color: var(--neon-foreground);
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.28);
}

.community-modal__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.community-modal__header-main {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    min-width: 0;
}

.community-modal__header-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 0.55rem;
    background: var(--theme-status-warning-bg, rgba(217, 119, 6, 0.12));
    color: var(--theme-status-warning-fg, #d97706);
    flex-shrink: 0;
}

.community-modal__header-icon svg {
    width: 1.1rem;
    height: 1.1rem;
    display: block;
}

.community-modal__title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 600;
    line-height: 1.3;
    color: var(--neon-foreground);
}

.community-modal__close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    padding: 0;
    border: none;
    border-radius: 999px;
    background: transparent;
    color: var(--theme-ui-muted-text-75);
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
    flex-shrink: 0;
}

.community-modal__close svg {
    width: 1rem;
    height: 1rem;
    display: block;
}

.community-modal__close:hover,
.community-modal__close:active {
    background: var(--theme-surface-overlay);
    color: var(--neon-foreground);
}

.community-modal__intro {
    margin: 0 0 1rem;
    font-size: 0.86rem;
    line-height: 1.45;
    color: var(--theme-ui-muted-text-80);
}

.community-modal__label {
    display: block;
    font-size: 0.82rem;
    font-weight: 500;
    margin-bottom: 0.35rem;
    color: var(--theme-ui-muted-text-85);
}

.community-modal__select,
.community-modal__textarea {
    width: 100%;
    margin-bottom: 0.85rem;
    padding: 0.55rem 0.65rem;
    border-radius: 0.55rem;
    border: 1px solid var(--neon-border);
    background: var(--input-bg);
    color: var(--neon-foreground);
    font: inherit;
    line-height: 1.4;
}

.community-modal__textarea {
    resize: vertical;
    min-height: 5.5rem;
}

.community-modal__select:focus,
.community-modal__textarea:focus {
    outline: none;
    border-color: var(--neon-border-strong);
    box-shadow: 0 0 0 2px var(--theme-focus-ring, rgba(59, 130, 246, 0.25));
}

.community-modal__actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 0.25rem;
}

.community-feed__empty,
.community-feed__login {
    text-align: center;
    color: var(--theme-ui-muted-text-80);
    padding: 2rem 1rem;
}

.community-feed__more {
    display: block;
    margin: 1rem auto;
}

.community-thread-panel {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 0;
}

.community-thread-panel__backdrop {
    position: absolute;
    inset: 0;
    border: none;
    background: var(--theme-panel-backdrop);
    backdrop-filter: blur(6px);
    cursor: pointer;
}

.community-thread-panel__sheet {
    position: relative;
    z-index: 1;
    width: min(30rem, calc(100vw - 1.5rem));
    max-height: min(88vh, 44rem);
    min-height: 0;
    display: flex;
    flex-direction: column;
    border-radius: 1rem 1rem 0 0;
    border: 1px solid var(--theme-border-subtle);
    border-bottom: none;
    background: var(--theme-thread-panel-bg);
    box-shadow: var(--theme-card-shadow);
    color: var(--neon-foreground);
    animation: community-panel-rise 0.28s ease;
    overflow: hidden;
}

@keyframes community-panel-rise {
    from {
        opacity: 0;
        transform: translateY(1.25rem);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.community-thread-panel__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 1rem 1.25rem 0.85rem;
    border-bottom: 1px solid var(--theme-border-faint);
}

.community-thread-panel__title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--neon-foreground);
}

.community-thread-panel__close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    border: 1px solid var(--theme-border-subtle);
    background: var(--theme-surface-overlay);
    color: var(--neon-foreground);
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.community-thread-panel__close:hover {
    border-color: var(--neon-border-strong);
    background: var(--theme-surface-overlay);
}

.community-thread-panel__body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 0.85rem 1rem 1.1rem;
    -webkit-overflow-scrolling: touch;
}

.community-thread-content {
    width: 100%;
    min-width: 0;
    max-width: 100%;
}

.community-thread-content > .community-post-card:not(.community-post-card--nested) {
    overflow: visible;
    padding: 0.85rem 0.9rem;
}

.community-thread-content .community-post-card {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.community-thread-content .community-post-card__body {
    overflow-wrap: anywhere;
    word-break: break-word;
}

.community-thread__replies {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin: 0.75rem 0 0;
    padding: 0;
}

.community-thread__branch {
    position: relative;
}

.community-thread__branch--root {
    margin-inline-start: 0.25rem;
    padding-inline-start: 0.85rem;
    border-inline-start: 2px solid var(--neon-accent);
}

.community-thread__branch--root + .community-thread__branch--root {
    margin-top: 0.65rem;
}

.community-thread__children {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-top: 0.65rem;
    margin-inline-start: 0.45rem;
    padding-inline-start: 0.85rem;
    border-inline-start: 2px solid color-mix(in srgb, var(--neon-accent) 70%, transparent);
}

.community-thread__branch .community-post-card--nested {
    position: relative;
    padding: 0.7rem 0.8rem;
    background: var(--neon-surface-soft);
    border-color: color-mix(in srgb, var(--neon-accent) 22%, var(--neon-border-soft));
    overflow: visible;
}

.community-thread__branch .community-post-card--nested::before {
    content: "";
    position: absolute;
    inset-inline-start: -0.85rem;
    top: 1.05rem;
    width: 0.65rem;
    height: 2px;
    background: var(--neon-accent);
}

.community-thread__branch .community-post-card--nested + .community-thread__children,
.community-thread__branch .community-thread__children .community-thread__branch {
    margin-top: 0.65rem;
}

.community-thread-content .community-composer {
    margin-top: 0.85rem;
    padding: 0;
}

@media (min-width: 768px) {
    .community-thread-panel {
        align-items: center;
        padding: 1rem;
    }

    .community-thread-panel__sheet {
        width: min(30rem, calc(100vw - 2rem));
        border-radius: 1rem;
        border-bottom: 1px solid var(--theme-border-subtle);
        max-height: min(85vh, 44rem);
    }
}

.community-thread__back {
    margin-bottom: 1rem;
}

.community-thread__pending {
    font-size: 0.85rem;
    color: var(--theme-status-warning-fg);
    margin-bottom: 0.75rem;
}

.community-embed-section {
    margin-top: 0;
    color: var(--neon-foreground);
}

.community-feed--embed {
    margin: 0;
}

.community-feed--embed .community-feed__empty {
    padding: 1.25rem 1rem;
    font-size: 0.9rem;
}

.community-embed-section__head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}
