.gce-community-container {
    --gce-scroll-bg: #f7f8fa;
    --gce-composer-bg: #f0f0f0;
    --gce-input-bg: #ffffff;
    --gce-text: #111111;
    --gce-muted-text: #888888;
    --gce-own-bg: #d6f5dc;
    --gce-own-border: #b9e8c4;
    --gce-own-name: #16803c;
    --gce-other-bg: #ffffff;
    --gce-other-border: #e5e7eb;
    --gce-other-name: #1d4ed8;
    --gce-admin-bg: #fff3b0;
    --gce-admin-border: #f0dd7a;
    --gce-admin-name: #7a5c00;
    --gce-divider-bg: #e3ecfa;
    --gce-divider-text: #2451b0;
    --gce-pinned-bg: #fff8e1;
    --gce-pinned-border: #f0e0a8;
    --gce-pinned-text: #7a5c00;
    --gce-card-bg: #ffffff;
    --gce-border-soft: rgba(0,0,0,0.12);
    --gce-quote-bg: rgba(0,0,0,0.04);
    --gce-toast-bg: #1a1a2e;
    --gce-toast-text: #ffffff;
    --gce-toast-success: #10b981;
    --gce-toast-error: #ef4444;
    --gce-toast-info: #3b82f6;

    max-width: 640px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--gce-text);
    background: var(--gce-scroll-bg);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 2px 14px rgba(0,0,0,0.08);
    display: flex;
    flex-direction: column;
    height: 640px;
    box-sizing: border-box;
}

/* Dark theme */
.gce-community-container[data-theme="dark"] {
    --gce-scroll-bg: #14181f;
    --gce-composer-bg: #1b1f27;
    --gce-input-bg: #242a35;
    --gce-text: #e8e8e8;
    --gce-muted-text: #9aa0a8;
    --gce-own-bg: #1f3a2a;
    --gce-own-border: #2d5540;
    --gce-own-name: #6fd393;
    --gce-other-bg: #242a35;
    --gce-other-border: #333a47;
    --gce-other-name: #7ea6ff;
    --gce-admin-bg: #4a3d10;
    --gce-admin-border: #6b5a18;
    --gce-admin-name: #f0d675;
    --gce-divider-bg: #1e2b45;
    --gce-divider-text: #8fb4ea;
    --gce-pinned-bg: #332c10;
    --gce-pinned-border: #52461a;
    --gce-pinned-text: #f0d675;
    --gce-card-bg: #242a35;
    --gce-border-soft: rgba(255,255,255,0.14);
    --gce-quote-bg: rgba(255,255,255,0.06);
    --gce-toast-bg: #2a2f3a;
    --gce-toast-text: #e8e8e8;
}

* { box-sizing: border-box; }

.gce-community-locked {
    text-align: center;
    padding: 48px 16px;
    color: #444;
}

/* ── Header ────────────────────────────────────── */

.gce-community-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #1d4ed8;
    color: #ffffff;
    padding: 12px 16px;
    flex-shrink: 0;
}

