/* Link previews and source cards -------------------------------------- */
.link-cards {
  display: grid;
  gap: 7px;
  width: 100%;
  min-width: 0;
  margin-top: 10px;
}

.message.user .link-cards {
  justify-items: end;
}

.link-cards-heading {
  color: rgba(220, 224, 235, 0.62);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.link-cards-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  min-width: 0;
}

.link-card {
  display: grid;
  gap: 3px;
  flex: 1 1 180px;
  min-width: 0;
  max-width: min(260px, 100%);
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 13px;
  color: rgba(255, 255, 255, 0.92);
  background: rgba(255, 255, 255, 0.05);
  text-decoration: none;
  transition: border-color 180ms ease, background 180ms ease, transform 180ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.link-card.is-rich {
  flex-basis: 260px;
  max-width: min(360px, 100%);
  padding: 10px 12px;
}

.link-card:hover,
.link-card:focus-visible {
  border-color: rgba(88, 161, 255, 0.55);
  background: rgba(88, 161, 255, 0.09);
  outline: none;
}

.link-card:active {
  transform: scale(0.985);
}

.link-card-site {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.link-card-icon {
  position: relative;
  display: grid;
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  overflow: hidden;
  border-radius: 5px;
  place-items: center;
  background: rgba(255, 255, 255, 0.12);
}

.link-card-icon img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #fff;
  opacity: 0;
  transition: opacity 160ms ease;
}

.link-card-icon.has-image img {
  opacity: 1;
}

.link-card-icon-letter {
  color: #fff;
  font-size: 0.62rem;
  font-weight: 800;
}

.link-card-site-name {
  overflow: hidden;
  color: rgba(220, 224, 235, 0.66);
  font-size: 0.7rem;
  font-weight: 600;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.link-card-title {
  display: -webkit-box;
  overflow: hidden;
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1.3;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.link-card:not(.is-rich) .link-card-title {
  -webkit-line-clamp: 1;
}

.link-card-description {
  display: -webkit-box;
  overflow: hidden;
  color: rgba(220, 224, 235, 0.64);
  font-size: 0.72rem;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.link-card-description:empty,
.link-card-description[hidden] {
  display: none;
}

.link-card.is-loading .link-card-title {
  color: rgba(255, 255, 255, 0.7);
}

@media (max-width: 640px) {
  .link-card,
  .link-card.is-rich {
    flex-basis: 100%;
    max-width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .link-card,
  .link-card-icon img {
    transition: none;
  }
}

/* Whole-page file drop target ------------------------------------------ */
.page-drop-overlay {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(4, 8, 18, 0.72);
  backdrop-filter: blur(6px);
  pointer-events: none;
  opacity: 0;
  transition: opacity 160ms ease;
}

.page-drop-overlay.is-visible {
  opacity: 1;
}

.page-drop-overlay[hidden] {
  display: none;
}

.page-drop-overlay-card {
  display: grid;
  gap: 6px;
  width: min(440px, 100%);
  padding: 28px 24px;
  border: 2px dashed rgba(88, 161, 255, 0.8);
  border-radius: 22px;
  color: #fff;
  background: rgba(20, 28, 46, 0.86);
  text-align: center;
}

.page-drop-overlay-card strong {
  font-size: 1.05rem;
}

.page-drop-overlay-card span {
  color: rgba(220, 224, 235, 0.72);
  font-size: 0.85rem;
}
