/* ClutchHub v185 — profil içi canlı özel mesaj balonu */
.profile-dm-bubble {
  position: fixed;
  z-index: 2147482500;
  right: 176px;
  bottom: 22px;
  width: min(390px, calc(100vw - 32px));
  height: min(590px, calc(100vh - 96px));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid #d6e1ed;
  border-radius: 18px 18px 5px 18px;
  background: #fff;
  color: #14243d;
  box-shadow: 0 24px 70px rgba(15, 35, 62, .24);
  transform-origin: right bottom;
  animation: profileDmOpen .18s ease-out;
}

.profile-dm-bubble::before,
.profile-dm-bubble::after {
  content: "";
  position: absolute;
  z-index: 2;
  pointer-events: none;
}

.profile-dm-bubble::before {
  top: -1px;
  left: -1px;
  width: 37px;
  height: 37px;
  border-top: 3px solid #ff5018;
  border-left: 3px solid #ff5018;
  clip-path: polygon(0 0, 100% 0, 0 100%);
}

.profile-dm-bubble::after {
  right: -1px;
  bottom: -1px;
  width: 28px;
  height: 28px;
  border-right: 3px solid #ff5018;
  border-bottom: 3px solid #ff5018;
}

.profile-dm-head {
  min-height: 70px;
  padding: 13px 14px 12px 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid #dce5ee;
  background:
    linear-gradient(120deg, rgba(255, 80, 24, .075), transparent 50%),
    #fff;
}

.profile-dm-head > button {
  width: 32px;
  height: 32px;
  border: 1px solid #d8e2ed;
  border-radius: 9px;
  background: #fff;
  color: #20314b;
  display: grid;
  place-items: center;
  font: inherit;
  font-size: 18px;
  cursor: pointer;
}

.profile-dm-head > button:hover,
.profile-dm-head > button:focus-visible {
  border-color: #ff7040;
  color: #f0440e;
  outline: 0;
}

.profile-dm-head-copy {
  min-width: 0;
  flex: 1;
  display: grid;
  gap: 2px;
}

.profile-dm-head-copy small {
  color: #f04a15;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .08em;
}

.profile-dm-head-copy strong {
  overflow: hidden;
  color: #10213b;
  font-size: 14px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-dm-head-copy span {
  color: #718099;
  font-size: 10px;
}

.profile-dm-avatar {
  position: relative;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #e9eef4;
  box-shadow: 0 0 0 1px #cfdbe8;
  overflow: hidden;
}

.profile-dm-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-dm-avatar span {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  color: #253750;
  font-size: 11px;
  font-weight: 900;
}

.profile-dm-view {
  min-height: 0;
  display: grid;
}

.profile-dm-list-view {
  grid-template-rows: auto minmax(0, 1fr);
}

.profile-dm-search {
  margin: 12px 14px 8px;
  height: 40px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid #d7e2ed;
  border-radius: 10px;
  background: #fbfdff;
}

.profile-dm-search span {
  color: #8a99ad;
  font-size: 16px;
}

.profile-dm-search input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  color: #172943;
  font: inherit;
  font-size: 11px;
}

.profile-dm-list {
  min-height: 0;
  padding: 3px 12px 14px;
  overflow-y: auto;
}

.profile-dm-person {
  width: 100%;
  min-height: 62px;
  padding: 9px 8px;
  border: 0;
  border-bottom: 1px solid #e2e9f0;
  background: transparent;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #152640;
  text-align: left;
  font: inherit;
  cursor: pointer;
}

.profile-dm-person:hover,
.profile-dm-person:focus-visible {
  border-radius: 10px;
  background: #fff5f0;
  outline: 0;
}

.profile-dm-person > span:not(.profile-dm-avatar) {
  min-width: 0;
  flex: 1;
  display: grid;
  gap: 2px;
}

.profile-dm-person strong {
  font-size: 11px;
  font-weight: 900;
}

.profile-dm-person small {
  overflow: hidden;
  color: #7988a0;
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-dm-person > b {
  color: #ff4f16;
  font-size: 16px;
}

.profile-dm-empty,
.profile-dm-loading {
  padding: 42px 20px;
  align-self: start;
  color: #718099;
  font-size: 11px;
  line-height: 1.55;
  text-align: center;
}

.profile-dm-chat-view {
  grid-template-rows: minmax(0, 1fr) auto;
}

.profile-dm-messages {
  min-height: 0;
  padding: 14px;
  overflow-y: auto;
  background:
    linear-gradient(rgba(226, 234, 242, .35) 1px, transparent 1px),
    linear-gradient(90deg, rgba(226, 234, 242, .35) 1px, transparent 1px),
    #f8fafc;
  background-size: 30px 30px;
}

.profile-dm-message {
  max-width: 82%;
  margin: 0 0 10px;
  display: grid;
  justify-items: start;
  gap: 3px;
}

.profile-dm-message.own {
  margin-left: auto;
  justify-items: end;
}

.profile-dm-message p {
  margin: 0;
  padding: 9px 11px;
  border: 1px solid #dbe5ee;
  border-radius: 5px 13px 13px 13px;
  background: #fff;
  color: #1b2d47;
  font-size: 11px;
  line-height: 1.48;
  overflow-wrap: anywhere;
  box-shadow: 0 4px 12px rgba(18, 42, 72, .05);
}

.profile-dm-message.own p {
  border-color: #ff5a21;
  border-radius: 13px 5px 13px 13px;
  background: linear-gradient(135deg, #ff6429, #f5470d);
  color: #fff;
}

.profile-dm-message small {
  color: #8997aa;
  font-size: 8px;
}

.profile-dm-compose {
  padding: 10px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px;
  gap: 7px;
  border-top: 1px solid #d9e3ed;
  background: #fff;
}

.profile-dm-compose input {
  min-width: 0;
  height: 42px;
  padding: 0 12px;
  border: 1px solid #d5e1ec;
  border-radius: 10px;
  outline: 0;
  color: #172943;
  font: inherit;
  font-size: 11px;
}

.profile-dm-compose input:focus {
  border-color: #ff7040;
  box-shadow: 0 0 0 3px rgba(255, 80, 24, .1);
}

.profile-dm-compose button {
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 10px;
  background: linear-gradient(135deg, #ff6429, #f0440e);
  color: #fff;
  font: inherit;
  font-size: 17px;
  font-weight: 900;
  cursor: pointer;
}

.profile-dm-compose button:disabled {
  cursor: not-allowed;
  opacity: .48;
}

.profile-dm-error {
  grid-column: 1 / -1;
  margin: 0;
  color: #b82929;
  font-size: 9px;
}

@keyframes profileDmOpen {
  from { opacity: 0; transform: translateY(18px) scale(.96); }
  to { opacity: 1; transform: none; }
}

@media (max-width: 700px) {
  .profile-dm-bubble {
    right: 8px;
    bottom: 72px;
    width: calc(100vw - 16px);
    height: min(570px, calc(100vh - 90px));
    border-radius: 16px 16px 4px 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .profile-dm-bubble {
    animation: none;
  }
}
