/* ============================================================================
   THE WALL - Social Platform Styles
   Matches Ocean Glass design system from main.css
   ============================================================================ */

/* Layout */
.social-layout {
    max-width: 700px;
    margin: 0 auto;
    padding: 0 1rem;
}

.social-header {
    margin-bottom: 1.5rem;
}

.social-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

.social-title-row h1 {
    margin: 0;
    font-size: clamp(1.8rem, 4vw, 2.5rem);
}

.social-header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-badge {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.8rem;
    background: var(--glass-bg);
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    color: var(--text);
    transition: var(--transition-fast);
}
.user-badge:hover {
    border-color: var(--accent-color);
    color: var(--accent-color);
}

/* ===== Stats Bar ===== */
.stats-bar {
    display: flex;
    gap: 1.5rem;
    margin-top: 0.75rem;
    font-size: 0.85rem;
    color: rgba(0, 0, 0, 0.5);
}
.stats-bar strong {
    color: var(--text);
}

/* Back link */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-bottom: 1.5rem;
    font-weight: 600;
    color: var(--text);
    opacity: 0.8;
}
.back-link:hover {
    opacity: 1;
    color: var(--accent-color);
}

/* ===== Notification Bell ===== */
.notif-bell {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: var(--glass-bg);
    cursor: pointer;
    transition: var(--transition-fast);
    color: var(--text);
}
.notif-bell:hover {
    border-color: var(--accent-color);
    color: var(--accent-color);
}

.notif-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    border-radius: 9px;
    background: var(--accent-red);
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

/* ===== Notification Panel ===== */
.notif-panel {
    padding: 0;
    margin-bottom: 1rem;
    max-height: 400px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.notif-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    font-size: 0.9rem;
}

.notif-mark-read {
    border: none;
    background: none;
    color: var(--accent-color);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    font-family: var(--font-primary);
}
.notif-mark-read:hover {
    text-decoration: underline;
}

.notif-list {
    overflow-y: auto;
    max-height: 340px;
}

.notif-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    text-decoration: none;
    color: var(--text);
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
    transition: background var(--transition-fast);
}
.notif-item:hover {
    background: rgba(0, 0, 0, 0.03);
}

.notif-item div {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}
.notif-item span {
    font-size: 0.85rem;
    line-height: 1.4;
}
.notif-item small {
    font-size: 0.75rem;
    color: rgba(0, 0, 0, 0.4);
}

.notif-unread {
    background: rgba(31, 117, 187, 0.06);
    border-left: 3px solid var(--accent-color);
}

/* ===== New Posts Bar ===== */
.new-posts-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem;
    margin-bottom: 1rem;
    background: var(--accent-color);
    color: white;
    border-radius: var(--glass-radius);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition-medium);
}
.new-posts-bar:hover {
    filter: brightness(1.1);
}

/* ===== Compose Box ===== */
.compose-box {
    padding: 1.25rem;
    margin-bottom: 1rem;
}

.compose-header {
    display: flex;
    gap: 0.75rem;
}

.compose-avatar img,
.compose-avatar .avatar-placeholder {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.compose-input-wrap {
    flex: 1;
}

.compose-input-wrap textarea {
    width: 100%;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.75rem;
    font-family: var(--font-primary);
    font-size: 0.95rem;
    color: var(--text);
    resize: vertical;
    min-height: 60px;
    transition: border-color var(--transition-fast);
}

.compose-input-wrap textarea::placeholder {
    color: rgba(0, 0, 0, 0.45);
}

.compose-input-wrap textarea:focus {
    outline: none;
    border-color: var(--accent-color);
}

/* Compose Preview */
.compose-preview {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
    padding: 0.5rem;
    background: rgba(0, 0, 0, 0.04);
    border-radius: 8px;
    position: relative;
}
.compose-preview img {
    max-height: 120px;
    max-width: 200px;
    border-radius: 6px;
    object-fit: cover;
}
.preview-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: none;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}
.preview-remove:hover {
    background: var(--accent-red);
}