.gce-community-header-identity {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.gce-community-header-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(255,255,255,0.18);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.gce-community-title {
    font-size: 16px;
    font-weight: 700;
    margin: 0;
    color: #ffffff;
    line-height: 1.3;
}

.gce-community-header-sub {
    font-size: 12px;
    color: rgba(255,255,255,0.8);
    display: block;
}

.gce-community-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

/* ── Theme toggle ────────────────────────────────── */

.gce-community-theme-toggle {
    position: relative;
    border: 1px solid rgba(255,255,255,0.35);
    background: rgba(0,0,0,0.2);
    width: 52px;
    height: 26px;
    border-radius: 999px;
    cursor: pointer;
    flex-shrink: 0;
    padding: 0 5px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.gce-community-theme-toggle-icon {
    font-size: 12px;
    line-height: 1;
    color: rgba(255,255,255,0.85);
    position: relative;
    z-index: 1;
}

.gce-community-theme-toggle-thumb {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
    transition: transform 0.18s ease;
}

.gce-community-theme-toggle[aria-pressed="true"] .gce-community-theme-toggle-thumb {
    transform: translateX(26px);
}

/* ── Level toggle ────────────────────────────────── */

.gce-community-level-toggle {
    display: flex;
    gap: 4px;
    background: rgba(255,255,255,0.15);
    border-radius: 8px;
    padding: 3px;
    flex-shrink: 0;
}

.gce-community-level-btn {
    border: none;
    background: transparent;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    color: rgba(255,255,255,0.9);
    white-space: nowrap;
}

.gce-community-level-btn[aria-selected="true"] {
    background: #ffffff;
    color: #1d4ed8;
}

/* ── Mode Toggle: Community | Private ───────────── */

.gce-community-mode-toggle {
    display: flex;
    gap: 0;
    background: var(--gce-composer-bg);
    border-bottom: 1px solid var(--gce-border-soft);
    padding: 4px;
    flex-shrink: 0;
    justify-content: center;
}

.gce-community-mode-btn {
    border: none;
    background: transparent;
    padding: 8px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    color: var(--gce-muted-text);
    transition: background 0.15s ease, color 0.15s ease;
    position: relative;
}

.gce-community-mode-btn[aria-selected="true"] {
    background: var(--gce-card-bg);
    color: var(--gce-text);
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.gce-community-mode-btn:hover {
    color: var(--gce-text);
}

.gce-community-private-badge {
    display: inline-block;
    background: #d63638;
    color: #fff;
    border-radius: 50%;
    font-size: 10px;
    font-weight: 700;
    padding: 1px 6px;
    margin-left: 4px;
    min-width: 18px;
    text-align: center;
    line-height: 16px;
}

.gce-community-private-badge[hidden] {
    display: none;
}

/* ── Mode content containers ─────────────────────── */

.gce-community-mode-content {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

.gce-community-mode-content[hidden] {
    display: none;
}

/* =========================================================
   PRIVATE MODE - CRITICAL HEIGHT CONSTRAINT FIXES
   ========================================================= */

/* The private mode container must constrain its children */
#gce_community_mode_private {
    display: none;
    flex: 1;
    flex-direction: column;
    min-height: 0;
    max-height: 100%;
    overflow: hidden;
    position: relative;
}

#gce_community_mode_private[style*="display:flex"] {
    display: flex !important;
}

/* Private inbox - scrollable container */
#gce_private_inbox {
    flex: 1;
    overflow-y: auto;
    padding: 14px;
    min-height: 0;
}

/* =========================================================
   PRIVATE CONVERSATION - CRITICAL HEIGHT CONSTRAINT
   ========================================================= */

/* The conversation container MUST constrain its children 
   so the composer stays visible at the bottom */
#gce_private_conversation {
    display: none;
    flex: 1;
    flex-direction: column;
    min-height: 0;
    max-height: 100%;
    overflow: hidden;
    position: relative;
}

#gce_private_conversation[style*="display:flex"] {
    display: flex !important;
}

/* =========================================================
   PRIVATE MESSAGES - SCROLLABLE AREA
   ========================================================= */

/* Keep the private conversation itself as a fixed-height flex column.
 * Only the message viewport scrolls; the composer remains visible. */
#gce_private_conversation {
    flex: 1 1 auto;
    min-height: 0;
    min-width: 0;
    height: 100%;
    max-height: 100%;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

#gce_private_conversation .gce-private-conversation-header {
    flex: 0 0 auto;
}

/* Messages container - MUST scroll, not grow */
#gce_private_messages {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 14px;
    background: var(--gce-scroll-bg);
    min-height: 0;
    max-height: 100%;
    display: flex;
    flex-direction: column;
    scroll-behavior: smooth;
}

/* Do not let message content force the page/panel to grow. */
#gce_private_messages {
    min-width: 0;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
    -webkit-overflow-scrolling: touch;
    overflow-anchor: none;
}

