
/* Shared browser chrome already reserves header/footer and keyboard clearance. */
html[data-simphoni-browser-footer] body.phonafrend-page-body {
  padding-block: 0;
}

html[data-simphoni-browser-footer] .phonafrend-page:not(.phonafrend-app-store-demo) {
  height: var(--simphoni-content-height);
  min-height: 0;
  max-height: var(--simphoni-content-height);
  padding-block: min(16px, 2vh);
}

/* Home in the persistent footer is the single Compass destination. Keep the
   existing in-page links available to standalone/native surfaces. */
html[data-simphoni-browser-footer] .phonafrend-return-nav,
html[data-simphoni-browser-footer] .phonafrend-simphoni-return-btn {
  display: none;
}

/* The decorative bottom wash must not paint across names or action buttons. */
.phonafrend-page .phonafrend-chat-header::after {
  content: none;
}

.phonafrend-page .phonafrend-chat-header:not(.empty) {
  flex: 0 0 auto;
  min-width: 0;
  max-height: 50%;
  overflow-y: auto;
}

.phonafrend-page .phonafrend-contact-name {
  white-space: normal;
  overflow-wrap: anywhere;
}

/* A short window/keyboard needs a bounded scrolling conversation, not a second
   viewport or an extra legacy footer reservation. */
html[data-simphoni-browser-footer] .phonafrend-chat-scroll {
  min-height: 0;
  padding-bottom: 0;
  overflow: hidden;
}

html[data-simphoni-browser-footer] .phonafrend-page .phonafrend-shell {
  min-height: 0;
  height: 100%;
}

html[data-simphoni-browser-footer] .phonafrend-chat-surface,
html[data-simphoni-browser-footer] .phonafrend-page .phonafrend-shell.mobile-view .phonafrend-chat-surface {
  min-height: 0;
  padding-bottom: 8px;
}

@media (max-width: 768px) {
  html[data-simphoni-browser-footer] .phonafrend-page:not(.phonafrend-app-store-demo) {
    padding-block: 0;
  }

  html[data-simphoni-browser-footer] .phonafrend-page .phonafrend-shell.mobile-view
    .phonafrend-chat-header:not(.empty) {
    padding-top: 8px;
  }
}

/* Scroll the roster; do not shrink each row below its name/status/history. */
.phonafrend-page .chat-connections-list > .chat-connection-item,
.phonafrend-page .chat-connections-list > .chat-connections-list-heading,
.phonafrend-page .chat-connections-list > .load-more-btn {
  flex-shrink: 0;
}

.phonafrend-page .chat-connection-item .chat-connection-handle,
.phonafrend-page .chat-connection-item .chat-connection-email-sub {
  white-space: normal;
  overflow-wrap: anywhere;
}
/* Compact call controls retain their independent accessible name and title. */
@media (max-width: 768px) {
  html[data-simphoni-browser-footer] .phonafrend-page:not(.phonafrend-placeholder-state) .phonafrend-shell.mobile-view .phonafrend-chat-header:not(.empty) .phonafrend-chat-call-label {
    display: none;
  }
  html[data-simphoni-browser-footer] .phonafrend-page:not(.phonafrend-placeholder-state) .phonafrend-shell.mobile-view .phonafrend-chat-header:not(.empty) .phonafrend-chat-call-btn--direct {
    justify-content: center;
  }
  /* Keep contact and toolbar rows intact when the bounded header must scroll. */
  html[data-simphoni-browser-footer] .phonafrend-page:not(.phonafrend-placeholder-state) .phonafrend-shell.mobile-view .phonafrend-chat-header:not(.empty) .phonafrend-header-content {
    flex: 0 0 auto;
    min-height: max-content;
    grid-auto-rows: max-content;
    overflow: visible;
  }
}
