/**
 * Shegerdha Forum Modern Theme (قالب مدرن انجمن شگردها)
 * Responsive Desktop-First Design based on Designer Mockup
 */

:root {
    --shg-font: 'Vazirmatn', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    --shg-bg: #ebf3fa;
    --shg-card-bg: #ffffff;
    --shg-border: #dbe7f3;
    --shg-border-hover: #b9d3ee;
    --shg-primary: #0d6efd;
    --shg-primary-hover: #0b5ed7;
    --shg-primary-light: #e7f1ff;
    --shg-success: #198754;
    --shg-success-hover: #157347;
    --shg-text: #1e293b;
    --shg-text-muted: #64748b;
    --shg-text-light: #94a3b8;
    --shg-title: #0f2744;
    --shg-radius-sm: 6px;
    --shg-radius-md: 10px;
    --shg-radius-lg: 14px;
    --shg-radius-full: 9999px;
    --shg-shadow-sm: 0 1px 3px rgba(15, 45, 90, 0.05);
    --shg-shadow-md: 0 4px 12px rgba(15, 45, 90, 0.06);
    --shg-shadow-lg: 0 8px 24px rgba(15, 45, 90, 0.08);
}

/* Base Reset & Typography in Modern Theme */
body.shg-theme-modern {
    background-color: var(--shg-bg);
    background-image: linear-gradient(180deg, #dcecf9 0%, #ebf3fa 280px);
    background-repeat: no-repeat;
    color: var(--shg-text);
    font-family: var(--shg-font);
    font-size: 14px;
    line-height: 1.65;
    margin: 0;
    padding: 0;
    direction: rtl;
    text-align: right;
    -webkit-font-smoothing: antialiased;
}

body.shg-theme-modern *:not(#sitebar):not(#sitebar *):not([class*="sitebar"]):not([class*="sitebar"] *):not([id*="sitebar"]):not([id*="sitebar"] *):not(.sitebar_window):not(.sitebar_window *):not(#Notification_content):not(#Notification_content *):not(#sb_Notification_content):not(#sb_Notification_content *) {
    box-sizing: border-box;
}

body.shg-theme-modern a:not(#sitebar *):not([class*="sitebar"] *):not([id*="sitebar"] *):not(.sitebar_window *):not(#Notification_content *):not(#sb_Notification_content *) {
    color: var(--shg-primary);
    text-decoration: none;
    transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

body.shg-theme-modern a:not(#sitebar *):not([class*="sitebar"] *):not([id*="sitebar"] *):not(.sitebar_window *):not(#Notification_content *):not(#sb_Notification_content *):hover {
    color: var(--shg-primary-hover);
}

/* Hide classic center logo when modern header is active */
body.shg-theme-modern > center > .div_logo {
    display: none !important;
}

/* Enforce font family across forum buttons, inputs and actions (excluding sitebar) */
body.shg-theme-modern button:not(#sitebar *):not([class*="sitebar"] *):not([id*="sitebar"] *):not(.sitebar_window *):not(#Notification_content *):not(#sb_Notification_content *),
body.shg-theme-modern input:not(#sitebar *):not([class*="sitebar"] *):not([id*="sitebar"] *):not(.sitebar_window *):not(#Notification_content *):not(#sb_Notification_content *),
body.shg-theme-modern textarea:not(#sitebar *):not([class*="sitebar"] *):not([id*="sitebar"] *):not(.sitebar_window *):not(#Notification_content *):not(#sb_Notification_content *),
body.shg-theme-modern select:not(#sitebar *):not([class*="sitebar"] *):not([id*="sitebar"] *):not(.sitebar_window *):not(#Notification_content *):not(#sb_Notification_content *),
body.shg-theme-modern .shg-btn-outline-action,
body.shg-theme-modern .shg-btn-card-action,
body.shg-theme-modern .shg-btn-reply-topic,
body.shg-theme-modern .shg-btn-submit-reply,
body.shg-theme-modern .shg-btn-preview,
body.shg-theme-modern .shg-btn-attach,
body.shg-theme-modern .btn_topic_2,
body.shg-theme-modern .btn_topic_3 {
    font-family: var(--shg-font) !important;
}

/* ============================================================
   Sitebar Style Isolation (Zero Leakage into Sitebar)
   ============================================================ */
#sitebar,
#sitebar *,
.sitebar_window,
.sitebar_window *,
.div_sitebar,
.div_sitebar *,
.div_sitebar_black,
.div_sitebar_black *,
.div_sitebar_black_page,
.div_sitebar_black_page *,
[class*="sitebar"],
[class*="sitebar"] *,
[id*="sitebar"],
[id*="sitebar"] *,
#Notification_content,
#Notification_content *,
#sb_Notification_content,
#sb_Notification_content * {
    font-family: IRANSans, tahoma, serif;
    box-sizing: content-box;
}

#sitebar a,
.sitebar_window a,
[class*="sitebar"] a,
[id*="sitebar"] a {
    text-decoration: none;
    transition: none;
}

#sitebar a.sitebar_flag,
#sitebar .sitebar_flag {
    color: #F8F8FF !important;
}

#sitebar a.sitebar_flag2,
#sitebar .sitebar_flag2,
.sitebar_flag2 {
    color: #FF201C !important;
}

#sitebar .sitebar_flag_count,
.sitebar_flag_count {
    color: #F5F551 !important;
}

#sitebar a.sitebar_small,
.sitebar_window a.sitebar_small {
    color: #ffffff !important;
    font-size: 12px !important;
    font-weight: normal !important;
}
#sitebar a.sitebar_small:hover,
.sitebar_window a.sitebar_small:hover {
    color: #FFFF00 !important;
}

#sitebar a.btn_login,
.sitebar_window a.btn_login {
    color: #F8F8FF !important;
    font-family: tahoma !important;
}
#sitebar a.btn_login:hover,
.sitebar_window a.btn_login:hover {
    color: #08406E !important;
}

#sitebar a.btn_sitebar_2 {
    color: #F8F8FF !important;
}
#sitebar a.btn_sitebar_2:hover {
    color: #FFFF00 !important;
}

#sitebar .userid_kadr_sitebar {
    color: yellow !important;
}

/* Ensure sitebar dropdown container stays aligned with trigger element on desktop in modern RTL theme */
@media screen and (min-width: 769px) {
    body.shg-theme-modern #sb_Notification_content:not(.sb-notify-cal-open) {
        right: auto !important;
    }
}

/* User popup trigger pointers */
body.shg-theme-modern .user_post_kadr,
body.shg-theme-modern .user_comment_kadr,
body.shg-theme-modern .shg-topic-meta-author {
    cursor: pointer;
}
body.shg-theme-modern .user_post_kadr:hover,
body.shg-theme-modern .user_comment_kadr:hover {
    color: var(--shg-primary-hover) !important;
}

/* ============================================================
   Modern Header
   ============================================================ */
.shg-modern-header-wrap {
    width: 100%;
    max-width: 1380px;
    margin: 12px auto 8px;
    padding: 0 16px;
}

