/* XChat private mail: modern implementation of the historic userboard. */

.xc-private-title,
.xc-private-send {
  display: block;
  appearance: none;
  border: 0;
  padding: 0;
  background: transparent;
  color: #ffff00;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.xc-private-title {
  margin-bottom: 14px;
  font-weight: 700;
}

.xc-private-title:hover,
.xc-private-send:hover {
  color: #ffffff;
  text-shadow: 0 0 7px #49a7ff;
}

.xc-private-new-indicator {
  display: inline-block;
}

.xchat-mail-has-new .xc-private-new-indicator {
  color: #ffff55;
  font-weight: 700;
  animation: xchat-private-mail-glow 1.15s ease-in-out infinite alternate;
}

@keyframes xchat-private-mail-glow {
  from {
    color: #fff76a;
    text-shadow:
      0 0 2px #ffffff,
      0 0 5px #ffe600,
      0 0 8px #247cff;
  }

  to {
    color: #ffffff;
    text-shadow:
      0 0 4px #ffffff,
      0 0 9px #fff200,
      0 0 14px #2f85ff;
  }
}

.xc-mail-mobile-button {
  display: none;
}

.xpm-root {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 12000;
  font: 13px Tahoma, Verdana, Arial, sans-serif;
}

.xpm-root.is-open {
  display: block;
}

.xpm-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 18, .72);
  backdrop-filter: blur(2px);
}

.xpm-window {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(860px, calc(100vw - 32px));
  height: min(590px, calc(100vh - 48px));
  transform: translate(-50%, -50%);
  display: grid;
  grid-template-rows: 30px minmax(0, 1fr);
  border: 1px solid #5d83d9;
  box-shadow: 0 14px 55px rgba(0, 0, 0, .75);
  background: #050523;
  color: #ffffff;
}

.xpm-titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-left: 10px;
  border-bottom: 1px solid #5d83d9;
  background: linear-gradient(90deg, #160978, #070534);
  color: #ffff00;
  font-weight: 700;
}

.xpm-titlebar button {
  width: 30px;
  height: 28px;
  border: 0;
  border-left: 1px solid #5d83d9;
  background: #02021d;
  color: #ffffff;
  cursor: pointer;
  font-size: 20px;
}

.xpm-content {
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  padding: 10px;
  box-sizing: border-box;
}

.xpm-toolbar {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  padding-bottom: 9px;
  border-bottom: 1px solid #425b9c;
}

.xpm-toolbar button,
.xpm-detail-actions button,
.xpm-compose-actions button {
  min-height: 28px;
  border: 1px solid #5d83d9;
  border-radius: 0;
  background: #0b1b4a;
  color: #ffffff;
  cursor: pointer;
  font-weight: 700;
}

.xpm-toolbar button:hover,
.xpm-detail-actions button:hover,
.xpm-compose-actions button:hover,
.xpm-toolbar button.is-active {
  border-color: #ffff00;
  background: #1f3990;
  color: #ffff00;
}

.xpm-capacity {
  margin-left: auto;
  color: #a9c7ff;
  white-space: nowrap;
}

.xpm-capacity b {
  color: #ffff00;
}

.xpm-inbox-layout {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(270px, 38%) minmax(0, 1fr);
  gap: 10px;
  padding-top: 10px;
}

.xpm-message-list {
  min-height: 0;
  overflow: auto;
  border: 1px solid #31477f;
  background: #010117;
}

.xpm-message-row {
  width: 100%;
  display: grid;
  grid-template-columns: 10px minmax(70px, .7fr) minmax(100px, 1.2fr);
  grid-template-areas:
    "dot from subject"
    "dot time time";
  gap: 3px 7px;
  padding: 8px;
  border: 0;
  border-bottom: 1px solid #243766;
  border-radius: 0;
  background: #070729;
  color: #dbe7ff;
  text-align: left;
  cursor: pointer;
}

.xpm-message-row:hover,
.xpm-message-row.is-selected {
  background: #111958;
}

.xpm-message-row.is-new {
  background: #111147;
  font-weight: 700;
}

.xpm-status-dot {
  grid-area: dot;
  align-self: center;
  width: 7px;
  height: 7px;
  background: #74829f;
}

.xpm-message-row.is-new .xpm-status-dot {
  background: #ffff00;
  box-shadow: 0 0 7px #ffff00;
}

