/* Global chat: compose row + attachments (loads after styles.min.css) */
.global-chat-controls {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
}
.global-chat-controls-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.global-chat-input-row {
  display: flex;
  align-items: stretch;
  gap: 8px;
  min-width: 0;
}
.global-chat-file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.global-chat-attach-btn {
  flex-shrink: 0;
  min-width: 44px;
  padding: 10px 12px !important;
  font-size: 1rem;
  line-height: 1;
}
.global-chat-controls .global-chat-input-row input[type="text"] {
  flex: 1;
  min-width: 0;
  border-radius: var(--r8);
  border: 1px solid rgba(63, 63, 70, 0.9);
  background: rgba(9, 9, 11, 0.9);
  color: var(--text);
  font-size: 0.88rem;
  padding: 10px 12px;
}
.global-chat-controls .global-chat-input-row input[type="text"]:focus {
  outline: none;
  border-color: rgba(96, 165, 250, 0.8);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.18);
}
.global-chat-attachment-preview {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 8px 10px;
  border-radius: var(--r8);
  border: 1px solid rgba(96, 165, 250, 0.28);
  background: rgba(30, 64, 175, 0.14);
  font-size: 0.78rem;
  color: #cbd5e1;
}
.global-chat-attachment-preview.hidden {
  display: none !important;
}
.global-chat-attachment-preview img {
  max-height: 72px;
  max-width: 120px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid rgba(148, 163, 184, 0.35);
}
.global-chat-attachment-preview-name {
  flex: 1;
  min-width: 0;
  word-break: break-word;
  font-weight: 600;
}
.global-chat-attachment-remove {
  flex-shrink: 0;
  border: 1px solid rgba(248, 113, 113, 0.35);
  border-radius: 999px;
  background: rgba(127, 29, 29, 0.35);
  color: #fecaca;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 4px 10px;
  cursor: pointer;
}
.global-chat-attachment-remove:hover {
  border-color: rgba(248, 113, 113, 0.55);
  color: #fff;
}
.global-chat-controls .btn[type="submit"] {
  min-width: 110px;
}
.global-chat-msg-img-link {
  display: inline-block;
  max-width: 100%;
  margin-bottom: 6px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.28);
  line-height: 0;
}
.global-chat-msg-img {
  display: block;
  max-width: min(100%, 320px);
  max-height: 240px;
  width: auto;
  height: auto;
  object-fit: contain;
  background: rgba(2, 6, 23, 0.5);
}
.global-chat-msg-file {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
  font-size: 0.84rem;
  font-weight: 600;
  color: #93c5fd;
  text-decoration: none;
  word-break: break-all;
}
.global-chat-msg-file:hover {
  text-decoration: underline;
  color: #bfdbfe;
}
.global-chat-msg-caption {
  margin-top: 6px;
  font-size: 0.86rem;
  line-height: 1.55;
  color: #f8fafc;
  white-space: pre-wrap;
  word-break: break-word;
}
.global-chat-msg--flagged .global-chat-msg-bubble {
  outline: 1px solid rgba(248, 113, 113, 0.45);
  outline-offset: 1px;
}
.global-chat-msg-flag {
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #fecaca;
  background: rgba(127, 29, 29, 0.5);
  border: 1px solid rgba(248, 113, 113, 0.55);
  border-radius: 999px;
  padding: 2px 8px;
  flex-shrink: 0;
}