.pdf-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--accent-color);
}

.compose-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.75rem;
    padding-left: 52px; /* avatar width + gap */
}

.compose-tools {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.attach-btn {
    cursor: pointer;
    color: rgba(0, 0, 0, 0.5);
    transition: color var(--transition-fast);
}
.attach-btn:hover {
    color: var(--accent-color);
}

.room-select {
    padding: 0.3rem 0.6rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--glass-bg);
    color: var(--text);
    font-size: 0.8rem;
    cursor: pointer;
    max-width: 140px;
}

.char-count {
    font-size: 0.75rem;
    color: rgba(0, 0, 0, 0.4);
}

.compose-locked {
    text-align: center;
    opacity: 0.7;
}
.compose-locked a {
    color: var(--accent-color);
    font-weight: 700;
    text-decoration: underline;
}

.compose-reply {
    margin-bottom: 1.5rem;
}

/* ===== Username Claim ===== */
.username-claim {
    text-align: center;
    margin-bottom: 1.5rem;
}
.username-claim h3 {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}
.username-form {
    max-width: 350px;
    margin: 1rem auto 0;
}
.username-input-group {
    display: flex;
    align-items: center;
    border: 2px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.15);
}
.username-at {
    padding: 0.6rem 0 0.6rem 0.75rem;
    font-weight: 700;
    color: var(--accent-color);
    font-size: 1.1rem;
}
.username-input-group input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 0.6rem 0.5rem;
    font-family: var(--font-primary);
    font-size: 1rem;
    color: var(--text);
    outline: none;
}
.username-status {
    padding: 0 0.75rem;
    font-size: 1.1rem;
}
.username-rules {
    font-size: 0.75rem;
    color: rgba(0, 0, 0, 0.4);
    margin: 0.5rem 0 1rem;
}

/* ===== Feed Filters ===== */
.feed-filters {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    overflow-x: auto;
    padding-bottom: 0.25rem;
}

.filter-tab {
    padding: 0.4rem 1rem;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: transparent;
    font-family: var(--font-primary);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
    cursor: pointer;
    white-space: nowrap;
    transition: var(--transition-fast);
}

.filter-tab:hover,
.filter-tab.active {
    background: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
}

/* ===== Post Card ===== */
.post-card {
    padding: 1.25rem;
    margin-bottom: 0.75rem;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.post-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.post-detail {
    margin-bottom: 1.5rem;
}
.post-detail:hover {
    transform: none;
}

.post-reply {
    margin-left: 0;
    border-left: 3px solid var(--glass-bg);
}

/* Bot posts — left accent border */
.post-bot {
    border-left: 4px solid var(--accent-color);
}

/* Alert posts — red accent */
.post-alert {
    border-left: 4px solid var(--accent-red);
}

/* Pinned posts */
.post-pinned {
    border-top: 2px solid var(--accent-color);
}

.pinned-label {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--accent-color);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Post Header */
.post-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.post-avatar img,
.post-avatar .avatar-placeholder {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border);
}

.avatar-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--secondary);
    color: white;
    font-weight: 700;
    font-size: 1rem;
    border: 2px solid var(--border);
}

.avatar-placeholder.aria-glow {
    background: var(--accent-color);
    box-shadow: 0 0 12px rgba(31, 117, 187, 0.5);
}

.avatar-large {
    width: 72px !important;
    height: 72px !important;
    font-size: 1.8rem !important;
}

.post-meta {
    flex: 1;
}

.post-author {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-weight: 700;
    font-size: 0.95rem;
}

.author-link {
    color: var(--text);
    text-decoration: none;
    font-weight: 700;
}
.author-link:hover {
    color: var(--accent-color);
    text-decoration: underline;
}

