/* ── File bubbles ────────────────────────────────────────────── */
.file-wrapper {
  display: inline-flex;
  flex-direction: column;
  max-width: 320px;
}

.file-bubble {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.6rem 0.8rem;
  background: var(--surface);
  border: 1px solid var(--border-md);
  cursor: pointer;
  transition: border-color 0.12s;
  max-width: 320px;
}
.file-bubble:hover              { border-color: var(--accent); }
.msg-group.is-me .file-bubble   { background: rgba(224,122,95,0.1); }

.file-icon { font-size: 1.5rem; flex-shrink: 0; line-height: 1; }
.file-info { display: flex; flex-direction: column; gap: 0.1rem; min-width: 0; }

.file-name {
  font-size: 0.83rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 220px;
  color: var(--text);
}
.file-size   { font-size: 0.68rem; color: var(--muted); }
.file-action { font-size: 0.7rem; color: var(--accent); margin-top: 0.1rem; }

.dl-progress {
  height: 3px;
  background: var(--border-md);
  margin-top: 0.3rem;
  overflow: hidden;
  display: none;
}
.dl-progress-bar {
  height: 100%;
  background: var(--accent);
  width: 0%;
  transition: width 0.1s;
}

/* ── Audio player ────────────────────────────────────────────── */
.audio-player {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--surface);
  border: 1px solid var(--border-md);
  padding: 0.55rem 0.75rem;
  max-width: 340px;
}
.audio-icon { font-size: 1.2rem; flex-shrink: 0; line-height: 1; }
.audio-col  { display: flex; flex-direction: column; gap: 0.2rem; flex: 1; min-width: 0; }
.audio-label {
  font-size: 0.72rem;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.audio-col audio { width: 100%; height: 28px; accent-color: var(--accent); }
.audio-dl {
  font-size: 0.9rem;
  color: var(--muted);
  text-decoration: none;
  flex-shrink: 0;
  padding: 0.15rem;
  transition: color 0.1s;
}
.audio-dl:hover { color: var(--accent); }

/* ── PDF bubble ──────────────────────────────────────────────── */
.pdf-bubble {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  background: var(--surface);
  border: 1px solid var(--border-md);
  padding: 0.65rem 0.85rem;
  max-width: 300px;
  cursor: pointer;
  transition: border-color 0.12s;
}
.pdf-bubble:hover { border-color: var(--accent); }
.pdf-icon { font-size: 1.8rem; line-height: 1; flex-shrink: 0; }
.pdf-info { display: flex; flex-direction: column; gap: 0.2rem; min-width: 0; }
.pdf-name {
  font-size: 0.83rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 200px;
}
.pdf-hint { font-size: 0.7rem; color: var(--accent); }

/* ── PDF fullscreen overlay ──────────────────────────────────── */
.pdf-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--bg);
  display: flex;
  flex-direction: column;
}
.pdf-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.55rem 1rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  gap: 1rem;
  flex-shrink: 0;
}
.pdf-toolbar-title {
  font-size: 0.88rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}
.pdf-toolbar-btn {
  padding: 0.3rem 0.75rem;
  background: var(--accent);
  border: none;
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
  font-family: var(--font);
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.12s;
}
.pdf-toolbar-btn:hover { background: var(--accent-dk); }
.pdf-iframe { flex: 1; border: none; width: 100%; }

/* ── Media lightbox ──────────────────────────────────────────── */
.media-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(20, 17, 18, 0.95);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}
.media-overlay img   { max-width: 90vw; max-height: 80vh; object-fit: contain; display: block; }
.media-overlay video { max-width: 90vw; max-height: 80vh; }

.media-overlay-audio {
  background: var(--surface);
  border: 1px solid var(--border-md);
  padding: 1.75rem 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.9rem;
  min-width: 320px;
}
.media-overlay-audio-name {
  font-size: 0.88rem;
  color: var(--muted);
  text-align: center;
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.media-overlay-audio audio { width: 100%; accent-color: var(--accent); }

.media-overlay-bar { display: flex; gap: 0.75rem; align-items: center; }
.media-overlay-dl {
  color: var(--muted);
  font-size: 0.82rem;
  text-decoration: none;
  transition: color 0.1s;
}
.media-overlay-dl:hover { color: var(--accent); }
.media-overlay-close {
  padding: 0.3rem 0.85rem;
  background: var(--surface2);
  border: 1px solid var(--border-md);
  color: var(--text);
  font-size: 0.82rem;
  font-family: var(--font);
  cursor: pointer;
  transition: background 0.12s;
}
.media-overlay-close:hover { background: var(--surface3); }
