/* Вкладки медиа / голосовые / ссылки в профиле из чата */

.tg-profile-shared {
  margin-top: 8px;
}

.tg-profile-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 12px;
  border-radius: 14px;
  overflow: hidden;
  background: var(--md-sys-color-surface-container);
  border: 1px solid color-mix(in srgb, var(--md-sys-color-outline-variant) 40%, transparent);
}

.tg-profile-tab {
  flex: 1;
  min-height: 42px;
  border: none;
  background: transparent;
  color: var(--md-sys-color-on-surface-variant);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.tg-profile-tab--active {
  background: var(--md-sys-color-primary-container);
  color: var(--md-sys-color-on-primary-container);
}

.tg-profile-shared-panel {
  min-height: 120px;
}

.tg-profile-shared-status {
  padding: 24px 12px;
  text-align: center;
  color: var(--md-sys-color-on-surface-variant);
  font-size: 0.875rem;
}

.tg-profile-media-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 3px;
  border-radius: 14px;
  overflow: hidden;
}

.tg-profile-media-item {
  position: relative;
  aspect-ratio: 1;
  border: none;
  padding: 0;
  background: var(--md-sys-color-surface-container-high);
  cursor: pointer;
  overflow: hidden;
}

.tg-profile-media-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.tg-profile-voice-list,
.tg-profile-links-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tg-profile-voice-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 14px;
  background: var(--md-sys-color-surface-container);
  border: 1px solid color-mix(in srgb, var(--md-sys-color-outline-variant) 35%, transparent);
}

.tg-profile-voice-item__play {
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--md-sys-color-primary);
  color: var(--md-sys-color-on-primary);
  flex-shrink: 0;
  cursor: pointer;
}

.tg-profile-voice-item__play .material-symbols-rounded {
  font-size: 22px;
  font-variation-settings: 'FILL' 1;
}

.tg-profile-voice-item__meta {
  flex: 1;
  min-width: 0;
}

.tg-profile-voice-item__title {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--md-sys-color-on-surface);
}

.tg-profile-voice-item__time {
  font-size: 0.75rem;
  color: var(--md-sys-color-on-surface-variant);
  margin-top: 2px;
}

.tg-profile-link-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px;
  border-radius: 14px;
  background: var(--md-sys-color-surface-container);
  border: 1px solid color-mix(in srgb, var(--md-sys-color-outline-variant) 35%, transparent);
  text-decoration: none;
  color: inherit;
}

.tg-profile-link-item__icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--md-sys-color-primary-container);
  color: var(--md-sys-color-on-primary-container);
  flex-shrink: 0;
}

.tg-profile-link-item__icon .material-symbols-rounded {
  font-size: 20px;
}

.tg-profile-link-item__body {
  flex: 1;
  min-width: 0;
}

.tg-profile-link-item__url {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--md-sys-color-primary);
  word-break: break-all;
  line-height: 1.35;
}

.tg-profile-link-item__meta {
  margin-top: 4px;
  font-size: 0.75rem;
  color: var(--md-sys-color-on-surface-variant);
}

/* Ссылки в сообщениях */
.message-link {
  color: var(--md-sys-color-primary);
  text-decoration: underline;
  text-underline-offset: 2px;
  word-break: break-word;
}

.message-bubble--mine .message-link {
  color: #e8def8;
}

.message-bubble--theirs .message-link {
  color: #4f378b;
}

@media (prefers-color-scheme: dark) {
  .message-bubble--theirs .message-link {
    color: #d0bcff;
  }
}