.xpm-from {
  grid-area: from;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.xpm-subject {
  grid-area: subject;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.xpm-message-row time {
  grid-area: time;
  color: #8ba4d4;
  font-size: 11px;
}

.xpm-detail {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  border: 1px solid #31477f;
  background: #010117;
}

.xpm-detail-placeholder,
.xpm-empty,
.xpm-loading {
  place-items: center;
  color: #9db2da;
  text-align: center;
}

.xpm-detail-meta {
  padding: 10px;
  border-bottom: 1px solid #31477f;
  line-height: 1.55;
}

.xpm-detail-nick {
  font-weight: 700;
}

.xpm-detail-body {
  min-height: 0;
  overflow: auto;
  padding: 13px;
  color: #ffffff;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.xpm-detail-actions {
  display: flex;
  gap: 8px;
  padding: 9px;
  border-top: 1px solid #31477f;
}

.xpm-compose {
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  gap: 10px;
  padding-top: 12px;
}

.xpm-compose label {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  color: #bcd0f7;
  font-weight: 700;
}

.xpm-compose input,
.xpm-compose textarea {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #5d83d9;
  border-radius: 0;
  outline: none;
  background: #000014;
  color: #ffffff;
  padding: 7px;
  font: 13px Verdana, Arial, sans-serif;
}

.xpm-compose input:focus,
.xpm-compose textarea:focus {
  border-color: #ffff00;
  box-shadow: 0 0 0 1px rgba(255, 255, 0, .2);
}

.xpm-body-label {
  min-height: 0;
  align-items: stretch !important;
}

.xpm-compose textarea {
  height: 100%;
  min-height: 160px;
  resize: none;
}

.xpm-recipient-wrap {
  position: relative;
}

.xpm-suggestions {
  position: absolute;
  z-index: 3;
  top: calc(100% + 2px);
  left: 0;
  right: 0;
  max-height: 190px;
  overflow: auto;
  border: 1px solid #5d83d9;
  background: #05052b;
  box-shadow: 0 9px 20px rgba(0, 0, 0, .65);
}

.xpm-suggestions button,
.xpm-suggestions span {
  display: block;
  width: 100%;
  padding: 7px 9px;
  border: 0;
  border-bottom: 1px solid #263c75;
  border-radius: 0;
  background: transparent;
  color: #ffffff;
  text-align: left;
}

.xpm-suggestions button:hover {
  background: #18256b;
  color: #ffff00;
}

.xpm-compose-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.xpm-error,
.xpm-notice {
  margin: 8px 0;
  padding: 8px;
  border: 1px solid #b93636;
  background: #3a0808;
  color: #ffd7d7;
}

.xpm-notice {
  border-color: #3ea96c;
  background: #082c19;
  color: #aaffc7;
}

.xip-mail-action {
  margin-top: 8px;
  min-height: 24px;
  border: 1px solid #5d83d9;
  border-radius: 0;
  background: #0b1b4a;
  color: #ffffff;
  cursor: pointer;
}

@media (max-width: 700px) {
  .xc-mail-mobile-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 34px;
    min-width: 72px;
    padding: 0 8px;
    border: 1px solid #5d83d9;
    border-radius: 0;
    background: #071332;
    color: #ffffff;
    font: 700 12px Verdana, Arial, sans-serif;
    white-space: nowrap;
  }

  .xc-mail-mobile-button.has-new {
    border-color: #ffff00;
    color: #ffff00;
    box-shadow: 0 0 7px rgba(255, 255, 0, .45);
    animation: xchat-private-mail-glow 1.15s ease-in-out infinite alternate;
  }

  .xpm-window {
    width: calc(100vw - 12px);
    height: calc(var(--xchat-mobile-vh, 100vh) - 12px);
    max-height: none;
  }

  .xpm-content {
    padding: 7px;
  }

  .xpm-toolbar {
    flex-wrap: wrap;
  }

  .xpm-capacity {
    width: 100%;
    margin-left: 0;
    font-size: 11px;
  }

  .xpm-inbox-layout {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(120px, 42%) minmax(0, 1fr);
    gap: 7px;
  }

  .xpm-message-row {
    padding: 7px;
  }

  .xpm-compose label {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .xpm-compose textarea {
    min-height: 120px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .xchat-mail-has-new .xc-private-new-indicator,
  .xc-mail-mobile-button.has-new {
    animation: none;
  }
}
