/* Logged-in home (index) */

.member-app {
  display: none !important;
  visibility: hidden;
  min-height: 100vh;
  padding-top: var(--nav-h);
  padding-bottom: calc(var(--mbn-h) + var(--safe-bottom) + 16px);
}

body.member-mode .member-app {
  display: block !important;
  visibility: visible;
}

body.guest-mode #guestApp {
  display: block;
}

body.member-mode #guestApp {
  display: none !important;
  visibility: hidden !important;
  height: 0 !important;
  overflow: hidden !important;
  pointer-events: none !important;
}

.member-home {
  max-width: 720px;
  margin: 0 auto;
  padding: 16px max(16px, env(safe-area-inset-left)) 24px max(16px, env(safe-area-inset-right));
}

/* Guest landing CSS must never affect logged-in sections */
.member-home section {
  padding: 0;
}

.member-home .app-section {
  margin-bottom: 14px;
}

.home-header {
  margin-bottom: 12px;
}

.home-profile-mount {
  margin-bottom: 12px;
}

.home-profile-mount:not(:empty) {
  display: block;
}

.home-quick {
  margin-bottom: 12px;
}

.home-quick-head {
  margin-bottom: 8px;
}

.home-quick-head .home-section-title {
  margin-bottom: 0;
  font-family: 'DM Sans', sans-serif;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--gold2);
}

.home-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 0;
  position: static;
  top: auto;
  left: auto;
  right: auto;
  height: auto;
  padding: 0;
  z-index: auto;
  background: none;
  border: none;
  backdrop-filter: none;
}

.home-action-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 6px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 2px;
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.22s ease, transform 0.22s ease, box-shadow 0.22s ease, background 0.22s ease;
  min-height: 72px;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

.home-action-card.primary {
  grid-column: 1 / -1;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  border-color: var(--gold2);
  background: linear-gradient(135deg, rgba(200, 169, 110, 0.1) 0%, var(--surface) 55%);
}

.home-action-desc {
  display: none;
}

.home-action-card.primary .home-action-desc {
  display: block;
  font-size: 11px;
}

.home-action-title {
  font-family: 'DM Sans', sans-serif;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
}

.home-action-card.primary .home-action-title {
  font-size: 11px;
}

.home-daily-section-head {
  margin: 20px 0 10px;
}

.home-daily-section-head .home-section-title {
  margin-bottom: 4px;
}

.home-daily-section-sub {
  font-size: 12px;
  color: var(--muted2, #888);
  line-height: 1.5;
  margin: 0;
}

.home-daily-hub {
  margin-bottom: 16px;
}

.xp-card {
  padding: 14px 16px 12px;
}

.daily-fact-card {
  padding: 14px 16px 16px;
}

.home-daily-cards {
  margin-bottom: 0;
}

.home-daily-cards:not([hidden]) {
  margin-bottom: 8px;
}

.home-daily-cards-stack {
  gap: 8px;
}

.daily-card {
  padding: 14px 16px;
}

.home-header .home-date,
.home-header .friends-page-sub {
  margin-bottom: 0;
}
.home-header .friends-page-title {
  margin-bottom: 6px;
}

.friends-page {
  padding-top: 12px;
  padding-bottom: calc(var(--mbn-h) + var(--safe-bottom) + 48px);
}

.friends-page .app-section {
  margin-bottom: 20px;
}

.friends-page .home-section-title {
  font-family: 'DM Sans', sans-serif;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--gold2);
}

.friends-page .home-section-head {
  margin-bottom: 10px;
}

.friends-page-title {
  margin-bottom: 4px;
}

.friends-page-sub {
  margin-bottom: 28px;
}

.home-greeting {
  font-family: 'Playfair Display', serif;
  font-size: clamp(24px, 5vw, 34px);
  font-weight: 700;
  color: var(--white);
  margin-bottom: 4px;
  line-height: 1.15;
}

.home-greeting em {
  font-style: italic;
  color: var(--gold);
}

.home-date {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.06em;
  margin-bottom: 0;
}

/* Today hub — XP + daily insight (home only) */
.home-daily-hub {
  margin-bottom: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1px solid var(--border);
  background: var(--surface);
  overflow: hidden;
  border-radius: 2px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12);
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

body.light-mode .home-daily-hub {
  box-shadow: 0 4px 20px rgba(26, 23, 20, 0.06);
}

#homeXpMount:empty {
  display: none;
}

