/* Chat: dieselbe Marine-/Blaupalette wie das Portal, eigenständige Scrollflächen. */
#portal .portal-content.chat-page {
  padding: 20px 24px;
  max-width: none;
  height: calc(100dvh - 72px);
  min-height: 0;
}
#portal .chat-shell {
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-columns: 292px minmax(0, 1fr);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 10px 35px #10284c08;
}
#portal .chat-directory {
  min-height: 0;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--line);
  background: #fbfdff;
}
#portal .chat-directory-top {
  padding: 22px 16px 0;
}
#portal .chat-directory .eyeline {
  color: #647c98;
  font-size: 9px;
  margin-bottom: 4px;
}
#portal .chat-title-line {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}
#portal .chat-title-line h1 {
  margin: 0;
  font-size: 27px;
}
#portal .chat-count {
  background: #e9f1fb;
  color: #42648a;
  border-radius: 8px;
  padding: 2px 7px;
  font-size: 11px;
}
#portal .chat-create-actions {
  display: grid;
  gap: 7px;
  grid-template-columns: 1fr;
}
#portal .chat-create-actions .p-btn {
  width: 100%;
  margin: 0;
  min-height: 36px;
}
#portal .chat-create-actions .p-btn.light {
  background: white;
  border: 1px solid var(--line);
  color: #264d79;
}
#portal .chat-search {
  margin: 17px 0 13px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  background: white;
  border-radius: 9px;
  padding: 0 10px;
}
#portal .chat-search svg {
  width: 16px;
  color: #6a819b;
}
#portal .chat-search input {
  min-width: 0;
  border: 0;
  background: transparent;
  padding: 10px 0;
  width: 100%;
  outline-offset: 2px;
  font-size: 12px;
}
#portal .chat-filters {
  display: flex;
  gap: 4px;
  padding-bottom: 13px;
}
#portal .chat-filters button {
  flex: 1;
  padding: 7px 5px;
  border: 0;
  background: transparent;
  color: #63768e;
  border-radius: 7px;
  font-size: 11px;
}
#portal .chat-filters button[aria-pressed='true'] {
  color: #005bc7;
  background: #e8f2ff;
}
#portal .chat-contact-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 4px 8px 12px;
  scrollbar-width: thin;
}
#portal .chat-contact {
  width: 100%;
  display: flex;
  text-align: left;
  align-items: center;
  padding: 13px 9px;
  gap: 10px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--ink);
  margin: 2px 0;
}
#portal .chat-contact:hover {
  background: #f0f6fd;
  transform: none;
}
#portal .chat-contact.selected {
  background: #e8f2ff;
  border-color: #d4e6ff;
}
#portal .chat-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 39px;
  height: 39px;
  flex: 0 0 39px;
  border-radius: 12px;
  background: #dcecff;
  color: #18579e;
  font-size: 12px;
  font-weight: 700;
}
#portal .chat-avatar.mint {
  background: #dff2e9;
  color: #36715a;
}
#portal .chat-avatar.violet {
  background: #eee7fb;
  color: #7959a3;
}
#portal .chat-avatar.sand {
  background: #f6eddb;
  color: #97713e;
}
#portal .chat-avatar.rose {
  background: #f9e5eb;
  color: #9a4d68;
}
#portal .chat-contact-copy {
  min-width: 0;
  flex: 1;
}
#portal .chat-contact-copy strong,
#portal .chat-contact-copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#portal .chat-contact-copy strong {
  font-size: 12px;
  font-weight: 650;
}
#portal .chat-contact-copy small {
  color: #70829a;
  font-size: 10px;
  font-weight: 400;
  margin-top: 4px;
}
#portal .chat-contact-meta {
  align-self: stretch;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: space-between;
  gap: 5px;
}
#portal .chat-contact-meta small {
  color: #70829a;
  font-size: 9px;
  font-weight: 400;
}
#portal .chat-contact-meta b {
  border-radius: 6px;
  padding: 0 5px;
  background: #0068dc;
  color: white;
  font-size: 10px;
}
#portal .chat-contact-meta svg {
  width: 13px;
  height: 13px;
  color: #7990aa;
}
#portal .chat-directory-footer {
  padding: 14px 18px;
  border-top: 1px solid var(--line);
  font-size: 10px;
  color: #617892;
  display: flex;
  align-items: center;
  gap: 7px;
}
#portal .chat-preview-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #cc9d48;
}
#portal .chat-conversation {
  min-height: 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