.post-handle {
    font-weight: 400;
    color: rgba(0, 0, 0, 0.5);
    font-size: 0.85rem;
    text-decoration: none;
}
.post-handle:hover {
    color: var(--accent-color);
}

.bot-badge {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.1rem 0.35rem;
    background: var(--accent-color);
    color: white;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.mod-badge {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.1rem 0.35rem;
    background: var(--success);
    color: white;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.post-time {
    font-size: 0.8rem;
    color: rgba(0, 0, 0, 0.45);
}

.post-type-badge {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.badge-milk_carton, .badge-alert {
    background: var(--accent-red);
    color: white;
}

.badge-infographic {
    background: var(--accent-color);
    color: white;
}

.badge-investigation {
    background: var(--warning);
    color: white;
}

.badge-echo {
    background: var(--success);
    color: white;
}

.badge-system {
    background: rgba(0, 0, 0, 0.3);
    color: white;
}

/* Post Body */
.post-body {
    line-height: 1.65;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.post-body-link {
    text-decoration: none;
    color: inherit;
}

.post-body-detail {
    font-size: 1.05rem;
    line-height: 1.7;
}

.post-body .mention {
    color: var(--accent-color);
    font-weight: 600;
    text-decoration: none;
}
.post-body .mention:hover {
    text-decoration: underline;
}

.post-body a {
    color: var(--accent-color);
    text-decoration: underline;
}

/* Post Image */
.post-image {
    margin-top: 0.75rem;
}

.post-image img {
    width: 100%;
    max-height: 600px;
    object-fit: contain;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg-secondary);
}

/* Milk carton posts — show full poster */
.post-milk-carton .post-image img {
    max-height: none;
}

/* PDF Document indicator */
.post-document {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    background: rgba(0, 0, 0, 0.04);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--accent-color);
    font-weight: 600;
    margin-top: 0.75rem;
    transition: var(--transition-fast);
}
.post-document:hover {
    background: rgba(31, 117, 187, 0.08);
}

/* Post Actions */
.post-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    flex-wrap: wrap;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.5rem;
    border: none;
    background: transparent;
    font-family: var(--font-primary);
    font-size: 0.85rem;
    font-weight: 600;
    color: rgba(0, 0, 0, 0.5);
    cursor: pointer;
    border-radius: 6px;
    transition: var(--transition-fast);
    text-decoration: none;
}

.action-btn:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text);
}

.like-btn.liked {
    color: var(--accent-red);
}
.like-btn.liked i {
    fill: var(--accent-red);
}

.share-btn:hover {
    color: var(--accent-color);
}

.repost-btn:hover {
    color: #22c55e;
}

.report-btn {
    margin-left: auto;
    opacity: 0;
    transition: opacity var(--transition-fast), color var(--transition-fast);
}
.post-card:hover .report-btn,
.post-detail .report-btn {
    opacity: 0.5;
}
.report-btn:hover {
    opacity: 1 !important;
    color: var(--accent-red) !important;
}

.delete-btn:hover {
    color: var(--accent-red);
}

.view-count-display {
    cursor: default;
    font-size: 0.8rem;
}

/* ===== Profile ===== */
.profile-card {
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.profile-header {
    display: flex;
    gap: 1.25rem;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.profile-avatar img {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--border);
}

.profile-info {
    flex: 1;
}

.profile-name {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 0 0.25rem;
    font-size: 1.4rem;
}

.profile-handle {
    color: rgba(0, 0, 0, 0.5);
    font-size: 0.95rem;
}

.profile-bio {
    margin-top: 0.5rem;
    line-height: 1.5;
    font-size: 0.95rem;
}

.profile-stats {
    display: flex;
    gap: 2rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.profile-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.15rem;
}
.profile-stat strong {
    font-size: 1.2rem;
}
.profile-stat span {
    font-size: 0.8rem;
    color: rgba(0, 0, 0, 0.5);
}

/* Replies */
.replies-section {
    margin-top: 0.5rem;
}

.replies-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.empty-feed, .empty-replies {
    text-align: center;
    padding: 3rem 1rem;
}
.empty-feed i, .empty-replies i {
    margin-bottom: 1rem;
}
.empty-feed h3 {
    margin-bottom: 0.5rem;
}

/* Load More */
.load-more-wrap {
    text-align: center;
    padding: 1rem;
}

/* ===== Toast ===== */
.social-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(80px);
    padding: 0.75rem 1.5rem;
    background: rgba(0, 0, 0, 0.85);
    color: white;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    z-index: 10000;
    pointer-events: none;
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}
.social-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ============================================================================
   CONTENT WARNINGS
   ============================================================================ */