.xp-card {
  padding: 18px 20px 16px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(200, 169, 110, 0.05) 0%, transparent 100%);
}

.xp-card-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}

.xp-level-ring {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--gold2);
  background: rgba(200, 169, 110, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.xp-level-num {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 22px;
  letter-spacing: 0.06em;
  color: var(--gold);
  line-height: 1;
}

.xp-card-copy {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.xp-card-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--white);
  letter-spacing: 0.04em;
}

.xp-card-sub {
  font-size: 11px;
  color: var(--muted2);
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.xp-total-badge {
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold2);
  flex-shrink: 0;
  padding: 6px 10px;
  border: 1px solid var(--border2);
  background: var(--bg);
}

.xp-bar-track {
  height: 5px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
}

.xp-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--gold2) 0%, var(--gold) 55%, var(--gold3) 100%);
  transition: width 0.45s ease;
  box-shadow: 0 0 12px rgba(200, 169, 110, 0.35);
}

.daily-fact-card {
  padding: 18px 20px 20px;
  margin-bottom: 0;
  border: none;
  border-left: none;
  background: transparent;
}

.daily-fact-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.daily-fact-label {
  font-size: 10px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--gold2);
  margin-bottom: 0;
}

.daily-fact-xp-badge {
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
  padding: 4px 8px;
  border: 1px solid var(--gold2);
  background: rgba(200, 169, 110, 0.08);
  flex-shrink: 0;
}

.daily-fact-xp-badge.is-claimed {
  color: var(--muted);
  border-color: var(--border2);
  background: transparent;
}

.daily-fact-text {
  font-size: 14px;
  color: var(--muted2);
  line-height: 1.75;
}

.daily-fact-text.animus-skeleton {
  min-height: 3.2em;
  color: transparent;
}

.daily-fact-card.is-ready .daily-fact-text {
  color: var(--text, #e2e2e2);
}

body.light-mode .daily-fact-card.is-ready .daily-fact-text {
  color: var(--text, #1a1714);
}

.daily-card--weekly {
  border-left: 3px solid var(--gold2, #8a6f3e);
}

.daily-card--mood .mood-btn.is-active {
  border-color: var(--gold, #c8a96e);
  background: rgba(200, 169, 110, 0.12);
}

.home-daily-cards {
  margin-bottom: 36px;
}

.home-daily-cards[hidden] {
  display: none;
}

.home-daily-cards-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.daily-card {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 16px 18px;
}

.daily-card--hero {
  border-color: var(--gold2);
  background: linear-gradient(180deg, rgba(200, 169, 110, 0.07) 0%, var(--surface) 100%);
}

.daily-card--echo {
  border-left: 3px solid var(--border2);
}

.daily-card-label {
  font-size: 10px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
}

.daily-card-lead {
  font-size: 15px;
  color: var(--white);
  margin: 0 0 8px;
  line-height: 1.45;
}

.daily-card-lead strong {
  color: var(--gold);
  font-weight: 500;
}

.daily-card-text {
  font-size: 13px;
  color: var(--muted2);
  line-height: 1.65;
  margin: 0 0 8px;
}

.daily-card-text:last-child {
  margin-bottom: 0;
}

.daily-card-text-muted {
  color: var(--muted);
  font-size: 12px;
}

.daily-card-tag {
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold2);
}

.daily-echo-line {
  padding-left: 10px;
  border-left: 2px solid var(--border2);
}

.daily-streak-inline {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 8px;
}

.daily-row-label {
  display: block;
  font-size: 10px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
}

.daily-row-text,
.daily-prompt-text,
.daily-row-hint {
  font-size: 13px;
  color: var(--muted2);
  line-height: 1.65;
  margin: 0;
}

.daily-row-hint {
  font-size: 11px;
  margin-top: 8px;
  color: var(--muted);
}

.daily-streak-count {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 32px;
  letter-spacing: 0.06em;
  color: var(--gold);
  line-height: 1;
}

.daily-streak-unit {
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted2);
}

.mood-week-strip {
  display: flex;
  gap: 6px;
  margin-top: 14px;
  justify-content: space-between;
}

.mood-strip-day {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

.mood-strip-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--border2);
  border: 1px solid var(--border);
}

.mood-strip-day.has-energized .mood-strip-dot {
  background: var(--gold);
  border-color: var(--gold2);
}

.mood-strip-day.has-neutral .mood-strip-dot {
  background: var(--muted2);
}

.mood-strip-day.has-drained .mood-strip-dot {
  background: #5a6a7a;
  border-color: var(--border2);
}

.mood-strip-lbl {
  font-size: 9px;
  color: var(--muted);
  letter-spacing: 0.02em;
}

.daily-row-cta-secondary {
  margin-left: 8px;
  border-color: var(--border2);
  color: var(--muted2);
}

.mood-btn-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.mood-btn {
  flex: 1 1 30%;
  min-width: 0;
  min-height: 44px;
  padding: 10px 8px;
  background: var(--bg);
  border: 1px solid var(--border2);
  color: var(--muted2);
  font-family: inherit;
  font-size: 11px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}

.mood-btn:hover {
  border-color: var(--gold2);
  color: var(--text);
}

.mood-btn.is-active {
  border-color: var(--gold);
  color: var(--gold);
  background: rgba(200, 169, 110, 0.1);
}

.mood-btn-icon {
  font-size: 14px;
  line-height: 1;
}

.mood-btn-label {
  letter-spacing: 0.06em;
}

.daily-reflection-input {
  width: 100%;
  margin-top: 10px;
  padding: 12px 14px;
  background: var(--bg);
  border: 1px solid var(--border2);
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  line-height: 1.5;
  resize: vertical;
  min-height: 72px;
  outline: none;
}

.daily-reflection-input:focus {
  border-color: var(--gold2);
}

.daily-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.daily-card-actions .daily-row-cta {
  margin-top: 0;
}

.daily-reflection-save,
.daily-row-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 12px;
  padding: 10px 18px;
  min-height: 44px;
  background: transparent;
  border: 1px solid var(--gold2);
  color: var(--gold);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.2s, color 0.2s;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.daily-reflection-save:hover,
.daily-row-cta:hover {
  background: rgba(200, 169, 110, 0.12);
  color: var(--gold3);
}

.daily-compare-empty .daily-row-cta {
  border-color: var(--border2);
  color: var(--muted2);
}

.home-action-card:hover {
  border-color: var(--gold2);
}

.home-action-card:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.home-action-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  flex: 1;
}

