.ptnr-handlowy-page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.ptnr-handlowy-page-head .dash__page-title {
  margin: 0;
}

/* Przedstawiciel handlowy — układ inspirowany Messengerem (FB): inbox | czat | profil
 *
 * Progi (jedna skala, bez nakładania sensów):
 *   ≤899px  — mobile: kolumna (czat → profil), bez listy rozmów
 *   900–1279px — laptop: siatka 3 kolumny, zwięzła gęstość UI
 *   ≥1280px — szeroki ekran: pełne rozmiary z arkusza bazowego
 *
 * Wszystkie @media są na końcu pliku w sekcji „Responsive”.
 */

.page-moj-profil .ptnr-msgr-page {
  background: #f0f2f5;
}

.ptnr-msgr-layout {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 100%;
}

/* —— Załączniki (pod oknem czatu) —— */
.ptnr-msgr-files {
  background: #ffffff;
  border-radius: 8px;
  border: 1px solid #e4e6eb;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  padding: 14px 16px 16px;
}

.ptnr-msgr-files__head {
  margin-bottom: 10px;
}

.ptnr-msgr-files__title {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 700;
  color: #050505;
  letter-spacing: -0.02em;
}

.ptnr-msgr-files__hint {
  margin: 0;
  font-size: 13px;
  color: #65676b;
  line-height: 1.4;
}

.ptnr-msgr-files__scroll {
  overflow-x: auto;
  border-radius: 8px;
  border: 1px solid #e4e6eb;
}

.ptnr-msgr-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.ptnr-msgr-table thead th {
  text-align: left;
  padding: 8px 12px;
  font-weight: 600;
  color: #65676b;
  background: #f7f8fa;
  border-bottom: 1px solid #e4e6eb;
  white-space: nowrap;
}

.ptnr-msgr-table tbody td {
  padding: 10px 12px;
  color: #050505;
  border-bottom: 1px solid #f0f2f5;
  background: #fff;
}

.ptnr-msgr-table tbody tr:last-child td {
  border-bottom: none;
}

.ptnr-msgr-table__empty td {
  color: #65676b;
}

/* —— Okno komunikatora —— */
.ptnr-msgr-app {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: auto auto auto;
  background: #ffffff;
  border-radius: 8px;
  border: 1px solid #e4e6eb;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
  overflow: hidden;
  min-height: min(82vh, 720px);
}

/* Lewa kolumna: inbox */
.ptnr-msgr-rail--inbox {
  display: flex;
  flex-direction: column;
  gap: 0;
  background: #ffffff;
  border-bottom: 1px solid #e4e6eb;
  padding: 10px 8px 12px;
}

.ptnr-msgr-inbox__search {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 8px 12px;
  padding: 8px 12px;
  background: #f0f2f5;
  border-radius: 999px;
  color: #65676b;
  font-size: 14px;
}

.ptnr-msgr-inbox__search-icon {
  font-size: 14px;
  opacity: 0.75;
}

.ptnr-msgr-inbox__search-placeholder {
  font-weight: 500;
}

.ptnr-msgr-inbox__label {
  margin: 0 8px 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #65676b;
}

.ptnr-msgr-thread {
  display: flex;
  align-items: center;
  gap: 12px;
  width: calc(100% - 16px);
  margin: 0 8px 4px;
  padding: 10px 10px;
  border: none;
  border-radius: 10px;
  background: transparent;
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: inherit;
  transition: background 0.12s ease;
}

.ptnr-msgr-thread:hover {
  background: #f2f3f5;
}

.ptnr-msgr-thread--active {
  background: #e7f3ff;
  box-shadow: inset 3px 0 0 #0866ff;
}

.ptnr-msgr-thread__avatar {
  flex-shrink: 0;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  overflow: hidden;
  background: #e4e6eb;
}

.ptnr-msgr-thread__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ptnr-msgr-thread__body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ptnr-msgr-thread__name {
  font-size: 15px;
  font-weight: 600;
  color: #050505;
}

.ptnr-msgr-thread__snippet {
  font-size: 13px;
  color: #65676b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ptnr-msgr-inbox__note {
  margin: 10px 12px 0;
  font-size: 12px;
  line-height: 1.4;
  color: #8a8d91;
}

