/* Навигация, вложения событий и галерея. Основная тема остаётся в styles.css. */

/* Более спокойная насыщенность текста без потери визуальной иерархии. */
body :where(strong, b, h1, h2, h3, h4, h5, h6) {
  font-weight: 600 !important;
}

body :is(.button, .eyebrow, .task-number, .status, .summary-action, .task-card-footer a, .back-link, .attachment-info a, th, .count-badge, .event-files a) {
  font-weight: 600 !important;
}

body :is(.nav-menu a, .filter-link, .task-meta dd, .detail-meta dd, .inline-meta dd, .system-list dd) {
  font-weight: 500 !important;
}

body :is(.brand-mark, .avatar, .report-icon, .chat-contact-avatar) {
  font-weight: 700 !important;
}

.nav-notification {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-left: auto;
  border-radius: 50%;
  background: var(--danger);
  box-shadow: 0 0 0 0 rgba(239, 126, 136, .55);
  animation: notification-pulse 1.5s ease-out infinite;
}

@keyframes notification-pulse {
  70% { box-shadow: 0 0 0 7px rgba(239, 126, 136, 0); }
  100% { box-shadow: 0 0 0 0 rgba(239, 126, 136, 0); }
}

.event-files {
  display: grid;
  gap: 5px;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}

.event-files li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  font-size: 11px;
}

.event-files span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.event-files a {
  flex: 0 0 auto;
  font-weight: 600;
}

.gallery-upload-preview {
  grid-column: 1 / -1;
  min-width: 0;
  padding-top: 4px;
}

.gallery-upload-preview-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 9px;
  color: var(--muted);
  font-size: 12px;
}

.gallery-upload-preview-heading strong {
  color: var(--text);
}

.gallery-upload-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}

.gallery-upload-preview-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #202132;
}

.gallery-upload-preview-media {
  display: block;
  width: 100%;
  height: 118px;
  object-fit: cover;
  background: #141520;
}

.gallery-upload-preview-info {
  display: grid;
  gap: 3px;
  padding: 8px;
}

.gallery-upload-preview-info strong {
  overflow-wrap: anywhere;
  font-size: 11px;
}

.gallery-upload-preview-info small {
  color: var(--muted);
  font-size: 10px;
}

.gallery-upload-preview-remove {
  justify-self: start;
  margin-top: 2px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--danger);
  cursor: pointer;
  font: inherit;
  font-size: 11px;
}

.gallery-upload-preview-remove:hover {
  text-decoration: underline;
}

.chat-layout {
  display: grid;
  grid-template-columns: minmax(220px, .6fr) minmax(0, 1.4fr);
  align-items: start;
  gap: 20px;
}

.chat-contacts {
  padding: 17px 12px;
}

.chat-contact-heading {
  margin: 22px 8px 7px;
}

.chat-contact-list {
  display: grid;
  gap: 3px;
  max-height: 500px;
  overflow: auto;
}

.chat-contact {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 8px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--text);
}

.chat-contact:hover,
.chat-contact.active {
  border-color: rgba(99, 213, 168, .16);
  background: var(--mint-dim);
  text-decoration: none;
}

.chat-contact strong,
.chat-contact small {
  display: block;
}

.chat-contact strong {
  font-size: 13px;
}

.chat-contact strong .chat-contact-unread {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-left: 6px;
  border-radius: 50%;
  background: var(--danger);
  box-shadow: 0 0 0 3px rgba(239, 126, 136, .15);
  vertical-align: middle;
}

.chat-contact small,
.chat-access-note {
  color: var(--muted);
  font-size: 11px;
}

.chat-contact-avatar {
  display: grid;
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 50%;
  background: var(--mint-dim);
  color: var(--mint-bright);
  font-size: 10px;
  font-weight: 700;
}

.chat-conversation,
.task-chat-panel {
  display: grid;
  gap: 15px;
}

.chat-message-list {
  display: grid;
  gap: 12px;
  max-height: 520px;
  min-height: 240px;
  padding: 3px 4px 3px 0;
  overflow: auto;
}

.task-chat-message-list {
  max-height: 360px;
  min-height: 120px;
}

.chat-message {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  max-width: 88%;
}

.chat-message.is-own {
  flex-direction: row-reverse;
  justify-self: end;
}

.chat-message-body {
  min-width: 0;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 4px 11px 11px;
  background: #202132;
}

.chat-message.is-own .chat-message-body {
  border-color: rgba(99, 213, 168, .3);
  border-radius: 11px 4px 11px 11px;
  background: var(--mint-dim);
}

.chat-message-body > div {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  align-items: baseline;
}

.chat-message-body strong {
  font-size: 12px;
}

.chat-message-body time {
  color: var(--muted);
  font-size: 10px;
}

.chat-message-body p {
  margin: 3px 0 0;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.chat-composer {
  display: grid;
  gap: 8px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.chat-composer textarea {
  min-height: 76px;
  resize: vertical;
}

.chat-composer-controls {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}

.chat-file-input {
  min-width: 0;
  flex: 1;
  padding: 6px;
  color: var(--muted);
  font-size: 12px;
}

.chat-attachments {
  display: grid;
  gap: 5px;
  margin: 9px 0 0;
  padding: 0;
  list-style: none;
}

.chat-attachments li {
  display: flex;
  gap: 8px;
  align-items: baseline;
  padding-top: 5px;
  border-top: 1px solid rgba(255, 255, 255, .1);
  font-size: 12px;
}

.chat-attachments a {
  min-width: 0;
  overflow-wrap: anywhere;
}

.chat-attachments small {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 10px;
}

.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: 750px) {
  .chat-layout { grid-template-columns: 1fr; }
  .chat-contact-list { max-height: 240px; }
  .chat-message { max-width: 96%; }
  .chat-composer-controls { align-items: stretch; flex-direction: column; }
  .chat-composer-controls .button { width: 100%; }
}