.shg-modern-header {
    background: var(--shg-card-bg);
    border: 1px solid var(--shg-border);
    border-radius: var(--shg-radius-lg);
    box-shadow: var(--shg-shadow-md);
    padding: 10px 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.shg-header-top-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

/* Right: Logo */
.shg-header-logo-block {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.shg-header-logo-icon {
    width: 48px;
    height: 48px;
    object-fit: contain;
}

.shg-header-logo-text {
    display: flex;
    flex-direction: column;
}

.shg-header-brand-title {
    font-size: 22px;
    font-weight: 900;
    color: #e11d48;
    line-height: 1.2;
    letter-spacing: -0.5px;
}

.shg-header-brand-subtitle {
    font-size: 11px;
    color: var(--shg-text-muted);
    font-weight: 500;
}

/* Center: Search Box */
.shg-header-search-form {
    flex: 1;
    max-width: 480px;
    margin: 0 auto;
    position: relative;
}

.shg-header-search-input {
    width: 100%;
    height: 40px;
    background: #f8fafc;
    border: 1.5px solid #cbd5e1;
    border-radius: var(--shg-radius-full);
    padding: 0 42px 0 16px;
    font-family: var(--shg-font);
    font-size: 13.5px;
    color: var(--shg-text);
    outline: none;
    transition: all 0.2s ease;
}

.shg-header-search-input:focus {
    background: #ffffff;
    border-color: var(--shg-primary);
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.15);
}

.shg-header-search-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    color: var(--shg-text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Left: User Actions & Settings */
.shg-header-user-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.shg-btn-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 36px;
    padding: 0 18px;
    border-radius: var(--shg-radius-full);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.shg-btn-pill-blue {
    background: var(--shg-primary);
    color: #ffffff !important;
}

.shg-btn-pill-blue:hover {
    background: var(--shg-primary-hover);
    box-shadow: 0 2px 8px rgba(13, 110, 253, 0.3);
}

.shg-btn-pill-green {
    background: var(--shg-success);
    color: #ffffff !important;
}

.shg-btn-pill-green:hover {
    background: var(--shg-success-hover);
    box-shadow: 0 2px 8px rgba(25, 135, 84, 0.3);
}

.shg-btn-icon-cog {
    width: 36px;
    height: 36px;
    border-radius: var(--shg-radius-full);
    border: 1px solid #cbd5e1;
    background: #f8fafc;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--shg-text-muted);
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
}

.shg-btn-icon-cog:hover {
    background: #e2e8f0;
    color: var(--shg-text);
}

/* Settings / Theme Dropdown */
.shg-settings-dropdown {
    position: absolute;
    top: 44px;
    left: 0;
    background: var(--shg-card-bg);
    border: 1px solid var(--shg-border);
    border-radius: var(--shg-radius-md);
    box-shadow: var(--shg-shadow-lg);
    width: 190px;
    padding: 6px 0;
    z-index: 1000;
    display: none;
    text-align: right;
}

.shg-settings-dropdown.is-open {
    display: block;
}

.shg-dropdown-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 14px;
    font-size: 12.5px;
    color: var(--shg-text);
    cursor: pointer;
    transition: background 0.15s ease;
}

.shg-dropdown-item:hover {
    background: #f1f5f9;
    color: var(--shg-primary);
}

.shg-dropdown-divider {
    height: 1px;
    background: var(--shg-border);
    margin: 4px 0;
}

/* ============================================================
   Secondary Navigation Bar (Tabs)
   ============================================================ */
.shg-header-nav-bar {
    background: #f0f7ff;
    border: 1px solid #d0e3f8;
    border-radius: var(--shg-radius-md);
    padding: 3px 6px;
    display: flex;
    align-items: center;
    gap: 4px;
    overflow-x: auto;
}

.shg-nav-tab-link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 14px;
    border-radius: var(--shg-radius-sm);
    font-size: 13px;
    font-weight: 600;
    color: #1e3a8a !important;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.shg-nav-tab-link:hover,
.shg-nav-tab-link.is-active {
    background: #ffffff;
    color: var(--shg-primary) !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.shg-nav-tab-link svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* ============================================================
   Breadcrumb Bar
   ============================================================ */
.shg-breadcrumb-bar {
    width: 100%;
    max-width: 1380px;
    margin: 4px auto 8px;
    padding: 0 16px;
}

.shg-breadcrumb-inner {
    background: var(--shg-card-bg);
    border: 1px solid var(--shg-border);
    border-radius: var(--shg-radius-md);
    padding: 9px 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12.5px;
    color: var(--shg-text-muted);
}

.shg-breadcrumb-inner a {
    color: var(--shg-primary);
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.shg-breadcrumb-inner a:hover {
    text-decoration: underline;
}

.shg-breadcrumb-sep {
    color: var(--shg-text-light);
    font-size: 11px;
}

.shg-breadcrumb-current {
    color: var(--shg-text);
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ============================================================
   Main 3-Column Desktop Layout
   ============================================================ */
.shg-main-wrapper {
    width: 100%;
    max-width: 1380px;
    margin: 0 auto 30px;
    padding: 0 16px;
}

.shg-3col-grid {
    display: grid;
    grid-template-columns: 60px 1fr 280px;
    gap: 8px;
    align-items: start;
}

/* Right Column (in RTL): Compact Vertical Pagination Strip */
.shg-col-pages,
.shg-col-left {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 60px;
}

body.shg-theme-modern .shg-col-pages > * {
    margin: 0 !important;
}

/* Left Column (in RTL): Full Sidebar with Info, Links & Badges */
.shg-col-right {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 280px;
}

body.shg-theme-modern .shg-col-right > * {
    margin: 0 !important;
}

/* Center Column (Main Forum Content) */
.shg-col-center {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0; /* prevent grid overflow */
}

body.shg-theme-modern #topic_main {
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
}

/* Sidebar Widget Cards */
.shg-widget-card {
    background: var(--shg-card-bg);
    border: 1px solid var(--shg-border);
    border-radius: var(--shg-radius-lg);
    box-shadow: var(--shg-shadow-sm);
    padding: 14px 16px;
}

.shg-widget-title {
    font-size: 14.5px;
    font-weight: 800;
    color: var(--shg-title);
    margin: 0 0 12px 0;
    padding-bottom: 8px;
    border-bottom: 1.5px solid #edf2f7;
    display: flex;
    align-items: center;
    gap: 8px;
}

.shg-widget-title svg {
    color: var(--shg-primary);
}

/* Topic Info Rows */
.shg-info-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    font-size: 12.5px;
}

.shg-info-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    color: var(--shg-text-muted);
}

.shg-info-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.shg-info-label svg {
    color: var(--shg-primary);
    width: 14px;
    height: 14px;
}

.shg-info-val {
    font-weight: 700;
    color: var(--shg-text);
}

.shg-badge-open {
    background: #ecfdf5;
    color: #059669;
    padding: 2px 8px;
    border-radius: var(--shg-radius-full);
    font-size: 11.5px;
    font-weight: 700;
}

/* Related Topics List */
.shg-related-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.shg-related-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px;
    border-radius: var(--shg-radius-sm);
    transition: background 0.15s ease;
}

.shg-related-item:hover {
    background: #f8fafc;
}