/* Środek: rozmowa */
.ptnr-msgr-convo {
  display: flex;
  flex-direction: column;
  min-height: min(58vh, 480px);
  background: #f0f2f5;
}

.ptnr-msgr-convo__top {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  flex-shrink: 0;
  padding: 10px 14px;
  background: #ffffff;
  border-bottom: 1px solid #e4e6eb;
}

.ptnr-msgr-convo__peer {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.ptnr-msgr-convo__avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  background: #e4e6eb;
}

.ptnr-msgr-convo__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ptnr-msgr-convo__peer-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.ptnr-msgr-convo__name {
  font-size: 15px;
  font-weight: 700;
  color: #050505;
}

.ptnr-msgr-convo__status {
  font-size: 12px;
  font-weight: 500;
  color: #65676b;
}

.ptnr-msgr-convo__stream {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 16px 14px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: stretch;
}

.ptnr-msgr-msg {
  max-width: 75%;
  padding: 10px 14px;
  border-radius: 18px;
  font-size: 15px;
  line-height: 1.45;
  box-shadow: 0 1px 0.5px rgba(0, 0, 0, 0.1);
}

.ptnr-msgr-msg__text {
  margin: 0;
}

.ptnr-msgr-msg--in {
  align-self: flex-start;
  background: #e4e6eb;
  color: #050505;
  border-bottom-left-radius: 4px;
}

.ptnr-msgr-msg--out {
  align-self: flex-end;
  background: #111827;
  color: #ffffff;
  border-bottom-right-radius: 4px;
}

.ptnr-msgr-composer {
  flex-shrink: 0;
  padding: 10px 12px 14px;
  background: #ffffff;
  border-top: 1px solid #e4e6eb;
}

.ptnr-msgr-composer__bar {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  min-height: 44px;
}

.ptnr-msgr-composer__field-wrap {
  flex: 1 1 auto;
  min-width: 0;
  align-self: stretch;
  display: flex;
  align-items: stretch;
}

.ptnr-msgr-composer__input {
  box-sizing: border-box;
  width: 100%;
  min-height: 40px;
  max-height: 7.5rem;
  padding: 10px 14px;
  margin: 0;
  border: none;
  border-radius: 20px;
  background: #f0f2f5;
  font-family: inherit;
  font-size: 15px;
  line-height: 1.45;
  color: #050505;
  resize: none;
  overflow-y: auto;
  outline: none;
}

.ptnr-msgr-composer__input::placeholder {
  color: #bcc0c4;
}

.ptnr-msgr-composer__input:focus {
  box-shadow: 0 0 0 2px #0866ff;
}

.ptnr-msgr-composer__icon-btn {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: none;
  border-radius: 999px;
  font-size: 18px;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.12s ease, filter 0.12s ease, color 0.12s ease;
}

.ptnr-msgr-composer__icon-btn--attach {
  background: #e4e6eb;
  color: #050505;
}

.ptnr-msgr-composer__icon-btn--attach:hover {
  background: #d8dadf;
}

.ptnr-msgr-composer__icon-btn--send {
  background: #0866ff;
  color: #ffffff;
}

.ptnr-msgr-composer__icon-btn--send:hover {
  filter: brightness(1.06);
}

.ptnr-msgr-composer__icon-btn:focus-visible {
  outline: 2px solid #0866ff;
  outline-offset: 2px;
}

.ptnr-msgr-composer__icon-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  filter: none;
}

