/* Member & admin area layout: top bar + sidebar (desktop) / drawer + bottom bar (phone). */
.member-body { --m-top: 60px; --m-side: 250px; --m-bottom: 64px; background: var(--color-bg); }
.m-top { position: sticky; top: 0; z-index: var(--z-header); height: var(--m-top); display: flex; align-items: center; gap: var(--sp-2);
  padding: 0 var(--gutter); background: color-mix(in srgb, var(--color-surface) 92%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--color-border); }
.m-top .brand img { width: 36px; height: 36px; }
.m-top .brand__name { font-size: 1rem; }
/* narrow phones: the name shrinks (…) before the tools can be pushed off-screen */
.m-top .brand { min-width: 0; flex: 0 1 auto; }
.m-top .brand__text { min-width: 0; }
.m-top .brand__name { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.m-top__tools { display: flex; align-items: center; gap: var(--sp-1); margin-left: auto; flex: 0 0 auto; }
@media (max-width: 400px) { .m-top .brand__text { display: none; } }
.m-top .lang-switch { display: none; }
@media (min-width: 480px) { .m-top .lang-switch { display: inline-flex; } }
.avatar--sm { --size: 36px; border-width: 1.5px; font-size: 0.8rem; }
.m-user { position: relative; }
.m-user summary { list-style: none; cursor: pointer; border-radius: var(--radius-full); }
.m-user summary::-webkit-details-marker { display: none; }
.m-user__menu { position: absolute; right: 0; top: calc(100% + 8px); min-width: 210px; padding: var(--sp-2); background: var(--color-surface-raised); border: 1px solid var(--color-border); border-radius: var(--radius); box-shadow: var(--shadow-lg); display: grid; z-index: var(--z-menu); }
.m-user__menu a, .m-user__menu button { display: block; text-align: left; padding: var(--sp-2) var(--sp-3); border-radius: var(--radius-sm); border: 0; background: none; color: var(--color-text); text-decoration: none; font-size: var(--fs-sm); min-height: 40px; }
.m-user__menu a:hover, .m-user__menu button:hover { background: var(--color-bg-alt); }
.m-user__name { margin: 0; padding: var(--sp-2) var(--sp-3); font-weight: 700; border-bottom: 1px solid var(--color-border); font-size: var(--fs-sm); }

.m-side { position: fixed; z-index: var(--z-menu); top: 0; bottom: 0; left: 0; width: min(84vw, 300px); background: var(--color-surface); border-right: 1px solid var(--color-border);
  transform: translateX(-100%); transition: transform var(--dur) var(--ease); overflow-y: auto; }
.m-side-open .m-side { transform: none; box-shadow: var(--shadow-lg); }
.m-backdrop { position: fixed; inset: 0; z-index: calc(var(--z-menu) - 1); border: 0; background: var(--color-overlay); opacity: 0; pointer-events: none; transition: opacity var(--dur) var(--ease); }
.m-side-open .m-backdrop { opacity: 1; pointer-events: auto; }
.m-side__inner { display: grid; gap: 2px; padding: var(--sp-4) var(--sp-3) calc(var(--m-bottom) + var(--sp-4)); }
.m-side a { position: relative; display: flex; align-items: center; gap: var(--sp-3); min-height: 44px; padding: 0 var(--sp-3); border-radius: var(--radius-sm); color: var(--color-text); text-decoration: none; font-size: var(--fs-sm); font-weight: 500; }
.m-side a:hover { background: var(--color-bg-alt); }
.m-side a[aria-current='page'] { background: var(--color-info-bg); color: var(--color-heading); font-weight: 700; }
.m-side a[aria-current='page']::before { content: ''; position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px; border-radius: 3px; background: var(--color-accent); }
.m-side a[data-soon] { color: var(--color-text-muted); }
.soon-dot { width: 6px; height: 6px; margin-left: auto; border-radius: 50%; background: var(--color-border-strong); }
.m-side__group { margin: var(--sp-4) var(--sp-3) var(--sp-1); font-size: var(--fs-xs); font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--color-accent-text); }

.m-bottom { position: fixed; z-index: var(--z-header); left: 0; right: 0; bottom: 0; height: calc(var(--m-bottom) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
  display: grid; grid-template-columns: repeat(5, 1fr); background: var(--color-surface); border-top: 1px solid var(--color-border); }
.m-bottom a, .m-bottom button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border: 0; background: none; color: var(--color-text-muted); text-decoration: none; font-size: 0.68rem; font-weight: 600; }
.m-bottom .soon-dot { display: none; }
.m-bottom a[aria-current='page'] { color: var(--color-accent-text); }
.m-bottom .icon { width: 22px; height: 22px; }