.home-action-arrow {
  flex-shrink: 0;
  font-size: 16px;
  line-height: 1;
  color: var(--gold);
  opacity: 0.85;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.home-action-card:hover .home-action-arrow {
  transform: translateX(3px);
  opacity: 1;
}

.home-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  min-width: 0;
  max-width: 100%;
}

.home-section-head .home-section-title {
  flex: 1 1 auto;
  min-width: 0;
}

.home-section-head .home-section-link {
  flex-shrink: 0;
  white-space: nowrap;
}

.home-section-title {
  font-size: 10px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--muted);
}

.home-section-link {
  font-size: 11px;
  color: var(--gold2);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
}

.home-section-link:hover {
  color: var(--gold);
}

.friends-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(140px, 100%), 1fr));
  gap: 10px;
  margin-bottom: 0;
  min-width: 0;
}

.friend-card {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 20px 16px;
  text-align: center;
  text-decoration: none;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: inherit;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  border-radius: 2px;
}

.friend-card:hover {
  border-color: var(--gold2);
  transform: translateY(-2px);
}

.friend-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border2);
  background: var(--surface2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 18px;
  color: var(--gold);
}

.friend-name {
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
}

.friend-username {
  font-size: 10px;
  color: var(--muted);
}

.friend-type {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 20px;
  letter-spacing: 0.08em;
  color: var(--gold);
  line-height: 1;
}

.friend-enn {
  font-size: 10px;
  color: var(--muted2);
}

.friend-card-add {
  background: none;
  border: 1px dashed var(--border2);
  color: var(--muted);
  cursor: pointer;
  min-height: 140px;
  font-family: 'DM Sans', sans-serif;
}

.friend-card-add:hover {
  border-color: var(--gold2);
  color: var(--gold);
}

.add-icon {
  font-size: 24px;
  line-height: 1;
}

.add-label {
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.empty-state {
  grid-column: 1 / -1;
  padding: 28px;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
}

.empty-state--personality {
  text-align: left;
  padding: 22px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 2px;
}

.empty-state-text {
  font-size: 13px;
  line-height: 1.65;
  color: var(--muted2);
  margin: 0 0 14px;
}

.empty-state-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 18px;
  border: 1px solid var(--gold2);
  color: var(--gold);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  background: transparent;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.2s ease, color 0.2s ease;
}