.ptnr-msgr-msg__inner {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.ptnr-msgr-msg__meta {
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
}

.ptnr-msgr-msg--in .ptnr-msgr-msg__meta {
  color: #65676b;
}

.ptnr-msgr-msg--out .ptnr-msgr-msg__meta {
  color: rgba(255, 255, 255, 0.88);
}

.ptnr-handlowy-chat-empty {
  margin: 0;
  font-size: 14px;
  color: #65676b;
  line-height: 1.45;
  text-align: center;
  padding: 1rem 0.75rem;
}

.ptnr-msgr-convo__status--error {
  color: #b91c1c;
  font-weight: 600;
}

/* Prawa kolumna: profil (styl FB „szczegóły”) */
.ptnr-msgr-rail--profile {
  background: #ffffff;
  padding: 16px 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.ptnr-msgr-profile__eyebrow {
  margin: 0 0 12px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #65676b;
}

.ptnr-msgr-profile__hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid #e4e6eb;
}

.ptnr-msgr-profile__photo {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  background: #e4e6eb;
  margin-bottom: 10px;
}

.ptnr-msgr-profile__name {
  font-size: 17px;
  font-weight: 700;
  color: #050505;
  letter-spacing: -0.02em;
}

.ptnr-msgr-profile__role {
  margin-top: 4px;
  font-size: 13px;
  color: #65676b;
}

.ptnr-msgr-profile__facts {
  margin: 0 0 14px;
}

.ptnr-msgr-profile__fact {
  padding: 10px 0;
  border-bottom: 1px solid #f0f2f5;
}

.ptnr-msgr-profile__fact:last-child {
  border-bottom: none;
}

.ptnr-msgr-profile__fact dt {
  margin: 0 0 2px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #8a8d91;
}

.ptnr-msgr-profile__fact dd {
  margin: 0;
  font-size: 14px;
  font-weight: 500;
  color: #050505;
  line-height: 1.4;
  word-break: break-word;
}

.ptnr-msgr-profile__fact a {
  color: #0866ff;
  text-decoration: none;
  font-weight: 600;
}

.ptnr-msgr-profile__fact a:hover {
  text-decoration: underline;
}

.ptnr-msgr-profile__cta {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

.ptnr-msgr-profile__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  background: #0866ff;
  color: #ffffff;
  border: none;
}

.ptnr-msgr-profile__btn:hover {
  filter: brightness(1.05);
}

.ptnr-msgr-profile__btn--soft {
  background: #e4e6eb;
  color: #050505;
}

.ptnr-msgr-profile__btn--soft:hover {
  filter: brightness(0.97);
}

.ptnr-msgr-profile__btn:focus-visible {
  outline: 2px solid #0866ff;
  outline-offset: 2px;
}

.ptnr-msgr-profile__foot {
  margin: 0;
  font-size: 12px;
  color: #65676b;
  text-align: center;
  line-height: 1.45;
}

/* Spotkania B2B — pod oknem czatu (kolejność w HTML), przed załącznikami */
.ptnr-handlowy-meetings {
  margin-top: 14px;
  margin-bottom: 0;
}

.ptnr-handlowy-meetings__lead {
  margin-bottom: 0.75rem;
}

.ptnr-handlowy-meetings__foot {
  margin: 0.85rem 0 0;
  font-size: 13px;
  color: #65676b;
}

.ptnr-handlowy-video-card .dash__btn-black--link {
  margin-top: 0.25rem;
}

.ptnr-handlowy-meetings__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ptnr-handlowy-meetings__item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  padding: 12px 14px;
  background: #f0f2f5;
  border-radius: 8px;
  border: 1px solid #e4e6eb;
}

.ptnr-handlowy-meetings__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
  width: 100%;
}

.ptnr-handlowy-meetings__item--highlight {
  outline: 2px solid #0866ff;
  outline-offset: 1px;
  background: #e7f0ff;
}

.ptnr-handlowy-meetings__when {
  flex: 1 1 12rem;
  min-width: 0;
  font-weight: 600;
  color: #050505;
  font-size: 15px;
}

.ptnr-handlowy-meetings__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  margin-left: auto;
  justify-content: flex-end;
}

.ptnr-handlowy-meetings__link {
  font-size: 14px;
  font-weight: 600;
  color: #0866ff;
  text-decoration: none;
}

.ptnr-handlowy-meetings__link:hover {
  text-decoration: underline;
}

.ptnr-handlowy-meetings__link--details {
  color: #15803d;
}

.ptnr-handlowy-meetings__link--details:hover {
  color: #14532d;
}

.ptnr-handlowy-meetings__topics {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 8px;
  width: 100%;
}

.ptnr-handlowy-meetings__topic-tag {
  display: inline-block;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
  color: #14532d;
  background: #dcfce7;
  border: 1px solid #86efac;
  border-radius: 6px;
}