.shg-related-thumb {
    width: 38px;
    height: 38px;
    border-radius: var(--shg-radius-md);
    background: #f1f5f9;
    flex-shrink: 0;
    object-fit: cover;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.shg-related-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.shg-related-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.shg-related-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--shg-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.shg-related-posts {
    font-size: 11px;
    color: var(--shg-primary);
}

/* Quick Access Links */
.shg-quick-links {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.shg-quick-link-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 10px;
    border-radius: var(--shg-radius-sm);
    font-size: 12.5px;
    font-weight: 600;
    color: #334155;
    transition: all 0.15s ease;
}

.shg-quick-link-item:hover {
    background: #f1f5f9;
    color: var(--shg-primary);
    transform: translateX(-3px);
}

.shg-quick-link-item svg {
    color: var(--shg-primary);
    width: 15px;
    height: 15px;
}

/* ============================================================
   Center Column: Topic Header Card
   ============================================================ */
.shg-topic-header-card {
    background: var(--shg-card-bg);
    border: 1px solid var(--shg-border);
    border-radius: var(--shg-radius-lg);
    box-shadow: var(--shg-shadow-sm);
    padding: 20px 22px;
    margin: 0 !important;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.shg-topic-header-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.shg-topic-title-area {
    display: flex;
    align-items: center;
    gap: 14px;
}

.shg-topic-mascot-avatar {
    width: 52px;
    height: 52px;
    border-radius: var(--shg-radius-md);
    background: #f8fafc;
    border: 1px solid var(--shg-border);
    padding: 6px;
    object-fit: contain;
    flex-shrink: 0;
}

.shg-topic-title-h1 {
    margin: 0 0 6px 0;
    font-size: 20px;
    font-weight: 900;
    color: var(--shg-title);
    line-height: 1.35;
}

.shg-topic-meta-line {
    font-size: 12px;
    color: var(--shg-text-muted);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.shg-topic-meta-author {
    color: var(--shg-primary);
    font-weight: 700;
}

/* Topic Action Buttons */
.shg-topic-action-buttons {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex-shrink: 0;
}

.shg-btn-reply-topic {
    background: var(--shg-primary);
    color: #ffffff !important;
    border: none;
    border-radius: var(--shg-radius-sm);
    padding: 8px 14px;
    font-size: 12.5px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: background 0.15s ease;
}

.shg-btn-reply-topic:hover {
    background: var(--shg-primary-hover);
}

.shg-btn-outline-action {
    background: #ffffff;
    color: var(--shg-text) !important;
    border: 1px solid #cbd5e1;
    border-radius: var(--shg-radius-sm);
    padding: 6px 12px;
    font-size: 11.5px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.15s ease;
}

.shg-btn-outline-action:hover {
    background: #f8fafc;
    border-color: var(--shg-primary);
    color: var(--shg-primary) !important;
}

/* Tags Row */
.shg-topic-tags-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.shg-topic-tag-pill {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    color: #334155;
    padding: 3px 12px;
    border-radius: var(--shg-radius-full);
    font-size: 12px;
    font-weight: 600;
    transition: all 0.15s ease;
}

.shg-topic-tag-pill:hover {
    background: var(--shg-primary-light);
    border-color: #bfdbfe;
    color: var(--shg-primary);
}

/* Topic Callout / Note Box */
.shg-topic-intro-callout {
    background: #f8fafc;
    border-right: 4px solid var(--shg-primary);
    border-radius: var(--shg-radius-sm);
    padding: 10px 14px;
    font-size: 13px;
    color: #475569;
    line-height: 1.6;
}

/* ============================================================
   Center Column: Post Cards
   ============================================================ */
body.shg-theme-modern .topic_page_kadr {
    width: 100% !important;
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Individual Post Card Wrapper */
body.shg-theme-modern .shg-post-card,
body.shg-theme-modern .topic_page_kadr > div[id^='post_'] {
    background: var(--shg-card-bg);
    border: 1px solid var(--shg-border);
    border-radius: var(--shg-radius-lg);
    box-shadow: var(--shg-shadow-sm);
    padding: 16px 18px;
    margin: 0 !important;
    position: relative;
    transition: box-shadow 0.2s ease;
}

body.shg-theme-modern .shg-post-card:hover,
body.shg-theme-modern .topic_page_kadr > div[id^='post_']:hover {
    box-shadow: var(--shg-shadow-md);
}

body.shg-theme-modern .shg-post-card .post_kadr,
body.shg-theme-modern .topic_page_kadr .post_kadr {
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    border: none !important;
}

/* First post body inside header card */
body.shg-theme-modern #topic_comments .shg-post-card,
body.shg-theme-modern #topic_comments div[id^='post_'] {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 8px 0 0 0 !important;
}

body.shg-theme-modern #topic_comments .shg-post-header-row {
    display: none !important;
}

/* Post Header Row */
.shg-post-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #f1f5f9;
    font-size: 12.5px;
}

.shg-post-header-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.shg-post-num-badge {
    background: #e0f2fe;
    color: var(--shg-primary);
    font-weight: 800;
    font-size: 13px;
    padding: 2px 8px;
    border-radius: var(--shg-radius-sm);
}

.shg-post-date-time {
    color: var(--shg-text-muted);
}

.shg-post-header-tools {
    display: flex;
    align-items: center;
    gap: 8px;
}

.shg-post-header-tools a {
    color: var(--shg-text-light);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: color 0.15s ease;
}

.shg-post-header-tools a:hover {
    color: var(--shg-primary);
}

/* Post Title & Text */
.post_title {
    font-family: var(--shg-font);
    font-size: 16px;
    font-weight: 800;
    color: var(--shg-title);
    margin-bottom: 8px;
    line-height: 1.4;
}

.post_view,
.post_kadr .post_view {
    font-family: var(--shg-font);
    font-size: 14px;
    color: #243242;
    line-height: 1.75;
    word-break: break-word;
}

/* Quote styling inside posts */
.post_view blockquote,
.shg-quote-box {
    background: #f0f9ff;
    border-right: 4px solid #38bdf8;
    border-radius: var(--shg-radius-sm);
    padding: 10px 16px;
    margin: 12px 0;
    font-size: 13.5px;
    font-style: italic;
    color: #1e293b;
    position: relative;
}

/* Post Embedded Media / Image */
.post_view img {
    max-width: 100% !important;
    height: auto;
    border-radius: var(--shg-radius-md);
    margin: 10px 0;
    box-shadow: var(--shg-shadow-sm);
}

/* Post Footer / Action Bar */
.shg-post-footer-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 14px;
    padding-top: 10px;
    border-top: 1px solid #f1f5f9;
}

/* Like / Vote Pill */
.shg-vote-pill-wrap {
    display: inline-flex;
    align-items: center;
    background: #e0f2fe;
    border: 1px solid #bae6fd;
    border-radius: var(--shg-radius-full);
    padding: 4px 12px;
    gap: 8px;
    font-size: 12px;
    font-weight: 700;
    color: #0369a1;
}

.shg-vote-pill-wrap a {
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    color: #0369a1;
}

.shg-vote-pill-wrap a:hover {
    color: #0284c7;
}

/* Post Bottom Actions (Quote, Quick Reply, Report) */
.shg-post-bottom-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.shg-btn-card-action {
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: var(--shg-radius-sm);
    padding: 5px 12px;
    font-size: 12px;
    font-weight: 600;
    color: #475569 !important;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.shg-btn-card-action:hover {
    background: #ffffff;
    border-color: var(--shg-primary);
    color: var(--shg-primary) !important;
}

/* Comments Container & Nested Indented Cards */
body.shg-theme-modern .comments_kadr {
    margin-top: 6px;
    padding: 0 !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

/* Individual Comment Card (Indented like old forum with modern polish) */
body.shg-theme-modern .comment_kadr {
    margin: 8px 36px 8px 4px !important; /* 36px indentation from right in RTL */
    padding: 10px 14px !important;
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
    border-right: 3.5px solid #0284c7 !important; /* Indent response line */
    border-radius: var(--shg-radius-md) !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03) !important;
    float: none !important;
    width: auto !important;
    box-sizing: border-box !important;
    font-size: 13px !important;
    color: var(--shg-text) !important;
    position: relative;
    clear: both;
}

body.shg-theme-modern .comment_kadr:hover {
    border-color: #cbd5e1 !important;
    border-right-color: #0369a1 !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05) !important;
}

body.shg-theme-modern .shg-comment-item {
    clear: both;
}

/* Compact Comment Reply Form (مثل تم قدیمی، جمع و جور و تمیز) */
body.shg-theme-modern .send_comments_kadr {
    margin: 8px 36px 12px 4px !important;
    padding: 12px 16px !important;
    background: #f8fafc !important;
    border: 1px solid #cbd5e1 !important;
    border-right: 3.5px solid var(--shg-primary) !important;
    border-radius: var(--shg-radius-md) !important;
    box-shadow: 0 2px 8px rgba(15, 45, 90, 0.05) !important;
    max-width: 580px !important;
    width: auto !important;
    float: none !important;
    clear: both !important;
    box-sizing: border-box !important;
}

body.shg-theme-modern .topic_comment_textarea {
    width: 100% !important;
    min-height: 65px !important;
    max-height: 180px !important;
    border: 1.5px solid #cbd5e1 !important;
    border-radius: var(--shg-radius-sm) !important;
    padding: 8px 10px !important;
    font-family: var(--shg-font) !important;
    font-size: 13px !important;
    outline: none !important;
    background: #ffffff !important;
    box-sizing: border-box !important;
    resize: vertical !important;
    transition: border-color 0.2s ease, box-shadow 0.2s ease !important;
}

body.shg-theme-modern .topic_comment_textarea:focus {
    border-color: var(--shg-primary) !important;
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.12) !important;
}

/* ============================================================
   Center Column: Reply Box Card (ارسال پاسخ جدید)
   ============================================================ */
.shg-new-reply-card {
    background: var(--shg-card-bg);
    border: 1px solid var(--shg-border);
    border-radius: var(--shg-radius-lg);
    box-shadow: var(--shg-shadow-md);
    padding: 18px 20px;
    margin: 0 !important;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.shg-new-reply-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 16px;
    font-weight: 800;
    color: #e11d48;
}

.shg-reply-toolbar {
    display: flex;
    align-items: center;
    gap: 4px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: var(--shg-radius-sm);
    padding: 4px;
    overflow-x: auto;
}

.shg-reply-textarea {
    width: 100%;
    min-height: 140px;
    background: #ffffff;
    border: 1.5px solid #cbd5e1;
    border-radius: var(--shg-radius-md);
    padding: 12px;
    font-family: var(--shg-font);
    font-size: 14px;
    outline: none;
    line-height: 1.6;
    transition: border-color 0.2s ease;
}

.shg-reply-textarea:focus {
    border-color: var(--shg-primary);
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.1);
}

.shg-reply-bottom-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 4px;
}

.shg-btn-attach {
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: var(--shg-radius-sm);
    padding: 7px 14px;
    font-size: 12.5px;
    font-weight: 600;
    color: #334155;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.shg-btn-attach:hover {
    background: #e2e8f0;
}