#portal .chat-conversation-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
}
#portal .chat-heading-copy {
  flex: 1;
  min-width: 0;
}
#portal .chat-heading-copy h2 {
  font-size: 18px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#portal .chat-heading-copy small {
  color: #71829a;
  display: block;
  margin-top: 3px;
}
#portal .chat-preview-badge {
  font-size: 10px;
  padding: 4px 8px;
  background: #fff7e8;
  color: #8b692d;
  border: 1px solid #f1e1c0;
  border-radius: 6px;
}
#portal .chat-list-toggle {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: #496887;
  padding: 7px;
}
#portal .chat-translation-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 22px;
  background: #fbfdff;
  flex-wrap: wrap;
}
#portal .chat-translation-bar label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 500;
  color: #476585;
  margin: 0;
}
#portal .chat-translation-bar input {
  width: 15px;
  height: 15px;
  margin: 0;
  accent-color: #0068dc;
}
#portal .chat-translation-bar select {
  font-size: 11px;
  padding: 5px 8px;
  width: auto;
  background: white;
}
#portal .chat-column-labels {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  border-top: 1px solid #edf2f8;
  border-bottom: 1px solid var(--line);
  background: #f5f8fc;
}
#portal .chat-column-labels span {
  padding: 10px 22px;
  font-size: 10px;
  font-weight: 650;
  color: #637b96;
  letter-spacing: 0.025em;
}
#portal .chat-column-labels span + span {
  border-left: 1px solid var(--line);
  color: #2663a6;
}
#portal .chat-messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: #fff;
  scrollbar-width: thin;
}
#portal .chat-day {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px 12px 8px;
}
#portal .chat-day span {
  padding: 3px 10px;
  background: #f2f6fb;
  border-radius: 20px;
  font-size: 10px;
  color: #7c8ca1;
}
#portal .chat-message-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}
#portal .chat-column-labels.dual,
#portal .chat-message-row.dual {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
#portal .chat-cell {
  min-width: 0;
  padding: 11px 22px;
}
#portal .chat-cell + .chat-cell {
  border-left: 1px solid #edf2f8;
  background: #fafdff;
}
#portal .chat-message-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 10px;
  margin-bottom: 6px;
}
#portal .chat-message-meta strong {
  color: #4c6480;
  font-weight: 650;
}
#portal .chat-message-meta span {
  color: #8d9bad;
  font-size: 9px;
}
#portal .chat-bubble {
  width: fit-content;
  max-width: 100%;
  padding: 11px 13px;
  background: #f0f4f9;
  border: 1px solid #e8eef5;
  border-radius: 2px 11px 11px;
  font-size: 12px;
  line-height: 1.7;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: #2e4968;
}
#portal .chat-cell.own .chat-bubble {
  background: #e9f2ff;
  border-color: #dbe9fc;
  color: #1c4e86;
  border-radius: 11px 2px 11px 11px;
  margin-left: auto;
}
#portal .chat-cell.own .chat-message-meta {
  justify-content: flex-end;
}
#portal .chat-message-label {
  display: block;
  color: #8a9ab0;
  font-size: 9px;
  margin-top: 5px;
}
#portal .chat-cell.own .chat-message-label {
  text-align: right;
}
#portal .chat-composer {
  flex-shrink: 0;
  margin: 13px 20px 7px;
  border: 1px solid #cbdcef;
  border-radius: 13px;
  background: white;
  box-shadow: 0 3px 12px #10284c06;
}
#portal .chat-composer:focus-within {
  border-color: #5499e8;
  box-shadow: 0 0 0 3px #0068dc0c;
}
#portal .chat-composer textarea {
  width: 100%;
  display: block;
  border: 0;
  outline: none;
  box-shadow: none;
  resize: none;
  border-radius: 13px;
  padding: 13px 15px 4px;
  font-size: 13px;
  min-height: 62px;
  max-height: 120px;
}
#portal .chat-composer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 6px 10px 10px 15px;
}
#portal .chat-composer-bottom small {
  font-size: 9px;
  color: #8b9aae;
}
#portal .chat-composer-bottom .p-btn {
  padding: 7px 13px;
  margin: 0;
}
#portal .chat-disclaimer {
  padding: 0 18px 11px;
  text-align: center;
  font-size: 9px;
  color: #8191a5;
}
#portal .chat-empty {
  padding: 30px 18px;
  color: #71849b;
  font-size: 12px;
  text-align: center;
}
#portal .chat-shell.list-hidden {
  grid-template-columns: minmax(0, 1fr);
}
#portal .chat-shell.list-hidden .chat-directory {
  display: none;
}
#portal .chat-person-picker {
  max-height: 340px;
  overflow-y: auto;
}
#portal .chat-person-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}
#portal .chat-person-option[hidden] {
  display: none;
}
#portal .chat-person-option input {
  width: 16px;
  height: 16px;
  accent-color: #0068dc;
}
#portal .chat-person-option small {
  display: block;
  margin-top: 3px;
  color: #6c839d;
  font-weight: 400;
}
#portal .chat-person-option strong {
  font-size: 13px;
}
#portal .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;
}
@media (max-width: 1200px) {
  #portal .chat-shell {
    grid-template-columns: 250px minmax(0, 1fr);
  }
  #portal .portal-content.chat-page {
    padding: 12px;
  }
  #portal .chat-cell {
    padding: 10px 14px;
  }
}
@media (max-width: 1000px) {
  #portal .chat-shell:not(.list-hidden) {
    grid-template-columns: minmax(0, 1fr);
  }
  #portal .chat-shell:not(.list-hidden) .chat-conversation {
    display: none;
  }
  #portal .chat-directory {
    border-right: 0;
  }
}
@media (max-width: 800px) {
  #portal:has(.chat-page) {
    height: 100dvh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
  }
  #portal:has(.chat-page) > .sidebar {
    flex: 0 0 auto;
  }
  #portal:has(.chat-page) > .portal-main {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
  }
  #portal:has(.chat-page) .portal-topbar {
    flex: 0 0 53px;
  }
  #portal .portal-content.chat-page {
    height: auto;
    min-height: 0;
    flex: 1;
    width: 100%;
    padding: 8px;
  }
  #portal .chat-conversation-header {
    padding: 12px;
  }
  #portal .chat-translation-bar {
    padding: 8px 12px;
  }
  #portal .chat-column-labels.dual span + span {
    display: none;
  }
  #portal .chat-message-row.dual {
    grid-template-columns: minmax(0, 1fr);
    border-bottom: 1px solid #edf2f8;
  }
  #portal .chat-cell + .chat-cell {
    border-left: 0;
    padding-top: 0;
  }
  #portal .chat-composer {
    margin: 8px 10px 5px;
  }
  #portal .chat-composer-bottom small {
    display: none;
  }
  #portal .chat-composer-bottom {
    justify-content: flex-end;
  }
}