/* CW label — always visible */
.cw-label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.75rem;
    background: rgba(210, 153, 34, 0.1);
    border: 1px solid rgba(210, 153, 34, 0.25);
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--warning);
    cursor: pointer;
    margin-bottom: 0.35rem;
    transition: var(--transition-fast);
}
.cw-label:hover {
    background: rgba(210, 153, 34, 0.16);
}
.cw-show-text {
    margin-left: auto;
    font-size: 0.75rem;
    font-weight: 400;
    opacity: 0.7;
}

/* Hidden content behind CW — collapsed by default */
.cw-hidden-content {
    display: none;
}
.cw-wrapper.cw-revealed .cw-hidden-content {
    display: block;
}
.cw-wrapper.cw-revealed .cw-show-text {
    display: none;
}
.cw-wrapper.cw-revealed .cw-label::after {
    content: '(Click to hide)';
    margin-left: auto;
    font-size: 0.75rem;
    font-weight: 400;
    opacity: 0.7;
}

/* Blur filter on content behind CW (shown when revealed but user can still re-hide) */
.cw-blur {
    filter: blur(6px);
    user-select: none;
    transition: filter 0.3s ease;
}
.cw-wrapper.cw-revealed .cw-blur {
    filter: none;
    user-select: auto;
}

/* Blur media behind CW */
.cw-blur-media {
    position: relative;
}
.cw-blur-media img {
    filter: blur(12px);
    transition: filter 0.3s ease;
}
.cw-blur-media.cw-media-revealed img {
    filter: none;
}

/* CW Input in Compose Box */
.cw-input-wrap {
    padding: 0 0 0 52px; /* aligned with text area (avatar + gap) */
}
.cw-input-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.65rem;
    background: rgba(210, 153, 34, 0.08);
    border: 1px solid rgba(210, 153, 34, 0.2);
    border-radius: 6px;
    margin-top: 0.4rem;
    color: var(--warning);
}
.cw-input {
    flex: 1;
    border: none;
    background: transparent;
    font-family: var(--font-primary);
    font-size: 0.85rem;
    color: var(--text);
    outline: none;
}
.cw-input::placeholder {
    color: rgba(0, 0, 0, 0.35);
}
.cw-remove-btn {
    border: none;
    background: none;
    font-size: 1.1rem;
    cursor: pointer;
    color: rgba(0, 0, 0, 0.4);
    padding: 0 0.2rem;
    line-height: 1;
}
.cw-remove-btn:hover {
    color: var(--accent-red);
}

/* CW toggle button in compose tools */
.cw-toggle-btn {
    font-size: 0.8rem !important;
    gap: 0.25rem !important;
    opacity: 0.7;
}
.cw-toggle-btn:hover {
    opacity: 1;
    color: var(--warning) !important;
}
.cw-toggle-btn.cw-active {
    opacity: 1;
    color: var(--warning) !important;
}

/* ============================================================================
   VERIFIED BADGES & TRUST LEVELS
   ============================================================================ */

.verified-badge {
    display: inline-flex;
    align-items: center;
    color: var(--success);
}
.verified-badge i {
    fill: var(--success);
}

.staff-badge {
    display: inline-flex;
    align-items: center;
    color: var(--accent-color);
}
.staff-badge i {
    fill: var(--accent-color);
}