.shg-reply-submit-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.shg-btn-preview {
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: var(--shg-radius-sm);
    padding: 7px 14px;
    font-size: 12.5px;
    font-weight: 600;
    color: #475569;
    cursor: pointer;
}

.shg-btn-submit-reply {
    background: var(--shg-primary);
    color: #ffffff !important;
    border: none;
    border-radius: var(--shg-radius-sm);
    padding: 7px 20px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s ease;
}

.shg-btn-submit-reply:hover {
    background: var(--shg-primary-hover);
}

/* ============================================================
   Left Column: Ads & Vertical Pagination Widget
   ============================================================ */
.shg-ad-box {
    background: var(--shg-card-bg);
    border: 1px solid var(--shg-border);
    border-radius: var(--shg-radius-lg);
    overflow: hidden;
    text-align: center;
    box-shadow: var(--shg-shadow-sm);
}

.shg-ad-title {
    background: #f8fafc;
    padding: 6px;
    font-size: 12px;
    font-weight: 700;
    color: var(--shg-text-muted);
    border-bottom: 1px solid #e2e8f0;
}

.shg-ad-content {
    padding: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.shg-ad-content img {
    max-width: 100%;
    height: auto;
    border-radius: var(--shg-radius-sm);
}

/* Support Badge */
.shg-support-badge {
    background: #ffffff;
    border: 1px solid #bae6fd;
    border-radius: var(--shg-radius-md);
    padding: 8px 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: var(--shg-shadow-sm);
}

.shg-support-icon {
    width: 32px;
    height: 32px;
    border-radius: var(--shg-radius-full);
    background: #e0f2fe;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--shg-primary);
    flex-shrink: 0;
}

.shg-support-text {
    font-size: 11px;
    font-weight: 700;
    color: #0369a1;
    line-height: 1.3;
}

/* Vertical Pagination Widget (صفحه‌ها) */
.shg-pages-widget {
    background: var(--shg-card-bg);
    border: 1px solid var(--shg-border);
    border-radius: var(--shg-radius-lg);
    box-shadow: var(--shg-shadow-sm);
    padding: 10px 5px;
    box-sizing: border-box;
    width: 100%;
    position: sticky;
    top: 20px;
}

.shg-pages-title {
    font-size: 11.5px;
    font-weight: 800;
    color: var(--shg-title);
    margin-bottom: 8px;
    text-align: center;
    white-space: nowrap;
}

.shg-pages-vertical-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* Style override for #topic_numpages and its buttons in Modern Theme */
body.shg-theme-modern #topic_numpages {
    display: flex !important;
    flex-direction: column;
    gap: 6px;
    height: auto !important;
    overflow: visible !important;
    padding: 0 !important;
}

body.shg-theme-modern .topic_numpage,
body.shg-theme-modern .topic_numpage_selected {
    width: 100% !important;
    height: 34px !important;
    border-radius: var(--shg-radius-md) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-family: var(--shg-font) !important;
    font-size: 13.5px !important;
    font-weight: 700 !important;
    text-decoration: none !important;
    margin: 0 !important;
    padding: 0 !important;
    transition: all 0.15s ease !important;
}

body.shg-theme-modern .topic_numpage {
    background: #f8fafc !important;
    border: 1px solid #cbd5e1 !important;
    color: var(--shg-text) !important;
}

body.shg-theme-modern .topic_numpage:hover {
    background: #e0f2fe !important;
    border-color: #7dd3fc !important;
    color: #0369a1 !important;
}

body.shg-theme-modern .topic_numpage_selected {
    background: var(--shg-primary) !important;
    border: 1px solid var(--shg-primary) !important;
    color: #ffffff !important;
    box-shadow: 0 2px 6px rgba(13, 110, 253, 0.3) !important;
}

/* ============================================================
   Modern Footer
   ============================================================ */
.shg-modern-footer-wrap {
    width: 100%;
    max-width: 1380px;
    margin: 20px auto 16px;
    padding: 0 16px;
}

.shg-modern-footer {
    background: var(--shg-card-bg);
    border: 1px solid var(--shg-border);
    border-radius: var(--shg-radius-md);
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12.5px;
    color: var(--shg-text-muted);
}

.shg-footer-links {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.shg-footer-links a {
    color: var(--shg-text-muted);
}

.shg-footer-links a:hover {
    color: var(--shg-primary);
}

.shg-footer-made-with {
    font-weight: 600;
    color: #475569;
}

/* Smiley box popup & overlay styling in modern theme */
#smiley_overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background: rgba(15, 23, 42, 0.38) !important;
    backdrop-filter: blur(2px) !important;
    -webkit-backdrop-filter: blur(2px) !important;
    z-index: 99990 !important;
    display: none;
}

body.shg-theme-modern #smiley_box {
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    margin: 0 !important;
    z-index: 99999 !important;
    box-shadow: 0 20px 48px rgba(0, 0, 0, 0.28) !important;
    border: 2px solid #16a34a !important;
    background: #eef8ee !important;
    border-radius: 16px !important;
    overflow: hidden !important;
}

/* Prominent corner close button */
body.shg-theme-modern #smiley_box #sm_close,
#smiley_box #sm_close {
    position: absolute !important;
    top: 7px !important;
    left: 8px !important;
    width: 28px !important;
    height: 28px !important;
    background: #ffffff !important;
    border: 1.5px solid #cbd5e1 !important;
    border-radius: 50% !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12) !important;
    cursor: pointer !important;
    z-index: 100 !important;
    transition: all 0.18s ease !important;
    text-decoration: none !important;
}

body.shg-theme-modern #smiley_box #sm_close svg,
#smiley_box #sm_close svg {
    width: 14px !important;
    height: 14px !important;
    margin: 0 !important;
    stroke: #475569 !important;
    stroke-width: 2.5 !important;
    transition: stroke 0.18s ease !important;
}

body.shg-theme-modern #smiley_box #sm_close:hover,
#smiley_box #sm_close:hover {
    background: #ef4444 !important;
    border-color: #ef4444 !important;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.35) !important;
    transform: scale(1.08) !important;
}

body.shg-theme-modern #smiley_box #sm_close:hover svg,
#smiley_box #sm_close:hover svg {
    stroke: #ffffff !important;
}

/* Tab headers vertical alignment and spacing */
#smiley_box #sm_topbar #nav1 {
    height: 2.7em !important;
    padding-left: 40px !important; /* Reserve room for top-left close button */
    padding-right: 4px !important;
    margin-bottom: 0 !important;
}

#smiley_box #sm_topbar #nav1 li,
#smiley_box #nav1 li {
    top: 6px !important;
}

#smiley_box #sm_topbar #nav1 li a,
#smiley_box #nav1 li a {
    padding: 2px 9px 5px !important;
    line-height: 22px !important;
    font-size: 11.5px !important;
    font-weight: 500 !important;
    font-family: var(--shg-font), tahoma, sans-serif !important;
    display: block !important;
}

/* Tab animation baseline alignment */
#nav1 li a span {
    top: 0 !important;
}

@media screen and (max-width: 768px) {
    body.shg-theme-modern #smiley_box {
        top: auto !important;
        left: 6px !important;
        right: 6px !important;
        bottom: 12px !important;
        transform: none !important;
        margin: 0 !important;
    }
    body.shg-theme-modern #smiley_box #sm_close {
        top: 6px !important;
        left: 6px !important;
        width: 26px !important;
        height: 26px !important;
    }
}

/* ==========================================================================
   MODERN BAG SYSTEM (کیف انتقال مطالب انجمن)
   Right-side minimal tab + slide-out drawer
   ========================================================================== */

/* 1. Right-edge protrusion tab (زائده مینیمال لبه راست) */
#shg_modern_bag_tab {
    position: fixed;
    right: 0;
    top: 38%;
    transform: translateY(-50%);
    z-index: 99990;
    cursor: pointer;
    display: none; /* Hidden by default when bag is empty */
    user-select: none;
    transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.28s ease;
}

#shg_modern_bag_tab:hover {
    transform: translateY(-50%) translateX(-6px);
}

