/* Module UI components (layered on app.css tokens). */
.notification-dot { position: absolute; top: 4px; right: 2px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px; background: #dc2626; color: #fff; font-size: .65rem; font-weight: 700; display: grid; place-items: center; }
.notification-menu { width: min(360px, 92vw); max-height: 70vh; overflow-y: auto; }
.notification-item { white-space: normal; border-bottom: 1px solid var(--lc-border); padding: .625rem 1rem; }
.notification-item.unread { background: var(--lc-primary-soft); }
.back-link { display: inline-flex; align-items: center; gap: .375rem; color: var(--lc-text-muted); text-decoration: none; font-size: .9rem; margin-bottom: .5rem; }
.back-link:hover { color: var(--lc-primary); }
.lc-badge-danger { background: rgba(220, 38, 38, .12); color: #b91c1c; }
[data-bs-theme="dark"] .lc-badge-danger { color: #f87171; }
.lc-badge-success { background: rgba(22, 163, 74, .12); color: #15803d; }
[data-bs-theme="dark"] .lc-badge-success { color: #4ade80; }
.toast-error { border-color: rgba(220, 38, 38, .4); }
.avatar-img { object-fit: cover; padding: 0; }
.avatar-xl { width: 88px; height: 88px; font-size: 1.6rem; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: .5rem; }
.photo-grid img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--lc-radius-sm); border: 1px solid var(--lc-border); }
.hero-photo { width: 100%; max-height: 260px; object-fit: cover; border-radius: var(--lc-radius); border: 1px solid var(--lc-border); }
.item-card { display: flex; flex-direction: column; height: 100%; text-decoration: none; color: inherit; transition: box-shadow .15s ease, transform .15s ease; }
.item-card:hover { box-shadow: var(--lc-shadow-lg); transform: translateY(-1px); color: inherit; }
.item-card .thumb { height: 140px; background: var(--lc-surface-2); border-top-left-radius: var(--lc-radius); border-top-right-radius: var(--lc-radius); display: grid; place-items: center; overflow: hidden; color: var(--lc-text-muted); font-size: 2rem; }
.item-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.item-card .body { padding: .875rem 1rem 1rem; display: flex; flex-direction: column; gap: .25rem; flex: 1; }
.item-card .title { font-weight: 600; }
.filter-bar { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1rem; }
.filter-bar .form-control, .filter-bar .form-select { width: auto; flex: 1 1 160px; max-width: 260px; }
.dl-grid { display: grid; grid-template-columns: minmax(120px, 40%) 1fr; gap: .5rem 1rem; margin: 0; }
.dl-grid dt { color: var(--lc-text-muted); font-weight: 500; font-size: .9rem; }
.dl-grid dd { margin: 0; overflow-wrap: anywhere; }
.form-section { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--lc-text-muted); font-weight: 600; margin: 1.5rem 0 .75rem; }
.form-section:first-child { margin-top: 0; }
.sticky-actions { position: sticky; bottom: var(--lc-bottombar-height); background: color-mix(in srgb, var(--lc-surface) 92%, transparent); backdrop-filter: blur(6px); border-top: 1px solid var(--lc-border); padding: .75rem 1.25rem; margin: 1.25rem -1.25rem -1.25rem; border-bottom-left-radius: var(--lc-radius); border-bottom-right-radius: var(--lc-radius); display: flex; justify-content: flex-end; gap: .5rem; }
.quick-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.quick-actions .btn { display: inline-flex; align-items: center; gap: .375rem; }
.status-stripe { width: 4px; align-self: stretch; border-radius: 2px; flex-shrink: 0; background: var(--lc-border); }
.status-stripe.overdue { background: #dc2626; }
.status-stripe.soon { background: #f59e0b; }
.status-stripe.upcoming { background: var(--lc-primary); }
.progress { --bs-progress-bar-bg: var(--lc-primary); height: .5rem; }
.kpi { padding: 1rem 1.25rem; }
.kpi .value { font-size: 1.5rem; font-weight: 700; letter-spacing: -.02em; }
.kpi .label { color: var(--lc-text-muted); font-size: .85rem; }
.bar-row { display: grid; grid-template-columns: minmax(90px, 30%) 1fr auto; gap: .75rem; align-items: center; padding: .375rem 0; }
.bar-track { background: var(--lc-surface-2); border-radius: 4px; height: .6rem; overflow: hidden; }
.bar { height: 100%; border-radius: 4px; background: var(--lc-primary); }
.calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1px solid var(--lc-border); border-left: 1px solid var(--lc-border); }
.calendar-grid .dow { padding: .5rem; font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--lc-text-muted); font-weight: 600; background: var(--lc-surface-2); border-right: 1px solid var(--lc-border); border-bottom: 1px solid var(--lc-border); }
.calendar-grid .day { min-height: 112px; padding: .375rem; border-right: 1px solid var(--lc-border); border-bottom: 1px solid var(--lc-border); display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.calendar-grid .day.other { background: var(--lc-surface-2); opacity: .7; }
.calendar-grid .day.today .num { background: var(--lc-primary); color: #fff; border-radius: 999px; }
.calendar-grid .num { font-size: .8rem; font-weight: 600; width: 1.6rem; height: 1.6rem; display: grid; place-items: center; text-decoration: none; color: inherit; }
.cal-chip { display: block; font-size: .72rem; line-height: 1.25; padding: 2px 6px; border-radius: 4px; color: #fff; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-chip:hover { color: #fff; filter: brightness(1.1); }
.cal-more { font-size: .7rem; color: var(--lc-text-muted); }
@media (max-width: 767.98px) { .calendar-grid { display: none; } }
.agenda-day { padding: .75rem 1.25rem; border-top: 1px solid var(--lc-border); }
.agenda-day:first-child { border-top: 0; }
.agenda-date { font-weight: 700; font-size: .85rem; color: var(--lc-text-muted); text-transform: uppercase; letter-spacing: .04em; margin-bottom: .375rem; }
.agenda-item { display: flex; gap: .625rem; align-items: center; padding: .25rem 0; color: inherit; text-decoration: none; }
.agenda-item:hover { color: var(--lc-primary); }
.agenda-swatch { width: .625rem; height: .625rem; border-radius: 50%; flex-shrink: 0; }
.plan-card.current { border-color: var(--lc-primary); box-shadow: 0 0 0 2px rgba(var(--lc-primary-rgb), .25); }
.foster-banner { border-radius: var(--lc-radius); padding: 1rem 1.25rem; background: linear-gradient(135deg, rgba(217, 119, 6, .12), rgba(219, 39, 119, .08)); border: 1px solid rgba(217, 119, 6, .25); }
.swatch-input { width: 3.5rem; padding: .25rem; height: calc(1.5em + .75rem + 2px); }
.task-row { display: flex; align-items: flex-start; gap: .75rem; padding: .75rem 1.25rem; border-top: 1px solid var(--lc-border); }
.task-row:first-child { border-top: 0; }
.task-row.done .task-title { text-decoration: line-through; color: var(--lc-text-muted); }
.task-check { border: 0; background: none; padding: 0; font-size: 1.35rem; line-height: 1; color: var(--lc-text-muted); }
.task-check:hover { color: var(--lc-primary); }
.log-entry { white-space: pre-wrap; }
.tree { list-style: none; padding-left: 1.25rem; margin: 0; border-left: 1px dashed var(--lc-border); }
.tree-root { padding-left: 0; border-left: 0; }
.tree li { padding: .25rem 0; }
.dot-swatch { display: inline-block; width: .75rem; height: .75rem; border-radius: 50%; vertical-align: middle; }
.location-menu { width: 290px; }

/* Bootstrap forces offcanvas-lg backgrounds transparent on desktop; keep the sidebar dark. */
.app-nav::-webkit-scrollbar { width: 6px; }
.app-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); border-radius: 3px; }
.app-nav { scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.15) transparent; }

/* Family feed (Home) */
.feed-column { max-width: 680px; margin: 0 auto; }
.feed-post { overflow: hidden; }
.feed-post-header { display: flex; align-items: center; gap: .625rem; padding: .875rem 1rem .5rem; }
.feed-post-author { font-weight: 600; font-size: .95rem; }
.feed-post-meta { font-size: .8rem; color: var(--lc-text-muted); }
.feed-post.pinned { border-color: var(--lc-primary); }
.feed-post-body { padding: 0 1rem .625rem; }
.feed-post-text { margin: 0; font-size: 1rem; line-height: 1.45; }
.feed-photo-link { display: block; background: var(--lc-surface-2); border-top: 1px solid var(--lc-border); border-bottom: 1px solid var(--lc-border); }
.feed-photo { display: block; width: 100%; max-height: 560px; object-fit: contain; }
.feed-event { display: flex; align-items: center; gap: .875rem; padding: .75rem; border: 1px solid var(--lc-border); border-radius: var(--lc-radius-sm); background: var(--lc-surface-2); margin-top: .625rem; flex-wrap: wrap; }
.feed-event-date { width: 3.25rem; text-align: center; border-radius: var(--lc-radius-sm); background: var(--lc-surface); border: 1px solid var(--lc-border); padding: .25rem 0; line-height: 1.1; }
.feed-event-date span { display: block; font-size: .7rem; text-transform: uppercase; color: #dc2626; font-weight: 700; }
.feed-event-date strong { font-size: 1.25rem; }

.feed-post-summary { display: flex; align-items: center; gap: .5rem; padding: .5rem 1rem; font-size: .875rem; color: var(--lc-text-muted); }
.reaction-summary { display: inline-flex; align-items: center; }
.reaction-dot { width: 20px; height: 20px; border-radius: 50%; display: inline-grid; place-items: center; color: #fff; font-size: .65rem; border: 2px solid var(--lc-surface); margin-right: -4px; }
.reaction-like { background: linear-gradient(135deg, #2dd4bf, #0f766e); }
.reaction-love { background: linear-gradient(135deg, #fb7185, #e11d48); }
.reaction-celebrate { background: linear-gradient(135deg, #fbbf24, #d97706); }
.feed-comment-count { cursor: pointer; }
.feed-comment-count:hover { text-decoration: underline; }

.feed-post-actions { display: flex; gap: .25rem; margin: 0 1rem; padding: .25rem 0; border-top: 1px solid var(--lc-border); border-bottom: 1px solid var(--lc-border); }
.feed-post-actions > * { flex: 1; }
.feed-action { display: flex; align-items: center; justify-content: center; gap: .5rem; width: 100%; height: 36px; margin: 0; border: 0; border-radius: var(--lc-radius-sm); background: transparent; color: var(--lc-text-muted); font-weight: 600; font-size: .925rem; cursor: pointer; }
.feed-action:hover { background: var(--lc-surface-2); }
.feed-action .bi { font-size: 1.1rem; }
.reaction-text-like { color: var(--lc-primary); }
.reaction-text-love { color: #e11d48; }
.reaction-text-celebrate { color: #d97706; }
.reaction-host { position: relative; display: flex; }
.reaction-host > form { flex: 1; }
.reaction-more { display: none; border: 0; background: transparent; color: var(--lc-text-muted); border-radius: var(--lc-radius-sm); padding: 0 .5rem; }
.reaction-picker { position: absolute; left: 0; bottom: calc(100% + 6px); z-index: 5; display: flex; gap: .25rem; padding: .3rem; border-radius: 999px; background: var(--lc-surface); box-shadow: var(--lc-shadow-lg); border: 1px solid var(--lc-border); opacity: 0; pointer-events: none; transform: translateY(4px); transition: opacity .15s ease .25s, transform .15s ease .25s; }
.reaction-host:hover .reaction-picker, .reaction-host:focus-within .reaction-picker { opacity: 1; pointer-events: auto; transform: none; transition-delay: .35s; }
.reaction-host:focus-within .reaction-picker { transition-delay: 0s; }
.reaction-choice { width: 40px; height: 40px; border: 0; border-radius: 50%; display: grid; place-items: center; color: #fff; font-size: 1.1rem; transition: transform .12s ease; }
.reaction-choice:hover, .reaction-choice:focus-visible { transform: scale(1.18); }
.reaction-choice.chosen { box-shadow: 0 0 0 3px var(--lc-surface), 0 0 0 5px currentColor; }
@media (hover: none) { .reaction-more { display: block; } }
@media (prefers-reduced-motion: reduce) { .reaction-picker, .reaction-choice { transition: none; } }

.feed-comments { list-style: none; margin: 0; padding: .625rem 1rem 0; }
.feed-comments li { display: flex; align-items: flex-start; gap: .5rem; padding: .2rem 0; }
.feed-comment-bubble { display: inline-block; max-width: 100%; background: var(--lc-surface-2); border-radius: 18px; padding: .45rem .8rem; overflow-wrap: anywhere; }
.feed-comment-meta { font-size: .75rem; color: var(--lc-text-muted); padding: .1rem .8rem 0; }
.feed-comment-delete { font-size: .75rem; color: var(--lc-text-muted); text-decoration: none; }
.feed-comment-delete:hover { text-decoration: underline; }
.avatar-sm { width: 32px; height: 32px; font-size: .7rem; }
.feed-comment-form { display: flex; align-items: flex-start; gap: .5rem; padding: .625rem 1rem .875rem; }
.feed-comment-input { position: relative; }
.feed-comment-input .form-control { border: 0; border-radius: 18px; background: var(--lc-surface-2); padding-right: 2.75rem; min-height: 36px; }
.feed-comment-send { position: absolute; right: .25rem; top: 50%; transform: translateY(-50%); border: 0; background: transparent; color: var(--lc-primary); width: 32px; height: 32px; border-radius: 50%; }
.feed-comment-send:hover { background: var(--lc-primary-soft); }
.icon-btn-round { border-radius: 50%; }

/* "What's on your mind?" composer */
.composer-card { padding: .75rem 1rem .5rem; margin-bottom: 1rem; }
.composer-top { display: flex; align-items: center; gap: .625rem; padding-bottom: .75rem; border-bottom: 1px solid var(--lc-border); }
.composer-pill { flex: 1; min-width: 0; height: 40px; padding: 0 1rem; border: 0; border-radius: 999px; background: var(--lc-surface-2); color: var(--lc-text-muted); font-size: 1rem; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.composer-pill:hover { background: var(--lc-border); }
.composer-actions { display: flex; gap: .25rem; padding-top: .375rem; }
.composer-action { flex: 1; display: flex; align-items: center; justify-content: center; gap: .5rem; height: 40px; border: 0; border-radius: var(--lc-radius-sm); background: transparent; color: var(--lc-text-muted); font-weight: 600; font-size: .925rem; }
.composer-action:hover { background: var(--lc-surface-2); }
.composer-action .bi { font-size: 1.3rem; }
@media (max-width: 420px) { .composer-action { font-size: .8rem; gap: .3rem; } .composer-action .bi { font-size: 1.1rem; } }
.composer-attach { display: flex; align-items: center; gap: .75rem; margin-top: .75rem; padding: .5rem .75rem; border: 1px solid var(--lc-border); border-radius: var(--lc-radius-sm); }
.composer-photo-btn { cursor: pointer; margin: 0; }
#composer-modal .modal-content { border-radius: var(--lc-radius); }
#composer-modal textarea { border: 0; font-size: 1.15rem; padding-left: 0; padding-right: 0; box-shadow: none; resize: vertical; min-height: 120px; }

/* Home right column */
.rail-section { padding: .25rem 0 .75rem; margin-bottom: .5rem; border-bottom: 1px solid var(--lc-border); }
.rail-section:last-child { border-bottom: 0; }
.rail-heading { display: flex; align-items: center; justify-content: space-between; padding: .5rem .5rem .375rem; }
.rail-heading h2 { margin: 0; font-size: 1.0625rem; font-weight: 600; color: var(--lc-text-muted); }
.rail-heading a { font-size: .875rem; text-decoration: none; }
.rail-heading a:hover { text-decoration: underline; }
.rail-item { display: flex; align-items: center; gap: .75rem; padding: .45rem .5rem; border-radius: var(--lc-radius-sm); color: var(--lc-text); text-decoration: none; }
.rail-item:hover { background: rgba(15, 23, 42, .05); color: var(--lc-text); }
[data-bs-theme="dark"] .rail-item:hover { background: rgba(255, 255, 255, .06); }
.rail-request { display: flex; gap: .75rem; padding: .5rem; }
.rail-btn-muted { background: var(--lc-surface-2); border-color: var(--lc-surface-2); color: var(--lc-text); }
.rail-contacts { list-style: none; margin: 0; padding: 0; }
.presence-avatar { position: relative; flex-shrink: 0; }
.presence-dot { display: none; position: absolute; right: -1px; bottom: -1px; width: 12px; height: 12px; border-radius: 50%; background: #22c55e; border: 2px solid var(--lc-bg); }
.rail-contact.online .presence-dot { display: block; }
.family-code { font-size: 1.25rem; letter-spacing: .08em; padding: .25rem .625rem; background: var(--lc-surface-2); border-radius: var(--lc-radius-sm); color: var(--lc-text); }

/* ---------- Messenger ---------- */
.messenger { display: grid; grid-template-columns: minmax(260px, 340px) 1fr; gap: 1rem; height: calc(100dvh - var(--lc-topbar-height) - 4rem); min-height: 420px; }
.messenger-sidebar, .messenger-main { display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.messenger-sidebar-header { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .875rem 1rem; border-bottom: 1px solid var(--lc-border); }
.messenger-list { overflow-y: auto; flex: 1; }
.messenger-empty-list { padding: 2rem 1rem; text-align: center; color: var(--lc-text-muted); }
.messenger-empty-list > i { font-size: 2rem; display: block; margin-bottom: .5rem; }
.messenger-placeholder { margin: auto; text-align: center; max-width: 360px; padding: 2rem 1rem; }
.messenger-placeholder > i { font-size: 2.5rem; color: var(--lc-primary); display: block; margin-bottom: .75rem; }
@media (max-width: 991.98px) {
  .messenger { grid-template-columns: 1fr; height: calc(100dvh - var(--lc-topbar-height) - var(--lc-bottombar-height) - 2.5rem); }
  .messenger-chat-view .messenger-sidebar { display: none; }
  .messenger-list-view .messenger-main { display: none; }
}

.conversation-item { display: flex; align-items: center; gap: .75rem; padding: .625rem 1rem; color: inherit; text-decoration: none; border-bottom: 1px solid var(--lc-border); white-space: normal; }
.conversation-item:hover { background: var(--lc-surface-2); color: inherit; }
.conversation-item.active { background: var(--lc-primary-soft); }
.conversation-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.conversation-top { display: flex; justify-content: space-between; gap: .5rem; }
.conversation-title { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conversation-time { font-size: .75rem; color: var(--lc-text-muted); white-space: nowrap; }
.conversation-preview { font-size: .85rem; color: var(--lc-text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conversation-item.unread .conversation-title, .conversation-item.unread .conversation-preview { font-weight: 700; color: var(--lc-text); }
.unread-pill { min-width: 1.4rem; height: 1.4rem; padding: 0 .4rem; border-radius: 999px; background: var(--lc-primary); color: #fff; font-size: .72rem; font-weight: 700; display: grid; place-items: center; }
[data-bs-theme="dark"] .unread-pill { color: #042f2e; }

.chat { display: flex; flex-direction: column; min-height: 0; flex: 1; background: var(--lc-surface); }
.chat-header { display: flex; align-items: center; gap: .75rem; padding: .625rem 1rem; border-bottom: 1px solid var(--lc-border); }
.chat-body { flex: 1; overflow-y: auto; overflow-x: hidden; padding: .75rem 1rem; display: flex; flex-direction: column; gap: 2px; overscroll-behavior: contain; }
.chat-status { margin: auto; color: var(--lc-text-muted); font-size: .9rem; text-align: center; }
.chat-older { align-self: center; }
.chat-day { align-self: center; font-size: .72rem; font-weight: 600; color: var(--lc-text-muted); text-transform: uppercase; letter-spacing: .04em; margin: .75rem 0 .25rem; }
.chat-msg { display: flex; flex-direction: column; max-width: 78%; }
.chat-msg.run-start { margin-top: .5rem; }
.chat-msg.mine { align-self: flex-end; align-items: flex-end; }
.chat-msg.theirs { align-self: flex-start; align-items: flex-start; }
.chat-sender { font-size: .72rem; color: var(--lc-text-muted); margin: 0 .75rem 2px; }
.chat-line { position: relative; display: flex; align-items: center; max-width: 100%; }
.chat-bubble { padding: .45rem .8rem; border-radius: 1.1rem; background: var(--lc-surface-2); min-width: 0; overflow-wrap: anywhere; }
.chat-msg.mine .chat-bubble { background: var(--lc-primary); color: #fff; }
[data-bs-theme="dark"] .chat-msg.mine .chat-bubble { color: #042f2e; }
.chat-text { white-space: pre-wrap; }
.chat-photo { display: block; max-width: min(260px, 100%); max-height: 260px; border-radius: .75rem; object-fit: cover; margin: .2rem 0; }
.chat-actions { position: absolute; bottom: calc(100% - 6px); z-index: 2; display: flex; padding: 2px; border: 1px solid var(--lc-border); border-radius: 999px; background: var(--lc-surface); box-shadow: var(--lc-shadow); opacity: 0; pointer-events: none; transition: opacity .12s ease; }
.chat-msg.mine .chat-actions { right: .25rem; }
.chat-msg.theirs .chat-actions { left: .25rem; }
.chat-line:hover .chat-actions, .chat-line:focus-within .chat-actions { opacity: 1; pointer-events: auto; }
.chat-msg.actions-open .chat-actions { opacity: 1; pointer-events: auto; }
.chat-action { border: 0; background: transparent; color: var(--lc-text-muted); width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: .85rem; }
.chat-action:hover, .chat-action:focus-visible { background: var(--lc-surface-2); color: var(--lc-text); }
.chat-reactions { display: flex; gap: .2rem; margin: -4px .5rem 0; position: relative; }
.chat-reaction { display: inline-flex; align-items: center; gap: .2rem; font-size: .72rem; padding: .05rem .4rem; border-radius: 999px; background: var(--lc-surface); border: 1px solid var(--lc-border); color: #e11d48; }
.chat-reaction.mine { border-color: var(--lc-primary); }
.chat-reaction span { color: var(--lc-text-muted); }
.chat-seen { align-self: flex-end; font-size: .72rem; color: var(--lc-text-muted); margin: 2px .25rem 0; }
.chat-typing { font-size: .8rem; color: var(--lc-text-muted); padding: 0 1rem .25rem; font-style: italic; }
.chat-composer { display: flex; align-items: flex-end; gap: .375rem; padding: .5rem .75rem .75rem; border-top: 1px solid var(--lc-border); }
.chat-input { resize: none; overflow-y: hidden; border-radius: 1.25rem; max-height: 140px; min-height: 40px; padding-top: .5rem; padding-bottom: .5rem; }
.chat-send { border-radius: 50%; width: 40px; height: 40px; padding: 0; flex-shrink: 0; display: grid; place-items: center; }
.chat-photo-btn { flex-shrink: 0; cursor: pointer; margin: 0; }
.chat-attachment { display: flex; align-items: center; gap: .5rem; margin: .5rem .75rem 0; padding: .25rem .625rem; font-size: .8rem; border-radius: var(--lc-radius-sm); background: var(--lc-surface-2); }
.chat-error { margin: .5rem .75rem 0; font-size: .8rem; color: #b91c1c; }
[data-bs-theme="dark"] .chat-error { color: #f87171; }

/* Contact picker (new message) */
.contact-list { max-height: 50vh; overflow-y: auto; }
.contact-option { display: flex; align-items: center; gap: .75rem; padding: .5rem .25rem; border-radius: var(--lc-radius-sm); cursor: pointer; }
.contact-option:hover { background: var(--lc-surface-2); }
.contact-option .form-check-input { margin: 0; }

/* Chat dock: pop-up chat windows in the bottom-right corner (desktop only) */
.chat-dock { position: fixed; right: 1rem; bottom: 0; z-index: 1040; display: flex; flex-direction: row-reverse; align-items: flex-end; gap: .75rem; pointer-events: none; }
.chat-window { pointer-events: auto; width: 328px; height: 440px; flex: none; border: 1px solid var(--lc-border); border-bottom: 0; border-radius: var(--lc-radius) var(--lc-radius) 0 0; box-shadow: var(--lc-shadow-lg); overflow: hidden; }
.chat-window.minimized { height: auto; }
.chat-window.minimized .chat-body, .chat-window.minimized .chat-typing, .chat-window.minimized .chat-window-composer { display: none; }
.chat-window-header { display: flex; align-items: center; gap: .125rem; padding: .25rem .25rem .25rem .5rem; background: var(--lc-primary); color: #fff; }
[data-bs-theme="dark"] .chat-window-header { color: #042f2e; }
.chat-window-header .icon-btn { color: inherit; }
.chat-window-header .icon-btn:hover { background: rgba(255, 255, 255, .18); color: inherit; }
.chat-window-title { flex: 1; min-width: 0; text-align: left; border: 0; background: transparent; color: inherit; font-weight: 600; padding: .375rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.icon-btn-sm { width: 32px; height: 32px; }
.chat-window .chat-body { padding: .5rem .75rem; }
.chat-window .chat-msg { max-width: 85%; }
@media (max-width: 991.98px) { .chat-dock { display: none; } }

/* Live toasts and the feed banner */
.live-toasts { z-index: 1090; }
.live-toast-body { display: block; color: inherit; text-decoration: none; }
.live-toast-body .bi { color: var(--lc-primary); }
.feed-live-banner { display: block; width: 100%; margin-bottom: 1rem; padding: .5rem 1rem; border: 1px solid var(--lc-primary); border-radius: 999px; background: var(--lc-primary-soft); color: var(--lc-primary-soft-text); font-weight: 600; position: sticky; top: calc(var(--lc-topbar-height) + .5rem); z-index: 5; }
.feed-live-banner[hidden] { display: none; }

/* ---------- Family map ---------- */
.location-layout { display: grid; grid-template-columns: 1fr minmax(280px, 360px); gap: 1rem; align-items: start; }
@media (max-width: 991.98px) { .location-layout { grid-template-columns: 1fr; } }
.location-map-card { overflow: hidden; }
.family-map { height: min(70dvh, 620px); min-height: 320px; }
.location-map-missing { min-height: 260px; display: grid; place-content: center; text-align: center; padding: 2rem 1rem; color: var(--lc-text-muted); }
.location-map-missing > i { font-size: 2.25rem; color: var(--lc-primary); margin-bottom: .5rem; }
.location-list { list-style: none; margin: 0; padding: 0; }
.location-list > li { display: flex; align-items: center; gap: .75rem; padding: .75rem 1rem; border-top: 1px solid var(--lc-border); cursor: pointer; }
.location-list > li:first-child { border-top: 0; }
.location-list > li:hover { background: var(--lc-surface-2); }
.sharing-dot { width: .7rem; height: .7rem; border-radius: 50%; background: var(--lc-border); flex-shrink: 0; }
.sharing-dot.on { background: #16a34a; box-shadow: 0 0 0 4px rgba(22, 163, 74, .2); }
.map-pin { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--lc-primary); color: #fff; font-weight: 700; font-size: .8rem; border: 3px solid #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .35); }
.map-pin.me { background: #2563eb; }

/* ---------- SOS ---------- */
.sos-btn { display: inline-grid; place-items: center; height: 32px; padding: 0 .65rem; border-radius: 999px; background: #dc2626; color: #fff; font-weight: 800; font-size: .78rem; letter-spacing: .06em; text-decoration: none; margin-right: .25rem; }
.sos-btn:hover, .sos-btn:focus-visible { background: #b91c1c; color: #fff; }
.sos-banner { background: #dc2626; color: #fff; }
.sos-banner-item { display: flex; align-items: center; gap: .75rem; padding: .625rem 1rem; color: #fff; text-decoration: none; border-top: 1px solid rgba(255, 255, 255, .25); }
.sos-banner-item:first-child { border-top: 0; }
.sos-banner-item:hover { background: #b91c1c; color: #fff; }
.sos-page { max-width: 640px; margin: 0 auto; }
.sos-call-911 { display: flex; align-items: center; justify-content: center; gap: .5rem; padding: .875rem; margin-bottom: .5rem; border-radius: var(--lc-radius); border: 2px solid #dc2626; color: #dc2626; font-weight: 700; font-size: 1.15rem; text-decoration: none; }
.sos-call-911:hover { background: rgba(220, 38, 38, .08); color: #b91c1c; }
[data-bs-theme="dark"] .sos-call-911 { color: #f87171; border-color: #f87171; }
.sos-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
.sos-kind { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .25rem; min-height: 132px; padding: 1rem .75rem; border: 0; border-radius: var(--lc-radius); background: #dc2626; color: #fff; text-align: center; box-shadow: var(--lc-shadow); transition: transform .1s ease, background .1s ease; }
.sos-kind:hover, .sos-kind:focus-visible { background: #b91c1c; }
.sos-kind:active { transform: scale(.97); }
.sos-kind .bi { font-size: 2rem; }
.sos-kind-label { font-weight: 700; font-size: 1.05rem; }
.sos-kind-hint { font-size: .8rem; opacity: .85; }
.sos-countdown, .sos-alarm { position: fixed; inset: 0; z-index: 2000; display: grid; place-items: center; padding: 1rem; background: rgba(127, 29, 29, .97); color: #fff; }
.sos-countdown[hidden] { display: none; }
.sos-countdown-box, .sos-alarm-box { text-align: center; max-width: 420px; width: 100%; }
.sos-countdown-number { font-size: 5rem; font-weight: 800; line-height: 1; margin-bottom: .5rem; }
.sos-alarm { background: rgba(185, 28, 28, .96); animation: sos-pulse 1.2s ease-in-out infinite alternate; }
.sos-alarm-box > .bi { font-size: 3.5rem; display: block; margin-bottom: .5rem; }
.sos-alarm-message { background: rgba(0, 0, 0, .2); border-radius: var(--lc-radius-sm); padding: .625rem .875rem; white-space: pre-wrap; }
@keyframes sos-pulse { from { background: rgba(185, 28, 28, .96); } to { background: rgba(127, 29, 29, .96); } }
@media (prefers-reduced-motion: reduce) { .sos-alarm { animation: none; } }
.sos-alert-card { border-radius: var(--lc-radius); padding: 1.25rem; margin-bottom: 1rem; color: #fff; background: #dc2626; }
.sos-alert-card.resolved { background: var(--lc-surface-2); color: var(--lc-text); }
.sos-alert-icon { font-size: 2.25rem; }
.sos-message { margin: 1rem 0 0; padding: .75rem 1rem; border-radius: var(--lc-radius-sm); background: rgba(0, 0, 0, .15); white-space: pre-wrap; }

/* ---------- PII protection ---------- */
.verified-strip { display: flex; align-items: center; gap: .5rem; padding: .4rem 1rem; font-size: .85rem; background: #fef3c7; color: #78350f; border-bottom: 1px solid #fde68a; }
[data-bs-theme="dark"] .verified-strip { background: rgba(245, 158, 11, .15); color: #fcd34d; border-color: rgba(245, 158, 11, .3); }
.verify-icon { display: inline-grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: var(--lc-primary-soft); color: var(--lc-primary); font-size: 1.6rem; }
.pii-card { border-left: 4px solid var(--lc-primary); }

/* ---------- @ tags in the feed ---------- */
.mention { font-weight: 600; color: var(--lc-primary); background: var(--lc-primary-soft); border-radius: 4px; padding: 0 .2rem; text-decoration: none; }
a.mention:hover { text-decoration: underline; color: var(--lc-primary-hover); }
.mention-host { position: relative; }
.mention-menu { position: absolute; left: 0; top: calc(100% + 4px); z-index: 1060; width: min(320px, 100%); min-width: 240px; max-height: 280px; overflow-y: auto; background: var(--lc-surface); border: 1px solid var(--lc-border); border-radius: var(--lc-radius-sm); box-shadow: var(--lc-shadow-lg); padding: .25rem; }
.mention-option { display: flex; align-items: center; gap: .625rem; width: 100%; padding: .4rem .5rem; border: 0; border-radius: var(--lc-radius-sm); background: transparent; color: inherit; text-align: left; }
.mention-option:hover, .mention-option.active { background: var(--lc-primary-soft); }
.avatar-app { background: linear-gradient(135deg, #14b8a6, #0f766e); color: #fff; font-size: 1.1rem; }
@media (max-width: 575.98px) { .feed-post-header .lc-badge { font-size: 0; gap: 0; padding: .3rem .4rem; } .feed-post-header .lc-badge .bi { font-size: .85rem; } }
/* ---------- Public site ---------- */
html { scroll-padding-top: 72px; }
.public-header { position: sticky; top: 0; z-index: 1030; padding: .5rem 0; background: color-mix(in srgb, var(--lc-surface) 92%, transparent); backdrop-filter: saturate(180%) blur(8px); border-bottom: 1px solid var(--lc-border); }
.public-header .topbar-brand span:last-child, .public-footer .topbar-brand span:last-child { display: inline; }
.public-nav { gap: .25rem; margin-left: 1.5rem; }
.public-nav a { padding: .4rem .75rem; border-radius: var(--lc-radius-sm); color: var(--lc-text-muted); font-weight: 500; text-decoration: none; }
.public-nav a:hover { background: var(--lc-surface-2); color: var(--lc-text); }
.public-footer { padding: 2rem 0; border-top: 1px solid var(--lc-border); }
.public-footer-links { display: flex; flex-wrap: wrap; gap: .25rem 1rem; }
.public-footer-links a { color: var(--lc-text-muted); text-decoration: none; font-size: .9rem; }
.public-footer-links a:hover { color: var(--lc-primary); }

.landing-hero { padding: 3.5rem 0 3rem; background: radial-gradient(1200px 400px at 80% 0%, var(--lc-primary-soft), transparent 70%); }
.landing-checks { list-style: none; display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; margin: 1.5rem 0 0; padding: 0; color: var(--lc-text-muted); font-weight: 500; }
.landing-checks .bi { color: var(--lc-primary); margin-right: .375rem; }
.landing-checks-stack { flex-direction: column; margin: 0; font-size: 1.05rem; }

.landing-section { padding: 4rem 0; }
.landing-band { background: var(--lc-surface); border-top: 1px solid var(--lc-border); border-bottom: 1px solid var(--lc-border); }
.landing-heading { max-width: 44rem; margin: 0 auto 2rem; text-align: center; }
.landing-heading p { color: var(--lc-text-muted); font-size: 1.05rem; margin: .5rem 0 0; }
.landing-eyebrow { display: inline-block; margin-bottom: .5rem; color: var(--lc-primary); font-weight: 700; font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; }
.landing-section h2 { font-size: clamp(1.6rem, 3.2vw, 2.25rem); font-weight: 800; letter-spacing: -.02em; line-height: 1.15; }
.landing-narrow { max-width: 760px; }
.landing-list { list-style: none; padding: 0; margin: 1.25rem 0; display: grid; gap: 1rem; }
.landing-list li { display: flex; gap: .875rem; }
.landing-list .bi { font-size: 1.4rem; line-height: 1.3; }
.feature-tile .nav-icon { width: 44px; height: 44px; font-size: 1.25rem; }
.feature-tile h3 { margin-top: .875rem; }

.landing-cta { padding: 3rem 1.5rem; border-radius: calc(var(--lc-radius) * 1.5); text-align: center; color: #fff; background: linear-gradient(135deg, #14b8a6, #0f766e); }
.landing-cta h2 { color: #fff; }
.landing-cta p { max-width: 36rem; margin: .75rem auto 1.5rem; opacity: .9; font-size: 1.05rem; }

/* Hero illustration: a few cards from the app, arranged like a collage. */
.landing-mock { position: relative; min-height: 430px; }
.mock-card { position: absolute; background: var(--lc-surface); border: 1px solid var(--lc-border); border-radius: var(--lc-radius); box-shadow: var(--lc-shadow-lg); padding: .875rem 1rem; }
.mock-row { display: flex; align-items: center; gap: .625rem; }
.mock-name { font-weight: 600; font-size: .9rem; }
.mock-meta { font-size: .75rem; color: var(--lc-text-muted); }
.mock-text { margin: .625rem 0; font-size: .95rem; }
.mock-reactions { display: flex; align-items: center; gap: .25rem; font-size: .8rem; color: var(--lc-text-muted); border-top: 1px solid var(--lc-border); padding-top: .5rem; }
.mock-reactions > span:nth-child(3) { margin-left: .5rem; }
.mock-post { top: 0; left: 0; width: min(380px, 88%); }
.mock-chat { top: 165px; right: 0; width: 240px; padding: 0; overflow: hidden; }
.mock-chat-head { padding: .5rem .75rem; background: var(--lc-primary); color: #fff; font-weight: 600; font-size: .85rem; }
[data-bs-theme="dark"] .mock-chat-head { color: #042f2e; }
.mock-bubble { margin: .5rem .75rem 0; padding: .4rem .7rem; border-radius: 1rem; font-size: .85rem; max-width: 85%; width: fit-content; }
.mock-bubble.theirs { background: var(--lc-surface-2); }
.mock-bubble.mine { margin-left: auto; background: var(--lc-primary); color: #fff; }
[data-bs-theme="dark"] .mock-bubble.mine { color: #042f2e; }
.mock-seen { text-align: right; font-size: .7rem; color: var(--lc-text-muted); padding: .2rem .75rem .6rem; }
.mock-map { top: 255px; left: 6%; width: 230px; height: 150px; padding: 0; overflow: hidden; background:
  linear-gradient(90deg, transparent 47%, color-mix(in srgb, var(--lc-border) 90%, transparent) 47% 53%, transparent 53%) 0 0 / 70px 70px,
  linear-gradient(0deg, transparent 47%, color-mix(in srgb, var(--lc-border) 90%, transparent) 47% 53%, transparent 53%) 0 0 / 70px 70px,
  var(--lc-surface-2); }
.mock-map-pin { position: absolute; top: 34px; left: 92px; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: #2563eb; color: #fff; font-weight: 700; font-size: .8rem; border: 3px solid #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .35); }
.mock-map-label { position: absolute; left: 0; right: 0; bottom: 0; padding: .4rem .6rem; background: var(--lc-surface); font-size: .78rem; font-weight: 500; }
.mock-map-label .bi { color: #e11d48; }
.mock-reminder { bottom: 0; right: 4%; display: flex; align-items: center; gap: .625rem; }
@media (max-width: 575.98px) {
  .landing-mock { min-height: 0; display: grid; gap: .75rem; }
  .mock-card { position: static; width: 100%; }
  .mock-map { height: 140px; position: relative; }
}

.landing-sos { max-width: 420px; margin: 0 auto; padding: 1.25rem; border-radius: calc(var(--lc-radius) * 1.5); background: var(--lc-bg); border: 1px solid var(--lc-border); }
.landing-sos-call { display: flex; align-items: center; justify-content: center; gap: .5rem; padding: .75rem; margin-bottom: .875rem; border: 2px solid #dc2626; border-radius: var(--lc-radius); color: #dc2626; font-weight: 700; }
[data-bs-theme="dark"] .landing-sos-call { color: #f87171; border-color: #f87171; }
.landing-sos .sos-kind { min-height: 104px; cursor: default; }
.public-footer-credit { margin: 1rem 0 0; padding-top: 1rem; border-top: 1px solid var(--lc-border); font-size: .85rem; color: var(--lc-text-muted); }

/* ---------- Privacy Policy and Terms ---------- */
.legal-page { max-width: 760px; margin: 0 auto; padding: 2.5rem 1rem 3rem; line-height: 1.65; }
.app-content .legal-page { padding-top: 0; }
.legal-header { margin-bottom: 1.5rem; }
.legal-header h1 { font-size: clamp(1.8rem, 4vw, 2.4rem); font-weight: 800; letter-spacing: -.02em; }
.legal-page section { margin-top: 2rem; scroll-margin-top: 80px; }
.legal-page h2 { font-size: 1.2rem; font-weight: 700; }
.legal-page ul { padding-left: 1.25rem; }
.legal-page li { margin-bottom: .375rem; }
.legal-summary { padding: 1rem 1.25rem; border-radius: var(--lc-radius); background: var(--lc-primary-soft); color: var(--lc-text); }
.legal-summary ul { margin: 0; }
.legal-summary-warning { background: rgba(220, 38, 38, .08); border: 1px solid rgba(220, 38, 38, .3); }
.legal-toc { margin-top: 1.5rem; padding: 1rem 1.25rem; border: 1px solid var(--lc-border); border-radius: var(--lc-radius); background: var(--lc-surface); }
.legal-toc ol { margin: 0; padding-left: 1.25rem; columns: 2; column-gap: 2rem; }
@media (max-width: 575.98px) { .legal-toc ol { columns: 1; } }
.auth-legal { margin: 1.5rem 0 0; text-align: center; font-size: .8rem; }
.auth-legal a, .left-nav-footer a { color: var(--lc-text-muted); }

/* ---------- Feeds tabs, people, profiles ---------- */
.feed-tabs { display: flex; gap: .25rem; margin-bottom: 1rem; padding: .25rem; border-radius: 999px; background: var(--lc-surface); box-shadow: 0 1px 2px rgba(15, 23, 42, .08); }
.feed-tab { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: .375rem; padding: .45rem .75rem; border-radius: 999px; color: var(--lc-text-muted); font-weight: 600; text-decoration: none; }
.feed-tab:hover { background: var(--lc-surface-2); color: var(--lc-text); }
.feed-tab.active { background: var(--lc-primary-soft); color: var(--lc-primary-soft-text); }
.feed-author-link { color: inherit; text-decoration: none; }
.feed-author-link:hover { text-decoration: underline; }
.people-search { position: relative; }
.people-search i { position: absolute; left: .875rem; top: 50%; transform: translateY(-50%); color: var(--lc-text-muted); }
.people-search .form-control { padding-left: 2.4rem; border-radius: 999px; }
.people-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .75rem; }
.people-card { display: flex; flex-direction: column; align-items: center; gap: .5rem; padding: 1rem .75rem; text-align: center; color: inherit; text-decoration: none; min-width: 0; }
.people-card:hover { color: inherit; box-shadow: 0 4px 14px rgba(15, 23, 42, .1); }
.profile-header { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; padding: 1.25rem; }
.profile-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.profile-actions form { margin: 0; }

/* ---------- profile photo: selfie camera and photo map pins ---------- */
.selfie-frame { position: relative; aspect-ratio: 1; overflow: hidden; border-radius: var(--lc-radius, .75rem); background: #000; }
.selfie-frame video, .selfie-frame canvas { display: block; width: 100%; height: 100%; object-fit: cover; }
.selfie-frame video { transform: scaleX(-1); }
.selfie-frame::after { content: ""; position: absolute; inset: 8%; border: 2px dashed rgba(255, 255, 255, .55); border-radius: 50%; pointer-events: none; }
.map-pin.has-photo { overflow: hidden; }
.map-pin img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