#gce_private_messages > * {
    min-width: 0;
}

/* Messages inside the private messages container */
#gce_private_messages .gce-community-post {
    flex-shrink: 0;
    width: 100%;
}

/* Day dividers - never squish */
#gce_private_messages .gce-community-day-divider {
    flex-shrink: 0;
    align-self: center;
}

/* Loading indicator */
#gce_private_messages .gce-community-loading {
    flex-shrink: 0;
}

/* =========================================================
   PRIVATE COMPOSER - ALWAYS VISIBLE AT BOTTOM
   ========================================================= */

/* The composer MUST never shrink or hide */
.gce-private-composer {
    flex-shrink: 0;
    padding: 8px 10px;
    background: var(--gce-composer-bg);
    border-top: 1px solid var(--gce-border-soft);
    position: relative;
    z-index: 2;
}

/* Composer row - full width flex */
.gce-private-composer .gce-community-composer-row {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    width: 100%;
}

/* Input wrapper - takes remaining space */
.gce-private-composer .gce-community-input-wrapper {
    position: relative;
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    align-items: flex-end;
    border-radius: 20px;
    background: var(--gce-input-bg);
    transition: border-radius 0.15s ease;
}

.gce-private-composer .gce-community-input-wrapper:focus-within {
    border-radius: 16px;
}

/* Textarea inside private composer */
.gce-private-composer textarea {
    flex: 1 1 auto;
    min-width: 0;
    border: none;
    background: transparent;
    color: var(--gce-text);
    resize: none;
    font-size: 14px;
    font-family: inherit;
    outline: none;
    min-height: 20px;
    max-height: 100px;
    padding: 10px 16px;
    line-height: 1.35;
    transition: max-height 0.15s ease;
}

.gce-private-composer textarea:focus {
    max-height: 40vh;
}

/* Send button - fixed size */
.gce-private-composer .gce-community-send-btn {
    flex-shrink: 0;
}

/* ── Pinned banner ────────────────────────────────── */

.gce-community-pinned-banner {
    background: var(--gce-pinned-bg);
    border-bottom: 1px solid var(--gce-pinned-border);
    flex-shrink: 0;
}

.gce-community-pinned-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
    border: none;
    background: none;
    cursor: pointer;
    padding: 9px 16px;
    text-align: left;
    font-size: 13px;
    color: var(--gce-text);
}

.gce-community-pinned-icon {
    flex-shrink: 0;
}

