/**
?v=2
 * Discourse Platform — Centralized Styles
 * discourse-styles.css  |  Clean, conflict-free version
 *
 * SECTIONS
 *  1.  Layout & Main Content
 *  2.  Navigation Headers & Tabs
 *  3.  Post Composer (Home)
 *  4.  Character Counter
 *  5.  Post Cards (Feed)
 *  6.  Post Action Buttons
 *  7.  More Menu & Post Options Dropdown
 *  8.  Single Post View
 *  9.  Reply Composer
 * 10.  Replies Section
 * 11.  Parent Context (Thread Origin)
 * 12.  Nested Replies (Feed & Single Post)
 * 13.  Connector Lines
 * 14.  Expand & Avatar-Expand Buttons
 * 15.  Nested Reply Animations
 * 16.  Single-Page Border Rules
 * 17.  Profile Page — User Info
 * 18.  Edit Profile Modal  (scoped: .discourse-edit-modal > .discourse-edit-modal-content)
 * 19.  Cropper Modal
 * 20.  Image Modals (Banner & Avatar)
 * 21.  Right Sidebar — Search & Trending
 * 22.  Loading & Empty States
 * 23.  Load More Button
 * 24.  Responsive Design
 * 25.  Utility / Misc Fixes
 * 26.  Compose Block (duplicate-free)
 * 27.  User Card (Sidebar)
 * 28.  Hint.css Override
 * 29.  Save-Draft Confirmation Modal
 * 30.  Followers / Following Modal
 * 31.  Reflections Tab
 * 32.  Repost Dropdown
 * 33.  Quote Modal
 * 34.  Repost Card
 * 35.  Quoted Post Box
 * 36.  Action Button Active States
 * 37.  @ Mention Autocomplete
 * 38.  Confirm / Delete Modal
 * 39.  Font Consistency (unified)
 * 40.  Notifications
 * 41.  Link Preview Cards
 * 42.  Post Edit Modal  (scoped: #discourse-edit-modal-overlay)
 * 43.  Reply-Permissions Modal
 */

/* ============================================
   1. LAYOUT & MAIN CONTENT
   ============================================ */

.discourse-full-container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    display: flex;
    align-items: flex-start;
    gap: 0;
    padding: 12px 350px 0 275px;
    box-sizing: border-box;
}

.discourse-main-content {
    flex: 1;
    max-width: 640px;
    border-left: 1px solid #333;
    border-right: 1px solid #333;
    min-height: 100vh;
}

body:not(.dark-mode) .discourse-main-content {
    border-left-color: #ddd;
    border-right-color: #ddd;
}

/* ============================================
   2. NAVIGATION HEADERS & TABS
   ============================================ */

.discourse-tabs {
    display: flex;
    border-bottom: 1px solid #333;
    position: sticky;
    top: 80px;
    background: rgba(22, 22, 22, 0.95);
    z-index: 100;
    backdrop-filter: blur(10px);
}

body:not(.dark-mode) .discourse-tabs {
    border-bottom-color: #ddd;
    background: rgba(255, 255, 255, 0.95);
}

.admin-bar .discourse-tabs {
    top: 112px;
}

.discourse-tab {
    flex: 1;
    padding: 20px 16px;
    text-align: center;
    font-size: 15px;
    font-weight: 700;
    color: #666;
    cursor: pointer;
    position: relative;
    transition: all 0.2s;
    background: transparent;
}

.discourse-tab:hover {
    background: rgba(255, 152, 1, 0.05);
    color: #ff9801;
}