.empty-state-cta:hover {
  background: rgba(200, 169, 110, 0.1);
  color: var(--gold3);
}

.home-profile-mount:empty {
  display: none;
  margin: 0;
}

.home-profile-snapshot {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 2px;
  text-decoration: none;
  color: inherit;
  position: relative;
  overflow: hidden;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  transition: border-color 0.22s ease, transform 0.22s ease, box-shadow 0.22s ease;
}

.home-profile-snapshot:hover {
  border-color: var(--gold2);
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.12);
}

.home-profile-snapshot-accent {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.home-profile-snapshot-body {
  flex: 1;
  min-width: 0;
  position: relative;
  z-index: 1;
}

.home-profile-snapshot-label {
  display: block;
  font-size: 10px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}

.home-profile-snapshot-type {
  display: block;
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(28px, 6vw, 34px);
  letter-spacing: 0.08em;
  line-height: 1;
  margin-bottom: 8px;
}

.home-profile-snapshot-tagline {
  font-size: 13px;
  line-height: 1.55;
  color: var(--muted2);
  margin: 0;
  overflow-wrap: anywhere;
}

.home-profile-snapshot-tagline--muted {
  color: var(--muted);
  font-style: italic;
}

.home-profile-snapshot-arrow {
  flex-shrink: 0;
  font-size: 18px;
  color: var(--gold);
  opacity: 0.85;
  position: relative;
  z-index: 1;
}

/* Mood heatmap + streak ring */
.mood-heatmap {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  margin-top: 14px;
  min-height: 56px;
}

.mood-heat-cell {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.mood-heat-bar {
  width: 100%;
  max-width: 28px;
  min-height: 8px;
  border-radius: 3px 3px 1px 1px;
  background: var(--border2);
  transition: height 0.35s ease, background 0.25s ease;
}

.mood-heat-cell.has-energized .mood-heat-bar {
  background: linear-gradient(180deg, var(--gold3) 0%, var(--gold) 100%);
}

.mood-heat-cell.has-neutral .mood-heat-bar {
  background: linear-gradient(180deg, var(--muted2) 0%, var(--muted) 100%);
  opacity: 0.85;
}

.mood-heat-cell.has-drained .mood-heat-bar {
  background: linear-gradient(180deg, #6a7a8a 0%, #4a5560 100%);
}

.mood-heat-cell.is-today .mood-heat-lbl {
  color: var(--gold);
}

.streak-viz {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 4px;
}

.streak-ring {
  width: 52px;
  height: 52px;
  flex-shrink: 0;
  position: relative;
}

.streak-ring svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.streak-ring-bg {
  fill: none;
  stroke: var(--border2);
  stroke-width: 3;
}

.streak-ring-fill {
  fill: none;
  stroke: var(--gold);
  stroke-width: 3;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.5s ease;
}

.streak-ring-num {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 20px;
  color: var(--gold);
  letter-spacing: 0.04em;
}

.streak-viz-copy {
  min-width: 0;
}

.streak-viz-copy .daily-streak-unit {
  display: block;
  margin-top: 2px;
}

/* Pull to refresh */
.pull-refresh-host,
#main-content.pull-refresh-root {
  position: relative;
}

.pull-refresh-indicator {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%) translateY(calc(-100% + var(--pull-offset, 0px)));
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted2);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 5;
}

.pull-refresh-indicator.is-visible {
  opacity: 1;
}

.pull-refresh-indicator.is-ready {
  color: var(--gold);
}

.pull-refresh-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid var(--border2);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: animus-spin 0.65s linear infinite;
  opacity: 0;
}

.pull-refresh-indicator.is-loading .pull-refresh-spinner {
  opacity: 1;
}

.is-pulling {
  transition: transform 0.15s ease;
}

@keyframes animus-spin {
  to {
    transform: rotate(360deg);
  }
}

.feed-items .feed-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  min-width: 0;
  max-width: 100%;
}

.feed-content {
  flex: 1;
  min-width: 0;
  max-width: 100%;
}

.feed-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.feed-action {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold2);
  text-decoration: none;
  min-height: 36px;
  padding: 4px 0;
}

.feed-action:hover {
  color: var(--gold);
}

.feed-text {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.feed-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border2);
  background: var(--surface2);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--gold);
}

.feed-items .feed-text {
  font-size: 13px;
  color: var(--text);
  line-height: 1.5;
}

