.life-page .life-shell {
  padding-top: 0;
  padding-bottom: calc(88px + env(safe-area-inset-bottom));
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
.life-heading { display: flex; align-items: center; gap: 4px; margin: 0; }
.life-heading .search-page-title { margin: 0; }
.app-header .life-heading { box-sizing: border-box; width: 100%; max-width: 450px; padding: 0 var(--app-content-inline-padding); background: #fff; }
#life-sort-control { margin-left: auto; }
.life-info-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text-secondary);
}
.life-info-button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }
.life-info-dialog {
  box-sizing: border-box;
  width: min(418px, calc(100% - 32px));
  max-height: calc(100dvh - 48px);
  margin: auto;
  padding: 20px;
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 0;
  border-radius: 12px;
  background: #fff;
  color: var(--text-primary);
  box-shadow: var(--modal-surface-shadow);
  font-size: 13px;
  line-height: 1.75;
}
.life-info-dialog::backdrop { background: rgba(42, 35, 40, .4); }
.life-info-heading { display: flex; justify-content: flex-end; margin: -8px -8px 0 0; }
.life-info-dialog form { margin: 0; }
.life-info-close { width: 44px; height: 44px; padding: 0; border: 0; border-radius: 8px; background: transparent; color: var(--text-secondary); font-size: 24px; }
.life-info-dialog p { margin: 0; }
.life-info-feature { margin-top: 20px; }
.life-info-heading + .life-info-feature { margin-top: 0; }
.life-info-feature h3 { margin: 0 0 4px; padding: 0; font-size: 14px; font-weight: 700; }
.life-info-feature p { color: var(--text-secondary); }
.life-intro { margin: 0 0 24px; color: var(--text-secondary); font-size: 14px; }
.life-recent { margin: 0 0 20px; }
.life-recent[hidden] { display: none; }
.life-recent-list { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px; }
.life-recent-card { flex: 0 0 88px; }
.life-recent-card .life-card-content { padding: 6px 5px; }
.life-recent-card h3.card-situation-title { font-size: 10px; padding: 3px 4px; }
.life-shell .category-title { margin: 0 0 12px; text-align: left; }
.life-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.life-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  color: var(--text-primary);
  text-decoration: none;
}
.life-card-cover {
  display: flex;
  position: relative;
  align-items: flex-end;
  width: 100%;
  aspect-ratio: 16 / 25;
  overflow: hidden;
  border-radius: 12px;
  background: #f3f4f6;
  color: #fff;
}
.life-card[hidden] { display: none; }
.life-card:focus-visible { outline: 2px solid var(--text-primary); outline-offset: 4px; }
.life-card-image {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.life-card-cover::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, .82) 8%, rgba(0, 0, 0, .18) 70%, transparent 88%);
  pointer-events: none;
}
.life-card-content {
  display: flex;
  flex-direction: column;
  gap: 7px;
  position: relative;
  box-sizing: border-box;
  width: 100%;
  padding: 12px 10px 11px;
}
.life-card h3.card-situation-title {
  margin: 0;
  padding: 5px 7px;
  border: 1px solid rgba(255, 255, 255, .38);
  border-radius: 8px;
  background: rgba(255, 255, 255, .18);
  color: #fff;
  font-size: .8rem;
  font-weight: 700;
  line-height: 1.35;
  text-align: left;
  text-shadow: none;
  box-shadow: none;
  overflow-wrap: anywhere;
}
.life-card p {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  color: rgba(255, 255, 255, .88);
  font-size: .62rem;
  line-height: 1.55;
}
.life-card-action { display: none; }

/* Overlapping member portraits match the group situation cards. */
.life-cast {
  display: flex;
  align-items: center;
  min-height: 30px;
  margin: 0;
  padding: 0 0 0 2px;
  list-style: none;
}
.life-cast-person {
  flex: 0 1 30px;
  min-width: 0;
  margin-left: -10px;
}
.life-cast-person:first-child { margin-left: 0; }
.life-cast-person img {
  box-sizing: border-box;
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  border: 2px solid rgba(255, 255, 255, .92);
  border-radius: 50%;
  object-fit: cover;
  object-position: center top;
  background: #f3f4f6;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .28);
}
.life-cast-person span { display: none; }

/* Registered member images also form each new school's cover. */
.life-card-portraits {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
}
.life-card-portraits img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: cover;
  object-position: center top;
}
.life-card-portraits::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, .82) 8%, rgba(0, 0, 0, .18) 70%, transparent 88%);
}

/* Keep the inline Life tags as compact as the cast discovery controls. */
.life-page { --discovery-filter-muted-color: #aaa5aa; }
#life-tag-filter[hidden] { display: none; }
#life-tag-scroller { gap: 2px; padding: 6px 16px 2px; }
/* Life content has no top padding; keep 8px below the header filters. */
.app-header #life-tag-scroller { padding-bottom: 8px; }
#life-tag-filter .discovery-situation-tag-button { box-sizing: border-box; min-height: 28px; padding: 3px 8px; }
#life-tag-scroller > .discovery-situation-tag-button:first-child:not(.is-active) { padding-left: 0; border-left-width: 0; }
.life-tag-dialog .discovery-situation-tag-button { box-sizing: border-box; min-height: 28px; }
.life-tag-dialog { position: fixed; inset: auto 0 0; margin: 0 auto; border: 0; color: var(--text-primary); }
.life-tag-dialog::backdrop { background: rgba(18, 16, 18, .42); }
.life-tag-dialog form { margin: 0; }
.life-tag-dialog .discovery-situation-tag-close { width: 44px; height: 44px; }
body:has(.life-tag-dialog[open]) { overflow: hidden; }