.shg-bag-tab-inner {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 7px;
    width: 36px;
    padding: 12px 6px 10px;
    box-sizing: border-box;
    background: linear-gradient(180deg, #0284c7 0%, #0369a1 100%);
    color: #ffffff;
    border-radius: 12px 0 0 12px;
    box-shadow: -4px 6px 20px rgba(2, 132, 199, 0.4), 0 2px 6px rgba(0, 0, 0, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-right: none;
}

/* Seamless bridge to screen edge when tab pulls out on hover */
.shg-bag-tab-inner::after {
    content: '';
    position: absolute;
    top: -1px;
    bottom: -1px;
    right: -24px;
    width: 25px;
    background: inherit;
    border-top: 1px solid rgba(255, 255, 255, 0.25);
    border-bottom: 1px solid rgba(255, 255, 255, 0.25);
    pointer-events: none;
}

.shg-bag-tab-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.shg-bag-tab-icon svg {
    width: 17px;
    height: 17px;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.25));
}

.shg-bag-tab-label {
    writing-mode: vertical-rl;
    text-orientation: mixed;
    direction: ltr;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.5px;
    white-space: nowrap;
    font-family: var(--shg-font), IRANSans, tahoma, sans-serif;
    line-height: 1;
    margin: 3px 0;
}

.shg-bag-badge {
    background: #ffffff;
    color: #0369a1;
    font-size: 11px;
    font-weight: 800;
    line-height: 1;
    padding: 3px 5px;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
    min-width: 16px;
    text-align: center;
    font-family: var(--shg-font), tahoma, sans-serif;
}

/* Tab busy animation */
.shg-bag-is-busy #shg_modern_bag_badge {
    animation: shgBadgePulse 0.8s infinite alternate;
}
@keyframes shgBadgePulse {
    from { transform: scale(1); opacity: 0.8; }
    to { transform: scale(1.2); opacity: 1; }
}

/* 2. Slide-out Drawer Panel (opens to the left) */
#shg_modern_bag_drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 360px;
    max-width: 90vw;
    background: #ffffff;
    box-shadow: -10px 0 35px rgba(0, 0, 0, 0.15);
    z-index: 99995;
    display: flex;
    flex-direction: column;
    transform: translateX(105%);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    direction: rtl;
    font-family: var(--shg-font), tahoma, sans-serif;
}

#shg_modern_bag_drawer.shg-drawer-open {
    transform: translateX(0);
}

.shg-bag-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-bottom: 1px solid #e2e8f0;
}

.shg-bag-drawer-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 700;
    color: #0f172a;
}

.shg-bag-drawer-title svg {
    color: #0284c7;
}

.shg-bag-header-count {
    background: #e0f2fe;
    color: #0284c7;
    font-size: 12px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
}

.shg-bag-close-btn {
    background: transparent;
    border: none;
    font-size: 18px;
    color: #64748b;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.shg-bag-close-btn:hover {
    background: #e2e8f0;
    color: #0f172a;
}

.shg-bag-drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* Action toolbar in drawer */
.shg-bag-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.shg-bag-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 12px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 10px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: var(--shg-font), tahoma, sans-serif;
}

.shg-bag-btn-clear {
    background: #fef2f2;
    color: #dc2626;
    border-color: #fecaca;
}

.shg-bag-btn-clear:hover {
    background: #fee2e2;
    border-color: #fca5a5;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(220, 38, 38, 0.15);
}

.shg-bag-btn-disable {
    background: #f8fafc;
    color: #475569;
    border-color: #cbd5e1;
}

.shg-bag-btn-disable:hover {
    background: #e2e8f0;
    color: #1e293b;
    transform: translateY(-1px);
}

/* Item chips list */
.shg-bag-items-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
    overflow-y: auto;
    max-height: calc(100vh - 310px);
}

.shg-bag-item-chip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 9px 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    transition: all 0.2s ease;
}

.shg-bag-item-chip:hover {
    background: #f0f9ff;
    border-color: #bae6fd;
}

.shg-bag-chip-main {
    display: flex;
    flex-direction: column;
    gap: 3px;
    flex: 1;
    min-width: 0;
}

.shg-bag-chip-id {
    font-weight: 700;
    color: #0284c7;
    text-decoration: none;
    font-size: 12px;
    direction: ltr;
    display: inline-block;
    align-self: flex-start;
}

.shg-bag-chip-id:hover {
    text-decoration: underline;
}

.shg-bag-chip-content {
    font-size: 12px;
    color: #334155;
    line-height: 1.5;
    word-break: break-word;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.shg-bag-chip-title {
    font-weight: 700;
    color: #0f172a;
}

.shg-bag-chip-text {
    color: #475569;
}

.shg-bag-chip-empty {
    color: #94a3b8;
    font-style: italic;
    font-size: 11px;
}

/* Left side: Thumbnail + Remove button */
.shg-bag-chip-left {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.shg-bag-chip-thumb {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    object-fit: cover;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.shg-bag-chip-remove {
    background: transparent;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    font-size: 15px;
    padding: 4px 6px;
    border-radius: 6px;
    transition: all 0.15s ease;
    line-height: 1;
}

.shg-bag-chip-remove:hover {
    background: #fee2e2;
    color: #dc2626;
}

/* Undo Banner */
.shg-bag-undo-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 9px 12px;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 10px;
    color: #92400e;
    font-size: 11.5px;
    margin-bottom: 2px;
}

.shg-bag-undo-info {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
    min-width: 0;
}

.shg-bag-undo-info svg {
    color: #d97706;
    flex-shrink: 0;
}

.shg-bag-undo-timer {
    font-size: 11px;
    color: #b45309;
    font-weight: 500;
}

.shg-bag-btn-undo {
    background: #d97706;
    color: #ffffff;
    border: none;
    border-radius: 6px;
    padding: 5px 10px;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    font-family: var(--shg-font), IRANSans, tahoma, sans-serif;
    white-space: nowrap;
    transition: all 0.18s ease;
    flex-shrink: 0;
}

.shg-bag-btn-undo:hover {
    background: #b45309;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(217, 119, 6, 0.3);
}

.shg-bag-empty-state {
    text-align: center;
    padding: 24px 12px;
    color: #94a3b8;
    font-size: 12px;
    line-height: 1.6;
}

/* Split to New Topic Card */
.shg-bag-split-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: all 0.2s ease;
}

.shg-bag-split-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    background: transparent;
    border: none;
    padding: 2px 0;
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
    color: #334155;
    font-family: var(--shg-font), IRANSans, tahoma, sans-serif;
}

.shg-bag-split-toggle:hover {
    color: #0284c7;
}

.shg-bag-split-toggle svg {
    color: #0284c7;
}

.shg-split-arrow {
    font-size: 10px;
    color: #64748b;
    transition: transform 0.2s ease;
}

.shg-split-arrow.shg-open {
    transform: rotate(180deg);
}

.shg-bag-split-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-top: 6px;
    border-top: 1px dashed #e2e8f0;
}

.shg-bag-split-tip {
    font-size: 11px;
    color: #64748b;
    line-height: 1.5;
    background: #f1f5f9;
    padding: 6px 8px;
    border-radius: 6px;
}

.shg-bag-split-field {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.shg-bag-split-field label {
    font-size: 11px;
    font-weight: 600;
    color: #475569;
}

/* Tab Undo Accent (when bag is empty but undo is available) */
.shg-bag-tab.shg-has-undo .shg-bag-tab-inner {
    background: linear-gradient(180deg, #f59e0b 0%, #d97706 100%);
    box-shadow: -4px 6px 20px rgba(245, 158, 11, 0.4), 0 2px 6px rgba(0, 0, 0, 0.12);
}

.shg-bag-tab.shg-has-undo .shg-bag-badge {
    color: #b45309;
}

/* Direct Destination Move Card */
.shg-bag-direct-move-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.shg-bag-direct-move-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 700;
    color: #334155;
}

.shg-bag-direct-move-title svg {
    color: #0284c7;
}

.shg-bag-direct-move-row {
    display: flex;
    width: 100%;
}

.shg-bag-direct-input {
    width: 100%;
    padding: 8px 12px;
    font-size: 12.5px;
    border: 1.5px solid #cbd5e1;
    border-radius: 8px;
    font-family: var(--shg-font), tahoma, sans-serif;
    outline: none;
    transition: border-color 0.2s ease;
    box-sizing: border-box;
    background: #ffffff;
}

.shg-bag-direct-input:focus {
    border-color: #0284c7;
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}

.shg-bag-direct-buttons-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1.2fr;
    gap: 6px;
}

.shg-bag-direct-btn {
    padding: 7px 8px;
    font-size: 11.5px;
    font-weight: 600;
    border-radius: 7px;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #334155;
    cursor: pointer;
    transition: all 0.18s ease;
    font-family: var(--shg-font), tahoma, sans-serif;
    text-align: center;
}

