/*
 * PulseLine desktop screen-fit correction (V15)
 * Keeps Conversations, active conversation and Group threads visible
 * inside the available Community content area without horizontal clipping.
 */

@media (min-width: 1200px) {
  /* The app shell already has a fixed navigation rail. Keep PulseLine inside
     the remaining width rather than allowing the three panes to size past it. */
  .pulseline-shell-grid {
    box-sizing: border-box !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    padding: 12px !important;
    gap: 10px !important;
    overflow-x: hidden !important;

    grid-template-columns:
      minmax(230px, 280px)
      minmax(0, 1fr)
      minmax(220px, 270px) !important;
  }

  .pulseline-shell-grid > *,
  .pulseline-lists-section,
  .pulseline-lists-grid,
  .pulseline-contacts-pane,
  .pulseline-groups-pane,
  .pulseline-shell-grid > section:nth-child(2),
  .pulseline-shell-grid > section:nth-child(2) > * {
    min-width: 0 !important;
    max-width: 100% !important;
  }

  .pulseline-contacts-pane,
  .pulseline-groups-pane {
    padding: 14px !important;
  }

  /* Prevent long headings/descriptions from forcing a column wider. */
  .pulseline-contacts-pane *,
  .pulseline-groups-pane * {
    min-width: 0;
  }

  .pulseline-contacts-pane p,
  .pulseline-groups-pane p {
    overflow-wrap: anywhere;
  }

  .pulseline-thread-list,
  .pulseline-group-list {
    min-width: 0 !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
  }

  .pulseline-conversation-pane,
  .pulseline-room-conversation,
  .pulseline-room-chat,
  .pulseline-message-canvas {
    min-width: 0 !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
  }
}

/* Typical laptop / smaller desktop: keep all three panes, but make the
   side panes compact so the conversation still has useful space. */
@media (min-width: 1200px) and (max-width: 1599px) {
  .pulseline-shell-grid {
    grid-template-columns:
      minmax(210px, 250px)
      minmax(0, 1fr)
      minmax(200px, 235px) !important;
    gap: 8px !important;
    padding: 10px !important;
  }

  .pulseline-contacts-pane,
  .pulseline-groups-pane {
    padding: 12px !important;
  }
}

/* Large desktop: do not re-introduce the old 760px minimum centre column.
   Let the middle pane flex to whatever width remains after both side panes. */
@media (min-width: 1600px) {
  .pulseline-shell-grid {
    grid-template-columns:
      minmax(240px, 285px)
      minmax(0, 1fr)
      minmax(220px, 270px) !important;
  }
}

/* At tablet widths the original responsive app can stack/navigate panes;
   this override intentionally stops at desktop. */
