/* Live Reading Presence, Community Stats & Notification Centre */
.jb-notif-wrap {
    position: relative;
}

.jb-notif-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: #e50914;
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    border: 2px solid #0E2340;
}

.jb-notif-drawer {
    display: none;
    position: fixed;
    top: 64px;
    right: 16px;
    width: min(390px, calc(100vw - 24px));
    max-height: min(76vh, 560px);
    background: #ffffff;
    color: #171C24;
    border: 1px solid rgba(16, 44, 80, 0.16);
    border-radius: 16px;
    box-shadow: 0 20px 48px rgba(10, 24, 48, 0.25);
    z-index: 1600;
    flex-direction: column;
    overflow: hidden;
}

.jb-notif-drawer.is-open {
    display: flex;
}

.jb-notif-drawer-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 12px 14px;
    background: #102C50;
    color: #fff;
}

.jb-notif-drawer-head h3 {
    margin: 0;
    font-size: 14px;
    font-weight: 800;
}

.jb-notif-head-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.jb-notif-head-btn {
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    border: none;
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
}

.jb-notif-tabs {
    display: flex;
    border-bottom: 1px solid rgba(16, 44, 80, 0.1);
    background: #F8F6F0;
}

.jb-notif-tab {
    flex: 1;
    padding: 8px 10px;
    border: none;
    background: transparent;
    font-size: 12px;
    font-weight: 700;
    color: #5A6475;
    cursor: pointer;
    border-bottom: 2px solid transparent;
}

.jb-notif-tab.is-active {
    color: #102C50;
    border-bottom-color: #D5A83F;
    background: #fff;
}

.jb-notif-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.jb-notif-item {
    display: flex;
    gap: 10px;
    padding: 10px;
    border-radius: 10px;
    border: 1px solid rgba(16, 44, 80, 0.08);
    margin-bottom: 8px;
    background: #fff;
}

.jb-notif-item.is-unread {
    background: #FFFDF6;
    border-color: rgba(213, 168, 63, 0.45);
}

.jb-notif-thumb {
    width: 44px;
    height: 54px;
    border-radius: 6px;
    object-fit: cover;
    flex-shrink: 0;
    background: #E9ECEF;
}

.jb-notif-item-body {
    flex: 1;
    min-width: 0;
}

.jb-notif-item-title {
    font-size: 12.5px;
    font-weight: 800;
    color: #102C50;
    margin-bottom: 2px;
}

.jb-notif-item-msg {
    font-size: 12px;
    color: #364152;
    line-height: 1.4;
    word-break: break-word;
}

.jb-notif-item-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    margin-top: 6px;
    font-size: 11px;
    color: #6B7280;
}

.jb-notif-item-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.jb-notif-link {
    color: #102C50;
    font-weight: 700;
    text-decoration: none;
}

.jb-notif-act {
    background: #EEF1F6;
    border: none;
    border-radius: 6px;
    padding: 3px 7px;
    font-size: 11px;
    font-weight: 700;
    color: #102C50;
    cursor: pointer;
}

.jb-notif-act.is-del {
    background: transparent;
    color: #9CA3AF;
    font-size: 15px;
    line-height: 1;
    padding: 0 4px;
}

.jb-notif-loading,
.jb-notif-empty {
    padding: 24px 12px;
    text-align: center;
    font-size: 13px;
    color: #6B7280;
}

.jb-notif-footer {
    padding: 8px 12px;
    border-top: 1px solid rgba(16, 44, 80, 0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    background: #F8F6F0;
}

.jb-notif-load-more {
    border: 1px solid #102C50;
    background: #fff;
    color: #102C50;
    border-radius: 8px;
    padding: 5px 10px;
    font-size: 11.5px;
    font-weight: 700;
    cursor: pointer;
}

.jb-notif-prefs-link {
    font-size: 11.5px;
    font-weight: 700;
    color: #102C50;
    text-decoration: none;
}

/* Live Reader Pill */
.jb-live-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(16, 44, 80, 0.08);
    border: 1px solid rgba(213, 168, 63, 0.45);
    font-size: 12px;
    font-weight: 700;
    color: inherit;
    white-space: nowrap;
}

.jb-live-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.22);
    flex-shrink: 0;
}

/* Community Stats Bar */
.jb-community-stats {
    margin: 18px auto;
    padding: 16px 18px;
    border-radius: 16px;
    background: linear-gradient(135deg, #0E2340 0%, #163661 100%);
    color: #fff;
    border: 1px solid rgba(213, 168, 63, 0.42);
    box-shadow: 0 10px 26px rgba(10, 24, 48, 0.18);
    max-width: 1240px;
}

.jb-cs-head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.jb-cs-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.22);
}

.jb-cs-title {
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #E8C97A;
}

.jb-cs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 10px;
}

.jb-cs-item {
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 10px 12px;
}

.jb-cs-item strong {
    display: block;
    font-size: 20px;
    font-weight: 800;
    color: #FFD700;
    line-height: 1.2;
}

.jb-cs-item span {
    display: block;
    font-size: 11.5px;
    color: rgba(255, 255, 255, 0.82);
    margin-top: 2px;
}

/* Notification Preferences Form */
.jb-prefs-card {
    background: #fff;
    border: 1px solid rgba(16, 44, 80, 0.12);
    border-radius: 14px;
    padding: 16px;
    margin-top: 12px;
    color: #171C24;
}

.jb-pref-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid rgba(16, 44, 80, 0.08);
    font-size: 13px;
}

.jb-pref-row:last-child {
    border-bottom: none;
}

.jb-pref-label {
    font-weight: 700;
    color: #102C50;
    min-width: 180px;
}

.jb-pref-row label {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
}

@media (max-width: 640px) {
    .jb-notif-drawer {
        right: 12px;
        left: 12px;
        width: auto;
        top: 60px;
    }
    .jb-cs-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