.gce-community-pinned-summary {
    flex: 1;
    color: var(--gce-pinned-text);
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.gce-community-pinned-chevron {
    color: var(--gce-muted-text);
    transition: transform 0.15s ease;
    flex-shrink: 0;
}

.gce-community-pinned-banner.is-expanded .gce-community-pinned-chevron {
    transform: rotate(180deg);
}

.gce-community-pinned-list {
    padding: 0 16px 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.gce-community-pinned-list[hidden] {
    display: none;
}

.gce-community-pinned-item {
    background: var(--gce-card-bg);
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 13px;
    color: var(--gce-text);
}

.gce-community-pinned-item .gce-community-post-name {
    font-size: 11.5px;
}

.gce-community-muted-notice {
    background: #fff4e5;
    border-bottom: 1px solid #f3d9a8;
    color: #7a5200;
    padding: 9px 16px;
    font-size: 13px;
    flex-shrink: 0;
}

/* ── Scroll area & feed ───────────────────────────── */

.gce-community-scroll-area {
    flex: 1 1 auto;
    overflow-y: auto;
    background: var(--gce-scroll-bg);
    min-height: 0;
}

.gce-community-loading-older {
    text-align: center;
    font-size: 12px;
    color: var(--gce-muted-text);
    padding: 8px 0;
}

.gce-community-loading {
    text-align: center;
    color: var(--gce-muted-text);
    padding: 32px 0;
    font-size: 14px;
}

.gce-community-feed {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 14px;
}

.gce-community-day-divider {
    align-self: center;
    background: var(--gce-divider-bg);
    color: var(--gce-divider-text);
    font-size: 11.5px;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 10px;
    margin: 8px 0 4px;
}

.gce-community-empty {
    text-align: center;
    color: var(--gce-muted-text);
    padding: 32px 0;
    font-size: 14px;
}

/* ── Posts ────────────────────────────────────────── */

.gce-community-post {
    border-radius: 10px;
    padding: 8px 12px 6px;
    position: relative;
    font-size: 14px;
    line-height: 1.45;
    max-width: 80%;
    box-shadow: 0 1px 1px rgba(0,0,0,0.06);
    color: var(--gce-text);
}

.gce-community-post.author-own {
    background: var(--gce-own-bg);
    align-self: flex-end;
    border: 1px solid var(--gce-own-border);
}

.gce-community-post.author-other {
    background: var(--gce-other-bg);
    align-self: flex-start;
    border: 1px solid var(--gce-other-border);
}

.gce-community-post.author-other .gce-community-post-name {
    color: var(--gce-other-name);
}

.gce-community-post.author-admin {
    background: var(--gce-admin-bg);
    align-self: flex-start;
    max-width: 88%;
    border: 1px solid var(--gce-admin-border);
}

.gce-community-post.author-admin .gce-community-post-name {
    color: var(--gce-admin-name);
}

.gce-community-post-name {
    font-weight: 700;
    font-size: 12.5px;
    margin-bottom: 2px;
    color: var(--gce-own-name);
}

.gce-community-post-content {
    white-space: pre-wrap;
    word-break: break-word;
}

.gce-community-pin-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 4px;
    opacity: 0.75;
}

.gce-community-quoted-reply {
    border-left: 3px solid var(--gce-border-soft);
    padding: 4px 8px;
    margin-bottom: 5px;
    font-size: 12.5px;
    opacity: 0.85;
    border-radius: 4px;
    background: var(--gce-quote-bg);
}

.gce-community-post-meta {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 3px;
}

.gce-community-post-time {
    font-size: 10.5px;
    opacity: 0.6;
}

.gce-community-post-actions {
    display: flex;
    gap: 8px;
    margin-right: auto;
    flex-wrap: wrap;
}

.gce-community-post-action-btn {
    border: none;
    background: none;
    cursor: pointer;
    font-size: 11px;
    opacity: 0.7;
    padding: 0;
    color: inherit;
}

.gce-community-post-action-btn:hover {
    opacity: 1;
    text-decoration: underline;
}

/* ── Deleted messages (private & community) ────────── */

.gce-community-post.gce-community-message-deleted {
    opacity: 0.6;
}

.gce-community-post.gce-community-message-deleted .gce-community-post-content {
    font-style: italic;
    color: var(--gce-muted-text);
}

/* ── Reactions ────────────────────────────────────── */

.gce-community-reactions {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 5px;
}

.gce-community-reaction-btn {
    border: 1px solid var(--gce-border-soft);
    background: rgba(255,255,255,0.5);
    border-radius: 999px;
    padding: 1px 7px;
    font-size: 12px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    color: var(--gce-text);
}

.gce-community-container[data-theme="dark"] .gce-community-reaction-btn {
    background: rgba(255,255,255,0.08);
}

.gce-community-reaction-btn.is-active {
    background: #1d4ed8;
    border-color: #1d4ed8;
    color: #ffffff;
}

.gce-community-reaction-count {
    font-weight: 600;
}

/* ── Composer ─────────────────────────────────────── */

.gce-community-composer {
    flex-shrink: 0;
    background: var(--gce-composer-bg);
    border-top: 1px solid var(--gce-border-soft);
    padding: 8px 10px;
}

.gce-community-composer-row {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    width: 100%;
}

.gce-community-input-wrapper {
    position: relative;
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    align-items: flex-end;
    border-radius: 20px;
    background: var(--gce-input-bg);
    transition: border-radius 0.15s ease;
}

.gce-community-input-wrapper:focus-within {
    border-radius: 16px;
}

.gce-community-composer textarea,
.gce-private-composer textarea {
    flex: 1 1 auto;
    min-width: 0;
    border: none;
    background: transparent;
    color: var(--gce-text);
    resize: none;
    font-size: 14px;
    font-family: inherit;
    outline: none;
    min-height: 20px;
    max-height: 100px;
    padding: 10px 44px 10px 16px;
    line-height: 1.35;
    transition: max-height 0.15s ease;
}

.gce-community-composer textarea:focus,
.gce-private-composer textarea:focus {
    max-height: 40vh;
}

.gce-community-attach-btn {
    position: absolute;
    right: 6px;
    bottom: 6px;
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    flex-shrink: 0;
    padding: 0;
    color: var(--gce-muted-text);
    transition: background 0.15s ease, color 0.15s ease;
}

.gce-community-attach-btn:hover {
    background: rgba(0,0,0,0.06);
}

.gce-community-container[data-theme="dark"] .gce-community-attach-btn:hover {
    background: rgba(255,255,255,0.08);
}

.gce-community-attach-icon {
    width: 20px;
    height: 20px;
    display: block;
}

.gce-community-send-btn {
    background: #1d4ed8;
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0,0,0,0.25);
    transition: background 0.15s ease, opacity 0.15s ease;
    padding: 0;
}