.m-main { padding: var(--sp-5) var(--gutter) calc(var(--m-bottom) + var(--sp-6)); max-width: 1180px; }
.member-body--plain .m-main { margin-inline: auto; max-width: 820px; padding-bottom: var(--sp-8); }
.m-head { margin-bottom: var(--sp-5); }
.m-head h1 { font-size: var(--fs-3xl); margin-bottom: var(--sp-1); }
.m-head p { color: var(--color-text-muted); margin: 0; }
.m-grid { display: grid; gap: var(--sp-4); grid-template-columns: minmax(0, 1fr); }
/* minmax(0, …): a column may never grow wider than the screen because of a long row inside it (scrolling tab bars) */
.m-grid > * { min-width: 0; }
@media (min-width: 900px) { .m-grid--2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .m-grid--main { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); align-items: start; } }
.panel-title { display: flex; align-items: center; gap: var(--sp-2); font-family: var(--font-body); font-size: var(--fs-lg); font-weight: 700; margin-bottom: var(--sp-3); }
.panel-title .icon { color: var(--color-accent-text); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: var(--sp-2) var(--sp-4); margin: 0; font-size: var(--fs-sm); }
.kv dt { color: var(--color-text-muted); }
.kv dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.status-badge[data-status='active'] { background: var(--color-success-bg); color: var(--color-success); }
.status-badge[data-status='pending'], .status-badge[data-status='applicant'] { background: var(--color-warning-bg); color: var(--color-warning); }
.status-badge[data-status='suspended'], .status-badge[data-status='rejected'] { background: var(--color-danger-bg); color: var(--color-danger); }
.status-badge[data-status='inactive'], .status-badge[data-status='deceased'] { background: var(--color-bg-alt); color: var(--color-text-muted); }

@media (min-width: 1024px) {
  .m-top__menu, .m-bottom, .m-backdrop { display: none; }
  .m-side { top: var(--m-top); width: var(--m-side); transform: none; z-index: 1; }
  .m-side__inner { padding-bottom: var(--sp-6); }
  .member-body:not(.member-body--plain) .m-main { margin-left: var(--m-side); padding: var(--sp-6) var(--sp-7) var(--sp-8); }
}
@media print { .m-top, .m-side, .m-bottom, .m-backdrop { display: none !important; } }

/* Notification bell + list (every member page; moved from community.css on 27 Nov 2026) */
.bell { position: relative; }
.bell summary { list-style: none; cursor: pointer; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; position: relative; }
.bell summary::-webkit-details-marker { display: none; }
.bell summary:hover { background: rgb(127 127 127 / 0.14); }
.bell__count { position: absolute; top: 4px; right: 2px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: var(--radius-full); background: var(--color-danger); color: #fff; font-size: 10px; font-weight: 700; display: grid; place-items: center; }
.bell__panel { position: absolute; right: -50px; top: calc(100% + 6px); width: min(92vw, 380px); background: var(--color-surface-raised); border: 1px solid var(--color-border); border-radius: var(--radius); box-shadow: var(--shadow-lg); z-index: var(--z-menu); overflow: hidden; }
/* phones: the panel spans the screen under the top bar (the bell is not at the screen edge, so a dropdown would spill off it) */
@media (max-width: 599px) { .bell__panel { position: fixed; left: var(--sp-2); right: var(--sp-2); top: calc(var(--m-top, 60px) + 6px); width: auto; } .bell__list { max-height: calc(100vh - var(--m-top, 60px) - 140px); } }
@media (min-width: 600px) { .bell__panel { right: 0; } }
.bell__head { display: flex; justify-content: space-between; align-items: center; padding: var(--sp-3) var(--sp-4); border-bottom: 1px solid var(--color-border); }
.bell__list { max-height: 60vh; overflow-y: auto; }
.bell__list > p { padding: var(--sp-4); margin: 0; }
.bell__all { display: block; text-align: center; padding: var(--sp-3); font-size: var(--fs-sm); font-weight: 600; border-top: 1px solid var(--color-border); text-decoration: none; }
.notif { display: flex; gap: var(--sp-3); align-items: flex-start; padding: var(--sp-3) var(--sp-4); text-decoration: none; color: inherit; border-bottom: 1px solid var(--color-border); font-size: var(--fs-sm); }
.notif:last-child { border-bottom: 0; }
.notif:hover { background: var(--color-bg-alt); }
.notif.is-unread { background: color-mix(in srgb, var(--color-accent) 9%, transparent); box-shadow: inset 4px 0 0 var(--color-accent); }
.notif.is-unread .notif__text { font-weight: 600; }
.notif__text small { font-weight: 400; }
.notif__text { flex: 1; display: grid; }
.notif__text small { color: var(--color-text-muted); font-size: var(--fs-xs); }
.notif-list { padding: 0; }
.notif .avatar { width: 36px; height: 36px; flex: 0 0 36px; font-size: .8rem; }
.notif__text { min-width: 0; overflow-wrap: anywhere; }
