/* File attachment type badges */

.file-badge {
  --fc-ink: #2563eb;
  --fc-soft: #dbeafe;
  --fc-band: #1d4ed8;
  position: relative;
  display: flex;
  flex-direction: column;
  width: 44px;
  height: 52px;
  border-radius: 10px;
  overflow: hidden;
  background: var(--fc-soft);
  color: var(--fc-ink);
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.05);
  flex-shrink: 0;
}

.file-badge::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 12px;
  height: 12px;
  background: linear-gradient(135deg, transparent 50%, rgba(15, 23, 42, 0.1) 50%);
}

.file-badge__glyph {
  flex: 1;
  display: grid;
  place-items: center;
  padding-top: 2px;
}

.file-badge__ext {
  display: block;
  text-align: center;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1;
  padding: 4px 2px 5px;
  color: #fff;
  background: var(--fc-band);
}

.file-badge[data-ext-family="pdf"] {
  --fc-ink: #dc2626;
  --fc-soft: #fee2e2;
  --fc-band: #b91c1c;
}

.file-badge[data-ext-family="ppt"] {
  --fc-ink: #ea580c;
  --fc-soft: #ffedd5;
  --fc-band: #c2410c;
}

.file-badge[data-ext-family="doc"] {
  --fc-ink: #2563eb;
  --fc-soft: #dbeafe;
  --fc-band: #1d4ed8;
}

.file-badge[data-ext-family="xls"] {
  --fc-ink: #16a34a;
  --fc-soft: #dcfce7;
  --fc-band: #15803d;
}

.file-badge[data-ext-family="zip"] {
  --fc-ink: #7c3aed;
  --fc-soft: #ede9fe;
  --fc-band: #6d28d9;
}

.file-badge[data-ext-family="txt"] {
  --fc-ink: #475569;
  --fc-soft: #f1f5f9;
  --fc-band: #334155;
}

.file-badge[data-ext-family="video"] {
  --fc-ink: #db2777;
  --fc-soft: #fce7f3;
  --fc-band: #be185d;
}

.file-chip {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 2px;
  text-decoration: none;
  color: inherit;
  min-width: 0;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.file-chip__body {
  min-width: 0;
  flex: 1;
}

.file-chip__name {
  display: block;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
}

.file-chip__meta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 3px;
  font-size: 13px;
  color: var(--accent);
}

.file-chip__action {
  font-weight: 600;
}

.file-chip__sep {
  color: var(--text-muted);
}

.file-chip__size {
  color: var(--text-muted);
  font-weight: 500;
}

.bubble:has(.file-chip) {
  padding-bottom: 26px;
}

.bubble:has(.file-chip) .bubble__meta {
  position: absolute;
  right: 12px;
  bottom: 8px;
}

.msg--out .bubble:has(.file-chip) {
  background: var(--surface);
  color: var(--text);
}

html[data-theme="dark"] .file-chip__name {
  color: var(--text);
}

html[data-theme="dark"] .msg--out .bubble:has(.file-chip) {
  background: var(--surface-2);
}

.chat-row__preview-icon {
  color: var(--accent);
}

.chat-row.is-unread .chat-row__preview-icon {
  color: var(--accent);
}