#portal .chat-messages > [data-chat-older] {
  align-self: center;
  margin: 8px auto;
}

#portal [data-group-action] {
  margin-block: 12px;
}

#portal .chat-contact-avatar {
  position: relative;
  display: inline-flex;
}
#portal .chat-status {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  color: white;
  background: #52647d;
  font-weight: 700;
  font-size: 12px;
}
#portal .chat-status-available {
  background: #177247;
}
#portal .chat-status-busy {
  background: #a23342;
}
#portal .chat-status-meeting {
  background: #6c4597;
}
#portal .chat-contact-avatar .chat-status {
  position: absolute;
  bottom: -3px;
  right: -3px;
  border: 2px solid white;
}
#portal .chat-contact-picker {
  position: relative;
}
#portal .chat-contact-suggestions {
  position: absolute;
  z-index: 2;
  inset-inline: 0;
  top: 100%;
  max-height: 230px;
  overflow: auto;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 24px #10284c24;
}
#portal .chat-contact-suggestions button {
  display: flex;
  flex-direction: column;
  width: 100%;
  text-align: left;
  padding: 8px 12px;
  background: white;
  border: 0;
  color: inherit;
  cursor: pointer;
}
#portal .chat-contact-suggestions button:is(:focus-visible, :hover) {
  background: #ebf3ff;
}