.feed-time {
  font-size: 11px;
  color: var(--muted);
  margin-top: 4px;
}

.onboarding-banner {
  background: var(--surface);
  border: 1px solid var(--border2);
  border-left: 3px solid var(--gold);
  padding: 16px 20px;
  margin-bottom: 0;
  display: none;
  border-radius: 2px;
}

.onboarding-banner.show {
  display: block;
}

.onboarding-banner p {
  font-size: 13px;
  color: var(--muted2);
  line-height: 1.6;
  margin-bottom: 12px;
}

.onboarding-banner a {
  display: inline-block;
  padding: 10px 20px;
  background: var(--gold);
  color: #000;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
}

.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  z-index: 500;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay.open {
  display: flex;
}

.modal-box {
  background: var(--surface);
  border: 1px solid var(--border2);
  padding: 28px;
  max-width: 440px;
  width: 100%;
  position: relative;
}

.modal-title {
  font-family: 'Playfair Display', serif;
  font-size: 22px;
  color: var(--white);
  margin-bottom: 8px;
}

.modal-sub {
  font-size: 13px;
  color: var(--muted2);
  margin-bottom: 16px;
  line-height: 1.6;
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: none;
  border: none;
  color: var(--muted2);
  font-size: 18px;
  cursor: pointer;
}

.modal-search-wrap {
  position: relative;
  margin-bottom: 12px;
}

.modal-search-wrap input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border2);
  color: var(--text);
  padding: 12px 16px 12px 40px;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  outline: none;
}

.modal-search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}

.search-results {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.search-result-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--bg);
  border: 1px solid var(--border);
}

.search-result-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--surface2);
  border: 1px solid var(--border2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Bebas Neue', sans-serif;
  color: var(--gold);
}

.search-empty {
  font-size: 13px;
  color: var(--muted);
  text-align: center;
  padding: 12px;
}

/* Responsive — home & daily cards */
@media (max-width: 768px) {
  .member-home {
    padding: 20px max(16px, env(safe-area-inset-left)) 32px max(16px, env(safe-area-inset-right));
    padding-bottom: calc(var(--mbn-h) + var(--safe-bottom) + 32px);
  }

  .friends-page {
    padding-left: max(16px, env(safe-area-inset-left));
    padding-right: max(16px, env(safe-area-inset-right));
  }

  .home-greeting {
    font-size: clamp(26px, 7vw, 36px);
  }

  .home-daily-hub,
  .home-daily-cards {
    margin-bottom: 24px;
  }

  .xp-card-head {
    flex-wrap: wrap;
    row-gap: 10px;
  }

  .xp-card-copy {
    flex: 1 1 calc(100% - 58px);
    min-width: 0;
  }

  .xp-card-sub {
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
    line-height: 1.45;
  }

  .xp-total-badge {
    margin-left: auto;
  }

  .daily-fact-head {
    flex-wrap: wrap;
    align-items: flex-start;
  }

  .daily-fact-label {
    letter-spacing: 0.2em;
    flex: 1 1 auto;
    min-width: 0;
  }

  .daily-fact-xp-badge {
    flex-shrink: 0;
  }

  .daily-fact-text,
  .daily-card-text,
  .daily-prompt-text {
    font-size: 14px;
  }

  .daily-card-lead {
    font-size: 16px;
  }

  .home-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .home-action-card {
    min-height: 56px;
    padding: 10px 12px;
  }

  .home-action-card.primary {
    grid-column: 1 / -1;
    min-height: 60px;
  }

  .mood-week-strip {
    gap: 4px;
  }

  .mood-strip-lbl {
    font-size: 8px;
  }

  .daily-row-cta-secondary {
    margin-left: 0;
  }

  .daily-card-actions .daily-row-cta {
    flex: 1 1 auto;
    min-width: min(100%, 140px);
  }
}

@media (max-width: 400px) {
  .xp-total-badge {
    width: 100%;
    margin-left: 0;
    text-align: center;
  }

  .xp-card-copy {
    flex: 1 1 100%;
  }

  .mood-btn-group {
    gap: 6px;
  }

  .mood-btn-label {
    font-size: 10px;
  }

  .daily-streak-count {
    font-size: 28px;
  }

  .home-actions {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (min-width: 720px) {
  .member-home {
    padding-left: 28px;
    padding-right: 28px;
  }

  .home-actions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .home-action-card.primary {
    grid-column: 1 / -1;
  }
}
