#files {
  position: fixed;
  right: 20px;
  bottom: calc(var(--dock-bottom) + 90px);
  z-index: 25;
  display: none;
  flex-direction: column;
  gap: 10px;
  width: min(380px, calc(100vw - 32px));
  height: min(60vh, 480px);
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--glass);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
  animation: pop .2s ease both;
}

body.files-open.joined #files {
  display: flex;
}

#fileList {
  flex: 1;
  min-height: 0;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
  line-height: 1.4;
}

#fileList:empty::before {
  content: "…";
  margin: auto;
  color: var(--muted);
}

.file {
  display: flex;
  gap: 8px;
  align-items: center;
}

.file.dim {
  opacity: .6;
}

.file .who {
  flex: none;
  min-width: 2ch;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: .03em;
  cursor: default;
}

.fname {
  flex: 1;
  min-width: 0;
  padding: 0;
  overflow: hidden;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
  font: inherit;
  color: var(--text);
  border: 0;
  background: none;
}

.fname:not(:disabled) {
  color: var(--accent);
  text-decoration: underline;
  cursor: pointer;
}

.fsize,
.fstate {
  flex: none;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}

.fstate.bad {
  color: var(--danger);
}

.fact,
.fdel {
  flex: none;
  width: 28px;
  height: 28px;
  font-size: 13px;
}

.fact[hidden] {
  display: none;
}

.fact::after,
.fdel::after {
  display: none;
}

#fileNote {
  flex: none;
  padding: 8px 10px;
  font-size: 12px;
  line-height: 1.4;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-strong);
}

#fileNote[hidden] {
  display: none;
}

#fileBrowse {
  width: 100%;
  padding: 10px 14px;
  font: inherit;
  font-weight: 600;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-strong);
  cursor: pointer;
  transition: transform .15s, background .15s, opacity .15s;
}

/* The same hover and press feel as the round buttons (.icon-btn in controls.css). */
#fileBrowse:hover:not(:disabled) {
  transform: translateY(-2px);
  background: var(--surface);
}

#fileBrowse:active:not(:disabled) {
  transform: scale(.96);
}

#fileBrowse:disabled {
  opacity: .5;
}

#filesToggle.unread::before {
  content: "";
  position: absolute;
  top: 2px;
  right: 2px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent-2);
  box-shadow: 0 0 0 2px var(--bg);
}