.discourse-tab.active { color: #ff9801; }

.discourse-tab-indicator { display: none; }

.discourse-tab.active .discourse-tab-indicator {
    display: block;
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 3px;
    background: #ff9801;
}

/* Single-post / Profile sticky header */
.discourse-single-header,
.discourse-profile-header {
    border-bottom: 1px solid #333;
    padding: 20px;
    position: relative;
    background: transparent;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 32px;
}

body:not(.dark-mode) .discourse-single-header,
body:not(.dark-mode) .discourse-profile-header {
    border-bottom-color: #ddd;
    background: rgba(255, 255, 255, 0.85);
}

.discourse-back-btn {
    background: none;
    border: none;
    color: #aaa;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

body:not(.dark-mode) .discourse-back-btn { color: #555; }

.discourse-back-btn:hover {
    background: rgba(255, 152, 1, 0.1);
    color: #ff9801;
}

.discourse-back-btn svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

.discourse-single-header h1,
.discourse-profile-header-info h1 {
    color: #aaa;
    font-size: 20px;
    margin: 0;
    font-weight: 700;
}

body:not(.dark-mode) .discourse-single-header h1,
body:not(.dark-mode) .discourse-profile-header-info h1 { color: #555; }

.discourse-profile-header-info { flex: 1; }

.discourse-profile-header-info span {
    color: #666;
    font-size: 13px;
    display: block;
    margin-top: 2px;
}

/* ============================================
   3. POST COMPOSER (HOME)
   ============================================ */

.discourse-post-box {
    display: flex;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid #333;
}

body:not(.dark-mode) .discourse-post-box { border-bottom-color: #e6e6e6; }

.discourse-post-input-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.discourse-post-input {
    width: 100%;
    min-height: 60px;
    max-height: 300px;
    background: transparent;
    border: none;
    color: #aaa;
    font-size: 18px;
    font-family: inherit;
    resize: none;
    outline: none;
    padding: 0;
    overflow-y: auto;
}

body:not(.dark-mode) .discourse-post-input { color: #333; }
.discourse-post-input::placeholder { color: #666; }

.discourse-post-input::-webkit-scrollbar,
.discourse-composer-textarea::-webkit-scrollbar,
#global-composer-textarea::-webkit-scrollbar { width: 6px; }

.discourse-post-input::-webkit-scrollbar-track,
.discourse-composer-textarea::-webkit-scrollbar-track,
#global-composer-textarea::-webkit-scrollbar-track { background: transparent; }

.discourse-post-input::-webkit-scrollbar-thumb,
.discourse-composer-textarea::-webkit-scrollbar-thumb,
#global-composer-textarea::-webkit-scrollbar-thumb { background: rgba(255,152,1,0.3); border-radius: 0; }

.discourse-post-input::-webkit-scrollbar-thumb:hover,
.discourse-composer-textarea::-webkit-scrollbar-thumb:hover,
#global-composer-textarea::-webkit-scrollbar-thumb:hover { background: rgba(255,152,1,0.5); }

.discourse-post-actions-bottom {
    display: flex !important;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #333;
    flex-direction: row !important;
    margin-left: 0 !important;
}

body:not(.dark-mode) .discourse-post-actions-bottom { border-top-color: #e6e6e6; }

.discourse-post-icons { display: flex; gap: 4px; margin-left: 0; }

.discourse-icon-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: #ff9801;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.discourse-icon-btn:hover { background: rgba(255,152,1,0.1); }

.discourse-icon-btn svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

.discourse-post-right {
    display: flex !important;
    align-items: center;
    gap: 12px;
    flex-direction: row !important;
}

.discourse-post-btn,
.discourse-reply-btn {
    background: #ff9801;
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 0;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: background 0.2s;
}

.discourse-post-btn:hover,
.discourse-reply-btn:hover { background: #e67e00; }

.discourse-post-btn:disabled,
.discourse-reply-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* Global composer post button and floating post/write button */
#global-composer-post-btn,
#global-post-button,
#discourse-post-btn,
.discourse-composer-btn,
.discourse-nav-post-btn {
    background: #ff9801 !important;
    color: white !important;
    border: none !important;
}
#global-composer-post-btn:hover,
#global-post-button:hover,
#discourse-post-btn:hover,
.discourse-composer-btn:hover,
.discourse-nav-post-btn:hover {
    background: #e67e00 !important;
}
#global-composer-post-btn:disabled,
#discourse-post-btn:disabled,
.discourse-composer-btn:disabled {
    opacity: 0.5 !important;
    cursor: not-allowed !important;
}

/* ============================================
   4. CHARACTER COUNTER
   ============================================ */

.discourse-char-counter {
    display: none !important;
    align-items: center !important;
    gap: 8px !important;
    flex-direction: row !important;
}

.discourse-char-counter.show {
    display: flex !important;
    flex-direction: row !important;
}

.discourse-char-circle {
    width: 30px !important;
    height: 30px !important;
    position: relative !important;
    flex-shrink: 0 !important;
}

.discourse-char-circle svg {
    width: 30px;
    height: 30px;
    transform: rotate(-90deg);
}

.discourse-char-circle circle {
    fill: none;
    stroke: #333;
    stroke-width: 2;
}

body:not(.dark-mode) .discourse-char-circle circle:not(.progress) { stroke: #e0e0e0; }

.discourse-char-circle circle.progress {
    stroke: #ff9801;
    stroke-dasharray: 84.26;
    stroke-dashoffset: 0;
    transition: stroke-dashoffset 0.2s, stroke 0.2s;
}

/* Warning/danger states removed — circle stays orange */

.discourse-char-divider {
    width: 1px !important;
    height: 24px !important;
    background: #444 !important;
    flex-shrink: 0 !important;
}

body:not(.dark-mode) .discourse-char-divider { background: #ccc !important; }

.discourse-char-count {
    color: #666 !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    min-width: 30px !important;
    text-align: left !important;
}

/* Warning/danger states removed */

/* ============================================
   5. POST CARDS (FEED VIEW)
   ============================================ */

.discourse-feed { border-top: 0; }

.discourse-post {
    border-bottom: 1px solid #333;
    padding: 16px 20px;
    transition: background 0.2s;
    cursor: pointer;
    position: relative;
    z-index: 0;
}

body:not(.dark-mode) .discourse-post { border-bottom-color: #ddd; }
.discourse-post:hover { background: rgba(255,152,1,0.02); }

.discourse-post-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255,152,1,0.3);
    cursor: pointer;
    transition: border-color 0.2s;
    flex-shrink: 0;
    position: relative !important;
    z-index: 10 !important;
    background: #1a1a1a;
    pointer-events: auto !important;
}

body:not(.dark-mode) .discourse-post-avatar { background: #fff; }
.discourse-post-avatar:hover { border-color: #ff9801; }

.discourse-post-avatar-container {
    position: relative;
    z-index: 10 !important;
    pointer-events: none !important;
}

.discourse-post-content-wrapper { display: flex; gap: 12px; }

.discourse-post-main { flex: 1; min-width: 0; }

.discourse-post-header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
    flex-wrap: wrap;
}

.discourse-post-author {
    color: #aaa;
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
    transition: color 0.2s;
}

body:not(.dark-mode) .discourse-post-author { color: #555; }
.discourse-post-author:hover { color: #ff9801 !important; text-decoration: none; }

.discourse-post-username,
.discourse-post-time,
.discourse-post-dot { color: #666; font-size: 15px; }

.discourse-post-text {
    color: #aaa;
    font-size: 15px;
    line-height: 1.5;
    margin-bottom: 12px;
    white-space: pre-wrap;
    word-wrap: break-word;
}

body:not(.dark-mode) .discourse-post-text { color: #555; }

.discourse-pinned-header {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #666;
    font-size: 13px;
    font-weight: 600;
    padding: 0 0 8px 0;
}

.discourse-pinned-header svg { fill: currentColor; }

.discourse-post-headers { display: flex; flex-direction: column; gap: 4px; }

/* ============================================
   6. POST ACTION BUTTONS
   ============================================ */

.discourse-post-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0;
    margin-top: 12px;
    padding: 0;
    width: 100% !important;
}

.discourse-post-action {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #666;
    cursor: pointer;
    transition: color 0.2s;
    position: relative;
    padding: 8px 12px;
    border-radius: 4px;
    justify-content: center;
    flex: 1 !important;
    min-width: 60px !important;
}

@media (hover: hover) { .discourse-post-action:hover { color: #ff9801; } }


.discourse-post-action-icon {
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.discourse-post-action-icon svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.discourse-post-action span {
    font-size: 13px;
    font-weight: 500;
    min-width: 10px !important;
    display: inline-block !important;
}

.discourse-post-action::before,
.discourse-expand-replies::before,
.discourse-avatar-expand::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(8px);
    background: rgba(255,152,1,0.15);
    color: #ff9801;
    padding: 4px 8px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s, transform 0.2s;
    z-index: 1000;
    border: 1px solid rgba(255,152,1,0.3);
}

.discourse-post-action:hover::before,
.discourse-expand-replies:hover::before,
.discourse-avatar-expand:hover::before {
    opacity: 1;
    transform: translateX(-50%) translateY(-4px);

}

/* ============================================
   7. MORE MENU & POST OPTIONS DROPDOWN
   ============================================ */

.discourse-post-more {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 50%;
    transition: all 0.2s;
    color: #666;
    border: none;
    background: none;
}

.discourse-post-more:hover { background: rgba(255,152,1,0.1); color: #ff9801; }
.discourse-post-more svg { width: 18px; height: 18px; fill: currentColor; }

.discourse-more-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 50%;
    border: none;
    background: none;
    color: rgb(113, 118, 123);
    transition: all 0.2s;
    z-index: 5;
}
.discourse-more-btn:hover { background: rgba(255,152,1,0.1); color: #ff9801; }
.discourse-more-btn svg { width: 18px; height: 18px; fill: currentColor; }

.discourse-post-options-dropdown {
    position: fixed;
    background: #1a1a1a;
    border: 1px solid #333;
    box-shadow: 0 4px 16px rgba(0,0,0,0.5);
    z-index: 999999;
    min-width: 200px;
    padding: 0;
    overflow: hidden;
}

.discourse-post-options-dropdown .discourse-post-option:first-child {
    margin-top: 0 !important;
    padding-top: 0 !important;
}
.discourse-post-options-dropdown .discourse-post-option:last-child {
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
}

body:not(.dark-mode) .discourse-post-options-dropdown {
    background: #fff;
    border-color: #ddd;
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

.discourse-post-option {
    padding: 0 16px;
    height: 40px;
    box-sizing: border-box;
    cursor: pointer;
    color: rgb(170, 170, 170);
    font-family: Nunito, sans-serif;
    font-size: 14px;
    font-weight: 600;
    line-height: 20px;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    gap: 12px;
}
body:not(.dark-mode) .discourse-post-option { color: rgb(170, 170, 170); }
.discourse-post-option:hover { background: rgba(255, 152, 1, 0.10); }
.discourse-post-option.danger { color: rgb(170, 170, 170); }
.discourse-post-option-icon svg { width: 18px; height: 18px; fill: currentColor; }

.discourse-more-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 4px;
    background: #000;
    border: 1px solid #333;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
    z-index: 1000;
    min-width: 200px;
    display: none;
}

body:not(.dark-mode) .discourse-post-option {
    color: rgb(51, 51, 51) !important;
}
body:not(.dark-mode) .discourse-post-option.danger {
    color: rgb(51, 51, 51) !important;
}
body:not(.dark-mode) .discourse-post-option-icon {
    color: rgb(51, 51, 51);
}
body:not(.dark-mode) .discourse-post-option-icon svg {
    fill: rgb(51, 51, 51);
}

body:not(.dark-mode) .discourse-more-menu {
    background: #fff;
    border-color: #ddd;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.discourse-more-menu.show { display: block; }

.discourse-more-menu-item {
    padding: 12px 16px;
    cursor: pointer;
    color: #aaa;
    font-size: 15px;
    font-weight: 600;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    gap: 12px;
}

body:not(.dark-mode) .discourse-more-menu-item { color: #555; }
.discourse-more-menu-item:hover { background: rgba(255,152,1,0.1); }
.discourse-more-menu-item.danger { color: #dc5064; }
.discourse-more-menu-item svg { width: 18px; height: 18px; fill: currentColor; }

/* ============================================
   8. SINGLE POST VIEW (EXPANDED)
   ============================================ */

.discourse-main-post {
    padding: 16px 20px;
    position: relative;
    border-bottom: 1px solid #333;
}

body:not(.dark-mode) .discourse-main-post { border-bottom-color: #ddd; }

.discourse-main-post-author {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.discourse-main-post-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255,152,1,0.3);
    cursor: pointer;
    transition: border-color 0.2s;
}

.discourse-main-post-avatar:hover { border-color: #ff9801; }

.discourse-main-post-author-info { flex: 1; }

.discourse-main-post-name {
    color: #aaa;
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
    transition: color 0.2s;
}

body:not(.dark-mode) .discourse-main-post-name { color: #555; }
.discourse-main-post-name:hover { color: #ff9801 !important; text-decoration: none; }

.discourse-main-post-username { color: #666; font-size: 15px; }

.discourse-main-post-content {
    color: #aaa;
    font-size: 23px;
    line-height: 1.5;
    margin-bottom: 16px;
    white-space: pre-wrap;
    word-wrap: break-word;
}

body:not(.dark-mode) .discourse-main-post-content { color: #555; }

.discourse-main-post-content.discourse-post-text {
    font-size: 17px;
    line-height: 1.6;
}

.discourse-main-post-timestamp { color: #666; font-size: 15px; margin-bottom: 16px; }

.discourse-main-post-actions {
    display: flex;
    align-items: center;
    justify-content: space-around;
    padding: 16px 0;
    border-top: 1px solid #333;
    border-bottom: 1px solid #333;
}

body:not(.dark-mode) .discourse-main-post-actions {
    border-top-color: #ddd;
    border-bottom-color: #ddd;
}

.discourse-main-post-actions .discourse-post-action {
    flex: 1;
    justify-content: center;
}

.discourse-main-post-actions .discourse-post-action-icon svg,
.discourse-main-post-actions .discourse-post-action > svg {
    width: 18px !important;
    height: 18px !important;
    fill: currentColor;
}

/* ============================================
   9. REPLY COMPOSER
   ============================================ */

.discourse-reply-composer {
    padding: 16px 20px;
    border-bottom: 1px solid #333;
}

body:not(.dark-mode) .discourse-reply-composer { border-bottom-color: #ddd; }

.discourse-reply-form { display: flex; align-items: flex-start; gap: 12px; }

.discourse-reply-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255,152,1,0.3);
    flex-shrink: 0;
}

.discourse-reply-content { flex: 1; }

.discourse-reply-textarea {
    width: 100%;
    min-height: 80px;
    background: transparent;
    border: none;
    color: #aaa;
    font-size: 15px;
    line-height: 1.5;
    font-family: inherit;
    resize: none;
    outline: none;
    padding: 12px 0;
}

body:not(.dark-mode) .discourse-reply-textarea { color: #555; }
.discourse-reply-textarea::placeholder { color: #666; }

.discourse-reply-indicator {
    background: rgba(255,152,1,0.1);
    border-left: 4px solid #ff9801;
    padding: 12px;
    margin-bottom: 12px;
    color: #ff9801;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.discourse-reply-context {
    padding: 12px 16px 4px 16px;
    background: transparent;
    margin-left: 56px;
}

.discourse-reply-context-text { color: #71767b; font-size: 15px; }
.discourse-reply-context-text .reply-context-handle { color: #ff9801; cursor: pointer; }
.discourse-reply-context-text .reply-context-handle:not(.reply-context-handle-deleted):hover { text-decoration: underline; }
body:not(.dark-mode) .discourse-reply-context-text { color: #536471; }

/* ============================================
   10. REPLIES SECTION
   ============================================ */

.discourse-reply {
    padding: 16px 20px;
    border-bottom: 1px solid #333;
    transition: background 0.2s;
    cursor: pointer;
}

body:not(.dark-mode) .discourse-reply { border-bottom-color: #ddd; }
.discourse-reply:hover { background: rgba(255,152,1,0.02); }

.discourse-reply-wrapper { display: flex; gap: 12px; }

.discourse-reply-avatar-small {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255,152,1,0.3);
    cursor: pointer;
    flex-shrink: 0;
    transition: border-color 0.2s;
}

.discourse-reply-avatar-small:hover { border-color: #ff9801; }

.discourse-reply-main { flex: 1; min-width: 0; }

.discourse-reply-header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
    flex-wrap: wrap;
}

.discourse-reply-author {
    color: #aaa;
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
    transition: color 0.2s;
}

body:not(.dark-mode) .discourse-reply-author { color: #555; }
.discourse-reply-author:hover { color: #ff9801 !important; text-decoration: none; }

.discourse-reply-username,
.discourse-reply-time,
.discourse-reply-dot { color: #666; font-size: 15px; }

.discourse-reply-text {
    color: #aaa;
    font-size: 15px;
    line-height: 1.5;
    margin-bottom: 8px;
    white-space: pre-wrap;
    word-wrap: break-word;
}

body:not(.dark-mode) .discourse-reply-text { color: #555; }

.discourse-reply-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
    padding-right: 54px;
}

/* ============================================
   11. PARENT CONTEXT (THREAD ORIGIN)
   ============================================ */

.discourse-parent-context {
    border-bottom: none;
    cursor: pointer;
    transition: background 0.2s;
    padding-top: 16px;
    position: relative;
}

.discourse-parent-context:hover { background: rgba(255,152,1,0.03); }

.discourse-parent-context-header {
    padding: 0 20px 8px 20px;
    display: flex;
    align-items: center;
    color: #666;
    font-size: 13px;
    font-weight: 600;
}

.discourse-parent-post {
    padding: 8px 20px 20px 20px;
    opacity: 0.7;
    position: relative;
}

.discourse-parent-post-wrapper { display: flex; gap: 12px; align-items: flex-start; }

.discourse-parent-avatar-container {
    position: absolute;
    left: 20px;
    top: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.discourse-parent-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255,152,1,0.3);
    flex-shrink: 0;
    z-index: 2;
    position: relative;
    background: #1a1a1a;
    transition: border-color 0.2s;
}

body:not(.dark-mode) .discourse-parent-avatar { background: #fff; }
.discourse-parent-avatar:hover { border-color: #ff9801; }

.discourse-parent-line {
    width: 2px;
    background: #555;
    position: absolute;
    top: 53px;
    left: 23px;
    transition: background 0.2s;
    z-index: 1;
}

body:not(.dark-mode) .discourse-parent-line { background: #cfd9de; }

.discourse-parent-main { flex: 1; min-width: 0; margin-left: 60px; }

.discourse-parent-header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.discourse-parent-author {
    color: #aaa;
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
    transition: color 0.2s;
}

.discourse-parent-author:hover { color: #ff9801 !important; }

.discourse-parent-username,
.discourse-parent-dot,
.discourse-parent-time { color: #666; font-size: 15px; }

.discourse-parent-text {
    color: #aaa;
    font-size: 15px;
    line-height: 1.5;
    white-space: pre-wrap;
    word-wrap: break-word;
    margin-bottom: 12px;
}

.discourse-parent-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
    padding-right: 54px;
}

.discourse-parent-actions .discourse-post-action {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #666;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    padding: 8px 12px;
    border-radius: 4px;
}

.discourse-parent-actions .discourse-post-action:hover {
    color: #ff9801;
    background: rgba(255,152,1,0.1);
}

/* ============================================
   12. NESTED REPLIES (FEED & SINGLE POST)
   ============================================ */

.discourse-feed-nested-replies {
    margin: 0 !important;
    padding: 0 !important;
    position: relative;
    margin-left: -20px !important;
    margin-right: -20px !important;
    width: calc(100% + 40px) !important;
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transition: max-height 0.3s ease, opacity 0.3s ease;
}

.discourse-feed-nested-replies.expanded {
    max-height: 5000px;
    opacity: 1;
}

.discourse-nested-reply {
    padding: 16px 20px !important;
    margin: 0 !important;
    cursor: pointer;
    transition: background 0.2s;
    position: relative;
    display: flex !important;
    gap: 12px !important;
    align-items: flex-start !important;
    border-bottom: none !important;
    border: none !important;
}

.discourse-nested-reply:hover { background: rgba(255,152,1,0.02) !important; }

.discourse-nested-reply.depth-1 { display: flex; flex-wrap: wrap; }

.discourse-nested-avatar-container {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-shrink: 0;
    width: 48px !important;
}

.discourse-nested-avatar {
    width: 48px !important;
    height: 48px !important;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255,152,1,0.3);
    cursor: pointer;
    transition: border-color 0.2s;
    background: #1a1a1a;
    z-index: 10 !important;
    position: relative !important;
    pointer-events: auto !important;
}

body:not(.dark-mode) .discourse-nested-avatar { background: #fff !important; }
.discourse-nested-avatar:hover { border-color: #ff9801 !important; }

.discourse-nested-main {
    flex: 1 !important;
    min-width: 0 !important;
    max-width: 100% !important;
}

.discourse-nested-header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.discourse-nested-author {
    color: #aaa;
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
    transition: color 0.2s;
}

body:not(.dark-mode) .discourse-nested-author { color: #0f1419; }
.discourse-nested-author:hover { color: #ff9801 !important; }

.discourse-nested-username,
.discourse-nested-dot,
.discourse-nested-time { color: #71767b; font-size: 15px; }

.discourse-nested-text {
    color: #aaa;
    font-size: 15px;
    line-height: 1.5;
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-wrap: break-word;
    margin-bottom: 12px;
    width: 100% !important;
}

body:not(.dark-mode) .discourse-nested-text { color: #0f1419; }

.discourse-nested-actions {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    gap: 0 !important;
    padding-right: 0 !important;
    width: 100% !important;
}

.discourse-nested-actions .discourse-post-action {
    padding: 8px 12px !important;
    margin: 0 !important;
    box-sizing: border-box !important;
    flex: 1 1 0% !important;
    min-width: 60px !important;
}

.discourse-nested-actions .discourse-post-action span {
    min-width: 10px !important;
    display: inline-block !important;
}

.discourse-post-action span:empty {
    display: inline-block !important;
    min-width: 10px !important;
}

.discourse-nested-replies-container.depth-2-container {
    flex-basis: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    margin-left: -20px !important;
    margin-right: -20px !important;
    width: calc(100% + 40px) !important;
    min-width: calc(100% + 40px) !important;
    max-width: calc(100% + 40px) !important;
    position: relative !important;
    box-sizing: border-box !important;
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transition: max-height 0.3s ease, opacity 0.3s ease;
}

.discourse-nested-replies-container.depth-2-container.expanded {
    max-height: 5000px;
    opacity: 1;
}

.depth-2-container > .discourse-nested-reply {
    width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    box-sizing: border-box !important;
}

.depth-2-container .discourse-nested-avatar-container {
    width: 48px !important;
    margin-left: 0 !important;
}

.depth-2-container .discourse-nested-main {
    display: block !important;
    width: 100% !important;
}

.depth-2-container .discourse-nested-actions {
    margin: 0 !important;
    padding: 0 !important;
    padding-right: 12px !important;
    box-sizing: border-box !important;
}

/* ============================================
   13. CONNECTOR LINES
   ============================================ */

.discourse-connector-line {
    position: absolute;
    width: 2px;
    background: #555;
    z-index: 1;
}

body:not(.dark-mode) .discourse-connector-line { background: #cfd9de; }

.discourse-nested-reply:hover ~ .discourse-connector-line,
.discourse-post:hover ~ .discourse-feed-nested-replies .discourse-connector-line,
.discourse-parent-context:hover .discourse-parent-line,
.discourse-main-post:hover ~ .discourse-parent-context .discourse-parent-line {
    background-color: #ff9801 !important;
    opacity: 0.8;
}

.discourse-replies-wrapper,
#main-post-container { position: relative; }

.connector-line-container {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none;
    z-index: 5 !important;
}

.connector-line-unified {
    position: absolute;
    cursor: pointer;
    transition: height 0.3s ease;
    pointer-events: auto !important;
    background: transparent;
    z-index: 5 !important;
    overflow: hidden;
}

.connector-line-segment {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    pointer-events: none;
    transition: opacity 0.4s ease, background-color 0.2s ease;
}

.connector-line-unified:hover .connector-line-segment { background-color: #ff9801 !important; }

.connector-line-tooltip {
    position: fixed;
    background: rgba(255,152,1,0.15);
    color: #ff9801;
    padding: 4px 8px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    pointer-events: none;
    z-index: 10000;
    border: 1px solid rgba(255,152,1,0.3);
    display: none;
}

/* ============================================
   14. EXPAND & AVATAR-EXPAND BUTTONS
   ============================================ */

.discourse-expand-replies {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 34px !important;
    height: 34px !important;
    padding: 0 !important;
    margin: 0 4px 0 0 !important;
    background: none !important;
    border: none !important;
    border-radius: 50% !important;
    cursor: pointer !important;
    transition: background 0.2s !important;
    flex-shrink: 0 !important;
    position: relative !important;
}

.discourse-expand-replies:hover { background: rgba(255,152,1,0.1) !important; }
body:not(.dark-mode) .discourse-expand-replies:hover { background: rgba(29,161,242,0.1) !important; }

.discourse-expand-icon {
    width: 18px !important;
    height: 18px !important;
    fill: #71767b !important;
    transition: transform 0.2s, fill 0.2s !important;
}

.discourse-expand-replies:hover .discourse-expand-icon { fill: #ff9801 !important; }
body:not(.dark-mode) .discourse-expand-replies:hover .discourse-expand-icon { fill: #1da1f2 !important; }
.discourse-expand-replies.expanded .discourse-expand-icon { transform: rotate(180deg) !important; }
.discourse-expand-replies.loading .discourse-expand-icon { animation: spin 1s linear infinite !important; }

@keyframes spin {
    0%   { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.discourse-avatar-expand {
    position: absolute;
    top: 60px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 20px;
    background: transparent;
    border: none;
    display: flex !important;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 100 !important;
    padding: 0;
    pointer-events: auto !important;
    visibility: visible !important;
}

.discourse-avatar-expand svg {
    width: 16px;
    height: 16px;
    fill: none;
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
}

.discourse-avatar-expand svg line {
    stroke: #888;
    stroke-width: 2.5;
    transition: stroke 0.2s;
}

body:not(.dark-mode) .discourse-avatar-expand svg line { stroke: #666; }
.discourse-avatar-expand:hover svg line,
body:not(.dark-mode) .discourse-avatar-expand:hover svg line { stroke: #ff9801; }

.discourse-avatar-expand.expanded svg {
    opacity: 0 !important;
    pointer-events: none;
    transition: opacity 0.2s;
}

.discourse-avatar-expand.collapsing svg {
    opacity: 0 !important;
    transition: opacity 0.2s 0.3s;
}

.discourse-avatar-expand::before {
    transform: translateX(-50%);
    margin-bottom: 0;
    bottom: auto;
    top: -10px;
}

.discourse-avatar-expand:not(.expanded):hover::before { opacity: 1; }
.discourse-avatar-expand.expanded::before { display: none !important; }

.discourse-avatar-expand.expanded .horizontal {
    animation: hideHorizontal 0.2s ease forwards;
}

@keyframes hideHorizontal {
    0%   { opacity: 1; transform: scaleX(1); }
    100% { opacity: 0; transform: scaleX(0); }
}

.discourse-avatar-expand.collapsing .horizontal {
    animation: showHorizontal 0.2s ease forwards 0.3s;
}

@keyframes showHorizontal {
    0%   { opacity: 0; transform: scaleX(0); }
    100% { opacity: 1; transform: scaleX(1); }
}



/* ============================================
   15. NESTED REPLY ANIMATIONS
   ============================================ */

.depth-2-container .discourse-nested-reply {
    animation: slideInFromTop 0.3s ease-out forwards;
    opacity: 0;
}

.depth-2-container .discourse-nested-reply:nth-child(1) { animation-delay: 0s; }
.depth-2-container .discourse-nested-reply:nth-child(2) { animation-delay: 0.05s; }
.depth-2-container .discourse-nested-reply:nth-child(3) { animation-delay: 0.1s; }
.depth-2-container .discourse-nested-reply:nth-child(4) { animation-delay: 0.15s; }
.depth-2-container .discourse-nested-reply:nth-child(5) { animation-delay: 0.2s; }

@keyframes slideInFromTop {
    0%   { opacity: 0; transform: translateY(-10px); }
    100% { opacity: 1; transform: translateY(0); }
}

.discourse-feed-nested-replies .discourse-nested-reply {
    animation: slideInFromTopFeed 0.3s ease-out forwards;
    opacity: 0;
    transform-origin: top;
}

.discourse-feed-nested-replies .discourse-nested-reply:nth-child(1) { animation-delay: 0.1s; }
.discourse-feed-nested-replies .discourse-nested-reply:nth-child(2) { animation-delay: 0.15s; }
.discourse-feed-nested-replies .discourse-nested-reply:nth-child(3) { animation-delay: 0.2s; }
.discourse-feed-nested-replies .discourse-nested-reply:nth-child(4) { animation-delay: 0.25s; }
.discourse-feed-nested-replies .discourse-nested-reply:nth-child(5) { animation-delay: 0.3s; }

@keyframes slideInFromTopFeed {
    0%   { opacity: 0; transform: translateY(-8px) scaleY(0.8); }
    100% { opacity: 1; transform: translateY(0) scaleY(1); }
}

.discourse-post.depth-1-with-replies { border-bottom: none !important; }

.discourse-post.has-expanded-replies {
    border-bottom: 1px solid #333 !important;
}

body:not(.dark-mode) .discourse-post.has-expanded-replies {
    border-bottom-color: #ddd !important;
}

.discourse-post:last-child { border-bottom: none !important; }

/* ============================================
   16. SINGLE-PAGE BORDER RULES
   ============================================ */

#replies-wrapper > .discourse-nested-reply.depth-1 {
    border-bottom: 1px solid #333 !important;
}

body:not(.dark-mode) #replies-wrapper > .discourse-nested-reply.depth-1 {
    border-bottom-color: #ddd !important;
}

#replies-wrapper > .discourse-nested-reply.depth-1:last-child,
#replies-wrapper > .discourse-nested-reply.depth-1.has-expanded-replies:last-child {
    border-bottom: none !important;
}

.discourse-feed-nested-replies .discourse-nested-reply {
    border: none !important;
}

/* ============================================
   17. PROFILE PAGE — USER INFO
   ============================================ */

.discourse-profile-banner {
    width: 100%;
    height: 200px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    background-size: cover;
    background-position: center;
    position: relative;
    cursor: pointer;
    transition: opacity 0.2s;
}

.discourse-profile-banner:hover { opacity: 0.95; }
body.dark-mode .discourse-profile-banner { background: linear-gradient(135deg, #434343 0%, #000 100%); }

.discourse-profile-info-section {
    padding: 0 20px 20px 20px;
    margin-top: -60px;
    position: relative;
    border-bottom: 1px solid #eff3f4;
}

body.dark-mode .discourse-profile-info-section { border-bottom-color: #2f3336; }

.discourse-profile-avatar-large {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 4px solid #ffffff;
    margin-bottom: 15px;
    object-fit: cover;
    cursor: pointer;
    transition: all 0.3s;
}

body.dark-mode .discourse-profile-avatar-large { border-color: #161616; }

.discourse-profile-avatar-large:hover {
    border-color: #ff9801 !important;
    box-shadow: 0 0 20px rgba(255,152,1,0.6);
    transform: scale(1.05);
}

.discourse-profile-names { margin-bottom: 15px; }

.discourse-profile-display-name-large {
    font-size: 20px;
    font-weight: bold;
    color: #0f1419;
    margin: 0 0 4px 0;
}

body.dark-mode .discourse-profile-display-name-large { color: #e7e9ea; }

.discourse-profile-username-large {
    font-size: 15px;
    color: #536471;
    display: block;
    margin-bottom: 12px;
}

body.dark-mode .discourse-profile-username-large { color: #71767b; }

.discourse-profile-bio {
    font-size: 15px;
    color: #0f1419;
    line-height: 1.5;
    margin-bottom: 15px;
    white-space: pre-wrap;
    word-wrap: break-word;
}

body.dark-mode .discourse-profile-bio { color: #e7e9ea; }

.discourse-profile-bio:empty::before {
    content: "No bio yet";
    color: #71767b;
    font-style: italic;
}

.discourse-profile-stats-bar {
    display: flex;
    gap: 20px;
    margin: 15px 0;
}

.discourse-profile-stat { font-size: 14px; color: #536471; }
body.dark-mode .discourse-profile-stat { color: #71767b; }

.discourse-profile-stat strong {
    color: #0f1419;
    font-weight: bold;
    margin-right: 4px;
}

body.dark-mode .discourse-profile-stat strong { color: #e7e9ea; }

.discourse-profile-actions { display: flex; gap: 12px; }

.discourse-follow-btn-main {
    background: #ff9801;
    color: white;
    border: 1px solid transparent;
    padding: 8px 24px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
    width: 120px;
    text-align: center;
    box-sizing: border-box;
    white-space: nowrap;
    overflow: hidden;
}

.discourse-follow-btn-main:hover { background: #e67e00; }
.discourse-follow-btn-main:disabled { opacity: 0.6; cursor: not-allowed; }

.discourse-follow-btn-main.following {
    background: transparent;
    border: 1px solid #536471;
    color: #0f1419;
}

body.dark-mode .discourse-follow-btn-main.following { color: #e7e9ea; }

.discourse-follow-btn-main.following:hover {
    background: rgba(244,33,46,0.1);
    border-color: rgba(244,33,46,0.4);
    color: #f4212e;
}

.discourse-edit-profile-btn {
    background: transparent;
    color: #ff9801;
    border: 2px solid #ff9801;
    padding: 10px 24px;
    font-size: 15px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
}

.discourse-edit-profile-btn:hover { background: rgba(255,152,1,0.1); }

.discourse-profile-tabs {
    display: flex;
    border-bottom: 1px solid #333;
    position: sticky;
    top: 80px;
    background: rgba(22, 22, 22, 0.95);
    z-index: 100;
    backdrop-filter: blur(10px);
}

body:not(.dark-mode) .discourse-profile-tabs {
    border-bottom-color: #ddd;
    background: rgba(255, 255, 255, 0.95);
}

.admin-bar .discourse-profile-tabs {
    top: 112px;
}

.discourse-profile-tab {
    flex: 1;
    text-align: center;
    padding: 16px;
    cursor: pointer;
    position: relative;
    color: #666;
    font-size: 15px;
    font-weight: 600;
    transition: all 0.2s;
}

.discourse-profile-tab:hover { background: rgba(255,152,1,0.05); color: #ff9801; }
.discourse-profile-tab.active { color: #ff9801; }

.discourse-profile-tab-indicator {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 4px;
    background: #ff9801;
    opacity: 0;
    transition: opacity 0.2s;
}

.discourse-profile-tab.active .discourse-profile-tab-indicator { opacity: 1; }

/* ============================================
   18. EDIT PROFILE MODAL
   ============================================ */

.discourse-edit-modal {
    display: none !important;
    position: fixed !important;
    top: 0 !important; left: 0 !important;
    width: 100vw !important; height: 100vh !important;
    background: none !important;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    z-index: 999999;
    align-items: center !important;
    justify-content: center !important;
    flex-direction: row !important;
    pointer-events: none;
    margin: 0 !important;
    padding: 0 !important;
    max-width: none !important;
    max-height: none !important;
}

.discourse-edit-modal.show {
    display: flex !important;
}

.discourse-edit-modal-content {
    background: #1a1a1a;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    border: 1px solid #444;
    margin: auto;
    pointer-events: auto;
}

body:not(.dark-mode) .discourse-edit-modal-content {
    background: #fff;
    border-color: #ddd;
}

.discourse-edit-modal-content::-webkit-scrollbar { width: 8px; }
.discourse-edit-modal-content::-webkit-scrollbar-track { background: transparent; }
.discourse-edit-modal-content::-webkit-scrollbar-thumb { background: rgba(255,152,1,0.3); }
.discourse-edit-modal-content::-webkit-scrollbar-thumb:hover { background: rgba(255,152,1,0.5); }

.discourse-edit-modal > .discourse-edit-modal-content > .discourse-edit-modal-header {
    padding: 15px 20px;
    border-bottom: 1px solid #444;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    background: #1a1a1a;
    z-index: 10;
}

body:not(.dark-mode) .discourse-edit-modal > .discourse-edit-modal-content > .discourse-edit-modal-header {
    border-bottom-color: #ddd;
    background: #fff;
}

.discourse-edit-modal > .discourse-edit-modal-content > .discourse-edit-modal-header h2 {
    color: #ff9801;
    font-size: 18px;
    font-weight: 600;
    margin: 0;
    flex: 1;
    text-align: center;
}

.discourse-edit-modal > .discourse-edit-modal-content .discourse-edit-modal-close {
    background: none;
    border: none;
    cursor: pointer;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s;
    padding: 0;
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #666;
}
.discourse-edit-modal > .discourse-edit-modal-content .discourse-edit-modal-close:hover {
    background: rgba(255, 152, 1,0.15);
    color: #666;
}
.discourse-edit-modal > .discourse-edit-modal-content .discourse-edit-modal-close svg {
    fill: #666;
    width: 20px;
    height: 20px;
}

.discourse-edit-modal > .discourse-edit-modal-content > .discourse-edit-modal-body {
    padding: 0;
}

.discourse-edit-banner-section {
    position: relative;
    margin-bottom: 100px;
    padding-bottom: 22px;
}

.discourse-edit-banner-preview {
    width: 100%;
    height: 200px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    background-size: cover;
    background-position: center;
    position: relative;
    transition: opacity 0.2s;
}

body.dark-mode .discourse-edit-banner-preview {
    background: linear-gradient(135deg, #434343 0%, #000 100%);
}

.discourse-banner-controls {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    gap: 15px;
    z-index: 5;
}

.discourse-banner-control-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(0,0,0,0.7);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    color: white;
}

.discourse-banner-control-btn:hover { background: rgba(0,0,0,0.9); transform: scale(1.1); }
.discourse-banner-control-btn svg { width: 22px; height: 22px; fill: currentColor; }

.discourse-edit-avatar-section {
    position: absolute;
    top: 140px; left: 25px;
    z-index: 10;
}

.discourse-edit-avatar-container {
    position: relative;
    width: 120px;
    height: 120px;
    margin-bottom: 12px;
}

.discourse-edit-avatar-preview {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 4px solid #1a1a1a;
    background: #1a1a1a;
    object-fit: cover;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    display: block;
}

body:not(.dark-mode) .discourse-edit-avatar-preview { border-color: #fff; background: #fff; }

.discourse-edit-avatar-preview:hover {
    border-color: #ff9801 !important;
    box-shadow: 0 0 20px rgba(255,152,1,0.6);
    transform: scale(1.05);
}

.discourse-edit-user-info { margin-top: 24px; margin-bottom: 12px; }
.discourse-edit-user-name { color: #ff9801; font-weight: 600; font-size: 18px; margin-bottom: 2px; }
.discourse-edit-user-handle { color: #666; font-size: 14px; margin-bottom: 0; }
body:not(.dark-mode) .discourse-edit-user-handle { color: #888; }

.discourse-edit-bio-section {
    padding: 15px 25px;
    clear: both;
    margin-top: 60px;
}

.discourse-edit-bio-textarea {
    width: 100%;
    min-height: 100px;
    background: rgba(128,128,128,0.1);
    border: 1px solid rgba(128,128,128,0.3);
    color: #aaa;
    font-size: 15px;
    line-height: 1.5;
    font-family: inherit;
    resize: vertical;
    padding: 12px;
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
}

body:not(.dark-mode) .discourse-edit-bio-textarea { color: #333; background: rgba(0,0,0,0.02); }

.discourse-edit-bio-textarea:focus {
    outline: none;
    border-color: #ff9801;
    box-shadow: 0 0 0 3px rgba(255,152,1,0.2);
}

.discourse-edit-bio-textarea::placeholder { color: #666; }

.discourse-edit-modal > .discourse-edit-modal-content > .discourse-edit-modal-footer {
    padding: 12px 25px 15px 25px;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    background: #1a1a1a;
}

body:not(.dark-mode) .discourse-edit-modal > .discourse-edit-modal-content > .discourse-edit-modal-footer {
    background: #fff;
}

.discourse-cancel-profile-btn {
    background: transparent;
    color: #888;
    border: 1px solid rgba(128,128,128,0.3);
    padding: 10px 24px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.discourse-cancel-profile-btn:hover { background: rgba(128,128,128,0.1); color: #aaa; }

.discourse-save-profile-btn {
    background: #ff9801;
    color: white;
    border: none;
    padding: 10px 24px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.discourse-save-profile-btn:hover { background: #e67e00; }
.discourse-save-profile-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.discourse-hidden-input,
input[type="file"].discourse-hidden-input { display: none !important; }

/* ============================================
   19. CROPPER MODAL
   ============================================ */

.discourse-crop-modal {
    display: none !important;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.9);
    z-index: 9999999;
    align-items: center;
    justify-content: center;
}

.discourse-crop-modal.show { display: flex !important; }

.discourse-crop-modal-content { border-radius: 0;
    background: #1a1a1a;
    padding: 30px;
    max-width: 700px;
    width: 90%;
    position: relative;
}

body:not(.dark-mode) .discourse-crop-modal-content { border-radius: 0; background: #fff; }

.discourse-crop-modal-content h2 {
    color: #ff9801;
    margin: 0 0 20px 0;
    text-align: center;
    font-size: 20px;
}

.discourse-crop-container {
    width: 100%;
    max-width: 600px;
    max-height: 400px;
    margin: 0 auto;
    overflow: hidden;
}

.discourse-crop-container img { max-width: 100%; display: block; }

.discourse-crop-actions { /* updated */ 
    display: flex;
    gap: 12px;
    justify-content: stretch;
    margin-top: 20px;
}

.discourse-crop-btn { flex: 1; border-radius: 0;
    padding: 10px 24px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}

.discourse-crop-cancel {
    background: transparent;
    color: #888;
    border: 1px solid rgba(128,128,128,0.3);
}

.discourse-crop-cancel:hover { background: rgba(128,128,128,0.1); }
.discourse-crop-save { background: #ff9801; color: white; }
.discourse-crop-save:hover { background: #e67e00; }

/* ============================================
   20. IMAGE MODALS (BANNER & AVATAR)
   ============================================ */

.discourse-banner-modal,
.discourse-avatar-modal {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.95);
    z-index: 10000;
    align-items: center;
    justify-content: center;
}

.discourse-banner-modal.show,
.discourse-avatar-modal.show { display: flex !important; }

.discourse-banner-modal-content,
.discourse-avatar-modal-content {
    position: relative;
    max-width: 95vw;
    max-height: 95vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.discourse-banner-modal-content img {
    max-width: 100%;
    max-height: 95vh;
    object-fit: contain;
    border: 6px solid #ff9801;
}

.discourse-avatar-modal-content img {
    max-width: 100%;
    max-height: 90vh;
    border-radius: 50%;
    border: 6px solid #ff9801;
    object-fit: cover;
}

.discourse-banner-modal-close,
.discourse-avatar-modal-close {
    position: absolute;
    top: -50px; right: -50px;
    background: #ff9801;
    color: white;
    border: none;
    width: 40px; height: 40px;
    font-size: 28px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    border-radius: 50%;
    line-height: 1;
    padding: 0;
}

.discourse-banner-modal-close:hover,
.discourse-avatar-modal-close:hover { background: #e67e00; }



/* ============================================
   22. LOADING & EMPTY STATES
   ============================================ */

.discourse-loading { text-align: center; padding: 40px; color: #888; font-size: 15px; }

.discourse-empty { text-align: center; padding: 60px 20px; }
.discourse-empty-icon { display: none; }
.discourse-empty h3 { color: #ff9801; font-size: 20px; margin-bottom: 10px; }
.discourse-empty p { color: #888; font-size: 15px; }

.discourse-no-replies { text-align: center; padding: 40px 20px; color: #666; font-size: 15px; }

.discourse-access-denied { text-align: center; padding: 60px 20px; }
.discourse-access-denied h2 { color: #ff9801; font-size: 24px; margin-bottom: 15px; }
.discourse-access-denied p { color: #888; font-size: 16px; line-height: 1.6; }

/* ============================================
   23. LOAD MORE BUTTON
   ============================================ */

.discourse-load-more {
    text-align: center;
    padding: 20px;
    border-top: 1px solid #333;
}

body:not(.dark-mode) .discourse-load-more { border-top-color: #ddd; }

.discourse-load-more-btn {
    background: transparent;
    border: 1px solid #ff9801;
    color: #ff9801;
    padding: 12px 32px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.discourse-load-more-btn:hover { background: rgba(255,152,1,0.1); }
.discourse-load-more-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ============================================
   24. RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 1000px) {
    .discourse-left-sidebar { width: 88px; padding: 10px; }
    .discourse-nav-item span { display: none; }
    .discourse-nav-post-btn span { display: none; }
    .discourse-nav-post-btn {
        width: 56px; height: 56px;
        padding: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 50%;
    }
}

@media (max-width: 700px) {
    .discourse-left-sidebar { display: none; }
    .discourse-main-content { border-left: none; border-right: none; }
    .discourse-edit-avatar-section { top: 130px; left: 20px; }
    .discourse-edit-avatar-preview,
    .discourse-edit-avatar-container { width: 100px; height: 100px; }
    .discourse-edit-banner-preview { height: 160px; }
    .discourse-crop-container { max-height: 300px; }
    .discourse-banner-controls { gap: 12px; }
    .discourse-banner-control-btn { width: 40px; height: 40px; }
    /* Raise the @handle 8px on mobile so it doesn't overlap the bio textarea. */
    .discourse-edit-user-handle { margin-top: -8px; }
}

/* ============================================
   25. UTILITY / MISC FIXES
   ============================================ */

.discourse-replies-wrapper { position: relative; }

#main-post-container { position: relative; padding: 0; }

.discourse-nested-line,
.discourse-reply-line { display: none !important; }

.discourse-post-author:hover,
.discourse-main-post-name:hover,
.discourse-reply-author:hover,
.discourse-parent-author:hover,
.discourse-nested-author:hover {
    color: #ff9801 !important;
    text-decoration: none !important;
}

.discourse-expand-replies,
.discourse-avatar-expand svg,
.expand-plus { list-style: none !important; }

.discourse-avatar-expand::marker,
.connector-line-unified::marker { display: none !important; }

/* ============================================
   26. COMPOSE BLOCK
   ============================================ */

.discourse-compose {
    background: transparent;
    border-bottom: 1px solid #333;
    padding: 16px 20px;
}

body:not(.dark-mode) .discourse-compose { border-bottom-color: #ddd; }

.discourse-compose-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255,152,1,0.3);
    margin-right: 12px;
    flex-shrink: 0;
}

.discourse-compose-form { display: flex; align-items: flex-start; gap: 12px; }
.discourse-compose-content { flex: 1; }

.discourse-compose-textarea {
    width: 100%;
    min-height: 120px;
    background: transparent;
    border: none;
    color: #aaa;
    font-size: 15px;
    line-height: 1.5;
    font-family: inherit;
    resize: none;
    outline: none;
    padding: 12px 0;
}

#global-composer-textarea {
    max-height: 150px;
    overflow-y: scroll;
    padding-right: 8px;
    box-sizing: border-box;
}

body:not(.dark-mode) .discourse-compose-textarea { color: #555; }
.discourse-compose-textarea::placeholder { color: #666; font-size: 15px; }

.discourse-compose-footer,
.discourse-reply-footer {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    flex-direction: row !important;
}

.discourse-compose-footer {
    margin-top: 12px !important;
    padding-top: 12px !important;
    border-top: 1px solid #333 !important;
}

body:not(.dark-mode) .discourse-compose-footer { border-top-color: #ddd !important; }

.discourse-compose-right,
.discourse-reply-right {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 12px !important;
}

.discourse-media-icons { display: flex; gap: 4px; align-items: center; }

.discourse-media-icon {
    width: 34px; height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #ff9801;
    transition: all 0.2s;
    border-radius: 50%;
}

.discourse-media-icon:hover { background: rgba(255,152,1,0.1); }
.discourse-media-icon svg { width: 20px; height: 20px; fill: currentColor; }

.discourse-media-icon.gif-icon {
    border: 1.5px solid #ff9801;
    border-radius: 3px;
    font-weight: 700;
    font-size: 10px;
    width: 32px; height: 32px;
}

/* ============================================
   27. USER CARD (SIDEBAR)
   ============================================ */

.discourse-user-card {
    background: transparent;
    border: 1px solid #333;
    padding: 20px;
    margin-bottom: 16px;
}

body:not(.dark-mode) .discourse-user-card { border-color: #ddd; }

.discourse-user-card-avatar {
    width: 100px; height: 100px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid rgba(255,152,1,0.3);
    margin-bottom: 12px;
}

.discourse-user-card h2 { color: #aaa; font-size: 20px; font-weight: 700; margin: 0 0 4px 0; }
body:not(.dark-mode) .discourse-user-card h2 { color: #555; }

.discourse-user-card > span { color: #666; font-size: 15px; display: block; margin-bottom: 16px; }

.discourse-user-stats {
    display: flex; gap: 20px;
    padding: 16px 0;
    border-top: 1px solid #333;
    border-bottom: 1px solid #333;
    margin-bottom: 16px;
}

body:not(.dark-mode) .discourse-user-stats { border-top-color: #ddd; border-bottom-color: #ddd; }

.discourse-user-stats > div { color: #666; font-size: 14px; }

.discourse-user-stats strong {
    color: #aaa;
    font-weight: 700;
    display: block;
    font-size: 18px;
    margin-bottom: 2px;
}

body:not(.dark-mode) .discourse-user-stats strong { color: #555; }

.discourse-follow-btn {
    width: 100%;
    background: #ff9801;
    color: #fff;
    border: none;
    padding: 12px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.discourse-follow-btn:hover { background: #e67e00; }

.discourse-follow-btn.following {
    background: transparent;
    border: 1px solid #ff9801;
    color: #ff9801;
}

.discourse-follow-btn.following:hover { background: rgba(255,152,1,0.1); }

/* ============================================
   28. HINT.CSS OVERRIDE
   ============================================ */

.hint--top::after { display: none !important; }

[aria-label]:not([data-tooltip])::before,
[aria-label]:not([data-tooltip])::after { display: none !important; }

.discourse-avatar-expand.hint--top::after { display: none !important; }

.connector-line-unified .hint--top::before,
.connector-line-unified .hint--top::after,
.connector-line-unified [aria-label]::before,
.connector-line-unified [aria-label]::after { display: none !important; content: none !important; }


/* ============================================
   PROFILE ACTION MOD BUTTONS
   ============================================ */

#profile-mute-btn,
#profile-block-btn,
#profile-report-btn,
#profile-suspend-btn {
    color: #71767b;
    opacity: 0.5;
    transition: color 0.2s, background 0.2s, opacity 0.2s;
}

#profile-mute-btn:hover,
#profile-block-btn:hover,
#profile-report-btn:hover {
    color: #ff9801;
    background: rgba(255,152,1,0.1);
    opacity: 1;
}

#profile-mute-btn.active {
    color: #ff9801;
    opacity: 1;
}

#profile-mute-btn.active svg {
    fill: #ff9801;
}

#profile-block-btn.active {
    color: #dc3545;
    opacity: 1;
}

#profile-block-btn.active svg {
    fill: #dc3545;
}

#profile-block-btn.active:hover {
    background: rgba(220,53,69,0.1);
    color: #dc3545;
}

#profile-suspend-btn {
    color: #71767b;
    opacity: 0.5;
}

#profile-suspend-btn:hover {
    background: rgba(220,53,69,0.1);
    color: #dc3545;
    opacity: 1;
}

#profile-suspend-btn.active {
    color: #dc3545;
    opacity: 1;
}

#profile-suspend-btn.active svg {
    fill: #dc3545;
}

#profile-suspend-btn.active:hover {
    background: rgba(220,53,69,0.1);
    color: #dc3545;
}

/* ============================================
   29. SAVE-DRAFT CONFIRMATION MODAL
   ============================================ */

.discourse-save-draft-modal {
    display: none !important;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    width: 100%; height: 100%;
    z-index: 10000000;
}

.discourse-save-draft-modal.show { display: flex !important; }

.discourse-save-draft-content {
    position: relative;
    background: var(--bg-color, #fff);
    width: 90%;
    max-width: 400px;
    box-shadow: 0 4px 32px rgba(0,0,0,0.3);
    animation: draftModalSlideIn 0.2s ease;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border-color, #e1e8ed);
    margin: auto;
}

@keyframes draftModalSlideIn {
    from { opacity: 0; transform: scale(0.95); }
    to   { opacity: 1; transform: scale(1); }
}

.discourse-save-draft-header { padding: 16px 20px; position: relative; text-align: center; border-bottom: none; }

.discourse-save-draft-header::after {
    display: none !important;
}

.discourse-save-draft-header h2 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: var(--text-color, #14171a);
    text-align: center;
}

.discourse-save-draft-body { padding: 20px; }

.discourse-save-draft-body p {
    margin: 0;
    font-size: 14px;
    line-height: 20px;
    color: var(--text-secondary, #536471);
}

.discourse-save-draft-footer {
    padding: 16px 20px;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    position: relative;
}

.discourse-save-draft-footer::before {
    content: '';
    position: absolute;
    left: 20px; right: 20px; top: 0;
    height: 1px;
    background-color: var(--border-color, #e1e8ed);
}

.discourse-draft-btn {
    padding: 8px 16px;
    font-size: 12px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s;
}

.discourse-draft-discard { background: transparent; color: rgb(220,53,69); border: 1px solid rgb(220,53,69); }
.discourse-draft-discard:hover { background-color: rgba(220,53,69,0.1); }
.discourse-draft-save { background: transparent; color: rgb(255,152,1); border: 1px solid rgb(255,152,1); }
.discourse-draft-save:hover { background-color: rgba(255,152,1,0.1); }

body.dark-mode .discourse-save-draft-content { background: #1a1a1a; border-color: #444; }
body.dark-mode .discourse-save-draft-header::after,
body.dark-mode .discourse-save-draft-footer::before { background-color: #444; }
body.dark-mode .discourse-save-draft-header h2 { color: #e7e9ea; }
body.dark-mode .discourse-save-draft-body p { color: #aaa; }
body.dark-mode .discourse-draft-discard { border-color: rgb(220,53,69); color: rgb(220,53,69); }
body.dark-mode .discourse-draft-discard:hover { background-color: rgba(220,53,69,0.1); }
body.dark-mode .discourse-draft-save { border-color: rgb(255,152,1); color: rgb(255,152,1); }
body.dark-mode .discourse-draft-save:hover { background-color: rgba(255,152,1,0.1); }

/* ============================================
   30. FOLLOWERS / FOLLOWING MODAL
   ============================================ */

.discourse-follow-modal {
    display: none !important;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 999999;
    align-items: flex-start;
    justify-content: center;
    padding-top: 5vh;
}
.discourse-follow-modal.show { display: flex !important; }
.discourse-follow-modal-overlay {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.7);
}
.discourse-follow-modal-content {
    background: #1a1a1a;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    position: relative;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    border: 1px solid #444;
    display: flex;
    flex-direction: column;
}
body:not(.dark-mode) .discourse-follow-modal-content { background: #fff; border-color: #ddd; }
.discourse-follow-modal-header {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 16px 16px 14px;
    border-bottom: 1px solid #333;
    flex-shrink: 0;
}
body:not(.dark-mode) .discourse-follow-modal-header { border-bottom-color: #ddd; }
.discourse-follow-modal-header h2 {
    margin: 0;
    font-size: 16px;
    font-weight: 800;
    text-align: center;
    flex: 1;
    color: #aaa;
}
body:not(.dark-mode) .discourse-follow-modal-header h2 { color: #0f1419; }
.discourse-follow-modal-close {
    position: absolute;
    right: 10px;
    background: none;
    border: none;
    color: #888;
    cursor: pointer;
    width: 36px; height: 36px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
    padding: 0;
}
.discourse-follow-modal-close:hover { background: rgba(255,152,1,0.1); color: #ff9801; }

.discourse-follow-modal-body { padding: 0; overflow-y: auto; flex: 1; }
.discourse-follow-modal-body::-webkit-scrollbar { width: 8px; }
.discourse-follow-modal-body::-webkit-scrollbar-track { background: transparent; }
.discourse-follow-modal-body::-webkit-scrollbar-thumb { background: rgba(255,152,1,0.3); }
.discourse-follow-modal-body::-webkit-scrollbar-thumb:hover { background: rgba(255,152,1,0.5); }

.discourse-follow-loading,
.discourse-follow-empty,
.discourse-follow-error { text-align: center; padding: 40px 20px; color: #888; font-size: 15px; }
.discourse-follow-error { color: #dc5064; }

.discourse-follow-list { padding: 0; }

.discourse-follow-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #333;
    transition: background 0.2s;
}

body:not(.dark-mode) .discourse-follow-item { border-bottom-color: #e6e6e6; }
.discourse-follow-item:hover { background: rgba(255,152,1,0.03); }
.discourse-follow-item:last-child { border-bottom: none; }

.discourse-follow-item-left {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.discourse-follow-avatar {
    width: 48px; height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255,152,1,0.3);
    cursor: pointer;
    flex-shrink: 0;
    transition: border-color 0.2s;
}

.discourse-follow-avatar:hover { border-color: #ff9801; }

.discourse-follow-info { flex: 1; min-width: 0; }

.discourse-follow-name {
    color: #aaa;
    font-weight: 700;
    font-size: 15px;
    margin-bottom: 2px;
    cursor: pointer;
    transition: color 0.2s;
}

body:not(.dark-mode) .discourse-follow-name { color: #0f1419; }
.discourse-follow-name:hover { color: #ff9801; }

.discourse-follow-username { color: #666; font-size: 15px; margin-bottom: 4px; }

.discourse-follow-bio {
    color: #888;
    font-size: 14px;
    line-height: 1.4;
    margin-top: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

body:not(.dark-mode) .discourse-follow-bio { color: #536471; }

.discourse-follow-item-btn {
    background: #ff9801;
    color: white;
    border: 1px solid #ff9801;
    width: 100px;
    min-width: 100px;
    max-width: 100px;
    padding: 7px 4px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
    flex-shrink: 0;
    margin-left: 12px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    box-sizing: border-box;
    display: inline-block;
    line-height: 1.4;
}

.discourse-follow-item-btn:hover { background: #e67e00; border-color: #e67e00; }
.discourse-follow-item-btn:disabled { opacity: 0.6; cursor: not-allowed; }

.discourse-follow-item-btn.following {
    background: transparent;
    border: 1px solid #536471;
    color: #0f1419;
}

body.dark-mode .discourse-follow-item-btn.following { color: #e7e9ea; }

.discourse-follow-item-btn.following:hover {
    background: rgba(244,33,46,0.1);
    border-color: rgba(244,33,46,0.4);
    color: #f4212e;
}

@media (max-width: 600px) {
    .discourse-follow-modal-content { width: 100%; height: 100%; max-height: 100vh; }
    .discourse-follow-avatar { width: 40px; height: 40px; }
    .discourse-follow-item { padding: 12px 16px; }
    .discourse-follow-item-btn { width: 90px; min-width: 90px; max-width: 90px; padding: 6px 0; font-size: 13px; }
}

/* ============================================
   31. REFLECTIONS TAB
   ============================================ */

.reflection-post {
    border-bottom: 1px solid #333;
    padding: 16px 20px;
    transition: background 0.2s;
    cursor: default;
    position: relative;
}

body:not(.dark-mode) .reflection-post { border-bottom-color: #e6e6e6; }
.reflection-post:hover { background: rgba(255,152,1,0.02); }

.reflection-header-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin: 12px 0 8px 0;
    gap: 10px;
    flex-wrap: wrap;
}

.reflection-title {
    margin: 0 !important;
    font-size: 18px !important;
    font-weight: 600 !important;
    color: #ff9801 !important;
    cursor: pointer;
    transition: color 0.3s;
    line-height: 1.4;
    flex: 1;
    min-width: 200px;
}

.reflection-title:hover { color: #e67e00 !important; text-decoration: none; }

.reflection-badges { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.journal-visibility-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    transition: background-color 0.3s, color 0.3s;
}

.journal-visibility-badge.private,
.journal-visibility-badge.companions,
.journal-visibility-badge.public { background-color: #f3f3f3; color: #1c1d23; }

.journal-visibility-badge.draft { background-color: rgba(255,152,1,0.15); color: #ff9801; }

body.dark-mode .journal-visibility-badge.private,
body.dark-mode .journal-visibility-badge.companions,
body.dark-mode .journal-visibility-badge.public { background-color: #2c2c2c; color: #f5f5f5; }

body.dark-mode .journal-visibility-badge.draft { background-color: rgba(255,152,1,0.15); color: #ff9801; }

.reflection-date { font-size: 12px; color: #888; margin-bottom: 12px; }

.reflection-content-preview { color: #aaa; line-height: 1.6; margin: 0 0 12px 0; font-size: 15px; }
body:not(.dark-mode) .reflection-content-preview { color: #555; }

.reflection-read-more {
    background: none;
    border: none;
    color: #ff9801;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
    margin-left: 5px;
    transition: color 0.3s;
}

.reflection-read-more:hover { color: #e67e00; }

.reflection-footer {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #333;
    display: flex;
    align-items: center;
    gap: 16px;
}

body:not(.dark-mode) .reflection-footer { border-top-color: #e6e6e6; }

.reflection-like-count {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #ff9801;
    font-size: 14px;
    font-weight: 500;
}

.reflection-share-btn {
    background: none; border: none;
    color: #ff9801; padding: 0;
    cursor: pointer; transition: color 0.3s;
    display: flex; align-items: center; justify-content: center;
    width: 20px; height: 20px;
}

.reflection-share-btn:hover { color: #e67e00; }
.reflection-share-btn svg { width: 16px; height: 16px; fill: currentColor; }
.visibility-badge { display: none; }



.discourse-quoted-post-box .discourse-attached-reflection.discourse-attached-reflection-compact {
    margin-left: 12px;
    margin-right: 12px;
    margin-bottom: 12px;
}
#discourse-repost-quoted-preview .discourse-attached-reflection.discourse-attached-reflection-compact {
    margin-left: 0;
    margin-right: 0;
    margin-bottom: 0;
}
#discourse-repost-quoted-preview .discourse-quoted-post-header {
    padding: 0 0 8px 0 !important;
}
#discourse-repost-quoted-preview .discourse-quoted-post-content {
    padding: 0 !important;
}



/* ============================================
   32. REPOST DROPDOWN
   ============================================ */

.discourse-repost-dropdown {
    position: fixed;
    display: none;
    background: rgba(255,152,1,0.15);
    border: 1px solid rgba(255,152,1,0.3);
    padding: 0;
    z-index: 10000;
    min-width: 140px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    opacity: 0;
    transform: translateY(-8px) scale(0.95);
    animation: repostDropdownIn 0.2s cubic-bezier(0.16,1,0.3,1) forwards;
}

@keyframes repostDropdownIn {
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.discourse-repost-dropdown.closing {
    animation: repostDropdownOut 0.15s cubic-bezier(0.4,0,1,1) forwards;
}

@keyframes repostDropdownOut {
    to { opacity: 0; transform: translateY(-8px) scale(0.95); }
}

.discourse-repost-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: none;
    border: none;
    border-bottom: 1px solid rgba(255,152,1,0.15);
    color: #ff9801;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    width: 100%;
    text-align: left;
    transition: background 0.15s ease;
}

.discourse-repost-option:last-child { border-bottom: none; }
.discourse-repost-option:hover { background: rgba(255,152,1,0.25); }
.discourse-repost-option:active { background: rgba(255,152,1,0.35); }
.discourse-repost-option svg { flex-shrink: 0; }

/* ============================================
   33. QUOTE MODAL
   ============================================ */

.discourse-quote-modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.7);
    z-index: 10000;
    display: none;
    opacity: 0;
    animation: fadeIn 0.2s ease forwards;
}

@keyframes fadeIn { to { opacity: 1; } }

.discourse-quote-modal-overlay.show {
    display: flex !important;
    align-items: flex-start !important;
    justify-content: center !important;
    padding-top: 5vh;
}

.discourse-quote-modal-overlay.closing { animation: fadeOut 0.2s ease forwards; }
@keyframes fadeOut { to { opacity: 0; } }

.discourse-quote-modal {
    background: #fff;
    border: 1px solid #ddd;
    width: 600px;
    max-width: 90vw;
    max-height: 90vh;
    overflow: visible;
    display: flex;
    flex-direction: column;
    opacity: 0;
    transform: scale(0.95);
    animation: modalIn 0.3s cubic-bezier(0.4,0,0.2,1) forwards;
    box-shadow: 0 4px 32px rgba(0,0,0,0.3);
}

@keyframes modalIn { to { opacity: 1; transform: scale(1); } }

.discourse-quote-modal-overlay.closing .discourse-quote-modal {
    animation: modalOut 0.2s cubic-bezier(0.4,0,1,1) forwards;
}

@keyframes modalOut { to { opacity: 0; transform: scale(0.95); } }

body.dark-mode .discourse-quote-modal { background: #1a1a1a; border-color: #444; }

.discourse-quote-modal-header {
    padding: 16px 20px;
    border-bottom: 1px solid #ddd;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    min-height: 53px;
    position: relative;
}

body.dark-mode .discourse-quote-modal-header { border-bottom-color: #333; }

.discourse-quote-modal-title {
    color: rgb(51, 51, 51);
    font-size: 20px;
    font-weight: 700;
    margin: 0;
    flex: 1;
    text-align: center;
}
body.dark-mode .discourse-quote-modal-title {
    color: #aaa;
}

.discourse-quote-save-draft {
    position: absolute;
    left: 20px;
    background: none; border: none;
    color: #ff9801;
    font-size: 15px; font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
    padding: 6px 12px;
}

.discourse-quote-save-draft:hover { opacity: 0.8; }

.discourse-quote-modal-close {
    position: absolute;
    right: 14px;
    top: 14px;
    background: none; border: none;
    width: 36px; height: 36px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    color: #666;
    line-height: 1; padding: 0;
    border-radius: 50%;
}

.discourse-quote-modal-close:hover { background: rgba(255,152,1,0.1); color: #ff9801; }
body.dark-mode .discourse-quote-modal-close { color: #aaa; }
.discourse-quote-modal-close svg { width: 20px; height: 20px; fill: currentColor; }

.discourse-quote-modal-body { flex: 1; overflow-y: auto; padding: 16px 20px; }
.discourse-quote-modal-wrapper { display: flex; flex-direction: column; gap: 16px; }

.discourse-quote-comment-row { display: flex; gap: 12px; align-items: flex-start; }

.discourse-quote-user-avatar {
    width: 48px; height: 48px;
    border-radius: 50%;
    flex-shrink: 0;
    object-fit: cover;
    border: 2px solid rgba(255,152,1,0.3);
}

.discourse-quote-content { flex: 1; display: flex; flex-direction: column; min-width: 0; }

.discourse-quote-textarea {
    width: 100%;
    min-height: 60px; max-height: 300px;
    border: none; resize: none;
    font-size: 16px; line-height: 1.5;
    background: transparent;
    color: transparent;
    caret-color: #333;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    padding: 0 8px 0 0; margin: 0 0 16px 0;
    overflow-y: scroll; outline: none;
    box-sizing: border-box;
    position: relative;
    z-index: 1;
}

body.dark-mode .discourse-quote-textarea {
    caret-color: #aaa;
}

.discourse-quote-modal .discourse-mention-highlight-wrapper {
    max-height: 300px;
    overflow: hidden;
    position: relative;
}

.discourse-quote-modal .discourse-mention-mirror {
    padding-right: 8px;
    box-sizing: border-box;
    overflow: hidden !important;
}

body.dark-mode .discourse-quote-textarea { color: #aaa; }
.discourse-quote-textarea::placeholder { color: #666; font-size: 20px; }
.discourse-quote-textarea::-webkit-scrollbar { width: 6px; }
.discourse-quote-textarea::-webkit-scrollbar-track { background: transparent; }
.discourse-quote-textarea::-webkit-scrollbar-thumb { background: rgba(255,152,1,0.3); }
.discourse-quote-textarea::-webkit-scrollbar-thumb:hover { background: rgba(255,152,1,0.5); }

.discourse-quoted-post-preview {
    border: 1px solid #ddd;
    padding: 12px;
    background: #f9f9f9;
    margin-top: 0;
    margin-bottom: 16px;
}

body.dark-mode .discourse-quoted-post-preview { border-color: #333; background: rgba(255,255,255,0.03); }

.discourse-quote-modal-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 12px 12px 20px;
    flex-shrink: 0;
    position: relative;
}

.discourse-quote-modal-footer::before {
    content: '';
    position: absolute;
    top: 0; left: 12px; right: 12px;
    height: 1px;
    background: #ddd;
}

body.dark-mode .discourse-quote-modal-footer::before { background: #333; }

.discourse-quote-tools { display: flex; gap: 4px; align-items: center; margin-left: 0; }

.discourse-quote-icon-btn {
    background: none; border: none;
    width: 36px; height: 36px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    border-radius: 50%;
    transition: background-color 0.2s;
    color: #ff9801; padding: 0;
}

.discourse-quote-icon-btn:first-child { margin-left: -8px; }
.discourse-quote-icon-btn:hover { background-color: rgba(255,152,1,0.1); }
.discourse-quote-icon-btn svg { width: 20px; height: 20px; fill: currentColor; }

.discourse-quote-actions { display: flex; align-items: center; gap: 12px; }

.discourse-quote-char-counter { display: none !important; flex-direction: row !important; align-items: center !important; gap: 8px !important; }
.discourse-quote-char-counter.show { display: flex !important; }
.discourse-quote-char-circle { width: 30px !important; height: 30px !important; position: relative !important; flex-shrink: 0 !important; }
.discourse-quote-char-circle svg { width: 30px; height: 30px; transform: rotate(-90deg); }
.discourse-quote-char-circle circle { fill: none; stroke-width: 2; }
.discourse-quote-char-circle circle:first-child { stroke: #e0e0e0; }
body.dark-mode .discourse-quote-char-circle circle:first-child { stroke: #333; }
.discourse-quote-char-circle circle.progress { stroke: #ff9801; stroke-dasharray: 84.26; stroke-dashoffset: 84.26; transition: stroke-dashoffset 0.2s, stroke 0.2s; }
/* Warning/danger states removed — circle stays orange */
.discourse-quote-char-divider { width: 1px !important; height: 24px !important; background: #ccc !important; flex-shrink: 0 !important; }
body.dark-mode .discourse-quote-char-divider { background: #444 !important; }
.discourse-quote-char-count { color: #666 !important; font-size: 13px !important; font-weight: 600 !important; min-width: 30px !important; text-align: left !important; }
/* Warning/danger states removed */

.discourse-quote-submit {
    background: #ff9801 !important; color: white !important;
    border: none; padding: 8px 16px;
    font-size: 15px; font-weight: 700;
    cursor: pointer; transition: background-color 0.2s;
    white-space: nowrap;
}

.discourse-quote-submit:hover:not(:disabled) { background: #e67e00 !important; }
.discourse-quote-submit:disabled { opacity: 0.5; cursor: not-allowed; }

/* ============================================
   34. REPOST CARD
   ============================================ */

.discourse-repost-card {
    position: relative;
    border-bottom: 1px solid #333;
    padding: 16px 20px !important;
    transition: background 0.2s;
    cursor: pointer;
}

body:not(.dark-mode) .discourse-repost-card { border-bottom-color: #ddd; }
.discourse-repost-card:hover { background: rgba(255,152,1,0.02); }

.discourse-repost-header {
    margin: 0 0 8px 0;
    padding: 0 !important;
    position: relative;
    width: 100%;
    box-sizing: border-box;
}

.discourse-repost-header-inner {
    display: flex;
    align-items: center;
    color: #666 !important;
    font-size: 13px;
    line-height: 1;
}

.discourse-repost-header .discourse-repost-icon {
    width: 16px !important; height: 16px !important;
    margin-right: 4px;
    fill: #536471;
}

.discourse-repost-author {
    font-weight: 600;
    color: #888 !important;
    margin-left: 4px;
    cursor: pointer;
}

body:not(.dark-mode) .discourse-repost-author { color: #536471 !important; }
.discourse-repost-author:hover { text-decoration: underline; color: #ff9801 !important; }

.discourse-repost-text { margin-left: 4px; }
.discourse-repost-dot { margin: 0 4px; }
.discourse-repost-time { color: #536471; }

.discourse-repost-card .discourse-post-content-wrapper {
    display: flex; gap: 12px;
    padding: 0 !important; margin: 0 !important;
    position: relative;
}

.discourse-repost-card .discourse-post-avatar-container { position: relative; flex-shrink: 0; width: 48px; }

body.dark-mode .discourse-repost-header-inner { color: #71767b; }
body.dark-mode .discourse-repost-header .discourse-repost-icon { fill: #71767b; }
body.dark-mode .discourse-repost-author { color: #e7e9ea; }

/* ============================================
   35. QUOTED POST BOX
   ============================================ */

.discourse-quoted-post-box {
    margin: 12px 0 0 0;
    border: 1px solid #333;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s;
    background: rgba(255,255,255,0.02);
    width: 100% !important;
    max-width: 100% !important;
}

body:not(.dark-mode) .discourse-quoted-post-box { border-color: #ddd; background: rgba(0,0,0,0.02); }
.discourse-quoted-post-box:hover { border-color: #666; background: rgba(255,255,255,0.05); }
body:not(.dark-mode) .discourse-quoted-post-box:hover { border-color: #999; background: rgba(0,0,0,0.05); }
body.dark-mode .discourse-quoted-post-box { border-color: #333; background: rgba(255,255,255,0.02); }
body.dark-mode .discourse-quoted-post-box:hover { border-color: #444; background: rgba(255,255,255,0.04); }

.discourse-quoted-post-header {
    display: flex; align-items: center;
    gap: 8px;
    padding: 12px 12px 8px 12px;
}

.discourse-quoted-post-avatar {
    border-radius: 50% !important;
    width: 28px !important; height: 28px !important;
    object-fit: cover !important;
    border: 1px solid rgba(255,152,1,0.2);
    cursor: pointer;
    flex-shrink: 0 !important;
}

.discourse-quoted-post-info {
    flex: 1; min-width: 0;
    display: flex; align-items: center;
    gap: 6px; flex-wrap: wrap;
}

.discourse-quoted-post-author { color: #aaa !important; font-weight: 700 !important; font-size: 14px !important; line-height: 1.3; cursor: pointer; display: inline; margin: 0; }
body:not(.dark-mode) .discourse-quoted-post-author { color: #0f1419 !important; }
.discourse-quoted-post-author:hover { text-decoration: underline; color: #ff9801 !important; }

.discourse-quoted-post-username { color: #666 !important; font-size: 13px !important; line-height: 1.3; display: inline; margin: 0; }
.discourse-quoted-post-dot { color: #666 !important; margin: 0 4px; font-size: 13px !important; line-height: 1.3; }
.discourse-quoted-post-time { color: #666 !important; font-size: 13px !important; line-height: 1.3; }

.discourse-quoted-post-content {
    padding: 0 12px 12px 12px;
    color: #aaa !important;
    font-size: 14px !important;
    line-height: 1.5 !important;
    white-space: pre-wrap;
    word-wrap: break-word;
}

body:not(.dark-mode) .discourse-quoted-post-content { color: #0f1419 !important; }

/* ============================================
   36. ACTION BUTTON ACTIVE STATES
   ============================================ */

.discourse-repost.reposted,
.discourse-like.liked,
.discourse-bookmark.bookmarked,
.discourse-comment.user-replied,
.discourse-views.has-views { color: #ff9801 !important; }

.discourse-repost.reposted .discourse-post-action-icon svg,  .discourse-repost.reposted span,
.discourse-like.liked .discourse-post-action-icon svg,        .discourse-like.liked span,
.discourse-bookmark.bookmarked .discourse-post-action-icon svg, .discourse-bookmark.bookmarked span,
.discourse-comment.user-replied .discourse-post-action-icon svg, .discourse-comment.user-replied span,
.discourse-views.has-views .discourse-post-action-icon svg,   .discourse-views.has-views span {
    fill: #ff9801 !important;
    color: #ff9801 !important;
}

.discourse-repost-option.undo-repost { color: #ff9801 !important; }
.discourse-repost-option.undo-repost:hover { background: rgba(255,152,1,0.15) !important; }
.discourse-repost-option.undo-repost svg { fill: #ff9801 !important; }

/* ============================================
   37. @ MENTION AUTOCOMPLETE
   ============================================ */

.discourse-mention-dropdown {
    position: fixed !important;
    z-index: 10000000 !important;
    background: var(--discourse-bg, #1a1a1a);
    border: 1px solid var(--discourse-border, #333);
    border-radius: 0;
    overflow: hidden;
    min-width: 240px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
    max-height: 280px;
    overflow-y: auto;
    overflow-x: hidden;

}

.discourse-mention-dropdown::-webkit-scrollbar { width: 4px; }
.discourse-mention-dropdown::-webkit-scrollbar-track { background: transparent; }
.discourse-mention-dropdown::-webkit-scrollbar-thumb { background: rgba(255,152,1,0.3); border-radius: 0; }
.discourse-mention-dropdown::-webkit-scrollbar-thumb:hover { background: rgba(255,152,1,0.5); }

body.dark-mode .discourse-mention-dropdown {
    background: #1a1a1a;
    border-color: #333;
    box-shadow: 0 4px 16px rgba(0,0,0,0.5);
}

body:not(.dark-mode) .discourse-mention-dropdown {
    background: #fff;
    border-color: #e1e1e1;
    box-shadow: 0 8px 32px rgba(0,0,0,0.12);
}

.discourse-mention-item {
    display: flex; align-items: center;
    gap: 10px; padding: 8px 14px;
    cursor: pointer; transition: background 0.1s;
}

.discourse-mention-item:hover,
.discourse-mention-item.selected { background: rgba(255,152,1,0.12); }

.discourse-mention-avatar { width: 36px; height: 36px; object-fit: cover; flex-shrink: 0; border-radius: 50%; }

.discourse-mention-info { display: flex; flex-direction: column; min-width: 0; }

.discourse-mention-name { font-size: 14px; font-weight: 600; color: #0f1419; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.dark-mode .discourse-mention-name { color: #e7e9ea; }

.discourse-mention-username { font-size: 13px; color: #536471; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.dark-mode .discourse-mention-username { color: #71767b; }

.discourse-mention-link { color: #ff9801; font-weight: 600; cursor: pointer; text-decoration: none; }
.discourse-mention-link:hover { text-decoration: underline; }

/* ============================================
   38. CONFIRM / DELETE MODAL
   ============================================ */

.discourse-confirm-modal-overlay {
    position: fixed !important;
    top: 0 !important; left: 0 !important;
    width: 100% !important; height: 100% !important;
    background: rgba(0,0,0,0.7) !important;
    z-index: 999999 !important;
    display: none !important;
    align-items: center !important;
    justify-content: center !important;
}

.discourse-confirm-modal-overlay.show { display: flex !important; }

.discourse-confirm-modal {
    position: relative !important;
    background: #1a1a1a;
    width: 90%; max-width: 400px;
    border: 1px solid #444;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    margin: auto;
}

body:not(.dark-mode) .discourse-confirm-modal { background: #fff; border-color: #ddd; }

.discourse-confirm-modal-header { padding: 20px 20px 16px; border-bottom: 1px solid #333; }
body:not(.dark-mode) .discourse-confirm-modal-header { border-bottom-color: #e6e6e6; }
.discourse-confirm-modal-header h3 { margin: 0; font-size: 18px; font-weight: 700; color: #aaa; }
body:not(.dark-mode) .discourse-confirm-modal-header h3 { color: #0f1419; }

.discourse-confirm-modal-body { padding: 16px 20px; }
.discourse-confirm-modal-body p { margin: 0; font-size: 15px; color: #666; line-height: 1.5; }
body:not(.dark-mode) .discourse-confirm-modal-body p { color: #536471; }

.discourse-confirm-modal-footer { padding: 12px 20px 20px; display: flex; gap: 10px; justify-content: flex-end; }

.discourse-confirm-cancel {
    background: transparent; color: #888;
    border: 1px solid #444; padding: 8px 20px;
    font-size: 14px; font-weight: 600;
    cursor: pointer; transition: all 0.2s;
}

body:not(.dark-mode) .discourse-confirm-cancel { border-color: #ddd; color: #536471; }
.discourse-confirm-cancel:hover { background: rgba(128,128,128,0.1); color: #aaa; }

.discourse-confirm-action {
    background: #ff9801; color: white;
    border: none; padding: 8px 20px;
    font-size: 14px; font-weight: 700;
    cursor: pointer; transition: all 0.2s;
}

.discourse-confirm-action:hover { background: #e67e00; }
.discourse-confirm-action.danger { background: #dc3545; }
.discourse-confirm-action.danger:hover { background: #c82333; }

/* ============================================
   39. FONT CONSISTENCY (UNIFIED)
   ============================================ */

.discourse-post-author,
.discourse-repost-card .discourse-post-author,
.discourse-nested-author,
.discourse-reply-author,
.discourse-parent-author {
    color: #aaa !important;
    font-weight: 700 !important;
    font-size: 15px !important;
}

body:not(.dark-mode) .discourse-post-author,
body:not(.dark-mode) .discourse-repost-card .discourse-post-author,
body:not(.dark-mode) .discourse-nested-author,
body:not(.dark-mode) .discourse-reply-author,
body:not(.dark-mode) .discourse-parent-author { color: #0f1419 !important; }

body:not(.dark-mode) .discourse-post-author:hover,
body:not(.dark-mode) .discourse-repost-card .discourse-post-author:hover,
body:not(.dark-mode) .discourse-nested-author:hover,
body:not(.dark-mode) .discourse-reply-author:hover,
body:not(.dark-mode) .discourse-parent-author:hover { color: #ff9801 !important; }

.discourse-post-text,
.discourse-repost-card .discourse-post-text,
.discourse-nested-text,
.discourse-reply-text,
.discourse-parent-text {
    color: #aaa !important;
    font-size: 15px !important;
    line-height: 1.5 !important;
}

body:not(.dark-mode) .discourse-post-text,
body:not(.dark-mode) .discourse-repost-card .discourse-post-text,
body:not(.dark-mode) .discourse-nested-text,
body:not(.dark-mode) .discourse-reply-text,
body:not(.dark-mode) .discourse-parent-text { color: #0f1419 !important; }

.discourse-post-username, .discourse-post-dot, .discourse-post-time,
.discourse-nested-username, .discourse-nested-dot, .discourse-nested-time,
.discourse-reply-username, .discourse-reply-dot, .discourse-reply-time,
.discourse-parent-username, .discourse-parent-dot, .discourse-parent-time {
    color: #666 !important;
    font-size: 15px !important;
}

/* ============================================
   40. NOTIFICATIONS
   ============================================ */

.discourse-notification-item { transition: background 0.2s; cursor: pointer; }
.discourse-notification-item:hover { background: rgba(255,152,1,0.05) !important; }

.discourse-notification-actor-name { font-size: 15px !important; font-weight: 700 !important; color: #aaa !important; }
body:not(.dark-mode) .discourse-notification-actor-name { color: #0f1419 !important; }

.discourse-notification-action { font-size: 15px !important; color: #666 !important; }
body:not(.dark-mode) .discourse-notification-action { color: #536471 !important; }

.discourse-notification-preview { font-size: 15px !important; line-height: 1.5 !important; color: #aaa !important; }
body:not(.dark-mode) .discourse-notification-preview { color: #0f1419 !important; }

.discourse-notification-time { font-size: 13px !important; color: #666 !important; }

.discourse-notification-avatar {
    width: 36px !important; height: 36px !important;
    border-radius: 50% !important;
    border: 2px solid rgba(255,152,1,0.3) !important;
}

/* ============================================
   41. LINK PREVIEW CARDS
   ============================================ */

.link-previews-container { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }

.link-preview-card {
    display: block;
    border: 1px solid #e0e0e0;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}

.link-preview-card:hover { border-color: #ff9801; background: rgba(255,152,1,0.04); }

body.dark-mode .link-preview-card { border-color: #333; }
body.dark-mode .link-preview-card:hover { border-color: #ff9801; background: rgba(255,152,1,0.06); }

.link-preview-image-container {
    width: 100%; max-height: 280px;
    overflow: hidden; position: relative;
    background: #f0f0f0;
}

body.dark-mode .link-preview-image-container { background: #1a1a1a; }

.link-preview-image {
    width: 100%; height: auto;
    max-height: 280px;
    object-fit: cover;
    display: block;
    vertical-align: bottom;
}

.link-preview-video { cursor: pointer; }

.link-preview-play-btn {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 56px; height: 56px;
    background: rgba(0,0,0,0.7);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    transition: background 0.2s, transform 0.2s;
}

.link-preview-card:hover .link-preview-play-btn {
    background: #f00;
    transform: translate(-50%, -50%) scale(1.1);
}

.link-preview-play-btn svg { width: 24px; height: 24px; margin-left: 4px; }

.link-preview-meta { padding: 10px 14px 12px; }
.link-preview-site { font-size: 12px; color: #888; text-transform: uppercase; letter-spacing: 0.3px; margin-bottom: 4px; }
body.dark-mode .link-preview-site { color: #666; }

.link-preview-title {
    font-size: 14px; font-weight: 600; color: #1a1a1a;
    line-height: 1.4; margin-bottom: 4px;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

body.dark-mode .link-preview-title { color: #f0f0f0; }

.link-preview-description {
    font-size: 13px; color: #666; line-height: 1.4;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

body.dark-mode .link-preview-description { color: #aaa; }

.discourse-post-text-segment { margin: 0; padding: 0; }
.discourse-post-text:has(.link-preview-slot:last-child) { margin-bottom: 0; }

/* ============================================
   42. POST EDIT MODAL
   ============================================ */

#discourse-edit-modal-overlay {
    display: none;
    position: fixed !important;
    top: 0 !important; left: 0 !important;
    width: 100% !important; height: 100% !important;
    max-width: none !important; max-height: none !important;
    background: rgba(0,0,0,0.7);
    z-index: 999999;
    align-items: flex-start;
    justify-content: center;
    flex-direction: row !important;
    padding-top: 5vh;
}

#discourse-edit-modal-overlay.show { display: flex !important; }

#discourse-edit-modal-overlay .discourse-edit-modal {
    display: block !important;
    position: relative !important;
    width: 600px !important;
    max-width: 90vw !important;
    max-height: 650px !important;
    height: auto !important;
    overflow-y: auto;
    background: #1a1a1a !important;
    border: 1px solid #444 !important;
    box-shadow: 0 4px 32px rgba(0,0,0,0.3);
    margin: 0 !important;
    pointer-events: auto !important;
}

body:not(.dark-mode) #discourse-edit-modal-overlay .discourse-edit-modal {
    background: #fff !important;
    border-color: #ddd;
}

#discourse-edit-modal-overlay .discourse-edit-modal-header {
    padding: 16px 20px;
    border-bottom: none;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    background: transparent;
    z-index: 10;
    flex-shrink: 0;
}

body:not(.dark-mode) #discourse-edit-modal-overlay .discourse-edit-modal-header {
    border-bottom-color: #ddd;
    background: #fff;
}

#discourse-edit-modal-overlay .discourse-edit-modal-header h2 {
    color: #333;
    font-size: 20px;
    font-weight: 700;
    margin: 0;
    flex: 1;
    text-align: center;
}
/* True-center the title by removing the close button from flex flow */
#discourse-edit-modal-overlay .discourse-edit-modal-header {
    position: relative;
}
#discourse-edit-modal-overlay .discourse-edit-modal-close {
    position: absolute !important;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
}

body.dark-mode #discourse-edit-modal-overlay .discourse-edit-modal-header h2 {
    color: #aaa;
}

#discourse-edit-modal-overlay .discourse-edit-modal-close {
    background: none; border: none;
    cursor: pointer;
    width: 36px; height: 36px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%;
    transition: background 0.2s;
    padding: 0;
    position: absolute;
    right: 14px;
    top: 14px;
}

#discourse-edit-modal-overlay .discourse-edit-modal-close:hover {
    background: rgba(255, 152, 1,0.15);
}

#discourse-edit-modal-overlay .discourse-edit-modal-close svg {
    fill: #666;
}

#discourse-edit-modal-overlay .discourse-edit-modal-body { padding: 12px 20px 0 20px; }

.discourse-edit-modal-wrapper { display: flex; gap: 12px; align-items: flex-start; }

.discourse-edit-avatar {
    width: 48px; height: 48px;
    border-radius: 50%; object-fit: cover;
    border: 2px solid rgba(255,152,1,0.3);
    flex-shrink: 0;
}

.discourse-edit-content { flex: 1; }

.discourse-edit-textarea {
    width: 100%;
    min-height: 60px;
    max-height: 400px;
    background: transparent !important;
    border: none;
    outline: none;
    resize: none;
    padding: 0;
    margin-bottom: 12px;
    box-sizing: border-box;
    color: #aaa;
    caret-color: #aaa;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 16px;
    font-weight: 400;
    line-height: 24px;
    white-space: pre-wrap;
    overflow-wrap: break-word;
    overflow-y: auto;
    position: relative;
    z-index: 2;
}
body:not(.dark-mode) .discourse-edit-textarea { color: #333; caret-color: #333; }
.discourse-edit-textarea::placeholder { color: #666; font-size: 16px; }
.discourse-edit-textarea::-webkit-scrollbar { width: 6px; }
.discourse-edit-textarea::-webkit-scrollbar-track { background: transparent; }
.discourse-edit-textarea::-webkit-scrollbar-thumb { background: rgba(255,152,1,0.3); border-radius: 0 !important; }
.discourse-edit-textarea::-webkit-scrollbar-thumb:hover { background: rgba(255,152,1,0.5); }
.discourse-edit-textarea { padding-right: 8px !important; box-sizing: border-box !important; margin-bottom: 0 !important; overflow-y: scroll !important; }

/* Hashtag highlight active state */
.discourse-edit-textarea.hashtag-highlight-active {
    color: transparent !important;
    caret-color: #aaa !important;
    background: transparent !important;
    position: relative !important;
    z-index: 2 !important;
}
body:not(.dark-mode) .discourse-edit-textarea.hashtag-highlight-active {
    caret-color: #333 !important;
}

/* Mention highlight wrapper inside edit modal */
#discourse-edit-modal-overlay .discourse-mention-highlight-wrapper { position: relative; width: 100%; max-height: 300px; overflow: hidden; }
#discourse-edit-modal-overlay .discourse-mention-mirror { pointer-events: none !important; z-index: 1 !important; overflow: hidden !important; }
#discourse-edit-modal-overlay .discourse-edit-textarea { z-index: 2 !important; position: relative !important; }

#discourse-edit-modal-overlay .discourse-edit-modal-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 20px 12px 76px;
    position: relative;
}

#discourse-edit-modal-overlay .discourse-edit-modal-footer::before {
    content: '';
    position: absolute;
    top: 0; left: 76px; right: 20px;
    height: 1px;
    background: #444;
}


body:not(.dark-mode) #discourse-edit-modal-overlay .discourse-edit-modal-footer::before {
    background: #ddd;
}

.discourse-composer-tools { display: flex; gap: 4px; align-items: center; }

.discourse-composer-icon-btn {
    background: none; border: none;
    width: 36px; height: 36px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; border-radius: 50%;
    transition: background-color 0.2s;
    color: #ff9801; padding: 0;
}

.discourse-composer-icon-btn:hover { background-color: rgba(255,152,1,0.1); }
.discourse-composer-icon-btn svg { width: 20px; height: 20px; fill: currentColor; }

.discourse-edit-footer-left { display: flex; gap: 4px; align-items: center; }

.discourse-edit-save {
    background: #ff9801; color: white;
    border: none; padding: 8px 20px;
    font-size: 15px; font-weight: 700;
    cursor: pointer; transition: background 0.2s;
}

.discourse-edit-save:hover { background: #e67e00; }
.discourse-edit-save:disabled { opacity: 0.5; cursor: not-allowed; }

/* Force exact match with create post textarea color */
#discourse-edit-modal-overlay textarea,
#discourse-edit-modal-overlay .discourse-edit-modal textarea,
#discourse-edit-modal-overlay .discourse-mention-highlight-wrapper textarea,
#discourse-edit-modal-overlay .discourse-edit-content textarea {
    color: rgb(170, 170, 170) !important;
    caret-color: rgb(170, 170, 170) !important;
}
body:not(.dark-mode) #discourse-edit-modal-overlay textarea,
body:not(.dark-mode) #discourse-edit-modal-overlay .discourse-edit-modal textarea,
body:not(.dark-mode) #discourse-edit-modal-overlay .discourse-mention-highlight-wrapper textarea,
body:not(.dark-mode) #discourse-edit-modal-overlay .discourse-edit-content textarea {
    color: #333 !important;
    caret-color: #333 !important;
}

/* ============================================
   43. REPLY-PERMISSIONS MODAL
   ============================================ */

.discourse-reply-perm-overlay {
    display: none;
    position: fixed !important;
    top: 0 !important; left: 0 !important;
    width: 100% !important; height: 100% !important;
    max-width: none !important; max-height: none !important;
    background: rgba(0,0,0,0.7);
    z-index: 999999;
    align-items: center;
    justify-content: center;
    flex-direction: row !important;
}

.discourse-reply-perm-overlay.show { display: flex !important; }

.discourse-reply-perm-modal {
    background: #1a1a1a;
    border: 1px solid #444;
    width: 90%;
    max-width: 260px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    position: relative;
    border-radius: 0;
}

body:not(.dark-mode) .discourse-reply-perm-modal { background: #fff; border-color: #ddd; }

.discourse-reply-perm-header {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 16px 16px 14px;
    border-bottom: 1px solid #333;
}

body:not(.dark-mode) .discourse-reply-perm-header { border-bottom-color: #ddd; }

.discourse-reply-perm-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 800;
    text-align: center;
    flex: 1;
    color: #aaa;
}

body:not(.dark-mode) .discourse-reply-perm-header h3 { color: #0f1419; }

.discourse-reply-perm-close {
    position: absolute;
    right: 10px;
    background: none; border: none;
    color: #888; cursor: pointer;
    width: 36px; height: 36px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
    padding: 0;
}

.discourse-reply-perm-close:hover { background: rgba(255,152,1,0.1); color: #ff9801; }

.discourse-reply-perm-body { padding: 6px 0; }

.discourse-reply-perm-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 16px 11px 20px;
    color: #aaa;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s;
    border-bottom: none;
}

body:not(.dark-mode) .discourse-reply-perm-option { color: #0f1419; }
.discourse-reply-perm-option:hover { background: rgba(255, 152, 1,0.07); }

/* Hide native radio */
.discourse-perm-radio-wrap {
    position: relative;
    width: 18px; height: 18px;
    flex-shrink: 0;
}

.discourse-perm-radio-wrap input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 100%; height: 100%;
    margin: 0; cursor: pointer; z-index: 1;
}

.discourse-perm-radio-dot {
    display: block;
    width: 18px; height: 18px;
    border-radius: 0;
    border: 2px solid #333;
    background: transparent;
    transition: all 0.15s;
}

body:not(.dark-mode) .discourse-perm-radio-dot {
    border-color: #ddd;
}

.discourse-perm-radio-wrap input[type="radio"]:checked + .discourse-perm-radio-dot {
    background: #ff9801;
    border-color: #333;
}

body:not(.dark-mode) .discourse-perm-radio-wrap input[type="radio"]:checked + .discourse-perm-radio-dot {
    border-color: #ddd;
}

.discourse-perm-label {
    font-size: 14px;
    font-weight: 500;
}

.discourse-reply-perm-footer { padding: 10px 16px 14px; }

.discourse-reply-perm-save {
    width: 100%;
    padding: 10px;
    background: #ff9801; color: #fff;
    border: none; border-radius: 0;
    font-size: 14px; font-weight: 700;
    cursor: pointer; transition: background 0.2s;
}

.discourse-reply-perm-save:hover { background: #e67e00; }





/* ============================================
   HASHTAGS & MENTIONS
   ============================================ */

a.discourse-hashtag,
a.discourse-mention {
    color: #ff9801 !important;
    font-weight: 600;
    text-decoration: none;
}

a.discourse-hashtag:hover,
a.discourse-mention:hover {
    color: #ff9801 !important;
    text-decoration: underline;
}

/* ============================================
   SAVE DRAFT MODAL — CANCEL BUTTON
   ============================================ */

.discourse-draft-cancel {
    background: transparent;
    border: 1px solid rgb(51, 51, 51);
    color: rgb(231, 233, 234);
    font-family: Nunito, sans-serif;
    font-size: 13px;
    font-weight: 600;
    padding: 6px 16px;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s ease;
    border-radius: 0;
    flex: 1;
}

.discourse-draft-cancel:hover {
    background: rgb(51, 51, 51);
    color: rgb(231, 233, 234);
}

body.light-mode .discourse-draft-cancel,
body:not(.dark-mode) .discourse-draft-cancel {
    border-color: rgb(221, 221, 221);
    color: rgb(83, 100, 113);
}

body.light-mode .discourse-draft-cancel:hover,
body:not(.dark-mode) .discourse-draft-cancel:hover {
    background: rgb(221, 221, 221);
    color: rgb(83, 100, 113);
}

/* ============================================================
   MENTION HIGHLIGHT — mirror backdrop
   ============================================================ */

.discourse-mention-highlight-wrapper {
    position: relative;
    width: 100%;
    overflow: hidden;
}

.discourse-mention-mirror {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    max-height: inherit;
    overflow: hidden !important;
    pointer-events: none;
    white-space: pre-wrap;
    word-wrap: break-word;
    background: transparent;
    border-width: 0 !important;
    border-style: solid;
    border-color: transparent;
    z-index: 0;
    margin: 0;
    padding-right: 14px;
    box-sizing: border-box;
}

.discourse-mention-highlight-wrapper textarea {
    position: relative;
    z-index: 1;
    background-color: transparent !important;
    color: transparent !important;
}

/* Edit modal textarea — override transparent text from mention wrapper */
#discourse-edit-modal-overlay .discourse-mention-highlight-wrapper textarea {
    color: #aaa !important;
    caret-color: rgb(170, 170, 170) !important;
}
body:not(.dark-mode) #discourse-edit-modal-overlay .discourse-mention-highlight-wrapper textarea {
    color: #333 !important;
    caret-color: #333 !important;
}
/* ============================================
   SEARCH PAGE TABS
   ============================================ */

.discourse-search-tabs {
    display: flex;
    border-bottom: 1px solid #333;
    position: sticky;
    top: 0;
    background: transparent;
    z-index: 100;
    backdrop-filter: blur(10px);
}

body:not(.dark-mode) .discourse-search-tabs {
    border-bottom-color: #ddd;
    background: rgba(255,255,255,0.85);
}

.discourse-search-tab {
    flex: 1;
    padding: 16px 8px;
    text-align: center;
    font-size: 15px;
    font-weight: 600;
    color: #666;
    cursor: pointer;
    position: relative;
    transition: all 0.2s;
    background: transparent;
    border: none;
    white-space: nowrap;
}

.discourse-search-tab:hover { color: #ff9801; background: rgba(255,152,1,0.05); }
.discourse-search-tab.active { color: #ff9801; }

.discourse-search-tab-indicator {
    position: absolute;
    bottom: -1px;
    left: 0; right: 0;
    height: 3px;
    background: #ff9801;
    opacity: 0;
    transition: opacity 0.2s;
}

.discourse-search-tab.active .discourse-search-tab-indicator { opacity: 1; }

/* ============================================
   SEARCH PEOPLE SECTION (Top tab + People tab)
   ============================================ */

.discourse-search-people-section {
    border-bottom: 1px solid #333;
}

body:not(.dark-mode) .discourse-search-people-section { border-bottom-color: #ddd; }

.discourse-search-section-title {
    padding: 12px 20px 8px;
    font-size: 20px;
    font-weight: 700;
    color: #aaa;
}

body:not(.dark-mode) .discourse-search-section-title { color: #555; }

.discourse-search-person {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 20px;
    transition: background 0.2s;
    cursor: pointer;
}

.discourse-search-person:hover { background: rgba(255,152,1,0.03); }

.discourse-search-person-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255,152,1,0.3);
    flex-shrink: 0;
    cursor: pointer;
    transition: border-color 0.2s;
}

.discourse-search-person-avatar:hover { border-color: #ff9801; }

.discourse-search-person-info {
    flex: 1;
    min-width: 0;
}

.discourse-search-person-name {
    font-size: 15px;
    font-weight: 700;
    color: #aaa;
    cursor: pointer;
    transition: color 0.2s;
    display: block;
    margin-bottom: 2px;
}

body:not(.dark-mode) .discourse-search-person-name { color: #0f1419; }
.discourse-search-person-name:hover { color: #ff9801 !important; }

.discourse-search-person-username {
    font-size: 14px;
    color: #666;
    display: block;
    margin-bottom: 4px;
}

.discourse-search-person-bio {
    font-size: 14px;
    color: #888;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

body:not(.dark-mode) .discourse-search-person-bio { color: #536471; }

.discourse-search-follow-btn {
    background: #ff9801;
    color: white;
    border: none;
    padding: 7px 18px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
    align-self: center;
    min-width: 90px;
    text-align: center;
}

.discourse-search-follow-btn:hover { background: #e67e00; }
.discourse-search-follow-btn:disabled { opacity: 0.6; cursor: not-allowed; }

.discourse-search-follow-btn.following {
    background: transparent;
    border: 1px solid #536471;
    color: #aaa;
}

body:not(.dark-mode) .discourse-search-follow-btn.following { color: #0f1419; }

.discourse-search-follow-btn.following:hover {
    background: rgba(244,33,46,0.1);
    border-color: rgba(244,33,46,0.4);
    color: #f4212e;
}

.discourse-search-view-all-btn {
    display: block;
    padding: 14px 20px;
    font-size: 15px;
    color: #ff9801;
    cursor: pointer;
    transition: background 0.2s;
    border: none;
    border-bottom: 1px solid #333;
    background: transparent;
    width: 100%;
    text-align: left;
}
body:not(.dark-mode) .discourse-search-view-all-btn { border-bottom-color: #ddd; }
.discourse-search-view-all-btn:hover { background: rgba(255,152,1,0.05); }

.discourse-search-posts-title {
    padding: 16px 20px 8px;
    font-size: 20px;
    font-weight: 700;
    color: #aaa;
}
body:not(.dark-mode) .discourse-search-posts-title {
    color: #555;
}

/* ── Dropdown people section ── */
.discourse-search-dropdown-people {
    border-bottom: 1px solid #e1e1e1;
}
body.dark-mode .discourse-search-dropdown-people { border-bottom-color: #333; }

.discourse-search-dropdown-person {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    cursor: pointer;
    transition: background 0.15s;
    text-decoration: none;
}

.discourse-search-dropdown-person:hover { background: rgba(255,152,1,0.08); }

.discourse-search-dropdown-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.discourse-search-dropdown-info {
    flex: 1;
    min-width: 0;
}

.discourse-search-dropdown-name {
    font-size: 14px;
    font-weight: 600;
    color: #0f1419;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}
body.dark-mode .discourse-search-dropdown-name { color: #fff; }

.discourse-search-dropdown-handle {
    font-size: 13px;
    color: #888;
    display: block;
}

.discourse-search-dropdown-follow {
    background: #ff9801;
    color: white;
    border: none;
    padding: 5px 12px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.2s;
}

.discourse-search-dropdown-follow:hover { background: #e67e00; }

.discourse-search-dropdown-follow.following {
    background: transparent;
    border: 1px solid #666;
    color: #aaa;
}

.discourse-search-dropdown-follow.following:hover {
    background: rgba(244,33,46,0.1);
    border-color: rgba(244,33,46,0.4);
    color: #f4212e;
}

/* Loading / empty states for search tabs */
.discourse-search-tab-loading { text-align: center; padding: 40px; color: #888; font-size: 15px; }

/* Announcement button active state */
.discourse-composer-icon-btn.announcement-active {
    color: #ff9801 !important;
}

.discourse-members-only-indicator {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
    margin-right: 32px;
    color: #ff9801;
    opacity: 0.75;
    cursor: default;
    position: relative;
}
.discourse-members-only-indicator svg {
    fill: currentColor;
    flex-shrink: 0;
}
.discourse-members-only-indicator[data-tooltip]::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(8px);
    background: rgba(255,152,1,0.15);
    color: #ff9801;
    padding: 4px 8px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s, transform 0.2s;
    z-index: 1000;
    border: 1px solid rgba(255,152,1,0.3);
    margin-bottom: 4px;
}
.discourse-members-only-indicator[data-tooltip]:hover::before {
    opacity: 1;
    transform: translateX(-50%) translateY(-4px);
}

/* Announcement badge on posts */
.discourse-announcement-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 700;
    color: #ff9801;
    padding: 8px 16px 6px;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}
.discourse-announcement-badge svg {
    width: 13px;
    height: 13px;
    fill: #ff9801;
    flex-shrink: 0;
}

/* Announcements tab unread badge */
.tab-unread-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #ff9801;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    border-radius: 50%;
    padding: 0 4px;
    margin-left: 4px;
    line-height: 1;
    vertical-align: middle;
}

/* Visibility button icon toggle */
.discourse-visibility-btn .visibility-icon-members { display: none; }
.discourse-visibility-btn[data-visibility="members"] .visibility-icon-public { display: none !important; }
.discourse-visibility-btn[data-visibility="members"] .visibility-icon-members { display: block !important; }

/* Announcement button active — fill the icon */
.discourse-composer-icon-btn.announcement-active svg,
.discourse-composer-icon-btn.announcement-active svg path {
    fill: #ff9801 !important;
}

/* Composer button tooltips — matches post action tooltip style */
.discourse-composer-icon-btn[data-tooltip]::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(8px);
    background: rgba(255,152,1,0.15);
    color: #ff9801;
    padding: 4px 8px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s, transform 0.2s;
    z-index: 9999;
    border: 1px solid rgba(255,152,1,0.3);
}
.discourse-composer-icon-btn[data-tooltip]:hover::before {
    opacity: 1;
    transform: translateX(-50%) translateY(-4px);
}
.discourse-composer-icon-btn[data-tooltip]::after {
    display: none;
}

/* ── Hashtag highlighting ── */
.discourse-composer-textarea.hashtag-highlight-active {
    color: transparent !important;
    caret-color: #555;
    background: transparent !important;
    position: relative;
    z-index: 2;
}
body.dark-mode .discourse-composer-textarea.hashtag-highlight-active {
    caret-color: #e7e9ea;
}
.discourse-hashtag-mirror {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
    color: transparent;
    white-space: pre-wrap;
    word-break: break-word;
    margin: 0;
}
.discourse-hashtag-mirror .dht {
    color: #ff9801;
}

/* ── Search page trending section ── */
.discourse-search-trending-section {
    margin-top: 8px;
}
.discourse-search-trending-list {
    display: flex;
    flex-direction: column;
}
.discourse-search-trending-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid #2f3336;
    transition: background 0.15s;
}
body:not(.dark-mode) .discourse-search-trending-row {
    border-bottom-color: #eee;
}
.discourse-search-trending-row:hover {
    background: rgba(255, 152, 1,0.04);
}
.discourse-search-trending-topic {
    font-size: 15px;
    font-weight: 700;
    color: #e7e9ea;
}
body:not(.dark-mode) .discourse-search-trending-topic {
    color: #0f1419;
}
.discourse-search-trending-count {
    font-size: 13px;
    color: #71767b;
    margin-top: 2px;
}
/* ── Profile message buttons ── */
.discourse-profile-info-section { position: relative; }

.discourse-profile-msg-btn {
    position: absolute;
    top: 60px;
    right: 16px;
    background: none;
    border: none;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    padding: 0;
    color: #ff9801;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, opacity 0.1s;
    opacity: 0.85;
}
.discourse-profile-msg-btn:hover {
    opacity: 1;
    background: rgba(255, 152, 1,0.1);
}
.discourse-profile-msg-btn svg { width: 34px; height: 34px; }

#profile-message-btn,
#profile-messaging-toggle-btn {
    position: absolute !important;
    top: 60px !important;
    right: 16px !important;
}

/* Tooltip */
.discourse-profile-msg-btn[data-tooltip]::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(8px);
    background: rgba(255,152,1,0.15);
    color: #ff9801;
    padding: 4px 8px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s, transform 0.2s;
    z-index: 9999;
    border: 1px solid rgba(255,152,1,0.3);
}
.discourse-profile-msg-btn[data-tooltip]:hover::before {
    opacity: 1;
    transform: translateX(-50%) translateY(-4px);
}
.discourse-profile-msg-btn[data-tooltip]::after { display: none; }

/* Disabled state */
#profile-messaging-toggle-btn.active {
    color: #555;
    position: relative;
}
#profile-messaging-toggle-btn.active svg rect,
#profile-messaging-toggle-btn.active svg path {
    fill: #555;
}
#profile-messaging-toggle-btn.active::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 10%;
    width: 80%;
    height: 2px;
    background: #555;
    transform: translateY(-50%);
    pointer-events: none;
}

/* ── Search dropdown scrollbar ── */
.discourse-search-results::-webkit-scrollbar { width: 6px; }
.discourse-search-results::-webkit-scrollbar-track { background: transparent; }
.discourse-search-results::-webkit-scrollbar-thumb { background: rgba(255, 152, 1,0.4); }
.discourse-search-results::-webkit-scrollbar-thumb:hover { background: #ff9801; }
.discourse-search-results { scrollbar-width: thin; scrollbar-color: rgba(255, 152, 1,0.4) transparent; }


/* ============================================
   VERIFIED BADGE
   ============================================ */

.discourse-main-post-name .discourse-verified-badge {
    margin-left: 4px;
}

.discourse-verified-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    vertical-align: middle;
    margin-left: -3px;
    position: relative;
    top: -1px;
    border-radius: 50%;
    transition: background 0.2s;
    cursor: default;
}

.discourse-verified-badge:hover {
    background: rgba(255, 152, 1, 0.15);
}

.discourse-verified-badge svg {
    width: 16px;
    height: 16px;
    display: block;
}

.discourse-verified-badge.large {
    width: 24px;
    height: 24px;
}

.discourse-verified-badge.large svg {
    width: 20px;
    height: 20px;
}

/* Tooltip */
.discourse-verified-badge::after {
    content: 'Verified';
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 152, 1,0.15);
    color: #ff9801;
    border: 1px solid rgba(255, 152, 1,0.3);
    padding: 3px 8px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    z-index: 9999;
}

.discourse-verified-badge:hover::after {
    opacity: 1;
}

/* ============================================
   IMAGE UPLOAD — PREVIEW TILES
   ============================================ */

.discourse-image-preview-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 0 0 8px 0;
    min-height: 0;
    margin-top: 12px;
}

.discourse-image-preview {
    position: relative;
    width: 80px;
    height: 80px;
    border: 1px solid #333;
    overflow: hidden;
    flex-shrink: 0;
}

body:not(.dark-mode) .discourse-image-preview {
    border-color: #ddd;
}

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

.discourse-image-preview.discourse-image-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 152, 1,0.05);
}

.discourse-image-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 152, 1,0.2);
    border-top-color: #ff9801;
    border-radius: 50%;
    animation: discourse-spin 0.7s linear infinite;
}

@keyframes discourse-spin {
    to { transform: rotate(360deg); }
}

.discourse-image-remove {
    position: absolute;
    top: 3px;
    right: 3px;
    width: 20px;
    height: 20px;
    background: rgba(0,0,0,0.7);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background 0.2s;
}

.discourse-image-remove:hover {
    background: rgba(220,53,69,0.85);
}

.discourse-image-error {
    width: 100%;
    font-size: 12px;
    color: #dc3545;
    padding: 4px 0;
    font-weight: 600;
}

/* Images rendered inside posts */
.discourse-post-images {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 10px;
}

.discourse-post-images img {
    max-width: 100%;
    max-height: 360px;
    object-fit: cover;
    cursor: pointer;
    border: 1px solid #333;
    display: block;
}

body:not(.dark-mode) .discourse-post-images img {
    border-color: #ddd;
}

.discourse-post-images.multi-image img {
    width: calc(50% - 2px);
    max-height: 200px;
}

/* ── GIF Picker ── */
.dgp-picker {
    position: fixed;
    z-index: 9999997;
    background: var(--bg-primary, #fff);
    border: 1px solid var(--border-color, #ddd);
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    flex-direction: column;
    overflow: hidden;
}
.dark-mode .dgp-picker { background: #1a1a1a; border-color: #333; }
.dgp-search-row { padding: 8px; border-bottom: 1px solid var(--border-color, #ddd); }
.dark-mode .dgp-search-row { border-color: #333; }
.dgp-search-input { width: 100%; padding: 8px 12px; border: 1px solid #ddd; background: transparent; color: inherit; font-size: 14px; outline: none; box-sizing: border-box; font-family: inherit; }
.dark-mode .dgp-search-input { border-color: #444; }
.dgp-search-input:focus { border-color: #ff9801; }
.dgp-grid { flex: 1; overflow-y: auto; display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; padding: 4px; }
.dgp-item { width: 100%; height: 80px; object-fit: cover; cursor: pointer; display: block; }
.dgp-item:hover { opacity: 0.75; }
.dgp-msg { grid-column: 1 / -1; padding: 24px; text-align: center; color: #888; font-size: 13px; }
.dgp-footer { padding: 5px 8px; font-size: 11px; color: #888; text-align: right; border-top: 1px solid var(--border-color, #ddd); flex-shrink: 0; }
.dark-mode .dgp-footer { border-color: #333; }
.dgp-gif-label { position: absolute; top: 4px; left: 4px; background: rgba(0,0,0,0.6); color: #fff; font-size: 10px; font-weight: 700; padding: 2px 5px; letter-spacing: 0.5px; }


/* ── Emoji Picker ── */
.dep-picker { position:fixed; z-index:9999997; flex-direction:column; overflow:hidden; background:var(--bg-primary,#fff); border:1px solid var(--border-color,#ddd); box-shadow:0 4px 20px rgba(0,0,0,0.2); }
.dark-mode .dep-picker { background:#1a1a1a; border-color:#333; }
.dep-search-row { padding:8px; border-bottom:1px solid var(--border-color,#ddd); flex-shrink:0; }
.dark-mode .dep-search-row { border-color:#333; }
.dep-search-input { width:100%; padding:7px 12px; border:1px solid #ddd; background:transparent; color:inherit; font-size:14px; outline:none; box-sizing:border-box; font-family:inherit; }
.dark-mode .dep-search-input { border-color:#444; }
.dep-search-input:focus { border-color:#ff9801; }
.dep-tabs { display:flex; overflow-x:auto; padding:4px 6px; gap:2px; border-bottom:1px solid var(--border-color,#ddd); flex-shrink:0; scrollbar-width:none; }
.dep-tabs::-webkit-scrollbar { display:none; }
.dark-mode .dep-tabs { border-color:#333; }
.dep-tab { background:none; border:none; cursor:pointer; font-size:18px; padding:4px 6px; border-radius:4px; opacity:0.5; transition:opacity 0.15s, background 0.15s; flex-shrink:0; }
.dep-tab:hover { opacity:1; background:rgba(255, 152, 1,0.1); }
.dep-tab.active { opacity:1; background:rgba(255, 152, 1,0.15); }
.dep-cat-label { padding:4px 10px; font-size:11px; font-weight:600; color:#888; text-transform:uppercase; letter-spacing:0.5px; flex-shrink:0; }
.dep-grid { flex:1; overflow-y:auto; display:grid; grid-template-columns:repeat(8,1fr); padding:4px; }
.dep-emoji { background:none; border:none; cursor:pointer; font-size:22px; padding:4px; border-radius:4px; line-height:1; transition:background 0.1s; }
.dep-emoji:hover { background:rgba(255, 152, 1,0.15); }

//* Emoji + GIF picker scrollbars */
.dep-grid::-webkit-scrollbar,
.dgp-grid::-webkit-scrollbar { width: 6px; height: 6px; }
.dep-grid::-webkit-scrollbar-track,
.dgp-grid::-webkit-scrollbar-track { background: transparent; }
.dep-grid::-webkit-scrollbar-thumb,
.dgp-grid::-webkit-scrollbar-thumb { background: rgba(255, 152, 1,0.4); }
.dep-grid::-webkit-scrollbar-thumb:hover,
.dgp-grid::-webkit-scrollbar-thumb:hover { background: #ff9801; }
.dep-grid { scrollbar-width: thin; scrollbar-color: rgba(255, 152, 1,0.4) transparent; }
.dgp-grid { scrollbar-width: thin; scrollbar-color: rgba(255, 152, 1,0.4) transparent; }

/* ── Poll Composer Builder ── */
.dpc-builder { border:1px solid #333; padding:12px; margin:8px 0; background:rgba(255, 152, 1,0.03); }
body:not(.dark-mode) .dpc-builder { border-color:#ddd; }
.dpc-header { display:flex; align-items:center; justify-content:space-between; margin-bottom:12px; flex-wrap:wrap; gap:8px; }
.dpc-title { font-size:12px; font-weight:700; color:#ff9801; text-transform:uppercase; letter-spacing:0.5px; }
.dpc-vote-type { display:flex; gap:4px; }
.dpc-type-btn { background:none; border:1px solid #ff9801; color:#ff9801; font-size:12px; font-weight:600; padding:4px 10px; cursor:pointer; transition:all 0.15s; }
.dpc-type-btn.active { border-color:#ff9801; color:#ff9801; background:rgba(255, 152, 1,0.08); }
.dpc-type-btn:hover:not(.active) { background:rgba(255, 152, 1,0.05); }
.dpc-options { display:flex; flex-direction:column; gap:6px; margin-bottom:8px; }
.dpc-option-row { position:relative; display:flex; align-items:center; }
.dpc-option-input { flex:1; background:transparent; border:1px solid #333; color:#aaa; font-size:14px; font-family:inherit; padding:7px 28px 7px 10px; outline:none; transition:border-color 0.15s; }
.dark-mode .dpc-builder .dpc-option-input,
.dark-mode .dpc-builder .dpc-option-input:focus,
.dark-mode .dpc-builder input.dpc-option-input { color:rgb(170,170,170) !important; }
body:not(.dark-mode) .dpc-option-input { border-color:#ddd; color:#333; }
.dpc-option-input:focus { border-color:#ff9801; }
.dpc-option-input::placeholder { color:#666; }
.dpc-option-remove { position:absolute; right:6px; top:50%; transform:translateY(-50%); background:none; border:none; color:#666; font-size:16px; cursor:pointer; width:20px; height:20px; display:flex; align-items:center; justify-content:center; padding:0; transition:color 0.15s; flex-shrink:0; line-height:1; }
.dpc-option-remove:hover { color:#dc3545; }
.dpc-add-btn { background:none; border:none; color:#ff9801; font-size:13px; font-weight:600; cursor:pointer; padding:4px 0; transition:opacity 0.15s; }
.dpc-add-btn:hover { opacity:0.8; }

/* ── Poll Display in Posts ── */
.discourse-post-poll { border:1px solid #333; margin-top:12px; overflow:hidden; }
body:not(.dark-mode) .discourse-post-poll { border-color:#ddd; }
.dpp-vote-type-label { font-size:11px; color:#888; padding:8px 12px 0; font-weight:600; text-transform:uppercase; letter-spacing:0.3px; }
.dpp-options { padding:8px 12px; display:flex; flex-direction:column; gap:6px; }
.dpp-option { position:relative; border:1px solid #333; cursor:pointer; transition:border-color 0.15s; overflow:hidden; min-height:36px; display:flex; align-items:center; }
body:not(.dark-mode) .dpp-option { border-color:#ddd; }
.dpp-option:hover:not(.voted) { border-color:#ff9801; }
.dpp-option.selected { border-color:#ff9801; }
.dpp-option.voted { cursor:default; }
.dpp-option-bar { position:absolute; top:0; left:0; bottom:0; background:rgba(255, 152, 1,0.12); transition:width 0.4s ease; pointer-events:none; width:0; }
.dpp-option.selected .dpp-option-bar { background:rgba(255, 152, 1,0.2); }
.dpp-option-content { position:relative; display:flex; align-items:center; padding:8px 12px; width:100%; z-index:1; gap:8px; box-sizing:border-box; }
.dpp-option-check { width:16px; height:16px; border:2px solid #555; flex-shrink:0; display:flex; align-items:center; justify-content:center; transition:all 0.15s; }
body:not(.dark-mode) .dpp-option-check { border-color:#ccc; }
.dpp-option.selected .dpp-option-check { border-color:#ff9801; background:transparent; }
.dpp-option-check-dot { width:10px; height:10px; background:#ff9801; display:none; border-radius:0; }
.dpp-option.selected .dpp-option-check-dot { display:block; }
.dpp-option-text { flex:1; font-size:14px; color:#aaa; }
body:not(.dark-mode) .dpp-option-text { color:#333; }
.dpp-option-pct { font-size:13px; font-weight:700; color:#888; min-width:38px; text-align:right; }
.dpp-footer { display:flex; align-items:center; justify-content:space-between; padding:8px 12px 10px; border-top:1px solid #333; gap:8px; }
body:not(.dark-mode) .dpp-footer { border-top-color:#ddd; }
.dpp-vote-count { font-size:12px; color:#888; }
.dpp-submit-btn { background:#ff9801; color:#fff; border:none; padding:6px 16px; font-size:13px; font-weight:700; cursor:pointer; transition:background 0.15s; }
.dpp-submit-btn:hover { background:#e67e00; }
.dpp-submit-btn:disabled { opacity:0.5; cursor:not-allowed; }

/* Hide footer on all Discourse pages */
body:has(.discourse-full-container) footer,
body:has(.discourse-full-container) .site-footer,
body:has(.discourse-full-container) #colophon,
body:has(.discourse-full-container) #footer {
    display: none !important;
}

/* ============================================================
   REPLY MODAL
   ============================================================ */
#discourse-reply-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 99999;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 5vh;
}

#discourse-reply-modal {
    background: #1a1a1a;
    overflow: visible;
    width: 600px;
    max-width: 90vw;
    max-height: 85vh;
    border-radius: 0;
    display: flex;
    flex-direction: column;
    border: 1px solid #444;
    box-shadow: 0 4px 32px rgba(0,0,0,0.3);
}

body:not(.dark-mode) #discourse-reply-modal {
    background: #fff;
    border-color: #ddd;
}

.drm-header {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 16px;
    min-height: 48px;
    position: relative;
}

.drm-header-title {
    font-size: 20px;
    font-weight: 700;
    color: rgb(237, 237, 237);
}

body:not(.dark-mode) .drm-header-title { color: #333; }

.drm-close {
    position: absolute;
    right: 14px;
    top: 14px;
    transform: none;
    background: none;
    border: none;
    cursor: pointer;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    padding: 0;
    line-height: 1;
    transition: background 0.2s;
}

.drm-close:hover { background: rgba(255, 152, 1, 0.1); }

.drm-close svg {
    width: 20px;
    height: 20px;
    fill: #aaa;
}

body:not(.dark-mode) .drm-close svg { fill: #555; }

.drm-body { padding: 0 16px 16px; }

/* Parent post row */
.drm-parent-row {
    display: flex;
    gap: 12px;
    padding-bottom: 4px;
}

.drm-parent-left {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-shrink: 0;
}

.drm-parent-left {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-shrink: 0;
    position: relative;
}

.drm-connector-line {
    width: 2px;
    height: 0;
    background: #333;
    margin-top: 4px;
    position: absolute;
    top: 41px;
    left: 50%;
    transform: translateX(-50%);
}

body:not(.dark-mode) .drm-connector-line { background: #ddd; }

.drm-parent-content { flex: 1; min-width: 0; }

.drm-parent-meta {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
    margin-bottom: 4px;
}

body:not(.dark-mode) .drm-name { color: #0f1419; }

.drm-username, .drm-time, .drm-dot {
    font-size: 14px;
    color: #71767b;
}

.drm-parent-text {
    font-size: 15px;
    line-height: 22px;
    color: #aaa;
    margin-bottom: 12px;
    word-break: break-word;
    white-space: pre-wrap;
}

body:not(.dark-mode) .drm-parent-text { color: #555; }

.drm-replying-to {
    font-size: 14px;
    color: #71767b;
    margin-bottom: 8px;
}

.drm-replying-handle { color: #ff9801; }

/* Composer row */
.drm-composer-row {
    display: flex;
    gap: 12px;
    padding-top: 4px;
}

.drm-composer-left { flex-shrink: 0; }

.drm-composer-content { flex: 1; min-width: 0; }

body:not(.dark-mode) #drm-textarea { color: #555; }

#drm-textarea::placeholder { color: #555; }

body:not(.dark-mode) #drm-textarea::placeholder { color: #aaa; }

.drm-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 8px;
    border-top: 1px solid #2f3336;
    margin-top: 4px;
}

body:not(.dark-mode) .drm-toolbar { border-top-color: #eff3f4; }

.drm-toolbar-left {
    display: flex;
    align-items: center;
    gap: 4px;
}

.drm-toolbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* ── Modal toolbar icon buttons (all modals) ─────────────────── */
.drm-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    background: transparent;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    padding: 6px;
    transition: background 0.15s;
    /* No position:relative — tooltip is fixed, not child-positioned */
}

.drm-icon-btn svg {
    width: 20px;
    height: 20px;
    fill: rgb(255, 152, 1);
    transition: fill 0.15s;
    display: block;
}

.drm-icon-btn:hover {
    background: rgba(255, 152, 1, 0.12);
}

/* Kill any hint.css interference */
.drm-icon-btn::before,
.drm-icon-btn::after { display: none !important; content: none !important; }

/* Char counter */
.drm-char-counter {
    display: flex;
    align-items: center;
    gap: 8px;
}

.drm-char-counter svg {
    width: 28px;
    height: 28px;
    transform: rotate(-90deg);
}

.drm-char-counter circle {
    fill: none;
    stroke: #333;
    stroke-width: 2.5;
    stroke-dasharray: 84;
    stroke-dashoffset: 0;
}

body:not(.dark-mode) .drm-char-counter circle { stroke: #ddd; }

.drm-char-counter .drm-progress {
    stroke: #ff9801;
    stroke-dashoffset: 84;
    transition: stroke-dashoffset 0.1s;
}

#drm-char-count {
    font-size: 13px;
    color: #71767b;
    min-width: 24px;
    text-align: center;
}


.drm-submit-btn {
    background: rgb(255, 152, 1);
    color: #fff;
    border: none;
    padding: 8px 18px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    border-radius: 0;
    transition: background 0.2s;
}

.drm-submit-btn:hover:not(:disabled) { background: rgb(230, 137, 0); }

.drm-submit-btn:disabled {
    opacity: 0.5;
    cursor: default;
}
/* Move close button to top right */

.discourse-parent-actions .hint--top::after,
.discourse-parent-actions [aria-label]::after {
    display: none !important;
    content: none !important;
}

.discourse-parent-actions .discourse-post-action[data-tooltip]::before {
    content: attr(data-tooltip) !important;
    position: absolute !important;
    bottom: 100% !important;
    left: 50% !important;
    transform: translateX(-50%) translateY(8px) !important;
    background: rgba(255,152,1,0.15) !important;
    color: #ff9801 !important;
    padding: 4px 8px !important;
    font-size: 11px !important;
    font-weight: 600 !important;
    white-space: nowrap !important;
    border: 1px solid rgba(255,152,1,0.3) !important;
    opacity: 0 !important;
    pointer-events: none !important;
    transition: opacity 0.2s, transform 0.2s !important;
    z-index: 1000 !important;
}

.discourse-parent-actions .discourse-post-action[data-tooltip]:hover::before {
    opacity: 1 !important;
    transform: translateX(-50%) translateY(-4px) !important;
}

.discourse-parent-actions {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    margin-top: 12px !important;
    padding-right: 0 !important;
    width: 100% !important;
}

.discourse-parent-actions .discourse-post-action {
    flex: 1 !important;
    justify-content: center !important;
    padding: 8px 12px !important;
    border-radius: 0 !important;
}

.discourse-parent-actions .discourse-post-action:hover {
    background: transparent !important;
}

/* Remove separator under modal titles */
.discourse-edit-modal-header,
#discourse-reply-modal .drm-header,
.global-composer-header {
    border-bottom: none !important;
}

.discourse-compose-avatar,
.discourse-edit-avatar,
.discourse-composer-avatar {
    cursor: pointer;
    transition: border-color 0.2s, opacity 0.2s;
}

.discourse-compose-avatar:hover,
.discourse-edit-avatar:hover,
.discourse-composer-avatar:hover {
    border-color: #ff9801;
    opacity: 0.85;
}

.discourse-post-box .discourse-composer-header,
.discourse-compose .discourse-composer-header {
    border-bottom: none !important;
}

#discourse-edit-modal-overlay .discourse-composer-icon-btn[data-tooltip]::before {
    content: attr(data-tooltip) !important;
    position: absolute !important;
    bottom: 100% !important;
    left: 50% !important;
    transform: translateX(-50%) translateY(8px) !important;
    background: rgba(255,152,1,0.15) !important;
    color: #ff9801 !important;
    padding: 4px 8px !important;
    font-size: 11px !important;
    font-weight: 600 !important;
    white-space: nowrap !important;
    border: 1px solid rgba(255,152,1,0.3) !important;
    opacity: 0 !important;
    pointer-events: none !important;
    transition: opacity 0.2s, transform 0.2s !important;
    z-index: 1000 !important;
}

#discourse-edit-modal-overlay .discourse-composer-icon-btn[data-tooltip]:hover::before {
    opacity: 1 !important;
    transform: translateX(-50%) translateY(-4px) !important;
}

#discourse-edit-modal-overlay .discourse-composer-icon-btn[aria-label]::after,
#discourse-edit-modal-overlay .discourse-composer-icon-btn[title]::after {
    display: none !important;
}
.discourse-quote-modal-footer {
    padding: 12px 12px 12px 80px !important;
}

.discourse-quote-modal-footer::before {
    left: 80px !important;
    right: 12px !important;
}

.discourse-quote-icon-btn {
    width: 36px !important;
    height: 36px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: none !important;
    border: none !important;
    border-radius: 50% !important;
    cursor: pointer !important;
    color: rgb(255, 152, 1) !important;
    transition: background 0.2s !important;
    position: relative !important;
    padding: 0 !important;
}

.discourse-quote-icon-btn:hover {
    background: rgba(255, 152, 1, 0.1) !important;
}

.discourse-quote-icon-btn svg {
    width: 20px !important;
    height: 20px !important;
    fill: rgb(255, 152, 1) !important;
}

.discourse-quote-icon-btn[title]::after {
    display: none !important;
    content: none !important;
}

.discourse-quote-icon-btn[title]::before {
    content: attr(title) !important;
    position: absolute !important;
    bottom: 100% !important;
    left: 50% !important;
    transform: translateX(-50%) translateY(8px) !important;
    background: rgba(255,152,1,0.15) !important;
    color: rgb(255,152,1) !important;
    padding: 4px 8px !important;
    font-size: 11px !important;
    font-weight: 600 !important;
    white-space: nowrap !important;
    border: 1px solid rgba(255,152,1,0.3) !important;
    opacity: 0 !important;
    pointer-events: none !important;
    transition: opacity 0.2s, transform 0.2s !important;
    z-index: 1000 !important;
}

.discourse-quote-icon-btn[title]:hover::before {
    opacity: 1 !important;
    transform: translateX(-50%) translateY(-4px) !important;
}


.discourse-quote-modal-header {
    border-bottom: none !important;
}
#discourse-edit-modal-overlay .discourse-composer-tools {
    margin-left: -8px !important;
}

.discourse-composer-icon-btn {
    color: rgb(255, 152, 1) !important;
}

.discourse-composer-icon-btn svg {
    fill: rgb(255, 152, 1) !important;
}

.discourse-composer-icon-btn:hover {
    background: rgba(255, 152, 1, 0.1) !important;
}

/* ── Mention dropdown — always on top of everything ── */
.discourse-mention-dropdown {
    position: fixed !important;
    z-index: 10000000 !important;
}

/* ── Edit modal — let dropdown escape overflow ── */
#discourse-edit-modal-overlay .discourse-edit-modal {
    overflow: visible;
}

#discourse-edit-modal-overlay .discourse-edit-modal-body {
    overflow-y: auto;
    max-height: calc(650px - 120px);
}

/* ── Fix attachment previews in all modals — prevent push-off ── */
#discourse-reply-modal .discourse-image-preview-container,
#discourse-edit-modal-overlay .discourse-image-preview-container {
    max-height: 180px;
    overflow-y: auto;
    flex-shrink: 0;
}

#discourse-edit-modal-overlay .discourse-edit-textarea {
    max-height: 250px !important;
}

/* ── Global fixed tooltip (escapes overflow:hidden on all modals) ── */
#discourse-fixed-tooltip {
    position: fixed;
    z-index: 2147483647;
    background: rgba(22, 22, 22, 0.94);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    line-height: 1;
    padding: 5px 9px;
    pointer-events: none;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.12s ease;
    transform: translateX(-50%);
    border: 1px solid rgba(255, 152, 1, 0.25);
}

#discourse-fixed-tooltip.visible {
    opacity: 1;
}

#discourse-fixed-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: rgba(22, 22, 22, 0.94);
}

/* ── Reply modal — consolidated single-source rules ── */
#drm-textarea {
    width: 100%;
    background: transparent;
    border: none;
    outline: none;
    resize: none;
    font-size: 16px;
    line-height: 24px;
    color: #aaa;
    min-height: 80px;
    max-height: 200px;
    overflow-y: scroll;
    padding: 8px 8px 0 0;
    caret-color: #aaa;
    font-family: inherit;
}

#drm-textarea::-webkit-scrollbar { width: 6px; }
#drm-textarea::-webkit-scrollbar-track { background: transparent; }
#drm-textarea::-webkit-scrollbar-thumb { background: rgba(255,152,1,0.3); border-radius: 0 !important; }
#drm-textarea::-webkit-scrollbar-thumb:hover { background: rgba(255,152,1,0.5); }

body:not(.dark-mode) #drm-textarea {
    color: #555;
    caret-color: #555;
}

.drm-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 152, 1, 0.35);
    cursor: pointer;
    transition: border-color 0.2s;
}

.drm-avatar:hover { border-color: #ff9801; }

.drm-name {
    font-weight: 700;
    font-size: 15px;
    color: #aaa;
    cursor: pointer;
    transition: color 0.2s;
}

body:not(.dark-mode) .drm-name { color: rgb(15, 20, 25); }
.drm-name:hover { color: #ff9801; }

#discourse-reply-modal {
    overflow: visible;
}

#discourse-reply-modal .drm-body {
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

/* ── Reply modal — mirror padding to match textarea + scrollbar ── */
#discourse-reply-modal .discourse-mention-mirror {
    padding-right: 14px !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
}

#discourse-reply-modal .discourse-mention-mirror {
    padding-right: 14px !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
    font-size: 16px !important;
    line-height: 24px !important;
    padding-top: 8px !important;
    padding-bottom: 0 !important;
    padding-left: 0 !important;
}

/* ── Quote modal — mirror padding to match textarea + scrollbar ── */
.discourse-quote-modal .discourse-mention-mirror {
    padding-right: 14px !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
}

/* ── Edit modal — mirror padding to match textarea + scrollbar ── */
#discourse-edit-modal-overlay .discourse-mention-mirror {
    padding-right: 14px !important;
    padding-left: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
    font-size: 16px !important;
    line-height: 24px !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
}

/* ── Standardized attachment spacing across ALL modals ── */
.discourse-composer-modal .discourse-image-preview-container,
#discourse-edit-modal-overlay .discourse-image-preview-container,
.discourse-quote-modal .discourse-image-preview-container,
#discourse-reply-modal .discourse-image-preview-container {
    margin-top: 10px !important;
    margin-bottom: 10px !important;
    padding: 0 !important;
}

/* When no images are present, collapse the empty container */
.discourse-image-preview-container:empty {
    margin: 0 !important;
}


/* ── Reply modal — every possible scroll container ── */


#discourse-reply-modal-overlay::-webkit-scrollbar,
#discourse-reply-modal::-webkit-scrollbar,
#discourse-reply-modal .drm-body::-webkit-scrollbar { width: 6px !important; }

#discourse-reply-modal-overlay::-webkit-scrollbar-track,
#discourse-reply-modal::-webkit-scrollbar-track,
#discourse-reply-modal .drm-body::-webkit-scrollbar-track { background: transparent !important; }

#discourse-reply-modal-overlay::-webkit-scrollbar-thumb,
#discourse-reply-modal::-webkit-scrollbar-thumb,
#discourse-reply-modal .drm-body::-webkit-scrollbar-thumb { background: rgba(255, 152, 1, 0.3) !important; border-radius: 0 !important; }

#discourse-reply-modal-overlay::-webkit-scrollbar-thumb:hover,
#discourse-reply-modal::-webkit-scrollbar-thumb:hover,
#discourse-reply-modal .drm-body::-webkit-scrollbar-thumb:hover { background: rgba(255, 152, 1, 0.5) !important; }

/* ── Edit modal — every possible scroll container ── */

#discourse-edit-modal-overlay::-webkit-scrollbar,
#discourse-edit-modal-overlay .discourse-edit-modal::-webkit-scrollbar,
#discourse-edit-modal-overlay .discourse-edit-modal-body::-webkit-scrollbar { width: 6px !important; }

#discourse-edit-modal-overlay::-webkit-scrollbar-track,
#discourse-edit-modal-overlay .discourse-edit-modal::-webkit-scrollbar-track,
#discourse-edit-modal-overlay .discourse-edit-modal-body::-webkit-scrollbar-track { background: transparent !important; }

#discourse-edit-modal-overlay::-webkit-scrollbar-thumb,
#discourse-edit-modal-overlay .discourse-edit-modal::-webkit-scrollbar-thumb,
#discourse-edit-modal-overlay .discourse-edit-modal-body::-webkit-scrollbar-thumb { background: rgba(255, 152, 1, 0.3) !important; border-radius: 0 !important; }

#discourse-edit-modal-overlay::-webkit-scrollbar-thumb:hover,
#discourse-edit-modal-overlay .discourse-edit-modal::-webkit-scrollbar-thumb:hover,
#discourse-edit-modal-overlay .discourse-edit-modal-body::-webkit-scrollbar-thumb:hover { background: rgba(255, 152, 1, 0.5) !important; }

/* ── Quote modal — every possible scroll container ── */


.discourse-quote-modal-overlay::-webkit-scrollbar,
.discourse-quote-modal::-webkit-scrollbar,
.discourse-quote-modal-body::-webkit-scrollbar { width: 6px !important; }

.discourse-quote-modal-overlay::-webkit-scrollbar-track,
.discourse-quote-modal::-webkit-scrollbar-track,
.discourse-quote-modal-body::-webkit-scrollbar-track { background: transparent !important; }

.discourse-quote-modal-overlay::-webkit-scrollbar-thumb,
.discourse-quote-modal::-webkit-scrollbar-thumb,
.discourse-quote-modal-body::-webkit-scrollbar-thumb { background: rgba(255, 152, 1, 0.3) !important; border-radius: 0 !important; }

.discourse-quote-modal-overlay::-webkit-scrollbar-thumb:hover,
.discourse-quote-modal::-webkit-scrollbar-thumb:hover,
.discourse-quote-modal-body::-webkit-scrollbar-thumb:hover { background: rgba(255, 152, 1, 0.5) !important; }



/* ── Reply modal body scrollbar (Chromium/Brave) ── */
#discourse-reply-modal .drm-body::-webkit-scrollbar { width: 6px; }
#discourse-reply-modal .drm-body::-webkit-scrollbar-track { background: transparent; }
#discourse-reply-modal .drm-body::-webkit-scrollbar-thumb { background: rgba(255, 152, 1, 0.3); border-radius: 0; }
#discourse-reply-modal .drm-body::-webkit-scrollbar-thumb:hover { background: rgba(255, 152, 1, 0.5); }

/* ── Edit modal body + modal scrollbar (Chromium/Brave) ── */
#discourse-edit-modal-overlay .discourse-edit-modal::-webkit-scrollbar,
#discourse-edit-modal-overlay .discourse-edit-modal-body::-webkit-scrollbar { width: 6px; }
#discourse-edit-modal-overlay .discourse-edit-modal::-webkit-scrollbar-track,
#discourse-edit-modal-overlay .discourse-edit-modal-body::-webkit-scrollbar-track { background: transparent; }
#discourse-edit-modal-overlay .discourse-edit-modal::-webkit-scrollbar-thumb,
#discourse-edit-modal-overlay .discourse-edit-modal-body::-webkit-scrollbar-thumb { background: rgba(255, 152, 1, 0.3); border-radius: 0; }
#discourse-edit-modal-overlay .discourse-edit-modal::-webkit-scrollbar-thumb:hover,
#discourse-edit-modal-overlay .discourse-edit-modal-body::-webkit-scrollbar-thumb:hover { background: rgba(255, 152, 1, 0.5); }

/* ── Quote modal body scrollbar (Chromium/Brave) ── */
.discourse-quote-modal-body::-webkit-scrollbar { width: 6px; }
.discourse-quote-modal-body::-webkit-scrollbar-track { background: transparent; }
.discourse-quote-modal-body::-webkit-scrollbar-thumb { background: rgba(255, 152, 1, 0.3); border-radius: 0; }
.discourse-quote-modal-body::-webkit-scrollbar-thumb:hover { background: rgba(255, 152, 1, 0.5); }



/* ============================================
   REFLECTION PICKER MODAL
   ============================================ */
.discourse-reflection-picker-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background: rgba(0,0,0,0.7);
    z-index: 999999;
    display: none;
    align-items: center !important;
    justify-content: center !important;
}

.discourse-reflection-picker-overlay.show {
    display: flex !important;
}

/* Account for WP admin bar */
body.admin-bar .discourse-reflection-picker-overlay {
    top: 32px !important;
}
@media screen and (max-width: 782px) {
    body.admin-bar .discourse-reflection-picker-overlay {
        top: 46px !important;
    }
}
.discourse-reflection-picker-overlay.show { display: flex; }

.discourse-reflection-picker-modal,
.discourse-reflection-viewer-modal {
    background: #1a1a1a;
    border: 1px solid #444;
    width: 600px;
    max-width: 90vw;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 32px rgba(0,0,0,0.3);
}
body:not(.dark-mode) .discourse-reflection-picker-modal,
body:not(.dark-mode) .discourse-reflection-viewer-modal { background: #fff; border-color: #ddd; }

.discourse-reflection-picker-header {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px 16px 16px;
    position: relative;
    min-height: 56px;
    box-sizing: border-box;
}

/* Keep header separator for the viewer modal only */
.discourse-reflection-viewer-modal .discourse-reflection-picker-header {
    border-bottom: 1px solid #333;
}
body:not(.dark-mode) .discourse-reflection-viewer-modal .discourse-reflection-picker-header {
    border-bottom-color: #eee;
}

.discourse-reflection-picker-header h2 {
    margin: 0;
    font-size: 17px;
    font-weight: 800;
    color: #aaa;
    line-height: 1;
}
body:not(.dark-mode) .discourse-reflection-picker-header h2 { color: #0f1419; }

.discourse-reflection-picker-close {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.2s;
}
.discourse-reflection-picker-close:hover { background: rgba(255,152,1,0.1); }

.discourse-reflection-picker-body {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}

.discourse-reflection-viewer-body {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
}

.discourse-reflection-picker-loading {
    text-align: center;
    padding: 40px 20px;
    color: #888;
    font-size: 14px;
}

.discourse-reflection-picker-item {
    padding: 14px 20px;
    border-top: 1px solid #2a2a2a;
    cursor: pointer;
    transition: background 0.15s;
}
body:not(.dark-mode) .discourse-reflection-picker-item { border-top-color: #f0f0f0; }
.discourse-reflection-picker-item:hover { background: rgba(255,152,1,0.05); }
.discourse-reflection-picker-item:hover .discourse-reflection-picker-item-title {
    color: #ff9801;
}

.discourse-reflection-picker-item-title {
    font-size: 15px;
    font-weight: 700;
    color: #e7e9ea;
}
body:not(.dark-mode) .discourse-reflection-picker-item-title { color: #0f1419; }

.discourse-reflection-picker-item-meta {
    font-size: 12px;
    color: #71767b;
    margin-bottom: 6px;
}

.discourse-reflection-picker-item-snippet {
    font-size: 13px;
    color: #aaa;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
body:not(.dark-mode) .discourse-reflection-picker-item-snippet { color: #555; }

.discourse-reflection-picker-visibility {
    display: inline-flex;
    align-items: center;
    font-size: 11px;
    font-weight: 600;
    font-family: Nunito, sans-serif;
    line-height: 1;
    padding: 3px 10px;
    margin-left: 8px;
    vertical-align: middle;
    text-align: center;
    border: 1px solid;
    box-sizing: border-box;
    height: 20px;
}

.discourse-reflection-picker-visibility[data-vis="public"] {
    color: rgb(70, 180, 80);
    border-color: rgb(70, 180, 80);
    background: rgba(70, 180, 80, 0.15);
}

.discourse-reflection-picker-visibility[data-vis="companions"] {
    color: rgb(255, 152, 1);
    border-color: rgb(255, 152, 1);
    background: rgba(255, 152, 1, 0.15);
}

.discourse-reflection-picker-visibility[data-vis="private"] {
    color: #888;
    border-color: #888;
    background: rgba(136, 136, 136, 0.15);
}

.discourse-reflection-picker-empty {
    text-align: center;
    padding: 40px 20px;
    color: #888;
    font-size: 14px;
}
.discourse-reflection-picker-empty-text {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 6px;
    color: #aaa;
}
body:not(.dark-mode) .discourse-reflection-picker-empty-text { color: #333; }
.discourse-reflection-picker-empty-subtext {
    font-size: 13px;
    color: #888;
    margin-bottom: 18px;
}
.discourse-reflection-picker-empty-btn,
a.discourse-reflection-picker-empty-btn {
    display: inline-block;
    background: #ff9801 !important;
    color: #fff !important;
    font-size: 14px;
    font-weight: 700;
    padding: 9px 20px;
    text-decoration: none !important;
    transition: background 0.2s;
    border: none;
    cursor: pointer;
}
.discourse-reflection-picker-empty-btn:hover,
a.discourse-reflection-picker-empty-btn:hover {
    background: #e68900 !important;
    color: #fff !important;
}

/* Reflection viewer body */
.discourse-reflection-viewer-body {
    padding: 20px 24px;
}
.discourse-reflection-viewer-body h3 {
    font-size: 20px;
    font-weight: 800;
    color: #e7e9ea;
    margin: 0 0 8px;
}
body:not(.dark-mode) .discourse-reflection-viewer-body h3 { color: #0f1419; }
.discourse-reflection-viewer-body .reflection-date {
    font-size: 12px;
    color: #71767b;
    margin-bottom: 16px;
}
.discourse-reflection-viewer-body .reflection-content {
    font-size: 15px;
    line-height: 1.7;
    color: #aaa;
    white-space: pre-wrap;
    word-wrap: break-word;
}
body:not(.dark-mode) .discourse-reflection-viewer-body .reflection-content { color: #333; }

.discourse-reflection-picker-item-title-row {
    display: flex;
    align-items: center;
    margin-bottom: 4px;
}



/* Reply modal — fully flush */
#discourse-reply-modal .drm-toolbar-left {
    margin-left: -8px;
}

/* Edit modal — flush with container left edge */
#discourse-edit-modal-overlay .discourse-edit-modal-footer .discourse-composer-tools {
    margin-left: -8px;
}

/* Quote modal — already close, just nudge */
.discourse-quote-modal-footer .discourse-composer-tools {
    margin-left: -7px;
}



/* Create post modal — stay inside footer padding (no negative margin) */
.discourse-composer-modal .discourse-composer-footer .discourse-composer-tools {
    margin-left: 0;
}



/* ============================================
   ATTACHED REFLECTION BLOCK (composer + feed)
   ============================================ */

.discourse-attached-reflection.discourse-attached-reflection-compact {
    padding: 10px 12px !important;
    margin-top: 8px;
    margin-bottom: 0;
    box-sizing: border-box;
    max-width: 100%;
}
.discourse-attached-reflection.discourse-attached-reflection-compact .discourse-attached-reflection-header {
    margin-bottom: 6px;
}
.discourse-attached-reflection.discourse-attached-reflection-compact .discourse-attached-reflection-title {
    font-size: 13px;
    margin-bottom: 4px;
    line-height: 1.3;
}
.discourse-attached-reflection.discourse-attached-reflection-compact .discourse-attached-reflection-snippet {
    font-size: 12px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    opacity: 0.85;
}
.discourse-attached-reflection.discourse-attached-reflection-compact .discourse-attached-reflection-label {
    font-size: 10px;
}
.discourse-attached-reflection.discourse-attached-reflection-compact .discourse-attached-reflection-icon {
    width: 12px;
    height: 12px;
}
.discourse-attached-reflection.discourse-attached-reflection-compact .discourse-attached-reflection-badge {
    font-size: 9px;
    padding: 2px 6px;
}

.discourse-attached-reflection {
    position: relative;
    border: 1px solid #444;
    padding: 12px 14px;
    margin-top: 12px;
    margin-bottom: 14px;
    background: rgba(255,152,1,0.03);
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}
body:not(.dark-mode) .discourse-attached-reflection {
    border-color: #ddd;
    background: rgba(255,152,1,0.04);
}

body:not(.dark-mode) .discourse-attached-reflection:hover {
    border-color: #ff9801 !important;
}

body:not(.dark-mode) .discourse-attached-reflection.discourse-attached-reflection-compact:hover {
    border-color: #ff9801 !important;
}

.discourse-attached-reflection:hover {
    border-color: #ff9801;
}
.discourse-attached-reflection-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}
.discourse-attached-reflection-icon {
    width: 14px;
    height: 14px;
    fill: #ff9801;
    flex-shrink: 0;
}
.discourse-attached-reflection-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #ff9801;
}
.discourse-attached-reflection-title {
    font-size: 15px;
    font-weight: 700;
    color: #e7e9ea;
    margin-bottom: 4px;
    line-height: 1.3;
}
body:not(.dark-mode) .discourse-attached-reflection-title { color: #0f1419; }
.discourse-attached-reflection-snippet {
    font-size: 13px;
    color: #aaa;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
body:not(.dark-mode) .discourse-attached-reflection-snippet { color: #555; }
.discourse-attached-reflection-remove {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 22px;
    height: 22px;
    border: none;
    background: rgba(0,0,0,0.5);
    color: #fff;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background 0.2s;
    z-index: 2;
}
.discourse-attached-reflection-remove:hover {
    background: rgba(220,53,69,0.85);
}
.discourse-attached-reflection-remove svg {
    width: 12px;
    height: 12px;
    fill: #fff;
}

/* Locked visibility button when reflection attached */
.discourse-composer-icon-btn.visibility-locked {
    opacity: 0.5;
    pointer-events: none;
}




.discourse-attached-reflection .discourse-reflection-readmore {
    background: transparent;
    border: none;
    color: #ff9801;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    padding: 8px 0 0 0;
    margin: 0;
    display: block;
    transition: color 0.2s;
}
.discourse-attached-reflection .discourse-reflection-readmore:hover {
    color: #ffb733;
    text-decoration: underline;
}
.discourse-attached-reflection.expanded .discourse-attached-reflection-snippet {
    display: block;
    -webkit-line-clamp: unset;
    overflow: visible;
    max-height: none;
    white-space: pre-wrap;
}



/* ============================================
   ATTACHED REFLECTION — VISIBILITY BADGE & READ MORE (feed)
   ============================================ */

.discourse-attached-reflection-header {
    flex-wrap: wrap;
}

.discourse-attached-reflection-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    font-size: 9px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 0;
    margin-left: auto;
}

.discourse-attached-reflection-badge.visibility-public {
    background: rgba(70, 180, 80, 0.15);
    color: #46b450;
}

.discourse-attached-reflection-badge.visibility-companions,
.discourse-attached-reflection-badge.visibility-members {
    background: rgba(255, 152, 1, 0.15);
    color: #ff9801;
}

.discourse-attached-reflection-badge.visibility-private {
    background: rgba(220, 80, 100, 0.15);
    color: #dc5064;
}

.discourse-attached-reflection-readmore {
    background: none;
    border: none;
    color: #ff9801;
    font-size: 12px;
    font-weight: 600;
    margin-top: 6px;
    padding: 4px 0;
    cursor: pointer;
    display: inline-block;
    font-family: inherit;
}

.discourse-attached-reflection-readmore:hover {
    text-decoration: underline;
}

.discourse-quoted-post-restricted {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 16px;
    border: 1px solid #444;
    border-radius: 0;
}

/* Dark mode is already the default here, but just in case there's a light variant: */
body:not(.dark-mode) .discourse-quoted-post-restricted {
    border-color: #ddd;
    color: #666;
    background: rgba(0, 0, 0, 0.02);
}

/* ============================================
   GATED PREVIEW (members-only posts for non-members)
   ============================================ */
.discourse-post-restricted {
    cursor: default;
}
.discourse-post-restricted:hover {
    background: transparent;
}
.discourse-post-restricted-content {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    margin-top: 8px;
    background: rgba(255, 152, 1, 0.05);
    border: 1px solid rgba(255, 152, 1, 0.2);
    border-radius: 0;
}
body.dark-mode .discourse-post-restricted-content {
    background: rgba(255, 152, 1, 0.06);
    border-color: rgba(255, 152, 1, 0.25);
}
.discourse-restricted-lock {
    color: #ff9801;
    flex-shrink: 0;
    opacity: 0.85;
}
.discourse-post-restricted-text {
    flex: 1;
    min-width: 0;
}
.discourse-post-restricted-title {
    font-size: 14px;
    font-weight: 600;
    color: #ff9801;
    margin-bottom: 2px;
}
.discourse-post-restricted-subtitle {
    font-size: 13px;
    color: #888;
    line-height: 1.4;
}
body:not(.dark-mode) .discourse-post-restricted-subtitle {
    color: #555;
}
.discourse-post-restricted-cta {
    display: inline-block;
    padding: 8px 14px;
    background: #ff9801;
    color: #fff !important;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none !important;
    white-space: nowrap;
    flex-shrink: 0;
    transition: background 0.2s;
}
.discourse-post-restricted-cta:hover {
    background: #e67e00;
    color: #fff !important;
    text-decoration: none !important;
}

body.dark-mode .discourse-post-restricted-subtitle {
    color: #aaa !important;
}
body.dark-mode .discourse-post-restricted-title {
    color: #ff9801 !important;
}

body.dark-mode .discourse-post-restricted-cta,
body.dark-mode a.discourse-post-restricted-cta {
    color: #fff !important;
}
body.dark-mode .discourse-post-restricted-cta:hover,
body.dark-mode a.discourse-post-restricted-cta:hover {
    color: #fff !important;
}

.discourse-main-post-author > .discourse-members-only-indicator {
    align-self: flex-start;
    margin-top: 8px;
    margin-left: auto;
}

.discourse-feed-nested-replies {
    overflow: visible !important;
}
/* === Hide tooltip pseudo-element when data-tooltip stripped by JS === */
.discourse-post-action:not([data-tooltip])::before,
.discourse-post-action:not([data-tooltip])::after,
.discourse-expand-replies:not([data-tooltip])::before,
.discourse-expand-replies:not([data-tooltip])::after,
.discourse-avatar-expand:not([data-tooltip])::before,
.discourse-avatar-expand:not([data-tooltip])::after,
.discourse-members-only-indicator:not([data-tooltip])::before,
.discourse-members-only-indicator:not([data-tooltip])::after,
.discourse-composer-icon-btn:not([data-tooltip])::before,
.discourse-composer-icon-btn:not([data-tooltip])::after,
.discourse-profile-msg-btn:not([data-tooltip])::before,
.discourse-profile-msg-btn:not([data-tooltip])::after {
    display: none !important;
    content: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}
/* === Hide avatar-modal X close button (click-outside/Esc still close) === */
#avatar-modal-close, .discourse-avatar-modal-close {
    display: none !important;
}
.discourse-nested-reply {

/* ── Modal button hover effects ── */
.discourse-modal-btn-primary:hover { background: #e68900 !important; }
.discourse-modal-btn-cancel:hover  { background: rgba(255,152,1,0.08) !important; color: #ff9801 !important; border-color: #ff9801 !important; }

/* Quote modal: match composer modal button size (30x30 with 17x17 SVG) */
.discourse-quote-modal .discourse-composer-icon-btn,
.discourse-quote-modal-overlay .discourse-composer-icon-btn {
    width: 30px !important;
    height: 30px !important;
}
.discourse-quote-modal .discourse-composer-icon-btn svg,
.discourse-quote-modal-overlay .discourse-composer-icon-btn svg {
    width: 17px !important;
    height: 17px !important;
}

/* Edit modal — match inline composer button size */
#discourse-edit-modal-overlay .discourse-composer-icon-btn {
    width: 30px !important;
    height: 30px !important;
}
#discourse-edit-modal-overlay .discourse-composer-icon-btn svg {
    width: 17px !important;
    height: 17px !important;
}

/* Reply modal — match inline composer button size */
#discourse-reply-modal-overlay .discourse-composer-icon-btn {
    width: 30px !important;
    height: 30px !important;
}
#discourse-reply-modal-overlay .discourse-composer-icon-btn svg {
    width: 17px !important;
    height: 17px !important;
}


/* === FINAL: Force 30/17 icon button size in all modal composers === */
body .discourse-quote-modal-overlay .discourse-composer-tools .discourse-composer-icon-btn,
body #discourse-edit-modal-overlay .discourse-composer-tools .discourse-composer-icon-btn,
body #discourse-reply-modal-overlay .discourse-composer-tools .discourse-composer-icon-btn {
    width: 30px !important;
    height: 30px !important;
}
body .discourse-quote-modal-overlay .discourse-composer-tools .discourse-composer-icon-btn svg,
body #discourse-edit-modal-overlay .discourse-composer-tools .discourse-composer-icon-btn svg,
body #discourse-reply-modal-overlay .discourse-composer-tools .discourse-composer-icon-btn svg {
    width: 17px !important;
    height: 17px !important;
}

/* Reply modal — space between reflection block and 'Replying to @user' */
#discourse-reply-modal .drm-parent-content .discourse-attached-reflection,
#discourse-reply-modal .drm-parent-content .discourse-attached-reflection.discourse-attached-reflection-compact {
    margin-bottom: 12px;
}

/* Reply modal — space below quote box (mirrors reflection spacing) */
#discourse-reply-modal .drm-parent-content .discourse-quoted-post-box {
    margin-bottom: 14px;
}

/* Soft-deleted post placeholder (Track A style) — high specificity to override conflicting rules */
body .discourse-post-deleted,
body div.discourse-post-deleted,
body div.discourse-main-post.discourse-post-deleted,
body div.discourse-parent-context.discourse-post-deleted,
body #main-post-container .discourse-post-deleted,
body #main-post-container div.discourse-post-deleted {
    padding: 24px 16px !important;
    background: rgba(128, 128, 128, 0.08) !important;
    border-bottom: 1px solid #2a2a2a !important;
    text-align: center !important;
    margin: 0 !important;
    display: block !important;
    color: #888 !important;
}
body:not(.dark-mode) .discourse-post-deleted,
body:not(.dark-mode) div.discourse-post-deleted,
body:not(.dark-mode) div.discourse-main-post.discourse-post-deleted,
body:not(.dark-mode) div.discourse-parent-context.discourse-post-deleted,
body:not(.dark-mode) #main-post-container .discourse-post-deleted,
body:not(.dark-mode) #main-post-container div.discourse-post-deleted {
    background: rgba(0, 0, 0, 0.04) !important;
    border-bottom-color: #eee !important;
}
body .discourse-post-deleted .discourse-post-deleted-text,
body #main-post-container .discourse-post-deleted .discourse-post-deleted-text {
    color: #888 !important;
    font-size: 14px !important;
    font-style: normal !important;
    line-height: 1.4 !important;
    margin: 0 !important;
    text-align: center !important;
    display: block !important;
}

/* Soft-deleted placeholder border (themed per mode) */
body.dark-mode .discourse-post-deleted {
    border-bottom: 1px solid #333 !important;
}
body:not(.dark-mode) .discourse-post-deleted {
    border-bottom: 1px solid #ddd !important;
}

/* Collapsible post content (4-line clamp with "Show more") — feeds only, not single-post highlighted */
.discourse-post-text.collapsible:not(.expanded) {
    display: -webkit-box !important;
    -webkit-line-clamp: 4 !important;
    line-clamp: 4 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
}
.discourse-readmore-btn {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    color: #ff9801 !important;
    cursor: pointer !important;
    padding: 0 !important;
    margin-top: 4px;
    font: inherit !important;
    font-weight: 500;
    display: inline-block;
    text-decoration: none !important;
}
.discourse-readmore-btn:hover,
.discourse-readmore-btn:focus,
.discourse-readmore-btn:active {
    text-decoration: none !important;
    color: #ff9801 !important;
    outline: none !important;
}
body:not(.dark-mode) .discourse-readmore-btn,
body:not(.dark-mode) .discourse-readmore-btn:hover {
    color: #1da1f2 !important;
}
/* ============================================================
   DISCOURSE_MOBILE_LAYOUT_V1
   On mobile (≤1024px), hide both left and right sidebars by
   default, expand the main content to fill the viewport.
   Sidebars will become slide-in drawers in batch 2.
   ============================================================ */
@media screen and (max-width: 1024px) {
    /* Container becomes single-column */
    body .discourse-full-container {
        display: block !important;
    }

    /* Hide left sidebar by default (will be toggled by drawer JS) */
    body .discourse-sidebar,
    body .discourse-left-sidebar {
        display: none !important;
    }

    /* Hide right sidebar by default (will be toggled by drawer JS) */
    body .discourse-right-sidebar {
        display: none !important;
    }

    /* Main content fills viewport */
    body .discourse-main-content {
        max-width: 100% !important;
        width: 100% !important;
        margin: 0 !important;
        border-left: none !important;
        border-right: none !important;
        box-sizing: border-box !important;
    }
}
/* ============================================================
   DISCOURSE_MOBILE_LAYOUT_V3
   The container has fixed padding (275px left, 350px right) to
   reserve space for absolutely-positioned sidebars. On mobile,
   zero out that padding so the main content can use the full
   viewport width.
   ============================================================ */
@media screen and (max-width: 1024px) {
    html body .discourse-full-container,
    body .discourse-full-container {
        padding-left: 0 !important;
        padding-right: 0 !important;
        max-width: 100% !important;
        width: 100% !important;
        display: block !important;
    }

    /* Sidebars: hide and remove from layout */
    html body .discourse-sidebar,
    html body .discourse-left-sidebar,
    html body .discourse-right-sidebar,
    body .discourse-sidebar,
    body .discourse-left-sidebar,
    body .discourse-right-sidebar {
        display: none !important;
    }

    /* Main content: full viewport width */
    html body .discourse-main-content,
    body .discourse-main-content {
        max-width: 100% !important;
        width: 100% !important;
        margin: 0 !important;
        border-left: none !important;
        border-right: none !important;
        box-sizing: border-box !important;
    }
}

/* EDIT_MODAL_OVERLAY_CLICKABLE: overlay must capture clicks so outside-click
   closes the modal and clicks don't fall through to the drawer/content behind. */
.discourse-edit-modal.show {
    pointer-events: auto !important;
    background: rgba(0, 0, 0, 0.6) !important;
}
.discourse-edit-modal.show .discourse-edit-modal-content {
    pointer-events: auto !important;
}

/* EDIT_MODAL_POINTER_FIX_V2: ID-level specificity to force pointer-events on overlay */
#edit-modal.discourse-edit-modal.show {
    pointer-events: auto !important;
    background: rgba(0, 0, 0, 0.6) !important;
}
#edit-modal.discourse-edit-modal.show > .discourse-edit-modal-content {
    pointer-events: auto !important;
}

/* ============================================
   CROP MODAL FINAL STYLING — clean ruleset
   ============================================ */

.discourse-crop-modal .discourse-crop-actions {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 10px !important;
    justify-content: center !important;
    margin: 20px auto 0 !important;
    box-sizing: border-box !important;
}

.discourse-crop-modal .discourse-crop-btn {
    flex: 1 1 100px !important;
    min-width: 100px !important;
    max-width: 220px !important;
    width: auto !important;
    padding: 12px 24px !important;
    box-sizing: border-box !important;
    border-radius: 0 !important;
}

.discourse-crop-modal .discourse-crop-cancel {
    background: transparent !important;
    color: #fff !important;
    border: 1px solid #fff !important;
}
body:not(.dark-mode) .discourse-crop-modal .discourse-crop-cancel {
    color: #333 !important;
    border: 1px solid #333 !important;
}
.discourse-crop-modal .discourse-crop-cancel:hover {
    background: rgba(255,255,255,0.08) !important;
}
body:not(.dark-mode) .discourse-crop-modal .discourse-crop-cancel:hover {
    background: rgba(0,0,0,0.05) !important;
}

.discourse-crop-modal .discourse-crop-save {
    background: #ff9801 !important;
    color: #fff !important;
    border: 1px solid #ff9801 !important;
}
.discourse-crop-modal .discourse-crop-save:hover {
    background: #e67e00 !important;
    border-color: #e67e00 !important;
}

.discourse-crop-modal-content { border-radius: 0 !important; }

#avatar-crop-modal.discourse-crop-modal {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background: rgba(0,0,0,0.9) !important;
    z-index: 9999999 !important;
    align-items: center !important;
    justify-content: center !important;
}
#avatar-crop-modal.discourse-crop-modal:not(.show) { display: none !important; }
#avatar-crop-modal.discourse-crop-modal.show { display: flex !important; }
}