/* ============================================================================
   ROOMS / CHANNELS
   ============================================================================ */

/* Room Navigation (horizontal scrolling tabs with arrows) */
.room-nav-wrapper {
    position: relative;
    margin-bottom: 1rem;
}

.room-nav {
    display: flex;
    gap: 0.35rem;
    overflow-x: auto;
    padding-bottom: 0.25rem;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.room-nav::-webkit-scrollbar { display: none; }

.room-nav-arrow {
    display: none;
    position: absolute;
    top: 50%;
    transform: translateY(-60%);
    width: 28px;
    height: 28px;
    align-items: center;
    justify-content: center;
    background: var(--accent-color, #1f75bb);
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    z-index: 3;
    padding: 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.4);
    transition: transform 0.15s, background 0.15s;
}
.room-nav-arrow:hover {
    background: #2589d6;
    transform: translateY(-60%) scale(1.12);
}
.room-nav-arrow-left { left: -4px; }
.room-nav-arrow-right { right: -4px; }

.room-nav-item {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.85rem;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: transparent;
    font-family: var(--font-primary);
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text);
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    text-decoration: none;
    transition: var(--transition-fast);
}
.room-nav-item:hover {
    background: rgba(31, 117, 187, 0.08);
    border-color: var(--accent-color);
    color: var(--accent-color);
}
.room-nav-item.room-active {
    background: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
}

/* Room Header (on room-specific page) */
.room-header {
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
}
.room-header-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.room-header-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: rgba(31, 117, 187, 0.1);
    color: var(--accent-color);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.room-header-name {
    margin: 0;
    font-size: 1.25rem;
}
.room-header-desc {
    margin: 0.15rem 0 0;
    font-size: 0.85rem;
    color: rgba(0, 0, 0, 0.5);
}
.room-verified-notice {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    margin-top: 0.5rem;
    font-size: 0.78rem;
    color: var(--success);
    font-weight: 600;
}

/* Room Badge on Post Cards (in combined feed) */
.room-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    font-size: 0.65rem;
    font-weight: 600;
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.06);
    color: rgba(0, 0, 0, 0.5);
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
}
.room-badge:hover {
    background: rgba(31, 117, 187, 0.1);
    color: var(--accent-color);
}

/* ============================================================================
   ECHO INTEGRATION
   ============================================================================ */

.echo-launch-cta {
    display: block;
    text-decoration: none;
    color: var(--text);
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
    border-left: 4px solid var(--success);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}
.echo-launch-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(46, 160, 67, 0.2);
}
.echo-launch-inner {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}
.echo-launch-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: rgba(46, 160, 67, 0.12);
    color: var(--success);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.echo-launch-text {
    flex: 1;
}
.echo-launch-text strong {
    font-size: 1.05rem;
}
.echo-launch-text p {
    margin: 0.15rem 0 0;
    font-size: 0.85rem;
    color: rgba(0, 0, 0, 0.55);
}

/* ============================================================================
   DM SYSTEM STYLES
   ============================================================================ */

/* DM Inbox */
.dm-aria-cta {
    display: block;
    text-decoration: none;
    color: var(--text);
    margin-bottom: 1rem;
    padding: 1rem 1.25rem;
    border-left: 4px solid var(--accent-color);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}
.dm-aria-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(31, 117, 187, 0.2);
}
.dm-aria-cta-inner {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.dm-aria-cta-inner p {
    margin: 0.15rem 0 0;
    font-size: 0.85rem;
}
.dm-aria-cta-inner i:last-child {
    margin-left: auto;
    opacity: 0.4;
}

/* DM List (inbox conversation rows) */
.dm-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.dm-list-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    text-decoration: none;
    color: var(--text);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}
.dm-list-item:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}
.dm-unread {
    border-left: 3px solid var(--accent-color);
}