.gce-community-send-btn:hover {
    background: #1a44c4;
}

.gce-community-send-btn:disabled {
    background: #a9b8e0;
    cursor: not-allowed;
    opacity: 0.6;
}

.gce-community-send-icon {
    width: 20px;
    height: 20px;
    display: block;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* ── Image preview ─────────────────────────────────── */

.gce-community-image-preview {
    padding-bottom: 6px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.gce-community-image-preview[hidden] {
    display: none;
}

.gce-community-image-preview-wrapper {
    position: relative;
    display: inline-flex;
    border-radius: 8px;
    overflow: hidden;
    background: var(--gce-card-bg);
    border: 1px solid var(--gce-border-soft);
    max-width: 120px;
    max-height: 90px;
}

.gce-community-image-preview-wrapper img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gce-community-image-preview-remove {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #1d4ed8;
    color: #fff;
    border: 2px solid var(--gce-composer-bg);
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.gce-community-image-preview-remove:hover {
    background: #1a44c4;
}

.gce-community-post-image {
    display: block;
    max-width: 100%;
    max-height: 260px;
    border-radius: 8px;
    margin-bottom: 5px;
    object-fit: cover;
    cursor: pointer;
}

/* ── Reply context ─────────────────────────────────── */

.gce-community-reply-context {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--gce-card-bg);
    border-left: 3px solid #1d4ed8;
    border-radius: 6px;
    padding: 6px 10px;
    margin: 0 0 6px;
    font-size: 12px;
    color: var(--gce-text);
}

.gce-community-reply-context[hidden] {
    display: none;
}

.gce-community-reply-cancel {
    border: none;
    background: none;
    cursor: pointer;
    font-size: 18px;
    color: var(--gce-muted-text);
    line-height: 1;
    padding: 0 4px;
}

/* ── Private: Inbox ────────────────────────────────── */

.gce-private-inbox-item {
    display: flex;
    align-items: center;
    padding: 12px 14px;
    border-bottom: 1px solid var(--gce-border-soft);
    cursor: pointer;
    transition: background 0.1s ease;
    gap: 12px;
}

.gce-private-inbox-item:hover {
    background: var(--gce-quote-bg);
}

.gce-private-inbox-item.unread {
    font-weight: 600;
}

.gce-private-inbox-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #1d4ed8;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    flex-shrink: 0;
}

.gce-private-inbox-content {
    flex: 1;
    min-width: 0;
}

.gce-private-inbox-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--gce-text);
}