.shg-bag-direct-btn:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
    color: #0f172a;
    transform: translateY(-1px);
}

.shg-bag-direct-btn-primary {
    background: #0284c7;
    color: #ffffff;
    border-color: #0284c7;
}

.shg-bag-direct-btn-primary:hover {
    background: #0369a1;
    border-color: #0369a1;
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(2, 132, 199, 0.3);
}

.shg-bag-tip {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
    font-size: 11px;
    line-height: 1.6;
    padding: 10px 12px;
    border-radius: 8px;
    text-align: center;
}

/* Backdrop */
.shg-bag-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.28);
    backdrop-filter: blur(2px);
    z-index: 99992;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.shg-bag-backdrop.shg-backdrop-open {
    display: block;
    opacity: 1;
}

/* 3. In-page Post Selection & Drop Styles (Modern Theme only) */
.shg-theme-modern .div_checkbox_bag_post {
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
}

.shg-theme-modern input.checkbox_bag_post {
    width: 18px !important;
    height: 18px !important;
    accent-color: #0284c7 !important;
    cursor: pointer !important;
    margin: 2px 4px !important;
    transition: transform 0.15s ease !important;
}

.shg-theme-modern input.checkbox_bag_post:hover {
    transform: scale(1.15) !important;
}

/* Selected Post Highlight */
.shg-theme-modern .shg-post-in-bag {
    border-right: 3px solid #0284c7 !important;
    background: linear-gradient(90deg, rgba(240, 249, 255, 0.85) 0%, rgba(255, 255, 255, 0.98) 100%) !important;
    box-shadow: 0 4px 16px rgba(2, 132, 199, 0.12) !important;
    transition: all 0.3s ease !important;
}

/* Temporary scroll highlight */
.shg-theme-modern .shg-post-highlight {
    outline: 2px solid #0284c7 !important;
    box-shadow: 0 0 20px rgba(2, 132, 199, 0.3) !important;
    animation: shgPulseHighlight 2.2s ease forwards !important;
}
@keyframes shgPulseHighlight {
    0% { transform: scale(1.01); }
    50% { transform: scale(1.01); }
    100% { transform: scale(1); }
}

/* Drop Button with Vertical Dots Icon (⋮) */
.shg-theme-modern .btn_drop_post {
    width: 28px !important;
    height: 28px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 8px !important;
    background: #e0f2fe url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='%230284c7'%3E%3Ccircle cx='12' cy='5' r='2.2'/%3E%3Ccircle cx='12' cy='12' r='2.2'/%3E%3Ccircle cx='12' cy='19' r='2.2'/%3E%3C/svg%3E") center center no-repeat !important;
    background-size: 16px !important;
    border: 1px solid #bae6fd !important;
    transition: all 0.2s ease !important;
    margin: 0 4px !important;
    cursor: pointer !important;
}

.shg-theme-modern .btn_drop_post:hover {
    background-color: #0284c7 !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='%23ffffff'%3E%3Ccircle cx='12' cy='5' r='2.2'/%3E%3Ccircle cx='12' cy='12' r='2.2'/%3E%3Ccircle cx='12' cy='19' r='2.2'/%3E%3C/svg%3E") !important;
    border-color: #0284c7 !important;
    box-shadow: 0 2px 8px rgba(2, 132, 199, 0.3) !important;
    transform: translateY(-1px) !important;
}

/* Topic Header Mover Controls */
.shg-theme-modern .shg-topic-mover-tools {
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    margin-right: 4px !important;
}

.shg-theme-modern .shg-topic-select-label {
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    font-size: 12px !important;
    color: #0284c7 !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    background: #e0f2fe !important;
    padding: 6px 12px !important;
    border-radius: 8px !important;
    border: 1px solid #bae6fd !important;
    transition: all 0.2s ease !important;
}

.shg-theme-modern .shg-topic-select-label:hover {
    background: #bae6fd !important;
}

/* Drop Target Popover Menu & Wrapper */
.shg-theme-modern .shg-bag-drop-wrapper {
    position: relative !important;
    display: inline-flex !important;
    align-items: center !important;
}

.shg-theme-modern .shg-bag-drop-menu {
    position: absolute !important;
    left: auto !important;
    right: 0 !important;
    top: calc(100% + 6px) !important;
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 12px !important;
    box-shadow: 0 12px 28px -4px rgba(15, 23, 42, 0.18), 0 6px 12px -4px rgba(15, 23, 42, 0.08) !important;
    padding: 8px !important;
    min-width: 165px !important;
    z-index: 10005 !important;
    display: none !important;
    flex-direction: column !important;
    gap: 6px !important;
}

.shg-theme-modern .shg-bag-drop-menu.shg-open {
    display: flex !important;
}

/* Drop Menu Item Buttons (Readability, proper height & padding) */
.shg-theme-modern .shg-bag-drop-item,
.shg-theme-modern .shg-bag-drop-menu input.btn_topic_2,
.shg-theme-modern .shg-bag-drop-menu button {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    box-sizing: border-box !important;
    min-height: 38px !important;
    height: auto !important;
    line-height: 1.5 !important;
    margin: 0 !important;
    padding: 8px 14px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    color: #334155 !important;
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 8px !important;
    cursor: pointer !important;
    transition: all 0.18s ease !important;
    text-align: center !important;
    font-family: var(--shg-font), IRANSans, tahoma, sans-serif !important;
    white-space: nowrap !important;
    overflow: visible !important;
}

.shg-theme-modern .shg-bag-drop-item:hover,
.shg-theme-modern .shg-bag-drop-menu input.btn_topic_2:hover,
.shg-theme-modern .shg-bag-drop-menu button:hover {
    background: #0284c7 !important;
    color: #ffffff !important;
    border-color: #0284c7 !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 10px rgba(2, 132, 199, 0.28) !important;
}

/* ==========================================================================
   4. Forum Tree View Mode (mode=tree)
   ========================================================================== */

.shg-tree-page-wrapper {
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 16px 40px;
}

.shg-tree-header-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 16px 20px;
    box-shadow: var(--shg-shadow-sm, 0 1px 3px rgba(0,0,0,0.06));
}

.shg-tree-mode-badge-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: #eff6ff;
    color: #0284c7;
    border: 1px solid #bfdbfe;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.shg-tree-header-title-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.shg-mode-pill {
    display: inline-flex;
    align-items: center;
    font-size: 11px;
    font-weight: 700;
    color: #0369a1;
    background: #e0f2fe;
    padding: 3px 10px;
    border-radius: 20px;
    border: 1px solid #bae6fd;
}

/* Tree Toolbar Card */
.shg-tree-toolbar-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 12px 18px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.shg-tree-toolbar-group {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.shg-tree-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 8px;
    border: 1px solid #cbd5e1;
    background: #f8fafc;
    color: #334155;
    cursor: pointer;
    transition: all 0.18s ease;
    font-family: var(--shg-font), IRANSans, tahoma, sans-serif;
}

.shg-tree-btn:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
    color: #0f172a;
    transform: translateY(-1px);
}

.shg-tree-btn-bag {
    background: #f0fdf4;
    color: #166534;
    border-color: #bbf7d0;
    font-weight: 700;
}

.shg-tree-btn-bag:hover {
    background: #dcfce7;
    border-color: #86efac;
    color: #14532d;
    box-shadow: 0 2px 6px rgba(22, 101, 52, 0.15);
}

.shg-tree-btn-bag.shg-has-selection {
    background: #16a34a;
    color: #ffffff;
    border-color: #16a34a;
    box-shadow: 0 2px 8px rgba(22, 163, 74, 0.35);
}

.shg-tree-btn-bag.shg-has-selection:hover {
    background: #15803d;
    border-color: #15803d;
    color: #ffffff;
}

.shg-tree-sel-badge {
    background: #ffffff;
    color: #16a34a;
    font-size: 11px;
    font-weight: 800;
    padding: 1px 6px;
    border-radius: 10px;
    line-height: 1.2;
}

.shg-tree-btn-bag.shg-has-selection .shg-tree-sel-badge {
    background: #ffffff;
    color: #15803d;
}

.shg-tree-btn-danger {
    background: #fff1f2;
    color: #be123c;
    border-color: #fecdd3;
}

.shg-tree-btn-danger:hover {
    background: #ffe4e6;
    border-color: #fda4af;
    color: #9f1239;
}

.shg-tree-limit-box {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #64748b;
    margin-right: 6px;
}