.dm-list-avatar img,
.dm-list-avatar .avatar-placeholder {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.dm-list-info {
    flex: 1;
    min-width: 0;
}
.dm-list-name {
    font-weight: 600;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}
.dm-list-preview {
    font-size: 0.85rem;
    color: rgba(0, 0, 0, 0.5);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 0.1rem;
}
.dm-unread .dm-list-preview {
    color: var(--text);
    font-weight: 500;
}

.dm-list-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.25rem;
    flex-shrink: 0;
}
.dm-list-time {
    font-size: 0.75rem;
    color: rgba(0, 0, 0, 0.4);
}
.dm-unread-badge {
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    border-radius: 10px;
    background: var(--accent-color);
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* DM Conversation Layout */
.dm-conversation-layout {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 140px);
    max-height: 800px;
}

.dm-conv-header-user {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.dm-conv-avatar {
    width: 32px !important;
    height: 32px !important;
    border-radius: 50%;
    object-fit: cover;
    font-size: 0.85rem !important;
}

/* Privacy Notice */
.dm-privacy-notice {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: rgba(31, 117, 187, 0.08);
    border-radius: 8px;
    font-size: 0.75rem;
    color: rgba(0, 0, 0, 0.55);
    margin-bottom: 0.5rem;
}

/* Messages Area */
.dm-messages {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem 0;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.dm-msg {
    display: flex;
    max-width: 85%;
}
.dm-msg-mine {
    align-self: flex-end;
    justify-content: flex-end;
}
.dm-msg-theirs {
    align-self: flex-start;
}

.dm-msg-bubble {
    padding: 0.65rem 0.85rem;
    border-radius: 16px;
    max-width: 100%;
    word-wrap: break-word;
    overflow-wrap: break-word;
}
.dm-msg-mine .dm-msg-bubble {
    background: var(--accent-color);
    color: white;
    border-bottom-right-radius: 4px;
}
.dm-msg-theirs .dm-msg-bubble {
    background: var(--glass-bg);
    border: 1px solid var(--border);
    border-bottom-left-radius: 4px;
}

.dm-msg-aria {
    border-left: 3px solid var(--accent-color);
}

.dm-msg-content {
    font-size: 0.92rem;
    line-height: 1.55;
}
.dm-msg-content a {
    color: inherit;
    text-decoration: underline;
}
.dm-msg-mine .dm-msg-content a {
    color: rgba(255, 255, 255, 0.9);
}

.dm-msg-time {
    font-size: 0.7rem;
    opacity: 0.5;
    margin-top: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}
.dm-msg-mine .dm-msg-time {
    text-align: right;
    justify-content: flex-end;
}

.dm-processing-time {
    opacity: 0.7;
    font-style: italic;
}

/* Tool Tags */
.dm-tools-used {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-top: 0.35rem;
}
.dm-tool-tag {
    font-size: 0.65rem;
    padding: 0.1rem 0.35rem;
    background: rgba(0, 0, 0, 0.06);
    border-radius: 3px;
    font-family: monospace;
    color: rgba(0, 0, 0, 0.6);
}
.dm-tool-active {
    background: rgba(31, 117, 187, 0.12);
    color: var(--accent-color);
}

/* ARIA DM Markdown Formatting */
.dm-msg-aria .dm-h2 {
    font-size: 1rem;
    font-weight: 700;
    margin: 0.6rem 0 0.3rem 0;
    color: var(--accent-color);
}
.dm-msg-aria .dm-h2:first-child { margin-top: 0; }
.dm-msg-aria .dm-h3 {
    font-size: 0.92rem;
    font-weight: 600;
    margin: 0.5rem 0 0.2rem 0;
}
.dm-msg-aria .dm-p {
    margin: 0.15rem 0;
}
.dm-msg-aria .dm-list {
    margin: 0.25rem 0 0.25rem 1.2rem;
    padding: 0;
    list-style: disc;
}
.dm-msg-aria .dm-list li {
    margin: 0.15rem 0;
    line-height: 1.45;
}
.dm-msg-aria .dm-code {
    background: rgba(0, 0, 0, 0.06);
    padding: 0.1rem 0.35rem;
    border-radius: 3px;
    font-family: monospace;
    font-size: 0.85em;
}
.dm-msg-aria .dm-hr {
    border: none;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    margin: 0.5rem 0;
}

/* Download Button (report links) */
.dm-download-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.45rem 0.85rem;
    margin: 0.35rem 0;
    background: var(--accent-color);
    color: white !important;
    text-decoration: none !important;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.15s ease;
}
.dm-download-btn:hover {
    background: var(--accent-hover, #024a6e);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Share Bar */
.dm-share-bar {
    display: flex;
    gap: 0.35rem;
    margin-top: 0.45rem;
    padding-top: 0.4rem;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    flex-wrap: wrap;
}
.dm-share-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.2rem 0.5rem;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.6);
    font-size: 0.72rem;
    color: rgba(0, 0, 0, 0.55);
    cursor: pointer;
    transition: all 0.15s ease;
}
.dm-share-btn:hover {
    background: rgba(255, 255, 255, 0.9);
    color: var(--accent-color);
    border-color: var(--accent-color);
}

/* Streaming Area */
.dm-streaming {
    padding: 0.25rem 0;
}
.dm-stream-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: rgba(0, 0, 0, 0.6);
    margin-bottom: 0.25rem;
}
.dm-stream-tools {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-bottom: 0.25rem;
}
.dm-stream-text {
    min-height: 1rem;
}