.gce-private-inbox-preview {
    font-size: 13px;
    color: var(--gce-muted-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gce-private-inbox-time {
    font-size: 11px;
    color: var(--gce-muted-text);
    flex-shrink: 0;
    margin-left: 8px;
}

.gce-private-inbox-unread {
    background: #1d4ed8;
    color: #fff;
    border-radius: 50%;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 7px;
    min-width: 20px;
    text-align: center;
    flex-shrink: 0;
}

/* ── Private: Conversation ────────────────────────── */

.gce-private-conversation-header {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 14px;
    border-bottom: 1px solid var(--gce-border-soft);
    background: var(--gce-card-bg);
}

.gce-private-back-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 18px;
    padding: 4px 8px;
    color: var(--gce-text);
}

.gce-private-back-btn:hover {
    opacity: 0.7;
}

.gce-private-conv-title {
    font-weight: 600;
    font-size: 14px;
    flex: 1;
    padding-left: 8px;
    color: var(--gce-text);
}

.gce-private-archive-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 13px;
    color: var(--gce-muted-text);
    padding: 4px 8px;
}

.gce-private-archive-btn:hover {
    color: var(--gce-text);
    text-decoration: underline;
}

/* ── Admin "Message privately" in feed ───────────── */

.gce-community-post-action-btn.gce-community-private-msg-btn {
    color: #1d4ed8;
}

.gce-community-post-action-btn.gce-community-private-msg-btn:hover {
    text-decoration: underline;
}

/* ── Private message delete button ────────────────── */

.gce-private-message-delete-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 11px;
    color: var(--gce-muted-text);
    padding: 0 4px;
    opacity: 0;
    transition: opacity 0.15s ease;
}

.gce-community-post:hover .gce-private-message-delete-btn {
    opacity: 0.5;
}

.gce-private-message-delete-btn:hover {
    opacity: 1 !important;
    color: #ef4444;
    text-decoration: underline;
}

.gce-private-message-delete-btn:focus {
    opacity: 0.5;
}

/* ── Modal Animation ───────────────────────────────── */

@keyframes gceModalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Modal backdrop - ensures it's always centered */
#gce_private_new_message_modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(4px);
}

#gce_private_new_message_modal.show {
    display: flex;
}

/* Modal card */
#gce_private_new_message_modal > div {
    background: var(--gce-card-bg);
    border-radius: 16px;
    max-width: 480px;
    width: 100%;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    animation: gceModalFadeIn 0.2s ease;
}

/* Modal close button hover */
#gce_private_modal_close:hover {
    opacity: 1 !important;
}

/* Search result hover */
.gce-private-search-result:hover {
    background: var(--gce-quote-bg);
}

/* Dark theme modal adjustments */
.gce-community-container[data-theme="dark"] #gce_private_new_message_modal {
    background: rgba(0, 0, 0, 0.75);
}

/* ── Toast Notifications ──────────────────────────── */

@keyframes gceToastSlideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes gceToastSlideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

.gce-toast {
    background: var(--gce-toast-bg);
    color: var(--gce-toast-text);
    padding: 14px 18px;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
    pointer-events: auto;
    cursor: default;
    min-width: 260px;
    max-width: 360px;
    animation: gceToastSlideIn 0.3s ease forwards;
    border-left: 4px solid var(--gce-toast-info);
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-size: 14px;
    line-height: 1.4;
}

.gce-toast.gce-toast-hiding {
    animation: gceToastSlideOut 0.25s ease forwards;
}

.gce-toast-icon {
    flex-shrink: 0;
    font-size: 18px;
    line-height: 1.4;
    margin-top: 1px;
}

.gce-toast-content {
    flex: 1;
    min-width: 0;
}

.gce-toast-title {
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 2px;
}

.gce-toast-message {
    font-size: 13px;
    opacity: 0.85;
    word-wrap: break-word;
}

.gce-toast-close {
    background: none;
    border: none;
    color: var(--gce-toast-text);
    opacity: 0.5;
    cursor: pointer;
    font-size: 16px;
    padding: 0 0 0 8px;
    flex-shrink: 0;
    line-height: 1;
    transition: opacity 0.15s ease;
}