.shg-tree-limit-input {
    width: 60px;
    padding: 5px 8px;
    font-size: 12px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    text-align: center;
    outline: none;
    font-family: var(--shg-font), tahoma, sans-serif;
}

.shg-tree-limit-input:focus {
    border-color: #0284c7;
}

.shg-tree-loading-inline {
    display: inline-flex;
    align-items: center;
    margin-right: 6px;
}

.shg-tree-loading-inline img {
    height: 20px;
}

/* Tree Canvas Card */
.shg-tree-canvas-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 20px;
    box-shadow: var(--shg-shadow-sm, 0 1px 3px rgba(0,0,0,0.06));
    min-height: 300px;
}

.shg-tree-loading-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 60px 20px;
    color: #64748b;
    font-size: 13px;
}

.shg-tree-view-body {
    direction: rtl;
    text-align: right;
    font-family: var(--shg-font), IRANSans, tahoma, sans-serif;
}

/* Tree Node Item Row */
.shg-tree-node-item {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    padding: 4px 6px;
    border-radius: 8px;
    box-sizing: border-box;
    transition: background 0.15s ease;
}

.shg-tree-node-item:hover {
    background: #f8fafc;
}

.shg-tree-node-content {
    display: inline-flex;
    align-items: baseline;
    gap: 8px;
    flex: 1;
    min-width: 0;
    font-size: 12.5px;
}

.shg-tree-node-title {
    font-weight: 700;
    color: #0369a1;
    white-space: nowrap;
}

.shg-tree-node-text {
    color: #334155;
    line-height: 1.5;
    word-break: break-word;
}

.shg-tree-node-meta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    font-size: 11px;
}

.shg-tree-node-user {
    background: #f1f5f9;
    color: #475569;
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 10.5px;
}

.shg-tree-node-time {
    color: #94a3b8;
}

.shg-tree-node-open {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 6px;
    color: #64748b;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    text-decoration: none;
    transition: all 0.15s ease;
}

.shg-tree-node-open:hover {
    background: #e0f2fe;
    color: #0284c7;
    border-color: #bae6fd;
}

.tree_img_tiny,
.shg-tree-img-tiny {
    width: 22px;
    height: 22px;
    border-radius: 4px;
    object-fit: cover;
    vertical-align: middle;
    margin: 0 4px;
    border: 1px solid #cbd5e1;
    cursor: pointer;
    transition: transform 0.15s ease;
    display: inline-block;
}

.tree_img_tiny:hover,
.shg-tree-img-tiny:hover {
    transform: scale(1.18);
}

.shg-tree-audio-player {
    height: 26px;
    max-width: 220px;
    vertical-align: middle;
    border-radius: 20px;
    outline: none;
    margin: 0 6px;
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    display: inline-block;
}

.shg-tree-media-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 1px 8px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 9999px;
    text-decoration: none !important;
    vertical-align: middle;
    margin: 0 4px;
    transition: all 0.15s ease;
    line-height: 18px;
}

.shg-tree-video-pill {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.shg-tree-video-pill:hover {
    background: #fee2e2;
    color: #b91c1c;
    border-color: #fca5a5;
    transform: translateY(-1px);
}

/* jsTree overrides in Modern Theme */
.shg-theme-modern .jstree-default .jstree-anchor {
    height: auto !important;
    line-height: 1.6 !important;
    padding: 3px 8px !important;
    border-radius: 8px !important;
    border: 1px solid transparent !important;
    transition: background 0.15s ease, border-color 0.15s ease !important;
    font-family: var(--shg-font), IRANSans, tahoma, sans-serif !important;
}

.shg-theme-modern .jstree-default .jstree-clicked {
    background: #dbeafe !important;
    border-color: #93c5fd !important;
    box-shadow: 0 1px 3px rgba(2, 132, 199, 0.12) !important;
}

.shg-theme-modern .jstree-default .jstree-clicked:hover {
    background: #bfdbfe !important;
    border-color: #60a5fa !important;
}

.shg-theme-modern .jstree-default .jstree-clicked .shg-tree-node-item {
    background: transparent !important;
}

.shg-theme-modern .jstree-default .jstree-hovered {
    background: #f1f5f9 !important;
    border-color: #e2e8f0 !important;
    box-shadow: none !important;
}

.shg-theme-modern .jstree-checkbox {
    width: 16px !important;
    height: 16px !important;
    margin-left: 6px !important;
}

/* ==========================================================================
   View Mode Switcher Pill Group (Standard, Tree, Tiles)
   ========================================================================== */
.shg-view-mode-group {
    display: inline-flex;
    align-items: center;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 3px;
    gap: 3px;
}

.shg-mode-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 11px;
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    border-radius: 7px;
    text-decoration: none !important;
    transition: all 0.15s ease;
    border: 1px solid transparent;
}

.shg-mode-btn:hover {
    color: #0f172a;
    background: rgba(255, 255, 255, 0.6);
}

.shg-mode-btn.active {
    background: #ffffff;
    color: #0284c7;
    border-color: #cbd5e1;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.shg-mode-btn svg {
    stroke-width: 2.2;
}

/* ==========================================================================
   Tile / Gallery Mode (mode=tiles)
   ========================================================================== */
.shg-tiles-page-wrapper {
    max-width: 1380px;
    margin: 0 auto;
    padding: 16px 20px 60px;
}

.shg-tiles-header-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 16px 20px;
    margin-bottom: 14px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

.shg-tiles-mode-badge-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, #0ea5e9, #6366f1);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 4px 10px rgba(99, 102, 241, 0.25);
}

.shg-mode-pill-tiles {
    background: #eef2ff !important;
    color: #4f46e5 !important;
    border: 1px solid #c7d2fe !important;
}

/* Toolbar */
.shg-tiles-toolbar-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 10px 16px;
    margin-bottom: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.shg-tiles-toolbar-group {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

/* Filter buttons */
.shg-tiles-filter-group {
    display: inline-flex;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 2px;
    gap: 2px;
}

.shg-tiles-filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: inherit;
}

.shg-tiles-filter-btn:hover {
    color: #1e293b;
}

.shg-tiles-filter-btn.active {
    background: #ffffff;
    color: #0284c7;
    border-color: #cbd5e1;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.shg-filter-badge {
    background: #e2e8f0;
    color: #475569;
    font-size: 10.5px;
    padding: 1px 6px;
    border-radius: 10px;
    font-weight: 700;
}

.shg-filter-badge-media {
    background: #e0f2fe;
    color: #0284c7;
}

/* Density Switcher */
.shg-density-group {
    display: inline-flex;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 2px;
    gap: 2px;
}

.shg-density-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    font-size: 11.5px;
    font-weight: 600;
    color: #64748b;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: inherit;
}

.shg-density-btn:hover {
    color: #1e293b;
}

.shg-density-btn.active {
    background: #ffffff;
    color: #0f172a;
    border-color: #cbd5e1;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

/* ==========================================================================
   Tiles Grid Canvas
   ========================================================================== */
.shg-tiles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(165px, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}

/* Compact mode ("مربع‌های ریز") */
.shg-tiles-grid.density-compact {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 8px;
}

/* Tile Card Base */
.shg-tile-card {
    aspect-ratio: 1 / 1;
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    cursor: pointer;
    box-sizing: border-box;
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.2s ease;
}

.shg-tile-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.1);
    border-color: #94a3b8;
    z-index: 2;
}

/* Mover Checkbox in Top Corner */
.shg-tile-check {
    position: absolute;
    top: 6px;
    right: 6px;
    z-index: 6;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(4px);
    border-radius: 6px;
    padding: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
    opacity: 0;
    transition: opacity 0.15s ease;
    cursor: pointer;
}

.shg-tile-card:hover .shg-tile-check,
.shg-tile-check:has(input:checked) {
    opacity: 1;
}

.shg-tile-check input {
    cursor: pointer;
    margin: 0;
    width: 15px;
    height: 15px;
}

/* Direct Open Link Button */
.shg-tile-open-btn {
    position: absolute;
    top: 6px;
    left: 6px;
    z-index: 6;
    width: 24px;
    height: 24px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #334155;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
    opacity: 0;
    transition: all 0.15s ease;
    text-decoration: none !important;
}

.shg-tile-card:hover .shg-tile-open-btn {
    opacity: 1;
}

.shg-tile-open-btn:hover {
    color: #0284c7;
    transform: scale(1.1);
}