/* Typing Indicator */
.dm-typing-indicator {
    display: flex;
    gap: 3px;
    align-items: center;
}
.dm-typing-indicator span {
    width: 6px;
    height: 6px;
    background: var(--accent-color);
    border-radius: 50%;
    animation: dmTyping 1.4s infinite both;
}
.dm-typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.dm-typing-indicator span:nth-child(3) { animation-delay: 0.4s; }
@keyframes dmTyping {
    0%, 60%, 100% { opacity: 0.3; transform: scale(0.8); }
    30% { opacity: 1; transform: scale(1); }
}

/* Empty Conversation */
.dm-empty-conv {
    text-align: center;
    padding: 3rem 1rem;
    opacity: 0.8;
}
.dm-empty-conv h3 {
    margin: 0 0 0.5rem;
}

/* Suggestions */
.dm-suggestions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 1rem;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}
.dm-suggestion {
    padding: 0.6rem 1rem;
    background: var(--glass-bg);
    border: 1px solid var(--border);
    border-radius: 20px;
    font-family: var(--font-primary);
    font-size: 0.85rem;
    cursor: pointer;
    text-align: left;
    color: var(--text);
    transition: var(--transition-fast);
}
.dm-suggestion:hover {
    border-color: var(--accent-color);
    background: rgba(31, 117, 187, 0.06);
}

/* Compose Area */
.dm-compose {
    padding: 0.75rem 0 0;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    flex-shrink: 0;
}
.dm-compose-inner {
    display: flex;
    align-items: flex-end;
    gap: 0.5rem;
    background: var(--glass-bg);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 0.35rem 0.5rem 0.35rem 0.85rem;
}
.dm-compose-inner textarea {
    flex: 1;
    border: none;
    background: transparent;
    font-family: var(--font-primary);
    font-size: 0.92rem;
    color: var(--text);
    resize: none;
    outline: none;
    padding: 0.35rem 0;
    max-height: 150px;
    line-height: 1.4;
}
.dm-compose-inner textarea::placeholder {
    color: rgba(0, 0, 0, 0.4);
}
.dm-send-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: var(--accent-color);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: var(--transition-fast);
}
.dm-send-btn:hover {
    filter: brightness(1.1);
}
.dm-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* DM Nav Icon */
.dm-nav-icon {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: var(--glass-bg);
    cursor: pointer;
    transition: var(--transition-fast);
    color: var(--text);
    text-decoration: none;
}
.dm-nav-icon:hover {
    border-color: var(--accent-color);
    color: var(--accent-color);
}
.dm-nav-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    border-radius: 9px;
    background: var(--accent-color);
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

