/* LUB Shakthi — notifications, avatars and member profiles. */

/* ─────────────────────────────────────────────── avatars */

/* An uploaded photo replaces the initials circle but keeps its footprint, so
 * nothing reflows when one member has a photo and the next does not. */
.avatar.is-photo { object-fit: cover; padding: 0; }
.avatar-link { display: inline-flex; flex: none; border-radius: 50%; transition: transform .15s, box-shadow .15s; }
.avatar-link:hover { transform: scale(1.06); box-shadow: 0 0 0 3px var(--brand-100); }

/* Stable per-person colour, so the same face is the same colour everywhere. */
.avatar[data-tone="0"] { background: #F97316; }
.avatar[data-tone="1"] { background: #2563EB; }
.avatar[data-tone="2"] { background: #059669; }
.avatar[data-tone="3"] { background: #7C3AED; }
.avatar[data-tone="4"] { background: #DB2777; }
.avatar[data-tone="5"] { background: #0891B2; }

.avatar-lg {
    width: 92px; height: 92px; font-size: 30px; border-radius: 50%;
    border: 4px solid #fff; box-shadow: 0 4px 16px rgba(17,24,39,.16);
}

/* ─────────────────────────────────────────────── the bell */

.bell { position: relative; flex: none; }
.bell summary {
    list-style: none; cursor: pointer; position: relative;
    width: 40px; height: 40px; border-radius: 50%;
    display: grid; place-items: center; color: var(--ink-2);
    transition: background .15s, color .15s;
}
.bell summary::-webkit-details-marker { display: none; }
.bell summary:hover { background: var(--bg); color: var(--ink); }
.bell[open] summary { background: var(--brand-50); color: var(--brand-deep); }
.bell summary .material-symbols-outlined { font-size: 23px; }

/* The count, not a decoration. It draws the eye three times on arrival and
 * then stops: a badge that throbs forever is a badge nobody reads. */
.bell-dot {
    position: absolute; top: 1px; right: 0;
    min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
    background: #E11D48; color: #fff; font-size: 10.5px; font-weight: 800;
    display: grid; place-items: center; border: 2px solid #fff;
    animation: bellPulse 2.4s ease-in-out 3;
}
@keyframes bellPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(225,29,72,.5); }
    55% { box-shadow: 0 0 0 7px rgba(225,29,72,0); }
}

/* z-index matches the other two sheets in the bar. They are siblings in the
   header's stacking context, and the script closes one when another opens. */
.bell-sheet {
    position: absolute; right: 0; z-index: 70; width: 366px; max-width: 92vw;
    top: calc(100% + 6px + var(--mtabs-h, 0px));
    background: #fff; border: 1px solid var(--line-2); border-radius: 14px;
    box-shadow: 0 14px 40px rgba(17,24,39,.16); overflow: hidden;
    animation: sheetIn .18s cubic-bezier(.22,1,.36,1);
}
@keyframes sheetIn { from { opacity: 0; transform: translateY(-8px) scale(.98); } to { opacity: 1; transform: none; } }

.bell-head {
    display: flex; align-items: center; gap: 8px;
    padding: 12px 14px 11px; border-bottom: 1px solid var(--line);
}
.bell-head strong { font-size: 15px; font-weight: 700; letter-spacing: -.01em; }
.bell-count {
    min-width: 20px; height: 19px; padding: 0 6px; border-radius: 999px;
    background: var(--brand); color: #fff; font-size: 10.5px; font-weight: 800;
    display: grid; place-items: center; flex: none;
}
.bell-head form { margin: 0 0 0 auto; }
.bell-head button {
    background: 0; border: 0; padding: 0; cursor: pointer; font-family: inherit;
    font-size: 11.5px; font-weight: 700; color: var(--brand-deep);
}
.bell-head button:hover { text-decoration: underline; }

.bell-list { max-height: 62vh; overflow-y: auto; }
.bell-none {
    display: flex; flex-direction: column; align-items: center; gap: 6px;
    padding: 30px 16px; font-size: 13px; color: var(--ink-3);
}
.bell-none .material-symbols-outlined { font-size: 26px; color: var(--line-2); }
.bell-all {
    display: block; text-align: center; padding: 11px; font-size: 13px; font-weight: 700;
    border-top: 1px solid var(--line); color: var(--brand-deep); background: #FCFCFD;
}
.bell-all:hover { background: var(--brand-50); }

/* ─────────────────────────────────────────────── one notification */

/* Compact and flat.
 *
 * The first version put a 34px gradient disc and three stacked lines on every
 * row, so twelve notifications read as twelve advertisements. The time moved
 * to the right edge, the discs became quiet tinted squares, and unread is
 * carried by a saffron edge and a dot rather than by shouting. */
.notif {
    display: flex; align-items: flex-start; gap: 10px;
    padding: 10px 14px 10px 11px;
    color: inherit; position: relative;
    border-left: 3px solid transparent;
    transition: background .14s;
}
.notif:hover { background: var(--bg); }
.notif.is-unread { background: #FFF8F2; border-left-color: var(--brand); }
.notif.is-unread:hover { background: var(--brand-50); }
.notif.is-unread .t { font-weight: 700; color: var(--ink); }
.notif.is-row { padding: 13px 18px 13px 15px; border-bottom: 1px solid var(--line); }
.notif.is-row:last-child { border-bottom: 0; }
.notif .grow { flex: 1; min-width: 0; }
.notif .t {
    font-size: 13px; font-weight: 500; line-height: 1.4; color: var(--ink-2);
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    overflow: hidden;
}
.notif .d {
    display: block; font-size: 12px; color: var(--ink-3); margin-top: 1px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.notif-end {
    flex: none; display: flex; flex-direction: column; align-items: flex-end;
    gap: 6px; padding-top: 1px;
}
.notif-end .m { font-size: 11px; color: var(--ink-3); white-space: nowrap; }

.notif-ico {
    width: 32px; height: 32px; flex: none; border-radius: 9px;
    display: grid; place-items: center;
}
.notif-ico .material-symbols-outlined { font-size: 18px; font-variation-settings: "FILL" 1; }
.notif-ico.tone-rose { background: #FEF2F3; color: #C01048; }
.notif-ico.tone-blue { background: #EFF6FF; color: #1D4ED8; }
.notif-ico.tone-brand { background: var(--brand-100); color: var(--brand-deep); }
/* Notification::tone() names five, not three. The two that had no rule were
   falling through to a transparent square with black ink in it. */
.notif-ico.tone-green { background: #ECFDF3; color: #047857; }
.notif-ico.tone-violet { background: #F5F3FF; color: #6D28D9; }

.notif-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--brand); flex: none; }

/* ─────────────────────────────────────────────── the chime, and the ask */

.bell-mute {
    width: 28px; height: 28px; flex: none; border: 0; border-radius: 50%;
    background: 0; color: var(--ink-3); cursor: pointer;
    display: grid; place-items: center; margin-left: auto;
}
.bell-mute:hover { background: var(--bg); color: var(--ink-2); }
.bell-mute.is-off { color: var(--line-2); }
.bell-mute .material-symbols-outlined { font-size: 18px; }
/* The "mark all read" form claimed the auto margin; with the mute button
   between them the form sits next to it rather than across the sheet. */
.bell-head .bell-mute + form { margin-left: 0; }

/* Asking to be told when the app is shut.
 *
 * Shown only when push is configured and this browser has not been asked
 * yet — and never on page load, because a permission prompt a member did
 * not invite is how a site gets blocked for good. */
.bell-ask {
    display: flex; align-items: center; gap: 10px;
    padding: 11px 14px; background: var(--brand-50);
    border-bottom: 1px solid var(--brand-200);
}
.bell-ask > .material-symbols-outlined { font-size: 20px; color: var(--brand-deep); flex: none; }
.bell-ask .grow { min-width: 0; }
.bell-ask strong { display: block; font-size: 12.5px; color: var(--brand-deep); line-height: 1.3; }
.bell-ask small { display: block; font-size: 11px; color: var(--ink-3); margin-top: 1px; line-height: 1.4; }
.bell-ask .btn { flex: none; }

/* ─────────────────────────────────────────────── the passing notice
 *
 * While the tab is in front, a system notification over the page you are
 * already looking at is noise — so it is said here instead, once, and goes
 * away by itself. */
.notify-toast {
    position: fixed; z-index: 92; left: 18px; bottom: 18px;
    display: flex; align-items: center; gap: 11px;
    max-width: 380px; padding: 11px 14px 11px 11px;
    background: #fff; color: inherit;
    border: 1px solid var(--line-2); border-radius: 13px;
    box-shadow: 0 14px 40px rgba(17,24,39,.18);
    animation: toastIn .22s cubic-bezier(.22,1,.36,1);
}
.notify-toast.is-going { animation: toastOut .4s ease forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(10px); } }

.notify-toast .grow { min-width: 0; }
.notify-toast strong {
    display: block; font-size: 13px; line-height: 1.35;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.notify-toast span.grow > span {
    display: block; font-size: 11.5px; color: var(--ink-3); margin-top: 1px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.notify-toast-ico {
    width: 34px; height: 34px; flex: none; border-radius: 10px;
    display: grid; place-items: center;
}
.notify-toast-ico .material-symbols-outlined { font-size: 19px; font-variation-settings: "FILL" 1; }
.notify-toast-ico.tone-rose { background: #FEF2F3; color: #C01048; }
.notify-toast-ico.tone-blue { background: #EFF6FF; color: #1D4ED8; }
.notify-toast-ico.tone-brand { background: var(--brand-100); color: var(--brand-deep); }
.notify-toast-ico.tone-green { background: #ECFDF3; color: #047857; }
.notify-toast-ico.tone-violet { background: #F5F3FF; color: #6D28D9; }

/* Clear of the tab bar a phone keeps under the thumb. */
@media (max-width: 759px) {
    .notify-toast { left: 10px; right: 10px; max-width: none; bottom: calc(var(--mbot-h, 60px) + 12px); }
}

/* ─────────────────────────────────────────────── member profile */

.person {
    background: #fff; border: 1px solid var(--line); border-radius: var(--r-xl);
    box-shadow: var(--shadow); overflow: hidden; margin-bottom: 18px;
}
.person-cover {
    height: 104px;
    background: linear-gradient(135deg, #EA580C 0%, #F97316 48%, #FB923C 100%);
    position: relative; overflow: hidden;
}
.person-cover::after {
    content: ''; position: absolute; width: 260px; height: 260px; border-radius: 50%;
    right: -90px; top: -130px; background: rgba(255,255,255,.14);
}

.person-main { padding: 0 20px 22px; text-align: center; }
.person-face { position: relative; display: inline-block; margin-top: -48px; }

.face-edit {
    position: absolute; right: -2px; bottom: 2px;
    width: 32px; height: 32px; border-radius: 50%; cursor: pointer;
    background: var(--ink); color: #fff; border: 3px solid #fff;
    display: grid; place-items: center; transition: background .15s, transform .15s;
}
.face-edit:hover, .face-edit:focus-visible { background: var(--brand); transform: scale(1.08); }
.face-edit .material-symbols-outlined { font-size: 15px; }

.person-main h1 { font-size: 22px; margin: 12px 0 2px; letter-spacing: -.02em; }
.person-who { font-size: 14px; color: var(--ink-2); margin: 0; }

.person-meta {
    display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 16px;
    margin: 12px 0 0; font-size: 12.5px; color: var(--ink-3);
}
.person-meta span { display: inline-flex; align-items: center; gap: 4px; }
.person-meta .material-symbols-outlined { font-size: 15px; }

.person-sectors { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 14px; }

.person-stats {
    display: flex; justify-content: center; gap: 0; margin: 18px 0 0;
    border-top: 1px solid var(--line); padding-top: 16px;
}
.person-stats div { flex: 1; max-width: 130px; }
.person-stats div + div { border-left: 1px solid var(--line); }
.person-stats dt {
    font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em;
    color: var(--ink-3); font-weight: 700;
}
.person-stats dd {
    margin: 3px 0 0; font-size: 21px; font-weight: 800; letter-spacing: -.02em;
    font-variant-numeric: tabular-nums;
}

.person-feed-head {
    font-size: 15px; font-weight: 800; letter-spacing: -.01em;
    margin: 0 0 12px 4px; color: var(--ink-2);
}

.who-link { color: inherit; }
.who-link:hover { color: var(--brand-deep); text-decoration: underline; }

/* Anchoring the sheet to the bell only works while there is room to its left.
 * On a phone the bell sits near the right edge, so a 348px sheet hangs off the
 * screen and the first 80-odd pixels of every line are cut off. Below this
 * width it is pinned to the viewport instead. */
@media (max-width: 560px) {
    .bell-sheet {
        position: fixed; top: calc(62px + 8px); right: 10px; left: 10px;
        width: auto; max-width: none;
    }
    .bell-list { max-height: 54vh; }

    /* Buys back the width the bell took from the chapter name. */
    .mtop-right .btn-2 .lbl { display: none; }
    .mtop-right .btn-2 { padding: 7px 10px; }
}

@media (max-width: 460px) {
    .person-stats div { max-width: none; }
    .person-main h1 { font-size: 19px; }
}

@media (prefers-reduced-motion: reduce) {
    .bell-dot { animation: none; }
    .bell-sheet { animation: none; }
    .avatar-link { transition: none; }
}