/* --------------------------------------------------------------------------
   Card Variant: Image
   -------------------------------------------------------------------------- */
.shg-tile-type-image .shg-tile-media-wrapper {
    width: 100%;
    height: 100%;
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.shg-tile-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.shg-tile-card:hover .shg-tile-img {
    transform: scale(1.08);
}

.shg-tile-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 8px;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.45) 0%, rgba(15, 23, 42, 0) 45%, rgba(15, 23, 42, 0.85) 100%);
    color: #ffffff;
    z-index: 3;
    pointer-events: none;
    box-sizing: border-box;
}

.shg-tile-overlay-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 10.5px;
    font-weight: 700;
    margin-top: 2px;
}

.shg-tile-post-id {
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    padding: 1px 5px;
    border-radius: 4px;
    opacity: 0.85;
}

.shg-tile-likes {
    background: rgba(225, 29, 72, 0.8);
    backdrop-filter: blur(4px);
    padding: 1px 6px;
    border-radius: 10px;
    font-size: 10px;
}

.shg-tile-overlay-bottom {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.shg-tile-author {
    font-size: 11.5px;
    font-weight: 700;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.shg-tile-snippet {
    font-size: 10.5px;
    line-height: 1.35;
    opacity: 0.92;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

.shg-tile-time {
    font-size: 9.5px;
    opacity: 0.75;
}

/* --------------------------------------------------------------------------
   Card Variant: Audio
   -------------------------------------------------------------------------- */
.shg-tile-type-audio {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border-color: #bbf7d0;
}

.shg-tile-audio-inner {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 10px;
    box-sizing: border-box;
    text-align: center;
}

.shg-tile-audio-icon {
    margin: 8px auto 0;
    color: #16a34a;
}

.shg-tile-audio-author {
    font-size: 11.5px;
    font-weight: 700;
    color: #166534;
}

.shg-tile-audio-snippet {
    font-size: 10.5px;
    color: #15803d;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.35;
}

.shg-tile-audio-ctrl-wrap {
    margin-top: auto;
}

.shg-tile-audio-ctrl {
    width: 100%;
    height: 24px;
}

/* --------------------------------------------------------------------------
   Card Variant: Video
   -------------------------------------------------------------------------- */
.shg-tile-type-video {
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    border-color: #fecaca;
}

.shg-tile-video-inner {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 10px;
    box-sizing: border-box;
    text-align: center;
}

.shg-tile-video-icon {
    margin: 8px auto 0;
    color: #dc2626;
}

.shg-tile-video-author {
    font-size: 11.5px;
    font-weight: 700;
    color: #991b1b;
}

.shg-tile-video-snippet {
    font-size: 10.5px;
    color: #b91c1c;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.35;
}

.shg-tile-video-play-btn {
    display: inline-block;
    background: #dc2626;
    color: #ffffff !important;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 9999px;
    text-decoration: none !important;
    margin: 0 auto;
    transition: background 0.15s ease;
}

.shg-tile-video-play-btn:hover {
    background: #b91c1c;
}

/* --------------------------------------------------------------------------
   Card Variant: Text-Only
   -------------------------------------------------------------------------- */
.shg-tile-type-text {
    background: #ffffff;
    border-color: #e2e8f0;
}

.shg-tile-text-inner {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 10px;
    box-sizing: border-box;
}

.shg-tile-text-quote {
    font-size: 26px;
    font-family: serif;
    color: #94a3b8;
    line-height: 0.8;
    height: 12px;
}

.shg-tile-text-body {
    font-size: 11px;
    color: #334155;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
    margin: 6px 0;
}

.density-compact .shg-tile-text-body {
    -webkit-line-clamp: 3;
    font-size: 10px;
}

.shg-tile-text-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 9.5px;
    color: #64748b;
    border-top: 1px solid #f1f5f9;
    padding-top: 4px;
}

/* ==========================================================================
   Tiles Mode Pagination
   ========================================================================== */
.shg-tiles-pagination-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    margin-top: 20px;
}

.shg-tiles-pagination {
    display: inline-flex;
    align-items: center;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 4px;
    gap: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.shg-tiles-page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 8px;
    font-size: 12px;
    font-weight: 600;
    color: #475569;
    border-radius: 8px;
    text-decoration: none !important;
    transition: all 0.15s ease;
}

.shg-tiles-page-btn:hover {
    background: #f1f5f9;
    color: #0f172a;
}

.shg-tiles-page-btn.active {
    background: #0284c7;
    color: #ffffff !important;
    font-weight: 700;
}

.shg-tiles-page-info {
    font-size: 12px;
    color: #64748b;
}

/* ==========================================================================
   Interactive Lightbox Modal
   ========================================================================== */
body.shg-lb-open {
    overflow: hidden !important;
}

.shg-tiles-lightbox {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: none;
    align-items: center;
    justify-content: center;
}

.shg-tiles-lightbox.is-active {
    display: flex;
}

.shg-lb-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(10px);
}

.shg-lb-container {
    position: relative;
    z-index: 2;
    width: 92vw;
    max-width: 1000px;
    max-height: 94vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.shg-lb-close {
    position: absolute;
    top: -42px;
    left: 0;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: #ffffff;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease;
}

.shg-lb-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.shg-lb-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(6px);
    border: none;
    color: #ffffff;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease, transform 0.15s ease;
    z-index: 5;
}

.shg-lb-nav:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-50%) scale(1.08);
}

.shg-lb-prev {
    right: -54px;
}

.shg-lb-next {
    left: -54px;
}

@media (max-width: 768px) {
    .shg-lb-prev {
        right: 8px;
    }
    .shg-lb-next {
        left: 8px;
    }
}

.shg-lb-media-stage {
    max-width: 100%;
    max-height: 75vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.shg-lb-img {
    max-width: 100%;
    max-height: 75vh;
    object-fit: contain;
    border-radius: 8px;
}

.shg-lb-caption-bar {
    width: 100%;
    background: rgba(30, 41, 59, 0.85);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    margin-top: 10px;
    padding: 10px 16px;
    color: #ffffff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    box-sizing: border-box;
}

.shg-lb-caption-main {
    display: flex;
    flex-direction: column;
    gap: 3px;
    overflow: hidden;
}

.shg-lb-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #94a3b8;
}

.shg-lb-author {
    color: #38bdf8;
    font-weight: 700;
}

.shg-lb-text {
    font-size: 13px;
    color: #f1f5f9;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.shg-lb-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #0284c7;
    color: #ffffff !important;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none !important;
    flex-shrink: 0;
    transition: background 0.15s ease;
}

.shg-lb-link:hover {
    background: #0369a1;
}

/* ============================================================
   Post Edit Info Line & Edit History Styles (tp=edits)
   ============================================================ */
.shg-post-lastedit {
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px dashed #e2e8f0;
    font-size: 12px;
    color: #94a3b8;
    line-height: 1.6;
}

.shg-post-lastedit .shg-post-edit-link,
.shg-post-lastedit a {
    color: #64748b !important;
    text-decoration: none !important;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: color 0.15s ease;
}

.shg-post-lastedit .shg-post-edit-link:hover,
.shg-post-lastedit a:hover {
    color: #0284c7 !important;
    text-decoration: underline !important;
}

.shg-post-lastedit i {
    font-style: normal;
    font-weight: 700;
    color: #334155;
}

/* Edit History Banner (tp=edits) */
.shg-edits-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    background: linear-gradient(135deg, #eff6ff 0%, #e0e7ff 100%);
    border: 1px solid #bfdbfe;
    border-radius: var(--shg-radius-md);
    padding: 14px 18px;
    margin-bottom: 16px;
}

.shg-edits-banner-main {
    display: flex;
    align-items: center;
    gap: 12px;
}

.shg-edits-banner-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: #dbeafe;
    color: #1d4ed8;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.shg-edits-banner-title {
    font-size: 14.5px;
    font-weight: 800;
    color: #1e3a8a;
    margin-bottom: 2px;
}

.shg-edits-banner-sub {
    font-size: 12px;
    color: #475569;
}

.shg-edits-count-badge {
    background: #fef3c7;
    color: #b45309;
    font-size: 11.5px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 6px;
    border: 1px solid #fde68a;
}

.shg-edits-section-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13.5px;
    font-weight: 800;
    color: #334155;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: var(--shg-radius-sm);
    padding: 10px 14px;
    margin: 16px 0 12px;
}

.shg-edits-section-header svg {
    color: #0284c7;
    flex-shrink: 0;
}