/* ===== Responsive ===== */

/* Tablet / small desktop */
@media (max-width: 900px) {
    .social-layout {
        max-width: 100%;
    }

    .compose-footer {
        padding-left: 0;
    }

    .feed-filters {
        -webkit-overflow-scrolling: touch;
    }

    .profile-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .profile-name {
        justify-content: center;
    }

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

    /* Touch devices have no hover — always show report btn */
    .report-btn {
        opacity: 0.5;
    }

    .dm-msg {
        max-width: 92%;
    }

    .dm-conversation-layout {
        height: calc(100vh - 120px);
        height: calc(100dvh - 120px);
    }

    .dm-suggestions {
        max-width: 100%;
    }
}

/* Phone (480px and below) */
@media (max-width: 480px) {
    .social-layout {
        padding: 0 0.5rem;
    }

    .social-header {
        margin-bottom: 1rem;
    }

    .social-title-row {
        gap: 0.5rem;
    }

    .social-header-actions {
        gap: 0.4rem;
    }

    .stats-bar {
        gap: 0.75rem;
        font-size: 0.78rem;
        flex-wrap: wrap;
    }

    /* Compose box — tighter on phones */
    .compose-avatar {
        width: 32px;
        height: 32px;
    }

    .compose-box {
        gap: 0.5rem;
    }

    .compose-tools {
        gap: 0.5rem;
    }

    /* Post cards — less padding */
    .post-card {
        padding: 0.75rem;
    }

    .post-header {
        gap: 0.5rem;
    }

    .post-avatar {
        width: 34px;
        height: 34px;
    }

    .post-avatar img {
        width: 34px;
        height: 34px;
    }

    .post-content {
        font-size: 0.92rem;
    }

    /* Milk carton images — constrain on phones so they don't dominate */
    .post-milk-carton .post-image img {
        max-height: 70vh;
    }

    /* Action buttons — smaller touch targets still 44px min via padding */
    .action-btn {
        padding: 0.4rem 0.35rem;
        font-size: 0.8rem;
    }

    /* Room nav — tighter pills */
    .room-nav-item {
        padding: 0.35rem 0.65rem;
        font-size: 0.78rem;
    }

    .room-nav-arrow {
        width: 24px;
        height: 24px;
    }

    /* Profile page */
    .profile-stats {
        gap: 1rem;
    }

    .profile-avatar {
        width: 70px;
        height: 70px;
    }

    /* DM — safe area for notched phones */
    .dm-conversation-layout {
        height: calc(100vh - 130px);
        height: calc(100dvh - 130px);
        padding-bottom: env(safe-area-inset-bottom, 0);
    }

    .dm-compose {
        padding-bottom: env(safe-area-inset-bottom, 0);
    }

    /* Notification panel */
    .notif-panel {
        max-height: 60vh;
        overflow-y: auto;
    }

    /* Feed filters scroll hint */
    .feed-filters {
        gap: 0.35rem;
    }

    .filter-pill {
        padding: 0.3rem 0.6rem;
        font-size: 0.78rem;
    }
}

/* Tiny phones (360px and below — iPhone SE, older Androids) */
@media (max-width: 360px) {
    .social-layout {
        padding: 0 0.35rem;
    }

    .social-title-row h1 {
        font-size: 1.5rem;
    }

    .post-card {
        padding: 0.6rem;
    }

    .room-nav-item {
        padding: 0.3rem 0.5rem;
        font-size: 0.72rem;
    }

    .action-btn {
        gap: 0.2rem;
        font-size: 0.75rem;
    }

    .dm-msg {
        max-width: 95%;
    }
}
