/* ===== Una MVP Responsive Overrides (frontend-only) ===== */
html, body { height: 100%; }
#root { min-height: 100%; }

/* Constrain and center the app shell */
[data-una-appshell] { max-width: 1200px; margin: 0 auto; width: 100%; padding: 8px; box-sizing: border-box; }

/* Chat panel becomes a column flexbox */
[data-una-chat-panel] {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 70vh; /* safety height on desktops */
}

/* Scrollable messages area */
[data-una-feed] {
  flex: 1 1 auto;
  min-height: 240px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

/* Compose area sticks to bottom of panel */
[data-una-compose] {
  position: sticky;
  bottom: 0;
  z-index: 1;
  background: transparent;
  padding-bottom: 4px;
}

/* Footer under compose */
#una-mvp-chat-footer {
  font-size: 12px;
  color: #2e3a2e;
  line-height: 1.45;
  text-align: left;
  margin-top: 6px;
  margin-bottom: 4px;
}

/* Make the left info column collapsible on smaller screens */
@media (max-width: 1000px) {
  [data-una-left] { display: none !important; }
  [data-una-chat-panel] { min-height: calc(100vh - 96px); }
  [data-una-appshell] { padding: 8px 8px 12px; }
}

/* Tighter layout for phones */
@media (max-width: 600px) {
  [data-una-chat-panel] { min-height: calc(100vh - 88px); gap: 6px; }
  #una-mvp-chat-footer { font-size: 11px; margin-top: 4px; }
}

/* Ensure send button remains pinned inside the compose field */
[data-una-compose] .una-send-button {
  position: absolute;
  right: 12px;
  bottom: 12px;
}

/* Prevent wide content from breaking layout */
[data-una-feed] img, [data-una-feed] iframe, [data-una-feed] .message-card {
  max-width: 100%;
  height: auto;
}

/* Trim popovers on narrow screens */
@media (max-width: 480px) {
  .MuiPopover-paper, .MuiMenu-paper { max-width: 90vw; }
}