/* Hub Activity — bell button + drawer panel.
 *
 * Forest/sand palette matched to the existing pack-header (#2f4525 →
 * #3e5a30) and chip surface (white-on-sand). Drawer slides down from
 * the top-right under the bell; a small green pip on the bell signals
 * unread count.
 */

.kagn-act-bell {
    position: relative;
    /* Match .header-profile-btn so the bell reads as a peer of the avatar
     * rather than a loose emoji floating in the dark header. */
    background: rgba(255, 255, 255, 0.15);
    border: 0;
    padding: 0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: inherit;
    transition: background 120ms ease;
    flex-shrink: 0;
    /* Slight extra gap from the profile icon (cluster default gap is 12px,
     * which makes them read as one unit). And a negative right margin
     * pulls the bell into the header's right padding so it sits closer
     * to the screen edge. */
    margin-left: 4px;
    margin-right: -4px;
}
@media (max-width: 600px) {
    .kagn-act-bell {
        margin-right: 0;
    }
}
.kagn-act-bell:hover,
.kagn-act-bell:focus-visible {
    background: rgba(255, 255, 255, 0.25);
    outline: none;
}

/* On the Hub the back button is display:none, leaving the right-cluster
 * (login + profile + bell) as the only child of .header-inner. With
 * justify-content: space-between and one child, the child snaps to the
 * left — which is why the bell appeared in the top-left of the header.
 * Force the cluster to the right when the bell is mounted so the whole
 * group hugs the right edge of the header. */
.header-inner.has-activity-bell > div {
    margin-left: auto;
}
.kagn-act-bell-icon {
    font-size: 18px;
    line-height: 1;
    display: inline-block;
}
/* The dot doubles as a count badge: empty for 1-9, "99+" past 99. Floats
 * top-right of the bell, with a dark border so it reads on either the
 * dark pack-header or a light header variant. */
.kagn-act-dot {
    position: absolute;
    top: -2px;
    right: -2px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    box-sizing: content-box;
    background: #d94c3a;
    color: #fff;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
    border: 1.5px solid var(--kagn-header-bg, #2f4525);
    box-shadow: 0 1px 3px rgba(0,0,0,0.25);
    pointer-events: none;
}

/* ─── Drawer ────────────────────────────────────────────────────────── */

.kagn-act-drawer {
    position: fixed;
    top: 56px;
    right: 8px;
    width: min(360px, calc(100vw - 16px));
    max-height: min(560px, calc(100vh - 80px));
    background: #fff;
    border: 1px solid #d8d0bb;
    border-radius: 12px;
    box-shadow: 0 16px 40px rgba(20, 30, 20, 0.18);
    z-index: 9000;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transform-origin: top right;
    transform: translateY(-6px) scale(0.98);
    opacity: 0;
    transition: opacity 140ms ease, transform 140ms ease;
}
.kagn-act-drawer.is-open {
    transform: translateY(0) scale(1);
    opacity: 1;
}
.kagn-act-drawer[hidden] { display: none; }

.kagn-act-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px 10px;
    border-bottom: 1px solid #ede7d4;
}
.kagn-act-head h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    color: #2a3429;
}
.kagn-act-close {
    background: transparent;
    border: 0;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    color: #6e7269;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.kagn-act-close:hover { background: #f5f1e8; color: #2a3429; }

.kagn-act-list {
    overflow-y: auto;
    flex: 1;
    padding: 4px 0;
}

.kagn-act-empty {
    padding: 24px 16px;
    text-align: center;
    color: #6e7269;
    font-size: 13px;
    line-height: 1.5;
}

/* ─── Item ──────────────────────────────────────────────────────────── */

.kagn-act-item {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    width: 100%;
    padding: 10px 14px;
    background: transparent;
    border: 0;
    border-top: 1px solid #f3eedb;
    text-align: left;
    cursor: pointer;
    color: #2a3429;
    font-family: inherit;
    transition: background 100ms ease;
}
.kagn-act-item:first-child { border-top: 0; }
.kagn-act-item:hover:not(.is-deleted) { background: #faf6e9; }
.kagn-act-item.is-unread { background: #f3faea; }
.kagn-act-item.is-unread:hover { background: #ebf5dc; }
.kagn-act-item.is-deleted {
    cursor: default;
    opacity: 0.55;
}

.kagn-act-thumb {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    overflow: hidden;
    background: linear-gradient(135deg, #b8c8a0 0%, #8aa372 100%);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.kagn-act-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.kagn-act-thumb-empty {
    background: #f5f1e8;
    color: #6fbe3e;
    font-size: 18px;
}

.kagn-act-meta {
    flex: 1;
    min-width: 0;
}
.kagn-act-body {
    font-size: 13px;
    line-height: 1.4;
    color: #2a3429;
    word-wrap: break-word;
}
.kagn-act-body strong { font-weight: 600; }
.kagn-act-body em { font-style: italic; color: #4a6a30; }
.kagn-act-when {
    margin-top: 3px;
    font-size: 11px;
    color: #8a8c81;
}

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

@media (max-width: 480px) {
    .kagn-act-drawer {
        top: 50px;
        right: 4px;
        left: 4px;
        width: auto;
        max-height: calc(100vh - 70px);
    }
    .kagn-act-bell { width: 32px; height: 32px; }
    .kagn-act-bell-icon { font-size: 16px; }
}