.gce-toast-close:hover {
    opacity: 1;
}

/* Toast variants */
.gce-toast.gce-toast-success {
    border-left-color: var(--gce-toast-success);
}

.gce-toast.gce-toast-success .gce-toast-icon {
    color: var(--gce-toast-success);
}

.gce-toast.gce-toast-error {
    border-left-color: var(--gce-toast-error);
}

.gce-toast.gce-toast-error .gce-toast-icon {
    color: var(--gce-toast-error);
}

.gce-toast.gce-toast-info {
    border-left-color: var(--gce-toast-info);
}

.gce-toast.gce-toast-info .gce-toast-icon {
    color: var(--gce-toast-info);
}

/* ── Toast container ──────────────────────────────── */

#gce_toast_container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 360px;
    pointer-events: none;
}

#gce_toast_container .gce-toast {
    pointer-events: auto;
}

/* ── Toast mobile adjustments ─────────────────────── */

@media (max-width: 480px) {
    #gce_toast_container {
        bottom: 12px;
        right: 12px;
        left: 12px;
        max-width: none;
    }

    .gce-toast {
        min-width: 0;
        max-width: none;
        width: 100%;
        padding: 12px 16px;
        font-size: 13px;
    }

    .gce-toast-title {
        font-size: 12px;
    }

    .gce-toast-message {
        font-size: 12px;
    }
}

/* ── Mobile ───────────────────────────────────────── */

@media (max-width: 480px) {
    .gce-community-container {
        border-radius: 0;
        height: 100vh;
        max-height: 100vh;
    }

    .gce-community-title {
        font-size: 15px;
    }

    .gce-community-level-toggle {
        padding: 2px;
    }

    .gce-community-level-btn {
        padding: 5px 9px;
        font-size: 11.5px;
    }

    .gce-community-mode-btn {
        padding: 6px 14px;
        font-size: 13px;
    }

    .gce-community-post {
        max-width: 88%;
        padding: 7px 10px 5px;
        font-size: 13.5px;
    }

    .gce-community-reaction-btn {
        padding: 2px 6px;
        font-size: 13px;
    }

    .gce-community-composer textarea,
    .gce-private-composer textarea {
        font-size: 16px;
        padding: 10px 44px 10px 14px;
    }

    .gce-community-send-btn {
        width: 38px;
        height: 38px;
        flex: 0 0 38px;
    }

    .gce-community-send-icon {
        width: 18px;
        height: 18px;
    }

    .gce-community-attach-btn {
        width: 30px;
        height: 30px;
        right: 4px;
        bottom: 4px;
    }

    .gce-community-attach-icon {
        width: 18px;
        height: 18px;
    }

    .gce-community-image-preview-wrapper {
        max-width: 90px;
        max-height: 70px;
    }

    .gce-private-inbox-item {
        padding: 10px 12px;
    }

    .gce-private-inbox-avatar {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }

    /* Private conversation mobile adjustments */
    #gce_private_conversation {
        height: 100%;
        max-height: 100%;
    }

    #gce_private_messages {
        padding: 10px;
    }

    .gce-private-composer {
        padding: 6px 8px;
    }

    .gce-private-composer textarea {
        font-size: 16px;
        padding: 8px 12px;
    }

    /* Modal mobile adjustments */
    #gce_private_new_message_modal {
        padding: 10px;
    }

    #gce_private_new_message_modal > div {
        max-width: 100%;
        max-height: 90vh;
        border-radius: 12px;
    }

    #gce_private_modal_search_btn {
        font-size: 13px;
        padding: 0 12px;
        height: 40px;
    }

    #gce_private_modal_search_input {
        font-size: 16px;
        padding: 8px 12px;
    }

    /* Toast mobile - ensure good positioning */
    #gce_toast_container {
        bottom: 70px;
    }
}