.ptnr-handlowy-meetings__note {
  margin: 0;
  width: 100%;
  font-size: 13px;
  line-height: 1.45;
  color: #65676b;
}

.ptnr-handlowy-meetings__empty {
  margin: 0;
  font-size: 14px;
  color: #65676b;
  line-height: 1.45;
}

.page-moj-profil .sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* -------------------------------------------------------------------------
   Responsive — kolejność: szeroki layout → wspólne <1280 → laptop 3-kol → mobile
   ------------------------------------------------------------------------- */

@media (min-width: 900px) {
  .ptnr-msgr-app {
    grid-template-columns: 300px minmax(0, 1fr) minmax(240px, 280px);
    grid-template-rows: 1fr;
    min-height: min(85vh, 820px);
  }

  .ptnr-msgr-rail--inbox {
    border-bottom: none;
    border-right: 1px solid #e4e6eb;
    padding: 12px 8px;
  }

  .ptnr-msgr-convo {
    border-right: 1px solid #e4e6eb;
    min-height: 0;
  }
}

@media (max-width: 1279px) {
  .ptnr-msgr-layout {
    gap: 10px;
  }

  .ptnr-handlowy-meetings__card .dash__widget-title {
    font-size: 1rem;
  }

  .ptnr-handlowy-meetings__lead {
    font-size: 0.8125rem;
    margin-bottom: 0.5rem;
  }

  .ptnr-handlowy-meetings__item {
    padding: 10px 12px;
    gap: 6px;
  }

  .ptnr-handlowy-meetings__when {
    font-size: 14px;
    flex: 1 1 100%;
  }

  .ptnr-handlowy-meetings__head {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .ptnr-handlowy-meetings__actions {
    margin-left: 0;
    justify-content: flex-start;
    width: 100%;
  }

  .ptnr-msgr-files {
    padding: 12px 12px 14px;
  }

  .ptnr-msgr-files__title {
    font-size: 14px;
  }
}

@media (min-width: 900px) and (max-width: 1279px) {
  .ptnr-msgr-app {
    min-height: min(72vh, 560px);
  }

  .ptnr-msgr-convo {
    min-height: min(48vh, 400px);
  }

  .ptnr-msgr-convo__top {
    padding: 8px 10px;
  }

  .ptnr-msgr-convo__name {
    font-size: 14px;
  }

  .ptnr-msgr-convo__status {
    font-size: 11px;
  }

  .ptnr-msgr-convo__avatar {
    width: 36px;
    height: 36px;
  }

  .ptnr-msgr-convo__stream {
    padding: 12px 10px 14px;
  }

  .ptnr-msgr-msg {
    max-width: 88%;
    padding: 8px 12px;
    font-size: 14px;
  }

  .ptnr-msgr-composer {
    padding: 8px 10px 10px;
  }

  .ptnr-msgr-composer__icon-btn {
    width: 36px;
    height: 36px;
    font-size: 16px;
  }

  .ptnr-msgr-composer__input {
    min-height: 36px;
    padding: 8px 12px;
    font-size: 14px;
  }

  .ptnr-msgr-rail--profile {
    padding: 12px 10px 14px;
  }

  .ptnr-msgr-profile__photo {
    width: 72px;
    height: 72px;
  }

  .ptnr-msgr-profile__name {
    font-size: 15px;
  }

  .ptnr-msgr-profile__cta {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
  }

  .ptnr-msgr-profile__btn {
    padding: 8px 12px;
    font-size: 13px;
    flex: 1 1 calc(50% - 4px);
    min-width: 8rem;
  }
}

@media (max-width: 899px) {
  .ptnr-msgr-rail--inbox {
    display: none;
  }

  .ptnr-msgr-rail--profile {
    border-top: 1px solid #e4e6eb;
  }

  .ptnr-msgr-app {
    min-height: min(64vh, 520px);
  }

  .ptnr-msgr-convo {
    min-height: min(42vh, 360px);
  }

  .ptnr-msgr-profile__cta {
    flex-direction: column;
  }

  .ptnr-msgr-profile__btn {
    flex: 1 1 auto;
    min-width: 0;
    width: 100%;
  }
}
